@ceed/ads 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/framer/index.js +1 -1
- package/package.json +2 -2
package/framer/index.js
CHANGED
|
@@ -124,7 +124,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
124
124
|
Prefix can't start with '-' when allowNegative is true.
|
|
125
125
|
prefix: `+n+`
|
|
126
126
|
allowNegative: `+a+`
|
|
127
|
-
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function u7(e){e=c7(e);var t=e.decimalSeparator,r=e.allowedDecimalSeparators,o=e.thousandsGroupStyle,n=e.suffix,a=e.allowNegative,i=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=bi);var l=e.onBlur;l===void 0&&(l=bi);var p=e.thousandSeparator,c=e.decimalScale,u=e.fixedDecimalScale,f=e.prefix;f===void 0&&(f="");var d=e.defaultValue,y=e.value,h=e.valueIsNumericString,b=e.onValueChange,v=y_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=oy(e),g=x.decimalSeparator,S=x.allowedDecimalSeparators,T=function(F){return m_(F,e)},P=function(F,R){return l7(F,R,e)},C=pp(y)?d:y,k=h!=null?h:s7(C,f,n);pp(y)?pp(d)||(k=k||typeof d=="number"):k=k||typeof y=="number";var I=function(F){return g_(F)?F:(typeof F=="number"&&(F=x_(F)),k&&typeof c=="number"?d_(F,c,!!u):F)},_=P_(I(y),I(d),!!k,T,P,b),A=_[0],M=A.numAsString,O=A.formattedValue,z=_[1],L=function(F){var R=F.target,K=F.key,oe=R.selectionStart,w=R.selectionEnd,ce=R.value;if(ce===void 0&&(ce=""),oe!==w){s(F);return}K==="Backspace"&&ce[0]==="-"&&oe===f.length+1&&a&&Is(R,1),c&&u&&(K==="Backspace"&&ce[oe-1]===g?(Is(R,oe-1),F.preventDefault()):K==="Delete"&&ce[oe]===g&&F.preventDefault()),S!=null&&S.includes(K)&&ce[oe]===g&&Is(R,oe+1);var he=p===!0?",":p;K==="Backspace"&&ce[oe-1]===he&&Is(R,oe-1),K==="Delete"&&ce[oe]===he&&Is(R,oe+1),s(F)},D=function(F){var R=M;if(R.match(/\d/g)||(R=""),i||(R=q6(R)),u&&c&&(R=d_(R,c,u)),R!==M){var K=m_(R,e);z({formattedValue:K,value:R,floatValue:parseFloat(R)},{event:F,source:Pu.event})}l(F)},B=function(F){return F===g?!0:Cu(F)},U=function(F){var R=F.currentValue,K=F.lastValue,oe=F.formattedValue,w=F.currentValueIndex,ce=F.formattedValueIndex,he=R[w],Ne=oe[ce],ie=T_(K,R),W=ie.to;return w>=W.start&&w<W.end&&S&&S.includes(he)&&Ne===g?!0:he===Ne};return Object.assign(Object.assign({},v),{value:O,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:U,onValueChange:z,format:T,removeFormatting:P,getCaretBoundary:function(F){return p7(F,e)},onKeyDown:L,onBlur:D})}function ny(e){var t=u7(e);return lp.createElement(n7,Object.assign({},t))}import d7,{useCallback as f7}from"react";import{motion as m7}from"framer-motion";var h7=m7(Fl),Su=d7.forwardRef((e,t)=>{var P;let T=e,{label:r,helperText:o,error:n,style:a,size:i,color:s,disabled:l,required:p,onChange:c,name:u,sx:f,className:d,enableClearable:y}=T,h=xe(T,["label","helperText","error","style","size","color","disabled","required","onChange","name","sx","className","enableClearable"]),[b,v]=pr(e.value,e.defaultValue,f7(C=>{c==null||c({target:{value:(C==null?void 0:C.toString())||"",name:u||""}})},[c,u])),x=C=>{v(C.target.value)},g=()=>{v(e.defaultValue||"")},S=N(h7,ae(V({value:b,name:u,onChange:x,required:p,color:n?"danger":s,disabled:l,slotProps:V({input:V({ref:t},(P=h.slotProps)==null?void 0:P.input)},h.slotProps)},h),{endDecorator:y?Ee(Et,{gap:1,direction:"row",children:[h.endDecorator,b&&N(Jt,{onMouseDown:C=>C.preventDefault(),onClick:g,"aria-label":"Clear",children:N(Ah,{})})]}):h.endDecorator}));return Ee(Fn,{required:p,color:s,size:i,error:n,disabled:l,sx:f,className:d,children:[r&&N($n,{children:r}),S,o&&N(Vn,{children:o})]})});Su.displayName="Input";var Jr=Su;var y7={AED:2,ALL:2,AMD:2,ANG:2,AOA:2,ARS:2,AUD:2,AWG:2,AZN:2,BAM:2,BBD:2,BDT:2,BGN:2,BHD:3,BMD:2,BND:2,BOB:2,BRL:2,BSD:2,BWP:2,BYN:2,BZD:2,CAD:2,CHF:2,CLP:2,CNH:2,CNY:2,COP:2,CRC:2,CUP:2,CVE:0,CZK:2,DJF:0,DKK:2,DOP:2,DZD:2,EGP:2,ETB:2,EUR:2,FJD:2,FKP:2,GBP:2,GEL:2,GHS:2,GIP:2,GMD:2,GNF:0,GTQ:2,GYD:2,HKD:2,HNL:2,HTG:2,HUF:2,IDR:0,ILS:2,INR:2,IQD:3,ISK:2,JMD:2,JOD:3,JPY:0,KES:2,KGS:2,KHR:2,KMF:0,KRW:0,KWD:3,KYD:2,KZT:2,LAK:2,LBP:2,LKR:2,LYD:3,MAD:2,MDL:2,MKD:2,MMK:2,MNT:2,MOP:2,MRU:2,MUR:2,MVR:2,MWK:2,MXN:2,MYR:2,MZN:2,NAD:2,NGN:2,NIO:2,NOK:2,NPR:2,NZD:2,OMR:3,PAB:2,PEN:2,PGK:2,PHP:2,PKR:2,PLN:2,PYG:0,QAR:2,RON:2,RSD:2,RUB:2,RWF:0,SAR:2,SBD:2,SCR:2,SEK:2,SGD:2,SHP:2,SLE:2,SOS:2,SRD:2,STN:2,SVC:2,SZL:2,THB:2,TND:3,TOP:2,TRY:2,TTD:2,TWD:2,TZS:2,UAH:2,UGX:0,USD:2,UYU:2,UZS:2,VEF:2,VND:0,VUV:0,WST:2,XAF:0,XCD:2,XOF:0,XPF:0,YER:2,ZAR:2,ZMW:2},C_=(e="USD")=>{let[t,r,o,...n]=new c_(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split(""),a=y7[e];return{symbol:`${t} `,thousandSeparator:r,decimalSeparator:o,placeholder:o?`${t} 0${o}${Array.from(Array(a)).map(()=>0).join("")}`:`${t} 0`,fixedDecimalScale:!!o,decimalScale:a}};var v7=R_.forwardRef(function(t,r){let a=t,{onChange:o}=a,n=xe(a,["onChange"]);return N(ny,ae(V({},n),{onValueChange:({value:i})=>{o==null||o({target:{name:t.name,value:i}})},valueIsNumericString:!0,getInputRef:r,allowNegative:!1}))}),b7=E(Jr,{name:"CurrencyInput",slot:"root",overridesResolver:(e,t)=>t.root})({}),ay=R_.forwardRef(function(t,r){let o=G({props:t,name:"CurrencyInput"}),O=o,{currency:n="USD",name:a,onChange:i,label:s,error:l,helperText:p,required:c,disabled:u,useMinorUnit:f,sx:d,className:y}=O,h=xe(O,["currency","name","onChange","label","error","helperText","required","disabled","useMinorUnit","sx","className"]),{symbol:b,thousandSeparator:v,decimalSeparator:x,placeholder:g,fixedDecimalScale:S,decimalScale:T}=C_(n),[P,C]=pr(o.value,o.defaultValue,S_(z=>i==null?void 0:i({target:{name:a,value:z}}),[i,a])),k=k_(()=>P&&f?P/Math.pow(10,T):P,[P,f,T]),I=k_(()=>o.max&&f?o.max/Math.pow(10,T):o.max,[o.max,f,T]),[_,A]=g7(!!I&&!!k&&k>I),M=S_(z=>{var D;if(z.target.value===""){C(void 0);return}let L=Number(f?(D=z.target.value)==null?void 0:D.replace(x,""):z.target.value);I&&Number(z.target.value)>I?A(!0):A(!1),C(L)},[x,I,f,C]);return N(b7,ae(V({},h),{ref:r,value:k,placeholder:g,onChange:M,error:l||_,disabled:u,required:c,color:l||_?"danger":o.color,label:s,helperText:_?new ry(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:I}):p,slotProps:{input:{component:v7,decimalSeparator:x,thousandSeparator:v,prefix:b,fixedDecimalScale:S,decimalScale:T,"aria-label":h["aria-label"]}},sx:V({},d),className:y}))});var E_=ay;import X7,{useCallback as xa,useEffect as vy,useMemo as cr,useRef as Xx,useState as F_,useId as Z7}from"react";import{jsx as x7}from"react/jsx-runtime";var I_=$t(x7("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");import{motion as T7}from"framer-motion";var P7=T7(rh),ku=P7;ku.displayName="Sheet";var Xo=ku;var Ru=e=>{let o=e,{children:t}=o,r=xe(o,["children"]);return N(uh,ae(V({},r),{children:t}))};Ru.displayName="Table";function Vx(e){let{headCells:t,showCheckbox:r,onCheckboxChange:o,slots:{checkbox:n=hu}={},slotProps:{checkbox:a={}}={}}=e;return N("thead",{children:Ee("tr",{children:[r&&N("th",{style:{width:"40px",textAlign:"center"},children:N(n,V({onChange:o},a))}),t.map(i=>N("th",{style:{width:i.width,minWidth:i.minWidth,maxWidth:i.maxWidth,textAlign:i.numeric?"right":"left"},children:i.label},i.label))]})})}Vx.displayName="TableHead";function jx(e){let{rows:t,cellOrder:r,rowOptions:o,showCheckbox:n,onCheckboxChange:a,slots:{checkbox:i=hu}={},slotProps:{checkbox:s={}}={}}=e;return N("tbody",{children:t.map((l,p)=>Ee("tr",{children:[n&&N("td",{style:{textAlign:"center"},children:N(i,V({onChange:c=>a==null?void 0:a(c,p)},s))}),r.map(c=>{var u;return N("td",{style:{textAlign:(u=o==null?void 0:o[c])!=null&&u.numeric?"right":"left"},children:l[c]},c)})]},p))})}jx.displayName="TableBody";import w7,{forwardRef as A7,useCallback as Kx,useEffect as M7,useImperativeHandle as N7,useRef as L7,useState as B7}from"react";function xo(e){return typeof e=="string"||e instanceof String}function Hx(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function Ux(e,t){return Array.isArray(t)?Ux(e,(r,o)=>t.includes(o)):Object.entries(e).reduce((r,o)=>{let[n,a]=o;return t(a,n)&&(r[n]=a),r},{})}var we={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Wx(e){switch(e){case we.LEFT:return we.FORCE_LEFT;case we.RIGHT:return we.FORCE_RIGHT;default:return e}}function iy(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function cp(e,t){if(t===e)return!0;let r=Array.isArray(t),o=Array.isArray(e),n;if(r&&o){if(t.length!=e.length)return!1;for(n=0;n<t.length;n++)if(!cp(t[n],e[n]))return!1;return!0}if(r!=o)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){let a=t instanceof Date,i=e instanceof Date;if(a&&i)return t.getTime()==e.getTime();if(a!=i)return!1;let s=t instanceof RegExp,l=e instanceof RegExp;if(s&&l)return t.toString()==e.toString();if(s!=l)return!1;let p=Object.keys(t);for(n=0;n<p.length;n++)if(!Object.prototype.hasOwnProperty.call(e,p[n]))return!1;for(n=0;n<p.length;n++)if(!cp(e[p[n]],t[p[n]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}var sy=class{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}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?we.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?we.RIGHT:we.LEFT}};function Ce(e,t){return new Ce.InputMask(e,t)}function Gx(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?Ce.MaskedRegExp:xo(e)?Ce.MaskedPattern:e===Date?Ce.MaskedDate:e===Number?Ce.MaskedNumber:Array.isArray(e)||e===Array?Ce.MaskedDynamic:Ce.Masked&&e.prototype instanceof Ce.Masked?e:Ce.Masked&&e instanceof Ce.Masked?e.constructor:e instanceof Function?Ce.MaskedFunction:(console.warn("Mask not found for mask",e),Ce.Masked)}function ga(e){if(!e)throw new Error("Options in not defined");if(Ce.Masked){if(e.prototype instanceof Ce.Masked)return{mask:e};let t=e instanceof Ce.Masked?{mask:e}:Hx(e)&&e.mask instanceof Ce.Masked?e:{},{mask:r=void 0}=t,o=xe(t,["mask"]);if(r){let n=r.mask;return V(ae(V({},Ux(r,(a,i)=>!i.startsWith("_"))),{mask:r.constructor,_mask:n}),o)}}return Hx(e)?V({},e):{mask:e}}function Br(e){if(Ce.Masked&&e instanceof Ce.Masked)return e;let t=ga(e),r=Gx(t.mask);if(!r)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===r&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new r(t)}Ce.createMask=Br;var xi=class{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(r){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(r){}return t!=null?t:this.value.length}select(t,r){if(!(t==null||r==null||t===this.selectionStart&&r===this.selectionEnd))try{this._unsafeSelect(t,r)}catch(o){}}get isActive(){return!1}};Ce.MaskElement=xi;var O_=90,C7=89,va=class extends xi{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,r,o;return(t=(r=(o=this.input).getRootNode)==null?void 0:r.call(o))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===O_&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===C7&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===O_&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}};Ce.HTMLMaskElement=va;var Eu=class extends va{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,r){this.input.setSelectionRange(t,r)}get value(){return this.input.value}set value(t){this.input.value=t}};Ce.HTMLMaskElement=va;var up=class extends va{get _unsafeSelectionStart(){let t=this.rootElement,r=t.getSelection&&t.getSelection(),o=r&&r.anchorOffset,n=r&&r.focusOffset;return n==null||o==null||o<n?o:n}get _unsafeSelectionEnd(){let t=this.rootElement,r=t.getSelection&&t.getSelection(),o=r&&r.anchorOffset,n=r&&r.focusOffset;return n==null||o==null||o>n?o:n}_unsafeSelect(t,r){if(!this.rootElement.createRange)return;let o=this.rootElement.createRange();o.setStart(this.input.firstChild||this.input,t),o.setEnd(this.input.lastChild||this.input,r);let n=this.rootElement,a=n.getSelection&&n.getSelection();a&&(a.removeAllRanges(),a.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}};Ce.HTMLContenteditableMaskElement=up;var Iu=class e{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>e.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}};Iu.MAX_LENGTH=100;var ly=class{constructor(t,r){this.el=t instanceof xi?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new up(t):new Eu(t),this.masked=Br(r),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Iu,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._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var r;return t==null||((r=this.masked)==null?void 0:r.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Ce.Masked)&&this.masked.constructor===Gx(t)){this.masked.updateOptions({mask:t});return}let r=t instanceof Ce.Masked?t:Br({mask:t});r.unmaskedValue=this.masked.unmaskedValue,this.masked=r}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}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,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,r){let o=this._listeners[t];o&&o.forEach(n=>n(r))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),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(t){let r=this.masked.unmaskedValue,o=this.masked.value,n=this.masked.rawInputValue,a=this.displayValue,i=this.unmaskedValue!==r||this.value!==o||this._rawInputValue!==n;this._unmaskedValue=r,this._value=o,this._rawInputValue=n,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),i&&this._fireChangeEvents(),!this._historyChanging&&(i||this.history.isEmpty)&&this.history.push({unmaskedValue:r,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){let i=t,{mask:r}=i,o=xe(i,["mask"]),n=!this.maskEquals(r),a=this.masked.optionsIsChanged(o);n&&(this.mask=r),a&&this.masked.updateOptions(o),(n||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,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,we.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,r){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(r),this}off(t,r){if(!this._listeners[t])return this;if(!r)return delete this._listeners[t],this;let o=this._listeners[t].indexOf(r);return o>=0&&this._listeners[t].splice(o,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();let r=new sy({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),o=this.masked.rawInputValue,n=this.masked.splice(r.startChangePos,r.removed.length,r.inserted,r.removeDirection,{input:!0,raw:!0}).offset,a=o===this.masked.rawInputValue?r.removeDirection:we.NONE,i=this.masked.nearestInputPos(r.startChangePos+n,a);a!==we.NONE&&(i=this.masked.nearestInputPos(i,we.NONE)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};Ce.InputMask=ly;var Ve=class e{static normalize(t){return Array.isArray(t)?t:[t,new e]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}};Ce.ChangeDetails=Ve;var zr=class{constructor(t,r,o){t===void 0&&(t=""),r===void 0&&(r=0),this.value=t,this.from=r,this.stop=o}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";let r=this.value[0];return this.value=this.value.slice(1),r}shift(){if(!this.value.length)return"";let t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}};var qt=class e{constructor(t){this._value="",this._update(V(V({},e.DEFAULTS),t)),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,r){r===void 0&&(r={input:!0}),this.reset(),this.append(t,r,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,r){return t}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),Math.min(this.displayValue.length,r-t)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),this.displayValue.slice(t,r)}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new zr(this.extractInput(t,r),t)}appendTail(t){return xo(t)&&(t=new zr(String(t))),t.appendTo(this)}_appendCharRaw(t,r){return t?(this._value+=t,new Ve({inserted:t,rawInserted:t})):new Ve}_appendChar(t,r,o){r===void 0&&(r={});let n=this.state,a;if([t,a]=this.doPrepareChar(t,r),t&&(a=a.aggregate(this._appendCharRaw(t,r)),!a.rawInserted&&this.autofix==="pad")){let i=this.state;this.state=n;let s=this.pad(r),l=this._appendCharRaw(t,r);s=s.aggregate(l),l.rawInserted||s.equals(a)?a=s:this.state=i}if(a.inserted){let i,s=this.doValidate(r)!==!1;if(s&&o!=null){let l=this.state;if(this.overwrite===!0){i=o.state;for(let c=0;c<a.rawInserted.length;++c)o.unshift(this.displayValue.length-a.tailShift)}let p=this.appendTail(o);if(s=p.rawInserted.length===o.toString().length,!(s&&p.inserted)&&this.overwrite==="shift"){this.state=l,i=o.state;for(let c=0;c<a.rawInserted.length;++c)o.shift();p=this.appendTail(o),s=p.rawInserted.length===o.toString().length}s&&p.inserted&&(this.state=l)}s||(a=new Ve,this.state=n,o&&i&&(o.state=i))}return a}_appendPlaceholder(){return new Ve}_appendEager(){return new Ve}append(t,r,o){if(!xo(t))throw new Error("value should be string");let n=xo(o)?new zr(String(o)):o;r!=null&&r.tail&&(r._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,r);for(let i=0;i<t.length;++i){let s=this._appendChar(t[i],r,n);if(!s.rawInserted&&!this.doSkipInvalid(t[i],r,n))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&r!=null&&r.input&&t&&a.aggregate(this._appendEager()),n!=null&&(a.tailShift+=this.appendTail(n).tailShift),a}remove(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(r),new Ve}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;let r=this.rawInputValue,o=this.value,n=t();return this.rawInputValue=r,this.value&&this.value!==o&&o.indexOf(this.value)===0&&(this.append(o.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;let r=this.state,o=t(this);return this.state=r,delete this._isolated,o}doSkipInvalid(t,r,o){return!!this.skipInvalid}doPrepare(t,r){return r===void 0&&(r={}),Ve.normalize(this.prepare?this.prepare(t,this,r):t)}doPrepareChar(t,r){return r===void 0&&(r={}),Ve.normalize(this.prepareChar?this.prepareChar(t,this,r):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,r,o,n,a){o===void 0&&(o=""),n===void 0&&(n=we.NONE),a===void 0&&(a={input:!0});let i=t+r,s=this.extractTail(i),l=this.eager===!0||this.eager==="remove",p;l&&(n=Wx(n),p=this.extractInput(0,i,{raw:!0}));let c=t,u=new Ve;if(n!==we.NONE&&(c=this.nearestInputPos(t,r>1&&t!==0&&!l?we.NONE:n),u.tailShift=c-t),u.aggregate(this.remove(c)),l&&n!==we.NONE&&p===this.rawInputValue)if(n===we.FORCE_LEFT){let f;for(;p===this.rawInputValue&&(f=this.displayValue.length);)u.aggregate(new Ve({tailShift:-1})).aggregate(this.remove(f-1))}else n===we.FORCE_RIGHT&&s.unshift();return u.aggregate(this.append(o,a,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!cp(this,t)}typedValueEquals(t){let r=this.typedValue;return t===r||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(r)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new Ve}};qt.DEFAULTS={skipInvalid:!0};qt.EMPTY_VALUES=[void 0,null,""];Ce.Masked=qt;var dp=class e{constructor(t,r){t===void 0&&(t=[]),r===void 0&&(r=0),this.chunks=t,this.from=r}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=xo(t)?new zr(String(t)):t;let r=this.chunks[this.chunks.length-1],o=r&&(r.stop===t.stop||t.stop==null)&&t.from===r.from+r.toString().length;if(t instanceof zr)o?r.extend(t.toString()):this.chunks.push(t);else if(t instanceof e){if(t.stop==null){let n;for(;t.chunks.length&&t.chunks[0].stop==null;)n=t.chunks.shift(),n.from+=t.from,this.extend(n)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Ce.MaskedPattern))return new zr(this.toString()).appendTo(t);let r=new Ve;for(let o=0;o<this.chunks.length;++o){let n=this.chunks[o],a=t._mapPosToBlock(t.displayValue.length),i=n.stop,s;if(i!=null&&(!a||a.index<=i)&&((n instanceof e||t._stops.indexOf(i)>=0)&&r.aggregate(t._appendPlaceholder(i)),s=n instanceof e&&t._blocks[i]),s){let l=s.appendTail(n);r.aggregate(l);let p=n.toString().slice(l.rawInserted.length);p&&r.aggregate(t.append(p,{tail:!0}))}else r.aggregate(t.append(n.toString(),{tail:!0}))}return r}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){let n=t,{chunks:r}=n,o=xe(n,["chunks"]);Object.assign(this,o),this.chunks=r.map(a=>{let i="chunks"in a?new e:new zr;return i.state=a,i})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";let r=t!=null?t-this.from:t,o=0;for(;o<this.chunks.length;){let n=this.chunks[o],a=n.unshift(r);if(n.toString()){if(!a)break;++o}else this.chunks.splice(o,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){let r=this.chunks[t],o=r.shift();if(r.toString()){if(!o)break;--t}else this.chunks.splice(t,1);if(o)return o}return""}};var py=class{constructor(t,r){this.masked=t,this._log=[];let{offset:o,index:n}=t._mapPosToBlock(r)||(r<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=o,this.index=n,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(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){let t=this._log.pop();return t&&(this.state=t),t}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(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((r=this.block)==null?void 0:r.displayValue.length)||0){var r;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())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,we.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,we.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,we.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,we.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,we.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,we.NONE),!0})}};var fp=class{constructor(t){Object.assign(this,t),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(t,r){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(r),this._value||(this._isRawInput=!1),new Ve}nearestInputPos(t,r){r===void 0&&(r=we.NONE);let o=0,n=this._value.length;switch(r){case we.LEFT:case we.FORCE_LEFT:return o;case we.NONE:case we.RIGHT:case we.FORCE_RIGHT:default:return n}}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),this._isRawInput?r-t:0}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),o===void 0&&(o={}),o.raw&&this._isRawInput&&this._value.slice(t,r)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,r){if(r===void 0&&(r={}),this.isFilled)return new Ve;let o=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||r.input||r.raw)&&(!r.raw||!o)&&!r.tail,i=new Ve({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(r.raw||r.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let t=new Ve;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new zr("")}appendTail(t){return xo(t)&&(t=new zr(String(t))),t.appendTo(this)}append(t,r,o){let n=this._appendChar(t[0],r);return o!=null&&(n.tailShift+=this.appendTail(o).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}};var Ti=class{constructor(t){let p=t,{parent:r,isOptional:o,placeholderChar:n,displayChar:a,lazy:i,eager:s}=p,l=xe(p,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=Br(l),Object.assign(this,{parent:r,isOptional:o,placeholderChar:n,displayChar:a,lazy:i,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),t===0&&r>=1?(this.isFilled=!1,this.masked.remove(t,r)):new Ve}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(t,r){if(r===void 0&&(r={}),this.isFilled)return new Ve;let o=this.masked.state,n=this.masked._appendChar(t,this.currentMaskFlags(r));return n.inserted&&this.doValidate(r)===!1&&(n=new Ve,this.masked.state=o),!n.inserted&&!this.isOptional&&!this.lazy&&!r.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(t,r,o){return this.masked.append(t,this.currentMaskFlags(r),o)}_appendPlaceholder(){return this.isFilled||this.isOptional?new Ve:(this.isFilled=!0,new Ve({inserted:this.placeholderChar}))}_appendEager(){return new Ve}extractTail(t,r){return this.masked.extractTail(t,r)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),this.masked.extractInput(t,r,o)}nearestInputPos(t,r){r===void 0&&(r=we.NONE);let o=0,n=this.value.length,a=Math.min(Math.max(t,o),n);switch(r){case we.LEFT:case we.FORCE_LEFT:return this.isComplete?a:o;case we.RIGHT:case we.FORCE_RIGHT:return this.isComplete?a:n;case we.NONE:default:return a}}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),this.value.slice(t,r).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var r;return ae(V({},t),{_beforeTailState:(t==null||(r=t._beforeTailState)==null?void 0:r.masked)||(t==null?void 0:t._beforeTailState)})}pad(t){return new Ve}};Ti.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]/,"*":/./};var cy=class extends qt{updateOptions(t){super.updateOptions(t)}_update(t){let r=t.mask;r&&(t.validate=o=>o.search(r)>=0),super._update(t)}};Ce.MaskedRegExp=cy;var or=class e extends qt{constructor(t){super(ae(V(V({},e.DEFAULTS),t),{definitions:Object.assign({},Ti.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)}))}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){let t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let r=this.mask;if(!r||!t)return;let o=!1,n=!1;for(let i=0;i<r.length;++i){if(this.blocks){let c=r.slice(i),u=Object.keys(this.blocks).filter(d=>c.indexOf(d)===0);u.sort((d,y)=>y.length-d.length);let f=u[0];if(f){let a=ga(this.blocks[f]),{expose:d,repeat:y}=a,h=xe(a,["expose","repeat"]),b=ae(V({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix},h),{repeat:y,parent:this}),v=y!=null?new Ce.RepeatBlock(b):Br(b);v&&(this._blocks.push(v),d&&(this.exposeBlock=v),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),i+=f.length-1;continue}}let s=r[i],l=s in t;if(s===e.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){o=!o;continue}if(s==="["||s==="]"){n=!n;continue}if(s===e.ESCAPE_CHAR){if(++i,s=r[i],!s)break;l=!1}let p=l?new Ti(ae(V({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},ga(t[s])),{parent:this})):new fp({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(p)}}get state(){return ae(V({},super.state),{_blocks:this._blocks.map(t=>t.state)})}set state(t){if(!t){this.reset();return}let n=t,{_blocks:r}=n,o=xe(n,["_blocks"]);this._blocks.forEach((a,i)=>a.state=r[i]),super.state=o}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,r)=>t+=r.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(r),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,r)=>t+=r.value,"")}set value(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(r),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(r),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,r)=>t+=r.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;let r=new Ve,o=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(o==null)return r;this._blocks[o].isFilled&&++o;for(let n=o;n<this._blocks.length;++n){let a=this._blocks[n]._appendEager();if(!a.inserted)break;r.aggregate(a)}return r}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._mapPosToBlock(this.displayValue.length),n=new Ve;if(!o)return n;for(let i=o.index,s;s=this._blocks[i];++i){var a;let l=s._appendChar(t,ae(V({},r),{_beforeTailState:(a=r._beforeTailState)==null||(a=a._blocks)==null?void 0:a[i]}));if(n.aggregate(l),l.consumed)break}return n}extractTail(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=new dp;return t===r||this._forEachBlocksInRange(t,r,(n,a,i,s)=>{let l=n.extractTail(i,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof dp&&(l.blockIndex=a),o.extend(l)}),o}extractInput(t,r,o){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),o===void 0&&(o={}),t===r)return"";let n="";return this._forEachBlocksInRange(t,r,(a,i,s,l)=>{n+=a.extractInput(s,l,o)}),n}_findStopBefore(t){let r;for(let o=0;o<this._stops.length;++o){let n=this._stops[o];if(n<=t)r=n;else break}return r}_appendPlaceholder(t){let r=new Ve;if(this.lazy&&t==null)return r;let o=this._mapPosToBlock(this.displayValue.length);if(!o)return r;let n=o.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(n,a).forEach(i=>{if(!i.lazy||t!=null){var s;r.aggregate(i._appendPlaceholder((s=i._blocks)==null?void 0:s.length))}}),r}_mapPosToBlock(t){let r="";for(let o=0;o<this._blocks.length;++o){let n=this._blocks[o],a=r.length;if(r+=n.displayValue,t<=r.length)return{index:o,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((r,o)=>r+=o.displayValue.length,0)}_forEachBlocksInRange(t,r,o){r===void 0&&(r=this.displayValue.length);let n=this._mapPosToBlock(t);if(n){let a=this._mapPosToBlock(r),i=a&&n.index===a.index,s=n.offset,l=a&&i?a.offset:this._blocks[n.index].displayValue.length;if(o(this._blocks[n.index],n.index,s,l),a&&!i){for(let p=n.index+1;p<a.index;++p)o(this._blocks[p],p,0,this._blocks[p].displayValue.length);o(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=super.remove(t,r);return this._forEachBlocksInRange(t,r,(n,a,i,s)=>{o.aggregate(n.remove(i,s))}),o}nearestInputPos(t,r){if(r===void 0&&(r=we.NONE),!this._blocks.length)return 0;let o=new py(this,t);if(r===we.NONE)return o.pushRightBeforeInput()||(o.popState(),o.pushLeftBeforeInput())?o.pos:this.displayValue.length;if(r===we.LEFT||r===we.FORCE_LEFT){if(r===we.LEFT){if(o.pushRightBeforeFilled(),o.ok&&o.pos===t)return t;o.popState()}if(o.pushLeftBeforeInput(),o.pushLeftBeforeRequired(),o.pushLeftBeforeFilled(),r===we.LEFT){if(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.ok&&o.pos<=t||(o.popState(),o.ok&&o.pos<=t))return o.pos;o.popState()}return o.ok?o.pos:r===we.FORCE_LEFT?0:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:0)}return r===we.RIGHT||r===we.FORCE_RIGHT?(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.pushRightBeforeFilled()?o.pos:r===we.FORCE_RIGHT?this.displayValue.length:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:this.nearestInputPos(t,we.LEFT))):t}totalInputPositions(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=0;return this._forEachBlocksInRange(t,r,(n,a,i,s)=>{o+=n.totalInputPositions(i,s)}),o}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){let r=this._maskedBlocks[t];return r?r.map(o=>this._blocks[o]):[]}pad(t){let r=new Ve;return this._forEachBlocksInRange(0,this.displayValue.length,o=>r.aggregate(o.pad(t))),r}};or.DEFAULTS=ae(V({},qt.DEFAULTS),{lazy:!0,placeholderChar:"_"});or.STOP_CHAR="`";or.ESCAPE_CHAR="\\";or.InputDefinition=Ti;or.FixedDefinition=fp;Ce.MaskedPattern=or;var Pi=class extends or{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){let c=t,{to:r=this.to||0,from:o=this.from||0,maxLength:n=this.maxLength||0,autofix:a=this.autofix}=c,i=xe(c,["to","from","maxLength","autofix"]);this.to=r,this.from=o,this.maxLength=Math.max(String(r).length,n),this.autofix=a;let s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),p=0;for(;p<l.length&&l[p]===s[p];)++p;i.mask=l.slice(0,p).replace(/0/g,"\\0")+"0".repeat(this.maxLength-p),super._update(i)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let r="",o="",[,n,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(r="0".repeat(n.length)+a,o="9".repeat(n.length)+a),r=r.padEnd(this.maxLength,"0"),o=o.padEnd(this.maxLength,"9"),[r,o]}doPrepareChar(t,r){r===void 0&&(r={});let o;return[t,o]=super.doPrepareChar(t.replace(/\D/g,""),r),t||(o.skip=!this.isComplete),[t,o]}_appendCharRaw(t,r){if(r===void 0&&(r={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,r);let o=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[a,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(o[this.value.length],r):Number(a)>this.to?!r.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(o[this.value.length],r).aggregate(this._appendCharRaw(t,r)):super._appendCharRaw(n[this.value.length],r):super._appendCharRaw(t,r)}doValidate(t){let r=this.value;if(r.search(/[^0]/)===-1&&r.length<=this._matchFrom)return!0;let[n,a]=this.boundaries(r);return this.from<=Number(a)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){let r=new Ve;if(this.value.length===this.maxLength)return r;let o=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let a=0;a<n;++a)r.aggregate(super._appendCharRaw("0",t));o.split("").forEach(a=>this._appendCharRaw(a))}return r}};Ce.MaskedRange=Pi;var mp=class e extends or{static extractPatternOptions(t){let a=t,{mask:r,pattern:o}=a,n=xe(a,["mask","pattern"]);return ae(V({},n),{mask:xo(r)?r:o})}constructor(t){super(e.extractPatternOptions(V(V({},e.DEFAULTS),t)))}updateOptions(t){super.updateOptions(t)}_update(t){let s=V(V({},e.DEFAULTS),t),{mask:r,pattern:o,blocks:n}=s,a=xe(s,["mask","pattern","blocks"]),i=Object.assign({},e.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,n),super._update(ae(V({},a),{mask:xo(r)?r:o,blocks:i}))}doValidate(t){let r=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&r!=null&&(this.min==null||this.min<=r)&&(this.max==null||r<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(e.extractPatternOptions(t))}};mp.GET_DEFAULT_BLOCKS=()=>({d:{mask:Pi,from:1,to:31,maxLength:2},m:{mask:Pi,from:1,to:12,maxLength:2},Y:{mask:Pi,from:1900,to:9999}});mp.DEFAULTS=ae(V({},or.DEFAULTS),{mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>{if(!e)return"";let r=String(e.getDate()).padStart(2,"0"),o=String(e.getMonth()+1).padStart(2,"0"),n=e.getFullYear();return[r,o,n].join(".")},parse:(e,t)=>{let[r,o,n]=e.split(".").map(Number);return new Date(n,o-1,r)}});Ce.MaskedDate=mp;var Ou=class e extends qt{constructor(t){super(V(V({},e.DEFAULTS),t)),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(r=>{let i=ga(r),{expose:o}=i,n=xe(i,["expose"]),a=Br(V({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid},n));return o&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._applyDispatch(t,r);return this.currentMask&&o.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(r))),o}_applyDispatch(t,r,o){t===void 0&&(t=""),r===void 0&&(r={}),o===void 0&&(o="");let n=r.tail&&r._beforeTailState!=null?r._beforeTailState._value:this.value,a=this.rawInputValue,i=r.tail&&r._beforeTailState!=null?r._beforeTailState._rawInputValue:a,s=a.slice(i.length),l=this.currentMask,p=new Ve,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(t,V({},r),o),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),p.tailShift=this.currentMask.value.length-n.length),s&&(p.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),p}_appendPlaceholder(){let t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){let t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){let r=new Ve;return t&&r.aggregate(this._applyDispatch("",{},t)),r.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var r,o;return ae(V({},t),{_beforeTailState:((r=t._beforeTailState)==null?void 0:r.currentMaskRef)===this.currentMask&&((o=t._beforeTailState)==null?void 0:o.currentMask)||t._beforeTailState})}doDispatch(t,r,o){return r===void 0&&(r={}),o===void 0&&(o=""),this.dispatch(t,this,r,o)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,r){r===void 0&&(r={});let[o,n]=super.doPrepare(t,r);if(this.currentMask){let a;[o,a]=super.doPrepare(o,this.currentMaskFlags(r)),n=n.aggregate(a)}return[o,n]}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(t,r);if(this.currentMask){let a;[o,a]=super.doPrepareChar(o,this.currentMaskFlags(r)),n=n.aggregate(a)}return[o,n]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(r=>r.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let r=String(t);this.currentMask&&(this.currentMask.typedValue=t,r=this.currentMask.unmaskedValue),this.unmaskedValue=r}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,r){let o=new Ve;return this.currentMask&&o.aggregate(this.currentMask.remove(t,r)).aggregate(this._applyDispatch()),o}get state(){var t;return ae(V({},super.state),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(r=>r.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state})}set state(t){let i=t,{compiledMasks:r,currentMaskRef:o,currentMask:n}=i,a=xe(i,["compiledMasks","currentMaskRef","currentMask"]);r&&this.compiledMasks.forEach((s,l)=>s.state=r[l]),o!=null&&(this.currentMask=o,this.currentMask.state=n),super.state=a}extractInput(t,r,o){return this.currentMask?this.currentMask.extractInput(t,r,o):""}extractTail(t,r){return this.currentMask?this.currentMask.extractTail(t,r):super.extractTail(t,r)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,r){return this.currentMask?this.currentMask.nearestInputPos(t,r):super.nearestInputPos(t,r)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((r,o)=>{if(!t[o])return;let i=t[o],{mask:n}=i,a=xe(i,["mask"]);return cp(r,a)&&r.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var r;return!!((r=this.currentMask)!=null&&r.typedValueEquals(t))}};Ou.DEFAULTS=ae(V({},qt.DEFAULTS),{dispatch:(e,t,r,o)=>{if(!t.compiledMasks.length)return;let n=t.rawInputValue,a=t.compiledMasks.map((i,s)=>{let l=t.currentMask===i,p=l?i.displayValue.length:i.nearestInputPos(i.displayValue.length,we.FORCE_LEFT);return i.rawInputValue!==n?(i.reset(),i.append(n,{raw:!0})):l||i.remove(p),i.append(e,t.currentMaskFlags(r)),i.appendTail(o),{index:s,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(p,i.nearestInputPos(i.displayValue.length,we.FORCE_LEFT)))}});return a.sort((i,s)=>s.weight-i.weight||s.totalInputPositions-i.totalInputPositions),t.compiledMasks[a[0].index]}});Ce.MaskedDynamic=Ou;var _u=class e extends or{constructor(t){super(V(V({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){let n=t,{enum:r}=n,o=xe(n,["enum"]);if(r){let a=r.map(l=>l.length),i=Math.min(...a),s=Math.max(...a)-i;o.mask="*".repeat(i),s&&(o.mask+="["+"*".repeat(s)+"]"),this.enum=r}super._update(o)}_appendCharRaw(t,r){r===void 0&&(r={});let o=Math.min(this.nearestInputPos(0,we.FORCE_RIGHT),this.value.length),n=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,o));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(i,s)=>{let l=n[0][s];s>=this.value.length||l===i.value||(i.reset(),i._appendChar(l,r))});let a=super._appendCharRaw(n[0][this.value.length],r);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(i=>a.aggregate(super._appendCharRaw(i))),a}return new Ve}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new zr("",t)}remove(t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),t===r)return new Ve;let o=Math.min(super.nearestInputPos(0,we.FORCE_RIGHT),this.value.length),n;for(n=t;n>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(o,n),o)).length>1);--n);let a=super.remove(n,r);return a.tailShift+=n-t,a}};_u.DEFAULTS=ae(V({},or.DEFAULTS),{matchValue:(e,t,r)=>e.indexOf(t,r)===r});Ce.MaskedEnum=_u;var uy=class extends qt{updateOptions(t){super.updateOptions(t)}_update(t){super._update(ae(V({},t),{validate:t.mask}))}};Ce.MaskedFunction=uy;var __,Ci=class e extends qt{constructor(t){super(V(V({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){let t="^"+(this.allowNegative?"[+|\\-]?":""),r="\\d*",o=(this.scale?"("+iy(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+r+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(iy).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(iy(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){let r=t.split(this.radix);return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),r.join(this.radix)}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(r.input&&r.raw||!r.input&&!r.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),r);return t&&!o&&(n.skip=!0),o&&!this.allowPositive&&!this.value&&o!=="-"&&n.aggregate(this._appendChar("-")),[o,n]}_separatorsCount(t,r){r===void 0&&(r=!1);let o=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++o,r&&(t+=this.thousandsSeparator.length));return o}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),[t,r]=this._adjustRangeWithSeparators(t,r),this._removeThousandsSeparators(super.extractInput(t,r,o))}_appendCharRaw(t,r){r===void 0&&(r={});let o=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(o);this._value=this._removeThousandsSeparators(this.value);let a=this._value;this._value+=t;let i=this.number,s=!isNaN(i),l=!1;if(s){let f;this.min!=null&&this.min<0&&this.number<this.min&&(f=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(f=this.max),f!=null&&(this.autofix?(this._value=this.format(f,this).replace(e.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!r.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let p;s?p=new Ve({inserted:this._value.slice(a.length),rawInserted:l?"":t,skip:l}):(this._value=a,p=new Ve),this._value=this._insertThousandsSeparators(this._value);let c=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,u=this._separatorsCountFromSlice(c);return p.tailShift+=(u-n)*this.thousandsSeparator.length,p}_findSeparatorAround(t){if(this.thousandsSeparator){let r=t-this.thousandsSeparator.length+1,o=this.value.indexOf(this.thousandsSeparator,r);if(o<=t)return o}return-1}_adjustRangeWithSeparators(t,r){let o=this._findSeparatorAround(t);o>=0&&(t=o);let n=this._findSeparatorAround(r);return n>=0&&(r=n+this.thousandsSeparator.length),[t,r]}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),[t,r]=this._adjustRangeWithSeparators(t,r);let o=this.value.slice(0,t),n=this.value.slice(r),a=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+n));let i=this._separatorsCountFromSlice(o);return new Ve({tailShift:(i-a)*this.thousandsSeparator.length})}nearestInputPos(t,r){if(!this.thousandsSeparator)return t;switch(r){case we.NONE:case we.LEFT:case we.FORCE_LEFT:{let o=this._findSeparatorAround(t-1);if(o>=0){let n=o+this.thousandsSeparator.length;if(t<n||this.value.length<=n||r===we.FORCE_LEFT)return o}break}case we.RIGHT:case we.FORCE_RIGHT:{let o=this._findSeparatorAround(t);if(o>=0)return o+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){let t=this.number,r=t;this.min!=null&&(r=Math.max(r,this.min)),this.max!=null&&(r=Math.min(r,this.max)),r!==t&&(this.unmaskedValue=this.format(r,this));let o=this.value;this.normalizeZeros&&(o=this._normalizeZeros(o)),this.padFractionalZeros&&this.scale>0&&(o=this._padFractionalZeros(o)),this._value=o}super.doCommit()}_normalizeZeros(t){let r=this._removeThousandsSeparators(t).split(this.radix);return r[0]=r[0].replace(/^(\D*)(0*)(\d*)/,(o,n,a,i)=>n+i),t.length&&!/\d$/.test(r[0])&&(r[0]=r[0]+"0"),r.length>1&&(r[1]=r[1].replace(/0*$/,""),r[1].length||(r.length=1)),this._insertThousandsSeparators(r.join(this.radix))}_padFractionalZeros(t){if(!t)return t;let r=t.split(this.radix);return r.length<2&&r.push(""),r[1]=r[1].padEnd(this.scale,"0"),r.join(this.radix)}doSkipInvalid(t,r,o){r===void 0&&(r={});let n=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===e.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,r,o)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,e.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(e.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}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(t){return(super.typedValueEquals(t)||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}};__=Ci;Ci.UNMASKED_RADIX=".";Ci.EMPTY_VALUES=[...qt.EMPTY_VALUES,0];Ci.DEFAULTS=ae(V({},qt.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[__.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})});Ce.MaskedNumber=Ci;var dy={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Yx(e,t,r){t===void 0&&(t=dy.MASKED),r===void 0&&(r=dy.MASKED);let o=Br(e);return n=>o.runIsolated(a=>(a[t]=n,a[r]))}function D_(e,t,r,o){return Yx(t,r,o)(e)}Ce.PIPE_TYPE=dy;Ce.createPipe=Yx;Ce.pipe=D_;var fy=class extends or{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var r,o,n;let l=ga(t),{repeat:a}=l,i=xe(l,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,i);let s=Br(this._blockOpts);this.repeat=(r=(o=a!=null?a:s.repeat)!=null?o:this.repeat)!=null?r:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Br(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,r){r===void 0&&(r={});let o=new Ve;for(let l=(n=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?n:Math.max(this._blocks.length-1,0),p,c;p=(i=this._blocks[l])!=null?i:c=!c&&this._allocateBlock(l);++l){var n,a,i,s;let u=p._appendChar(t,ae(V({},r),{_beforeTailState:(s=r._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]}));if(u.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(u),u.consumed)break}return o}_trimEmptyTail(t,r){var o,n;t===void 0&&(t=0);let a=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0),i;r!=null&&(i=(n=this._mapPosToBlock(r))==null?void 0:n.index),i==null&&(i=this._blocks.length-1);let s=0;for(let l=i;a<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(i-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=super.remove(t,r);return this._trimEmptyTail(t,r),o}totalInputPositions(t,r){return t===void 0&&(t=0),r==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,r)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};Ce.RepeatBlock=fy;try{globalThis.IMask=Ce}catch(e){}import qx from"react";var Be=lo(fC(),1);import my from"react";var w_={mask:Be.default.oneOfType([Be.default.array,Be.default.func,Be.default.string,Be.default.instanceOf(RegExp),Be.default.oneOf([Date,Number,Ce.Masked]),Be.default.instanceOf(Ce.Masked)]),value:Be.default.any,unmask:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["typed"])]),prepare:Be.default.func,prepareChar:Be.default.func,validate:Be.default.func,commit:Be.default.func,overwrite:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["shift"])]),eager:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["append","remove"])]),skipInvalid:Be.default.bool,onAccept:Be.default.func,onComplete:Be.default.func,placeholderChar:Be.default.string,displayChar:Be.default.string,lazy:Be.default.bool,definitions:Be.default.object,blocks:Be.default.object,enum:Be.default.arrayOf(Be.default.string),maxLength:Be.default.number,from:Be.default.number,to:Be.default.number,pattern:Be.default.string,format:Be.default.func,parse:Be.default.func,autofix:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["pad"])]),radix:Be.default.string,thousandsSeparator:Be.default.string,mapToRadix:Be.default.arrayOf(Be.default.string),scale:Be.default.number,normalizeZeros:Be.default.bool,padFractionalZeros:Be.default.bool,min:Be.default.oneOfType([Be.default.number,Be.default.instanceOf(Date)]),max:Be.default.oneOfType([Be.default.number,Be.default.instanceOf(Date)]),dispatch:Be.default.func,inputRef:Be.default.oneOfType([Be.default.func,Be.default.shape({current:Be.default.object})])},A_=Object.keys(w_).filter(e=>e!=="value"),S7=["value","unmask","onAccept","onComplete","inputRef"],k7=A_.filter(e=>S7.indexOf(e)<0);function Jx(e){var t;let r=(t=class extends my.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let a=this.props,i=this._extractMaskOptionsFromProps(a);if(i.mask)this.maskRef?(this.maskRef.updateOptions(i),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(i);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=Ce(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){let i=xe(a,[]);return Object.keys(i).filter(s=>k7.indexOf(s)<0).forEach(s=>{delete i[s]}),i}_extractNonMaskProps(a){let i=xe(a,[]);return A_.forEach(s=>{s!=="maxLength"&&delete i[s]}),"defaultValue"in i||(i.defaultValue=a.mask?"":i.value),delete i.value,i}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 my.createElement(e,ae(V({},this._extractNonMaskProps(this.props)),{inputRef:this._inputRef}))}},t.displayName=void 0,t.propTypes=void 0,t),o=e.displayName||e.name||"Component";return r.displayName="IMask("+o+")",r.propTypes=w_,my.forwardRef((n,a)=>my.createElement(r,ae(V({},n),{ref:a})))}var R7=Jx(e=>{let o=e,{inputRef:t}=o,r=xe(o,["inputRef"]);return qx.createElement("input",ae(V({},r),{ref:t}))}),E7=(e,t)=>qx.createElement(R7,ae(V({},e),{ref:t})),ba=qx.forwardRef(E7);import{useRef as fKe,useState as mKe,useCallback as hKe,useEffect as yKe}from"react";import"react";import{jsx as I7}from"react/jsx-runtime";var Si=$t(I7("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday");import{motion as O7}from"framer-motion";var _7=O7(Rm),D7=E(_7)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Du=D7;Du.displayName="DialogActions";var jn=Du;var z7=E(Yt,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),F7=E(Xo,{name:"DatePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),$7=E("div",{name:"DatePicker",slot:"root",overridesResolver:(e,t)=>t.root})({width:"100%"}),M_=(e,t)=>{let r=`${e.getDate()}`,o=`${e.getMonth()+1}`,n=e.getFullYear();return Number(r)<10&&(r="0"+r),Number(o)<10&&(o="0"+o),t.replace(/YYYY/g,n.toString()).replace(/MM/g,o).replace(/DD/g,r)};function V7(e,t){let r=t.split(/[-./\s]/),o=e.split(/[-./\s]/);if(r.length!==o.length)throw new Error("Invalid date string or format");let n,a,i;for(let l=0;l<r.length;l++){let p=parseInt(o[l],10);switch(r[l]){case"DD":n=p;break;case"MM":a=p-1;break;case"YYYY":i=p;break}}return new Date(i,a,n)}var j7=e=>e.replace(/YYYY/g,"Y").replace(/MM/g,"M").replace(/DD/g,"D").replace(/[^YMD\s]/g,t=>`${t}\``),H7=w7.forwardRef(function(t,r){let i=t,{onChange:o,format:n}=i,a=xe(i,["onChange","format"]);return N(ba,ae(V({},a),{inputRef:r,onAccept:s=>o({target:{name:t.name,value:s}}),mask:Date,pattern:j7(n),blocks:{D:{mask:Ce.MaskedRange,from:1,to:31,maxLength:2},M:{mask:Ce.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ce.MaskedRange,from:1900,to:9999,maxLength:4}},format:s=>M_(s,n),parse:s=>V7(s,n),autofix:"pad",overwrite:!0}))}),hy=A7((e,t)=>{let r=G({props:e,name:"DatePicker"}),_=r,{onChange:o,disabled:n,label:a,error:i,helperText:s,minDate:l,maxDate:p,disableFuture:c,disablePast:u,required:f,sx:d,className:y,format:h="YYYY/MM/DD",size:b}=_,v=xe(_,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required","sx","className","format","size"]),x=L7(null),[g,S]=pr(r.value,r.defaultValue||"",Kx(A=>o==null?void 0:o({target:{name:r.name,value:A}}),[r.name,o]),{disableStrict:!0}),[T,P]=B7(null),C=!!T;M7(()=>{var A;T||(A=x.current)==null||A.blur()},[T,x]),N7(t,()=>x.current,[x]);let k=Kx(A=>{S(A.target.value)},[S]),I=Kx(A=>{P(T?null:A.currentTarget),setTimeout(()=>{var M;(M=x.current)==null||M.focus()},0)},[T,P,x]);return N($7,{children:N(ro,{open:!0,children:Ee(Yo,{children:[N(Jr,ae(V({},v),{color:i?"danger":v.color,ref:x,size:b,value:g,onChange:k,placeholder:h,disabled:n,required:f,error:i,slotProps:{input:{component:H7,ref:x,format:h}},className:y,sx:d,endDecorator:N(Jt,{variant:"plain",onClick:I,"aria-label":"Toggle Calendar","aria-controls":"date-picker-popper","aria-haspopup":"dialog","aria-expanded":C,children:N(Si,{})}),label:a,helperText:s})),C&&N(Zn,{onClickAway:()=>P(null),children:N(z7,{id:"date-picker-popper",open:!0,anchorEl:T,placement:"bottom-end",onMouseDown:A=>A.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],"aria-label":"Calendar Tooltip","aria-expanded":C,children:Ee(F7,{tabIndex:-1,role:"presentation",children:[N(gi,{value:Number.isNaN(new Date(g).getTime())?void 0:[new Date(g),void 0],onChange:([A])=>{k({target:{name:r.name,value:M_(A,h)}}),P(null)},minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:c,disablePast:u}),N(jn,{sx:{p:1},children:N(wt,{size:b,variant:"plain",color:"neutral",onClick:()=>{k({target:{name:r.name,value:""}}),P(null)},children:"Clear"})})]})})})]})})})});var N_=hy;import{motion as U7}from"framer-motion";var W7=U7(gh),wu=e=>{let y=e,{label:t,error:r,helperText:o,color:n,size:a,disabled:i,required:s,minRows:l=2,maxRows:p=4,sx:c,className:u}=y,f=xe(y,["label","error","helperText","color","size","disabled","required","minRows","maxRows","sx","className"]),d=N(W7,V({required:s,disabled:i,color:r?"danger":n,size:a,minRows:l,maxRows:p},f));return Ee(Fn,{required:s,disabled:i,color:n,size:a,error:r,sx:c,className:u,children:[t&&N($n,{children:t}),d,o&&N(Vn,{children:o})]})};wu.displayName="Textarea";var L_=wu;import{useMemo as G7}from"react";import{motion as Y7}from"framer-motion";var J7=Y7(Zm),yy=J7;yy.displayName="Option";function Au(e){let h=e,{label:t,helperText:r,error:o,size:n,color:a,disabled:i,required:s,onChange:l,sx:p,className:c}=h,u=xe(h,["label","helperText","error","size","color","disabled","required","onChange","sx","className"]),f=G7(()=>e.options.map(b=>typeof b!="object"?{value:b,label:b}:b),[e.options]),d=(b,v)=>{var S;let x=b||{target:{}},g=ae(V({},x),{target:{name:((S=x.target)==null?void 0:S.name)||e.name,value:v||void 0}});l==null||l(g)},y=N(th,ae(V({},u),{required:s,disabled:i,size:n,color:o?"danger":a,onChange:d,children:f.map(b=>N(yy,{value:b.value,children:b.label},b.value))}));return Ee(Fn,{required:s,disabled:i,size:n,color:a,error:o,sx:p,className:c,children:[t&&N($n,{children:t}),y,r&&N(Vn,{children:r})]})}Au.displayName="Select";var B_=Au;import{motion as q7}from"framer-motion";var K7=q7(bh),Mu=e=>N(K7,V({},e));Mu.displayName="Tooltip";var z_=Mu;import{motion as $_}from"framer-motion";Vi();function V_(e){return!e.editMode&&["number","date","currency"].includes(e.type||"")?"end":"start"}var Q7=E("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),gy=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function eG(e){let{paginationModel:{page:t,pageSize:r},rowCount:o,onPageChange:n}=e,a=1,i=Math.ceil(o/r),s=[t-2,t-1].filter(u=>u>1),l=[t+1,t+2].filter(u=>u<=i-1),p=i>1&&t<i-3,c=i>1&&t>4;return N(Et,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center",children:Ee(Et,{direction:"row",spacing:.5,alignItems:"center",children:[N(Jt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-1),disabled:t===a,"aria-label":"Previous page",children:N($h,{})}),t!==a&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(a),children:a}),c&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-3),children:"..."}),s.map(u=>N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(u),children:u},u)),N(wt,{variant:"soft",size:"sm",children:t}),l.map(u=>N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(u),children:u},u)),p&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+3),children:"..."}),t!==i&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(i),children:i}),N(Jt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+1),disabled:t===i,"aria-label":"Next page",children:N(Vh,{})})]})})}var tG=e=>N(Fh,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onClick:t=>t.stopPropagation(),onMouseDown:t=>{var i;let r=t.clientX,o=(i=e.current)==null?void 0:i.getBoundingClientRect().width,n=s=>{o&&r&&(e.current.style.width=`${o+(s.clientX-r)}px`)},a=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)}}),rG=E("tbody",{name:"DataTable",slot:"tableBody"})({"&::after":{content:"''",display:"block",height:"100%"}}),oG=E("tr",{name:"DataTable",slot:"tableRow",shouldForwardProp:e=>e!=="striped"})(({striped:e})=>ae(V({},e&&{background:"var(--TableRow-stripeBackground, var(--ceed-palette-background-level2))",color:"var(--ceed-palette-text-primary)"}),{"&:hover":{background:"var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))"}})),nG=E("span",{name:"DataTable",slot:"headCellAsterisk"})(({theme:e})=>({color:"var(--ceed-palette-danger-500)",marginLeft:e.spacing(.5)})),aG=$_(I_),iG=e=>{let{width:t,maxWidth:r,minWidth:o,stickyHeader:n,resizable:a,field:i,tableId:s,headerName:l,required:p,editMode:c,sort:u,onSortChange:f,sortable:d=!0,sortOrder:y}=e,h=Xx(null),b=cr(()=>`${s}_header_${l!=null?l:i}`.trim(),[s,l,i]),v=a==null||a?tG(h):null,x={width:t,minWidth:o!=null?o:"50px",maxWidth:r,position:n?void 0:"relative",cursor:d?"pointer":"default",userSelect:"none"},g=V_(e),S=y[0],T=d&&N(aG,{style:{width:"16px",height:"16px"},role:"img","aria-labelledby":b,"aria-description":(u!=null?u:S)==="desc"?"descending":"ascending","data-testid":void 0,variants:{hover:{opacity:1},initial:{opacity:0}},animate:{color:u?"var(--ceed-palette-text-secondary)":"var(--ceed-palette-primary-solidDisabledColor)",rotate:(u!=null?u:S)==="desc"?180:0,opacity:u?1:0},transition:{duration:0,rotate:{duration:.2,ease:"easeOut"},color:{duration:.2,ease:"easeInOut"},opacity:{duration:.2,ease:"easeInOut"}}});return Ee($_.th,{id:b,"aria-label":l!=null?l:i,"aria-sort":u?{asc:"ascending",desc:"descending"}[u]:"none",ref:h,style:x,onClick:P=>d&&(f==null?void 0:f({field:i,currentSort:u,multiple:P.shiftKey})),whileHover:"hover",initial:"initial",children:[Ee(Et,{gap:1,direction:"row",justifyContent:g,children:[g==="end"&&T,Ee("div",{children:[l!=null?l:i,c&&p&&N(nG,{children:"*"})]}),g==="start"&&T]}),v]},i)},sG=e=>{var T;let{tableId:t,field:r,type:o,renderCell:n,renderEditCell:a,isCellEditable:i,noWrap:s,row:l,rowId:p}=e,[c,u]=F_(l[r]),f=Xx(null),d=cr(()=>({row:l,value:c,id:p}),[l,p,c]),y=cr(()=>!!(e.editMode&&(typeof i=="function"?i(d):i==null||i)),[e.editMode,i,d]),h=cr(()=>ae(V({},typeof e.componentProps=="function"?e.componentProps(d):e.componentProps||{}),{size:"sm"}),[e,d]),b=cr(()=>V(ae(V({},h),{onChange:P=>{var C,k;(C=h.onChange)==null||C.call(h,P),u(P.target.value),o==="select"&&((k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:P.target.value}),value:P.target.value})))},onFocus:P=>{var C,k;(C=h.onFocus)==null||C.call(h,P),(k=e.onCellEditStart)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{value:c}),value:c}))},onBlur:P=>{var C,k;(C=h.onBlur)==null||C.call(h,P),o&&["number","text","longText","currency","date"].includes(o)&&((k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:c}),value:c})))}}),o==="autocomplete"&&{onChangeComplete:P=>{var C,k;(C=h.onChangeComplete)==null||C.call(h,P),u(P.target.value),(k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:P.target.value}),value:P.target.value}))}}),[d,l,r,c,h,o,e]),v=cr(()=>a?a(d):{date:N(N_,V({value:c},b)),currency:N(E_,V({value:c},b)),number:N(Jr,V({value:c,type:"number"},b)),text:N(Jr,V({value:c,type:"text"},b)),longText:N(L_,V({value:c},b)),autocomplete:N(PO,V({value:c,options:b.options||[c]},b)),select:N(B_,V({value:c,options:b.options||[c]},b))}[o||"text"],[c,b,o]),x=cr(()=>{if(n)return n(d);let P=c;return{link:X7.createElement(e.component||ca,V({children:P},h))}[o||"text"]||P},[c,n,d,o,h,e]),g=cr(()=>y&&v?v:x,[y,v,x]),S=cr(()=>s&&e.type==="longText",[s,e.type]);return vy(()=>{u(l[r])},[l,r]),N("td",{ref:f,headers:`${t}_header_${(T=e.headerName)!=null?T:r}`,style:{textAlign:V_({type:o}),verticalAlign:y?"top":"middle"},children:S?N(z_,{title:c,placement:"bottom",style:{maxWidth:"100%"},enterDelay:1500,enterNextDelay:1500,children:N("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:g})}):g},r)},lG=e=>{let{tableId:t,columns:r,rowId:o,editMode:n,noWrap:a,row:i}=e;return N(Yo,{children:r.map((s,l)=>QP(sG,ae(V({},s),{tableId:t,key:`${o}_${s.field.toString()}_${l}`,row:i,rowId:o,editMode:n,noWrap:a})))})};function pG({rows:e,columns:t,rowCount:r,pagination:o,paginationMode:n,paginationModel:a,onPaginationModelChange:i,sortModel:s,sortOrder:l=["asc","desc",null],selectionModel:p=[],onSortModelChange:c,onSelectionModelChange:u,editMode:f,getId:d,isTotalSelected:y}){let[h,b]=pr(s,[],xa(B=>c==null?void 0:c(B),[c])),v=cr(()=>t.reduce((B,U)=>ae(V({},B),{[U.field]:U}),{}),[t]),x=xa((B,U)=>{for(let F of h){let{field:R,sort:K}=F,oe=B[R],w=U[R],ce=v[R],he=0;if(ce.sortComparator?he=ce.sortComparator({rowA:B,rowB:U}):typeof oe=="string"&&typeof w=="string"?he=oe.localeCompare(w):typeof oe=="number"&&typeof w=="number"?he=oe-w:oe instanceof Date&&w instanceof Date&&(he=oe.getTime()-w.getTime()),he!==0)return K==="asc"?he:-he}return 0},[h,v]),g=cr(()=>h.length?[...e].sort(x):e,[e,h,x]),S=cr(()=>Array.from(new Set(l)),[l]),[T,P]=F_((a==null?void 0:a.page)||1),C=(a==null?void 0:a.pageSize)||20,k=xa((B,U)=>{var F,R;return(R=(F=d==null?void 0:d(B))!=null?F:B.id)!=null?R:`${(U||0)+(T-1)*C}`},[d,T,C]),I=cr(()=>new Set(p),[p]),_=cr(()=>!o||n==="server"?g:g.slice((T-1)*C,(T-1)*C+C),[g,T,C,n,o]),A=cr(()=>_.length>0&&_.every((B,U)=>I.has(k(B,U))),[_,I,k]),M=r||g.length,O=cr(()=>y!=null?y:M>0&&p.length===M,[y,p,M]),z=cr(()=>(t||Object.keys(g[0]||{}).map(U=>({field:U}))).map(U=>{var F,R,K;return ae(V({},U),{isCellEditable:f&&(typeof U.isCellEditable=="function"?U.isCellEditable:(F=U.isCellEditable)!=null?F:!0),sort:(R=h.find(oe=>oe.field===U.field))==null?void 0:R.sort,sortOrder:((K=v[U.field])==null?void 0:K.sortOrder)||S})}),[g,t,f,h,v,S]),L=xa(B=>{P(B),i==null||i({page:B,pageSize:C})},[i,C]),D=xa(B=>{let{field:U,currentSort:F,multiple:R}=B,oe=v[U].sortOrder||S;if(F!==void 0){let ce=(oe.indexOf(F)+1)%oe.length,he=oe[ce];if(!he){let ie=R?h.filter(W=>W.field!==U):[];b(ie);return}let Ne=R?h.map(ie=>ie.field===U?{field:U,sort:he}:ie):[{field:U,sort:he}];b(Ne)}else{let w=R?[...h,{field:U,sort:oe[0]}]:[{field:U,sort:oe[0]}];b(w)}},[S,v,h,b]);return vy(()=>{a||L(1)},[M,L,a]),vy(()=>{let B=Math.max(1,Math.ceil(M/C));T>B&&L(B)},[T,M,C,L]),vy(()=>{u==null||u([])},[T]),{rowCount:M,page:T,pageSize:C,onPaginationModelChange:L,getId:k,HeadCell:iG,BodyRow:lG,dataInPage:_,handleSortChange:D,isAllSelected:A,isTotalSelected:O,isSelectedRow:xa(B=>I.has(B),[I]),onAllCheckboxChange:xa(()=>{u==null||u(A?[]:_.map(k))},[A,_,u,k]),onCheckboxChange:xa((B,U)=>{if(I.has(U)){let F=p.filter(R=>R!==U);u==null||u(F)}else{let F=[...p,U];u==null||u(F)}},[p,u,I]),columns:z,onTotalSelect:xa(()=>{u==null||u(O?[]:g.map(k),!O)},[O,g,u,k])}}function Zx(e){let Fe=e,{rows:t,checkboxSelection:r,editMode:o,selectionModel:n,onSelectionModelChange:a,disableSelectionOnClick:i,onRowClick:s,rowCount:l,columns:p,onPaginationModelChange:c,pagination:u,paginationMode:f,paginationModel:d,sortModel:y,sortOrder:h,onSortModelChange:b,loading:v,slots:{checkbox:x=hu,toolbar:g,footer:S,loadingOverlay:T=()=>N(Bc,{value:8,variant:"plain"})}={},slotProps:{checkbox:P={},toolbar:C,background:k={}}={},stripe:I}=Fe,_=xe(Fe,["rows","checkboxSelection","editMode","selectionModel","onSelectionModelChange","disableSelectionOnClick","onRowClick","rowCount","columns","onPaginationModelChange","pagination","paginationMode","paginationModel","sortModel","sortOrder","onSortModelChange","loading","slots","slotProps","stripe"]),A=Z7(),M=Xx(null),{columns:O,isAllSelected:z,isSelectedRow:L,onAllCheckboxChange:D,onCheckboxChange:B,getId:U,rowCount:F,page:R,pageSize:K,onPaginationModelChange:oe,handleSortChange:w,dataInPage:ce,isTotalSelected:he,onTotalSelect:Ne,HeadCell:ie,BodyRow:W}=pG(e),de=Lh({count:ce.length,getScrollElement:()=>M.current,estimateSize:()=>32,measureElement:je=>je.clientHeight,overscan:20}),ye=cr(()=>({page:R,pageSize:K}),[R,K]),ke=de.getTotalSize(),Pe=de.getVirtualItems();return Ee(Fh,{sx:{maxHeight:"100%",overflow:"auto",display:"flex",flexDirection:"column"},children:[(!!r||!!g)&&Ee(Et,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center",children:[!!r&&Ee(Et,{direction:"row",spacing:1,children:[!z&&Ee(Pr,{level:"body-xs",children:[gy((n==null?void 0:n.length)||0)," items selected"]}),z&&!he&&Ee(Et,{direction:"row",spacing:1,alignItems:"center",children:[Ee(Pr,{level:"body-xs",children:["All ",gy((n==null?void 0:n.length)||0)," items on this page are selected."]}),Ee(wt,{size:"sm",variant:"plain",onClick:Ne,children:["Select all ",gy(F!=null?F:t.length)," items"]})]}),he&&Ee(Et,{direction:"row",spacing:1,alignItems:"center",children:[Ee(Pr,{level:"body-xs",children:["All ",gy(F!=null?F:t.length)," items are selected."]}),N(wt,{size:"sm",variant:"plain",color:"danger",onClick:Ne,children:"Cancel"})]})]}),g&&N(g,V({},C||{}))]}),N(Xo,ae(V({variant:"outlined",sx:{height:"100%",overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},ref:M},k),{children:Ee(Ru,ae(V({},_),{children:[N("thead",{children:Ee("tr",{children:[r&&N("th",{style:{width:"40px",textAlign:"center"},children:N(x,V({onChange:D,checked:z,indeterminate:(n||[]).length>0&&!z},P))}),O.map((je,re)=>N(ie,V({tableId:A,stickyHeader:e.stickyHeader,editMode:!!je.isCellEditable,onSortChange:w},je),`${je.field.toString()}_${re}`))]})}),Ee(rG,{style:{height:`${ke}px`},children:[!!v&&N(Q7,{children:N("td",{children:N(Fh,{sx:{position:"absolute",top:0,left:0,right:0},children:N(T,{})})})}),Pe.map((je,re)=>{let Z=je.index,be=ce[Z],me=U(be,Z),$e=I&&(I==="even"&&(Z+1)%2===0||I==="odd"&&(Z+1)%2===1);return Ee(oG,{role:r&&!i?"checkbox":void 0,tabIndex:r&&!i?-1:void 0,onClick:Oe=>{s==null||s({row:be,rowId:me},Oe),r&&!i&&B(Oe,me)},"aria-checked":r&&!i?L(me):void 0,striped:$e,style:{height:`${je.size}px`,transform:`translateY(${je.start-re*je.size}px)`},children:[r&&N("th",{scope:"row",style:{textAlign:"center"},children:N(x,V({onClick:Oe=>Oe.stopPropagation(),onChange:Oe=>B(Oe,me),checked:L(me)},P))}),N(W,{tableId:A,columns:O,row:be,rowId:me,editMode:o,noWrap:e.noWrap})]},me)})]}),S&&N(S,{})]}))})),u&&N(eG,{paginationModel:ye,rowCount:F,onPageChange:oe})]})}Zx.displayName="DataTable";import cG,{forwardRef as uG,useCallback as by,useEffect as dG,useImperativeHandle as fG,useMemo as mG,useRef as hG,useState as yG}from"react";var gG=E(Yt,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),vG=E(Xo,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),bG=E("div",{name:"DateRangePicker",slot:"root",overridesResolver:(e,t)=>t.root})({width:"100%"}),H_=([e,t],r)=>{let o=n=>{let a=`${n.getDate()}`,i=`${n.getMonth()+1}`,s=n.getFullYear();return Number(a)<10&&(a="0"+a),Number(i)<10&&(i="0"+i),r.replace(/YYYY/g,s.toString()).replace(/MM/g,i).replace(/DD/g,a)};return[o(e),t?o(t):""].join(" - ")};function j_(e,t){let r=t.split(/[-./\s]/),o=e.split(/[-./\s]/),n,a,i;for(let l=0;l<r.length;l++){let p=parseInt(o[l],10);switch(r[l]){case"DD":n=p;break;case"MM":a=p-1;break;case"YYYY":i=p;break}}return new Date(i,a,n)}var U_=(e,t)=>{let r=e.split(" - ")[0]||"",o=e.split(" - ")[1]||"";return[j_(r,t),j_(o,t)]},xG=e=>`${e} - ${e}`.replace(/YYYY/g,"Y").replace(/MM/g,"M").replace(/DD/g,"D").replace(/[^YMD\s]/g,t=>`${t}\``),TG=cG.forwardRef(function(t,r){let i=t,{onChange:o,format:n}=i,a=xe(i,["onChange","format"]);return N(ba,ae(V({},a),{inputRef:r,onAccept:s=>o({target:{name:t.name,value:s}}),mask:Date,pattern:xG(n),blocks:{D:{mask:Ce.MaskedRange,from:1,to:31,maxLength:2},M:{mask:Ce.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ce.MaskedRange,from:1900,to:9999}},format:s=>H_(s,n),parse:s=>U_(s,n),autofix:"pad",overwrite:!0}))}),Qx=uG((e,t)=>{let r=G({props:e,name:"DateRangePicker"}),M=r,{onChange:o,disabled:n,label:a,error:i,helperText:s,minDate:l,maxDate:p,disableFuture:c,disablePast:u,required:f,sx:d,className:y,format:h="YYYY/MM/DD",size:b}=M,v=xe(M,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required","sx","className","format","size"]),x=hG(null),[g,S]=pr(r.value,r.defaultValue||"",by(O=>o==null?void 0:o({target:{name:r.name,value:O}}),[r.name,o]),{disableStrict:!0}),[T,P]=yG(null),C=!!T,k=mG(()=>g?U_(g,h):void 0,[g,h]);dG(()=>{var O;T||(O=x.current)==null||O.blur()},[T,x]),fG(t,()=>x.current,[x]);let I=by(O=>{S(O.target.value)},[S]),_=by(O=>{var z;P(T?null:O.currentTarget),(z=x.current)==null||z.focus()},[T,P,x]),A=by(([O,z])=>{!O||!z||(S(H_([O,z],h)),P(null))},[S,P,h]);return N(bG,{children:N(ro,{open:!0,children:Ee(Yo,{children:[N(Jr,ae(V({},v),{color:i?"danger":v.color,ref:t,size:b,value:g,onChange:I,disabled:n,required:f,placeholder:`${h} - ${h}`,slotProps:{input:{component:TG,ref:x,format:h}},error:i,className:y,sx:d,endDecorator:N(Jt,{variant:"plain",onClick:_,"aria-label":"Toggle Calendar","aria-controls":"date-range-picker-popper","aria-haspopup":"dialog","aria-expanded":C,children:N(Si,{})}),label:a,helperText:s})),C&&N(Zn,{onClickAway:()=>P(null),children:N(gG,{id:"date-range-picker-popper",open:!0,anchorEl:T,placement:"bottom-end",onMouseDown:O=>O.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],"aria-label":"Calendar Tooltip","aria-expanded":C,children:Ee(vG,{tabIndex:-1,role:"presentation",children:[N(gi,{rangeSelection:!0,defaultValue:k,onChange:A,minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:c,disablePast:u}),N(jn,{sx:{p:1},children:N(wt,{size:b,variant:"plain",color:"neutral",onClick:()=>{S(""),P(null)},children:"Clear"})})]})})})]})})})});Qx.displayName="DateRangePicker";import{motion as PG}from"framer-motion";var CG=PG(Im),SG=E(CG)(({theme:e})=>({padding:e.spacing(0,6,5)})),Nu=SG;Nu.displayName="DialogContent";var xy=Nu;import{motion as kG}from"framer-motion";var RG=kG(Om),EG=E(RG)(({theme:e})=>({padding:e.spacing(4,6)})),Lu=EG;Lu.displayName="DialogTitle";var Ty=Lu;import DG from"react";import{motion as eT}from"framer-motion";var IG=eT(wm),tT=IG;tT.displayName="Modal";var W_=E(Jm)({padding:0}),Bu=W_;Bu.displayName="ModalDialog";var OG=E(eT(Ym))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),Py=OG;Py.displayName="ModalClose";var _G=eT(Km),rT=_G;rT.displayName="ModalOverflow";function oT(e){let n=e,{title:t,children:r}=n,o=xe(n,["title","children"]);return Ee(W_,ae(V({},o),{children:[N(Py,{}),N(Ty,{children:t}),N(xy,{children:r})]}))}oT.displayName="ModalFrame";var wG=E(Bu,{name:"Dialog",slot:"Root"})({padding:0}),nT=DG.forwardRef((e,t)=>{let s=e,{title:r,children:o,actions:n,fullscreen:a}=s,i=xe(s,["title","children","actions","fullscreen"]);return Ee(wG,ae(V({layout:a?"fullscreen":"center",ref:t},i),{children:[N(Ty,{children:r}),N(xy,{children:o}),N(jn,{children:n})]}))});nT.displayName="DialogFrame";import{motion as AG}from"framer-motion";var MG=AG(_m),zu=e=>N(MG,V({},e));zu.displayName="Divider";import{motion as NG}from"framer-motion";var LG=NG(Nc),aT=e=>{var n;let o=e,{children:t}=o,r=xe(o,["children"]);return N(LG,ae(V({},r),{slotProps:ae(V({},r.slotProps),{content:ae(V({},(n=r.slotProps)==null?void 0:n.content),{sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}})}),children:t}))};aT.displayName="InsetDrawer";import c8,{useCallback as Oy,useEffect as TD,useMemo as OT,useRef as PD,useState as _y}from"react";import{jsx as BG}from"react/jsx-runtime";var G_=$t(BG("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");import{jsx as zG}from"react/jsx-runtime";var Y_=$t(zG("path",{d:"m19.41 7.41-4.83-4.83c-.37-.37-.88-.58-1.41-.58H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8.83c0-.53-.21-1.04-.59-1.42M14.8 15H13v3c0 .55-.45 1-1 1s-1-.45-1-1v-3H9.21c-.45 0-.67-.54-.35-.85l2.8-2.79c.2-.19.51-.19.71 0l2.79 2.79c.3.31.08.85-.36.85M14 9c-.55 0-1-.45-1-1V3.5L18.5 9z"}),"UploadFileRounded");import{jsx as FG}from"react/jsx-runtime";var J_=$t(FG("path",{d:"M18.3 5.71a.9959.9959 0 0 0-1.41 0L12 10.59 7.11 5.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"ClearRounded");function Fu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){t.forEach(function(n){return n()})}}function hp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function iT(e){if(Array.isArray(e))return hp(e)}function sT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lT(e,t){if(e){if(typeof e=="string")return hp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hp(e,t)}}function pT(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
127
|
+
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function u7(e){e=c7(e);var t=e.decimalSeparator,r=e.allowedDecimalSeparators,o=e.thousandsGroupStyle,n=e.suffix,a=e.allowNegative,i=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=bi);var l=e.onBlur;l===void 0&&(l=bi);var p=e.thousandSeparator,c=e.decimalScale,u=e.fixedDecimalScale,f=e.prefix;f===void 0&&(f="");var d=e.defaultValue,y=e.value,h=e.valueIsNumericString,b=e.onValueChange,v=y_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=oy(e),g=x.decimalSeparator,S=x.allowedDecimalSeparators,T=function(F){return m_(F,e)},P=function(F,R){return l7(F,R,e)},C=pp(y)?d:y,k=h!=null?h:s7(C,f,n);pp(y)?pp(d)||(k=k||typeof d=="number"):k=k||typeof y=="number";var I=function(F){return g_(F)?F:(typeof F=="number"&&(F=x_(F)),k&&typeof c=="number"?d_(F,c,!!u):F)},_=P_(I(y),I(d),!!k,T,P,b),A=_[0],M=A.numAsString,O=A.formattedValue,z=_[1],L=function(F){var R=F.target,K=F.key,oe=R.selectionStart,w=R.selectionEnd,ce=R.value;if(ce===void 0&&(ce=""),oe!==w){s(F);return}K==="Backspace"&&ce[0]==="-"&&oe===f.length+1&&a&&Is(R,1),c&&u&&(K==="Backspace"&&ce[oe-1]===g?(Is(R,oe-1),F.preventDefault()):K==="Delete"&&ce[oe]===g&&F.preventDefault()),S!=null&&S.includes(K)&&ce[oe]===g&&Is(R,oe+1);var he=p===!0?",":p;K==="Backspace"&&ce[oe-1]===he&&Is(R,oe-1),K==="Delete"&&ce[oe]===he&&Is(R,oe+1),s(F)},D=function(F){var R=M;if(R.match(/\d/g)||(R=""),i||(R=q6(R)),u&&c&&(R=d_(R,c,u)),R!==M){var K=m_(R,e);z({formattedValue:K,value:R,floatValue:parseFloat(R)},{event:F,source:Pu.event})}l(F)},B=function(F){return F===g?!0:Cu(F)},U=function(F){var R=F.currentValue,K=F.lastValue,oe=F.formattedValue,w=F.currentValueIndex,ce=F.formattedValueIndex,he=R[w],Ne=oe[ce],ie=T_(K,R),W=ie.to;return w>=W.start&&w<W.end&&S&&S.includes(he)&&Ne===g?!0:he===Ne};return Object.assign(Object.assign({},v),{value:O,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:U,onValueChange:z,format:T,removeFormatting:P,getCaretBoundary:function(F){return p7(F,e)},onKeyDown:L,onBlur:D})}function ny(e){var t=u7(e);return lp.createElement(n7,Object.assign({},t))}import d7,{useCallback as f7}from"react";import{motion as m7}from"framer-motion";var h7=m7(Fl),Su=d7.forwardRef((e,t)=>{var P;let T=e,{label:r,helperText:o,error:n,style:a,size:i,color:s,disabled:l,required:p,onChange:c,name:u,sx:f,className:d,enableClearable:y}=T,h=xe(T,["label","helperText","error","style","size","color","disabled","required","onChange","name","sx","className","enableClearable"]),[b,v]=pr(e.value,e.defaultValue,f7(C=>{c==null||c({target:{value:(C==null?void 0:C.toString())||"",name:u||""}})},[c,u])),x=C=>{v(C.target.value)},g=()=>{v(e.defaultValue||"")},S=N(h7,ae(V({value:b,name:u,onChange:x,required:p,color:n?"danger":s,disabled:l,slotProps:V({input:V({ref:t},(P=h.slotProps)==null?void 0:P.input)},h.slotProps)},h),{endDecorator:y?Ee(Et,{gap:1,direction:"row",children:[h.endDecorator,b&&N(Jt,{onMouseDown:C=>C.preventDefault(),onClick:g,"aria-label":"Clear",children:N(Ah,{})})]}):h.endDecorator}));return Ee(Fn,{required:p,color:s,size:i,error:n,disabled:l,sx:f,className:d,children:[r&&N($n,{children:r}),S,o&&N(Vn,{children:o})]})});Su.displayName="Input";var Jr=Su;var y7={AED:2,ALL:2,AMD:2,ANG:2,AOA:2,ARS:2,AUD:2,AWG:2,AZN:2,BAM:2,BBD:2,BDT:2,BGN:2,BHD:3,BMD:2,BND:2,BOB:2,BRL:2,BSD:2,BWP:2,BYN:2,BZD:2,CAD:2,CHF:2,CLP:2,CNH:2,CNY:2,COP:2,CRC:2,CUP:2,CVE:0,CZK:2,DJF:0,DKK:2,DOP:2,DZD:2,EGP:2,ETB:2,EUR:2,FJD:2,FKP:2,GBP:2,GEL:2,GHS:2,GIP:2,GMD:2,GNF:0,GTQ:2,GYD:2,HKD:2,HNL:2,HTG:2,HUF:2,IDR:0,ILS:2,INR:2,IQD:3,ISK:2,JMD:2,JOD:3,JPY:0,KES:2,KGS:2,KHR:2,KMF:0,KRW:0,KWD:3,KYD:2,KZT:2,LAK:2,LBP:2,LKR:2,LYD:3,MAD:2,MDL:2,MKD:2,MMK:2,MNT:2,MOP:2,MRU:2,MUR:2,MVR:2,MWK:2,MXN:2,MYR:2,MZN:2,NAD:2,NGN:2,NIO:2,NOK:2,NPR:2,NZD:2,OMR:3,PAB:2,PEN:2,PGK:2,PHP:2,PKR:2,PLN:2,PYG:0,QAR:2,RON:2,RSD:2,RUB:2,RWF:0,SAR:2,SBD:2,SCR:2,SEK:2,SGD:2,SHP:2,SLE:2,SOS:2,SRD:2,STN:2,SVC:2,SZL:2,THB:2,TND:3,TOP:2,TRY:2,TTD:2,TWD:2,TZS:2,UAH:2,UGX:0,USD:2,UYU:2,UZS:2,VEF:2,VND:0,VUV:0,WST:2,XAF:0,XCD:2,XOF:0,XPF:0,YER:2,ZAR:2,ZMW:2},C_=(e="USD")=>{let[t,r,o,...n]=new c_(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split(""),a=y7[e];return{symbol:`${t} `,thousandSeparator:r,decimalSeparator:o,placeholder:o?`${t} 0${o}${Array.from(Array(a)).map(()=>0).join("")}`:`${t} 0`,fixedDecimalScale:!!o,decimalScale:a}};var v7=R_.forwardRef(function(t,r){let a=t,{onChange:o}=a,n=xe(a,["onChange"]);return N(ny,ae(V({},n),{onValueChange:({value:i})=>{o==null||o({target:{name:t.name,value:i}})},valueIsNumericString:!0,getInputRef:r,allowNegative:!1}))}),b7=E(Jr,{name:"CurrencyInput",slot:"root",overridesResolver:(e,t)=>t.root})({}),ay=R_.forwardRef(function(t,r){let o=G({props:t,name:"CurrencyInput"}),O=o,{currency:n="USD",name:a,onChange:i,label:s,error:l,helperText:p,required:c,disabled:u,useMinorUnit:f,sx:d,className:y}=O,h=xe(O,["currency","name","onChange","label","error","helperText","required","disabled","useMinorUnit","sx","className"]),{symbol:b,thousandSeparator:v,decimalSeparator:x,placeholder:g,fixedDecimalScale:S,decimalScale:T}=C_(n),[P,C]=pr(o.value,o.defaultValue,S_(z=>i==null?void 0:i({target:{name:a,value:z}}),[i,a])),k=k_(()=>P&&f?P/Math.pow(10,T):P,[P,f,T]),I=k_(()=>o.max&&f?o.max/Math.pow(10,T):o.max,[o.max,f,T]),[_,A]=g7(!!I&&!!k&&k>I),M=S_(z=>{var D;if(z.target.value===""){C(void 0);return}let L=Number(f?(D=z.target.value)==null?void 0:D.replace(x,""):z.target.value);I&&Number(z.target.value)>I?A(!0):A(!1),C(L)},[x,I,f,C]);return N(b7,ae(V({},h),{ref:r,value:k,placeholder:g,onChange:M,error:l||_,disabled:u,required:c,color:l||_?"danger":o.color,label:s,helperText:_?new ry(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:I}):p,slotProps:{input:{component:v7,decimalSeparator:x,thousandSeparator:v,prefix:b,fixedDecimalScale:S,decimalScale:T,"aria-label":h["aria-label"]}},sx:V({},d),className:y}))});var E_=ay;import X7,{useCallback as xa,useEffect as vy,useMemo as cr,useRef as Xx,useState as F_,useId as Z7}from"react";import{jsx as x7}from"react/jsx-runtime";var I_=$t(x7("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0s.39-1.02 0-1.41l-6.59-6.59a.996.996 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");import{motion as T7}from"framer-motion";var P7=T7(rh),ku=P7;ku.displayName="Sheet";var Xo=ku;var Ru=e=>{let o=e,{children:t}=o,r=xe(o,["children"]);return N(uh,ae(V({},r),{children:t}))};Ru.displayName="Table";function Vx(e){let{headCells:t,showCheckbox:r,onCheckboxChange:o,slots:{checkbox:n=hu}={},slotProps:{checkbox:a={}}={}}=e;return N("thead",{children:Ee("tr",{children:[r&&N("th",{style:{width:"40px",textAlign:"center"},children:N(n,V({onChange:o},a))}),t.map(i=>N("th",{style:{width:i.width,minWidth:i.minWidth,maxWidth:i.maxWidth,textAlign:i.numeric?"right":"left"},children:i.label},i.label))]})})}Vx.displayName="TableHead";function jx(e){let{rows:t,cellOrder:r,rowOptions:o,showCheckbox:n,onCheckboxChange:a,slots:{checkbox:i=hu}={},slotProps:{checkbox:s={}}={}}=e;return N("tbody",{children:t.map((l,p)=>Ee("tr",{children:[n&&N("td",{style:{textAlign:"center"},children:N(i,V({onChange:c=>a==null?void 0:a(c,p)},s))}),r.map(c=>{var u;return N("td",{style:{textAlign:(u=o==null?void 0:o[c])!=null&&u.numeric?"right":"left"},children:l[c]},c)})]},p))})}jx.displayName="TableBody";import w7,{forwardRef as A7,useCallback as Kx,useEffect as M7,useImperativeHandle as N7,useRef as L7,useState as B7}from"react";function xo(e){return typeof e=="string"||e instanceof String}function Hx(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function Ux(e,t){return Array.isArray(t)?Ux(e,(r,o)=>t.includes(o)):Object.entries(e).reduce((r,o)=>{let[n,a]=o;return t(a,n)&&(r[n]=a),r},{})}var we={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Wx(e){switch(e){case we.LEFT:return we.FORCE_LEFT;case we.RIGHT:return we.FORCE_RIGHT;default:return e}}function iy(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function cp(e,t){if(t===e)return!0;let r=Array.isArray(t),o=Array.isArray(e),n;if(r&&o){if(t.length!=e.length)return!1;for(n=0;n<t.length;n++)if(!cp(t[n],e[n]))return!1;return!0}if(r!=o)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){let a=t instanceof Date,i=e instanceof Date;if(a&&i)return t.getTime()==e.getTime();if(a!=i)return!1;let s=t instanceof RegExp,l=e instanceof RegExp;if(s&&l)return t.toString()==e.toString();if(s!=l)return!1;let p=Object.keys(t);for(n=0;n<p.length;n++)if(!Object.prototype.hasOwnProperty.call(e,p[n]))return!1;for(n=0;n<p.length;n++)if(!cp(e[p[n]],t[p[n]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}var sy=class{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}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?we.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?we.RIGHT:we.LEFT}};function Ce(e,t){return new Ce.InputMask(e,t)}function Gx(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?Ce.MaskedRegExp:xo(e)?Ce.MaskedPattern:e===Date?Ce.MaskedDate:e===Number?Ce.MaskedNumber:Array.isArray(e)||e===Array?Ce.MaskedDynamic:Ce.Masked&&e.prototype instanceof Ce.Masked?e:Ce.Masked&&e instanceof Ce.Masked?e.constructor:e instanceof Function?Ce.MaskedFunction:(console.warn("Mask not found for mask",e),Ce.Masked)}function ga(e){if(!e)throw new Error("Options in not defined");if(Ce.Masked){if(e.prototype instanceof Ce.Masked)return{mask:e};let t=e instanceof Ce.Masked?{mask:e}:Hx(e)&&e.mask instanceof Ce.Masked?e:{},{mask:r=void 0}=t,o=xe(t,["mask"]);if(r){let n=r.mask;return V(ae(V({},Ux(r,(a,i)=>!i.startsWith("_"))),{mask:r.constructor,_mask:n}),o)}}return Hx(e)?V({},e):{mask:e}}function Br(e){if(Ce.Masked&&e instanceof Ce.Masked)return e;let t=ga(e),r=Gx(t.mask);if(!r)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===r&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new r(t)}Ce.createMask=Br;var xi=class{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(r){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(r){}return t!=null?t:this.value.length}select(t,r){if(!(t==null||r==null||t===this.selectionStart&&r===this.selectionEnd))try{this._unsafeSelect(t,r)}catch(o){}}get isActive(){return!1}};Ce.MaskElement=xi;var O_=90,C7=89,va=class extends xi{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,r,o;return(t=(r=(o=this.input).getRootNode)==null?void 0:r.call(o))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===O_&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===C7&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===O_&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}};Ce.HTMLMaskElement=va;var Eu=class extends va{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,r){this.input.setSelectionRange(t,r)}get value(){return this.input.value}set value(t){this.input.value=t}};Ce.HTMLMaskElement=va;var up=class extends va{get _unsafeSelectionStart(){let t=this.rootElement,r=t.getSelection&&t.getSelection(),o=r&&r.anchorOffset,n=r&&r.focusOffset;return n==null||o==null||o<n?o:n}get _unsafeSelectionEnd(){let t=this.rootElement,r=t.getSelection&&t.getSelection(),o=r&&r.anchorOffset,n=r&&r.focusOffset;return n==null||o==null||o>n?o:n}_unsafeSelect(t,r){if(!this.rootElement.createRange)return;let o=this.rootElement.createRange();o.setStart(this.input.firstChild||this.input,t),o.setEnd(this.input.lastChild||this.input,r);let n=this.rootElement,a=n.getSelection&&n.getSelection();a&&(a.removeAllRanges(),a.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}};Ce.HTMLContenteditableMaskElement=up;var Iu=class e{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>e.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}};Iu.MAX_LENGTH=100;var ly=class{constructor(t,r){this.el=t instanceof xi?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new up(t):new Eu(t),this.masked=Br(r),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Iu,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._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var r;return t==null||((r=this.masked)==null?void 0:r.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof Ce.Masked)&&this.masked.constructor===Gx(t)){this.masked.updateOptions({mask:t});return}let r=t instanceof Ce.Masked?t:Br({mask:t});r.unmaskedValue=this.masked.unmaskedValue,this.masked=r}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}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,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,r){let o=this._listeners[t];o&&o.forEach(n=>n(r))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),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(t){let r=this.masked.unmaskedValue,o=this.masked.value,n=this.masked.rawInputValue,a=this.displayValue,i=this.unmaskedValue!==r||this.value!==o||this._rawInputValue!==n;this._unmaskedValue=r,this._value=o,this._rawInputValue=n,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),i&&this._fireChangeEvents(),!this._historyChanging&&(i||this.history.isEmpty)&&this.history.push({unmaskedValue:r,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){let i=t,{mask:r}=i,o=xe(i,["mask"]),n=!this.maskEquals(r),a=this.masked.optionsIsChanged(o);n&&(this.mask=r),a&&this.masked.updateOptions(o),(n||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,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,we.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,r){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(r),this}off(t,r){if(!this._listeners[t])return this;if(!r)return delete this._listeners[t],this;let o=this._listeners[t].indexOf(r);return o>=0&&this._listeners[t].splice(o,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();let r=new sy({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),o=this.masked.rawInputValue,n=this.masked.splice(r.startChangePos,r.removed.length,r.inserted,r.removeDirection,{input:!0,raw:!0}).offset,a=o===this.masked.rawInputValue?r.removeDirection:we.NONE,i=this.masked.nearestInputPos(r.startChangePos+n,a);a!==we.NONE&&(i=this.masked.nearestInputPos(i,we.NONE)),this.updateControl(i),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};Ce.InputMask=ly;var Ve=class e{static normalize(t){return Array.isArray(t)?t:[t,new e]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}};Ce.ChangeDetails=Ve;var zr=class{constructor(t,r,o){t===void 0&&(t=""),r===void 0&&(r=0),this.value=t,this.from=r,this.stop=o}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";let r=this.value[0];return this.value=this.value.slice(1),r}shift(){if(!this.value.length)return"";let t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}};var qt=class e{constructor(t){this._value="",this._update(V(V({},e.DEFAULTS),t)),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,r){r===void 0&&(r={input:!0}),this.reset(),this.append(t,r,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,r){return t}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),Math.min(this.displayValue.length,r-t)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),this.displayValue.slice(t,r)}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new zr(this.extractInput(t,r),t)}appendTail(t){return xo(t)&&(t=new zr(String(t))),t.appendTo(this)}_appendCharRaw(t,r){return t?(this._value+=t,new Ve({inserted:t,rawInserted:t})):new Ve}_appendChar(t,r,o){r===void 0&&(r={});let n=this.state,a;if([t,a]=this.doPrepareChar(t,r),t&&(a=a.aggregate(this._appendCharRaw(t,r)),!a.rawInserted&&this.autofix==="pad")){let i=this.state;this.state=n;let s=this.pad(r),l=this._appendCharRaw(t,r);s=s.aggregate(l),l.rawInserted||s.equals(a)?a=s:this.state=i}if(a.inserted){let i,s=this.doValidate(r)!==!1;if(s&&o!=null){let l=this.state;if(this.overwrite===!0){i=o.state;for(let c=0;c<a.rawInserted.length;++c)o.unshift(this.displayValue.length-a.tailShift)}let p=this.appendTail(o);if(s=p.rawInserted.length===o.toString().length,!(s&&p.inserted)&&this.overwrite==="shift"){this.state=l,i=o.state;for(let c=0;c<a.rawInserted.length;++c)o.shift();p=this.appendTail(o),s=p.rawInserted.length===o.toString().length}s&&p.inserted&&(this.state=l)}s||(a=new Ve,this.state=n,o&&i&&(o.state=i))}return a}_appendPlaceholder(){return new Ve}_appendEager(){return new Ve}append(t,r,o){if(!xo(t))throw new Error("value should be string");let n=xo(o)?new zr(String(o)):o;r!=null&&r.tail&&(r._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,r);for(let i=0;i<t.length;++i){let s=this._appendChar(t[i],r,n);if(!s.rawInserted&&!this.doSkipInvalid(t[i],r,n))break;a.aggregate(s)}return(this.eager===!0||this.eager==="append")&&r!=null&&r.input&&t&&a.aggregate(this._appendEager()),n!=null&&(a.tailShift+=this.appendTail(n).tailShift),a}remove(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(r),new Ve}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;let r=this.rawInputValue,o=this.value,n=t();return this.rawInputValue=r,this.value&&this.value!==o&&o.indexOf(this.value)===0&&(this.append(o.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,n}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;let r=this.state,o=t(this);return this.state=r,delete this._isolated,o}doSkipInvalid(t,r,o){return!!this.skipInvalid}doPrepare(t,r){return r===void 0&&(r={}),Ve.normalize(this.prepare?this.prepare(t,this,r):t)}doPrepareChar(t,r){return r===void 0&&(r={}),Ve.normalize(this.prepareChar?this.prepareChar(t,this,r):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,r,o,n,a){o===void 0&&(o=""),n===void 0&&(n=we.NONE),a===void 0&&(a={input:!0});let i=t+r,s=this.extractTail(i),l=this.eager===!0||this.eager==="remove",p;l&&(n=Wx(n),p=this.extractInput(0,i,{raw:!0}));let c=t,u=new Ve;if(n!==we.NONE&&(c=this.nearestInputPos(t,r>1&&t!==0&&!l?we.NONE:n),u.tailShift=c-t),u.aggregate(this.remove(c)),l&&n!==we.NONE&&p===this.rawInputValue)if(n===we.FORCE_LEFT){let f;for(;p===this.rawInputValue&&(f=this.displayValue.length);)u.aggregate(new Ve({tailShift:-1})).aggregate(this.remove(f-1))}else n===we.FORCE_RIGHT&&s.unshift();return u.aggregate(this.append(o,a,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!cp(this,t)}typedValueEquals(t){let r=this.typedValue;return t===r||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(r)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new Ve}};qt.DEFAULTS={skipInvalid:!0};qt.EMPTY_VALUES=[void 0,null,""];Ce.Masked=qt;var dp=class e{constructor(t,r){t===void 0&&(t=[]),r===void 0&&(r=0),this.chunks=t,this.from=r}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=xo(t)?new zr(String(t)):t;let r=this.chunks[this.chunks.length-1],o=r&&(r.stop===t.stop||t.stop==null)&&t.from===r.from+r.toString().length;if(t instanceof zr)o?r.extend(t.toString()):this.chunks.push(t);else if(t instanceof e){if(t.stop==null){let n;for(;t.chunks.length&&t.chunks[0].stop==null;)n=t.chunks.shift(),n.from+=t.from,this.extend(n)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof Ce.MaskedPattern))return new zr(this.toString()).appendTo(t);let r=new Ve;for(let o=0;o<this.chunks.length;++o){let n=this.chunks[o],a=t._mapPosToBlock(t.displayValue.length),i=n.stop,s;if(i!=null&&(!a||a.index<=i)&&((n instanceof e||t._stops.indexOf(i)>=0)&&r.aggregate(t._appendPlaceholder(i)),s=n instanceof e&&t._blocks[i]),s){let l=s.appendTail(n);r.aggregate(l);let p=n.toString().slice(l.rawInserted.length);p&&r.aggregate(t.append(p,{tail:!0}))}else r.aggregate(t.append(n.toString(),{tail:!0}))}return r}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){let n=t,{chunks:r}=n,o=xe(n,["chunks"]);Object.assign(this,o),this.chunks=r.map(a=>{let i="chunks"in a?new e:new zr;return i.state=a,i})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";let r=t!=null?t-this.from:t,o=0;for(;o<this.chunks.length;){let n=this.chunks[o],a=n.unshift(r);if(n.toString()){if(!a)break;++o}else this.chunks.splice(o,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){let r=this.chunks[t],o=r.shift();if(r.toString()){if(!o)break;--t}else this.chunks.splice(t,1);if(o)return o}return""}};var py=class{constructor(t,r){this.masked=t,this._log=[];let{offset:o,index:n}=t._mapPosToBlock(r)||(r<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=o,this.index=n,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(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){let t=this._log.pop();return t&&(this.state=t),t}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(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((r=this.block)==null?void 0:r.displayValue.length)||0){var r;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())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,we.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,we.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,we.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,we.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,we.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,we.NONE),!0})}};var fp=class{constructor(t){Object.assign(this,t),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(t,r){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(r),this._value||(this._isRawInput=!1),new Ve}nearestInputPos(t,r){r===void 0&&(r=we.NONE);let o=0,n=this._value.length;switch(r){case we.LEFT:case we.FORCE_LEFT:return o;case we.NONE:case we.RIGHT:case we.FORCE_RIGHT:default:return n}}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),this._isRawInput?r-t:0}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this._value.length),o===void 0&&(o={}),o.raw&&this._isRawInput&&this._value.slice(t,r)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,r){if(r===void 0&&(r={}),this.isFilled)return new Ve;let o=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||r.input||r.raw)&&(!r.raw||!o)&&!r.tail,i=new Ve({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(r.raw||r.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let t=new Ve;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new zr("")}appendTail(t){return xo(t)&&(t=new zr(String(t))),t.appendTo(this)}append(t,r,o){let n=this._appendChar(t[0],r);return o!=null&&(n.tailShift+=this.appendTail(o).tailShift),n}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}};var Ti=class{constructor(t){let p=t,{parent:r,isOptional:o,placeholderChar:n,displayChar:a,lazy:i,eager:s}=p,l=xe(p,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=Br(l),Object.assign(this,{parent:r,isOptional:o,placeholderChar:n,displayChar:a,lazy:i,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),t===0&&r>=1?(this.isFilled=!1,this.masked.remove(t,r)):new Ve}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(t,r){if(r===void 0&&(r={}),this.isFilled)return new Ve;let o=this.masked.state,n=this.masked._appendChar(t,this.currentMaskFlags(r));return n.inserted&&this.doValidate(r)===!1&&(n=new Ve,this.masked.state=o),!n.inserted&&!this.isOptional&&!this.lazy&&!r.input&&(n.inserted=this.placeholderChar),n.skip=!n.inserted&&!this.isOptional,this.isFilled=!!n.inserted,n}append(t,r,o){return this.masked.append(t,this.currentMaskFlags(r),o)}_appendPlaceholder(){return this.isFilled||this.isOptional?new Ve:(this.isFilled=!0,new Ve({inserted:this.placeholderChar}))}_appendEager(){return new Ve}extractTail(t,r){return this.masked.extractTail(t,r)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),this.masked.extractInput(t,r,o)}nearestInputPos(t,r){r===void 0&&(r=we.NONE);let o=0,n=this.value.length,a=Math.min(Math.max(t,o),n);switch(r){case we.LEFT:case we.FORCE_LEFT:return this.isComplete?a:o;case we.RIGHT:case we.FORCE_RIGHT:return this.isComplete?a:n;case we.NONE:default:return a}}totalInputPositions(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.value.length),this.value.slice(t,r).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var r;return ae(V({},t),{_beforeTailState:(t==null||(r=t._beforeTailState)==null?void 0:r.masked)||(t==null?void 0:t._beforeTailState)})}pad(t){return new Ve}};Ti.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]/,"*":/./};var cy=class extends qt{updateOptions(t){super.updateOptions(t)}_update(t){let r=t.mask;r&&(t.validate=o=>o.search(r)>=0),super._update(t)}};Ce.MaskedRegExp=cy;var or=class e extends qt{constructor(t){super(ae(V(V({},e.DEFAULTS),t),{definitions:Object.assign({},Ti.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)}))}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){let t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let r=this.mask;if(!r||!t)return;let o=!1,n=!1;for(let i=0;i<r.length;++i){if(this.blocks){let c=r.slice(i),u=Object.keys(this.blocks).filter(d=>c.indexOf(d)===0);u.sort((d,y)=>y.length-d.length);let f=u[0];if(f){let a=ga(this.blocks[f]),{expose:d,repeat:y}=a,h=xe(a,["expose","repeat"]),b=ae(V({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix},h),{repeat:y,parent:this}),v=y!=null?new Ce.RepeatBlock(b):Br(b);v&&(this._blocks.push(v),d&&(this.exposeBlock=v),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),i+=f.length-1;continue}}let s=r[i],l=s in t;if(s===e.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(s==="{"||s==="}"){o=!o;continue}if(s==="["||s==="]"){n=!n;continue}if(s===e.ESCAPE_CHAR){if(++i,s=r[i],!s)break;l=!1}let p=l?new Ti(ae(V({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},ga(t[s])),{parent:this})):new fp({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(p)}}get state(){return ae(V({},super.state),{_blocks:this._blocks.map(t=>t.state)})}set state(t){if(!t){this.reset();return}let n=t,{_blocks:r}=n,o=xe(n,["_blocks"]);this._blocks.forEach((a,i)=>a.state=r[i]),super.state=o}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,r)=>t+=r.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(r),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,r)=>t+=r.value,"")}set value(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(r),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){let r=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(r),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,r)=>t+=r.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;let r=new Ve,o=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(o==null)return r;this._blocks[o].isFilled&&++o;for(let n=o;n<this._blocks.length;++n){let a=this._blocks[n]._appendEager();if(!a.inserted)break;r.aggregate(a)}return r}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._mapPosToBlock(this.displayValue.length),n=new Ve;if(!o)return n;for(let i=o.index,s;s=this._blocks[i];++i){var a;let l=s._appendChar(t,ae(V({},r),{_beforeTailState:(a=r._beforeTailState)==null||(a=a._blocks)==null?void 0:a[i]}));if(n.aggregate(l),l.consumed)break}return n}extractTail(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=new dp;return t===r||this._forEachBlocksInRange(t,r,(n,a,i,s)=>{let l=n.extractTail(i,s);l.stop=this._findStopBefore(a),l.from=this._blockStartPos(a),l instanceof dp&&(l.blockIndex=a),o.extend(l)}),o}extractInput(t,r,o){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),o===void 0&&(o={}),t===r)return"";let n="";return this._forEachBlocksInRange(t,r,(a,i,s,l)=>{n+=a.extractInput(s,l,o)}),n}_findStopBefore(t){let r;for(let o=0;o<this._stops.length;++o){let n=this._stops[o];if(n<=t)r=n;else break}return r}_appendPlaceholder(t){let r=new Ve;if(this.lazy&&t==null)return r;let o=this._mapPosToBlock(this.displayValue.length);if(!o)return r;let n=o.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(n,a).forEach(i=>{if(!i.lazy||t!=null){var s;r.aggregate(i._appendPlaceholder((s=i._blocks)==null?void 0:s.length))}}),r}_mapPosToBlock(t){let r="";for(let o=0;o<this._blocks.length;++o){let n=this._blocks[o],a=r.length;if(r+=n.displayValue,t<=r.length)return{index:o,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((r,o)=>r+=o.displayValue.length,0)}_forEachBlocksInRange(t,r,o){r===void 0&&(r=this.displayValue.length);let n=this._mapPosToBlock(t);if(n){let a=this._mapPosToBlock(r),i=a&&n.index===a.index,s=n.offset,l=a&&i?a.offset:this._blocks[n.index].displayValue.length;if(o(this._blocks[n.index],n.index,s,l),a&&!i){for(let p=n.index+1;p<a.index;++p)o(this._blocks[p],p,0,this._blocks[p].displayValue.length);o(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=super.remove(t,r);return this._forEachBlocksInRange(t,r,(n,a,i,s)=>{o.aggregate(n.remove(i,s))}),o}nearestInputPos(t,r){if(r===void 0&&(r=we.NONE),!this._blocks.length)return 0;let o=new py(this,t);if(r===we.NONE)return o.pushRightBeforeInput()||(o.popState(),o.pushLeftBeforeInput())?o.pos:this.displayValue.length;if(r===we.LEFT||r===we.FORCE_LEFT){if(r===we.LEFT){if(o.pushRightBeforeFilled(),o.ok&&o.pos===t)return t;o.popState()}if(o.pushLeftBeforeInput(),o.pushLeftBeforeRequired(),o.pushLeftBeforeFilled(),r===we.LEFT){if(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.ok&&o.pos<=t||(o.popState(),o.ok&&o.pos<=t))return o.pos;o.popState()}return o.ok?o.pos:r===we.FORCE_LEFT?0:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:0)}return r===we.RIGHT||r===we.FORCE_RIGHT?(o.pushRightBeforeInput(),o.pushRightBeforeRequired(),o.pushRightBeforeFilled()?o.pos:r===we.FORCE_RIGHT?this.displayValue.length:(o.popState(),o.ok||(o.popState(),o.ok)?o.pos:this.nearestInputPos(t,we.LEFT))):t}totalInputPositions(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=0;return this._forEachBlocksInRange(t,r,(n,a,i,s)=>{o+=n.totalInputPositions(i,s)}),o}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){let r=this._maskedBlocks[t];return r?r.map(o=>this._blocks[o]):[]}pad(t){let r=new Ve;return this._forEachBlocksInRange(0,this.displayValue.length,o=>r.aggregate(o.pad(t))),r}};or.DEFAULTS=ae(V({},qt.DEFAULTS),{lazy:!0,placeholderChar:"_"});or.STOP_CHAR="`";or.ESCAPE_CHAR="\\";or.InputDefinition=Ti;or.FixedDefinition=fp;Ce.MaskedPattern=or;var Pi=class extends or{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){let c=t,{to:r=this.to||0,from:o=this.from||0,maxLength:n=this.maxLength||0,autofix:a=this.autofix}=c,i=xe(c,["to","from","maxLength","autofix"]);this.to=r,this.from=o,this.maxLength=Math.max(String(r).length,n),this.autofix=a;let s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),p=0;for(;p<l.length&&l[p]===s[p];)++p;i.mask=l.slice(0,p).replace(/0/g,"\\0")+"0".repeat(this.maxLength-p),super._update(i)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let r="",o="",[,n,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(r="0".repeat(n.length)+a,o="9".repeat(n.length)+a),r=r.padEnd(this.maxLength,"0"),o=o.padEnd(this.maxLength,"9"),[r,o]}doPrepareChar(t,r){r===void 0&&(r={});let o;return[t,o]=super.doPrepareChar(t.replace(/\D/g,""),r),t||(o.skip=!this.isComplete),[t,o]}_appendCharRaw(t,r){if(r===void 0&&(r={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,r);let o=String(this.from).padStart(this.maxLength,"0"),n=String(this.to).padStart(this.maxLength,"0"),[a,i]=this.boundaries(this.value+t);return Number(i)<this.from?super._appendCharRaw(o[this.value.length],r):Number(a)>this.to?!r.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(o[this.value.length],r).aggregate(this._appendCharRaw(t,r)):super._appendCharRaw(n[this.value.length],r):super._appendCharRaw(t,r)}doValidate(t){let r=this.value;if(r.search(/[^0]/)===-1&&r.length<=this._matchFrom)return!0;let[n,a]=this.boundaries(r);return this.from<=Number(a)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){let r=new Ve;if(this.value.length===this.maxLength)return r;let o=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let a=0;a<n;++a)r.aggregate(super._appendCharRaw("0",t));o.split("").forEach(a=>this._appendCharRaw(a))}return r}};Ce.MaskedRange=Pi;var mp=class e extends or{static extractPatternOptions(t){let a=t,{mask:r,pattern:o}=a,n=xe(a,["mask","pattern"]);return ae(V({},n),{mask:xo(r)?r:o})}constructor(t){super(e.extractPatternOptions(V(V({},e.DEFAULTS),t)))}updateOptions(t){super.updateOptions(t)}_update(t){let s=V(V({},e.DEFAULTS),t),{mask:r,pattern:o,blocks:n}=s,a=xe(s,["mask","pattern","blocks"]),i=Object.assign({},e.GET_DEFAULT_BLOCKS());t.min&&(i.Y.from=t.min.getFullYear()),t.max&&(i.Y.to=t.max.getFullYear()),t.min&&t.max&&i.Y.from===i.Y.to&&(i.m.from=t.min.getMonth()+1,i.m.to=t.max.getMonth()+1,i.m.from===i.m.to&&(i.d.from=t.min.getDate(),i.d.to=t.max.getDate())),Object.assign(i,this.blocks,n),super._update(ae(V({},a),{mask:xo(r)?r:o,blocks:i}))}doValidate(t){let r=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&r!=null&&(this.min==null||this.min<=r)&&(this.max==null||r<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(e.extractPatternOptions(t))}};mp.GET_DEFAULT_BLOCKS=()=>({d:{mask:Pi,from:1,to:31,maxLength:2},m:{mask:Pi,from:1,to:12,maxLength:2},Y:{mask:Pi,from:1900,to:9999}});mp.DEFAULTS=ae(V({},or.DEFAULTS),{mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>{if(!e)return"";let r=String(e.getDate()).padStart(2,"0"),o=String(e.getMonth()+1).padStart(2,"0"),n=e.getFullYear();return[r,o,n].join(".")},parse:(e,t)=>{let[r,o,n]=e.split(".").map(Number);return new Date(n,o-1,r)}});Ce.MaskedDate=mp;var Ou=class e extends qt{constructor(t){super(V(V({},e.DEFAULTS),t)),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(r=>{let i=ga(r),{expose:o}=i,n=xe(i,["expose"]),a=Br(V({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid},n));return o&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._applyDispatch(t,r);return this.currentMask&&o.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(r))),o}_applyDispatch(t,r,o){t===void 0&&(t=""),r===void 0&&(r={}),o===void 0&&(o="");let n=r.tail&&r._beforeTailState!=null?r._beforeTailState._value:this.value,a=this.rawInputValue,i=r.tail&&r._beforeTailState!=null?r._beforeTailState._rawInputValue:a,s=a.slice(i.length),l=this.currentMask,p=new Ve,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(t,V({},r),o),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),i&&(this.currentMask.append(i,{raw:!0}),p.tailShift=this.currentMask.value.length-n.length),s&&(p.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),p}_appendPlaceholder(){let t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){let t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){let r=new Ve;return t&&r.aggregate(this._applyDispatch("",{},t)),r.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var r,o;return ae(V({},t),{_beforeTailState:((r=t._beforeTailState)==null?void 0:r.currentMaskRef)===this.currentMask&&((o=t._beforeTailState)==null?void 0:o.currentMask)||t._beforeTailState})}doDispatch(t,r,o){return r===void 0&&(r={}),o===void 0&&(o=""),this.dispatch(t,this,r,o)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,r){r===void 0&&(r={});let[o,n]=super.doPrepare(t,r);if(this.currentMask){let a;[o,a]=super.doPrepare(o,this.currentMaskFlags(r)),n=n.aggregate(a)}return[o,n]}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(t,r);if(this.currentMask){let a;[o,a]=super.doPrepareChar(o,this.currentMaskFlags(r)),n=n.aggregate(a)}return[o,n]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(r=>r.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let r=String(t);this.currentMask&&(this.currentMask.typedValue=t,r=this.currentMask.unmaskedValue),this.unmaskedValue=r}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,r){let o=new Ve;return this.currentMask&&o.aggregate(this.currentMask.remove(t,r)).aggregate(this._applyDispatch()),o}get state(){var t;return ae(V({},super.state),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(r=>r.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state})}set state(t){let i=t,{compiledMasks:r,currentMaskRef:o,currentMask:n}=i,a=xe(i,["compiledMasks","currentMaskRef","currentMask"]);r&&this.compiledMasks.forEach((s,l)=>s.state=r[l]),o!=null&&(this.currentMask=o,this.currentMask.state=n),super.state=a}extractInput(t,r,o){return this.currentMask?this.currentMask.extractInput(t,r,o):""}extractTail(t,r){return this.currentMask?this.currentMask.extractTail(t,r):super.extractTail(t,r)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,r){return this.currentMask?this.currentMask.nearestInputPos(t,r):super.nearestInputPos(t,r)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((r,o)=>{if(!t[o])return;let i=t[o],{mask:n}=i,a=xe(i,["mask"]);return cp(r,a)&&r.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var r;return!!((r=this.currentMask)!=null&&r.typedValueEquals(t))}};Ou.DEFAULTS=ae(V({},qt.DEFAULTS),{dispatch:(e,t,r,o)=>{if(!t.compiledMasks.length)return;let n=t.rawInputValue,a=t.compiledMasks.map((i,s)=>{let l=t.currentMask===i,p=l?i.displayValue.length:i.nearestInputPos(i.displayValue.length,we.FORCE_LEFT);return i.rawInputValue!==n?(i.reset(),i.append(n,{raw:!0})):l||i.remove(p),i.append(e,t.currentMaskFlags(r)),i.appendTail(o),{index:s,weight:i.rawInputValue.length,totalInputPositions:i.totalInputPositions(0,Math.max(p,i.nearestInputPos(i.displayValue.length,we.FORCE_LEFT)))}});return a.sort((i,s)=>s.weight-i.weight||s.totalInputPositions-i.totalInputPositions),t.compiledMasks[a[0].index]}});Ce.MaskedDynamic=Ou;var _u=class e extends or{constructor(t){super(V(V({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){let n=t,{enum:r}=n,o=xe(n,["enum"]);if(r){let a=r.map(l=>l.length),i=Math.min(...a),s=Math.max(...a)-i;o.mask="*".repeat(i),s&&(o.mask+="["+"*".repeat(s)+"]"),this.enum=r}super._update(o)}_appendCharRaw(t,r){r===void 0&&(r={});let o=Math.min(this.nearestInputPos(0,we.FORCE_RIGHT),this.value.length),n=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,o));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(i,s)=>{let l=n[0][s];s>=this.value.length||l===i.value||(i.reset(),i._appendChar(l,r))});let a=super._appendCharRaw(n[0][this.value.length],r);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(i=>a.aggregate(super._appendCharRaw(i))),a}return new Ve}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new zr("",t)}remove(t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),t===r)return new Ve;let o=Math.min(super.nearestInputPos(0,we.FORCE_RIGHT),this.value.length),n;for(n=t;n>=0&&!(this.enum.filter(s=>this.matchValue(s,this.value.slice(o,n),o)).length>1);--n);let a=super.remove(n,r);return a.tailShift+=n-t,a}};_u.DEFAULTS=ae(V({},or.DEFAULTS),{matchValue:(e,t,r)=>e.indexOf(t,r)===r});Ce.MaskedEnum=_u;var uy=class extends qt{updateOptions(t){super.updateOptions(t)}_update(t){super._update(ae(V({},t),{validate:t.mask}))}};Ce.MaskedFunction=uy;var __,Ci=class e extends qt{constructor(t){super(V(V({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){let t="^"+(this.allowNegative?"[+|\\-]?":""),r="\\d*",o=(this.scale?"("+iy(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+r+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(iy).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(iy(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){let r=t.split(this.radix);return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),r.join(this.radix)}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(r.input&&r.raw||!r.input&&!r.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),r);return t&&!o&&(n.skip=!0),o&&!this.allowPositive&&!this.value&&o!=="-"&&n.aggregate(this._appendChar("-")),[o,n]}_separatorsCount(t,r){r===void 0&&(r=!1);let o=0;for(let n=0;n<t;++n)this._value.indexOf(this.thousandsSeparator,n)===n&&(++o,r&&(t+=this.thousandsSeparator.length));return o}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,r,o){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),[t,r]=this._adjustRangeWithSeparators(t,r),this._removeThousandsSeparators(super.extractInput(t,r,o))}_appendCharRaw(t,r){r===void 0&&(r={});let o=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,n=this._separatorsCountFromSlice(o);this._value=this._removeThousandsSeparators(this.value);let a=this._value;this._value+=t;let i=this.number,s=!isNaN(i),l=!1;if(s){let f;this.min!=null&&this.min<0&&this.number<this.min&&(f=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(f=this.max),f!=null&&(this.autofix?(this._value=this.format(f,this).replace(e.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!r.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let p;s?p=new Ve({inserted:this._value.slice(a.length),rawInserted:l?"":t,skip:l}):(this._value=a,p=new Ve),this._value=this._insertThousandsSeparators(this._value);let c=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,u=this._separatorsCountFromSlice(c);return p.tailShift+=(u-n)*this.thousandsSeparator.length,p}_findSeparatorAround(t){if(this.thousandsSeparator){let r=t-this.thousandsSeparator.length+1,o=this.value.indexOf(this.thousandsSeparator,r);if(o<=t)return o}return-1}_adjustRangeWithSeparators(t,r){let o=this._findSeparatorAround(t);o>=0&&(t=o);let n=this._findSeparatorAround(r);return n>=0&&(r=n+this.thousandsSeparator.length),[t,r]}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),[t,r]=this._adjustRangeWithSeparators(t,r);let o=this.value.slice(0,t),n=this.value.slice(r),a=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+n));let i=this._separatorsCountFromSlice(o);return new Ve({tailShift:(i-a)*this.thousandsSeparator.length})}nearestInputPos(t,r){if(!this.thousandsSeparator)return t;switch(r){case we.NONE:case we.LEFT:case we.FORCE_LEFT:{let o=this._findSeparatorAround(t-1);if(o>=0){let n=o+this.thousandsSeparator.length;if(t<n||this.value.length<=n||r===we.FORCE_LEFT)return o}break}case we.RIGHT:case we.FORCE_RIGHT:{let o=this._findSeparatorAround(t);if(o>=0)return o+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){let t=this.number,r=t;this.min!=null&&(r=Math.max(r,this.min)),this.max!=null&&(r=Math.min(r,this.max)),r!==t&&(this.unmaskedValue=this.format(r,this));let o=this.value;this.normalizeZeros&&(o=this._normalizeZeros(o)),this.padFractionalZeros&&this.scale>0&&(o=this._padFractionalZeros(o)),this._value=o}super.doCommit()}_normalizeZeros(t){let r=this._removeThousandsSeparators(t).split(this.radix);return r[0]=r[0].replace(/^(\D*)(0*)(\d*)/,(o,n,a,i)=>n+i),t.length&&!/\d$/.test(r[0])&&(r[0]=r[0]+"0"),r.length>1&&(r[1]=r[1].replace(/0*$/,""),r[1].length||(r.length=1)),this._insertThousandsSeparators(r.join(this.radix))}_padFractionalZeros(t){if(!t)return t;let r=t.split(this.radix);return r.length<2&&r.push(""),r[1]=r[1].padEnd(this.scale,"0"),r.join(this.radix)}doSkipInvalid(t,r,o){r===void 0&&(r={});let n=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===e.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,r,o)&&!n}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,e.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(e.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}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(t){return(super.typedValueEquals(t)||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}};__=Ci;Ci.UNMASKED_RADIX=".";Ci.EMPTY_VALUES=[...qt.EMPTY_VALUES,0];Ci.DEFAULTS=ae(V({},qt.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[__.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})});Ce.MaskedNumber=Ci;var dy={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Yx(e,t,r){t===void 0&&(t=dy.MASKED),r===void 0&&(r=dy.MASKED);let o=Br(e);return n=>o.runIsolated(a=>(a[t]=n,a[r]))}function D_(e,t,r,o){return Yx(t,r,o)(e)}Ce.PIPE_TYPE=dy;Ce.createPipe=Yx;Ce.pipe=D_;var fy=class extends or{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var r,o,n;let l=ga(t),{repeat:a}=l,i=xe(l,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,i);let s=Br(this._blockOpts);this.repeat=(r=(o=a!=null?a:s.repeat)!=null?o:this.repeat)!=null?r:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((n=this._blocks)==null?void 0:n.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Br(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,r){r===void 0&&(r={});let o=new Ve;for(let l=(n=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?n:Math.max(this._blocks.length-1,0),p,c;p=(i=this._blocks[l])!=null?i:c=!c&&this._allocateBlock(l);++l){var n,a,i,s;let u=p._appendChar(t,ae(V({},r),{_beforeTailState:(s=r._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]}));if(u.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(u),u.consumed)break}return o}_trimEmptyTail(t,r){var o,n;t===void 0&&(t=0);let a=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0),i;r!=null&&(i=(n=this._mapPosToBlock(r))==null?void 0:n.index),i==null&&(i=this._blocks.length-1);let s=0;for(let l=i;a<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(i-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(t,r){t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length);let o=super.remove(t,r);return this._trimEmptyTail(t,r),o}totalInputPositions(t,r){return t===void 0&&(t=0),r==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,r)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};Ce.RepeatBlock=fy;try{globalThis.IMask=Ce}catch(e){}import qx from"react";var Be=lo(fC(),1);import my from"react";var w_={mask:Be.default.oneOfType([Be.default.array,Be.default.func,Be.default.string,Be.default.instanceOf(RegExp),Be.default.oneOf([Date,Number,Ce.Masked]),Be.default.instanceOf(Ce.Masked)]),value:Be.default.any,unmask:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["typed"])]),prepare:Be.default.func,prepareChar:Be.default.func,validate:Be.default.func,commit:Be.default.func,overwrite:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["shift"])]),eager:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["append","remove"])]),skipInvalid:Be.default.bool,onAccept:Be.default.func,onComplete:Be.default.func,placeholderChar:Be.default.string,displayChar:Be.default.string,lazy:Be.default.bool,definitions:Be.default.object,blocks:Be.default.object,enum:Be.default.arrayOf(Be.default.string),maxLength:Be.default.number,from:Be.default.number,to:Be.default.number,pattern:Be.default.string,format:Be.default.func,parse:Be.default.func,autofix:Be.default.oneOfType([Be.default.bool,Be.default.oneOf(["pad"])]),radix:Be.default.string,thousandsSeparator:Be.default.string,mapToRadix:Be.default.arrayOf(Be.default.string),scale:Be.default.number,normalizeZeros:Be.default.bool,padFractionalZeros:Be.default.bool,min:Be.default.oneOfType([Be.default.number,Be.default.instanceOf(Date)]),max:Be.default.oneOfType([Be.default.number,Be.default.instanceOf(Date)]),dispatch:Be.default.func,inputRef:Be.default.oneOfType([Be.default.func,Be.default.shape({current:Be.default.object})])},A_=Object.keys(w_).filter(e=>e!=="value"),S7=["value","unmask","onAccept","onComplete","inputRef"],k7=A_.filter(e=>S7.indexOf(e)<0);function Jx(e){var t;let r=(t=class extends my.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let a=this.props,i=this._extractMaskOptionsFromProps(a);if(i.mask)this.maskRef?(this.maskRef.updateOptions(i),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(i);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=Ce(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){let i=xe(a,[]);return Object.keys(i).filter(s=>k7.indexOf(s)<0).forEach(s=>{delete i[s]}),i}_extractNonMaskProps(a){let i=xe(a,[]);return A_.forEach(s=>{s!=="maxLength"&&delete i[s]}),"defaultValue"in i||(i.defaultValue=a.mask?"":i.value),delete i.value,i}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 my.createElement(e,ae(V({},this._extractNonMaskProps(this.props)),{inputRef:this._inputRef}))}},t.displayName=void 0,t.propTypes=void 0,t),o=e.displayName||e.name||"Component";return r.displayName="IMask("+o+")",r.propTypes=w_,my.forwardRef((n,a)=>my.createElement(r,ae(V({},n),{ref:a})))}var R7=Jx(e=>{let o=e,{inputRef:t}=o,r=xe(o,["inputRef"]);return qx.createElement("input",ae(V({},r),{ref:t}))}),E7=(e,t)=>qx.createElement(R7,ae(V({},e),{ref:t})),ba=qx.forwardRef(E7);import{useRef as fKe,useState as mKe,useCallback as hKe,useEffect as yKe}from"react";import"react";import{jsx as I7}from"react/jsx-runtime";var Si=$t(I7("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday");import{motion as O7}from"framer-motion";var _7=O7(Rm),D7=E(_7)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Du=D7;Du.displayName="DialogActions";var jn=Du;var z7=E(Yt,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),F7=E(Xo,{name:"DatePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),$7=E("div",{name:"DatePicker",slot:"root",overridesResolver:(e,t)=>t.root})({width:"100%"}),M_=(e,t)=>{let r=`${e.getDate()}`,o=`${e.getMonth()+1}`,n=e.getFullYear();return Number(r)<10&&(r="0"+r),Number(o)<10&&(o="0"+o),t.replace(/YYYY/g,n.toString()).replace(/MM/g,o).replace(/DD/g,r)};function V7(e,t){let r=t.split(/[-./\s]/),o=e.split(/[-./\s]/);if(r.length!==o.length)throw new Error("Invalid date string or format");let n,a,i;for(let l=0;l<r.length;l++){let p=parseInt(o[l],10);switch(r[l]){case"DD":n=p;break;case"MM":a=p-1;break;case"YYYY":i=p;break}}return new Date(i,a,n)}var j7=e=>e.replace(/YYYY/g,"Y").replace(/MM/g,"M").replace(/DD/g,"D").replace(/[^YMD\s]/g,t=>`${t}\``),H7=w7.forwardRef(function(t,r){let i=t,{onChange:o,format:n}=i,a=xe(i,["onChange","format"]);return N(ba,ae(V({},a),{inputRef:r,onAccept:s=>o({target:{name:t.name,value:s}}),mask:Date,pattern:j7(n),blocks:{D:{mask:Ce.MaskedRange,from:1,to:31,maxLength:2},M:{mask:Ce.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ce.MaskedRange,from:1900,to:9999,maxLength:4}},format:s=>M_(s,n),parse:s=>V7(s,n),autofix:"pad",overwrite:!0}))}),hy=A7((e,t)=>{let r=G({props:e,name:"DatePicker"}),_=r,{onChange:o,disabled:n,label:a,error:i,helperText:s,minDate:l,maxDate:p,disableFuture:c,disablePast:u,required:f,sx:d,className:y,format:h="YYYY/MM/DD",size:b}=_,v=xe(_,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required","sx","className","format","size"]),x=L7(null),[g,S]=pr(r.value,r.defaultValue||"",Kx(A=>o==null?void 0:o({target:{name:r.name,value:A}}),[r.name,o]),{disableStrict:!0}),[T,P]=B7(null),C=!!T;M7(()=>{var A;T||(A=x.current)==null||A.blur()},[T,x]),N7(t,()=>x.current,[x]);let k=Kx(A=>{S(A.target.value)},[S]),I=Kx(A=>{P(T?null:A.currentTarget),setTimeout(()=>{var M;(M=x.current)==null||M.focus()},0)},[T,P,x]);return N($7,{children:N(ro,{open:!0,children:Ee(Yo,{children:[N(Jr,ae(V({},v),{color:i?"danger":v.color,ref:x,size:b,value:g,onChange:k,placeholder:h,disabled:n,required:f,error:i,slotProps:{input:{component:H7,ref:x,format:h}},className:y,sx:d,endDecorator:N(Jt,{variant:"plain",onClick:I,"aria-label":"Toggle Calendar","aria-controls":"date-picker-popper","aria-haspopup":"dialog","aria-expanded":C,children:N(Si,{})}),label:a,helperText:s})),C&&N(Zn,{onClickAway:()=>P(null),children:N(z7,{id:"date-picker-popper",open:!0,anchorEl:T,placement:"bottom-end",onMouseDown:A=>A.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],"aria-label":"Calendar Tooltip","aria-expanded":C,children:Ee(F7,{tabIndex:-1,role:"presentation",children:[N(gi,{value:Number.isNaN(new Date(g).getTime())?void 0:[new Date(g),void 0],onChange:([A])=>{k({target:{name:r.name,value:M_(A,h)}}),P(null)},minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:c,disablePast:u}),N(jn,{sx:{p:1},children:N(wt,{size:b,variant:"plain",color:"neutral",onClick:()=>{k({target:{name:r.name,value:""}}),P(null)},children:"Clear"})})]})})})]})})})});var N_=hy;import{motion as U7}from"framer-motion";var W7=U7(gh),wu=e=>{let y=e,{label:t,error:r,helperText:o,color:n,size:a,disabled:i,required:s,minRows:l=2,maxRows:p=4,sx:c,className:u}=y,f=xe(y,["label","error","helperText","color","size","disabled","required","minRows","maxRows","sx","className"]),d=N(W7,V({required:s,disabled:i,color:r?"danger":n,size:a,minRows:l,maxRows:p},f));return Ee(Fn,{required:s,disabled:i,color:n,size:a,error:r,sx:c,className:u,children:[t&&N($n,{children:t}),d,o&&N(Vn,{children:o})]})};wu.displayName="Textarea";var L_=wu;import{useMemo as G7}from"react";import{motion as Y7}from"framer-motion";var J7=Y7(Zm),yy=J7;yy.displayName="Option";function Au(e){let h=e,{label:t,helperText:r,error:o,size:n,color:a,disabled:i,required:s,onChange:l,sx:p,className:c}=h,u=xe(h,["label","helperText","error","size","color","disabled","required","onChange","sx","className"]),f=G7(()=>e.options.map(b=>typeof b!="object"?{value:b,label:b}:b),[e.options]),d=(b,v)=>{var S;let x=b||{target:{}},g=ae(V({},x),{target:{name:((S=x.target)==null?void 0:S.name)||e.name,value:v||void 0}});l==null||l(g)},y=N(th,ae(V({},u),{required:s,disabled:i,size:n,color:o?"danger":a,onChange:d,children:f.map(b=>N(yy,{value:b.value,children:b.label},b.value))}));return Ee(Fn,{required:s,disabled:i,size:n,color:a,error:o,sx:p,className:c,children:[t&&N($n,{children:t}),y,r&&N(Vn,{children:r})]})}Au.displayName="Select";var B_=Au;import{motion as q7}from"framer-motion";var K7=q7(bh),Mu=e=>N(K7,V({},e));Mu.displayName="Tooltip";var z_=Mu;import{motion as $_}from"framer-motion";Vi();function V_(e){return!e.editMode&&["number","date","currency"].includes(e.type||"")?"end":"start"}var Q7=E("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),gy=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function eG(e){let{paginationModel:{page:t,pageSize:r},rowCount:o,onPageChange:n}=e,a=1,i=Math.ceil(o/r),s=[t-2,t-1].filter(u=>u>1),l=[t+1,t+2].filter(u=>u<=i-1),p=i>1&&t<i-3,c=i>1&&t>4;return N(Et,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center",children:Ee(Et,{direction:"row",spacing:.5,alignItems:"center",children:[N(Jt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-1),disabled:t===a,"aria-label":"Previous page",children:N($h,{})}),t!==a&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(a),children:a}),c&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-3),children:"..."}),s.map(u=>N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(u),children:u},u)),N(wt,{variant:"soft",size:"sm",children:t}),l.map(u=>N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(u),children:u},u)),p&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+3),children:"..."}),t!==i&&N(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(i),children:i}),N(Jt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+1),disabled:t===i,"aria-label":"Next page",children:N(Vh,{})})]})})}var tG=e=>N(Fh,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onClick:t=>t.stopPropagation(),onMouseDown:t=>{var i;let r=t.clientX,o=(i=e.current)==null?void 0:i.getBoundingClientRect().width,n=s=>{o&&r&&(e.current.style.width=`${o+(s.clientX-r)}px`)},a=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)}}),rG=E("tbody",{name:"DataTable",slot:"tableBody"})({"&::after":{content:"''",display:"block",height:"100%"}}),oG=E("tr",{name:"DataTable",slot:"tableRow",shouldForwardProp:e=>e!=="striped"})(({striped:e})=>ae(V({},e&&{background:"var(--TableRow-stripeBackground, var(--ceed-palette-background-level2))",color:"var(--ceed-palette-text-primary)"}),{"&:hover":{background:"var(--TableRow-hoverBackground, var(--ceed-palette-background-level3))"}})),nG=E("span",{name:"DataTable",slot:"headCellAsterisk"})(({theme:e})=>({color:"var(--ceed-palette-danger-500)",marginLeft:e.spacing(.5)})),aG=$_(I_),iG=e=>{let{width:t,maxWidth:r,minWidth:o,stickyHeader:n,resizable:a,field:i,tableId:s,headerName:l,required:p,editMode:c,sort:u,onSortChange:f,sortable:d=!0,sortOrder:y}=e,h=Xx(null),b=cr(()=>`${s}_header_${l!=null?l:i}`.trim(),[s,l,i]),v=a==null||a?tG(h):null,x={width:t,minWidth:o!=null?o:"50px",maxWidth:r,position:n?void 0:"relative",cursor:d?"pointer":"default",userSelect:"none"},g=V_(e),S=y[0],T=d&&N(aG,{style:{width:"16px",height:"16px"},role:"img","aria-labelledby":b,"aria-description":(u!=null?u:S)==="desc"?"descending":"ascending","data-testid":void 0,variants:{hover:{opacity:1},initial:{opacity:0}},animate:{color:u?"var(--ceed-palette-text-secondary)":"var(--ceed-palette-primary-solidDisabledColor)",rotate:(u!=null?u:S)==="desc"?180:0,opacity:u?1:0},transition:{duration:0,rotate:{duration:.2,ease:"easeOut"},color:{duration:.2,ease:"easeInOut"},opacity:{duration:.2,ease:"easeInOut"}}});return Ee($_.th,{id:b,"aria-label":l!=null?l:i,"aria-sort":u?{asc:"ascending",desc:"descending"}[u]:"none",ref:h,style:x,onClick:P=>d&&(f==null?void 0:f({field:i,currentSort:u,multiple:P.shiftKey})),whileHover:"hover",initial:"initial",children:[Ee(Et,{gap:1,direction:"row",justifyContent:g,children:[g==="end"&&T,Ee("div",{children:[l!=null?l:i,c&&p&&N(nG,{children:"*"})]}),g==="start"&&T]}),v]},i)},sG=e=>{var T;let{tableId:t,field:r,type:o,renderCell:n,renderEditCell:a,isCellEditable:i,noWrap:s,row:l,rowId:p}=e,[c,u]=F_(l[r]),f=Xx(null),d=cr(()=>({row:l,value:c,id:p}),[l,p,c]),y=cr(()=>!!(e.editMode&&(typeof i=="function"?i(d):i==null||i)),[e.editMode,i,d]),h=cr(()=>ae(V({},typeof e.componentProps=="function"?e.componentProps(d):e.componentProps||{}),{size:"sm"}),[e,d]),b=cr(()=>V(ae(V({},h),{onChange:P=>{var C,k;(C=h.onChange)==null||C.call(h,P),u(P.target.value),o==="select"&&((k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:P.target.value}),value:P.target.value})))},onFocus:P=>{var C,k;(C=h.onFocus)==null||C.call(h,P),(k=e.onCellEditStart)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{value:c}),value:c}))},onBlur:P=>{var C,k;(C=h.onBlur)==null||C.call(h,P),o&&["number","text","longText","currency","date"].includes(o)&&((k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:c}),value:c})))}}),o==="autocomplete"&&{onChangeComplete:P=>{var C,k;(C=h.onChangeComplete)==null||C.call(h,P),u(P.target.value),(k=e.onCellEditStop)==null||k.call(e,ae(V({},d),{originalRow:l,row:ae(V({},d.row),{[r]:P.target.value}),value:P.target.value}))}}),[d,l,r,c,h,o,e]),v=cr(()=>a?a(d):{date:N(N_,V({value:c},b)),currency:N(E_,V({value:c},b)),number:N(Jr,V({value:c,type:"number"},b)),text:N(Jr,V({value:c,type:"text"},b)),longText:N(L_,V({value:c},b)),autocomplete:N(PO,V({value:c,options:b.options||[c]},b)),select:N(B_,V({value:c,options:b.options||[c]},b))}[o||"text"],[c,b,o]),x=cr(()=>{if(n)return n(d);let P=c;return{link:X7.createElement(e.component||ca,V({children:P},h))}[o||"text"]||P},[c,n,d,o,h,e]),g=cr(()=>y&&v?v:x,[y,v,x]),S=cr(()=>s&&e.type==="longText",[s,e.type]);return vy(()=>{u(l[r])},[l,r]),N("td",{ref:f,headers:`${t}_header_${(T=e.headerName)!=null?T:r}`,style:{textAlign:V_({type:o}),verticalAlign:y?"top":"middle"},children:S?N(z_,{title:c,placement:"bottom",style:{maxWidth:"100%"},enterDelay:1500,enterNextDelay:1500,children:N("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:g})}):g},r)},lG=e=>{let{tableId:t,columns:r,rowId:o,editMode:n,noWrap:a,row:i}=e;return N(Yo,{children:r.map((s,l)=>QP(sG,ae(V({},s),{tableId:t,key:`${o}_${s.field.toString()}_${l}`,row:i,rowId:o,editMode:n,noWrap:a})))})};function pG({rows:e,columns:t,rowCount:r,pagination:o,paginationMode:n,paginationModel:a,onPaginationModelChange:i,sortModel:s,sortOrder:l=["asc","desc",null],selectionModel:p=[],onSortModelChange:c,onSelectionModelChange:u,editMode:f,getId:d,isTotalSelected:y}){let[h,b]=pr(s,[],xa(B=>c==null?void 0:c(B),[c])),v=cr(()=>t.reduce((B,U)=>ae(V({},B),{[U.field]:U}),{}),[t]),x=xa((B,U)=>{for(let F of h){let{field:R,sort:K}=F,oe=B[R],w=U[R],ce=v[R],he=0;if(ce.sortComparator?he=ce.sortComparator({rowA:B,rowB:U}):typeof oe=="string"&&typeof w=="string"?he=oe.localeCompare(w):typeof oe=="number"&&typeof w=="number"?he=oe-w:oe instanceof Date&&w instanceof Date&&(he=oe.getTime()-w.getTime()),he!==0)return K==="asc"?he:-he}return 0},[h,v]),g=cr(()=>h.length?[...e].sort(x):e,[e,h,x]),S=cr(()=>Array.from(new Set(l)),[l]),[T,P]=F_((a==null?void 0:a.page)||1),C=(a==null?void 0:a.pageSize)||20,k=xa((B,U)=>{var F,R;return(R=(F=d==null?void 0:d(B))!=null?F:B.id)!=null?R:`${(U||0)+(T-1)*C}`},[d,T,C]),I=cr(()=>new Set(p),[p]),_=cr(()=>!o||n==="server"?g:g.slice((T-1)*C,(T-1)*C+C),[g,T,C,n,o]),A=cr(()=>_.length>0&&_.every((B,U)=>I.has(k(B,U))),[_,I,k]),M=r||g.length,O=cr(()=>y!=null?y:M>0&&p.length===M,[y,p,M]),z=cr(()=>(t||Object.keys(g[0]||{}).map(U=>({field:U}))).map(U=>{var F,R,K;return ae(V({},U),{isCellEditable:f&&(typeof U.isCellEditable=="function"?U.isCellEditable:(F=U.isCellEditable)!=null?F:!0),sort:(R=h.find(oe=>oe.field===U.field))==null?void 0:R.sort,sortOrder:((K=v[U.field])==null?void 0:K.sortOrder)||S})}),[g,t,f,h,v,S]),L=xa(B=>{P(B),i==null||i({page:B,pageSize:C})},[i,C]),D=xa(B=>{let{field:U,currentSort:F,multiple:R}=B,oe=v[U].sortOrder||S;if(F!==void 0){let ce=(oe.indexOf(F)+1)%oe.length,he=oe[ce];if(!he){let ie=R?h.filter(W=>W.field!==U):[];b(ie);return}let Ne=R?h.map(ie=>ie.field===U?{field:U,sort:he}:ie):[{field:U,sort:he}];b(Ne)}else{let w=R?[...h,{field:U,sort:oe[0]}]:[{field:U,sort:oe[0]}];b(w)}},[S,v,h,b]);return vy(()=>{a||L(1)},[M,L,a]),vy(()=>{let B=Math.max(1,Math.ceil(M/C));T>B&&L(B)},[T,M,C,L]),vy(()=>{u==null||u([])},[T]),{rowCount:M,page:T,pageSize:C,onPaginationModelChange:L,getId:k,HeadCell:iG,BodyRow:lG,dataInPage:_,handleSortChange:D,isAllSelected:A,isTotalSelected:O,isSelectedRow:xa(B=>I.has(B),[I]),onAllCheckboxChange:xa(()=>{u==null||u(A?[]:_.map(k))},[A,_,u,k]),onCheckboxChange:xa((B,U)=>{if(I.has(U)){let F=p.filter(R=>R!==U);u==null||u(F)}else{let F=[...p,U];u==null||u(F)}},[p,u,I]),columns:z,onTotalSelect:xa(()=>{u==null||u(O?[]:g.map(k),!O)},[O,g,u,k])}}function Zx(e){let Fe=e,{rows:t,checkboxSelection:r,editMode:o,selectionModel:n,onSelectionModelChange:a,disableSelectionOnClick:i,onRowClick:s,rowCount:l,columns:p,onPaginationModelChange:c,pagination:u,paginationMode:f,paginationModel:d,sortModel:y,sortOrder:h,onSortModelChange:b,loading:v,slots:{checkbox:x=hu,toolbar:g,footer:S,loadingOverlay:T=()=>N(Bc,{value:8,variant:"plain"})}={},slotProps:{checkbox:P={},toolbar:C,background:k={}}={},stripe:I}=Fe,_=xe(Fe,["rows","checkboxSelection","editMode","selectionModel","onSelectionModelChange","disableSelectionOnClick","onRowClick","rowCount","columns","onPaginationModelChange","pagination","paginationMode","paginationModel","sortModel","sortOrder","onSortModelChange","loading","slots","slotProps","stripe"]),A=Z7(),M=Xx(null),{columns:O,isAllSelected:z,isSelectedRow:L,onAllCheckboxChange:D,onCheckboxChange:B,getId:U,rowCount:F,page:R,pageSize:K,onPaginationModelChange:oe,handleSortChange:w,dataInPage:ce,isTotalSelected:he,onTotalSelect:Ne,HeadCell:ie,BodyRow:W}=pG(e),de=Lh({count:ce.length,getScrollElement:()=>M.current,estimateSize:()=>32,measureElement:je=>je.clientHeight,overscan:20}),ye=cr(()=>({page:R,pageSize:K}),[R,K]),ke=de.getTotalSize(),Pe=de.getVirtualItems();return Ee(Fh,{sx:{maxHeight:"100%",overflow:"auto",display:"flex",flexDirection:"column"},children:[(!!r||!!g)&&Ee(Et,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center",children:[!!r&&Ee(Et,{direction:"row",spacing:1,children:[!z&&Ee(Pr,{level:"body-xs",children:[gy((n==null?void 0:n.length)||0)," items selected"]}),z&&!he&&Ee(Et,{direction:"row",spacing:1,alignItems:"center",children:[Ee(Pr,{level:"body-xs",children:["All ",gy((n==null?void 0:n.length)||0)," items on this page are selected."]}),Ee(wt,{size:"sm",variant:"plain",onClick:Ne,children:["Select all ",gy(F!=null?F:t.length)," items"]})]}),he&&Ee(Et,{direction:"row",spacing:1,alignItems:"center",children:[Ee(Pr,{level:"body-xs",children:["All ",gy(F!=null?F:t.length)," items are selected."]}),N(wt,{size:"sm",variant:"plain",color:"danger",onClick:Ne,children:"Cancel"})]})]}),g&&N(g,V({},C||{}))]}),N(Xo,ae(V({variant:"outlined",sx:{height:"100%",overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},ref:M},k),{children:Ee(Ru,ae(V({},_),{children:[N("thead",{children:Ee("tr",{children:[r&&N("th",{style:{width:"40px",textAlign:"center"},children:N(x,V({onChange:D,checked:z,indeterminate:(n||[]).length>0&&!z},P))}),O.map((je,re)=>N(ie,V({tableId:A,stickyHeader:e.stickyHeader,editMode:!!je.isCellEditable,onSortChange:w},je),`${je.field.toString()}_${re}`))]})}),Ee(rG,{style:{height:`${ke}px`},children:[!!v&&N(Q7,{children:N("td",{children:N(Fh,{sx:{position:"absolute",top:0,left:0,right:0},children:N(T,{})})})}),Pe.map((je,re)=>{let Z=je.index,be=ce[Z],me=U(be,Z),$e=I&&(I==="even"&&(Z+1)%2===0||I==="odd"&&(Z+1)%2===1);return Ee(oG,{role:r&&!i?"checkbox":void 0,tabIndex:r&&!i?-1:void 0,onClick:Oe=>{s==null||s({row:be,rowId:me},Oe),r&&!i&&B(Oe,me)},"aria-checked":r&&!i?L(me):void 0,striped:$e,style:{height:`${je.size}px`,transform:`translateY(${je.start-re*je.size}px)`},children:[r&&N("th",{scope:"row",style:{textAlign:"center"},children:N(x,V({onClick:Oe=>Oe.stopPropagation(),onChange:Oe=>B(Oe,me),checked:L(me)},P))}),N(W,{tableId:A,columns:O,row:be,rowId:me,editMode:o,noWrap:e.noWrap})]},me)})]}),S&&N(S,{})]}))})),u&&N(eG,{paginationModel:ye,rowCount:F,onPageChange:oe})]})}Zx.displayName="DataTable";import cG,{forwardRef as uG,useCallback as by,useEffect as dG,useImperativeHandle as fG,useMemo as mG,useRef as hG,useState as yG}from"react";var gG=E(Yt,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),vG=E(Xo,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),bG=E("div",{name:"DateRangePicker",slot:"root",overridesResolver:(e,t)=>t.root})({width:"100%"}),H_=([e,t],r)=>{let o=n=>{let a=`${n.getDate()}`,i=`${n.getMonth()+1}`,s=n.getFullYear();return Number(a)<10&&(a="0"+a),Number(i)<10&&(i="0"+i),r.replace(/YYYY/g,s.toString()).replace(/MM/g,i).replace(/DD/g,a)};return[o(e),t?o(t):""].join(" - ")};function j_(e,t){let r=t.split(/[-./\s]/),o=e.split(/[-./\s]/),n,a,i;for(let l=0;l<r.length;l++){let p=parseInt(o[l],10);switch(r[l]){case"DD":n=p;break;case"MM":a=p-1;break;case"YYYY":i=p;break}}return new Date(i,a,n)}var U_=(e,t)=>{let r=e.split(" - ")[0]||"",o=e.split(" - ")[1]||"";return[j_(r,t),j_(o,t)]},xG=e=>`${e} - ${e}`.replace(/YYYY/g,"Y").replace(/MM/g,"M").replace(/DD/g,"D").replace(/[^YMD\s]/g,t=>`${t}\``),TG=cG.forwardRef(function(t,r){let i=t,{onChange:o,format:n}=i,a=xe(i,["onChange","format"]);return N(ba,ae(V({},a),{inputRef:r,onAccept:s=>o({target:{name:t.name,value:s}}),mask:Date,pattern:xG(n),blocks:{D:{mask:Ce.MaskedRange,from:1,to:31,maxLength:2},M:{mask:Ce.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ce.MaskedRange,from:1900,to:9999}},format:s=>H_(s,n),parse:s=>U_(s,n),autofix:"pad",overwrite:!0}))}),Qx=uG((e,t)=>{let r=G({props:e,name:"DateRangePicker"}),M=r,{onChange:o,disabled:n,label:a,error:i,helperText:s,minDate:l,maxDate:p,disableFuture:c,disablePast:u,required:f,sx:d,className:y,format:h="YYYY/MM/DD",size:b}=M,v=xe(M,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required","sx","className","format","size"]),x=hG(null),[g,S]=pr(r.value,r.defaultValue||"",by(O=>o==null?void 0:o({target:{name:r.name,value:O}}),[r.name,o]),{disableStrict:!0}),[T,P]=yG(null),C=!!T,k=mG(()=>g?U_(g,h):void 0,[g,h]);dG(()=>{var O;T||(O=x.current)==null||O.blur()},[T,x]),fG(t,()=>x.current,[x]);let I=by(O=>{S(O.target.value)},[S]),_=by(O=>{var z;P(T?null:O.currentTarget),(z=x.current)==null||z.focus()},[T,P,x]),A=by(([O,z])=>{!O||!z||(S(H_([O,z],h)),P(null))},[S,P,h]);return N(bG,{children:N(ro,{open:!0,children:Ee(Yo,{children:[N(Jr,ae(V({},v),{color:i?"danger":v.color,ref:t,size:b,value:g,onChange:I,disabled:n,required:f,placeholder:`${h} - ${h}`,slotProps:{input:{component:TG,ref:x,format:h}},error:i,className:y,sx:d,endDecorator:N(Jt,{variant:"plain",onClick:_,"aria-label":"Toggle Calendar","aria-controls":"date-range-picker-popper","aria-haspopup":"dialog","aria-expanded":C,children:N(Si,{})}),label:a,helperText:s})),C&&N(Zn,{onClickAway:()=>P(null),children:N(gG,{id:"date-range-picker-popper",open:!0,anchorEl:T,placement:"bottom-end",onMouseDown:O=>O.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],"aria-label":"Calendar Tooltip","aria-expanded":C,children:Ee(vG,{tabIndex:-1,role:"presentation",children:[N(gi,{rangeSelection:!0,defaultValue:k,onChange:A,minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:c,disablePast:u}),N(jn,{sx:{p:1},children:N(wt,{size:b,variant:"plain",color:"neutral",onClick:()=>{S(""),P(null)},children:"Clear"})})]})})})]})})})});Qx.displayName="DateRangePicker";import{motion as PG}from"framer-motion";var CG=PG(Im),SG=E(CG)(({theme:e})=>({padding:e.spacing(0,6,5)})),Nu=SG;Nu.displayName="DialogContent";var xy=Nu;import{motion as kG}from"framer-motion";var RG=kG(Om),EG=E(RG)(({theme:e})=>({padding:e.spacing(4,6)})),Lu=EG;Lu.displayName="DialogTitle";var Ty=Lu;import DG from"react";import{motion as eT}from"framer-motion";var IG=eT(wm),tT=IG;tT.displayName="Modal";var W_=E(Jm)({padding:0}),Bu=W_;Bu.displayName="ModalDialog";var OG=E(eT(Ym))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),Py=OG;Py.displayName="ModalClose";var _G=eT(Km),rT=_G;rT.displayName="ModalOverflow";function oT(e){let n=e,{title:t,children:r}=n,o=xe(n,["title","children"]);return Ee(W_,ae(V({},o),{children:[N(Py,{}),N(Ty,{children:t}),N(xy,{children:r})]}))}oT.displayName="ModalFrame";var wG=E(Bu,{name:"Dialog",slot:"Root"})({padding:0}),nT=DG.forwardRef((e,t)=>{let s=e,{title:r,children:o,actions:n,fullscreen:a}=s,i=xe(s,["title","children","actions","fullscreen"]);return Ee(wG,ae(V({layout:a?"fullscreen":"center",ref:t},i),{children:[N(Ty,{children:r}),N(xy,{children:o}),N(jn,{children:n})]}))});nT.displayName="DialogFrame";import{motion as AG}from"framer-motion";var MG=AG(_m),zu=e=>N(MG,V({},e));zu.displayName="Divider";import{motion as NG}from"framer-motion";var LG=NG(Nc),aT=e=>{var n;let o=e,{children:t}=o,r=xe(o,["children"]);return N(LG,ae(V({},r),{slotProps:ae(V({},r.slotProps),{content:ae(V({},(n=r.slotProps)==null?void 0:n.content),{sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}})}),children:t}))};aT.displayName="InsetDrawer";import c8,{useCallback as Oy,useEffect as TD,useMemo as OT,useRef as PD,useState as _y}from"react";import{jsx as BG}from"react/jsx-runtime";var G_=$t(BG("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");import{jsx as zG}from"react/jsx-runtime";var Y_=$t(zG("path",{d:"m19.41 7.41-4.83-4.83c-.37-.37-.88-.58-1.41-.58H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8.83c0-.53-.21-1.04-.59-1.42M14.8 15H13v3c0 .55-.45 1-1 1s-1-.45-1-1v-3H9.21c-.45 0-.67-.54-.35-.85l2.8-2.79c.2-.19.51-.19.71 0l2.79 2.79c.3.31.08.85-.36.85M14 9c-.55 0-1-.45-1-1V3.5L18.5 9z"}),"UploadFileRounded");import{jsx as FG}from"react/jsx-runtime";var J_=$t(FG("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"ClearRounded");function Fu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){t.forEach(function(n){return n()})}}function hp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function iT(e){if(Array.isArray(e))return hp(e)}function sT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lT(e,t){if(e){if(typeof e=="string")return hp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hp(e,t)}}function pT(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
128
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ta(e){return iT(e)||sT(e)||lT(e)||pT()}var Vu=lo(bp());var nD=lo(bp());function Sy(e){var t=null;return function(){return t||(t={value:e.apply(void 0,arguments)}),t.value}}var ki=Sy(function(){var t=navigator,r=t.userAgent;return r.includes("AppleWebKit")&&!r.includes("Chrome")});var X_=lo(bp());var ky={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function Z_(e){var t=e.dragEnter;return ki()?t.hasOwnProperty(ky.isEnteringWindow):!1}function Q_(e){var t=e.dragLeave;return ki()?t.hasOwnProperty(ky.isLeavingWindow):!1}(function(){if(typeof window>"u"||!ki())return;function t(){return{enterCount:0,isOverWindow:!1}}var r=t();function o(){r=t()}(0,X_.bindAll)(window,[{type:"dragstart",listener:function(){r.enterCount=0,r.isOverWindow=!0}},{type:"drop",listener:o},{type:"dragend",listener:o},{type:"dragenter",listener:function(a){!r.isOverWindow&&r.enterCount===0&&(a[ky.isEnteringWindow]=!0),r.isOverWindow=!0,r.enterCount++}},{type:"dragleave",listener:function(a){r.enterCount--,r.isOverWindow&&r.enterCount===0&&(a[ky.isLeavingWindow]=!0,r.isOverWindow=!1)}}],{capture:!0})})();function GG(e){return"nodeName"in e}function eD(e){var t=e.dragLeave,r=t.type,o=t.relatedTarget;return r!=="dragleave"?!1:ki()?Q_({dragLeave:t}):o==null||o instanceof HTMLIFrameElement?!0:GG(o)&&!document.contains(o)}function xp(e){var t=e.onDragEnd;return[{type:"pointermove",listener:function(){var r=0;return function(){if(r<20){r++;return}t()}}()},{type:"pointerdown",listener:t}]}var tD=lo(bp());function YG(e,t){var r=t.property,o=t.rule,n=t.priority,a=n===void 0?"":n,i=e.style.getPropertyValue(r),s=e.style.getPropertyPriority(r);return e.style.setProperty(r,o,a),function(){e.style.setProperty(r,i,s)}}function JG(e){var t=e.current,r=document.elementFromPoint(t.input.clientX,t.input.clientY);return r instanceof HTMLElement?YG(r,{property:"pointer-events",rule:"auto",priority:"important"}):null}function qG(){var e,t=document.createElement("style");return t.setAttribute("pdnd-post-drag-fix","true"),document.head.appendChild(t),(e=t.sheet)===null||e===void 0||e.insertRule("* { pointer-events: none !important; }"),function(){document.head.removeChild(t)}}function uT(e){var t=e.current;queueMicrotask(function(){var r=JG({current:t}),o=qG();function n(){a(),r==null||r(),o()}var a=(0,tD.bindAll)(window,[{type:"pointerdown",listener:n},{type:"pointermove",listener:n},{type:"focusin",listener:n},{type:"focusout",listener:n},{type:"dragstart",listener:n},{type:"dragenter",listener:n},{type:"dragover",listener:n}],{capture:!0})})}function dT(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var KG=function(t){var r=[],o=null,n=function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];r=s,!o&&(o=requestAnimationFrame(function(){o=null,t.apply(void 0,r)}))};return n.cancel=function(){o&&(cancelAnimationFrame(o),o=null)},n},rD=KG;var fT=rD(function(e){return e()}),Ry=function(){var e=null;function t(o){var n=requestAnimationFrame(function(){e=null,o()});e={frameId:n,fn:o}}function r(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:r}}();function oD(e){var t=e.source,r=e.initial,o=e.dispatchEvent,n={dropTargets:[]};function a(s){o(s),n={dropTargets:s.payload.location.current.dropTargets}}var i={start:function(l){var p=l.nativeSetDragImage,c={current:r,previous:n,initial:r};a({eventName:"onGenerateDragPreview",payload:{source:t,location:c,nativeSetDragImage:p}}),Ry.schedule(function(){a({eventName:"onDragStart",payload:{source:t,location:c}})})},dragUpdate:function(l){var p=l.current;Ry.flush(),fT.cancel(),a({eventName:"onDropTargetChange",payload:{source:t,location:{initial:r,previous:n,current:p}}})},drag:function(l){var p=l.current;fT(function(){Ry.flush();var c={initial:r,previous:n,current:p};a({eventName:"onDrag",payload:{source:t,location:c}})})},drop:function(l){var p=l.current,c=l.updatedSourcePayload;Ry.flush(),fT.cancel(),a({eventName:"onDrop",payload:{source:c!=null?c:t,location:{current:p,previous:n,initial:r}}})}};return i}var hT={isActive:!1};function aD(){return!hT.isActive}function XG(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function ZG(e){var t=e.current,r=e.next;if(t.length!==r.length)return!0;for(var o=0;o<t.length;o++)if(t[o].element!==r[o].element)return!0;return!1}function QG(e){var t=e.event,r=e.dragType,o=e.getDropTargetsOver,n=e.dispatchEvent;if(!aD())return;var a=e8({event:t,dragType:r,getDropTargetsOver:o});hT.isActive=!0;var i={current:a};mT({event:t,current:a.dropTargets});var s=oD({source:r.payload,dispatchEvent:n,initial:a});function l(d){var y=ZG({current:i.current.dropTargets,next:d.dropTargets});i.current=d,y&&s.dragUpdate({current:i.current})}function p(d){var y=dT(d),h=o({target:d.target,input:y,source:r.payload,current:i.current.dropTargets});h.length&&(d.preventDefault(),mT({event:d,current:h})),l({dropTargets:h,input:y})}function c(){i.current.dropTargets.length&&l({dropTargets:[],input:i.current.input}),s.drop({current:i.current,updatedSourcePayload:null}),u()}function u(){hT.isActive=!1,f()}var f=(0,nD.bindAll)(window,[{type:"dragover",listener:function(y){p(y),s.drag({current:i.current})}},{type:"dragenter",listener:p},{type:"dragleave",listener:function(y){eD({dragLeave:y})&&(l({input:i.current.input,dropTargets:[]}),r.startedFrom==="external"&&c())}},{type:"drop",listener:function(y){y.preventDefault(),mT({event:y,current:i.current.dropTargets}),s.drop({current:i.current,updatedSourcePayload:r.type==="external"?r.getDropPayload(y):null}),u(),r.startedFrom==="internal"&&uT({current:i.current})}},{type:"dragend",listener:function(y){c(),r.startedFrom==="internal"&&uT({current:i.current})}}].concat(Ta(xp({onDragEnd:c}))),{capture:!0});s.start({nativeSetDragImage:XG(t)})}function mT(e){var t,r=e.event,o=e.current,n=(t=o[0])===null||t===void 0?void 0:t.dropEffect;n!=null&&r.dataTransfer&&(r.dataTransfer.dropEffect=n)}function e8(e){var t=e.event,r=e.dragType,o=e.getDropTargetsOver,n=dT(t);if(r.startedFrom==="external")return{input:n,dropTargets:[]};var a=o({input:n,source:r.payload,target:t.target,current:[]});return{input:n,dropTargets:a}}var yT={canStart:aD,start:QG};var gT=new Map;function t8(e){var t=e.typeKey,r=e.mount,o=gT.get(t);if(o)return o.usageCount++,o;var n={typeKey:t,unmount:r(),usageCount:1};return gT.set(t,n),n}function iD(e){var t=t8(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),gT.delete(e.typeKey))}}function Ri(e){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function vT(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(Ri(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bT(e){var t=vT(e,"string");return Ri(t)=="symbol"?t:t+""}function $u(e,t,r){return t=bT(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sD(e,t){var r=t.attribute,o=t.value;return e.setAttribute(r,o),function(){return e.removeAttribute(r)}}function lD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function Ei(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lD(Object(r),!0).forEach(function(o){$u(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lD(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function xT(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=r8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(p){throw p},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
129
129
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,i=!1,s;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return a=p.done,p},e:function(p){i=!0,s=p},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(i)throw s}}}}function r8(e,t){if(e){if(typeof e=="string")return pD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pD(e,t)}}function pD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function TT(e){return e.slice(0).reverse()}function cD(e){var t=e.typeKey,r=e.defaultDropEffect,o=new WeakMap,n="data-drop-target-for-".concat(t),a="[".concat(n,"]");function i(d){return o.set(d.element,d),function(){return o.delete(d.element)}}function s(d){if(0)var y;return Fu(sD(d.element,{attribute:n,value:"true"}),i(d))}function l(d){var y,h,b,v,x=d.source,g=d.target,S=d.input,T=d.result,P=T===void 0?[]:T;if(g==null)return P;if(!(g instanceof Element))return g instanceof Node?l({source:x,target:g.parentElement,input:S,result:P}):P;var C=g.closest(a);if(C==null)return P;var k=o.get(C);if(k==null)return P;var I={input:S,source:x,element:k.element};if(k.canDrop&&!k.canDrop(I))return l({source:x,target:k.element.parentElement,input:S,result:P});var _=(y=(h=k.getData)===null||h===void 0?void 0:h.call(k,I))!==null&&y!==void 0?y:{},A=(b=(v=k.getDropEffect)===null||v===void 0?void 0:v.call(k,I))!==null&&b!==void 0?b:r,M={data:_,element:k.element,dropEffect:A,isActiveDueToStickiness:!1};return l({source:x,target:k.element.parentElement,input:S,result:[].concat(Ta(P),[M])})}function p(d){var y=d.eventName,h=d.payload,b=xT(h.location.current.dropTargets),v;try{for(b.s();!(v=b.n()).done;){var x,g=v.value,S=o.get(g.element),T=Ei(Ei({},h),{},{self:g});S==null||(x=S[y])===null||x===void 0||x.call(S,T)}}catch(P){b.e(P)}finally{b.f()}}var c={onGenerateDragPreview:p,onDrag:p,onDragStart:p,onDrop:p,onDropTargetChange:function(y){var h=y.payload,b=new Set(h.location.current.dropTargets.map(function(B){return B.element})),v=new Set,x=xT(h.location.previous.dropTargets),g;try{for(x.s();!(g=x.n()).done;){var S,T=g.value;v.add(T.element);var P=o.get(T.element),C=b.has(T.element),k=Ei(Ei({},h),{},{self:T});if(P==null||(S=P.onDropTargetChange)===null||S===void 0||S.call(P,k),!C){var I;P==null||(I=P.onDragLeave)===null||I===void 0||I.call(P,k)}}}catch(B){x.e(B)}finally{x.f()}var _=xT(h.location.current.dropTargets),A;try{for(_.s();!(A=_.n()).done;){var M,O,z=A.value;if(!v.has(z.element)){var L=Ei(Ei({},h),{},{self:z}),D=o.get(z.element);D==null||(M=D.onDropTargetChange)===null||M===void 0||M.call(D,L),D==null||(O=D.onDragEnter)===null||O===void 0||O.call(D,L)}}}catch(B){_.e(B)}finally{_.f()}}};function u(d){c[d.eventName](d)}function f(d){var y=d.source,h=d.target,b=d.input,v=d.current,x=l({source:y,target:h,input:b});if(x.length>=v.length)return x;for(var g=TT(v),S=TT(x),T=[],P=0;P<g.length;P++){var C,k=g[P],I=S[P];if(I!=null){T.push(I);continue}var _=T[P-1],A=g[P-1];if((_==null?void 0:_.element)!==(A==null?void 0:A.element))break;var M=o.get(k.element);if(!M)break;var O={input:b,source:y,element:M.element};if(M.canDrop&&!M.canDrop(O)||!((C=M.getIsSticky)!==null&&C!==void 0&&C.call(M,O)))break;T.push(Ei(Ei({},k),{},{isActiveDueToStickiness:!0}))}return TT(T)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:u}}function o8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n8(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(p){throw p},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
130
130
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,i=!1,s;return{s:function(){r=r.call(e)},n:function(){var p=r.next();return a=p.done,p},e:function(p){i=!0,s=p},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(i)throw s}}}}function n8(e,t){if(e){if(typeof e=="string")return uD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uD(e,t)}}function uD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function dD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function a8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dD(Object(r),!0).forEach(function(o){$u(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dD(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function fD(){var e=new Set,t=null;function r(a){t&&(!a.canMonitor||a.canMonitor(t.canMonitorArgs))&&t.active.add(a)}function o(a){var i=a8({},a);return e.add(i),r(i),function(){e.delete(i),t&&t.active.delete(i)}}function n(a){var i=a.eventName,s=a.payload;if(i==="onGenerateDragPreview"){t={canMonitorArgs:{initial:s.location.initial,source:s.source},active:new Set};var l=o8(e),p;try{for(l.s();!(p=l.n()).done;){var c=p.value;r(c)}}catch(b){l.e(b)}finally{l.f()}}if(t){for(var u=Array.from(t.active),f=0,d=u;f<d.length;f++){var y=d[f];if(t.active.has(y)){var h;(h=y[i])===null||h===void 0||h.call(y,s)}}i==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:n,monitorForConsumers:o}}function mD(e){var t=e.typeKey,r=e.mount,o=e.dispatchEventToSource,n=e.defaultDropEffect,a=fD(),i=cD({typeKey:t,defaultDropEffect:n});function s(c){o==null||o(c),i.dispatchEvent(c),a.dispatchEvent(c)}function l(c){var u=c.event,f=c.dragType;yT.start({event:u,dragType:f,getDropTargetsOver:i.getIsOver,dispatchEvent:s})}function p(){function c(){var u={canStart:yT.canStart,start:l};return r(u)}return iD({typeKey:t,mount:c})}return{registerUsage:p,dropTarget:i.dropTargetForConsumers,monitor:a.monitorForConsumers}}var Met=Sy(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),hD="pdnd:android-fallback";function i8(e){return"nodeName"in e}function yD(e){var t=e.dragEnter,r=t.type,o=t.relatedTarget;return r!=="dragenter"?!1:ki()?Z_({dragEnter:t}):o==null||o instanceof HTMLIFrameElement?!0:i8(o)&&!document.contains(o)}var gD="text/plain";var vD="application/vnd.pdnd";function CT(e){var t=e.type,r=e.value;return!(t===vD||t===gD&&r===hD)}function s8(e){return Array.from(e.types).filter(function(t){return CT({type:t,value:e.getData(t)})})}function l8(e){return Array.from(e.items).filter(function(t){return t.kind==="file"||CT({type:t.type,value:e.getData(t.type)})})}var PT=!1,ST=mD({typeKey:"external",defaultDropEffect:"copy",mount:function(t){return(0,Vu.bind)(window,{type:"dragenter",listener:function(o){if(!PT&&o.dataTransfer&&t.canStart(o)&&yD({dragEnter:o})){var n=s8(o.dataTransfer);if(n.length){var a={types:n,items:[],getStringData:function(){return null}};t.start({event:o,dragType:{type:"external",startedFrom:"external",payload:a,getDropPayload:function(s){if(!s.dataTransfer)return a;var l=l8(s.dataTransfer),p=s.dataTransfer.getData.bind(s.dataTransfer);return{types:n,items:l,getStringData:function(u){if(!n.includes(u))return null;var f=p(u);return CT({type:u,value:f})?f:null}}}}})}}}})}});function kT(e){return ST.dropTarget(e)}function RT(e){return ST.monitor(e)}(function(){if(typeof window>"u")return;ST.registerUsage();var t={type:"idle"},r=t;function o(){r.type==="dragging"&&(PT=!1,r.cleanup(),r=t)}function n(){return(0,Vu.bindAll)(window,[{type:"dragend",listener:o}].concat(Ta(xp({onDragEnd:o}))),{capture:!0})}(0,Vu.bind)(window,{type:"dragstart",listener:function(){r.type==="idle"&&(PT=!0,r={type:"dragging",cleanup:n()})},options:{capture:!0}})})();function Ey(e){var t=e.source;return t.types.includes("Files")}function ET(e){var t=e.source;return t.items.filter(function(r){return r.kind==="file"}).map(function(r){return r.getAsFile()}).filter(function(r){return r!=null})}var xD=lo(bp());function bD(e){e.defaultPrevented||(e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.preventDefault())}var IT=null;function p8(){ju(),IT=(0,xD.bindAll)(window,[{type:"dragover",listener:bD},{type:"dragenter",listener:bD},{type:"drop",listener:function(t){t.preventDefault(),ju()}},{type:"dragend",listener:ju}].concat(Ta(xp({onDragEnd:ju}))),{capture:!1})}function ju(){var e;(e=IT)===null||e===void 0||e(),IT=null}var Iy={start:p8,stop:ju};var u8=E(Fl)({width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",position:"absolute"}),d8=E(Et,{name:"Uploader",slot:"PreviewRoot"})({}),f8=E(fu,{name:"Uploader",slot:"UploadCard"})(({theme:e})=>({padding:e.spacing(2.5),border:`1px solid ${e.palette.neutral.outlinedBorder}`})),m8=E(Y_,{name:"Uploader",slot:"UploadFileIcon"})(({theme:e})=>({color:e.palette.neutral[400],width:"32px",height:"32px"})),h8=E(J_,{name:"Uploader",slot:"ClearIcon"})(({theme:e})=>({color:e.palette.neutral.plainColor,width:"18px",height:"18px"})),y8=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"],_T=e=>{let t=e==0?0:Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t),o=y8[t];return Intl.NumberFormat("en-us",{style:"unit",unit:o,unitDisplay:"narrow"}).format(r)},g8=e=>{let{files:t,uploaded:r,onDelete:o}=e;return N(d8,{gap:1,children:[...r,...t].map(n=>N(f8,{size:"sm",color:"neutral",children:Ee(Et,{direction:"row",alignItems:"center",gap:2,children:[N(m8,{}),Ee(Et,{flex:"1",children:[N(Pr,{level:"body-sm",textColor:"common.black",children:n.name}),!!n.size&&N(Pr,{level:"body-xs",fontWeight:"300",lineHeight:"1.33",textColor:"text.tertiary",children:_T(n.size)})]}),N(Jt,{onClick:()=>o==null?void 0:o(n),children:N(h8,{})})]})},n.name))})},v8=E(Et,{name:"Uploader",slot:"root"})(({theme:e})=>({gap:e.spacing(2)})),b8=E(Xo,{name:"Uploader",slot:"dropZone",shouldForwardProp:e=>e!=="error"})(({theme:e,state:t,error:r})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:e.spacing(5),gap:e.spacing(4),cursor:"pointer",backgroundColor:e.palette.background.surface,border:r?`1px solid ${e.palette.danger.outlinedBorder}`:t==="idle"?`1px solid ${e.palette.neutral.outlinedBorder}`:`1px solid ${e.palette.primary.outlinedBorder}`})),x8=E(G_,{name:"Uploader",slot:"iconContainer",shouldForwardProp:e=>e!=="error"})(({theme:e,state:t,error:r})=>({color:r?`rgba(${e.vars.palette.danger.mainChannel} / 0.6)`:t==="over"?`rgba(${e.palette.primary.mainChannel} / 0.6)`:e.palette.neutral.softActiveBg,width:"32px",height:"32px"})),CD=c8.memo(e=>{let{accept:t,minCount:r,maxCount:o,name:n,size:a,maxFileSize:i,maxFileTotalSize:s,onChange:l,label:p,disabled:c,onDelete:u}=e,f=PD(null),d=PD(null),[y,h]=_y(),[b,v]=_y([]),[x,g]=_y(e.uploaded||[]),[S,T]=_y("idle"),P=OT(()=>{let z=t.split(",").map(F=>F.trim()),[L,D]=[z.filter(F=>["image/*","video/*","audio/*"].includes(F)).map(F=>{let[R]=F.split("/");return R.toLowerCase()}),z.filter(F=>!["image/*","video/*","audio/*"].includes(F)).map(F=>{let[R,K]=F.split("/");return K?K.toUpperCase():R.toUpperCase().replace(".","")})],B=[];L.length>0&&B.push(`Any ${L.join(", ")} files`),D.length>0&&B.push(D.join(", "));let U=[B.join(", "),`Maximum ${_T(s)}`];return o&&U.push(`Up to ${o} ${o===1?"file":"files"}`),U.join(", ")},[t,s,o]),C=OT(()=>!!y||e.error,[e.error,y]),k=OT(()=>!o||o&&[...x,...b].length!==o,[b,o,x]),I=Oy(z=>{try{let L=t.split(",").map(F=>F.trim().replace(".","").replace("*",".*"))||[],D=new RegExp(`\\b(${L.join("|")})\\b`);if(z.forEach(F=>{let[R,K]=F.name.split(".");if(!D.test(F.type)&&!D.test(K))throw new Error("Please upload acceptable file type.")}),i&&z.forEach(F=>{if(F.size>i)throw new Error(`One or more File size exceeded the maximum limit. Each file size must be ${_T(i)} or less.`)}),[...b,...z].reduce((F,R)=>F+R.size,0)>s)throw new Error("Total File size exceeded the maximum limit.");let U=[...b,...z];if(o&&[...x,...U].length>o)throw new Error("Exceeded the maximum number of files.");l==null||l({target:{name:n,value:U}}),v(U),h(void 0)}catch(L){h(L.message)}},[b,x,o,t,i,s,n,l]);TD(()=>{let z=f.current;if(!(!z||c))return Fu(kT({element:z,canDrop:Ey,onDragEnter:()=>T("over"),onDragLeave:()=>T("potential"),onDrop:async({source:L})=>{let D=await ET({source:L});I(D)}}),RT({canMonitor:Ey,onDragStart:()=>{T("potential"),Iy.start()},onDrop:()=>{T("idle"),Iy.stop()}}))}),TD(()=>{d.current&&r&&(b.length<r?d.current.setCustomValidity(`At least ${r} files are required.`):d.current.setCustomValidity(""))},[d,b,r]);let _=Oy(z=>{let L=Array.from(z.target.files||[]);I(L)},[I]),A=Oy(z=>{z instanceof File?v(L=>(l==null||l({target:{name:n,value:L.filter(D=>D!==z)}}),L.filter(D=>D!==z))):(g(L=>L.filter(D=>D.id!==z.id)),u==null||u(z)),h(void 0)},[n,l,u]),M=Oy(()=>{var z;(z=d.current)==null||z.click()},[]);return Ee(v8,{children:[k&&Ee(Fn,{size:a,error:!!(C||y),disabled:c,required:!!r,children:[p&&N($n,{children:p}),Ee(b8,{state:S,error:!!(C||y),ref:f,onClick:M,children:[N(Et,{alignItems:"center",gap:1,children:N(x8,{state:S,error:!!(C||y)})}),N(u8,{disabled:c,required:!!r,onInvalid:z=>{r&&b.length<r&&h(`Please choose ${r} ${r===1?"file":"files"} to upload.`)},slotProps:{input:{multiple:!0,accept:t,type:"file",ref:d,role:"button",onChange:_}}})]}),N(Vn,{children:Ee(Et,{children:[y&&N("div",{children:y}),N("div",{children:P})]})})]}),[...x,...b].length>0&&N(g8,{files:b,uploaded:x,onDelete:A})]})});import{motion as T8}from"framer-motion";var P8=T8(Fm),DT=P8;DT.displayName="Grid";function SD(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var C8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k8={};function Dy(e,t){return((t||k8).jsx?S8:C8).test(e)}var R8=/[ \t\n\f\r]/g;function wT(e){return typeof e=="object"?e.type==="text"?kD(e.value):!1:kD(e)}function kD(e){return e.replace(R8,"")===""}var Pa=class{constructor(t,r,o){this.property=t,this.normal=r,o&&(this.space=o)}};Pa.prototype.property={};Pa.prototype.normal={};Pa.prototype.space=null;function AT(e,t){let r={},o={},n=-1;for(;++n<e.length;)Object.assign(r,e[n].property),Object.assign(o,e[n].normal);return new Pa(r,o,t)}function Hu(e){return e.toLowerCase()}var Fr=class{constructor(t,r){this.property=t,this.attribute=r}};Fr.prototype.space=null;Fr.prototype.boolean=!1;Fr.prototype.booleanish=!1;Fr.prototype.overloadedBoolean=!1;Fr.prototype.number=!1;Fr.prototype.commaSeparated=!1;Fr.prototype.spaceSeparated=!1;Fr.prototype.commaOrSpaceSeparated=!1;Fr.prototype.mustUseProperty=!1;Fr.prototype.defined=!1;var Uu={};kn(Uu,{boolean:()=>We,booleanish:()=>At,commaOrSpaceSeparated:()=>ao,commaSeparated:()=>Ii,number:()=>ge,overloadedBoolean:()=>MT,spaceSeparated:()=>dt});var E8=0,We=Os(),At=Os(),MT=Os(),ge=Os(),dt=Os(),Ii=Os(),ao=Os();function Os(){return 2**++E8}var NT=Object.keys(Uu),_s=class extends Fr{constructor(t,r,o,n){let a=-1;if(super(t,r),RD(this,"space",n),typeof o=="number")for(;++a<NT.length;){let i=NT[a];RD(this,NT[a],(o&Uu[i])===Uu[i])}}};_s.prototype.defined=!0;function RD(e,t,r){r&&(e[t]=r)}var I8={}.hasOwnProperty;function Zo(e){let t={},r={},o;for(o in e.properties)if(I8.call(e.properties,o)){let n=e.properties[o],a=new _s(o,e.transform(e.attributes||{},o),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(a.mustUseProperty=!0),t[o]=a,r[Hu(o)]=o,r[Hu(a.attribute)]=o}return new Pa(t,r,e.space)}var LT=Zo({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});var BT=Zo({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function wy(e,t){return t in e?e[t]:t}function Ay(e,t){return wy(e,t.toLowerCase())}var zT=Zo({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ay,properties:{xmlns:null,xmlnsXLink:null}});var FT=Zo({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:At,ariaAutoComplete:null,ariaBusy:At,ariaChecked:At,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:At,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:At,ariaFlowTo:dt,ariaGrabbed:At,ariaHasPopup:null,ariaHidden:At,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:ge,ariaLive:null,ariaModal:At,ariaMultiLine:At,ariaMultiSelectable:At,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:At,ariaReadOnly:At,ariaRelevant:null,ariaRequired:At,ariaRoleDescription:dt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:At,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null}});var ED=Zo({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Ay,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ii,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:dt,autoFocus:We,autoPlay:We,blocking:dt,capture:null,charSet:null,checked:We,cite:null,className:dt,cols:ge,colSpan:null,content:null,contentEditable:At,controls:We,controlsList:dt,coords:ge|Ii,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:MT,draggable:At,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:dt,height:ge,hidden:We,high:ge,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:dt,itemRef:dt,itemScope:We,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:We,optimum:ge,pattern:null,ping:dt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:dt,required:We,reversed:We,rows:ge,rowSpan:ge,sandbox:dt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:At,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:At,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:At,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:ge,security:null,unselectable:null}});var ID=Zo({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:wy,properties:{about:ao,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ii,g2:Ii,glyphName:Ii,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:ao,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ge,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ao,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ao,rev:ao,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ao,requiredFeatures:ao,requiredFonts:ao,requiredFormats:ao,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:ao,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ao,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ao,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}});var O8=/^data[-\w.:]+$/i,OD=/-[a-z]/g,_8=/[A-Z]/g;function $T(e,t){let r=Hu(t),o=t,n=Fr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&O8.test(t)){if(t.charAt(4)==="-"){let a=t.slice(5).replace(OD,w8);o="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=t.slice(4);if(!OD.test(a)){let i=a.replace(_8,D8);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}n=_s}return new n(o,t)}function D8(e){return"-"+e.toLowerCase()}function w8(e){return e.charAt(1).toUpperCase()}var VT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var _D=AT([BT,LT,zT,FT,ED],"html"),My=AT([BT,LT,zT,FT,ID],"svg");function DD(e){return e.join(" ").trim()}var jT=lo(zD(),1),FD=jT.default.default||jT.default;var Ny=$D("end"),Tp=$D("start");function $D(e){return t;function t(r){let o=r&&r.position&&r.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function HT(e){let t=Tp(e),r=Ny(e);if(t&&r)return{start:t,end:r}}function Oi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?VD(e.position):"start"in e||"end"in e?VD(e):"line"in e||"column"in e?UT(e):""}function UT(e){return jD(e&&e.line)+":"+jD(e&&e.column)}function VD(e){return UT(e&&e.start)+"-"+UT(e&&e.end)}function jD(e){return e&&typeof e=="number"?e:1}var Vt=class extends Error{constructor(t,r,o){super(),typeof r=="string"&&(o=r,r=void 0);let n="",a={},i=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a=V({},r)),typeof t=="string"?n=t:!a.cause&&t&&(i=!0,n=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof o=="string"){let l=o.indexOf(":");l===-1?a.ruleId=o:(a.source=o.slice(0,l),a.ruleId=o.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){let l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}let s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=n,this.line=s?s.line:void 0,this.name=Oi(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}};Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;var WT={}.hasOwnProperty,G8=new Map,Y8=/[A-Z]/g,J8=/-([a-z])/g,q8=new Set(["table","tbody","thead","tfoot","tr"]),K8=new Set(["td","th"]),HD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,o;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=nY(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=oY(r,t.jsx,t.jsxs)}let n={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?My:_D,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=UD(n,e,void 0);return a&&typeof a!="string"?a:n.create(e,n.Fragment,{children:a||void 0},void 0)}function UD(e,t,r){if(t.type==="element")return X8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Z8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eY(e,t,r);if(t.type==="mdxjsEsm")return Q8(e,t);if(t.type==="root")return tY(e,t,r);if(t.type==="text")return rY(e,t)}function X8(e,t,r){let o=e.schema,n=o;t.tagName.toLowerCase()==="svg"&&o.space==="html"&&(n=My,e.schema=n),e.ancestors.push(t);let a=GD(e,t.tagName,!1),i=aY(e,t),s=JT(e,t);return q8.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!wT(l):!0})),WD(e,i,a,t),YT(i,s),e.ancestors.pop(),e.schema=o,e.create(t,a,i,r)}function Z8(e,t){if(t.data&&t.data.estree&&e.evaluater){let o=t.data.estree.body[0];return o.type,e.evaluater.evaluateExpression(o.expression)}Gu(e,t.position)}function Q8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Gu(e,t.position)}function eY(e,t,r){let o=e.schema,n=o;t.name==="svg"&&o.space==="html"&&(n=My,e.schema=n),e.ancestors.push(t);let a=t.name===null?e.Fragment:GD(e,t.name,!0),i=iY(e,t),s=JT(e,t);return WD(e,i,a,t),YT(i,s),e.ancestors.pop(),e.schema=o,e.create(t,a,i,r)}function tY(e,t,r){let o={};return YT(o,JT(e,t)),e.create(t,e.Fragment,o,r)}function rY(e,t){return t.value}function WD(e,t,r,o){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=o)}function YT(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function oY(e,t,r){return o;function o(n,a,i,s){let p=Array.isArray(i.children)?r:t;return s?p(a,i,s):p(a,i)}}function nY(e,t){return r;function r(o,n,a,i){let s=Array.isArray(a.children),l=Tp(o);return t(n,a,i,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function aY(e,t){let r={},o,n;for(n in t.properties)if(n!=="children"&&WT.call(t.properties,n)){let a=sY(e,n,t.properties[n]);if(a){let[i,s]=a;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&K8.has(t.tagName)?o=s:r[i]=s}}if(o){let a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return r}function iY(e,t){let r={};for(let o of t.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){let a=o.data.estree.body[0];a.type;let i=a.expression;i.type;let s=i.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else Gu(e,t.position);else{let n=o.name,a;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&e.evaluater){let s=o.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else Gu(e,t.position);else a=o.value===null?!0:o.value;r[n]=a}return r}function JT(e,t){let r=[],o=-1,n=e.passKeys?new Map:G8;for(;++o<t.children.length;){let a=t.children[o],i;if(e.passKeys){let l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){let p=n.get(l)||0;i=l+"-"+p,n.set(l,p+1)}}let s=UD(e,a,i);s!==void 0&&r.push(s)}return r}function sY(e,t,r){let o=$T(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=o.commaSeparated?SD(r):DD(r)),o.property==="style"){let n=typeof r=="object"?r:lY(e,String(r));return e.stylePropertyNameCase==="css"&&(n=pY(n)),["style",n]}return[e.elementAttributeNameCase==="react"&&o.space?VT[o.property]||o.property:o.attribute,r]}}function lY(e,t){let r={};try{FD(t,o)}catch(n){if(!e.ignoreInvalidStyle){let a=n,i=new Vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=HD+"#cannot-parse-style-attribute",i}}return r;function o(n,a){let i=n;i.slice(0,2)!=="--"&&(i.slice(0,4)==="-ms-"&&(i="ms-"+i.slice(4)),i=i.replace(J8,uY)),r[i]=a}}function GD(e,t,r){let o;if(!r)o={type:"Literal",value:t};else if(t.includes(".")){let n=t.split("."),a=-1,i;for(;++a<n.length;){let s=Dy(n[a])?{type:"Identifier",name:n[a]}:{type:"Literal",value:n[a]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}o=i}else o=Dy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(o.type==="Literal"){let n=o.value;return WT.call(e.components,n)?e.components[n]:n}if(e.evaluater)return e.evaluater.evaluateExpression(o);Gu(e)}function Gu(e,t){let r=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=HD+"#cannot-handle-mdx-estrees-without-createevaluater",r}function pY(e){let t={},r;for(r in e)WT.call(e,r)&&(t[cY(r)]=e[r]);return t}function cY(e){let t=e.replace(Y8,dY);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uY(e,t){return t.toUpperCase()}function dY(e){return"-"+e.toLowerCase()}var Yu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};import{Fragment as gq,jsx as vq,jsxs as bq}from"react/jsx-runtime";var fY={};function qT(e,t){let r=t||fY,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return JD(e,o,n)}function JD(e,t,r){if(mY(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return YD(e.children,t,r)}return Array.isArray(e)?YD(e,t,r):""}function YD(e,t,r){let o=[],n=-1;for(;++n<e.length;)o[n]=JD(e[n],t,r);return o.join("")}function mY(e){return!!(e&&typeof e=="object")}var qD=document.createElement("i");function Pp(e){let t="&"+e+";";qD.innerHTML=t;let r=qD.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function $r(e,t,r,o){let n=e.length,a=0,i;if(t<0?t=-t>n?0:n+t:t=t>n?n:t,r=r>0?r:0,o.length<1e4)i=Array.from(o),i.unshift(t,r),e.splice(...i);else for(r&&e.splice(t,r);a<o.length;)i=o.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function qr(e,t){return e.length>0?($r(e,e.length,0,t),e):t}var KD={}.hasOwnProperty;function XD(e){let t={},r=-1;for(;++r<e.length;)hY(t,e[r]);return t}function hY(e,t){let r;for(r in t){let n=(KD.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r],i;if(a)for(i in a){KD.call(n,i)||(n[i]=[]);let s=a[i];yY(n[i],Array.isArray(s)?s:s?[s]:[])}}}function yY(e,t){let r=-1,o=[];for(;++r<t.length;)(t[r].add==="after"?e:o).push(t[r]);$r(e,0,0,o)}function Ly(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Ca(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var To=_i(/[A-Za-z]/),ur=_i(/[\dA-Za-z]/),ZD=_i(/[#-'*+\--9=?A-Z^-~]/);function Ju(e){return e!==null&&(e<32||e===127)}var qu=_i(/\d/),QD=_i(/[\dA-Fa-f]/),ew=_i(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function Ge(e){return e===-2||e===-1||e===32}var tw=_i(new RegExp("\\p{P}|\\p{S}","u")),rw=_i(/\s/);function _i(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Qo(e){let t=[],r=-1,o=0,n=0;for(;++r<e.length;){let a=e.charCodeAt(r),i="";if(a===37&&ur(e.charCodeAt(r+1))&&ur(e.charCodeAt(r+2)))n=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){let s=e.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(i=String.fromCharCode(a,s),n=1):i="\uFFFD"}else i=String.fromCharCode(a);i&&(t.push(e.slice(o,r),encodeURIComponent(i)),o=r+n+1,i=""),n&&(r+=n,n=0)}return t.join("")+e.slice(o)}function qe(e,t,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,a=0;return i;function i(l){return Ge(l)?(e.enter(r),s(l)):t(l)}function s(l){return Ge(l)&&a++<n?(e.consume(l),s):(e.exit(r),t(l))}}var ow={tokenize:gY};function gY(e){let t=e.attempt(this.parser.constructs.contentInitial,o,n),r;return t;function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),qe(e,t,"linePrefix")}function n(s){return e.enter("paragraph"),a(s)}function a(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Ae(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),i)}}var aw={tokenize:vY},nw={tokenize:bY};function vY(e){let t=this,r=[],o=0,n,a,i;return s;function s(g){if(o<r.length){let S=r[o];return t.containerState=S[1],e.attempt(S[0].continuation,l,p)(g)}return p(g)}function l(g){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,n&&x();let S=t.events.length,T=S,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){P=t.events[T][1].end;break}v(o);let C=S;for(;C<t.events.length;)t.events[C][1].end=Object.assign({},P),C++;return $r(t.events,T+1,0,t.events.slice(S)),t.events.length=C,p(g)}return s(g)}function p(g){if(o===r.length){if(!n)return f(g);if(n.currentConstruct&&n.currentConstruct.concrete)return y(g);t.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nw,c,u)(g)}function c(g){return n&&x(),v(o),f(g)}function u(g){return t.parser.lazy[t.now().line]=o!==r.length,i=t.now().offset,y(g)}function f(g){return t.containerState={},e.attempt(nw,d,y)(g)}function d(g){return o++,r.push([t.currentConstruct,t.containerState]),f(g)}function y(g){if(g===null){n&&x(),v(0),e.consume(g);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:n}),h(g)}function h(g){if(g===null){b(e.exit("chunkFlow"),!0),v(0),e.consume(g);return}return Ae(g)?(e.consume(g),b(e.exit("chunkFlow")),o=0,t.interrupt=void 0,s):(e.consume(g),h)}function b(g,S){let T=t.sliceStream(g);if(S&&T.push(null),g.previous=a,a&&(a.next=g),a=g,n.defineSkip(g.start),n.write(T),t.parser.lazy[g.start.line]){let P=n.events.length;for(;P--;)if(n.events[P][1].start.offset<i&&(!n.events[P][1].end||n.events[P][1].end.offset>i))return;let C=t.events.length,k=C,I,_;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(I){_=t.events[k][1].end;break}I=!0}for(v(o),P=C;P<t.events.length;)t.events[P][1].end=Object.assign({},_),P++;$r(t.events,k+1,0,t.events.slice(C)),t.events.length=P}}function v(g){let S=r.length;for(;S-- >g;){let T=r[S];t.containerState=T[1],T[0].exit.call(t,e)}r.length=g}function x(){n.write([null]),a=void 0,n=void 0,t.containerState._closeFlow=void 0}}function bY(e,t,r){return qe(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function KT(e){if(e===null||jt(e)||rw(e))return 1;if(tw(e))return 2}function Cp(e,t,r){let o=[],n=-1;for(;++n<e.length;){let a=e[n].resolveAll;a&&!o.includes(a)&&(t=a(t,r),o.push(a))}return t}var Ku={name:"attention",tokenize:TY,resolveAll:xY};function xY(e,t){let r=-1,o,n,a,i,s,l,p,c;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(o=r;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&t.sliceSerialize(e[o][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[o][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[o][1].end.offset-e[o][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let u=Object.assign({},e[o][1].end),f=Object.assign({},e[r][1].start);iw(u,-l),iw(f,l),i={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[r][1].start),end:f},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[o][1].end),end:Object.assign({},e[r][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},e[o][1].end=Object.assign({},i.start),e[r][1].start=Object.assign({},s.end),p=[],e[o][1].end.offset-e[o][1].start.offset&&(p=qr(p,[["enter",e[o][1],t],["exit",e[o][1],t]])),p=qr(p,[["enter",n,t],["enter",i,t],["exit",i,t],["enter",a,t]]),p=qr(p,Cp(t.parser.constructs.insideSpan.null,e.slice(o+1,r),t)),p=qr(p,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",n,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,p=qr(p,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,$r(e,o-1,r-o+3,p),r=o+p.length-c-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function TY(e,t){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=KT(o),a;return i;function i(l){return a=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===a)return e.consume(l),s;let p=e.exit("attentionSequence"),c=KT(l),u=!c||c===2&&n||r.includes(l),f=!n||n===2&&c||r.includes(o);return p._open=!!(a===42?u:u&&(n||!f)),p._close=!!(a===42?f:f&&(c||!u)),t(l)}}function iw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var XT={name:"autolink",tokenize:PY};function PY(e,t,r){let o=0;return n;function n(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(d){return To(d)?(e.consume(d),i):p(d)}function i(d){return d===43||d===45||d===46||ur(d)?(o=1,s(d)):p(d)}function s(d){return d===58?(e.consume(d),o=0,l):(d===43||d===45||d===46||ur(d))&&o++<32?(e.consume(d),s):(o=0,p(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ju(d)?r(d):(e.consume(d),l)}function p(d){return d===64?(e.consume(d),c):ZD(d)?(e.consume(d),p):r(d)}function c(d){return ur(d)?u(d):r(d)}function u(d){return d===46?(e.consume(d),o=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):f(d)}function f(d){if((d===45||ur(d))&&o++<63){let y=d===45?f:u;return e.consume(d),y}return r(d)}}var Di={tokenize:CY,partial:!0};function CY(e,t,r){return o;function o(a){return Ge(a)?qe(e,n,"linePrefix")(a):n(a)}function n(a){return a===null||Ae(a)?t(a):r(a)}}var By={name:"blockQuote",tokenize:SY,continuation:{tokenize:kY},exit:RY};function SY(e,t,r){let o=this;return n;function n(i){if(i===62){let s=o.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Ge(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function kY(e,t,r){let o=this;return n;function n(i){return Ge(i)?qe(e,a,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(By,t,r)(i)}}function RY(e){e.exit("blockQuote")}var zy={name:"characterEscape",tokenize:EY};function EY(e,t,r){return o;function o(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),n}function n(a){return ew(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}var Fy={name:"characterReference",tokenize:IY};function IY(e,t,r){let o=this,n=0,a,i;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),a=31,i=ur,c(u))}function p(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=QD,c):(e.enter("characterReferenceValue"),a=7,i=qu,c(u))}function c(u){if(u===59&&n){let f=e.exit("characterReferenceValue");return i===ur&&!Pp(o.sliceSerialize(f))?r(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(u)&&n++<a?(e.consume(u),c):r(u)}}var sw={tokenize:_Y,partial:!0},$y={name:"codeFenced",tokenize:OY,concrete:!0};function OY(e,t,r){let o=this,n={tokenize:T,partial:!0},a=0,i=0,s;return l;function l(P){return p(P)}function p(P){let C=o.events[o.events.length-1];return a=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,s=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(P)}function c(P){return P===s?(i++,e.consume(P),c):i<3?r(P):(e.exit("codeFencedFenceSequence"),Ge(P)?qe(e,u,"whitespace")(P):u(P))}function u(P){return P===null||Ae(P)?(e.exit("codeFencedFence"),o.interrupt?t(P):e.check(sw,h,S)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(P))}function f(P){return P===null||Ae(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(P)):Ge(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,d,"whitespace")(P)):P===96&&P===s?r(P):(e.consume(P),f)}function d(P){return P===null||Ae(P)?u(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||Ae(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(P)):P===96&&P===s?r(P):(e.consume(P),y)}function h(P){return e.attempt(n,S,b)(P)}function b(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),v}function v(P){return a>0&&Ge(P)?qe(e,x,"linePrefix",a+1)(P):x(P)}function x(P){return P===null||Ae(P)?e.check(sw,h,S)(P):(e.enter("codeFlowValue"),g(P))}function g(P){return P===null||Ae(P)?(e.exit("codeFlowValue"),x(P)):(e.consume(P),g)}function S(P){return e.exit("codeFenced"),t(P)}function T(P,C,k){let I=0;return _;function _(L){return P.enter("lineEnding"),P.consume(L),P.exit("lineEnding"),A}function A(L){return P.enter("codeFencedFence"),Ge(L)?qe(P,M,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):M(L)}function M(L){return L===s?(P.enter("codeFencedFenceSequence"),O(L)):k(L)}function O(L){return L===s?(I++,P.consume(L),O):I>=i?(P.exit("codeFencedFenceSequence"),Ge(L)?qe(P,z,"whitespace")(L):z(L)):k(L)}function z(L){return L===null||Ae(L)?(P.exit("codeFencedFence"),C(L)):k(L)}}}function _Y(e,t,r){let o=this;return n;function n(i){return i===null?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return o.parser.lazy[o.now().line]?r(i):t(i)}}var Xu={name:"codeIndented",tokenize:wY},DY={tokenize:AY,partial:!0};function wY(e,t,r){let o=this;return n;function n(p){return e.enter("codeIndented"),qe(e,a,"linePrefix",5)(p)}function a(p){let c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(p):r(p)}function i(p){return p===null?l(p):Ae(p)?e.attempt(DY,i,l)(p):(e.enter("codeFlowValue"),s(p))}function s(p){return p===null||Ae(p)?(e.exit("codeFlowValue"),i(p)):(e.consume(p),s)}function l(p){return e.exit("codeIndented"),t(p)}}function AY(e,t,r){let o=this;return n;function n(i){return o.parser.lazy[o.now().line]?r(i):Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n):qe(e,a,"linePrefix",5)(i)}function a(i){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):Ae(i)?n(i):r(i)}}var ZT={name:"codeText",tokenize:LY,resolve:MY,previous:NY};function MY(e){let t=e.length-4,r=3,o,n;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(o=r;++o<t;)if(e[o][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(o=r-1,t++;++o<=t;)n===void 0?o!==t&&e[o][1].type!=="lineEnding"&&(n=o):(o===t||e[o][1].type==="lineEnding")&&(e[n][1].type="codeTextData",o!==n+2&&(e[n][1].end=e[o-1][1].end,e.splice(n+2,o-n-2),t-=o-n-2,o=n+2),n=void 0);return e}function NY(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LY(e,t,r){let o=this,n=0,a,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),n++,l):(e.exit("codeTextSequence"),p(f))}function p(f){return f===null?r(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),p):f===96?(i=e.enter("codeTextSequence"),a=0,u(f)):Ae(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Ae(f)?(e.exit("codeTextData"),p(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),a++,u):a===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}var Vy=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let o=r==null?Number.POSITIVE_INFINITY:r;return o<this.left.length?this.left.slice(t,o):t>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(t,r,o){let n=r||0;this.setCursor(Math.trunc(t));let a=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&Zu(this.left,o),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Zu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Zu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);Zu(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Zu(this.left,r.reverse())}}};function Zu(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function jy(e){let t={},r=-1,o,n,a,i,s,l,p,c=new Vy(e);for(;++r<c.length;){for(;r in t;)r=t[r];if(o=c.get(r),r&&o[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(l=o[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(o[0]==="enter")o[1].contentType&&(Object.assign(t,BY(c,r)),r=t[r],p=!0);else if(o[1]._container){for(a=r,n=void 0;a--&&(i=c.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank");)i[0]==="enter"&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=a);n&&(o[1].end=Object.assign({},c.get(n)[1].start),s=c.slice(n,r),s.unshift(o),c.splice(n,r-n+1,s))}}return $r(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!p}function BY(e,t){let r=e.get(t)[1],o=e.get(t)[2],n=t-1,a=[],i=r._tokenizer||o.parser[r.contentType](r.start),s=i.events,l=[],p={},c,u,f=-1,d=r,y=0,h=0,b=[h];for(;d;){for(;e.get(++n)[1]!==d;);a.push(n),d._tokenizer||(c=o.sliceStream(d),d.next||c.push(null),u&&i.defineSkip(d.start),d._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),d._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=d,d=d.next}for(d=r;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,b.push(h),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(i.events=[],d?(d._tokenizer=void 0,d.previous=void 0):b.pop(),f=b.length;f--;){let v=s.slice(b[f],b[f+1]),x=a.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),f=-1;++f<l.length;)p[y+l[f][0]]=y+l[f][1],y+=l[f][1]-l[f][0]-1;return p}var QT={tokenize:$Y,resolve:FY},zY={tokenize:VY,partial:!0};function FY(e){return jy(e),e}function $Y(e,t){let r;return o;function o(s){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(s)}function n(s){return s===null?a(s):Ae(s)?e.check(zY,i,a)(s):(e.consume(s),n)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function VY(e,t,r){let o=this;return n;function n(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),qe(e,a,"linePrefix")}function a(i){if(i===null||Ae(i))return r(i);let s=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(o.parser.constructs.flow,r,t)(i)}}function Hy(e,t,r,o,n,a,i,s,l){let p=l||Number.POSITIVE_INFINITY,c=0;return u;function u(v){return v===60?(e.enter(o),e.enter(n),e.enter(a),e.consume(v),e.exit(a),f):v===null||v===32||v===41||Ju(v)?r(v):(e.enter(o),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(v))}function f(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(n),e.exit(o),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===62?(e.exit("chunkString"),e.exit(s),f(v)):v===null||v===60||Ae(v)?r(v):(e.consume(v),v===92?y:d)}function y(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function h(v){return!c&&(v===null||v===41||jt(v))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(o),t(v)):c<p&&v===40?(e.consume(v),c++,h):v===41?(e.consume(v),c--,h):v===null||v===32||v===40||Ju(v)?r(v):(e.consume(v),v===92?b:h)}function b(v){return v===40||v===41||v===92?(e.consume(v),h):h(v)}}function Uy(e,t,r,o,n,a){let i=this,s=0,l;return p;function p(d){return e.enter(o),e.enter(n),e.consume(d),e.exit(n),e.enter(a),c}function c(d){return s>999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?r(d):d===93?(e.exit(a),e.enter(n),e.consume(d),e.exit(n),e.exit(o),t):Ae(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===null||d===91||d===93||Ae(d)||s++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!Ge(d)),d===92?f:u)}function f(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function Wy(e,t,r,o,n,a){let i;return s;function s(f){return f===34||f===39||f===40?(e.enter(o),e.enter(n),e.consume(f),e.exit(n),i=f===40?41:f,l):r(f)}function l(f){return f===i?(e.enter(n),e.consume(f),e.exit(n),e.exit(o),t):(e.enter(a),p(f))}function p(f){return f===i?(e.exit(a),l(i)):f===null?r(f):Ae(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||Ae(f)?(e.exit("chunkString"),p(f)):(e.consume(f),f===92?u:c)}function u(f){return f===i||f===92?(e.consume(f),c):c(f)}}function ws(e,t){let r;return o;function o(n){return Ae(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,o):Ge(n)?qe(e,o,r?"linePrefix":"lineSuffix")(n):t(n)}}var e0={name:"definition",tokenize:HY},jY={tokenize:UY,partial:!0};function HY(e,t,r){let o=this,n;return a;function a(d){return e.enter("definition"),i(d)}function i(d){return Uy.call(o,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return n=Ca(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):r(d)}function l(d){return jt(d)?ws(e,p)(d):p(d)}function p(d){return Hy(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(jY,u,u)(d)}function u(d){return Ge(d)?qe(e,f,"whitespace")(d):f(d)}function f(d){return d===null||Ae(d)?(e.exit("definition"),o.parser.defined.push(n),t(d)):r(d)}}function UY(e,t,r){return o;function o(s){return jt(s)?ws(e,n)(s):r(s)}function n(s){return Wy(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Ge(s)?qe(e,i,"whitespace")(s):i(s)}function i(s){return s===null||Ae(s)?t(s):r(s)}}var t0={name:"hardBreakEscape",tokenize:WY};function WY(e,t,r){return o;function o(a){return e.enter("hardBreakEscape"),e.consume(a),n}function n(a){return Ae(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}var r0={name:"headingAtx",tokenize:YY,resolve:GY};function GY(e,t){let r=e.length-2,o=3,n,a;return e[o][1].type==="whitespace"&&(o+=2),r-2>o&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(o===r-1||r-4>o&&e[r-2][1].type==="whitespace")&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[r][1].end},a={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},$r(e,o,r-o+1,[["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t]])),e}function YY(e,t,r){let o=0;return n;function n(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&o++<6?(e.consume(c),i):c===null||jt(c)?(e.exit("atxHeadingSequence"),s(c)):r(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Ae(c)?(e.exit("atxHeading"),t(c)):Ge(c)?qe(e,s,"whitespace")(c):(e.enter("atxHeadingText"),p(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function p(c){return c===null||c===35||jt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),p)}}var lw=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],o0=["pre","script","style","textarea"];var n0={name:"htmlFlow",tokenize:XY,resolveTo:KY,concrete:!0},JY={tokenize:QY,partial:!0},qY={tokenize:ZY,partial:!0};function KY(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function XY(e,t,r){let o=this,n,a,i,s,l;return p;function p(w){return c(w)}function c(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),u}function u(w){return w===33?(e.consume(w),f):w===47?(e.consume(w),a=!0,h):w===63?(e.consume(w),n=3,o.interrupt?t:R):To(w)?(e.consume(w),i=String.fromCharCode(w),b):r(w)}function f(w){return w===45?(e.consume(w),n=2,d):w===91?(e.consume(w),n=5,s=0,y):To(w)?(e.consume(w),n=4,o.interrupt?t:R):r(w)}function d(w){return w===45?(e.consume(w),o.interrupt?t:R):r(w)}function y(w){let ce="CDATA[";return w===ce.charCodeAt(s++)?(e.consume(w),s===ce.length?o.interrupt?t:M:y):r(w)}function h(w){return To(w)?(e.consume(w),i=String.fromCharCode(w),b):r(w)}function b(w){if(w===null||w===47||w===62||jt(w)){let ce=w===47,he=i.toLowerCase();return!ce&&!a&&o0.includes(he)?(n=1,o.interrupt?t(w):M(w)):lw.includes(i.toLowerCase())?(n=6,ce?(e.consume(w),v):o.interrupt?t(w):M(w)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(w):a?x(w):g(w))}return w===45||ur(w)?(e.consume(w),i+=String.fromCharCode(w),b):r(w)}function v(w){return w===62?(e.consume(w),o.interrupt?t:M):r(w)}function x(w){return Ge(w)?(e.consume(w),x):_(w)}function g(w){return w===47?(e.consume(w),_):w===58||w===95||To(w)?(e.consume(w),S):Ge(w)?(e.consume(w),g):_(w)}function S(w){return w===45||w===46||w===58||w===95||ur(w)?(e.consume(w),S):T(w)}function T(w){return w===61?(e.consume(w),P):Ge(w)?(e.consume(w),T):g(w)}function P(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),l=w,C):Ge(w)?(e.consume(w),P):k(w)}function C(w){return w===l?(e.consume(w),l=null,I):w===null||Ae(w)?r(w):(e.consume(w),C)}function k(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||jt(w)?T(w):(e.consume(w),k)}function I(w){return w===47||w===62||Ge(w)?g(w):r(w)}function _(w){return w===62?(e.consume(w),A):r(w)}function A(w){return w===null||Ae(w)?M(w):Ge(w)?(e.consume(w),A):r(w)}function M(w){return w===45&&n===2?(e.consume(w),D):w===60&&n===1?(e.consume(w),B):w===62&&n===4?(e.consume(w),K):w===63&&n===3?(e.consume(w),R):w===93&&n===5?(e.consume(w),F):Ae(w)&&(n===6||n===7)?(e.exit("htmlFlowData"),e.check(JY,oe,O)(w)):w===null||Ae(w)?(e.exit("htmlFlowData"),O(w)):(e.consume(w),M)}function O(w){return e.check(qY,z,oe)(w)}function z(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),L}function L(w){return w===null||Ae(w)?O(w):(e.enter("htmlFlowData"),M(w))}function D(w){return w===45?(e.consume(w),R):M(w)}function B(w){return w===47?(e.consume(w),i="",U):M(w)}function U(w){if(w===62){let ce=i.toLowerCase();return o0.includes(ce)?(e.consume(w),K):M(w)}return To(w)&&i.length<8?(e.consume(w),i+=String.fromCharCode(w),U):M(w)}function F(w){return w===93?(e.consume(w),R):M(w)}function R(w){return w===62?(e.consume(w),K):w===45&&n===2?(e.consume(w),R):M(w)}function K(w){return w===null||Ae(w)?(e.exit("htmlFlowData"),oe(w)):(e.consume(w),K)}function oe(w){return e.exit("htmlFlow"),t(w)}}function ZY(e,t,r){let o=this;return n;function n(i){return Ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):r(i)}function a(i){return o.parser.lazy[o.now().line]?r(i):t(i)}}function QY(e,t,r){return o;function o(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(Di,t,r)}}var a0={name:"htmlText",tokenize:eJ};function eJ(e,t,r){let o=this,n,a,i;return s;function s(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),l}function l(R){return R===33?(e.consume(R),p):R===47?(e.consume(R),T):R===63?(e.consume(R),g):To(R)?(e.consume(R),k):r(R)}function p(R){return R===45?(e.consume(R),c):R===91?(e.consume(R),a=0,y):To(R)?(e.consume(R),x):r(R)}function c(R){return R===45?(e.consume(R),d):r(R)}function u(R){return R===null?r(R):R===45?(e.consume(R),f):Ae(R)?(i=u,B(R)):(e.consume(R),u)}function f(R){return R===45?(e.consume(R),d):u(R)}function d(R){return R===62?D(R):R===45?f(R):u(R)}function y(R){let K="CDATA[";return R===K.charCodeAt(a++)?(e.consume(R),a===K.length?h:y):r(R)}function h(R){return R===null?r(R):R===93?(e.consume(R),b):Ae(R)?(i=h,B(R)):(e.consume(R),h)}function b(R){return R===93?(e.consume(R),v):h(R)}function v(R){return R===62?D(R):R===93?(e.consume(R),v):h(R)}function x(R){return R===null||R===62?D(R):Ae(R)?(i=x,B(R)):(e.consume(R),x)}function g(R){return R===null?r(R):R===63?(e.consume(R),S):Ae(R)?(i=g,B(R)):(e.consume(R),g)}function S(R){return R===62?D(R):g(R)}function T(R){return To(R)?(e.consume(R),P):r(R)}function P(R){return R===45||ur(R)?(e.consume(R),P):C(R)}function C(R){return Ae(R)?(i=C,B(R)):Ge(R)?(e.consume(R),C):D(R)}function k(R){return R===45||ur(R)?(e.consume(R),k):R===47||R===62||jt(R)?I(R):r(R)}function I(R){return R===47?(e.consume(R),D):R===58||R===95||To(R)?(e.consume(R),_):Ae(R)?(i=I,B(R)):Ge(R)?(e.consume(R),I):D(R)}function _(R){return R===45||R===46||R===58||R===95||ur(R)?(e.consume(R),_):A(R)}function A(R){return R===61?(e.consume(R),M):Ae(R)?(i=A,B(R)):Ge(R)?(e.consume(R),A):I(R)}function M(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),n=R,O):Ae(R)?(i=M,B(R)):Ge(R)?(e.consume(R),M):(e.consume(R),z)}function O(R){return R===n?(e.consume(R),n=void 0,L):R===null?r(R):Ae(R)?(i=O,B(R)):(e.consume(R),O)}function z(R){return R===null||R===34||R===39||R===60||R===61||R===96?r(R):R===47||R===62||jt(R)?I(R):(e.consume(R),z)}function L(R){return R===47||R===62||jt(R)?I(R):r(R)}function D(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):r(R)}function B(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),U}function U(R){return Ge(R)?qe(e,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):F(R)}function F(R){return e.enter("htmlTextData"),i(R)}}var As={name:"labelEnd",tokenize:iJ,resolveTo:aJ,resolveAll:nJ},tJ={tokenize:sJ},rJ={tokenize:lJ},oJ={tokenize:pJ};function nJ(e){let t=-1;for(;++t<e.length;){let r=e[t][1];(r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd")&&(e.splice(t+1,r.type==="labelImage"?4:2),r.type="data",t++)}return e}function aJ(e,t){let r=e.length,o=0,n,a,i,s;for(;r--;)if(n=e[r][1],a){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;e[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(i){if(e[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(a=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(i=r);let l={type:e[a][1].type==="labelLink"?"link":"image",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[a][1].start),end:Object.assign({},e[i][1].end)},c={type:"labelText",start:Object.assign({},e[a+o+2][1].end),end:Object.assign({},e[i-2][1].start)};return s=[["enter",l,t],["enter",p,t]],s=qr(s,e.slice(a+1,a+o+3)),s=qr(s,[["enter",c,t]]),s=qr(s,Cp(t.parser.constructs.insideSpan.null,e.slice(a+o+4,i-3),t)),s=qr(s,[["exit",c,t],e[i-2],e[i-1],["exit",p,t]]),s=qr(s,e.slice(i+1)),s=qr(s,[["exit",l,t]]),$r(e,a,e.length,s),e}function iJ(e,t,r){let o=this,n=o.events.length,a,i;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){a=o.events[n][1];break}return s;function s(f){return a?a._inactive?u(f):(i=o.parser.defined.includes(Ca(o.sliceSerialize({start:a.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):r(f)}function l(f){return f===40?e.attempt(tJ,c,i?c:u)(f):f===91?e.attempt(rJ,c,i?p:u)(f):i?c(f):u(f)}function p(f){return e.attempt(oJ,c,u)(f)}function c(f){return t(f)}function u(f){return a._balanced=!0,r(f)}}function sJ(e,t,r){return o;function o(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),n}function n(u){return jt(u)?ws(e,a)(u):a(u)}function a(u){return u===41?c(u):Hy(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function i(u){return jt(u)?ws(e,l)(u):c(u)}function s(u){return r(u)}function l(u){return u===34||u===39||u===40?Wy(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):c(u)}function p(u){return jt(u)?ws(e,c)(u):c(u)}function c(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):r(u)}}function lJ(e,t,r){let o=this;return n;function n(s){return Uy.call(o,e,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return o.parser.defined.includes(Ca(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function i(s){return r(s)}}function pJ(e,t,r){return o;function o(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),n}function n(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}var i0={name:"labelStartImage",tokenize:cJ,resolveAll:As.resolveAll};function cJ(e,t,r){let o=this;return n;function n(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):r(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):t(s)}}var s0={name:"labelStartLink",tokenize:uJ,resolveAll:As.resolveAll};function uJ(e,t,r){let o=this;return n;function n(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(i):t(i)}}var Qu={name:"lineEnding",tokenize:dJ};function dJ(e,t){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,t,"linePrefix")}}var Ms={name:"thematicBreak",tokenize:fJ};function fJ(e,t,r){let o=0,n;return a;function a(p){return e.enter("thematicBreak"),i(p)}function i(p){return n=p,s(p)}function s(p){return p===n?(e.enter("thematicBreakSequence"),l(p)):o>=3&&(p===null||Ae(p))?(e.exit("thematicBreak"),t(p)):r(p)}function l(p){return p===n?(e.consume(p),o++,l):(e.exit("thematicBreakSequence"),Ge(p)?qe(e,s,"whitespace")(p):s(p))}}var Vr={name:"list",tokenize:yJ,continuation:{tokenize:gJ},exit:bJ},mJ={tokenize:xJ,partial:!0},hJ={tokenize:vJ,partial:!0};function yJ(e,t,r){let o=this,n=o.events[o.events.length-1],a=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,i=0;return s;function s(d){let y=o.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!o.containerState.marker||d===o.containerState.marker:qu(d)){if(o.containerState.type||(o.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Ms,r,p)(d):p(d);if(!o.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return r(d)}function l(d){return qu(d)&&++i<10?(e.consume(d),l):(!o.interrupt||i<2)&&(o.containerState.marker?d===o.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),p(d)):r(d)}function p(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||d,e.check(Di,o.interrupt?r:c,e.attempt(mJ,f,u))}function c(d){return o.containerState.initialBlankLine=!0,a++,f(d)}function u(d){return Ge(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),f):r(d)}function f(d){return o.containerState.size=a+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function gJ(e,t,r){let o=this;return o.containerState._closeFlow=void 0,e.check(Di,n,a);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,qe(e,t,"listItemIndent",o.containerState.size+1)(s)}function a(s){return o.containerState.furtherBlankLines||!Ge(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(hJ,t,i)(s))}function i(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,qe(e,e.attempt(Vr,t,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function vJ(e,t,r){let o=this;return qe(e,n,"listItemIndent",o.containerState.size+1);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===o.containerState.size?t(a):r(a)}}function bJ(e){e.exit(this.containerState.type)}function xJ(e,t,r){let o=this;return qe(e,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(a){let i=o.events[o.events.length-1];return!Ge(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}var Gy={name:"setextUnderline",tokenize:PJ,resolveTo:TJ};function TJ(e,t){let r=e.length,o,n,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){o=r;break}e[r][1].type==="paragraph"&&(n=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:Object.assign({},e[n][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",i,t]),e.splice(a+1,0,["exit",e[o][1],t]),e[o][1].end=Object.assign({},e[a][1].end)):e[o][1]=i,e.push(["exit",i,t]),e}function PJ(e,t,r){let o=this,n;return a;function a(p){let c=o.events.length,u;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){u=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(e.enter("setextHeadingLine"),n=p,i(p)):r(p)}function i(p){return e.enter("setextHeadingLineSequence"),s(p)}function s(p){return p===n?(e.consume(p),s):(e.exit("setextHeadingLineSequence"),Ge(p)?qe(e,l,"lineSuffix")(p):l(p))}function l(p){return p===null||Ae(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}var pw={tokenize:CJ};function CJ(e){let t=this,r=e.attempt(Di,o,e.attempt(this.parser.constructs.flowInitial,n,qe(e,e.attempt(this.parser.constructs.flow,n,e.attempt(QT,n)),"linePrefix")));return r;function o(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function n(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var cw={resolveAll:mw()},uw=fw("string"),dw=fw("text");function fw(e){return{tokenize:t,resolveAll:mw(e==="text"?SJ:void 0)};function t(r){let o=this,n=this.parser.constructs[e],a=r.attempt(n,i,s);return i;function i(c){return p(c)?a(c):s(c)}function s(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),l}function l(c){return p(c)?(r.exit("data"),a(c)):(r.consume(c),l)}function p(c){if(c===null)return!0;let u=n[c],f=-1;if(u)for(;++f<u.length;){let d=u[f];if(!d.previous||d.previous.call(o,o.previous))return!0}return!1}}}function mw(e){return t;function t(r,o){let n=-1,a;for(;++n<=r.length;)a===void 0?r[n]&&r[n][1].type==="data"&&(a=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),n=a+2),a=void 0);return e?e(r,o):r}}function SJ(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let o=e[r-1][1],n=t.sliceStream(o),a=n.length,i=-1,s=0,l;for(;a--;){let p=n[a];if(typeof p=="string"){for(i=p.length;p.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(p===-2)l=!0,s++;else if(p!==-1){a++;break}}if(s){let p={type:r===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:o.end.line,column:o.end.column-s,offset:o.end.offset-s,_index:o.start._index+a,_bufferIndex:a?i:o.start._bufferIndex+i},end:Object.assign({},o.end)};o.end=Object.assign({},p.start),o.start.offset===o.end.offset?Object.assign(o,p):(e.splice(r,0,["enter",p,t],["exit",p,t]),r+=2)}r++}return e}function hw(e,t,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},a=[],i=[],s=[],l=!0,p={consume:S,enter:T,exit:P,attempt:I(C),check:I(k),interrupt:I(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:h,sliceSerialize:y,now:b,defineSkip:v,write:d},u=t.tokenize.call(c,p),f;return t.resolveAll&&a.push(t),c;function d(O){return i=qr(i,O),x(),i[i.length-1]!==null?[]:(_(t,0),c.events=Cp(a,c.events,c),c.events)}function y(O,z){return RJ(h(O),z)}function h(O){return kJ(i,O)}function b(){let{line:O,column:z,offset:L,_index:D,_bufferIndex:B}=o;return{line:O,column:z,offset:L,_index:D,_bufferIndex:B}}function v(O){n[O.line]=O.column,M()}function x(){let O;for(;o._index<i.length;){let z=i[o._index];if(typeof z=="string")for(O=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===O&&o._bufferIndex<z.length;)g(z.charCodeAt(o._bufferIndex));else g(z)}}function g(O){l=void 0,f=O,u=u(O)}function S(O){Ae(O)?(o.line++,o.column=1,o.offset+=O===-3?2:1,M()):O!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=O,l=!0}function T(O,z){let L=z||{};return L.type=O,L.start=b(),c.events.push(["enter",L,c]),s.push(L),L}function P(O){let z=s.pop();return z.end=b(),c.events.push(["exit",z,c]),z}function C(O,z){_(O,z.from)}function k(O,z){z.restore()}function I(O,z){return L;function L(D,B,U){let F,R,K,oe;return Array.isArray(D)?ce(D):"tokenize"in D?ce([D]):w(D);function w(W){return de;function de(ye){let ke=ye!==null&&W[ye],Pe=ye!==null&&W.null,Fe=[...Array.isArray(ke)?ke:ke?[ke]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return ce(Fe)(ye)}}function ce(W){return F=W,R=0,W.length===0?U:he(W[R])}function he(W){return de;function de(ye){return oe=A(),K=W,W.partial||(c.currentConstruct=W),W.name&&c.parser.constructs.disable.null.includes(W.name)?ie(ye):W.tokenize.call(z?Object.assign(Object.create(c),z):c,p,Ne,ie)(ye)}}function Ne(W){return l=!0,O(K,oe),B}function ie(W){return l=!0,oe.restore(),++R<F.length?he(F[R]):U}}}function _(O,z){O.resolveAll&&!a.includes(O)&&a.push(O),O.resolve&&$r(c.events,z,c.events.length-z,O.resolve(c.events.slice(z),c)),O.resolveTo&&(c.events=O.resolveTo(c.events,c))}function A(){let O=b(),z=c.previous,L=c.currentConstruct,D=c.events.length,B=Array.from(s);return{restore:U,from:D};function U(){o=O,c.previous=z,c.currentConstruct=L,c.events.length=D,s=B,M()}}function M(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function kJ(e,t){let r=t.start._index,o=t.start._bufferIndex,n=t.end._index,a=t.end._bufferIndex,i;if(r===n)i=[e[r].slice(o,a)];else{if(i=e.slice(r,n),o>-1){let s=i[0];typeof s=="string"?i[0]=s.slice(o):i.shift()}a>0&&i.push(e[n].slice(0,a))}return i}function RJ(e,t){let r=-1,o=[],n;for(;++r<e.length;){let a=e[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
|