@zydon/common 1.0.37 → 1.0.38
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Editor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6BjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-
|
|
1
|
+
import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-3c0b738b.js";
|
|
2
2
|
import Hn, { useContext as ie, useId as Pi, useEffect as Ti } from "react";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "@emotion/react";
|
|
@@ -5605,7 +5605,7 @@ const iD = (t, e, n) => {
|
|
|
5605
5605
|
...r,
|
|
5606
5606
|
children: n
|
|
5607
5607
|
}
|
|
5608
|
-
), oD = () => import("./features-
|
|
5608
|
+
), oD = () => import("./features-c7963e76.js").then((t) => t.default), sD = ({ children: t }) => /* @__PURE__ */ N.jsx(H1, { strict: !0, features: oD, children: /* @__PURE__ */ N.jsxs(In.div, { style: { height: "100%" }, children: [
|
|
5609
5609
|
" ",
|
|
5610
5610
|
t,
|
|
5611
5611
|
" "
|
|
@@ -84020,12 +84020,18 @@ const Mre = Gt("div")(() => ({
|
|
|
84020
84020
|
name: t,
|
|
84021
84021
|
control: a,
|
|
84022
84022
|
rules: n,
|
|
84023
|
-
render: ({
|
|
84023
|
+
render: ({
|
|
84024
|
+
field: { name: i, onBlur: o, onChange: s, value: l },
|
|
84025
|
+
fieldState: { error: c }
|
|
84026
|
+
}) => /* @__PURE__ */ N.jsx(
|
|
84024
84027
|
xne,
|
|
84025
84028
|
{
|
|
84026
|
-
|
|
84027
|
-
|
|
84028
|
-
|
|
84029
|
+
id: `quill${i}`,
|
|
84030
|
+
onBlur: o,
|
|
84031
|
+
onChange: s,
|
|
84032
|
+
value: l,
|
|
84033
|
+
error: !!c,
|
|
84034
|
+
helperText: (c == null ? void 0 : c.message) || e,
|
|
84029
84035
|
...r
|
|
84030
84036
|
}
|
|
84031
84037
|
)
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a1 as p, aj as c, ak as v, am as u, a2 as d, a3 as C, a4 as k, a5 as S, a6 as T, an as P, ao as g, ap as A, a7 as F, aF as I, a8 as M, aq as h, aH as f, ar as D, as as B, aI as x, a9 as E, aa as N, ab as y, ac as U, ad as R, at as w, b1 as H, ae as L, aK as z, aL as G, aJ as V, al as W, ay as j, az as q, aA as K, au as O, af as Z, ag as J, ah as Q, b2 as X, b3 as Y, av as _, aM as $, aG as aa, ai as sa, aw as ea, b4 as oa, aB as ra, aC as ta, aD as ia, aE as na, ax as la, b5 as ba, bj as ma, b6 as pa, bg as ca, bh as va, bi as ua, bl as da, bk as Ca, b8 as ka, b9 as Sa, ba as Ta, bb as Pa, bc as ga, bd as Aa, b7 as Fa, be as Ia, bf as Ma, a_ as ha, a$ as fa, b0 as Da, aT as Ba, aW as xa, aO as Ea, aQ as Na, aV as ya, aN as Ua, aU as Ra, aS as wa, aR as Ha, aY as La, aZ as za, aX as Ga, aP as Va } from "./index-
|
|
1
|
+
import { a1 as p, aj as c, ak as v, am as u, a2 as d, a3 as C, a4 as k, a5 as S, a6 as T, an as P, ao as g, ap as A, a7 as F, aF as I, a8 as M, aq as h, aH as f, ar as D, as as B, aI as x, a9 as E, aa as N, ab as y, ac as U, ad as R, at as w, b1 as H, ae as L, aK as z, aL as G, aJ as V, al as W, ay as j, az as q, aA as K, au as O, af as Z, ag as J, ah as Q, b2 as X, b3 as Y, av as _, aM as $, aG as aa, ai as sa, aw as ea, b4 as oa, aB as ra, aC as ta, aD as ia, aE as na, ax as la, b5 as ba, bj as ma, b6 as pa, bg as ca, bh as va, bi as ua, bl as da, bk as Ca, b8 as ka, b9 as Sa, ba as Ta, bb as Pa, bc as ga, bd as Aa, b7 as Fa, be as Ia, bf as Ma, a_ as ha, a$ as fa, b0 as Da, aT as Ba, aW as xa, aO as Ea, aQ as Na, aV as ya, aN as Ua, aU as Ra, aS as wa, aR as Ha, aY as La, aZ as za, aX as Ga, aP as Va } from "./index-3c0b738b.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "@emotion/react";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -287,7 +287,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=U,M=Q),$===void 0&&(
|
|
|
287
287
|
border-left: 0;
|
|
288
288
|
border-right: 0;
|
|
289
289
|
}
|
|
290
|
-
`,Hse=1,zse=3,Wse=function(t){Ose(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.imageRef=C.createRef(),n.videoRef=C.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=Gse(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=i.crop,o=i.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var s=qse(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=s.crop,o=s.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var r,i,a,o,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var u=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((a=n.imageRef.current)===null||a===void 0?void 0:a.naturalHeight)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c.offsetWidth<d||c.offsetHeight<p,m=d/p,_=void 0;if(f){var g=n.getObjectFit();switch(g){default:case"contain":_=u>m?{width:n.containerRect.height*m,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/m};break;case"horizontal-cover":_={width:n.containerRect.width,height:n.containerRect.width/m};break;case"vertical-cover":_={width:n.containerRect.height*m,height:n.containerRect.height};break}}else _={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=Xt(Xt({},_),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:Lse(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==h.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==h.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(e.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(e.getMousePoint(r))},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(e.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(e.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=e.getMousePoint(r),a=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var o=n.gestureRotationStart+r.rotation;n.props.onRotationChange(o)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,a,o=r.x,s=r.y;n.dragStartPosition={x:o,y:s},n.dragStartCrop=Xt({},n.props.crop),(a=(i=n.props).onInteractionStart)===null||a===void 0||a.call(i)},n.onDrag=function(r){var i=r.x,a=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||a===void 0)){var o=i-n.dragStartPosition.x,s=a-n.dragStartPosition.y,l={x:n.dragStartCrop.x+o,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?fc(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=e.getMousePoint(r),a=Pse(r).pixelY,o=n.props.zoom-a*n.props.zoomSpeed/200;n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r){var i=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(i-n.containerRect.left),y:n.containerRect.height/2-(a-n.containerRect.top)}},n.getPointOnMedia=function(r){var i=r.x,a=r.y,o=n.props,s=o.crop,l=o.zoom;return{x:(i+s.x)/l,y:(a+s.y)/l}},n.setNewZoom=function(r,i,a){var o=a===void 0?{}:a,s=o.shouldUpdatePosition,l=s===void 0?!0:s;if(!(!n.state.cropSize||!n.props.onZoomChange)){var c=_c(r,n.props.minZoom,n.props.maxZoom);if(l){var u=n.getPointOnContainer(i),d=n.getPointOnMedia(u),p={x:d.x*c-u.x,y:d.y*c-u.y},f=n.props.restrictPosition?fc(p,n.mediaSize,n.state.cropSize,c,n.props.rotation):p;n.props.onCropChange(f)}n.props.onZoomChange(c)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?fc(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return Fse(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,a),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,a)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,a)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?fc(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return e.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Vse,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},e.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},e.prototype.componentDidUpdate=function(n){var r,i,a,o,s,l,c,u,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((a=n.cropSize)===null||a===void 0?void 0:a.width)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load())},e.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},e.prototype.getObjectFit=function(){var n,r,i,a;if(this.props.objectFit==="cover"){var o=this.imageRef.current||this.videoRef.current;if(o&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,c=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,u=l/c;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},e.prototype.onPinchStart=function(n){var r=e.getTouchPoint(n.touches[0]),i=e.getTouchPoint(n.touches[1]);this.lastPinchDistance=C1(r,i),this.lastPinchRotation=R1(r,i),this.onDragStart(N1(r,i))},e.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=e.getTouchPoint(n.touches[0]),a=e.getTouchPoint(n.touches[1]),o=N1(i,a);this.onDrag(o),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=C1(i,a),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,o,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=R1(i,a),u=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(u),r.lastPinchRotation=c})}},e.prototype.render=function(){var n=this,r=this.props,i=r.image,a=r.video,o=r.mediaProps,s=r.transform,l=r.crop,c=l.x,u=l.y,d=r.rotation,p=r.zoom,f=r.cropShape,m=r.showGrid,_=r.style,g=_.containerStyle,h=_.cropAreaStyle,E=_.mediaStyle,v=r.classes,b=v.containerClassName,S=v.cropAreaClassName,O=v.mediaClassName,y=this.getObjectFit();return C.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(A){return n.containerRef=A},"data-testid":"container",style:g,className:mc("reactEasyCrop_Container",b)},i?C.createElement("img",Xt({alt:"",className:mc("reactEasyCrop_Image",y==="contain"&&"reactEasyCrop_Contain",y==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",y==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},o,{src:i,ref:this.imageRef,style:Xt(Xt({},E),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):a&&C.createElement("video",Xt({autoPlay:!0,loop:!0,muted:!0,className:mc("reactEasyCrop_Video",y==="contain"&&"reactEasyCrop_Contain",y==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",y==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Xt(Xt({},E),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(T){return C.createElement("source",Xt({key:T.src},T))})),this.state.cropSize&&C.createElement("div",{style:Xt(Xt({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:mc("reactEasyCrop_CropArea",f==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",S)}))},e.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:zse,minZoom:Hse,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},e.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e}(C.Component);const jse=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function A1(t){return t*Math.PI/180}function Kse(t,e,n){const r=A1(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function Qse(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await jse(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=A1(n),{width:l,height:c}=Kse(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,p)=>{a.toBlob(f=>{d(f)},"image/png")})}const I1=({title:t,open:e,onClose:n,onFileCropped:r,image:{width:i,height:a,aspect:o,imgSrc:s=""}})=>{const[l,c]=C.useState({x:0,y:0}),[u,d]=C.useState(1),p=C.useRef(),f=C.useRef(),m=async(h,E)=>{try{const v=await Qse(s,E,0);p.current=new File([v],"image.png",{type:v.type})}catch{r(void 0)}},_=async()=>{r(f.current),n()},g=()=>{r(p.current),f.current=p.current,n()};return w.jsxs(ne.Dialog,{open:e,scroll:"body",PaperProps:{sx:{maxWidth:"100%"}},children:[w.jsx(ne.DialogTitle,{children:t}),w.jsx(ne.DialogContent,{children:w.jsx(ne.Stack,{position:"relative",alignItems:"center",justifyContent:"center",style:{position:"relative",width:i*1.1,height:a*1.1,margin:"auto"},children:w.jsx(Wse,{image:s,crop:l,zoom:u,minZoom:1,maxZoom:5,cropSize:{width:i,height:a},aspect:o,onCropChange:c,onZoomChange:d,onCropComplete:m,objectFit:"horizontal-cover"})})}),w.jsxs(ne.DialogActions,{children:[w.jsxs(ne.Stack,{direction:"row",gap:3,flex:1,alignItems:"center",maxWidth:200,mr:"auto",children:[w.jsx(ne.Typography,{variant:"body1",children:"Zoom"}),w.jsx(ne.Slider,{value:u,onChange:(h,E)=>d(Array.isArray(E)?E[0]:E),min:1,max:5,size:"medium",step:.5})]}),w.jsx(ne.Button,{variant:"soft",size:"medium",onClick:_,children:"Descartar"}),w.jsx(ne.Button,{variant:"contained",size:"medium",onClick:g,children:"Salvar"})]})]})},Xse=$t(ne.Box)(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=e.variant==="filled",i=e.variant==="outlined",a=e.variant==="soft",o={...e.color==="default"&&{...i&&{backgroundColor:"transparent",color:t.palette.text.primary,border:`1px solid ${Ee(t.palette.grey[500],.32)}`},...a&&{color:n?t.palette.text.primary:t.palette.common.white,backgroundColor:Ee(t.palette.grey[500],.16)}}},s={...e.color!=="default"&&{...r&&{color:t.palette[e.color].contrastText,backgroundColor:t.palette[e.color].main},...i&&{backgroundColor:"transparent",color:t.palette[e.color].main,border:`1px solid ${t.palette[e.color].main}`},...a&&{color:t.palette[e.color][n?"dark":"light"],backgroundColor:Ee(t.palette[e.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...o}}),x1=C.forwardRef(({children:t,color:e="default",variant:n="soft",startIcon:r,endIcon:i,sx:a,...o},s)=>{const l=Ur(),c={width:16,height:16,"& svg, img":{width:1,height:1,objectFit:"cover"}};return w.jsxs(Xse,{ref:s,component:"span",ownerState:{color:e,variant:n},sx:{...r&&{pl:.75},...i&&{pr:.75},...a},theme:l,...o,children:[r&&w.jsxs(ne.Box,{sx:{mr:.75,...c},children:[" ",r," "]}),t,i&&w.jsxs(ne.Box,{sx:{ml:.75,...c},children:[" ",i," "]})]})});x1.displayName="Label";function Nr(t){return typeof t=="string"||t instanceof String}function w1(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function D1(t,e){return Array.isArray(e)?D1(t,(n,r)=>e.includes(r)):Object.entries(t).reduce((n,r)=>{let[i,a]=r;return e(a,i)&&(n[i]=a),n},{})}const Pe={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Zse(t){switch(t){case Pe.LEFT:return Pe.FORCE_LEFT;case Pe.RIGHT:return Pe.FORCE_RIGHT;default:return t}}function lh(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function gc(t,e){if(e===t)return!0;const n=Array.isArray(e),r=Array.isArray(t);let i;if(n&&r){if(e.length!=t.length)return!1;for(i=0;i<e.length;i++)if(!gc(e[i],t[i]))return!1;return!0}if(n!=r)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const a=e instanceof Date,o=t instanceof Date;if(a&&o)return e.getTime()==t.getTime();if(a!=o)return!1;const s=e instanceof RegExp,l=t instanceof RegExp;if(s&&l)return e.toString()==t.toString();if(s!=l)return!1;const c=Object.keys(e);for(i=0;i<c.length;i++)if(!Object.prototype.hasOwnProperty.call(t,c[i]))return!1;for(i=0;i<c.length;i++)if(!gc(t[c[i]],e[c[i]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class Jse{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Pe.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Pe.RIGHT:Pe.LEFT}}function Ge(t,e){return new Ge.InputMask(t,e)}function M1(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?Ge.MaskedRegExp:Nr(t)?Ge.MaskedPattern:t===Date?Ge.MaskedDate:t===Number?Ge.MaskedNumber:Array.isArray(t)||t===Array?Ge.MaskedDynamic:Ge.Masked&&t.prototype instanceof Ge.Masked?t:Ge.Masked&&t instanceof Ge.Masked?t.constructor:t instanceof Function?Ge.MaskedFunction:(console.warn("Mask not found for mask",t),Ge.Masked)}function hc(t){if(!t)throw new Error("Options in not defined");if(Ge.Masked){if(t.prototype instanceof Ge.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof Ge.Masked?{mask:t}:w1(t)&&t.mask instanceof Ge.Masked?t:{};if(e){const r=e.mask;return{...D1(e,(i,a)=>!a.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return w1(t)?{...t}:{mask:t}}function si(t){if(Ge.Masked&&t instanceof Ge.Masked)return t;const e=hc(t),n=M1(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}Ge.createMask=si;class ch{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}Ge.MaskElement=ch;class li extends ch{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,r;return(e=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(li.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}li.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},Ge.HTMLMaskElement=li;class ele extends li{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}Ge.HTMLMaskElement=li;class P1 extends li{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Ge.HTMLContenteditableMaskElement=P1;class tle{constructor(e,n){this.el=e instanceof ch?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new P1(e):new ele(e),this.masked=si(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof Ge.Masked)&&this.masked.constructor===M1(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof Ge.Masked?e:si({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const r=this._listeners[e];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,r=this.displayValue,i=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==r&&(this.el.value=r),i&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...r}=e,i=!this.maskEquals(n),a=!gc(this.masked,r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Pe.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(n);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new Jse({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:Pe.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Pe.NONE&&(o=this.masked.nearestInputPos(o,Pe.NONE)),this.updateControl(),this.updateCursor(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}Ge.InputMask=tle;class gt{static normalize(e){return Array.isArray(e)?e:[e,new gt]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}Ge.ChangeDetails=gt;class cr{constructor(e,n,r){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class gn{constructor(e){this._value="",this._update({...gn.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new cr(this.extractInput(e,n),e)}appendTail(e){return Nr(e)&&(e=new cr(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new gt({inserted:e,rawInserted:e})):new gt}_appendChar(e,n,r){n===void 0&&(n={});const i=this.state;let a;if([e,a]=this.doPrepareChar(e,n),a=a.aggregate(this._appendCharRaw(e,n)),a.inserted){let o,s=this.doValidate(n)!==!1;if(s&&r!=null){const l=this.state;this.overwrite===!0&&(o=r.state,r.unshift(this.displayValue.length-a.tailShift));let c=this.appendTail(r);s=c.rawInserted===r.toString(),!(s&&c.inserted)&&this.overwrite==="shift"&&(this.state=l,o=r.state,r.shift(),c=this.appendTail(r),s=c.rawInserted===r.toString()),s&&c.inserted&&(this.state=l)}s||(a=new gt,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new gt}_appendEager(){return new gt}append(e,n,r){if(!Nr(e))throw new Error("value should be string");const i=Nr(r)?new cr(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,n);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],n,i);if(!s.rawInserted&&!this.doSkipInvalid(e[o],n,i))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new gt}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=e();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&this.append(r.slice(this.displayValue.length),{},""),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,r=e(this);return this.state=n,delete this._isolated,r}doSkipInvalid(e,n,r){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),gt.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),gt.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,r,i,a){i===void 0&&(i=Pe.NONE),a===void 0&&(a={input:!0});const o=e+n,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(i=Zse(i),c=this.extractInput(0,o,{raw:!0}));let u=e;const d=new gt;if(i!==Pe.NONE&&(u=this.nearestInputPos(e,n>1&&e!==0&&!l?Pe.NONE:i),d.tailShift=u-e),d.aggregate(this.remove(u)),l&&i!==Pe.NONE&&c===this.rawInputValue)if(i===Pe.FORCE_LEFT){let p;for(;c===this.rawInputValue&&(p=this.displayValue.length);)d.aggregate(new gt({tailShift:-1})).aggregate(this.remove(p-1))}else i===Pe.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(r,a,s))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||gn.EMPTY_VALUES.includes(e)&&gn.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}gn.DEFAULTS={skipInvalid:!0},gn.EMPTY_VALUES=[void 0,null,""],Ge.Masked=gn;class ci{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Nr(e)?new cr(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof cr)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof ci){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Ge.MaskedPattern))return new cr(this.toString()).appendTo(e);const n=new gt;for(let r=0;r<this.chunks.length&&!n.skip;++r){const i=this.chunks[r],a=e._mapPosToBlock(e.displayValue.length),o=i.stop;let s;if(o!=null&&(!a||a.index<=o)){if(i instanceof ci||e._stops.indexOf(o)>=0){const l=e._appendPlaceholder(o);n.aggregate(l)}s=i instanceof ci&&e._blocks[o]}if(s){const l=s.appendTail(i);l.skip=!1,n.aggregate(l),e._value+=l.inserted;const c=i.toString().slice(l.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...r}=e;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new ci:new cr;return a.state=i,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],r=n.shift();if(n.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class nle{constructor(e,n){this.masked=e,this._log=[];const{offset:r,index:i}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Pe.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pe.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pe.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Pe.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pe.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pe.NONE),!0})}}class L1{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new gt}nearestInputPos(e,n){n===void 0&&(n=Pe.NONE);const r=0,i=this._value.length;switch(n){case Pe.LEFT:case Pe.FORCE_LEFT:return r;case Pe.NONE:case Pe.RIGHT:case Pe.FORCE_RIGHT:default:return i}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const r=new gt;if(this.isFilled)return r;const i=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!i)&&!n.tail;return o&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new gt;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new cr("")}appendTail(e){return Nr(e)&&(e=new cr(String(e))),e.appendTo(this)}append(e,n,r){const i=this._appendChar(e[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class Ec{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s,...l}=e;this.masked=si(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new gt}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new gt;const r=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i.inserted=i.rawInserted="",this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,n,r){return this.masked.append(e,this.currentMaskFlags(n),r)}_appendPlaceholder(){const e=new gt;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new gt}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,r)}nearestInputPos(e,n){n===void 0&&(n=Pe.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(e,r),i);switch(n){case Pe.LEFT:case Pe.FORCE_LEFT:return this.isComplete?a:r;case Pe.RIGHT:case Pe.FORCE_RIGHT:return this.isComplete?a:i;case Pe.NONE:default:return a}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||(e==null?void 0:e._beforeTailState)}}}Ec.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class rle extends gn{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}Ge.MaskedRegExp=rle;class hn extends gn{constructor(e){super({...hn.DEFAULTS,...e,definitions:Object.assign({},Ec.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const c=n.slice(a),u=Object.keys(this.blocks).filter(p=>c.indexOf(p)===0);u.sort((p,f)=>f.length-p.length);const d=u[0];if(d){const{expose:p,...f}=hc(this.blocks[d]),m=si({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...f,parent:this});m&&(this._blocks.push(m),p&&(this.exposeBlock=m),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),a+=d.length-1;continue}}let o=n[a],s=o in e;if(o===hn.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===hn.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}const l=s?new Ec({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...hc(e[o]),parent:this}):new L1({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...r}=e;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new gt;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new gt;if(!r)return i;for(let o=r.index;;++o){var a;const s=this._blocks[o];if(!s)break;const l=s._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]}),c=l.skip;if(i.aggregate(l),c||l.rawInserted)break}return i}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=new ci;return e===n||this._forEachBlocksInRange(e,n,(i,a,o,s)=>{const l=i.extractTail(o,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof ci&&(l.blockIndex=a),r.extend(l)}),r}extractInput(e,n,r){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),e===n)return"";let i="";return this._forEachBlocksInRange(e,n,(a,o,s,l)=>{i+=a.extractInput(s,l,r)}),i}_findStopBefore(e){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=e)n=i;else break}return n}_appendPlaceholder(e){const n=new gt;if(this.lazy&&e==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=e??this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||e!=null){var s;const l=o._appendPlaceholder((s=o._blocks)==null?void 0:s.length);this._value+=l.inserted,n.aggregate(l)}}),n}_mapPosToBlock(e){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,e<=n.length)return{index:r,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(e,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,s=i.offset,l=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,s,l),a&&!o){for(let c=i.index+1;c<a.index;++c)r(this._blocks[c],c,0,this._blocks[c].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r.aggregate(i.remove(o,s))}),r}nearestInputPos(e,n){if(n===void 0&&(n=Pe.NONE),!this._blocks.length)return 0;const r=new nle(this,e);if(n===Pe.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Pe.LEFT||n===Pe.FORCE_LEFT){if(n===Pe.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Pe.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:n===Pe.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Pe.RIGHT||n===Pe.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Pe.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,Pe.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r+=i.totalInputPositions(o,s)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(r=>this._blocks[r]):[]}}hn.DEFAULTS={lazy:!0,placeholderChar:"_"},hn.STOP_CHAR="`",hn.ESCAPE_CHAR="\\",hn.InputDefinition=Ec,hn.FixedDefinition=L1,Ge.MaskedPattern=hn;class bc extends hn{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=e;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===s[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",r="";const[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(e,n){n===void 0&&(n={});let r;if([e,r]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,r];const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),o=this.value+e;if(o.length>this.maxLength)return["",r];const[s,l]=this.boundaries(o);return Number(l)<this.from?[i[o.length-1],r]:Number(s)>this.to?this.autofix==="pad"&&o.length<this.maxLength?["",r.aggregate(this.append(i[o.length-1]+e,n))]:[a[o.length-1],r]:[e,r]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(e)}}Ge.MaskedRange=bc;class ui extends hn{constructor(e){const{mask:n,pattern:r,...i}={...ui.DEFAULTS,...e};super({...i,mask:Nr(n)?n:r})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...a}={...ui.DEFAULTS,...e},o=Object.assign({},ui.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,i),Object.keys(o).forEach(s=>{const l=o[s];!("autofix"in l)&&"autofix"in e&&(l.autofix=e.autofix)}),super._update({...a,mask:Nr(n)?n:r,blocks:o})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}ui.GET_DEFAULT_BLOCKS=()=>({d:{mask:bc,from:1,to:31,maxLength:2},m:{mask:bc,from:1,to:12,maxLength:2},Y:{mask:bc,from:1900,to:9999}}),ui.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear();return[n,r,i].join(".")},parse:(t,e)=>{const[n,r,i]=t.split(".").map(Number);return new Date(i,r-1,n)}},Ge.MaskedDate=ui;class Ko extends gn{constructor(e){super({...Ko.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:r,...i}=hc(n),a=si({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._applyDispatch(e,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),r}_applyDispatch(e,n,r){e===void 0&&(e=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,s=a.slice(o.length),l=this.currentMask,c=new gt,u=l==null?void 0:l.state;if(this.currentMask=this.doDispatch(e,{...n},r),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),o){const d=this.currentMask.append(o,{raw:!0});c.tailShift=d.inserted.length-i.length}s&&(c.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)}else u&&(this.currentMask.state=u);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new gt;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,r;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(e,this,n,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[r,i]=super.doPrepare(e,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(e,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(e,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const r=new gt;return this.currentMask&&r.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=e;n&&this.compiledMasks.forEach((o,s)=>o.state=n[s]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(e,n,r){return this.currentMask?this.currentMask.extractInput(e,n,r):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,r)=>{if(!e[r])return;const{mask:i,...a}=e[r];return gc(n,a)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}Ko.DEFAULTS=void 0,Ko.DEFAULTS={dispatch:(t,e,n,r)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,a=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Pe.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(c),o.append(t,e.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,Pe.FORCE_LEFT)))}});return a.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[a[0].index]}},Ge.MaskedDynamic=Ko;class ile extends hn{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...r}=e;if(n){const i=n.map(s=>s.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}Ge.MaskedEnum=ile;class ale extends gn{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Ge.MaskedFunction=ale;class Tn extends gn{constructor(e){super({...Tn.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+lh(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(lh).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(lh(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(e,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,r))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return a.tailShift+=(s-i)*this.thousandsSeparator.length,a.skip=!a.rawInserted&&e===this.thousandsSeparator,a}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,n){const r=this._findSeparatorAround(e);r>=0&&(e=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const r=this.value.slice(0,e),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new gt({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case Pe.NONE:case Pe.LEFT:case Pe.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(e<i||this.value.length<=i||n===Pe.FORCE_LEFT)return r}break}case Pe.RIGHT:case Pe.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const r=this.number;n=n&&!isNaN(r)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,r){n===void 0&&(n={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Tn.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Tn.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Tn.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Tn.EMPTY_VALUES.includes(e)&&Tn.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Tn.UNMASKED_RADIX=".",Tn.EMPTY_VALUES=[...gn.EMPTY_VALUES,0],Tn.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Tn.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Ge.MaskedNumber=Tn;const uh={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function k1(t,e,n){e===void 0&&(e=uh.MASKED),n===void 0&&(n=uh.MASKED);const r=si(t);return i=>r.runIsolated(a=>(a[e]=i,a[n]))}function ole(t,e,n,r){return k1(e,n,r)(t)}Ge.PIPE_TYPE=uh,Ge.createPipe=k1,Ge.pipe=ole;try{globalThis.IMask=Ge}catch{}const F1={mask:J.oneOfType([J.array,J.func,J.string,J.instanceOf(RegExp),J.oneOf([Date,Number,Ge.Masked]),J.instanceOf(Ge.Masked)]),value:J.any,unmask:J.oneOfType([J.bool,J.oneOf(["typed"])]),prepare:J.func,prepareChar:J.func,validate:J.func,commit:J.func,overwrite:J.oneOfType([J.bool,J.oneOf(["shift"])]),eager:J.oneOfType([J.bool,J.oneOf(["append","remove"])]),skipInvalid:J.bool,onAccept:J.func,onComplete:J.func,placeholderChar:J.string,displayChar:J.string,lazy:J.bool,definitions:J.object,blocks:J.object,enum:J.arrayOf(J.string),maxLength:J.number,from:J.number,to:J.number,pattern:J.string,format:J.func,parse:J.func,autofix:J.oneOfType([J.bool,J.oneOf(["pad"])]),radix:J.string,thousandsSeparator:J.string,mapToRadix:J.arrayOf(J.string),scale:J.number,normalizeZeros:J.bool,padFractionalZeros:J.bool,min:J.oneOfType([J.number,J.instanceOf(Date)]),max:J.oneOfType([J.number,J.instanceOf(Date)]),dispatch:J.func,inputRef:J.oneOfType([J.func,J.shape({current:J.object})])},B1=Object.keys(F1).filter(t=>t!=="value"),sle=["value","unmask","onAccept","onComplete","inputRef"],lle=B1.filter(t=>sle.indexOf(t)<0);function cle(t){var e;const n=(e=class extends C.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Ge(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(s=>lle.indexOf(s)<0).forEach(s=>{delete o[s]}),o}_extractNonMaskProps(a){const{...o}=a;return B1.forEach(s=>{delete o[s]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return C.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),r=t.displayName||t.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=F1,C.forwardRef((i,a)=>C.createElement(n,{...i,ref:a}))}const ule=cle(t=>{let{inputRef:e,...n}=t;return C.createElement("input",{...n,ref:e})}),dle=(t,e)=>C.createElement(ule,{...t,ref:e});C.forwardRef(dle);function ple(t,e){let{onAccept:n,onComplete:r}=e===void 0?{}:e;const i=C.useRef(null),a=C.useRef(null),[o,s]=C.useState(!1),[l,c]=C.useState({}),[u,d]=C.useState(""),[p,f]=C.useState(""),[m,_]=C.useState(),g=C.useCallback(()=>{var v;o&&((v=a.current)==null||v.destroy(),a.current=null)},[]),h=C.useCallback(v=>{const b=a.current;b&&(c({value:b.value,unmaskedValue:b.unmaskedValue,typedValue:b.typedValue}),_(b.typedValue),f(b.unmaskedValue),d(b.value),n==null||n(b.value,b,v))},[n]),E=C.useCallback(()=>a.current&&(r==null?void 0:r(a.current.value,a.current)),[r]);return C.useEffect(()=>{const v=i.current;if(!v||!(t!=null&&t.mask))return g();const b=a.current;b?b==null||b.updateOptions(t):v&&t!=null&&t.mask&&(a.current=Ge(v,t),h()),s(!!a.current)},[t,g,h]),C.useEffect(()=>{if(!a.current)return;const v=a.current;return v.on("accept",h),v.on("complete",E),()=>{v.off("accept",h),v.off("complete",E)}},[h,E]),C.useEffect(()=>{const{value:v,...b}=l,S=a.current;S&&o&&(v!==u&&(S.value=u),c(b))},[u]),C.useEffect(()=>{const{unmaskedValue:v,...b}=l,S=a.current;S&&o&&(v!==p&&(S.unmaskedValue=p),c(b))},[p]),C.useEffect(()=>{const{typedValue:v,...b}=l,S=a.current;S&&o&&(v!==m&&(S.typedValue=m),c(b))},[m]),C.useEffect(()=>g,[g]),{ref:i,maskRef:a,value:u,setValue:d,unmaskedValue:p,setUnmaskedValue:f,typedValue:m,setTypedValue:_}}const dh=C.forwardRef(({name:t,value:e,mask:n,onChange:r,...i},a)=>{const{ref:o,unmaskedValue:s,value:l,maskRef:c}=ple({mask:n});return C.useEffect(()=>{c.current.value=e||""},[c,e]),C.useEffect(()=>{r({target:{name:t,value:s||e||""}})},[t,s,e]),w.jsx(ne.TextField,{inputRef:a,inputProps:{ref:o},name:t,value:l,onChange:()=>r({target:{name:t,value:s}}),...i})});dh.displayName="MaskedInput";function fle(t){let e;switch(t){case"top-left":e={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":e={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":e={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":e={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":e={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":e={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":e={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return e}const _le=$t("span")(({arrow:t,theme:e})=>{const i=`solid 1px ${Ee(e.palette.grey[500],.12)}`,a={borderRadius:"0 0 3px 0",top:-6,borderBottom:i,borderRight:i},o={borderRadius:"3px 0 0 0",bottom:-6,borderTop:i,borderLeft:i},s={borderRadius:"0 3px 0 0",left:-6,borderTop:i,borderRight:i},l={borderRadius:"0 0 0 3px",right:-6,borderBottom:i,borderLeft:i};return{display:"none",[e.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:'""',display:"block",position:"absolute",transform:"rotate(-135deg)",background:e.palette.background.paper},...t==="top-left"&&{...a,left:20},...t==="top-center"&&{...a,left:0,right:0,margin:"auto"},...t==="top-right"&&{...a,right:20},...t==="bottom-left"&&{...o,left:20},...t==="bottom-center"&&{...o,left:0,right:0,margin:"auto"},...t==="bottom-right"&&{...o,right:20},...t==="left-top"&&{...s,top:20},...t==="left-center"&&{...s,top:0,bottom:0,margin:"auto"},...t==="left-bottom"&&{...s,bottom:20},...t==="right-top"&&{...l,top:20},...t==="right-center"&&{...l,top:0,bottom:0,margin:"auto"},...t==="right-bottom"&&{...l,bottom:20}}}),mle=({open:t,children:e,arrow:n="top-right",disabledArrow:r,sx:i,...a})=>{const{style:o,anchorOrigin:s,transformOrigin:l}=fle(n);return w.jsxs(ne.Popover,{open:!!t,anchorEl:t,anchorOrigin:s,transformOrigin:l,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...o,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...i}},...a,children:[!r&&w.jsx(_le,{arrow:n}),e]})},gle=({children:t,container:e})=>Jo.createPortal(t,document.getElementById(e)||document.body);var hle=!!(typeof window<"u"&&window.document&&window.document.createElement),Ele=hle;const U1=jn(Ele);var Na=function(){return Na=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Na.apply(this,arguments)},Aa=null,G1=null;U1&&window.addEventListener("resize",function(){G1!==window.devicePixelRatio&&(G1=window.devicePixelRatio,Aa=null)});function $1(){if(Aa===null){if(typeof document>"u")return Aa=0,Aa;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var n=e.getBoundingClientRect().right;t.removeChild(e),Aa=n}return Aa}function q1(t){return!t||!t.ownerDocument||!t.ownerDocument.defaultView?window:t.ownerDocument.defaultView}function Y1(t){return!t||!t.ownerDocument?document:t.ownerDocument}var V1=function(t){var e={},n=Array.prototype.reduce.call(t,function(r,i){var a=i.name.match(/data-simplebar-(.+)/);if(a){var o=a[1].replace(/\W+(.)/g,function(s,l){return l.toUpperCase()});switch(i.value){case"true":r[o]=!0;break;case"false":r[o]=!1;break;case void 0:r[o]=!0;break;default:r[o]=i.value}}return r},e);return n};function H1(t,e){var n;t&&(n=t.classList).add.apply(n,e.split(" "))}function z1(t,e){t&&e.split(" ").forEach(function(n){t.classList.remove(n)})}function W1(t){return".".concat(t.split(" ").join("."))}var ble=Object.freeze({__proto__:null,getElementWindow:q1,getElementDocument:Y1,getOptions:V1,addClasses:H1,removeClasses:z1,classNamesToQuery:W1}),Ar=q1,ph=Y1,vle=V1,Ir=H1,xr=z1,on=W1,vc=function(){function t(e,n){n===void 0&&(n={});var r=this;if(this.removePreventClickId=null,this.minScrollbarWidth=20,this.stopScrollDelay=175,this.isScrolling=!1,this.isMouseEntering=!1,this.scrollXTicking=!1,this.scrollYTicking=!1,this.wrapperEl=null,this.contentWrapperEl=null,this.contentEl=null,this.offsetEl=null,this.maskEl=null,this.placeholderEl=null,this.heightAutoObserverWrapperEl=null,this.heightAutoObserverEl=null,this.rtlHelpers=null,this.scrollbarWidth=0,this.resizeObserver=null,this.mutationObserver=null,this.elStyles=null,this.isRtl=null,this.mouseX=0,this.mouseY=0,this.onMouseMove=function(){},this.onWindowResize=function(){},this.onStopScrolling=function(){},this.onMouseEntered=function(){},this.onScroll=function(){var i=Ar(r.el);r.scrollXTicking||(i.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(i.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0),r.isScrolling||(r.isScrolling=!0,Ir(r.el,r.classNames.scrolling)),r.showScrollbar("x"),r.showScrollbar("y"),r.onStopScrolling()},this.scrollX=function(){r.axis.x.isOverflowing&&r.positionScrollbar("x"),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&r.positionScrollbar("y"),r.scrollYTicking=!1},this._onStopScrolling=function(){xr(r.el,r.classNames.scrolling),r.options.autoHide&&(r.hideScrollbar("x"),r.hideScrollbar("y")),r.isScrolling=!1},this.onMouseEnter=function(){r.isMouseEntering||(Ir(r.el,r.classNames.mouseEntered),r.showScrollbar("x"),r.showScrollbar("y"),r.isMouseEntering=!0),r.onMouseEntered()},this._onMouseEntered=function(){xr(r.el,r.classNames.mouseEntered),r.options.autoHide&&(r.hideScrollbar("x"),r.hideScrollbar("y")),r.isMouseEntering=!1},this._onMouseMove=function(i){r.mouseX=i.clientX,r.mouseY=i.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this._onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.onPointerEvent=function(i){if(!(!r.axis.x.track.el||!r.axis.y.track.el||!r.axis.x.scrollbar.el||!r.axis.y.scrollbar.el)){var a,o;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(a=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(o=r.isWithinBounds(r.axis.y.track.rect)),(a||o)&&(i.stopPropagation(),i.type==="pointerdown"&&i.pointerType!=="touch"&&(a&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(i,"x"):r.onTrackClick(i,"x")),o&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(i,"y"):r.onTrackClick(i,"y"))))}},this.drag=function(i){var a,o,s,l,c,u,d,p,f,m,_;if(!(!r.draggedAxis||!r.contentWrapperEl)){var g,h=r.axis[r.draggedAxis].track,E=(o=(a=h.rect)===null||a===void 0?void 0:a[r.axis[r.draggedAxis].sizeAttr])!==null&&o!==void 0?o:0,v=r.axis[r.draggedAxis].scrollbar,b=(l=(s=r.contentWrapperEl)===null||s===void 0?void 0:s[r.axis[r.draggedAxis].scrollSizeAttr])!==null&&l!==void 0?l:0,S=parseInt((u=(c=r.elStyles)===null||c===void 0?void 0:c[r.axis[r.draggedAxis].sizeAttr])!==null&&u!==void 0?u:"0px",10);i.preventDefault(),i.stopPropagation(),r.draggedAxis==="y"?g=i.pageY:g=i.pageX;var O=g-((p=(d=h.rect)===null||d===void 0?void 0:d[r.axis[r.draggedAxis].offsetAttr])!==null&&p!==void 0?p:0)-r.axis[r.draggedAxis].dragOffset;O=r.draggedAxis==="x"&&r.isRtl?((m=(f=h.rect)===null||f===void 0?void 0:f[r.axis[r.draggedAxis].sizeAttr])!==null&&m!==void 0?m:0)-v.size-O:O;var y=O/(E-v.size),T=y*(b-S);r.draggedAxis==="x"&&r.isRtl&&(T=!((_=t.getRtlHelpers())===null||_===void 0)&&_.isScrollingToNegative?-T:T),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=T}},this.onEndDrag=function(i){var a=ph(r.el),o=Ar(r.el);i.preventDefault(),i.stopPropagation(),xr(r.el,r.classNames.dragging),a.removeEventListener("mousemove",r.drag,!0),a.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",r.preventClick,!0),a.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null})},this.preventClick=function(i){i.preventDefault(),i.stopPropagation()},this.el=e,this.options=Na(Na({},t.defaultOptions),n),this.classNames=Na(Na({},t.defaultOptions.classNames),n.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}}},typeof this.el!="object"||!this.el.nodeName)throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));this.onMouseMove=O0(this._onMouseMove,64),this.onWindowResize=Po(this._onWindowResize,64,{leading:!0}),this.onStopScrolling=Po(this._onStopScrolling,this.stopScrollDelay),this.onMouseEntered=Po(this._onMouseEntered,this.stopScrollDelay),this.init()}return t.getRtlHelpers=function(){if(t.rtlHelpers)return t.rtlHelpers;var e=document.createElement("div");e.innerHTML='<div class="simplebar-dummy-scrollbar-size"><div></div></div>';var n=e.firstElementChild,r=n==null?void 0:n.firstElementChild;if(!r)return null;document.body.appendChild(n),n.scrollLeft=0;var i=t.getOffset(n),a=t.getOffset(r);n.scrollLeft=-999;var o=t.getOffset(r);return document.body.removeChild(n),t.rtlHelpers={isScrollOriginAtZero:i.left!==a.left,isScrollingToNegative:a.left!==o.left},t.rtlHelpers},t.prototype.getScrollbarWidth=function(){try{return this.contentWrapperEl&&getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:$1()}catch{return $1()}},t.getOffset=function(e){var n=e.getBoundingClientRect(),r=ph(e),i=Ar(e);return{top:n.top+(i.pageYOffset||r.documentElement.scrollTop),left:n.left+(i.pageXOffset||r.documentElement.scrollLeft)}},t.prototype.init=function(){U1&&(this.initDOM(),this.rtlHelpers=t.getRtlHelpers(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.prototype.initDOM=function(){var e,n;this.wrapperEl=this.el.querySelector(on(this.classNames.wrapper)),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector(on(this.classNames.contentWrapper)),this.contentEl=this.options.contentNode||this.el.querySelector(on(this.classNames.contentEl)),this.offsetEl=this.el.querySelector(on(this.classNames.offset)),this.maskEl=this.el.querySelector(on(this.classNames.mask)),this.placeholderEl=this.findChild(this.wrapperEl,on(this.classNames.placeholder)),this.heightAutoObserverWrapperEl=this.el.querySelector(on(this.classNames.heightAutoObserverWrapperEl)),this.heightAutoObserverEl=this.el.querySelector(on(this.classNames.heightAutoObserverEl)),this.axis.x.track.el=this.findChild(this.el,"".concat(on(this.classNames.track)).concat(on(this.classNames.horizontal))),this.axis.y.track.el=this.findChild(this.el,"".concat(on(this.classNames.track)).concat(on(this.classNames.vertical))),this.axis.x.scrollbar.el=((e=this.axis.x.track.el)===null||e===void 0?void 0:e.querySelector(on(this.classNames.scrollbar)))||null,this.axis.y.scrollbar.el=((n=this.axis.y.track.el)===null||n===void 0?void 0:n.querySelector(on(this.classNames.scrollbar)))||null,this.options.autoHide||(Ir(this.axis.x.scrollbar.el,this.classNames.visible),Ir(this.axis.y.scrollbar.el,this.classNames.visible))},t.prototype.initListeners=function(){var e=this,n,r=Ar(this.el);if(this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("pointerdown",this.onPointerEvent,!0),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),(n=this.contentWrapperEl)===null||n===void 0||n.addEventListener("scroll",this.onScroll),r.addEventListener("resize",this.onWindowResize),!!this.contentEl){if(window.ResizeObserver){var i=!1,a=r.ResizeObserver||ResizeObserver;this.resizeObserver=new a(function(){i&&r.requestAnimationFrame(function(){e.recalculate()})}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),r.requestAnimationFrame(function(){i=!0})}this.mutationObserver=new r.MutationObserver(function(){r.requestAnimationFrame(function(){e.recalculate()})}),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})}},t.prototype.recalculate=function(){if(!(!this.heightAutoObserverEl||!this.contentEl||!this.contentWrapperEl||!this.wrapperEl||!this.placeholderEl)){var e=Ar(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var n=this.contentEl.offsetWidth,r=this.heightAutoObserverEl.offsetHeight<=1,i=this.heightAutoObserverEl.offsetWidth<=1||n>0,a=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding="".concat(this.elStyles.paddingTop," ").concat(this.elStyles.paddingRight," ").concat(this.elStyles.paddingBottom," ").concat(this.elStyles.paddingLeft),this.wrapperEl.style.margin="-".concat(this.elStyles.paddingTop," -").concat(this.elStyles.paddingRight," -").concat(this.elStyles.paddingBottom," -").concat(this.elStyles.paddingLeft);var l=this.contentEl.scrollHeight,c=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=r?"auto":"100%",this.placeholderEl.style.width=i?"".concat(n||c,"px"):"auto",this.placeholderEl.style.height="".concat(l,"px");var u=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=n!==0&&c>n,this.axis.y.isOverflowing=l>u,this.axis.x.isOverflowing=o==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=s==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var d=this.axis.x.isOverflowing?this.scrollbarWidth:0,p=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&c>a-p,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&l>u-d,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el&&(this.axis.x.scrollbar.el.style.width="".concat(this.axis.x.scrollbar.size,"px")),this.axis.y.scrollbar.el&&(this.axis.y.scrollbar.el.style.height="".concat(this.axis.y.scrollbar.size,"px")),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},t.prototype.getScrollbarSize=function(e){var n,r;if(e===void 0&&(e="y"),!this.axis[e].isOverflowing||!this.contentEl)return 0;var i=this.contentEl[this.axis[e].scrollSizeAttr],a=(r=(n=this.axis[e].track.el)===null||n===void 0?void 0:n[this.axis[e].offsetSizeAttr])!==null&&r!==void 0?r:0,o=a/i,s;return s=Math.max(~~(o*a),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(s=Math.min(s,this.options.scrollbarMaxSize)),s},t.prototype.positionScrollbar=function(e){var n,r,i;e===void 0&&(e="y");var a=this.axis[e].scrollbar;if(!(!this.axis[e].isOverflowing||!this.contentWrapperEl||!a.el||!this.elStyles)){var o=this.contentWrapperEl[this.axis[e].scrollSizeAttr],s=((n=this.axis[e].track.el)===null||n===void 0?void 0:n[this.axis[e].offsetSizeAttr])||0,l=parseInt(this.elStyles[this.axis[e].sizeAttr],10),c=this.contentWrapperEl[this.axis[e].scrollOffsetAttr];c=e==="x"&&this.isRtl&&(!((r=t.getRtlHelpers())===null||r===void 0)&&r.isScrollOriginAtZero)?-c:c,e==="x"&&this.isRtl&&(c=!((i=t.getRtlHelpers())===null||i===void 0)&&i.isScrollingToNegative?c:-c);var u=c/(o-l),d=~~((s-a.size)*u);d=e==="x"&&this.isRtl?-d+(s-a.size):d,a.el.style.transform=e==="x"?"translate3d(".concat(d,"px, 0, 0)"):"translate3d(0, ".concat(d,"px, 0)")}},t.prototype.toggleTrackVisibility=function(e){e===void 0&&(e="y");var n=this.axis[e].track.el,r=this.axis[e].scrollbar.el;!n||!r||!this.contentWrapperEl||(this.axis[e].isOverflowing||this.axis[e].forceVisible?(n.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll",this.el.classList.add("".concat(this.classNames.scrollable,"-").concat(e))):(n.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden",this.el.classList.remove("".concat(this.classNames.scrollable,"-").concat(e))),this.axis[e].isOverflowing?r.style.display="block":r.style.display="none")},t.prototype.showScrollbar=function(e){e===void 0&&(e="y"),this.axis[e].isOverflowing&&!this.axis[e].scrollbar.isVisible&&(Ir(this.axis[e].scrollbar.el,this.classNames.visible),this.axis[e].scrollbar.isVisible=!0)},t.prototype.hideScrollbar=function(e){e===void 0&&(e="y"),this.axis[e].isOverflowing&&this.axis[e].scrollbar.isVisible&&(xr(this.axis[e].scrollbar.el,this.classNames.visible),this.axis[e].scrollbar.isVisible=!1)},t.prototype.hideNativeScrollbar=function(){this.offsetEl&&(this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px",this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px")},t.prototype.onMouseMoveForAxis=function(e){e===void 0&&(e="y");var n=this.axis[e];!n.track.el||!n.scrollbar.el||(n.track.rect=n.track.el.getBoundingClientRect(),n.scrollbar.rect=n.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(n.track.rect)?(this.showScrollbar(e),Ir(n.track.el,this.classNames.hover),this.isWithinBounds(n.scrollbar.rect)?Ir(n.scrollbar.el,this.classNames.hover):xr(n.scrollbar.el,this.classNames.hover)):(xr(n.track.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(e)))},t.prototype.onMouseLeaveForAxis=function(e){e===void 0&&(e="y"),xr(this.axis[e].track.el,this.classNames.hover),xr(this.axis[e].scrollbar.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(e)},t.prototype.onDragStart=function(e,n){var r;n===void 0&&(n="y");var i=ph(this.el),a=Ar(this.el),o=this.axis[n].scrollbar,s=n==="y"?e.pageY:e.pageX;this.axis[n].dragOffset=s-(((r=o.rect)===null||r===void 0?void 0:r[this.axis[n].offsetAttr])||0),this.draggedAxis=n,Ir(this.el,this.classNames.dragging),i.addEventListener("mousemove",this.drag,!0),i.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(i.addEventListener("click",this.preventClick,!0),i.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.prototype.onTrackClick=function(e,n){var r=this,i,a,o,s;n===void 0&&(n="y");var l=this.axis[n];if(!(!this.options.clickOnTrack||!l.scrollbar.el||!this.contentWrapperEl)){e.preventDefault();var c=Ar(this.el);this.axis[n].scrollbar.rect=l.scrollbar.el.getBoundingClientRect();var u=this.axis[n].scrollbar,d=(a=(i=u.rect)===null||i===void 0?void 0:i[this.axis[n].offsetAttr])!==null&&a!==void 0?a:0,p=parseInt((s=(o=this.elStyles)===null||o===void 0?void 0:o[this.axis[n].sizeAttr])!==null&&s!==void 0?s:"0px",10),f=this.contentWrapperEl[this.axis[n].scrollOffsetAttr],m=n==="y"?this.mouseY-d:this.mouseX-d,_=m<0?-1:1,g=_===-1?f-p:f+p,h=40,E=function(){r.contentWrapperEl&&(_===-1?f>g&&(f-=h,r.contentWrapperEl[r.axis[n].scrollOffsetAttr]=f,c.requestAnimationFrame(E)):f<g&&(f+=h,r.contentWrapperEl[r.axis[n].scrollOffsetAttr]=f,c.requestAnimationFrame(E)))};E()}},t.prototype.getContentElement=function(){return this.contentEl},t.prototype.getScrollElement=function(){return this.contentWrapperEl},t.prototype.removeListeners=function(){var e=Ar(this.el);this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("pointerdown",this.onPointerEvent,!0),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.onMouseMove.cancel(),this.onWindowResize.cancel(),this.onStopScrolling.cancel(),this.onMouseEntered.cancel()},t.prototype.unMount=function(){this.removeListeners()},t.prototype.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.prototype.findChild=function(e,n){var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,function(i){return r.call(i,n)})[0]},t.rtlHelpers=null,t.defaultOptions={forceVisible:!1,clickOnTrack:!0,scrollbarMinSize:25,scrollbarMaxSize:0,ariaLabel:"scrollable content",classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging",scrolling:"simplebar-scrolling",scrollable:"simplebar-scrollable",mouseEntered:"simplebar-mouse-entered"},scrollableNode:null,contentNode:null,autoHide:!0},t.getOptions=vle,t.helpers=ble,t}(),En=function(){return En=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},En.apply(this,arguments)};function Sle(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}var j1=Le.forwardRef(function(t,e){var n=t.children,r=t.scrollableNodeProps,i=r===void 0?{}:r,a=Sle(t,["children","scrollableNodeProps"]),o=Le.useRef(),s=Le.useRef(),l=Le.useRef(),c={},u={};Object.keys(a).forEach(function(f){Object.prototype.hasOwnProperty.call(vc.defaultOptions,f)?c[f]=a[f]:u[f]=a[f]});var d=En(En({},vc.defaultOptions.classNames),c.classNames),p=En(En({},i),{className:"".concat(d.contentWrapper).concat(i.className?" ".concat(i.className):""),tabIndex:0,role:"region","aria-label":c.ariaLabel||vc.defaultOptions.ariaLabel});return Le.useEffect(function(){var f;return s.current=p.ref?p.ref.current:s.current,o.current&&(f=new vc(o.current,En(En(En({},c),s.current&&{scrollableNode:s.current}),l.current&&{contentNode:l.current})),typeof e=="function"?e(f):e&&(e.current=f)),function(){f==null||f.unMount(),f=null,typeof e=="function"&&e(null)}},[]),Le.createElement("div",En({"data-simplebar":"init",ref:o},u),Le.createElement("div",{className:d.wrapper},Le.createElement("div",{className:d.heightAutoObserverWrapperEl},Le.createElement("div",{className:d.heightAutoObserverEl})),Le.createElement("div",{className:d.mask},Le.createElement("div",{className:d.offset},typeof n=="function"?n({scrollableNodeRef:s,scrollableNodeProps:En(En({},p),{ref:s}),contentNodeRef:l,contentNodeProps:{className:d.contentEl,ref:l}}):Le.createElement("div",En({},p),Le.createElement("div",{className:d.contentEl},n)))),Le.createElement("div",{className:d.placeholder})),Le.createElement("div",{className:"".concat(d.track," simplebar-horizontal")},Le.createElement("div",{className:d.scrollbar})),Le.createElement("div",{className:"".concat(d.track," simplebar-vertical")},Le.createElement("div",{className:d.scrollbar})))});j1.displayName="SimpleBar";const yle=$t("div")(()=>({flexGrow:1,height:"100%",overflow:"hidden"})),Tle=$t(j1)(({theme:t})=>({maxHeight:"100%","& .simplebar-scrollbar":{"&:before":{backgroundColor:Ee(t.palette.grey[600],.48)},"&.simplebar-visible:before":{opacity:1}},"& .simplebar-mask":{zIndex:"inherit"}})),Ole=({children:t,sx:e,...n})=>{const r=typeof navigator>"u"?"SSR":navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r)?w.jsx(ne.Box,{sx:{overflowX:"auto",...e},...n,children:t}):w.jsx(yle,{children:w.jsx(Tle,{clickOnTrack:!1,sx:e,...n,children:t})})},Cle=C.memo(Ole),Rle=({onSearch:t,onChange:e,trigger:n="click",iconPosition:r="end",...i})=>{const a=C.useRef(null),o=w.jsx(ne.InputAdornment,{position:r,children:w.jsx(ne.IconButton,{color:"inherit",onClick:()=>{var s;t((s=a.current)==null?void 0:s.value)},children:w.jsx(Yt,{icon:"eva:search-fill",sx:{width:20,height:20}})})});return w.jsx(ne.TextField,{inputRef:a,InputProps:{onKeyDown:s=>{var l;s.key==="Enter"&&t((l=a.current)==null?void 0:l.value)},...r==="start"?{startAdornment:o}:{endAdornment:o}},onChange:s=>{if(n==="change"){t(s.target.value);return}s.target.value===""&&t(""),e&&e(s)},...i})},Nle=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:a,fieldState:{error:o}})=>w.jsx(Ld,{...a,...r,onChange:s=>a.onChange(s),error:!!o,helperText:(o==null?void 0:o.message)||e})})},Ale=({name:t,helperText:e,...n})=>{const{control:r}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:i,fieldState:{error:a}})=>w.jsxs("div",{children:[w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Checkbox,{...i,checked:i.value}),...n}),(!!a||e)&&w.jsx(ne.FormHelperText,{error:!!a,children:a?a==null?void 0:a.message:e})]})})},Ile=({row:t,name:e,label:n,options:r,spacing:i,helperText:a,...o})=>{const{control:s}=_t.useFormContext(),l=(c,u)=>c.includes(u)?c.filter(d=>d!==u):[...c,u];return w.jsx(_t.Controller,{name:e,control:s,render:({field:c,fieldState:{error:u}})=>w.jsxs(ne.FormControl,{component:"fieldset",children:[n&&w.jsx(ne.FormLabel,{component:"legend",sx:{typography:"body2"},children:n}),w.jsx(ne.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:i||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:i||2}}}},children:r.map(d=>w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Checkbox,{checked:c.value.includes(d.value),onChange:()=>c.onChange(l(c.value,d.value))}),label:d.label,...o},d.value))}),(!!u||a)&&w.jsx(ne.FormHelperText,{error:!!u,sx:{mx:0},children:u?u==null?void 0:u.message:a})]})})},xle=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>w.jsx(hO,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},wle=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.DatePicker,{inputRef:r,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})},Dle=({name:t,label:e,...n})=>{const{control:r,setError:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:{value:a,onChange:o},fieldState:{error:s}})=>w.jsx(Ma.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...n.localeText},value:[(a==null?void 0:a.startDate)||null,(a==null?void 0:a.endDate)||null],onChange:l=>o({startDate:l[0],endDate:l[1]}),onError:l=>{i(t,{message:l[0]||l[1]||void 0})},...n,slotProps:{textField:({position:l})=>{var c;return{...(c=n.slotProps)==null?void 0:c.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:l==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`}}},sx:{width:1}})})},Mle=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:r,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})},Ple=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{...a},fieldState:{error:o}})=>w.jsx(d1,{...a,error:!!o,helperText:(o==null?void 0:o.message)||e,...r})})},K1=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,...o},fieldState:{error:s}})=>w.jsx(ne.TextField,{...o,inputRef:a,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...r})})},Lle=({id:t,children:e,onSubmit:n,methods:r})=>w.jsx(_t.FormProvider,{...r,children:w.jsx(ne.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,children:e})}),kle=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>w.jsx(dh,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},Fle=t=>{const[e,n]=C.useState(!1);return w.jsx(K1,{...t,type:e?"text":"password",InputProps:{endAdornment:w.jsx(ne.InputAdornment,{position:"end",children:w.jsx(ne.IconButton,{onClick:()=>n(!e),edge:"end","aria-label":"Mostrar/Ocultar senha",children:w.jsx(Yt,{icon:e?"eva:eye-off-fill":"eva:eye-fill"})})})}})},Ble=({name:t,helperText:e,...n})=>{const{control:r}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:i,fieldState:{error:a}})=>w.jsxs("div",{children:[w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Switch,{...i,checked:i.value}),...n}),(!!a||e)&&w.jsx(ne.FormHelperText,{error:!!a,children:a?a==null?void 0:a.message:e})]})})},Ule=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.TimePicker,{ampm:!1,format:"HH:mm",inputRef:r,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})};function Ia(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})}function xa(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1],a=c;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(c);break}a[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Q1(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function X1(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Gle=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Qo(t,e){var n=$le(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function $le(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),i=Gle.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}var qle=[".DS_Store","Thumbs.db"];function Yle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return Sc(t)&&Vle(t.dataTransfer)?[2,jle(t.dataTransfer,t.type)]:Hle(t)?[2,zle(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,Wle(t)]:[2,[]]})})}function Vle(t){return Sc(t)}function Hle(t){return Sc(t)&&Sc(t.target)}function Sc(t){return typeof t=="object"&&t!==null}function zle(t){return fh(t.target.files).map(function(e){return Qo(e)})}function Wle(t){return Ia(this,void 0,void 0,function(){var e;return xa(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Qo(r)})]}})})}function jle(t,e){return Ia(this,void 0,void 0,function(){var n,r;return xa(this,function(i){switch(i.label){case 0:return t.items?(n=fh(t.items).filter(function(a){return a.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(Kle))]):[3,2];case 1:return r=i.sent(),[2,Z1(J1(r))];case 2:return[2,Z1(fh(t.files).map(function(a){return Qo(a)}))]}})})}function Z1(t){return t.filter(function(e){return qle.indexOf(e.name)===-1})}function fh(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r)}return e}function Kle(t){if(typeof t.webkitGetAsEntry!="function")return eI(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?tI(e):eI(t)}function J1(t){return t.reduce(function(e,n){return X1(X1([],Q1(e),!1),Q1(Array.isArray(n)?J1(n):[n]),!1)},[])}function eI(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=Qo(e);return Promise.resolve(n)}function Qle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return[2,t.isDirectory?tI(t):Xle(t)]})})}function tI(t){var e=t.createReader();return new Promise(function(n,r){var i=[];function a(){var o=this;e.readEntries(function(s){return Ia(o,void 0,void 0,function(){var l,c,u;return xa(this,function(d){switch(d.label){case 0:if(s.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(s.map(Qle)),i.push(u),a(),d.label=6;case 6:return[2]}})})},function(s){r(s)})}a()})}function Xle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return[2,new Promise(function(n,r){t.file(function(i){var a=Qo(i,t.fullPath);n(a)},function(i){r(i)})})]})})}var Zle=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",i=(t.type||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some(function(o){var s=o.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?a===s.replace(/\/.*$/,""):i===s})}return!0};function nI(t){return tce(t)||ece(t)||oI(t)||Jle()}function Jle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
290
|
+
`,Hse=1,zse=3,Wse=function(t){Ose(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.imageRef=C.createRef(),n.videoRef=C.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=Gse(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=i.crop,o=i.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var s=qse(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),a=s.crop,o=s.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var r,i,a,o,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var u=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((a=n.imageRef.current)===null||a===void 0?void 0:a.naturalHeight)||((o=n.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c.offsetWidth<d||c.offsetHeight<p,m=d/p,_=void 0;if(f){var g=n.getObjectFit();switch(g){default:case"contain":_=u>m?{width:n.containerRect.height*m,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/m};break;case"horizontal-cover":_={width:n.containerRect.width,height:n.containerRect.width/m};break;case"vertical-cover":_={width:n.containerRect.height*m,height:n.containerRect.height};break}}else _={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=Xt(Xt({},_),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var h=n.props.cropSize?n.props.cropSize:Lse(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==h.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==h.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(h),n.setState({cropSize:h},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(h),h}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(e.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(e.getMousePoint(r))},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(e.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(e.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=e.getMousePoint(r),a=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var o=n.gestureRotationStart+r.rotation;n.props.onRotationChange(o)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,a,o=r.x,s=r.y;n.dragStartPosition={x:o,y:s},n.dragStartCrop=Xt({},n.props.crop),(a=(i=n.props).onInteractionStart)===null||a===void 0||a.call(i)},n.onDrag=function(r){var i=r.x,a=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||a===void 0)){var o=i-n.dragStartPosition.x,s=a-n.dragStartPosition.y,l={x:n.dragStartCrop.x+o,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?fc(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=e.getMousePoint(r),a=Pse(r).pixelY,o=n.props.zoom-a*n.props.zoomSpeed/200;n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r){var i=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(i-n.containerRect.left),y:n.containerRect.height/2-(a-n.containerRect.top)}},n.getPointOnMedia=function(r){var i=r.x,a=r.y,o=n.props,s=o.crop,l=o.zoom;return{x:(i+s.x)/l,y:(a+s.y)/l}},n.setNewZoom=function(r,i,a){var o=a===void 0?{}:a,s=o.shouldUpdatePosition,l=s===void 0?!0:s;if(!(!n.state.cropSize||!n.props.onZoomChange)){var c=_c(r,n.props.minZoom,n.props.maxZoom);if(l){var u=n.getPointOnContainer(i),d=n.getPointOnMedia(u),p={x:d.x*c-u.x,y:d.y*c-u.y},f=n.props.restrictPosition?fc(p,n.mediaSize,n.state.cropSize,c,n.props.rotation):p;n.props.onCropChange(f)}n.props.onZoomChange(c)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?fc(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return Fse(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,a),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,a)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,a=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,a)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?fc(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return e.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Vse,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},e.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},e.prototype.componentDidUpdate=function(n){var r,i,a,o,s,l,c,u,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((a=n.cropSize)===null||a===void 0?void 0:a.width)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load())},e.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},e.prototype.getObjectFit=function(){var n,r,i,a;if(this.props.objectFit==="cover"){var o=this.imageRef.current||this.videoRef.current;if(o&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,c=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,u=l/c;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},e.prototype.onPinchStart=function(n){var r=e.getTouchPoint(n.touches[0]),i=e.getTouchPoint(n.touches[1]);this.lastPinchDistance=C1(r,i),this.lastPinchRotation=R1(r,i),this.onDragStart(N1(r,i))},e.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=e.getTouchPoint(n.touches[0]),a=e.getTouchPoint(n.touches[1]),o=N1(i,a);this.onDrag(o),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=C1(i,a),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,o,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=R1(i,a),u=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(u),r.lastPinchRotation=c})}},e.prototype.render=function(){var n=this,r=this.props,i=r.image,a=r.video,o=r.mediaProps,s=r.transform,l=r.crop,c=l.x,u=l.y,d=r.rotation,p=r.zoom,f=r.cropShape,m=r.showGrid,_=r.style,g=_.containerStyle,h=_.cropAreaStyle,E=_.mediaStyle,v=r.classes,b=v.containerClassName,S=v.cropAreaClassName,O=v.mediaClassName,y=this.getObjectFit();return C.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(A){return n.containerRef=A},"data-testid":"container",style:g,className:mc("reactEasyCrop_Container",b)},i?C.createElement("img",Xt({alt:"",className:mc("reactEasyCrop_Image",y==="contain"&&"reactEasyCrop_Contain",y==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",y==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},o,{src:i,ref:this.imageRef,style:Xt(Xt({},E),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):a&&C.createElement("video",Xt({autoPlay:!0,loop:!0,muted:!0,className:mc("reactEasyCrop_Video",y==="contain"&&"reactEasyCrop_Contain",y==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",y==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Xt(Xt({},E),{transform:s||"translate(".concat(c,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(T){return C.createElement("source",Xt({key:T.src},T))})),this.state.cropSize&&C.createElement("div",{style:Xt(Xt({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:mc("reactEasyCrop_CropArea",f==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",S)}))},e.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:zse,minZoom:Hse,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},e.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},e}(C.Component);const jse=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function A1(t){return t*Math.PI/180}function Kse(t,e,n){const r=A1(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function Qse(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await jse(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=A1(n),{width:l,height:c}=Kse(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,p)=>{a.toBlob(f=>{d(f)},"image/png")})}const I1=({title:t,open:e,onClose:n,onFileCropped:r,image:{width:i,height:a,aspect:o,imgSrc:s=""}})=>{const[l,c]=C.useState({x:0,y:0}),[u,d]=C.useState(1),p=C.useRef(),f=C.useRef(),m=async(h,E)=>{try{const v=await Qse(s,E,0);p.current=new File([v],"image.png",{type:v.type})}catch{r(void 0)}},_=async()=>{r(f.current),n()},g=()=>{r(p.current),f.current=p.current,n()};return w.jsxs(ne.Dialog,{open:e,scroll:"body",PaperProps:{sx:{maxWidth:"100%"}},children:[w.jsx(ne.DialogTitle,{children:t}),w.jsx(ne.DialogContent,{children:w.jsx(ne.Stack,{position:"relative",alignItems:"center",justifyContent:"center",style:{position:"relative",width:i*1.1,height:a*1.1,margin:"auto"},children:w.jsx(Wse,{image:s,crop:l,zoom:u,minZoom:1,maxZoom:5,cropSize:{width:i,height:a},aspect:o,onCropChange:c,onZoomChange:d,onCropComplete:m,objectFit:"horizontal-cover"})})}),w.jsxs(ne.DialogActions,{children:[w.jsxs(ne.Stack,{direction:"row",gap:3,flex:1,alignItems:"center",maxWidth:200,mr:"auto",children:[w.jsx(ne.Typography,{variant:"body1",children:"Zoom"}),w.jsx(ne.Slider,{value:u,onChange:(h,E)=>d(Array.isArray(E)?E[0]:E),min:1,max:5,size:"medium",step:.5})]}),w.jsx(ne.Button,{variant:"soft",size:"medium",onClick:_,children:"Descartar"}),w.jsx(ne.Button,{variant:"contained",size:"medium",onClick:g,children:"Salvar"})]})]})},Xse=$t(ne.Box)(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=e.variant==="filled",i=e.variant==="outlined",a=e.variant==="soft",o={...e.color==="default"&&{...i&&{backgroundColor:"transparent",color:t.palette.text.primary,border:`1px solid ${Ee(t.palette.grey[500],.32)}`},...a&&{color:n?t.palette.text.primary:t.palette.common.white,backgroundColor:Ee(t.palette.grey[500],.16)}}},s={...e.color!=="default"&&{...r&&{color:t.palette[e.color].contrastText,backgroundColor:t.palette[e.color].main},...i&&{backgroundColor:"transparent",color:t.palette[e.color].main,border:`1px solid ${t.palette[e.color].main}`},...a&&{color:t.palette[e.color][n?"dark":"light"],backgroundColor:Ee(t.palette[e.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...o}}),x1=C.forwardRef(({children:t,color:e="default",variant:n="soft",startIcon:r,endIcon:i,sx:a,...o},s)=>{const l=Ur(),c={width:16,height:16,"& svg, img":{width:1,height:1,objectFit:"cover"}};return w.jsxs(Xse,{ref:s,component:"span",ownerState:{color:e,variant:n},sx:{...r&&{pl:.75},...i&&{pr:.75},...a},theme:l,...o,children:[r&&w.jsxs(ne.Box,{sx:{mr:.75,...c},children:[" ",r," "]}),t,i&&w.jsxs(ne.Box,{sx:{ml:.75,...c},children:[" ",i," "]})]})});x1.displayName="Label";function Nr(t){return typeof t=="string"||t instanceof String}function w1(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function D1(t,e){return Array.isArray(e)?D1(t,(n,r)=>e.includes(r)):Object.entries(t).reduce((n,r)=>{let[i,a]=r;return e(a,i)&&(n[i]=a),n},{})}const Pe={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Zse(t){switch(t){case Pe.LEFT:return Pe.FORCE_LEFT;case Pe.RIGHT:return Pe.FORCE_RIGHT;default:return t}}function lh(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function gc(t,e){if(e===t)return!0;const n=Array.isArray(e),r=Array.isArray(t);let i;if(n&&r){if(e.length!=t.length)return!1;for(i=0;i<e.length;i++)if(!gc(e[i],t[i]))return!1;return!0}if(n!=r)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const a=e instanceof Date,o=t instanceof Date;if(a&&o)return e.getTime()==t.getTime();if(a!=o)return!1;const s=e instanceof RegExp,l=t instanceof RegExp;if(s&&l)return e.toString()==t.toString();if(s!=l)return!1;const c=Object.keys(e);for(i=0;i<c.length;i++)if(!Object.prototype.hasOwnProperty.call(t,c[i]))return!1;for(i=0;i<c.length;i++)if(!gc(t[c[i]],e[c[i]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class Jse{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Pe.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Pe.RIGHT:Pe.LEFT}}function Ge(t,e){return new Ge.InputMask(t,e)}function M1(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?Ge.MaskedRegExp:Nr(t)?Ge.MaskedPattern:t===Date?Ge.MaskedDate:t===Number?Ge.MaskedNumber:Array.isArray(t)||t===Array?Ge.MaskedDynamic:Ge.Masked&&t.prototype instanceof Ge.Masked?t:Ge.Masked&&t instanceof Ge.Masked?t.constructor:t instanceof Function?Ge.MaskedFunction:(console.warn("Mask not found for mask",t),Ge.Masked)}function hc(t){if(!t)throw new Error("Options in not defined");if(Ge.Masked){if(t.prototype instanceof Ge.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof Ge.Masked?{mask:t}:w1(t)&&t.mask instanceof Ge.Masked?t:{};if(e){const r=e.mask;return{...D1(e,(i,a)=>!a.startsWith("_")),mask:e.constructor,_mask:r,...n}}}return w1(t)?{...t}:{mask:t}}function si(t){if(Ge.Masked&&t instanceof Ge.Masked)return t;const e=hc(t),n=M1(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}Ge.createMask=si;class ch{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}Ge.MaskElement=ch;class li extends ch{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,r;return(e=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(li.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}li.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},Ge.HTMLMaskElement=li;class ele extends li{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}Ge.HTMLMaskElement=li;class P1 extends li{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,e),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}Ge.HTMLContenteditableMaskElement=P1;class tle{constructor(e,n){this.el=e instanceof ch?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new P1(e):new ele(e),this.masked=si(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof Ge.Masked)&&this.masked.constructor===M1(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof Ge.Masked?e:si({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const r=this._listeners[e];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,r=this.displayValue,i=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==r&&(this.el.value=r),i&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...r}=e,i=!this.maskEquals(n),a=!gc(this.masked,r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Pe.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const r=this._listeners[e].indexOf(n);return r>=0&&this._listeners[e].splice(r,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new Jse({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:Pe.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Pe.NONE&&(o=this.masked.nearestInputPos(o,Pe.NONE)),this.updateControl(),this.updateCursor(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}Ge.InputMask=tle;class gt{static normalize(e){return Array.isArray(e)?e:[e,new gt]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}Ge.ChangeDetails=gt;class cr{constructor(e,n,r){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=r}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class gn{constructor(e){this._value="",this._update({...gn.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new cr(this.extractInput(e,n),e)}appendTail(e){return Nr(e)&&(e=new cr(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new gt({inserted:e,rawInserted:e})):new gt}_appendChar(e,n,r){n===void 0&&(n={});const i=this.state;let a;if([e,a]=this.doPrepareChar(e,n),a=a.aggregate(this._appendCharRaw(e,n)),a.inserted){let o,s=this.doValidate(n)!==!1;if(s&&r!=null){const l=this.state;this.overwrite===!0&&(o=r.state,r.unshift(this.displayValue.length-a.tailShift));let c=this.appendTail(r);s=c.rawInserted===r.toString(),!(s&&c.inserted)&&this.overwrite==="shift"&&(this.state=l,o=r.state,r.shift(),c=this.appendTail(r),s=c.rawInserted===r.toString()),s&&c.inserted&&(this.state=l)}s||(a=new gt,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new gt}_appendEager(){return new gt}append(e,n,r){if(!Nr(e))throw new Error("value should be string");const i=Nr(r)?new cr(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,n);for(let o=0;o<e.length;++o){const s=this._appendChar(e[o],n,i);if(!s.rawInserted&&!this.doSkipInvalid(e[o],n,i))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new gt}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=e();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&this.append(r.slice(this.displayValue.length),{},""),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,r=e(this);return this.state=n,delete this._isolated,r}doSkipInvalid(e,n,r){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),gt.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),gt.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,r,i,a){i===void 0&&(i=Pe.NONE),a===void 0&&(a={input:!0});const o=e+n,s=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(i=Zse(i),c=this.extractInput(0,o,{raw:!0}));let u=e;const d=new gt;if(i!==Pe.NONE&&(u=this.nearestInputPos(e,n>1&&e!==0&&!l?Pe.NONE:i),d.tailShift=u-e),d.aggregate(this.remove(u)),l&&i!==Pe.NONE&&c===this.rawInputValue)if(i===Pe.FORCE_LEFT){let p;for(;c===this.rawInputValue&&(p=this.displayValue.length);)d.aggregate(new gt({tailShift:-1})).aggregate(this.remove(p-1))}else i===Pe.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(r,a,s))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||gn.EMPTY_VALUES.includes(e)&&gn.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}gn.DEFAULTS={skipInvalid:!0},gn.EMPTY_VALUES=[void 0,null,""],Ge.Masked=gn;class ci{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Nr(e)?new cr(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof cr)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof ci){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof Ge.MaskedPattern))return new cr(this.toString()).appendTo(e);const n=new gt;for(let r=0;r<this.chunks.length&&!n.skip;++r){const i=this.chunks[r],a=e._mapPosToBlock(e.displayValue.length),o=i.stop;let s;if(o!=null&&(!a||a.index<=o)){if(i instanceof ci||e._stops.indexOf(o)>=0){const l=e._appendPlaceholder(o);n.aggregate(l)}s=i instanceof ci&&e._blocks[o]}if(s){const l=s.appendTail(i);l.skip=!1,n.aggregate(l),e._value+=l.inserted;const c=i.toString().slice(l.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...r}=e;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new ci:new cr;return a.state=i,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],r=n.shift();if(n.toString()){if(!r)break;--e}else this.chunks.splice(e,1);if(r)return r}return""}}class nle{constructor(e,n){this.masked=e,this._log=[];const{offset:r,index:i}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Pe.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pe.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pe.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Pe.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pe.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pe.NONE),!0})}}class L1{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new gt}nearestInputPos(e,n){n===void 0&&(n=Pe.NONE);const r=0,i=this._value.length;switch(n){case Pe.LEFT:case Pe.FORCE_LEFT:return r;case Pe.NONE:case Pe.RIGHT:case Pe.FORCE_RIGHT:default:return i}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const r=new gt;if(this.isFilled)return r;const i=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!i)&&!n.tail;return o&&(r.rawInserted=this.char),this._value=r.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new gt;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new cr("")}appendTail(e){return Nr(e)&&(e=new cr(String(e))),e.appendTo(this)}append(e,n,r){const i=this._appendChar(e[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class Ec{constructor(e){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s,...l}=e;this.masked=si(l),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new gt}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new gt;const r=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i.inserted=i.rawInserted="",this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,n,r){return this.masked.append(e,this.currentMaskFlags(n),r)}_appendPlaceholder(){const e=new gt;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new gt}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,r)}nearestInputPos(e,n){n===void 0&&(n=Pe.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(e,r),i);switch(n){case Pe.LEFT:case Pe.FORCE_LEFT:return this.isComplete?a:r;case Pe.RIGHT:case Pe.FORCE_RIGHT:return this.isComplete?a:i;case Pe.NONE:default:return a}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||(e==null?void 0:e._beforeTailState)}}}Ec.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class rle extends gn{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=r=>r.search(n)>=0),super._update(e)}}Ge.MaskedRegExp=rle;class hn extends gn{constructor(e){super({...hn.DEFAULTS,...e,definitions:Object.assign({},Ec.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const c=n.slice(a),u=Object.keys(this.blocks).filter(p=>c.indexOf(p)===0);u.sort((p,f)=>f.length-p.length);const d=u[0];if(d){const{expose:p,...f}=hc(this.blocks[d]),m=si({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...f,parent:this});m&&(this._blocks.push(m),p&&(this.exposeBlock=m),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),a+=d.length-1;continue}}let o=n[a],s=o in e;if(o===hn.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===hn.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}const l=s?new Ec({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...hc(e[o]),parent:this}):new L1({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...r}=e;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new gt;let r=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new gt;if(!r)return i;for(let o=r.index;;++o){var a;const s=this._blocks[o];if(!s)break;const l=s._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]}),c=l.skip;if(i.aggregate(l),c||l.rawInserted)break}return i}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=new ci;return e===n||this._forEachBlocksInRange(e,n,(i,a,o,s)=>{const l=i.extractTail(o,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof ci&&(l.blockIndex=a),r.extend(l)}),r}extractInput(e,n,r){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),e===n)return"";let i="";return this._forEachBlocksInRange(e,n,(a,o,s,l)=>{i+=a.extractInput(s,l,r)}),i}_findStopBefore(e){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=e)n=i;else break}return n}_appendPlaceholder(e){const n=new gt;if(this.lazy&&e==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=e??this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||e!=null){var s;const l=o._appendPlaceholder((s=o._blocks)==null?void 0:s.length);this._value+=l.inserted,n.aggregate(l)}}),n}_mapPosToBlock(e){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,e<=n.length)return{index:r,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(e,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,s=i.offset,l=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,s,l),a&&!o){for(let c=i.index+1;c<a.index;++c)r(this._blocks[c],c,0,this._blocks[c].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(e,n);return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r.aggregate(i.remove(o,s))}),r}nearestInputPos(e,n){if(n===void 0&&(n=Pe.NONE),!this._blocks.length)return 0;const r=new nle(this,e);if(n===Pe.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Pe.LEFT||n===Pe.FORCE_LEFT){if(n===Pe.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===e)return e;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Pe.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=e||(r.popState(),r.ok&&r.pos<=e))return r.pos;r.popState()}return r.ok?r.pos:n===Pe.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Pe.RIGHT||n===Pe.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Pe.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(e,Pe.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(e,n,(i,a,o,s)=>{r+=i.totalInputPositions(o,s)}),r}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(r=>this._blocks[r]):[]}}hn.DEFAULTS={lazy:!0,placeholderChar:"_"},hn.STOP_CHAR="`",hn.ESCAPE_CHAR="\\",hn.InputDefinition=Ec,hn.FixedDefinition=L1,Ge.MaskedPattern=hn;class bc extends hn{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=e;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===s[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",r="";const[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(e,n){n===void 0&&(n={});let r;if([e,r]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,r];const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),o=this.value+e;if(o.length>this.maxLength)return["",r];const[s,l]=this.boundaries(o);return Number(l)<this.from?[i[o.length-1],r]:Number(s)>this.to?this.autofix==="pad"&&o.length<this.maxLength?["",r.aggregate(this.append(i[o.length-1]+e,n))]:[a[o.length-1],r]:[e,r]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(e)}}Ge.MaskedRange=bc;class ui extends hn{constructor(e){const{mask:n,pattern:r,...i}={...ui.DEFAULTS,...e};super({...i,mask:Nr(n)?n:r})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...a}={...ui.DEFAULTS,...e},o=Object.assign({},ui.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,i),Object.keys(o).forEach(s=>{const l=o[s];!("autofix"in l)&&"autofix"in e&&(l.autofix=e.autofix)}),super._update({...a,mask:Nr(n)?n:r,blocks:o})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}ui.GET_DEFAULT_BLOCKS=()=>({d:{mask:bc,from:1,to:31,maxLength:2},m:{mask:bc,from:1,to:12,maxLength:2},Y:{mask:bc,from:1900,to:9999}}),ui.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),i=t.getFullYear();return[n,r,i].join(".")},parse:(t,e)=>{const[n,r,i]=t.split(".").map(Number);return new Date(i,r-1,n)}},Ge.MaskedDate=ui;class Ko extends gn{constructor(e){super({...Ko.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:r,...i}=hc(n),a=si({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const r=this._applyDispatch(e,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),r}_applyDispatch(e,n,r){e===void 0&&(e=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,s=a.slice(o.length),l=this.currentMask,c=new gt,u=l==null?void 0:l.state;if(this.currentMask=this.doDispatch(e,{...n},r),this.currentMask)if(this.currentMask!==l){if(this.currentMask.reset(),o){const d=this.currentMask.append(o,{raw:!0});c.tailShift=d.inserted.length-i.length}s&&(c.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)}else u&&(this.currentMask.state=u);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new gt;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,r;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=e._beforeTailState)==null?void 0:r.currentMask)||e._beforeTailState}}doDispatch(e,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(e,this,n,r)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[r,i]=super.doPrepare(e,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(e,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(e,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const r=new gt;return this.currentMask&&r.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),r}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=e;n&&this.compiledMasks.forEach((o,s)=>o.state=n[s]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(e,n,r){return this.currentMask?this.currentMask.extractInput(e,n,r):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,r)=>{if(!e[r])return;const{mask:i,...a}=e[r];return gc(n,a)&&n.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}Ko.DEFAULTS=void 0,Ko.DEFAULTS={dispatch:(t,e,n,r)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,a=e.compiledMasks.map((o,s)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Pe.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):l||o.remove(c),o.append(t,e.currentMaskFlags(n)),o.appendTail(r),{index:s,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,Pe.FORCE_LEFT)))}});return a.sort((o,s)=>s.weight-o.weight||s.totalInputPositions-o.totalInputPositions),e.compiledMasks[a[0].index]}},Ge.MaskedDynamic=Ko;class ile extends hn{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...r}=e;if(n){const i=n.map(s=>s.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}Ge.MaskedEnum=ile;class ale extends gn{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}Ge.MaskedFunction=ale;class Tn extends gn{constructor(e){super({...Tn.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+lh(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(lh).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(lh(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(e,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(e+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,r){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,r))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const o=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(o);return a.tailShift+=(s-i)*this.thousandsSeparator.length,a.skip=!a.rawInserted&&e===this.thousandsSeparator,a}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=e)return r}return-1}_adjustRangeWithSeparators(e,n){const r=this._findSeparatorAround(e);r>=0&&(e=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const r=this.value.slice(0,e),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new gt({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case Pe.NONE:case Pe.LEFT:case Pe.FORCE_LEFT:{const r=this._findSeparatorAround(e-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(e<i||this.value.length<=i||n===Pe.FORCE_LEFT)return r}break}case Pe.RIGHT:case Pe.FORCE_RIGHT:{const r=this._findSeparatorAround(e);if(r>=0)return r+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const r=this.number;n=n&&!isNaN(r)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,r){n===void 0&&(n={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Tn.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Tn.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Tn.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Tn.EMPTY_VALUES.includes(e)&&Tn.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Tn.UNMASKED_RADIX=".",Tn.EMPTY_VALUES=[...gn.EMPTY_VALUES,0],Tn.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Tn.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},Ge.MaskedNumber=Tn;const uh={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function k1(t,e,n){e===void 0&&(e=uh.MASKED),n===void 0&&(n=uh.MASKED);const r=si(t);return i=>r.runIsolated(a=>(a[e]=i,a[n]))}function ole(t,e,n,r){return k1(e,n,r)(t)}Ge.PIPE_TYPE=uh,Ge.createPipe=k1,Ge.pipe=ole;try{globalThis.IMask=Ge}catch{}const F1={mask:J.oneOfType([J.array,J.func,J.string,J.instanceOf(RegExp),J.oneOf([Date,Number,Ge.Masked]),J.instanceOf(Ge.Masked)]),value:J.any,unmask:J.oneOfType([J.bool,J.oneOf(["typed"])]),prepare:J.func,prepareChar:J.func,validate:J.func,commit:J.func,overwrite:J.oneOfType([J.bool,J.oneOf(["shift"])]),eager:J.oneOfType([J.bool,J.oneOf(["append","remove"])]),skipInvalid:J.bool,onAccept:J.func,onComplete:J.func,placeholderChar:J.string,displayChar:J.string,lazy:J.bool,definitions:J.object,blocks:J.object,enum:J.arrayOf(J.string),maxLength:J.number,from:J.number,to:J.number,pattern:J.string,format:J.func,parse:J.func,autofix:J.oneOfType([J.bool,J.oneOf(["pad"])]),radix:J.string,thousandsSeparator:J.string,mapToRadix:J.arrayOf(J.string),scale:J.number,normalizeZeros:J.bool,padFractionalZeros:J.bool,min:J.oneOfType([J.number,J.instanceOf(Date)]),max:J.oneOfType([J.number,J.instanceOf(Date)]),dispatch:J.func,inputRef:J.oneOfType([J.func,J.shape({current:J.object})])},B1=Object.keys(F1).filter(t=>t!=="value"),sle=["value","unmask","onAccept","onComplete","inputRef"],lle=B1.filter(t=>sle.indexOf(t)<0);function cle(t){var e;const n=(e=class extends C.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Ge(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(s=>lle.indexOf(s)<0).forEach(s=>{delete o[s]}),o}_extractNonMaskProps(a){const{...o}=a;return B1.forEach(s=>{delete o[s]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return C.createElement(t,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),r=t.displayName||t.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=F1,C.forwardRef((i,a)=>C.createElement(n,{...i,ref:a}))}const ule=cle(t=>{let{inputRef:e,...n}=t;return C.createElement("input",{...n,ref:e})}),dle=(t,e)=>C.createElement(ule,{...t,ref:e});C.forwardRef(dle);function ple(t,e){let{onAccept:n,onComplete:r}=e===void 0?{}:e;const i=C.useRef(null),a=C.useRef(null),[o,s]=C.useState(!1),[l,c]=C.useState({}),[u,d]=C.useState(""),[p,f]=C.useState(""),[m,_]=C.useState(),g=C.useCallback(()=>{var v;o&&((v=a.current)==null||v.destroy(),a.current=null)},[]),h=C.useCallback(v=>{const b=a.current;b&&(c({value:b.value,unmaskedValue:b.unmaskedValue,typedValue:b.typedValue}),_(b.typedValue),f(b.unmaskedValue),d(b.value),n==null||n(b.value,b,v))},[n]),E=C.useCallback(()=>a.current&&(r==null?void 0:r(a.current.value,a.current)),[r]);return C.useEffect(()=>{const v=i.current;if(!v||!(t!=null&&t.mask))return g();const b=a.current;b?b==null||b.updateOptions(t):v&&t!=null&&t.mask&&(a.current=Ge(v,t),h()),s(!!a.current)},[t,g,h]),C.useEffect(()=>{if(!a.current)return;const v=a.current;return v.on("accept",h),v.on("complete",E),()=>{v.off("accept",h),v.off("complete",E)}},[h,E]),C.useEffect(()=>{const{value:v,...b}=l,S=a.current;S&&o&&(v!==u&&(S.value=u),c(b))},[u]),C.useEffect(()=>{const{unmaskedValue:v,...b}=l,S=a.current;S&&o&&(v!==p&&(S.unmaskedValue=p),c(b))},[p]),C.useEffect(()=>{const{typedValue:v,...b}=l,S=a.current;S&&o&&(v!==m&&(S.typedValue=m),c(b))},[m]),C.useEffect(()=>g,[g]),{ref:i,maskRef:a,value:u,setValue:d,unmaskedValue:p,setUnmaskedValue:f,typedValue:m,setTypedValue:_}}const dh=C.forwardRef(({name:t,value:e,mask:n,onChange:r,...i},a)=>{const{ref:o,unmaskedValue:s,value:l,maskRef:c}=ple({mask:n});return C.useEffect(()=>{c.current.value=e||""},[c,e]),C.useEffect(()=>{r({target:{name:t,value:s||e||""}})},[t,s,e]),w.jsx(ne.TextField,{inputRef:a,inputProps:{ref:o},name:t,value:l,onChange:()=>r({target:{name:t,value:s}}),...i})});dh.displayName="MaskedInput";function fle(t){let e;switch(t){case"top-left":e={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":e={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":e={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":e={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":e={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":e={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":e={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":e={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":e={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:e={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return e}const _le=$t("span")(({arrow:t,theme:e})=>{const i=`solid 1px ${Ee(e.palette.grey[500],.12)}`,a={borderRadius:"0 0 3px 0",top:-6,borderBottom:i,borderRight:i},o={borderRadius:"3px 0 0 0",bottom:-6,borderTop:i,borderLeft:i},s={borderRadius:"0 3px 0 0",left:-6,borderTop:i,borderRight:i},l={borderRadius:"0 0 0 3px",right:-6,borderBottom:i,borderLeft:i};return{display:"none",[e.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:'""',display:"block",position:"absolute",transform:"rotate(-135deg)",background:e.palette.background.paper},...t==="top-left"&&{...a,left:20},...t==="top-center"&&{...a,left:0,right:0,margin:"auto"},...t==="top-right"&&{...a,right:20},...t==="bottom-left"&&{...o,left:20},...t==="bottom-center"&&{...o,left:0,right:0,margin:"auto"},...t==="bottom-right"&&{...o,right:20},...t==="left-top"&&{...s,top:20},...t==="left-center"&&{...s,top:0,bottom:0,margin:"auto"},...t==="left-bottom"&&{...s,bottom:20},...t==="right-top"&&{...l,top:20},...t==="right-center"&&{...l,top:0,bottom:0,margin:"auto"},...t==="right-bottom"&&{...l,bottom:20}}}),mle=({open:t,children:e,arrow:n="top-right",disabledArrow:r,sx:i,...a})=>{const{style:o,anchorOrigin:s,transformOrigin:l}=fle(n);return w.jsxs(ne.Popover,{open:!!t,anchorEl:t,anchorOrigin:s,transformOrigin:l,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...o,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...i}},...a,children:[!r&&w.jsx(_le,{arrow:n}),e]})},gle=({children:t,container:e})=>Jo.createPortal(t,document.getElementById(e)||document.body);var hle=!!(typeof window<"u"&&window.document&&window.document.createElement),Ele=hle;const U1=jn(Ele);var Na=function(){return Na=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Na.apply(this,arguments)},Aa=null,G1=null;U1&&window.addEventListener("resize",function(){G1!==window.devicePixelRatio&&(G1=window.devicePixelRatio,Aa=null)});function $1(){if(Aa===null){if(typeof document>"u")return Aa=0,Aa;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var n=e.getBoundingClientRect().right;t.removeChild(e),Aa=n}return Aa}function q1(t){return!t||!t.ownerDocument||!t.ownerDocument.defaultView?window:t.ownerDocument.defaultView}function Y1(t){return!t||!t.ownerDocument?document:t.ownerDocument}var V1=function(t){var e={},n=Array.prototype.reduce.call(t,function(r,i){var a=i.name.match(/data-simplebar-(.+)/);if(a){var o=a[1].replace(/\W+(.)/g,function(s,l){return l.toUpperCase()});switch(i.value){case"true":r[o]=!0;break;case"false":r[o]=!1;break;case void 0:r[o]=!0;break;default:r[o]=i.value}}return r},e);return n};function H1(t,e){var n;t&&(n=t.classList).add.apply(n,e.split(" "))}function z1(t,e){t&&e.split(" ").forEach(function(n){t.classList.remove(n)})}function W1(t){return".".concat(t.split(" ").join("."))}var ble=Object.freeze({__proto__:null,getElementWindow:q1,getElementDocument:Y1,getOptions:V1,addClasses:H1,removeClasses:z1,classNamesToQuery:W1}),Ar=q1,ph=Y1,vle=V1,Ir=H1,xr=z1,on=W1,vc=function(){function t(e,n){n===void 0&&(n={});var r=this;if(this.removePreventClickId=null,this.minScrollbarWidth=20,this.stopScrollDelay=175,this.isScrolling=!1,this.isMouseEntering=!1,this.scrollXTicking=!1,this.scrollYTicking=!1,this.wrapperEl=null,this.contentWrapperEl=null,this.contentEl=null,this.offsetEl=null,this.maskEl=null,this.placeholderEl=null,this.heightAutoObserverWrapperEl=null,this.heightAutoObserverEl=null,this.rtlHelpers=null,this.scrollbarWidth=0,this.resizeObserver=null,this.mutationObserver=null,this.elStyles=null,this.isRtl=null,this.mouseX=0,this.mouseY=0,this.onMouseMove=function(){},this.onWindowResize=function(){},this.onStopScrolling=function(){},this.onMouseEntered=function(){},this.onScroll=function(){var i=Ar(r.el);r.scrollXTicking||(i.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(i.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0),r.isScrolling||(r.isScrolling=!0,Ir(r.el,r.classNames.scrolling)),r.showScrollbar("x"),r.showScrollbar("y"),r.onStopScrolling()},this.scrollX=function(){r.axis.x.isOverflowing&&r.positionScrollbar("x"),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&r.positionScrollbar("y"),r.scrollYTicking=!1},this._onStopScrolling=function(){xr(r.el,r.classNames.scrolling),r.options.autoHide&&(r.hideScrollbar("x"),r.hideScrollbar("y")),r.isScrolling=!1},this.onMouseEnter=function(){r.isMouseEntering||(Ir(r.el,r.classNames.mouseEntered),r.showScrollbar("x"),r.showScrollbar("y"),r.isMouseEntering=!0),r.onMouseEntered()},this._onMouseEntered=function(){xr(r.el,r.classNames.mouseEntered),r.options.autoHide&&(r.hideScrollbar("x"),r.hideScrollbar("y")),r.isMouseEntering=!1},this._onMouseMove=function(i){r.mouseX=i.clientX,r.mouseY=i.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this._onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.onPointerEvent=function(i){if(!(!r.axis.x.track.el||!r.axis.y.track.el||!r.axis.x.scrollbar.el||!r.axis.y.scrollbar.el)){var a,o;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(a=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(o=r.isWithinBounds(r.axis.y.track.rect)),(a||o)&&(i.stopPropagation(),i.type==="pointerdown"&&i.pointerType!=="touch"&&(a&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(i,"x"):r.onTrackClick(i,"x")),o&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(i,"y"):r.onTrackClick(i,"y"))))}},this.drag=function(i){var a,o,s,l,c,u,d,p,f,m,_;if(!(!r.draggedAxis||!r.contentWrapperEl)){var g,h=r.axis[r.draggedAxis].track,E=(o=(a=h.rect)===null||a===void 0?void 0:a[r.axis[r.draggedAxis].sizeAttr])!==null&&o!==void 0?o:0,v=r.axis[r.draggedAxis].scrollbar,b=(l=(s=r.contentWrapperEl)===null||s===void 0?void 0:s[r.axis[r.draggedAxis].scrollSizeAttr])!==null&&l!==void 0?l:0,S=parseInt((u=(c=r.elStyles)===null||c===void 0?void 0:c[r.axis[r.draggedAxis].sizeAttr])!==null&&u!==void 0?u:"0px",10);i.preventDefault(),i.stopPropagation(),r.draggedAxis==="y"?g=i.pageY:g=i.pageX;var O=g-((p=(d=h.rect)===null||d===void 0?void 0:d[r.axis[r.draggedAxis].offsetAttr])!==null&&p!==void 0?p:0)-r.axis[r.draggedAxis].dragOffset;O=r.draggedAxis==="x"&&r.isRtl?((m=(f=h.rect)===null||f===void 0?void 0:f[r.axis[r.draggedAxis].sizeAttr])!==null&&m!==void 0?m:0)-v.size-O:O;var y=O/(E-v.size),T=y*(b-S);r.draggedAxis==="x"&&r.isRtl&&(T=!((_=t.getRtlHelpers())===null||_===void 0)&&_.isScrollingToNegative?-T:T),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=T}},this.onEndDrag=function(i){var a=ph(r.el),o=Ar(r.el);i.preventDefault(),i.stopPropagation(),xr(r.el,r.classNames.dragging),a.removeEventListener("mousemove",r.drag,!0),a.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",r.preventClick,!0),a.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null})},this.preventClick=function(i){i.preventDefault(),i.stopPropagation()},this.el=e,this.options=Na(Na({},t.defaultOptions),n),this.classNames=Na(Na({},t.defaultOptions.classNames),n.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,forceVisible:!1,track:{size:null,el:null,rect:null,isVisible:!1},scrollbar:{size:null,el:null,rect:null,isVisible:!1}}},typeof this.el!="object"||!this.el.nodeName)throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));this.onMouseMove=O0(this._onMouseMove,64),this.onWindowResize=Po(this._onWindowResize,64,{leading:!0}),this.onStopScrolling=Po(this._onStopScrolling,this.stopScrollDelay),this.onMouseEntered=Po(this._onMouseEntered,this.stopScrollDelay),this.init()}return t.getRtlHelpers=function(){if(t.rtlHelpers)return t.rtlHelpers;var e=document.createElement("div");e.innerHTML='<div class="simplebar-dummy-scrollbar-size"><div></div></div>';var n=e.firstElementChild,r=n==null?void 0:n.firstElementChild;if(!r)return null;document.body.appendChild(n),n.scrollLeft=0;var i=t.getOffset(n),a=t.getOffset(r);n.scrollLeft=-999;var o=t.getOffset(r);return document.body.removeChild(n),t.rtlHelpers={isScrollOriginAtZero:i.left!==a.left,isScrollingToNegative:a.left!==o.left},t.rtlHelpers},t.prototype.getScrollbarWidth=function(){try{return this.contentWrapperEl&&getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:$1()}catch{return $1()}},t.getOffset=function(e){var n=e.getBoundingClientRect(),r=ph(e),i=Ar(e);return{top:n.top+(i.pageYOffset||r.documentElement.scrollTop),left:n.left+(i.pageXOffset||r.documentElement.scrollLeft)}},t.prototype.init=function(){U1&&(this.initDOM(),this.rtlHelpers=t.getRtlHelpers(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.prototype.initDOM=function(){var e,n;this.wrapperEl=this.el.querySelector(on(this.classNames.wrapper)),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector(on(this.classNames.contentWrapper)),this.contentEl=this.options.contentNode||this.el.querySelector(on(this.classNames.contentEl)),this.offsetEl=this.el.querySelector(on(this.classNames.offset)),this.maskEl=this.el.querySelector(on(this.classNames.mask)),this.placeholderEl=this.findChild(this.wrapperEl,on(this.classNames.placeholder)),this.heightAutoObserverWrapperEl=this.el.querySelector(on(this.classNames.heightAutoObserverWrapperEl)),this.heightAutoObserverEl=this.el.querySelector(on(this.classNames.heightAutoObserverEl)),this.axis.x.track.el=this.findChild(this.el,"".concat(on(this.classNames.track)).concat(on(this.classNames.horizontal))),this.axis.y.track.el=this.findChild(this.el,"".concat(on(this.classNames.track)).concat(on(this.classNames.vertical))),this.axis.x.scrollbar.el=((e=this.axis.x.track.el)===null||e===void 0?void 0:e.querySelector(on(this.classNames.scrollbar)))||null,this.axis.y.scrollbar.el=((n=this.axis.y.track.el)===null||n===void 0?void 0:n.querySelector(on(this.classNames.scrollbar)))||null,this.options.autoHide||(Ir(this.axis.x.scrollbar.el,this.classNames.visible),Ir(this.axis.y.scrollbar.el,this.classNames.visible))},t.prototype.initListeners=function(){var e=this,n,r=Ar(this.el);if(this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("pointerdown",this.onPointerEvent,!0),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),(n=this.contentWrapperEl)===null||n===void 0||n.addEventListener("scroll",this.onScroll),r.addEventListener("resize",this.onWindowResize),!!this.contentEl){if(window.ResizeObserver){var i=!1,a=r.ResizeObserver||ResizeObserver;this.resizeObserver=new a(function(){i&&r.requestAnimationFrame(function(){e.recalculate()})}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),r.requestAnimationFrame(function(){i=!0})}this.mutationObserver=new r.MutationObserver(function(){r.requestAnimationFrame(function(){e.recalculate()})}),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})}},t.prototype.recalculate=function(){if(!(!this.heightAutoObserverEl||!this.contentEl||!this.contentWrapperEl||!this.wrapperEl||!this.placeholderEl)){var e=Ar(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var n=this.contentEl.offsetWidth,r=this.heightAutoObserverEl.offsetHeight<=1,i=this.heightAutoObserverEl.offsetWidth<=1||n>0,a=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding="".concat(this.elStyles.paddingTop," ").concat(this.elStyles.paddingRight," ").concat(this.elStyles.paddingBottom," ").concat(this.elStyles.paddingLeft),this.wrapperEl.style.margin="-".concat(this.elStyles.paddingTop," -").concat(this.elStyles.paddingRight," -").concat(this.elStyles.paddingBottom," -").concat(this.elStyles.paddingLeft);var l=this.contentEl.scrollHeight,c=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=r?"auto":"100%",this.placeholderEl.style.width=i?"".concat(n||c,"px"):"auto",this.placeholderEl.style.height="".concat(l,"px");var u=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=n!==0&&c>n,this.axis.y.isOverflowing=l>u,this.axis.x.isOverflowing=o==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=s==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var d=this.axis.x.isOverflowing?this.scrollbarWidth:0,p=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&c>a-p,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&l>u-d,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el&&(this.axis.x.scrollbar.el.style.width="".concat(this.axis.x.scrollbar.size,"px")),this.axis.y.scrollbar.el&&(this.axis.y.scrollbar.el.style.height="".concat(this.axis.y.scrollbar.size,"px")),this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}},t.prototype.getScrollbarSize=function(e){var n,r;if(e===void 0&&(e="y"),!this.axis[e].isOverflowing||!this.contentEl)return 0;var i=this.contentEl[this.axis[e].scrollSizeAttr],a=(r=(n=this.axis[e].track.el)===null||n===void 0?void 0:n[this.axis[e].offsetSizeAttr])!==null&&r!==void 0?r:0,o=a/i,s;return s=Math.max(~~(o*a),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(s=Math.min(s,this.options.scrollbarMaxSize)),s},t.prototype.positionScrollbar=function(e){var n,r,i;e===void 0&&(e="y");var a=this.axis[e].scrollbar;if(!(!this.axis[e].isOverflowing||!this.contentWrapperEl||!a.el||!this.elStyles)){var o=this.contentWrapperEl[this.axis[e].scrollSizeAttr],s=((n=this.axis[e].track.el)===null||n===void 0?void 0:n[this.axis[e].offsetSizeAttr])||0,l=parseInt(this.elStyles[this.axis[e].sizeAttr],10),c=this.contentWrapperEl[this.axis[e].scrollOffsetAttr];c=e==="x"&&this.isRtl&&(!((r=t.getRtlHelpers())===null||r===void 0)&&r.isScrollOriginAtZero)?-c:c,e==="x"&&this.isRtl&&(c=!((i=t.getRtlHelpers())===null||i===void 0)&&i.isScrollingToNegative?c:-c);var u=c/(o-l),d=~~((s-a.size)*u);d=e==="x"&&this.isRtl?-d+(s-a.size):d,a.el.style.transform=e==="x"?"translate3d(".concat(d,"px, 0, 0)"):"translate3d(0, ".concat(d,"px, 0)")}},t.prototype.toggleTrackVisibility=function(e){e===void 0&&(e="y");var n=this.axis[e].track.el,r=this.axis[e].scrollbar.el;!n||!r||!this.contentWrapperEl||(this.axis[e].isOverflowing||this.axis[e].forceVisible?(n.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll",this.el.classList.add("".concat(this.classNames.scrollable,"-").concat(e))):(n.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden",this.el.classList.remove("".concat(this.classNames.scrollable,"-").concat(e))),this.axis[e].isOverflowing?r.style.display="block":r.style.display="none")},t.prototype.showScrollbar=function(e){e===void 0&&(e="y"),this.axis[e].isOverflowing&&!this.axis[e].scrollbar.isVisible&&(Ir(this.axis[e].scrollbar.el,this.classNames.visible),this.axis[e].scrollbar.isVisible=!0)},t.prototype.hideScrollbar=function(e){e===void 0&&(e="y"),this.axis[e].isOverflowing&&this.axis[e].scrollbar.isVisible&&(xr(this.axis[e].scrollbar.el,this.classNames.visible),this.axis[e].scrollbar.isVisible=!1)},t.prototype.hideNativeScrollbar=function(){this.offsetEl&&(this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px",this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-".concat(this.scrollbarWidth,"px"):"0px")},t.prototype.onMouseMoveForAxis=function(e){e===void 0&&(e="y");var n=this.axis[e];!n.track.el||!n.scrollbar.el||(n.track.rect=n.track.el.getBoundingClientRect(),n.scrollbar.rect=n.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(n.track.rect)?(this.showScrollbar(e),Ir(n.track.el,this.classNames.hover),this.isWithinBounds(n.scrollbar.rect)?Ir(n.scrollbar.el,this.classNames.hover):xr(n.scrollbar.el,this.classNames.hover)):(xr(n.track.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(e)))},t.prototype.onMouseLeaveForAxis=function(e){e===void 0&&(e="y"),xr(this.axis[e].track.el,this.classNames.hover),xr(this.axis[e].scrollbar.el,this.classNames.hover),this.options.autoHide&&this.hideScrollbar(e)},t.prototype.onDragStart=function(e,n){var r;n===void 0&&(n="y");var i=ph(this.el),a=Ar(this.el),o=this.axis[n].scrollbar,s=n==="y"?e.pageY:e.pageX;this.axis[n].dragOffset=s-(((r=o.rect)===null||r===void 0?void 0:r[this.axis[n].offsetAttr])||0),this.draggedAxis=n,Ir(this.el,this.classNames.dragging),i.addEventListener("mousemove",this.drag,!0),i.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(i.addEventListener("click",this.preventClick,!0),i.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.prototype.onTrackClick=function(e,n){var r=this,i,a,o,s;n===void 0&&(n="y");var l=this.axis[n];if(!(!this.options.clickOnTrack||!l.scrollbar.el||!this.contentWrapperEl)){e.preventDefault();var c=Ar(this.el);this.axis[n].scrollbar.rect=l.scrollbar.el.getBoundingClientRect();var u=this.axis[n].scrollbar,d=(a=(i=u.rect)===null||i===void 0?void 0:i[this.axis[n].offsetAttr])!==null&&a!==void 0?a:0,p=parseInt((s=(o=this.elStyles)===null||o===void 0?void 0:o[this.axis[n].sizeAttr])!==null&&s!==void 0?s:"0px",10),f=this.contentWrapperEl[this.axis[n].scrollOffsetAttr],m=n==="y"?this.mouseY-d:this.mouseX-d,_=m<0?-1:1,g=_===-1?f-p:f+p,h=40,E=function(){r.contentWrapperEl&&(_===-1?f>g&&(f-=h,r.contentWrapperEl[r.axis[n].scrollOffsetAttr]=f,c.requestAnimationFrame(E)):f<g&&(f+=h,r.contentWrapperEl[r.axis[n].scrollOffsetAttr]=f,c.requestAnimationFrame(E)))};E()}},t.prototype.getContentElement=function(){return this.contentEl},t.prototype.getScrollElement=function(){return this.contentWrapperEl},t.prototype.removeListeners=function(){var e=Ar(this.el);this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("pointerdown",this.onPointerEvent,!0),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.onMouseMove.cancel(),this.onWindowResize.cancel(),this.onStopScrolling.cancel(),this.onMouseEntered.cancel()},t.prototype.unMount=function(){this.removeListeners()},t.prototype.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.prototype.findChild=function(e,n){var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,function(i){return r.call(i,n)})[0]},t.rtlHelpers=null,t.defaultOptions={forceVisible:!1,clickOnTrack:!0,scrollbarMinSize:25,scrollbarMaxSize:0,ariaLabel:"scrollable content",classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging",scrolling:"simplebar-scrolling",scrollable:"simplebar-scrollable",mouseEntered:"simplebar-mouse-entered"},scrollableNode:null,contentNode:null,autoHide:!0},t.getOptions=vle,t.helpers=ble,t}(),En=function(){return En=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},En.apply(this,arguments)};function Sle(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}var j1=Le.forwardRef(function(t,e){var n=t.children,r=t.scrollableNodeProps,i=r===void 0?{}:r,a=Sle(t,["children","scrollableNodeProps"]),o=Le.useRef(),s=Le.useRef(),l=Le.useRef(),c={},u={};Object.keys(a).forEach(function(f){Object.prototype.hasOwnProperty.call(vc.defaultOptions,f)?c[f]=a[f]:u[f]=a[f]});var d=En(En({},vc.defaultOptions.classNames),c.classNames),p=En(En({},i),{className:"".concat(d.contentWrapper).concat(i.className?" ".concat(i.className):""),tabIndex:0,role:"region","aria-label":c.ariaLabel||vc.defaultOptions.ariaLabel});return Le.useEffect(function(){var f;return s.current=p.ref?p.ref.current:s.current,o.current&&(f=new vc(o.current,En(En(En({},c),s.current&&{scrollableNode:s.current}),l.current&&{contentNode:l.current})),typeof e=="function"?e(f):e&&(e.current=f)),function(){f==null||f.unMount(),f=null,typeof e=="function"&&e(null)}},[]),Le.createElement("div",En({"data-simplebar":"init",ref:o},u),Le.createElement("div",{className:d.wrapper},Le.createElement("div",{className:d.heightAutoObserverWrapperEl},Le.createElement("div",{className:d.heightAutoObserverEl})),Le.createElement("div",{className:d.mask},Le.createElement("div",{className:d.offset},typeof n=="function"?n({scrollableNodeRef:s,scrollableNodeProps:En(En({},p),{ref:s}),contentNodeRef:l,contentNodeProps:{className:d.contentEl,ref:l}}):Le.createElement("div",En({},p),Le.createElement("div",{className:d.contentEl},n)))),Le.createElement("div",{className:d.placeholder})),Le.createElement("div",{className:"".concat(d.track," simplebar-horizontal")},Le.createElement("div",{className:d.scrollbar})),Le.createElement("div",{className:"".concat(d.track," simplebar-vertical")},Le.createElement("div",{className:d.scrollbar})))});j1.displayName="SimpleBar";const yle=$t("div")(()=>({flexGrow:1,height:"100%",overflow:"hidden"})),Tle=$t(j1)(({theme:t})=>({maxHeight:"100%","& .simplebar-scrollbar":{"&:before":{backgroundColor:Ee(t.palette.grey[600],.48)},"&.simplebar-visible:before":{opacity:1}},"& .simplebar-mask":{zIndex:"inherit"}})),Ole=({children:t,sx:e,...n})=>{const r=typeof navigator>"u"?"SSR":navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r)?w.jsx(ne.Box,{sx:{overflowX:"auto",...e},...n,children:t}):w.jsx(yle,{children:w.jsx(Tle,{clickOnTrack:!1,sx:e,...n,children:t})})},Cle=C.memo(Ole),Rle=({onSearch:t,onChange:e,trigger:n="click",iconPosition:r="end",...i})=>{const a=C.useRef(null),o=w.jsx(ne.InputAdornment,{position:r,children:w.jsx(ne.IconButton,{color:"inherit",onClick:()=>{var s;t((s=a.current)==null?void 0:s.value)},children:w.jsx(Yt,{icon:"eva:search-fill",sx:{width:20,height:20}})})});return w.jsx(ne.TextField,{inputRef:a,InputProps:{onKeyDown:s=>{var l;s.key==="Enter"&&t((l=a.current)==null?void 0:l.value)},...r==="start"?{startAdornment:o}:{endAdornment:o}},onChange:s=>{if(n==="change"){t(s.target.value);return}s.target.value===""&&t(""),e&&e(s)},...i})},Nle=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:a,fieldState:{error:o}})=>w.jsx(Ld,{...a,...r,onChange:s=>a.onChange(s),error:!!o,helperText:(o==null?void 0:o.message)||e})})},Ale=({name:t,helperText:e,...n})=>{const{control:r}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:i,fieldState:{error:a}})=>w.jsxs("div",{children:[w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Checkbox,{...i,checked:i.value}),...n}),(!!a||e)&&w.jsx(ne.FormHelperText,{error:!!a,children:a?a==null?void 0:a.message:e})]})})},Ile=({row:t,name:e,label:n,options:r,spacing:i,helperText:a,...o})=>{const{control:s}=_t.useFormContext(),l=(c,u)=>c.includes(u)?c.filter(d=>d!==u):[...c,u];return w.jsx(_t.Controller,{name:e,control:s,render:({field:c,fieldState:{error:u}})=>w.jsxs(ne.FormControl,{component:"fieldset",children:[n&&w.jsx(ne.FormLabel,{component:"legend",sx:{typography:"body2"},children:n}),w.jsx(ne.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:i||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:i||2}}}},children:r.map(d=>w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Checkbox,{checked:c.value.includes(d.value),onChange:()=>c.onChange(l(c.value,d.value))}),label:d.label,...o},d.value))}),(!!u||a)&&w.jsx(ne.FormHelperText,{error:!!u,sx:{mx:0},children:u?u==null?void 0:u.message:a})]})})},xle=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>w.jsx(hO,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},wle=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.DatePicker,{inputRef:r,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})},Dle=({name:t,label:e,...n})=>{const{control:r,setError:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:{value:a,onChange:o},fieldState:{error:s}})=>w.jsx(Ma.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...n.localeText},value:[(a==null?void 0:a.startDate)||null,(a==null?void 0:a.endDate)||null],onChange:l=>o({startDate:l[0],endDate:l[1]}),onError:l=>{i(t,{message:l[0]||l[1]||void 0})},...n,slotProps:{textField:({position:l})=>{var c;return{...(c=n.slotProps)==null?void 0:c.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:l==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`}}},sx:{width:1}})})},Mle=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:r,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})},Ple=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onBlur:o,onChange:s,value:l},fieldState:{error:c}})=>w.jsx(d1,{id:`quill${a}`,onBlur:o,onChange:s,value:l,error:!!c,helperText:(c==null?void 0:c.message)||e,...r})})},K1=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,...o},fieldState:{error:s}})=>w.jsx(ne.TextField,{...o,inputRef:a,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...r})})},Lle=({id:t,children:e,onSubmit:n,methods:r})=>w.jsx(_t.FormProvider,{...r,children:w.jsx(ne.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,children:e})}),kle=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>w.jsx(dh,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},Fle=t=>{const[e,n]=C.useState(!1);return w.jsx(K1,{...t,type:e?"text":"password",InputProps:{endAdornment:w.jsx(ne.InputAdornment,{position:"end",children:w.jsx(ne.IconButton,{onClick:()=>n(!e),edge:"end","aria-label":"Mostrar/Ocultar senha",children:w.jsx(Yt,{icon:e?"eva:eye-off-fill":"eva:eye-fill"})})})}})},Ble=({name:t,helperText:e,...n})=>{const{control:r}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:r,render:({field:i,fieldState:{error:a}})=>w.jsxs("div",{children:[w.jsx(ne.FormControlLabel,{control:w.jsx(ne.Switch,{...i,checked:i.value}),...n}),(!!a||e)&&w.jsx(ne.FormHelperText,{error:!!a,children:a?a==null?void 0:a.message:e})]})})},Ule=({name:t,...e})=>{const{control:n}=_t.useFormContext();return w.jsx(_t.Controller,{name:t,control:n,render:({field:{ref:r,...i},fieldState:{error:a}})=>{var o;return w.jsx(Ma.TimePicker,{ampm:!1,format:"HH:mm",inputRef:r,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...e.localeText},...i,...e,value:i.value?new Date(i.value):null,slotProps:{textField:{...(o=e.slotProps)==null?void 0:o.textField,error:!!a,helperText:a==null?void 0:a.message,autoComplete:"off",spellCheck:"false",fullWidth:!0}}})}})};function Ia(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})}function xa(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1],a=c;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(c);break}a[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Q1(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function X1(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var Gle=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Qo(t,e){var n=$le(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function $le(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),i=Gle.get(r);i&&Object.defineProperty(t,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return t}var qle=[".DS_Store","Thumbs.db"];function Yle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return Sc(t)&&Vle(t.dataTransfer)?[2,jle(t.dataTransfer,t.type)]:Hle(t)?[2,zle(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,Wle(t)]:[2,[]]})})}function Vle(t){return Sc(t)}function Hle(t){return Sc(t)&&Sc(t.target)}function Sc(t){return typeof t=="object"&&t!==null}function zle(t){return fh(t.target.files).map(function(e){return Qo(e)})}function Wle(t){return Ia(this,void 0,void 0,function(){var e;return xa(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Qo(r)})]}})})}function jle(t,e){return Ia(this,void 0,void 0,function(){var n,r;return xa(this,function(i){switch(i.label){case 0:return t.items?(n=fh(t.items).filter(function(a){return a.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(Kle))]):[3,2];case 1:return r=i.sent(),[2,Z1(J1(r))];case 2:return[2,Z1(fh(t.files).map(function(a){return Qo(a)}))]}})})}function Z1(t){return t.filter(function(e){return qle.indexOf(e.name)===-1})}function fh(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r)}return e}function Kle(t){if(typeof t.webkitGetAsEntry!="function")return eI(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?tI(e):eI(t)}function J1(t){return t.reduce(function(e,n){return X1(X1([],Q1(e),!1),Q1(Array.isArray(n)?J1(n):[n]),!1)},[])}function eI(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=Qo(e);return Promise.resolve(n)}function Qle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return[2,t.isDirectory?tI(t):Xle(t)]})})}function tI(t){var e=t.createReader();return new Promise(function(n,r){var i=[];function a(){var o=this;e.readEntries(function(s){return Ia(o,void 0,void 0,function(){var l,c,u;return xa(this,function(d){switch(d.label){case 0:if(s.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(s.map(Qle)),i.push(u),a(),d.label=6;case 6:return[2]}})})},function(s){r(s)})}a()})}function Xle(t){return Ia(this,void 0,void 0,function(){return xa(this,function(e){return[2,new Promise(function(n,r){t.file(function(i){var a=Qo(i,t.fullPath);n(a)},function(i){r(i)})})]})})}var Zle=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",i=(t.type||"").toLowerCase(),a=i.replace(/\/.*$/,"");return n.some(function(o){var s=o.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?a===s.replace(/\/.*$/,""):i===s})}return!0};function nI(t){return tce(t)||ece(t)||oI(t)||Jle()}function Jle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
291
291
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ece(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tce(t){if(Array.isArray(t))return _h(t)}function rI(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function iI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rI(Object(n),!0).forEach(function(r){aI(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function aI(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xo(t,e){return ice(t)||rce(t,e)||oI(t,e)||nce()}function nce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
292
292
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oI(t,e){if(t){if(typeof t=="string")return _h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _h(t,e)}}function _h(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rce(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function ice(t){if(Array.isArray(t))return t}var ace="file-invalid-type",oce="file-too-large",sce="file-too-small",lce="too-many-files",cce=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:ace,message:"File type must be ".concat(n)}},sI=function(e){return{code:oce,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},lI=function(e){return{code:sce,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},uce={code:lce,message:"Too many files"};function cI(t,e){var n=t.type==="application/x-moz-file"||Zle(t,e);return[n,n?null:cce(e)]}function uI(t,e,n){if(di(t.size))if(di(e)&&di(n)){if(t.size>n)return[!1,sI(n)];if(t.size<e)return[!1,lI(e)]}else{if(di(e)&&t.size<e)return[!1,lI(e)];if(di(n)&&t.size>n)return[!1,sI(n)]}return[!0,null]}function di(t){return t!=null}function dce(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,a=t.multiple,o=t.maxFiles,s=t.validator;return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(function(l){var c=cI(l,n),u=Xo(c,1),d=u[0],p=uI(l,r,i),f=Xo(p,1),m=f[0],_=s?s(l):null;return d&&m&&!_})}function yc(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function Tc(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function dI(t){t.preventDefault()}function pce(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function fce(t){return t.indexOf("Edge/")!==-1}function _ce(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return pce(t)||fce(t)}function zn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return e.some(function(s){return!yc(r)&&s&&s.apply(void 0,[r].concat(a)),yc(r)})}}function mce(){return"showOpenFilePicker"in window}function gce(t){if(di(t)){var e=Object.entries(t).filter(function(n){var r=Xo(n,2),i=r[0],a=r[1],o=!0;return pI(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(a)||!a.every(fI))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=Xo(r,2),a=i[0],o=i[1];return iI(iI({},n),{},aI({},a,o))},{});return[{description:"Files",accept:e}]}return t}function hce(t){if(di(t))return Object.entries(t).reduce(function(e,n){var r=Xo(n,2),i=r[0],a=r[1];return[].concat(nI(e),[i],nI(a))},[]).filter(function(e){return pI(e)||fI(e)}).join(",")}function Ece(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function bce(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function pI(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function fI(t){return/^.*\.[\w]+$/.test(t)}var vce=["children"],Sce=["open"],yce=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Tce=["refKey","onChange","onClick"];function Oce(t){return Nce(t)||Rce(t)||_I(t)||Cce()}function Cce(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
293
293
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rce(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nce(t){if(Array.isArray(t))return gh(t)}function mh(t,e){return xce(t)||Ice(t,e)||_I(t,e)||Ace()}function Ace(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|