@ceed/cds 0.0.133 → 0.0.135

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/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: `+i+`
127
- `),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function K6(e){e=J6(e);var t=e.decimalSeparator,r=e.allowedDecimalSeparators,o=e.thousandsGroupStyle,n=e.suffix,i=e.allowNegative,a=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=ma);var l=e.onBlur;l===void 0&&(l=ma);var p=e.thousandSeparator,c=e.decimalScale,d=e.fixedDecimalScale,f=e.prefix;f===void 0&&(f="");var u=e.defaultValue,h=e.value,y=e.valueIsNumericString,g=e.onValueChange,v=r_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=qh(e),b=x.decimalSeparator,k=x.allowedDecimalSeparators,P=function(F){return e_(F,e)},T=function(F,R){return G6(F,R,e)},C=ep(h)?u:h,S=y!=null?y:W6(C,f,n);ep(h)?ep(u)||(S=S||typeof u=="number"):S=S||typeof h=="number";var O=function(F){return o_(F)?F:(typeof F=="number"&&(F=a_(F)),S&&typeof c=="number"?ZI(F,c,!!d):F)},_=l_(O(h),O(u),!!S,P,T,g),L=_[0],N=L.numAsString,D=L.formattedValue,$=_[1],M=function(F){var R=F.target,X=F.key,ie=R.selectionStart,w=R.selectionEnd,ue=R.value;if(ue===void 0&&(ue=""),ie!==w){s(F);return}X==="Backspace"&&ue[0]==="-"&&ie===f.length+1&&i&&Ss(R,1),c&&d&&(X==="Backspace"&&ue[ie-1]===b?(Ss(R,ie-1),F.preventDefault()):X==="Delete"&&ue[ie]===b&&F.preventDefault()),k!=null&&k.includes(X)&&ue[ie]===b&&Ss(R,ie+1);var ve=p===!0?",":p;X==="Backspace"&&ue[ie-1]===ve&&Ss(R,ie-1),X==="Delete"&&ue[ie]===ve&&Ss(R,ie+1),s(F)},I=function(F){var R=N;if(R.match(/\d/g)||(R=""),a||(R=A6(R)),d&&c&&(R=ZI(R,c,d)),R!==N){var X=e_(R,e);$({formattedValue:X,value:R,floatValue:parseFloat(R)},{event:F,source:yu.event})}l(F)},B=function(F){return F===b?!0:gu(F)},q=function(F){var R=F.currentValue,X=F.lastValue,ie=F.formattedValue,w=F.currentValueIndex,ue=F.formattedValueIndex,ve=R[w],Me=ie[ue],ae=s_(X,R),U=ae.to;return w>=U.start&&w<U.end&&k&&k.includes(ve)&&Me===b?!0:ve===Me};return Object.assign(Object.assign({},v),{value:D,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:q,onValueChange:$,format:P,removeFormatting:T,getCaretBoundary:function(F){return q6(F,e)},onKeyDown:M,onBlur:I})}function p_(e){var t=K6(e);return Ql.createElement(j6,Object.assign({},t))}import Y6 from"react";import{motion as X6}from"framer-motion";var Z6=X6(pm),vu=Y6.forwardRef((e,t)=>{var u;let f=e,{label:r,helperText:o,error:n,style:i,size:a,color:s,disabled:l,required:p}=f,c=Ce(f,["label","helperText","error","style","size","color","disabled","required"]),d=A(Z6,j({required:p,color:n?"danger":s,size:a,disabled:l,slotProps:j({input:j({ref:t},(u=c.slotProps)==null?void 0:u.input)},c.slotProps)},c));return r?Ee(qt,{required:p,color:s,size:a,error:n,disabled:l,children:[A(Jt,{children:r}),d,o&&A(Ft,{children:o})]}):d});vu.displayName="Input";var Gr=vu;var Q6={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 YI(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split(""),i=Q6[e];return{symbol:`${t} `,thousandSeparator:r,decimalSeparator:o,placeholder:o?`${t} 0${o}${Array.from(Array(i)).map(()=>0).join("")}`:`${t} 0`,fixedDecimalScale:!!o,decimalScale:i}};var t7=f_.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(p_,le(j({},n),{onValueChange:({value:a})=>{o==null||o({target:{name:t.name,value:a}})},valueIsNumericString:!0,getInputRef:r,allowNegative:!1}))}),Jh=f_.forwardRef(function(t,r){let L=t,{currency:o="USD",name:n,onChange:i,label:a,error:s,helperText:l,required:p,disabled:c,useMinorUnit:d}=L,f=Ce(L,["currency","name","onChange","label","error","helperText","required","disabled","useMinorUnit"]),{symbol:u,thousandSeparator:h,decimalSeparator:y,placeholder:g,fixedDecimalScale:v,decimalScale:x}=c_(o),[b,k]=d_(t.value),P=u_(()=>b&&d?b/Math.pow(10,x):b,[b,d,x]),T=u_(()=>t.max&&d?t.max/Math.pow(10,x):t.max,[t.max,d,x]),[C,S]=d_(!!T&&!!P&&P>T),O=e7(N=>{var $;let D=Number(d?($=N.target.value)==null?void 0:$.replace(y,""):N.target.value);T&&Number(N.target.value)>T?S(!0):S(!1),k(D),i==null||i(le(j({},N),{target:{name:n,value:D}}))},[y,T,n,i,d]),_=A(Gr,le(j({},f),{size:"sm",ref:r,value:P,placeholder:g,onChange:O,disabled:c,required:p,color:s||C?"danger":t.color,slotProps:{input:{component:t7,decimalSeparator:y,thousandSeparator:h,prefix:u,fixedDecimalScale:v,decimalScale:x,"aria-label":f["aria-label"]}},sx:{fontFamily:"monospace"}}));return a?Ee(qt,{size:"sm",disabled:c,required:p,error:s||C,children:[A(Jt,{children:a}),_,C?A(Ft,{children:new Gh(`limit: {amount, number, ::currency/${o} unit-width-narrow}`).format({amount:T})}):l&&A(Ft,{children:l})]}):_});var m_=Jh;import O7,{useCallback as ap,useEffect as sy,useMemo as no,useRef as I_,useState as __,useId as I7}from"react";import{motion as r7}from"framer-motion";var o7=r7(Ym),bu=o7;bu.displayName="Sheet";var qo=bu;var xu=e=>{let o=e,{children:t}=o,r=Ce(o,["children"]);return A(rh,le(j({},r),{children:t}))};xu.displayName="Table";function Ex(e){let{headCells:t,showCheckbox:r,onCheckboxChange:o,slots:{checkbox:n=pu}={},slotProps:{checkbox:i={}}={}}=e;return A("thead",{children:Ee("tr",{children:[r&&A("th",{style:{width:"40px",textAlign:"center"},children:A(n,j({onChange:o},i))}),t.map(a=>A("th",{style:{width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth,textAlign:a.numeric?"right":"left"},children:a.label},a.label))]})})}Ex.displayName="TableHead";function Ox(e){let{rows:t,cellOrder:r,rowOptions:o,showCheckbox:n,onCheckboxChange:i,slots:{checkbox:a=pu}={},slotProps:{checkbox:s={}}={}}=e;return A("tbody",{children:t.map((l,p)=>Ee("tr",{children:[n&&A("td",{style:{textAlign:"center"},children:A(a,j({onChange:c=>i==null?void 0:i(c,p)},s))}),r.map(c=>{var d;return A("td",{style:{textAlign:(d=o==null?void 0:o[c])!=null&&d.numeric?"right":"left"},children:l[c]},c)})]},p))})}Ox.displayName="TableBody";import f7,{forwardRef as m7,useCallback as x_,useEffect as T_,useImperativeHandle as h7,useRef as y7,useState as P_}from"react";function bo(e){return typeof e=="string"||e instanceof String}function Ix(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function _x(e,t){return Array.isArray(t)?_x(e,(r,o)=>t.includes(o)):Object.entries(e).reduce((r,o)=>{let[n,i]=o;return t(i,n)&&(r[n]=i),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 Kh(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function tp(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(!tp(t[n],e[n]))return!1;return!0}if(r!=o)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){let i=t instanceof Date,a=e instanceof Date;if(i&&a)return t.getTime()==e.getTime();if(i!=a)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(!tp(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 Yh=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 Pe(e,t){return new Pe.InputMask(e,t)}function Dx(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?Pe.MaskedRegExp:bo(e)?Pe.MaskedPattern:e===Date?Pe.MaskedDate:e===Number?Pe.MaskedNumber:Array.isArray(e)||e===Array?Pe.MaskedDynamic:Pe.Masked&&e.prototype instanceof Pe.Masked?e:Pe.Masked&&e instanceof Pe.Masked?e.constructor:e instanceof Function?Pe.MaskedFunction:(console.warn("Mask not found for mask",e),Pe.Masked)}function fi(e){if(!e)throw new Error("Options in not defined");if(Pe.Masked){if(e.prototype instanceof Pe.Masked)return{mask:e};let t=e instanceof Pe.Masked?{mask:e}:Ix(e)&&e.mask instanceof Pe.Masked?e:{},{mask:r=void 0}=t,o=Ce(t,["mask"]);if(r){let n=r.mask;return j(le(j({},_x(r,(i,a)=>!a.startsWith("_"))),{mask:r.constructor,_mask:n}),o)}}return Ix(e)?j({},e):{mask:e}}function Mr(e){if(Pe.Masked&&e instanceof Pe.Masked)return e;let t=fi(e),r=Dx(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)}Pe.createMask=Mr;var ha=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}};Pe.MaskElement=ha;var h_=90,n7=89,mi=class extends ha{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===h_&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===n7&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===h_&&(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={}}};Pe.HTMLMaskElement=mi;var Tu=class extends mi{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}};Pe.HTMLMaskElement=mi;var rp=class extends mi{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,i=n.getSelection&&n.getSelection();i&&(i.removeAllRanges(),i.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}};Pe.HTMLContenteditableMaskElement=rp;var Pu=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}};Pu.MAX_LENGTH=100;var Xh=class{constructor(t,r){this.el=t instanceof ha?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new rp(t):new Tu(t),this.masked=Mr(r),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Pu,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 Pe.Masked)&&this.masked.constructor===Dx(t)){this.masked.updateOptions({mask:t});return}let r=t instanceof Pe.Masked?t:Mr({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,i=this.displayValue,a=this.unmaskedValue!==r||this.value!==o||this._rawInputValue!==n;this._unmaskedValue=r,this._value=o,this._rawInputValue=n,this.el.value!==i&&(this.el.value=i),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),a&&this._fireChangeEvents(),!this._historyChanging&&(a||this.history.isEmpty)&&this.history.push({unmaskedValue:r,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){let a=t,{mask:r}=a,o=Ce(a,["mask"]),n=!this.maskEquals(r),i=this.masked.optionsIsChanged(o);n&&(this.mask=r),i&&this.masked.updateOptions(o),(n||i)&&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 Yh({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,i=o===this.masked.rawInputValue?r.removeDirection:we.NONE,a=this.masked.nearestInputPos(r.startChangePos+n,i);i!==we.NONE&&(a=this.masked.nearestInputPos(a,we.NONE)),this.updateControl(a),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}};Pe.InputMask=Xh;var Fe=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}};Pe.ChangeDetails=Fe;var Lr=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 Kt=class e{constructor(t){this._value="",this._update(j(j({},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 Lr(this.extractInput(t,r),t)}appendTail(t){return bo(t)&&(t=new Lr(String(t))),t.appendTo(this)}_appendCharRaw(t,r){return t?(this._value+=t,new Fe({inserted:t,rawInserted:t})):new Fe}_appendChar(t,r,o){r===void 0&&(r={});let n=this.state,i;if([t,i]=this.doPrepareChar(t,r),t&&(i=i.aggregate(this._appendCharRaw(t,r)),!i.rawInserted&&this.autofix==="pad")){let a=this.state;this.state=n;let s=this.pad(r),l=this._appendCharRaw(t,r);s=s.aggregate(l),l.rawInserted||s.equals(i)?i=s:this.state=a}if(i.inserted){let a,s=this.doValidate(r)!==!1;if(s&&o!=null){let l=this.state;if(this.overwrite===!0){a=o.state;for(let c=0;c<i.rawInserted.length;++c)o.unshift(this.displayValue.length-i.tailShift)}let p=this.appendTail(o);if(s=p.rawInserted.length===o.toString().length,!(s&&p.inserted)&&this.overwrite==="shift"){this.state=l,a=o.state;for(let c=0;c<i.rawInserted.length;++c)o.shift();p=this.appendTail(o),s=p.rawInserted.length===o.toString().length}s&&p.inserted&&(this.state=l)}s||(i=new Fe,this.state=n,o&&a&&(o.state=a))}return i}_appendPlaceholder(){return new Fe}_appendEager(){return new Fe}append(t,r,o){if(!bo(t))throw new Error("value should be string");let n=bo(o)?new Lr(String(o)):o;r!=null&&r.tail&&(r._beforeTailState=this.state);let i;[t,i]=this.doPrepare(t,r);for(let a=0;a<t.length;++a){let s=this._appendChar(t[a],r,n);if(!s.rawInserted&&!this.doSkipInvalid(t[a],r,n))break;i.aggregate(s)}return(this.eager===!0||this.eager==="append")&&r!=null&&r.input&&t&&i.aggregate(this._appendEager()),n!=null&&(i.tailShift+=this.appendTail(n).tailShift),i}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 Fe}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={}),Fe.normalize(this.prepare?this.prepare(t,this,r):t)}doPrepareChar(t,r){return r===void 0&&(r={}),Fe.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,i){o===void 0&&(o=""),n===void 0&&(n=we.NONE),i===void 0&&(i={input:!0});let a=t+r,s=this.extractTail(a),l=this.eager===!0||this.eager==="remove",p;l&&(n=wx(n),p=this.extractInput(0,a,{raw:!0}));let c=t,d=new Fe;if(n!==we.NONE&&(c=this.nearestInputPos(t,r>1&&t!==0&&!l?we.NONE:n),d.tailShift=c-t),d.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);)d.aggregate(new Fe({tailShift:-1})).aggregate(this.remove(f-1))}else n===we.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(o,i,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!tp(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 Fe}};Kt.DEFAULTS={skipInvalid:!0};Kt.EMPTY_VALUES=[void 0,null,""];Pe.Masked=Kt;var op=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=bo(t)?new Lr(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 Lr)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 Pe.MaskedPattern))return new Lr(this.toString()).appendTo(t);let r=new Fe;for(let o=0;o<this.chunks.length;++o){let n=this.chunks[o],i=t._mapPosToBlock(t.displayValue.length),a=n.stop,s;if(a!=null&&(!i||i.index<=a)&&((n instanceof e||t._stops.indexOf(a)>=0)&&r.aggregate(t._appendPlaceholder(a)),s=n instanceof e&&t._blocks[a]),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=Ce(n,["chunks"]);Object.assign(this,o),this.chunks=r.map(i=>{let a="chunks"in i?new e:new Lr;return a.state=i,a})}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],i=n.unshift(r);if(n.toString()){if(!i)break;++o}else this.chunks.splice(o,1);if(i)return i}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 Zh=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 np=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 Fe}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 Fe;let o=this.eager===!0||this.eager==="append",i=this.char===t&&(this.isUnmasking||r.input||r.raw)&&(!r.raw||!o)&&!r.tail,a=new Fe({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(r.raw||r.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let t=new Fe;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Lr("")}appendTail(t){return bo(t)&&(t=new Lr(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 ya=class{constructor(t){let p=t,{parent:r,isOptional:o,placeholderChar:n,displayChar:i,lazy:a,eager:s}=p,l=Ce(p,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=Mr(l),Object.assign(this,{parent:r,isOptional:o,placeholderChar:n,displayChar:i,lazy:a,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 Fe}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 Fe;let o=this.masked.state,n=this.masked._appendChar(t,this.currentMaskFlags(r));return n.inserted&&this.doValidate(r)===!1&&(n=new Fe,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 Fe:(this.isFilled=!0,new Fe({inserted:this.placeholderChar}))}_appendEager(){return new Fe}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,i=Math.min(Math.max(t,o),n);switch(r){case we.LEFT:case we.FORCE_LEFT:return this.isComplete?i:o;case we.RIGHT:case we.FORCE_RIGHT:return this.isComplete?i:n;case we.NONE:default:return i}}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 le(j({},t),{_beforeTailState:(t==null||(r=t._beforeTailState)==null?void 0:r.masked)||(t==null?void 0:t._beforeTailState)})}pad(t){return new Fe}};ya.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 Qh=class extends Kt{updateOptions(t){super.updateOptions(t)}_update(t){let r=t.mask;r&&(t.validate=o=>o.search(r)>=0),super._update(t)}};Pe.MaskedRegExp=Qh;var or=class e extends Kt{constructor(t){super(le(j(j({},e.DEFAULTS),t),{definitions:Object.assign({},ya.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 a=0;a<r.length;++a){if(this.blocks){let c=r.slice(a),d=Object.keys(this.blocks).filter(u=>c.indexOf(u)===0);d.sort((u,h)=>h.length-u.length);let f=d[0];if(f){let i=fi(this.blocks[f]),{expose:u,repeat:h}=i,y=Ce(i,["expose","repeat"]),g=le(j({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix},y),{repeat:h,parent:this}),v=h!=null?new Pe.RepeatBlock(g):Mr(g);v&&(this._blocks.push(v),u&&(this.exposeBlock=v),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),a+=f.length-1;continue}}let s=r[a],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(++a,s=r[a],!s)break;l=!1}let p=l?new ya(le(j({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},fi(t[s])),{parent:this})):new np({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(p)}}get state(){return le(j({},super.state),{_blocks:this._blocks.map(t=>t.state)})}set state(t){if(!t){this.reset();return}let n=t,{_blocks:r}=n,o=Ce(n,["_blocks"]);this._blocks.forEach((i,a)=>i.state=r[a]),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 Fe,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 i=this._blocks[n]._appendEager();if(!i.inserted)break;r.aggregate(i)}return r}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._mapPosToBlock(this.displayValue.length),n=new Fe;if(!o)return n;for(let a=o.index,s;s=this._blocks[a];++a){var i;let l=s._appendChar(t,le(j({},r),{_beforeTailState:(i=r._beforeTailState)==null||(i=i._blocks)==null?void 0:i[a]}));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 op;return t===r||this._forEachBlocksInRange(t,r,(n,i,a,s)=>{let l=n.extractTail(a,s);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof op&&(l.blockIndex=i),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,(i,a,s,l)=>{n+=i.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 Fe;if(this.lazy&&t==null)return r;let o=this._mapPosToBlock(this.displayValue.length);if(!o)return r;let n=o.index,i=t!=null?t:this._blocks.length;return this._blocks.slice(n,i).forEach(a=>{if(!a.lazy||t!=null){var s;r.aggregate(a._appendPlaceholder((s=a._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],i=r.length;if(r+=n.displayValue,t<=r.length)return{index:o,offset:t-i}}}_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 i=this._mapPosToBlock(r),a=i&&n.index===i.index,s=n.offset,l=i&&a?i.offset:this._blocks[n.index].displayValue.length;if(o(this._blocks[n.index],n.index,s,l),i&&!a){for(let p=n.index+1;p<i.index;++p)o(this._blocks[p],p,0,this._blocks[p].displayValue.length);o(this._blocks[i.index],i.index,0,i.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,i,a,s)=>{o.aggregate(n.remove(a,s))}),o}nearestInputPos(t,r){if(r===void 0&&(r=we.NONE),!this._blocks.length)return 0;let o=new Zh(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,i,a,s)=>{o+=n.totalInputPositions(a,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 Fe;return this._forEachBlocksInRange(0,this.displayValue.length,o=>r.aggregate(o.pad(t))),r}};or.DEFAULTS=le(j({},Kt.DEFAULTS),{lazy:!0,placeholderChar:"_"});or.STOP_CHAR="`";or.ESCAPE_CHAR="\\";or.InputDefinition=ya;or.FixedDefinition=np;Pe.MaskedPattern=or;var ga=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:i=this.autofix}=c,a=Ce(c,["to","from","maxLength","autofix"]);this.to=r,this.from=o,this.maxLength=Math.max(String(r).length,n),this.autofix=i;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;a.mask=l.slice(0,p).replace(/0/g,"\\0")+"0".repeat(this.maxLength-p),super._update(a)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let r="",o="",[,n,i]=t.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(r="0".repeat(n.length)+i,o="9".repeat(n.length)+i),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"),[i,a]=this.boundaries(this.value+t);return Number(a)<this.from?super._appendCharRaw(o[this.value.length],r):Number(i)>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,i]=this.boundaries(r);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){let r=new Fe;if(this.value.length===this.maxLength)return r;let o=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let i=0;i<n;++i)r.aggregate(super._appendCharRaw("0",t));o.split("").forEach(i=>this._appendCharRaw(i))}return r}};Pe.MaskedRange=ga;var ip=class e extends or{static extractPatternOptions(t){let i=t,{mask:r,pattern:o}=i,n=Ce(i,["mask","pattern"]);return le(j({},n),{mask:bo(r)?r:o})}constructor(t){super(e.extractPatternOptions(j(j({},e.DEFAULTS),t)))}updateOptions(t){super.updateOptions(t)}_update(t){let s=j(j({},e.DEFAULTS),t),{mask:r,pattern:o,blocks:n}=s,i=Ce(s,["mask","pattern","blocks"]),a=Object.assign({},e.GET_DEFAULT_BLOCKS());t.min&&(a.Y.from=t.min.getFullYear()),t.max&&(a.Y.to=t.max.getFullYear()),t.min&&t.max&&a.Y.from===a.Y.to&&(a.m.from=t.min.getMonth()+1,a.m.to=t.max.getMonth()+1,a.m.from===a.m.to&&(a.d.from=t.min.getDate(),a.d.to=t.max.getDate())),Object.assign(a,this.blocks,n),super._update(le(j({},i),{mask:bo(r)?r:o,blocks:a}))}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))}};ip.GET_DEFAULT_BLOCKS=()=>({d:{mask:ga,from:1,to:31,maxLength:2},m:{mask:ga,from:1,to:12,maxLength:2},Y:{mask:ga,from:1900,to:9999}});ip.DEFAULTS=le(j({},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)}});Pe.MaskedDate=ip;var Cu=class e extends Kt{constructor(t){super(j(j({},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 a=fi(r),{expose:o}=a,n=Ce(a,["expose"]),i=Mr(j({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid},n));return o&&(this.exposeMask=i),i}):[])}_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,i=this.rawInputValue,a=r.tail&&r._beforeTailState!=null?r._beforeTailState._rawInputValue:i,s=i.slice(a.length),l=this.currentMask,p=new Fe,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(t,j({},r),o),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),a&&(this.currentMask.append(a,{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 Fe;return t&&r.aggregate(this._applyDispatch("",{},t)),r.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var r,o;return le(j({},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 i;[o,i]=super.doPrepare(o,this.currentMaskFlags(r)),n=n.aggregate(i)}return[o,n]}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(t,r);if(this.currentMask){let i;[o,i]=super.doPrepareChar(o,this.currentMaskFlags(r)),n=n.aggregate(i)}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 Fe;return this.currentMask&&o.aggregate(this.currentMask.remove(t,r)).aggregate(this._applyDispatch()),o}get state(){var t;return le(j({},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 a=t,{compiledMasks:r,currentMaskRef:o,currentMask:n}=a,i=Ce(a,["compiledMasks","currentMaskRef","currentMask"]);r&&this.compiledMasks.forEach((s,l)=>s.state=r[l]),o!=null&&(this.currentMask=o,this.currentMask.state=n),super.state=i}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 a=t[o],{mask:n}=a,i=Ce(a,["mask"]);return tp(r,i)&&r.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var r;return!!((r=this.currentMask)!=null&&r.typedValueEquals(t))}};Cu.DEFAULTS=le(j({},Kt.DEFAULTS),{dispatch:(e,t,r,o)=>{if(!t.compiledMasks.length)return;let n=t.rawInputValue,i=t.compiledMasks.map((a,s)=>{let l=t.currentMask===a,p=l?a.displayValue.length:a.nearestInputPos(a.displayValue.length,we.FORCE_LEFT);return a.rawInputValue!==n?(a.reset(),a.append(n,{raw:!0})):l||a.remove(p),a.append(e,t.currentMaskFlags(r)),a.appendTail(o),{index:s,weight:a.rawInputValue.length,totalInputPositions:a.totalInputPositions(0,Math.max(p,a.nearestInputPos(a.displayValue.length,we.FORCE_LEFT)))}});return i.sort((a,s)=>s.weight-a.weight||s.totalInputPositions-a.totalInputPositions),t.compiledMasks[i[0].index]}});Pe.MaskedDynamic=Cu;var Su=class e extends or{constructor(t){super(j(j({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){let n=t,{enum:r}=n,o=Ce(n,["enum"]);if(r){let i=r.map(l=>l.length),a=Math.min(...i),s=Math.max(...i)-a;o.mask="*".repeat(a),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(i=>this.matchValue(i,this.unmaskedValue+t,o));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(a,s)=>{let l=n[0][s];s>=this.value.length||l===a.value||(a.reset(),a._appendChar(l,r))});let i=super._appendCharRaw(n[0][this.value.length],r);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(a=>i.aggregate(super._appendCharRaw(a))),i}return new Fe}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new Lr("",t)}remove(t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),t===r)return new Fe;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 i=super.remove(n,r);return i.tailShift+=n-t,i}};Su.DEFAULTS=le(j({},or.DEFAULTS),{matchValue:(e,t,r)=>e.indexOf(t,r)===r});Pe.MaskedEnum=Su;var ey=class extends Kt{updateOptions(t){super.updateOptions(t)}_update(t){super._update(le(j({},t),{validate:t.mask}))}};Pe.MaskedFunction=ey;var y_,va=class e extends Kt{constructor(t){super(j(j({},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?"("+Kh(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+r+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Kh).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Kh(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 i=this._value;this._value+=t;let a=this.number,s=!isNaN(a),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=i===this._value&&!r.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let p;s?p=new Fe({inserted:this._value.slice(i.length),rawInserted:l?"":t,skip:l}):(this._value=i,p=new Fe),this._value=this._insertThousandsSeparators(this._value);let c=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return p.tailShift+=(d-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),i=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+n));let a=this._separatorsCountFromSlice(o);return new Fe({tailShift:(a-i)*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,i,a)=>n+a),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==="")}};y_=va;va.UNMASKED_RADIX=".";va.EMPTY_VALUES=[...Kt.EMPTY_VALUES,0];va.DEFAULTS=le(j({},Kt.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[y_.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})});Pe.MaskedNumber=va;var ty={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Ax(e,t,r){t===void 0&&(t=ty.MASKED),r===void 0&&(r=ty.MASKED);let o=Mr(e);return n=>o.runIsolated(i=>(i[t]=n,i[r]))}function g_(e,t,r,o){return Ax(t,r,o)(e)}Pe.PIPE_TYPE=ty;Pe.createPipe=Ax;Pe.pipe=g_;var ry=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=fi(t),{repeat:i}=l,a=Ce(l,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,a);let s=Mr(this._blockOpts);this.repeat=(r=(o=i!=null?i: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(Mr(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,r){r===void 0&&(r={});let o=new Fe;for(let l=(n=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?n:Math.max(this._blocks.length-1,0),p,c;p=(a=this._blocks[l])!=null?a:c=!c&&this._allocateBlock(l);++l){var n,i,a,s;let d=p._appendChar(t,le(j({},r),{_beforeTailState:(s=r._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]}));if(d.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(d),d.consumed)break}return o}_trimEmptyTail(t,r){var o,n;t===void 0&&(t=0);let i=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0),a;r!=null&&(a=(n=this._mapPosToBlock(r))==null?void 0:n.index),a==null&&(a=this._blocks.length-1);let s=0;for(let l=a;i<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(a-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}};Pe.RepeatBlock=ry;try{globalThis.IMask=Pe}catch(e){}import Mx from"react";var Be=ko(eC(),1);import oy from"react";var v_={mask:Be.default.oneOfType([Be.default.array,Be.default.func,Be.default.string,Be.default.instanceOf(RegExp),Be.default.oneOf([Date,Number,Pe.Masked]),Be.default.instanceOf(Pe.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})])},b_=Object.keys(v_).filter(e=>e!=="value"),i7=["value","unmask","onAccept","onComplete","inputRef"],a7=b_.filter(e=>i7.indexOf(e)<0);function Nx(e){var t;let r=(t=class extends oy.Component{constructor(i){super(i),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let i=this.props,a=this._extractMaskOptionsFromProps(i);if(a.mask)this.maskRef?(this.maskRef.updateOptions(a),"value"in i&&i.value!==void 0&&(this.maskValue=i.value)):this.initMask(a);else if(this.destroyMask(),"value"in i&&i.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=i.value:this.element.value=i.value}}componentWillUnmount(){this.destroyMask()}_inputRef(i){this.element=i,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=i:this.props.inputRef(i))}initMask(i){i===void 0&&(i=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Pe(this.element,i).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(i){let a=Ce(i,[]);return Object.keys(a).filter(s=>a7.indexOf(s)<0).forEach(s=>{delete a[s]}),a}_extractNonMaskProps(i){let a=Ce(i,[]);return b_.forEach(s=>{s!=="maxLength"&&delete a[s]}),"defaultValue"in a||(a.defaultValue=i.mask?"":a.value),delete a.value,a}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(i){this.maskRef&&(i=i==null&&this.props.unmask!=="typed"?"":i,this.props.unmask==="typed"?this.maskRef.typedValue=i:this.props.unmask?this.maskRef.unmaskedValue=i:this.maskRef.value=i)}_onAccept(i){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,i)}_onComplete(i){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,i)}render(){return oy.createElement(e,le(j({},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=v_,oy.forwardRef((n,i)=>oy.createElement(r,le(j({},n),{ref:i})))}var s7=Nx(e=>{let o=e,{inputRef:t}=o,r=Ce(o,["inputRef"]);return Mx.createElement("input",le(j({},r),{ref:t}))}),l7=(e,t)=>Mx.createElement(s7,le(j({},e),{ref:t})),hi=Mx.forwardRef(l7);import{useRef as AJe,useState as NJe,useCallback as MJe,useEffect as LJe}from"react";import"react";import{jsx as p7}from"react/jsx-runtime";var ba=Tr(p7("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 c7}from"framer-motion";var u7=c7(Tm),d7=E(u7)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),ku=d7;ku.displayName="DialogActions";var Bn=ku;var g7=E(Gt,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),v7=E(qo,{name:"DatePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),b7=E("div",{name:"DatePicker",slot:"container"})({width:"100%"}),C_=e=>{let t=`${e.getDate()}`,r=`${e.getMonth()+1}`,o=e.getFullYear();return Number(t)<10&&(t="0"+t),Number(r)<10&&(r="0"+r),[o,r,t].join("/")},x7=f7.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(hi,le(j({},n),{inputRef:r,onAccept:a=>o({target:{name:t.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:Pe.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Pe.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Pe.MaskedRange,from:1900,to:9999}},format:C_,parse:a=>{let s=a.split("/");return new Date(Number(s[0]),Number(s[1])-1,Number(s[2]))},autofix:"pad",overwrite:!0}))}),ny=m7((e,t)=>{let T=e,{onChange:r,disabled:o,label:n,error:i,helperText:a,minDate:s,maxDate:l,disableFuture:p,disablePast:c,required:d}=T,f=Ce(T,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required"]),u=y7(null),[h,y]=P_(e.value||""),[g,v]=P_(null),x=!!g;T_(()=>{y(e.value||"")},[e.value]),T_(()=>{var C;g||(C=u.current)==null||C.blur()},[g,u]),h7(t,()=>u.current,[u.current]);let b=x_(C=>{y(C.target.value),r==null||r(C)},[r]),k=x_(C=>{v(g?null:C.currentTarget),setTimeout(()=>{var S;(S=u.current)==null||S.focus()},0)},[g,v,u]),P=A(b7,{children:A(Qr,{open:!0,children:Ee(oo,{children:[A(Gr,le(j({},f),{color:i?"danger":f.color,ref:u,size:"sm",value:h,onChange:b,placeholder:"YYYY/MM/DD",disabled:o,required:d,slotProps:{input:{component:x7,ref:u}},sx:{fontFamily:"monospace"},endDecorator:A(pr,{variant:"plain",onClick:k,children:A(ba,{})})})),x&&A(Gn,{onClickAway:()=>v(null),children:A(g7,{id:"date-picker-popper",open:!0,anchorEl:g,placement:"bottom-end",onMouseDown:C=>C.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],children:Ee(v7,{tabIndex:-1,role:"presentation",children:[A(fa,{value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([C])=>{b({target:{name:e.name,value:C_(C)}}),v(null)},minDate:s?new Date(s):void 0,maxDate:l?new Date(l):void 0,disableFuture:p,disablePast:c}),A(Bn,{sx:{p:1},children:A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{b({target:{name:e.name,value:""}}),v(null)},children:"Clear"})})]})})})]})})});return n?Ee(qt,{required:d,disabled:o,error:i,size:"sm",children:[A(Jt,{children:n}),P,a&&A(Ft,{children:a})]}):P});var S_=ny;import{motion as T7}from"framer-motion";var P7=T7(lh),Ru=e=>{let f=e,{label:t,error:r,helperText:o,color:n,size:i,disabled:a,required:s,minRows:l=2,maxRows:p=4}=f,c=Ce(f,["label","error","helperText","color","size","disabled","required","minRows","maxRows"]),d=A(P7,j({required:s,disabled:a,color:r?"danger":n,size:i,minRows:l,maxRows:p},c));return t?Ee(qt,{required:s,disabled:a,color:n,size:i,error:r,children:[A(Jt,{children:t}),d,o&&A(Ft,{children:o})]}):d};Ru.displayName="Textarea";var k_=Ru;import{useMemo as C7}from"react";import{motion as S7}from"framer-motion";var k7=S7(Gm),iy=k7;iy.displayName="Option";function Eu(e){let u=e,{label:t,helperText:r,error:o,size:n,color:i,disabled:a,required:s,onChange:l}=u,p=Ce(u,["label","helperText","error","size","color","disabled","required","onChange"]),c=C7(()=>e.options.map(h=>typeof h!="object"?{value:h,label:h}:h),[e.options]),d=(h,y)=>{var x;let g=h||{target:{}},v=le(j({},g),{target:{name:((x=g.target)==null?void 0:x.name)||e.name,value:y||void 0}});l==null||l(v)},f=A(Km,le(j({},p),{required:s,disabled:a,size:n,color:o?"danger":i,onChange:d,children:c.map(h=>A(iy,{value:h.value,children:h.label},h.value))}));return t?Ee(qt,{required:s,disabled:a,size:n,color:i,error:o,children:[A(Jt,{children:t}),f,r&&A(Ft,{children:r})]}):f}Eu.displayName="Select";var R_=Eu;import{motion as R7}from"framer-motion";var E7=R7(ch),Ou=e=>A(E7,j({},e));Ou.displayName="Tooltip";var E_=Ou;La();function w_(e){return!e.editMode&&["number","date","currency"].includes(e.type||"")?"end":"start"}var O_=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"}}),ay=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function _7(e){let{paginationModel:{page:t,pageSize:r},rowCount:o,onPageChange:n}=e,i=1,a=Math.ceil(o/r),s=[t-2,t-1].filter(d=>d>1),l=[t+1,t+2].filter(d=>d<=a-1),p=a>1&&t<a-3,c=a>1&&t>4;return A(Ar,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center",children:Ee(Ar,{direction:"row",spacing:.5,alignItems:"center",children:[A(pr,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-1),disabled:t===i,"aria-label":"Previous page",children:A(_h,{})}),t!==i&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(i),children:i}),c&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-3),children:"..."}),s.map(d=>A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(d),children:d},d)),A(wt,{variant:"soft",size:"sm",children:t}),l.map(d=>A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(d),children:d},d)),p&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+3),children:"..."}),t!==a&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(a),children:a}),A(pr,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+1),disabled:t===a,"aria-label":"Next page",children:A(wh,{})})]})})}var w7=e=>A(Ih,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:t=>{var a;let r=t.clientX,o=(a=e.current)==null?void 0:a.getBoundingClientRect().width,n=s=>{o&&r&&(e.current.style.width=`${o+(s.clientX-r)}px`)},i=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)}}),D7=E("span",{name:"DataTable",slot:"headCellAsterisk"})(({theme:e})=>({color:"var(--ceed-palette-danger-500)",marginLeft:e.spacing(.5)})),A7=e=>{var n,i,a,s,l;let t=I_(null),r={width:e.width,minWidth:(n=e.minWidth)!=null?n:"50px",maxWidth:e.maxWidth,textAlign:w_(e),position:e.stickyHeader?void 0:"relative"},o=(i=e.resizable)==null||i?w7(t):null;return Ee("th",{id:`${e.tableId}_header_${(a=e.headerName)!=null?a:e.field}`,"aria-label":(s=e.headerName)!=null?s:e.field,ref:t,style:r,children:[(l=e.headerName)!=null?l:e.field,e.editMode&&e.required&&A(D7,{children:"*"}),o]},e.field)},N7=e=>{var P;let{tableId:t,field:r,type:o,renderCell:n,renderEditCell:i,isCellEditable:a,noWrap:s,row:l,rowId:p}=e,[c,d]=__(l[r]),f=I_(null),u=no(()=>({row:l,value:c,id:p}),[l,p,c]),h=no(()=>!!(e.editMode&&(typeof a=="function"?a(u):a==null||a)),[e.editMode,a,u]),y=no(()=>le(j({},typeof e.componentProps=="function"?e.componentProps(u):e.componentProps||{}),{size:"sm"}),[e,u]),g=no(()=>j(le(j({},y),{onChange:T=>{var C,S;(C=y.onChange)==null||C.call(y,T),d(T.target.value),o==="select"&&((S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:T.target.value}),value:T.target.value})))},onFocus:T=>{var C,S;(C=y.onFocus)==null||C.call(y,T),(S=e.onCellEditStart)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{value:c}),value:c}))},onBlur:T=>{var C,S;(C=y.onBlur)==null||C.call(y,T),o&&["number","text","longText","currency","date"].includes(o)&&((S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:c}),value:c})))}}),o==="autocomplete"&&{onChangeComplete:T=>{var C,S;(C=y.onChangeComplete)==null||C.call(y,T),d(T.target.value),(S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:T.target.value}),value:T.target.value}))}}),[u,l,r,c,y,o,e]),v=no(()=>i?i(u):{date:A(S_,j({value:c},g)),currency:A(m_,j({value:c},g)),number:A(Gr,j({value:c,type:"number"},g)),text:A(Gr,j({value:c,type:"text"},g)),longText:A(k_,j({value:c},g)),autocomplete:A(lI,j({value:c,options:g.options||[c]},g)),select:A(R_,j({value:c,options:g.options||[c]},g))}[o||"text"],[c,g,o]),x=no(()=>{if(n)return n(u);let T=c;return{link:O7.createElement(e.component||ai,j({children:T},y))}[o||"text"]||T},[c,n,u,o,y,e]),b=no(()=>h&&v?v:x,[h,v,x]),k=no(()=>s&&e.type==="longText",[s,e.type]);return sy(()=>{d(l[r])},[l,r]),A("td",{ref:f,headers:`${t}_header_${(P=e.headerName)!=null?P:r}`,style:{textAlign:w_({type:o}),verticalAlign:h?"top":"middle"},children:k?A(E_,{title:c,placement:"bottom",style:{maxWidth:"100%"},enterDelay:1500,enterNextDelay:1500,children:A("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:b})}):b},r)},M7=e=>{let{tableId:t,columns:r,rowId:o,editMode:n,noWrap:i,row:a}=e;return A(oo,{children:r.map((s,l)=>$P(N7,le(j({},s),{tableId:t,key:`${o}_${s.field.toString()}_${l}`,row:a,rowId:o,editMode:n,noWrap:i})))})};function L7({rows:e,columns:t,rowCount:r,pagination:o,paginationMode:n,paginationModel:i,onPaginationModelChange:a,selectionModel:s=[],onSelectionModelChange:l,editMode:p,getId:c,isTotalSelected:d}){let[f,u]=__((i==null?void 0:i.page)||1),h=(i==null?void 0:i.pageSize)||20,y=ap((C,S)=>{var O,_;return(_=(O=c==null?void 0:c(C))!=null?O:C==null?void 0:C.id)!=null?_:`${(S||0)+(f-1)*h}`},[c!=null?c:f,h]),g=no(()=>new Set(s),[s]),v=no(()=>!o||n==="server"?e:e.slice((f-1)*h,(f-1)*h+h),[e,f,h,n,o]),x=no(()=>v.length>0&&v.every((C,S)=>g.has(y(C,S))),[v,g,y]),b=r||e.length,k=no(()=>d!=null?d:b>0&&s.length===b,[d,s,b]),P=no(()=>(t||Object.keys(e[0]||{}).map(S=>({field:S}))).map(S=>{var O;return le(j({},S),{isCellEditable:p&&(typeof S.isCellEditable=="function"?S.isCellEditable:(O=S.isCellEditable)!=null?O:!0)})}),[e,t,p]),T=ap(C=>{u(C),a==null||a({page:C,pageSize:h})},[a,h]);return sy(()=>{T(1)},[b,T]),sy(()=>{let C=Math.max(1,Math.ceil(b/h));f>C&&T(C)},[f,b,h,T]),sy(()=>{l==null||l([])},[f]),{rowCount:b,page:f,pageSize:h,onPaginationModelChange:T,getId:y,HeadCell:A7,BodyRow:M7,dataInPage:v,isAllSelected:x,isTotalSelected:k,isSelectedRow:ap(C=>g.has(C),[g]),onAllCheckboxChange:ap(()=>{l==null||l(x?[]:v.map(y))},[x,v,l,y]),onCheckboxChange:ap((C,S)=>{if(g.has(S)){let O=s.filter(_=>_!==S);l==null||l(O)}else{let O=[...s,S];l==null||l(O)}},[s,l,g]),columns:P,onTotalSelect:ap(()=>{l==null||l(k?[]:e.map(y),!k)},[k,e,l,y])}}function Lx(e){let ie=e,{rows:t,checkboxSelection:r,editMode:o,selectionModel:n,onSelectionModelChange:i,rowCount:a,columns:s,onPaginationModelChange:l,pagination:p,paginationMode:c,paginationModel:d,loading:f,slots:{checkbox:u=pu,toolbar:h,footer:y,loadingOverlay:g=()=>A(Nc,{value:8,variant:"plain"})}={},slotProps:{checkbox:v={},toolbar:x,background:b={}}={}}=ie,k=Ce(ie,["rows","checkboxSelection","editMode","selectionModel","onSelectionModelChange","rowCount","columns","onPaginationModelChange","pagination","paginationMode","paginationModel","loading","slots","slotProps"]),{columns:P,isAllSelected:T,isSelectedRow:C,onAllCheckboxChange:S,onCheckboxChange:O,getId:_,rowCount:L,page:N,pageSize:D,onPaginationModelChange:$,dataInPage:M,isTotalSelected:I,onTotalSelect:B,HeadCell:q,BodyRow:F}=L7(e),R=I7(),X=no(()=>({page:N,pageSize:D}),[N,D]);return Ee(Ih,{children:[(!!r||!!h)&&Ee(Ar,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center",children:[!!r&&Ee(Ar,{direction:"row",spacing:1,children:[!T&&Ee(yn,{level:"body-xs",children:[ay((n==null?void 0:n.length)||0)," items selected"]}),T&&!I&&Ee(Ar,{direction:"row",spacing:1,alignItems:"center",children:[Ee(yn,{level:"body-xs",children:["All ",ay((n==null?void 0:n.length)||0)," items on this page are selected."]}),Ee(wt,{size:"sm",variant:"plain",onClick:B,children:["Select all ",ay(L!=null?L:t.length)," items"]})]}),I&&Ee(Ar,{direction:"row",spacing:1,alignItems:"center",children:[Ee(yn,{level:"body-xs",children:["All ",ay(L!=null?L:t.length)," items are selected."]}),A(wt,{size:"sm",variant:"plain",color:"danger",onClick:B,children:"Cancel"})]})]}),h&&A(h,j({},x||{}))]}),A(qo,le(j({variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"}},b),{children:Ee(xu,le(j({},k),{children:[A("thead",{children:Ee("tr",{children:[r&&A("th",{style:{width:"40px",textAlign:"center"},children:A(u,j({onChange:S,checked:T,indeterminate:(n||[]).length>0&&!T},v))}),P.map((w,ue)=>A(q,j({tableId:R,stickyHeader:e.stickyHeader,editMode:!!w.isCellEditable},w),`${w.field.toString()}_${ue}`))]})}),Ee("tbody",{children:[A(O_,{children:!!f&&A("td",{children:A(Ih,{sx:{position:"absolute",top:0,left:0,right:0},children:A(g,{})})})}),A(O_,{}),M.map((w,ue)=>{let ve=_(w,ue);return Ee("tr",{role:r?"checkbox":void 0,tabIndex:r?-1:void 0,onClick:r?Me=>O(Me,ve):void 0,"aria-checked":r?C(ve):void 0,children:[r&&A("th",{scope:"row",style:{textAlign:"center"},children:A(u,j({onChange:Me=>O(Me,ve),checked:C(ve)},v))}),A(F,{tableId:R,columns:P,row:w,rowId:ve,editMode:o,noWrap:e.noWrap})]},ve)})]}),y&&A(y,{})]}))})),D<L&&p&&A(_7,{paginationModel:X,rowCount:L,onPageChange:$})]})}Lx.displayName="DataTable";import B7,{forwardRef as z7,useCallback as Bx,useEffect as D_,useImperativeHandle as F7,useMemo as $7,useRef as V7,useState as A_}from"react";var j7=E(Gt,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),H7=E(qo,{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})),U7=E("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),N_=([e,t])=>{let r=o=>{let n=`${o.getDate()}`,i=`${o.getMonth()+1}`,a=o.getFullYear();return Number(n)<10&&(n="0"+n),Number(i)<10&&(i="0"+i),[a,i,n].join("/")};return[r(e),t?r(t):""].join(" - ")},M_=e=>{let t=e.split(" - ")[0]||"",r=e.split(" - ")[1]||"",o=t.split("/"),n=r.split("/");return[new Date(Number(o[0]),Number(o[1])-1,Number(o[2])),new Date(Number(n[0]),Number(n[1])-1,Number(n[2]))]},W7=B7.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(hi,le(j({},n),{inputRef:r,onAccept:a=>o({target:{name:t.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:Pe.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Pe.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Pe.MaskedRange,from:1900,to:9999}},format:N_,parse:M_,autofix:"pad",overwrite:!0}))}),zx=z7((e,t)=>{let S=e,{onChange:r,disabled:o,label:n,error:i,helperText:a,minDate:s,maxDate:l,disableFuture:p,disablePast:c,required:d}=S,f=Ce(S,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required"]),u=V7(null),[h,y]=A_(e.value||""),[g,v]=A_(null),x=!!g,b=$7(()=>h?M_(h):void 0,[h]);D_(()=>{y(e.value||"")},[e.value]),D_(()=>{var O;g||(O=u.current)==null||O.blur()},[g,u]),F7(t,()=>u.current,[u.current]);let k=Bx(O=>{y(O.target.value),r==null||r(O)},[r]),P=Bx(O=>{var _;v(g?null:O.currentTarget),(_=u.current)==null||_.focus()},[g,v,u]),T=Bx(([O,_])=>{!O||!_||(y(N_([O,_])),v(null))},[y,v]),C=A(U7,{children:A(Qr,{open:!0,children:Ee(oo,{children:[A(Gr,le(j({},f),{color:i?"danger":f.color,ref:t,size:"sm",value:h,onChange:k,disabled:o,required:d,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:W7,ref:u}},sx:{fontFamily:"monospace"},endDecorator:A(pr,{variant:"plain",onClick:P,children:A(ba,{})})})),x&&A(Gn,{onClickAway:()=>v(null),children:A(j7,{id:"date-range-picker-popper",open:!0,anchorEl:g,placement:"bottom-end",onMouseDown:O=>O.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],children:Ee(H7,{tabIndex:-1,role:"presentation",children:[A(fa,{rangeSelection:!0,defaultValue:b,onChange:T,minDate:s?new Date(s):void 0,maxDate:l?new Date(l):void 0,disableFuture:p,disablePast:c}),A(Bn,{sx:{p:1},children:A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{y(""),v(null)},children:"Clear"})})]})})})]})})});return n?Ee(qt,{required:d,disabled:o,error:i,size:"sm",children:[A(Jt,{children:n}),C,a&&A(Ft,{children:a})]}):C});zx.displayName="DateRangePicker";import{motion as G7}from"framer-motion";var q7=G7(Cm),J7=E(q7)(({theme:e})=>({padding:e.spacing(0,6,5)})),Iu=J7;Iu.displayName="DialogContent";var ly=Iu;import{motion as K7}from"framer-motion";var Y7=K7(Sm),X7=E(Y7)(({theme:e})=>({padding:e.spacing(4,6)})),_u=X7;_u.displayName="DialogTitle";var py=_u;import tG from"react";import{motion as Fx}from"framer-motion";var Z7=Fx(Em),$x=Z7;$x.displayName="Modal";var L_=E(jm)({padding:0}),wu=L_;wu.displayName="ModalDialog";var Q7=E(Fx(Vm))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),cy=Q7;cy.displayName="ModalClose";var eG=Fx(Um),Vx=eG;Vx.displayName="ModalOverflow";function jx(e){let n=e,{title:t,children:r}=n,o=Ce(n,["title","children"]);return Ee(L_,le(j({},o),{children:[A(cy,{}),A(py,{children:t}),A(ly,{children:r})]}))}jx.displayName="ModalFrame";var rG=E(wu,{name:"Dialog",slot:"Root"})({padding:0}),Hx=tG.forwardRef((e,t)=>{let s=e,{title:r,children:o,actions:n,fullscreen:i}=s,a=Ce(s,["title","children","actions","fullscreen"]);return Ee(rG,le(j({layout:i?"fullscreen":"center",ref:t},a),{children:[A(py,{children:r}),A(ly,{children:o}),A(Bn,{children:n})]}))});Hx.displayName="DialogFrame";import{motion as oG}from"framer-motion";var nG=oG(km),Du=e=>A(nG,j({},e));Du.displayName="Divider";import{motion as iG}from"framer-motion";var aG=iG(Dc),Ux=e=>{var n;let o=e,{children:t}=o,r=Ce(o,["children"]);return A(aG,le(j({},r),{slotProps:le(j({},r.slotProps),{content:le(j({},(n=r.slotProps)==null?void 0:n.content),{sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}})}),children:t}))};Ux.displayName="InsetDrawer";import{motion as sG}from"framer-motion";var lG=sG(Am),Wx=lG;Wx.displayName="Grid";function B_(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var pG=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uG={};function uy(e,t){return((t||uG).jsx?cG:pG).test(e)}var dG=/[ \t\n\f\r]/g;function Gx(e){return typeof e=="object"?e.type==="text"?z_(e.value):!1:z_(e)}function z_(e){return e.replace(dG,"")===""}var yi=class{constructor(t,r,o){this.property=t,this.normal=r,o&&(this.space=o)}};yi.prototype.property={};yi.prototype.normal={};yi.prototype.space=null;function qx(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 yi(r,o,t)}function Au(e){return e.toLowerCase()}var Br=class{constructor(t,r){this.property=t,this.attribute=r}};Br.prototype.space=null;Br.prototype.boolean=!1;Br.prototype.booleanish=!1;Br.prototype.overloadedBoolean=!1;Br.prototype.number=!1;Br.prototype.commaSeparated=!1;Br.prototype.spaceSeparated=!1;Br.prototype.commaOrSpaceSeparated=!1;Br.prototype.mustUseProperty=!1;Br.prototype.defined=!1;var Nu={};Cn(Nu,{boolean:()=>Ue,booleanish:()=>Dt,commaOrSpaceSeparated:()=>io,commaSeparated:()=>xa,number:()=>he,overloadedBoolean:()=>Jx,spaceSeparated:()=>dt});var fG=0,Ue=ks(),Dt=ks(),Jx=ks(),he=ks(),dt=ks(),xa=ks(),io=ks();function ks(){return 2**++fG}var Kx=Object.keys(Nu),Rs=class extends Br{constructor(t,r,o,n){let i=-1;if(super(t,r),F_(this,"space",n),typeof o=="number")for(;++i<Kx.length;){let a=Kx[i];F_(this,Kx[i],(o&Nu[a])===Nu[a])}}};Rs.prototype.defined=!0;function F_(e,t,r){r&&(e[t]=r)}var mG={}.hasOwnProperty;function Jo(e){let t={},r={},o;for(o in e.properties)if(mG.call(e.properties,o)){let n=e.properties[o],i=new Rs(o,e.transform(e.attributes||{},o),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,r[Au(o)]=o,r[Au(i.attribute)]=o}return new yi(t,r,e.space)}var Yx=Jo({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 Xx=Jo({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function dy(e,t){return t in e?e[t]:t}function fy(e,t){return dy(e,t.toLowerCase())}var Zx=Jo({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:fy,properties:{xmlns:null,xmlnsXLink:null}});var Qx=Jo({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:dt,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:he,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:dt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Dt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null}});var $_=Jo({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:fy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xa,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:dt,autoFocus:Ue,autoPlay:Ue,blocking:dt,capture:null,charSet:null,checked:Ue,cite:null,className:dt,cols:he,colSpan:null,content:null,contentEditable:Dt,controls:Ue,controlsList:dt,coords:he|xa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Jx,draggable:Dt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:dt,height:he,hidden:Ue,high:he,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:dt,itemRef:dt,itemScope:Ue,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:he,pattern:null,ping:dt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:dt,required:Ue,reversed:Ue,rows:he,rowSpan:he,sandbox:dt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Dt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:he,security:null,unselectable:null}});var V_=Jo({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:dy,properties:{about:io,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:xa,g2:xa,glyphName:xa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:io,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:io,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:io,rev:io,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:io,requiredFeatures:io,requiredFonts:io,requiredFormats:io,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:io,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:io,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:io,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}});var hG=/^data[-\w.:]+$/i,j_=/-[a-z]/g,yG=/[A-Z]/g;function eT(e,t){let r=Au(t),o=t,n=Br;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hG.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(j_,vG);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!j_.test(i)){let a=i.replace(yG,gG);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}n=Rs}return new n(o,t)}function gG(e){return"-"+e.toLowerCase()}function vG(e){return e.charAt(1).toUpperCase()}var tT={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 H_=qx([Xx,Yx,Zx,Qx,$_],"html"),my=qx([Xx,Yx,Zx,Qx,V_],"svg");function U_(e){return e.join(" ").trim()}var rT=ko(X_(),1),Z_=rT.default.default||rT.default;var hy=Q_("end"),sp=Q_("start");function Q_(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 oT(e){let t=sp(e),r=hy(e);if(t&&r)return{start:t,end:r}}function Ta(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ew(e.position):"start"in e||"end"in e?ew(e):"line"in e||"column"in e?nT(e):""}function nT(e){return tw(e&&e.line)+":"+tw(e&&e.column)}function ew(e){return nT(e&&e.start)+"-"+nT(e&&e.end)}function tw(e){return e&&typeof e=="number"?e:1}var $t=class extends Error{constructor(t,r,o){super(),typeof r=="string"&&(o=r,r=void 0);let n="",i={},a=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i=j({},r)),typeof t=="string"?n=t:!i.cause&&t&&(a=!0,n=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof o=="string"){let l=o.indexOf(":");l===-1?i.ruleId=o:(i.source=o.slice(0,l),i.ruleId=o.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){let l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}let s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.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=Ta(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}};$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;var iT={}.hasOwnProperty,DG=new Map,AG=/[A-Z]/g,NG=/-([a-z])/g,MG=new Set(["table","tbody","thead","tfoot","tr"]),LG=new Set(["td","th"]),rw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aT(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=UG(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=HG(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:H_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=ow(n,e,void 0);return i&&typeof i!="string"?i:n.create(e,n.Fragment,{children:i||void 0},void 0)}function ow(e,t,r){if(t.type==="element")return BG(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zG(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $G(e,t,r);if(t.type==="mdxjsEsm")return FG(e,t);if(t.type==="root")return VG(e,t,r);if(t.type==="text")return jG(e,t)}function BG(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 i=iw(e,t.tagName,!1),a=WG(e,t),s=lT(e,t);return MG.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Gx(l):!0})),nw(e,a,i,t),sT(a,s),e.ancestors.pop(),e.schema=o,e.create(t,i,a,r)}function zG(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)}Lu(e,t.position)}function FG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function $G(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 i=t.name===null?e.Fragment:iw(e,t.name,!0),a=GG(e,t),s=lT(e,t);return nw(e,a,i,t),sT(a,s),e.ancestors.pop(),e.schema=o,e.create(t,i,a,r)}function VG(e,t,r){let o={};return sT(o,lT(e,t)),e.create(t,e.Fragment,o,r)}function jG(e,t){return t.value}function nw(e,t,r,o){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=o)}function sT(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function HG(e,t,r){return o;function o(n,i,a,s){let p=Array.isArray(a.children)?r:t;return s?p(i,a,s):p(i,a)}}function UG(e,t){return r;function r(o,n,i,a){let s=Array.isArray(i.children),l=sp(o);return t(n,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function WG(e,t){let r={},o,n;for(n in t.properties)if(n!=="children"&&iT.call(t.properties,n)){let i=qG(e,n,t.properties[n]);if(i){let[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&LG.has(t.tagName)?o=s:r[a]=s}}if(o){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return r}function GG(e,t){let r={};for(let o of t.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){let i=o.data.estree.body[0];i.type;let a=i.expression;a.type;let s=a.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else Lu(e,t.position);else{let n=o.name,i;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,i=e.evaluater.evaluateExpression(s.expression)}else Lu(e,t.position);else i=o.value===null?!0:o.value;r[n]=i}return r}function lT(e,t){let r=[],o=-1,n=e.passKeys?new Map:DG;for(;++o<t.children.length;){let i=t.children[o],a;if(e.passKeys){let l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){let p=n.get(l)||0;a=l+"-"+p,n.set(l,p+1)}}let s=ow(e,i,a);s!==void 0&&r.push(s)}return r}function qG(e,t,r){let o=eT(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=o.commaSeparated?B_(r):U_(r)),o.property==="style"){let n=typeof r=="object"?r:JG(e,String(r));return e.stylePropertyNameCase==="css"&&(n=KG(n)),["style",n]}return[e.elementAttributeNameCase==="react"&&o.space?tT[o.property]||o.property:o.attribute,r]}}function JG(e,t){let r={};try{Z_(t,o)}catch(n){if(!e.ignoreInvalidStyle){let i=n,a=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=rw+"#cannot-parse-style-attribute",a}}return r;function o(n,i){let a=n;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(NG,XG)),r[a]=i}}function iw(e,t,r){let o;if(!r)o={type:"Literal",value:t};else if(t.includes(".")){let n=t.split("."),i=-1,a;for(;++i<n.length;){let s=uy(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}o=a}else o=uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(o.type==="Literal"){let n=o.value;return iT.call(e.components,n)?e.components[n]:n}if(e.evaluater)return e.evaluater.evaluateExpression(o);Lu(e)}function Lu(e,t){let r=new $t("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=rw+"#cannot-handle-mdx-estrees-without-createevaluater",r}function KG(e){let t={},r;for(r in e)iT.call(e,r)&&(t[YG(r)]=e[r]);return t}function YG(e){let t=e.replace(AG,ZG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XG(e,t){return t.toUpperCase()}function ZG(e){return"-"+e.toLowerCase()}var Bu={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 oJ,jsx as nJ,jsxs as iJ}from"react/jsx-runtime";var QG={};function pT(e,t){let r=t||QG,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return sw(e,o,n)}function sw(e,t,r){if(e8(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 aw(e.children,t,r)}return Array.isArray(e)?aw(e,t,r):""}function aw(e,t,r){let o=[],n=-1;for(;++n<e.length;)o[n]=sw(e[n],t,r);return o.join("")}function e8(e){return!!(e&&typeof e=="object")}var lw=document.createElement("i");function lp(e){let t="&"+e+";";lw.innerHTML=t;let r=lw.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function zr(e,t,r,o){let n=e.length,i=0,a;if(t<0?t=-t>n?0:n+t:t=t>n?n:t,r=r>0?r:0,o.length<1e4)a=Array.from(o),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);i<o.length;)a=o.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function qr(e,t){return e.length>0?(zr(e,e.length,0,t),e):t}var pw={}.hasOwnProperty;function cw(e){let t={},r=-1;for(;++r<e.length;)t8(t,e[r]);return t}function t8(e,t){let r;for(r in t){let n=(pw.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],a;if(i)for(a in i){pw.call(n,a)||(n[a]=[]);let s=i[a];r8(n[a],Array.isArray(s)?s:s?[s]:[])}}}function r8(e,t){let r=-1,o=[];for(;++r<t.length;)(t[r].add==="after"?e:o).push(t[r]);zr(e,0,0,o)}function yy(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 gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xo=Pa(/[A-Za-z]/),cr=Pa(/[\dA-Za-z]/),uw=Pa(/[#-'*+\--9=?A-Z^-~]/);function zu(e){return e!==null&&(e<32||e===127)}var Fu=Pa(/\d/),dw=Pa(/[\dA-Fa-f]/),fw=Pa(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}var mw=Pa(new RegExp("\\p{P}|\\p{S}","u")),hw=Pa(/\s/);function Pa(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ko(e){let t=[],r=-1,o=0,n=0;for(;++r<e.length;){let i=e.charCodeAt(r),a="";if(i===37&&cr(e.charCodeAt(r+1))&&cr(e.charCodeAt(r+2)))n=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let s=e.charCodeAt(r+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),n=1):a="\uFFFD"}else a=String.fromCharCode(i);a&&(t.push(e.slice(o,r),encodeURIComponent(a)),o=r+n+1,a=""),n&&(r+=n,n=0)}return t.join("")+e.slice(o)}function Je(e,t,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,i=0;return a;function a(l){return We(l)?(e.enter(r),s(l)):t(l)}function s(l){return We(l)&&i++<n?(e.consume(l),s):(e.exit(r),t(l))}}var yw={tokenize:o8};function o8(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"),Je(e,t,"linePrefix")}function n(s){return e.enter("paragraph"),i(s)}function i(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return De(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}var vw={tokenize:n8},gw={tokenize:i8};function n8(e){let t=this,r=[],o=0,n,i,a;return s;function s(b){if(o<r.length){let k=r[o];return t.containerState=k[1],e.attempt(k[0].continuation,l,p)(b)}return p(b)}function l(b){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,n&&x();let k=t.events.length,P=k,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}v(o);let C=k;for(;C<t.events.length;)t.events[C][1].end=Object.assign({},T),C++;return zr(t.events,P+1,0,t.events.slice(k)),t.events.length=C,p(b)}return s(b)}function p(b){if(o===r.length){if(!n)return f(b);if(n.currentConstruct&&n.currentConstruct.concrete)return h(b);t.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gw,c,d)(b)}function c(b){return n&&x(),v(o),f(b)}function d(b){return t.parser.lazy[t.now().line]=o!==r.length,a=t.now().offset,h(b)}function f(b){return t.containerState={},e.attempt(gw,u,h)(b)}function u(b){return o++,r.push([t.currentConstruct,t.containerState]),f(b)}function h(b){if(b===null){n&&x(),v(0),e.consume(b);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:n}),y(b)}function y(b){if(b===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(b);return}return De(b)?(e.consume(b),g(e.exit("chunkFlow")),o=0,t.interrupt=void 0,s):(e.consume(b),y)}function g(b,k){let P=t.sliceStream(b);if(k&&P.push(null),b.previous=i,i&&(i.next=b),i=b,n.defineSkip(b.start),n.write(P),t.parser.lazy[b.start.line]){let T=n.events.length;for(;T--;)if(n.events[T][1].start.offset<a&&(!n.events[T][1].end||n.events[T][1].end.offset>a))return;let C=t.events.length,S=C,O,_;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(O){_=t.events[S][1].end;break}O=!0}for(v(o),T=C;T<t.events.length;)t.events[T][1].end=Object.assign({},_),T++;zr(t.events,S+1,0,t.events.slice(C)),t.events.length=T}}function v(b){let k=r.length;for(;k-- >b;){let P=r[k];t.containerState=P[1],P[0].exit.call(t,e)}r.length=b}function x(){n.write([null]),i=void 0,n=void 0,t.containerState._closeFlow=void 0}}function i8(e,t,r){return Je(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cT(e){if(e===null||Vt(e)||hw(e))return 1;if(mw(e))return 2}function pp(e,t,r){let o=[],n=-1;for(;++n<e.length;){let i=e[n].resolveAll;i&&!o.includes(i)&&(t=i(t,r),o.push(i))}return t}var $u={name:"attention",tokenize:s8,resolveAll:a8};function a8(e,t){let r=-1,o,n,i,a,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 d=Object.assign({},e[o][1].end),f=Object.assign({},e[r][1].start);bw(d,-l),bw(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[r][1].start),end:f},i={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({},a.start),end:Object.assign({},s.end)},e[o][1].end=Object.assign({},a.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",a,t],["exit",a,t],["enter",i,t]]),p=qr(p,pp(t.parser.constructs.insideSpan.null,e.slice(o+1,r),t)),p=qr(p,[["exit",i,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,zr(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 s8(e,t){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=cT(o),i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;let p=e.exit("attentionSequence"),c=cT(l),d=!c||c===2&&n||r.includes(l),f=!n||n===2&&c||r.includes(o);return p._open=!!(i===42?d:d&&(n||!f)),p._close=!!(i===42?f:f&&(c||!d)),t(l)}}function bw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var uT={name:"autolink",tokenize:l8};function l8(e,t,r){let o=0;return n;function n(u){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(u){return xo(u)?(e.consume(u),a):p(u)}function a(u){return u===43||u===45||u===46||cr(u)?(o=1,s(u)):p(u)}function s(u){return u===58?(e.consume(u),o=0,l):(u===43||u===45||u===46||cr(u))&&o++<32?(e.consume(u),s):(o=0,p(u))}function l(u){return u===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.exit("autolink"),t):u===null||u===32||u===60||zu(u)?r(u):(e.consume(u),l)}function p(u){return u===64?(e.consume(u),c):uw(u)?(e.consume(u),p):r(u)}function c(u){return cr(u)?d(u):r(u)}function d(u){return u===46?(e.consume(u),o=0,c):u===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.exit("autolink"),t):f(u)}function f(u){if((u===45||cr(u))&&o++<63){let h=u===45?f:d;return e.consume(u),h}return r(u)}}var Ca={tokenize:p8,partial:!0};function p8(e,t,r){return o;function o(i){return We(i)?Je(e,n,"linePrefix")(i):n(i)}function n(i){return i===null||De(i)?t(i):r(i)}}var gy={name:"blockQuote",tokenize:c8,continuation:{tokenize:u8},exit:d8};function c8(e,t,r){let o=this;return n;function n(a){if(a===62){let s=o.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return r(a)}function i(a){return We(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function u8(e,t,r){let o=this;return n;function n(a){return We(a)?Je(e,i,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(gy,t,r)(a)}}function d8(e){e.exit("blockQuote")}var vy={name:"characterEscape",tokenize:f8};function f8(e,t,r){return o;function o(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n}function n(i){return fw(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var by={name:"characterReference",tokenize:m8};function m8(e,t,r){let o=this,n=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),i=31,a=cr,c(d))}function p(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=dw,c):(e.enter("characterReferenceValue"),i=7,a=Fu,c(d))}function c(d){if(d===59&&n){let f=e.exit("characterReferenceValue");return a===cr&&!lp(o.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&n++<i?(e.consume(d),c):r(d)}}var xw={tokenize:y8,partial:!0},xy={name:"codeFenced",tokenize:h8,concrete:!0};function h8(e,t,r){let o=this,n={tokenize:P,partial:!0},i=0,a=0,s;return l;function l(T){return p(T)}function p(T){let C=o.events[o.events.length-1];return i=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,s=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(T)}function c(T){return T===s?(a++,e.consume(T),c):a<3?r(T):(e.exit("codeFencedFenceSequence"),We(T)?Je(e,d,"whitespace")(T):d(T))}function d(T){return T===null||De(T)?(e.exit("codeFencedFence"),o.interrupt?t(T):e.check(xw,y,k)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(T))}function f(T){return T===null||De(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):We(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,u,"whitespace")(T)):T===96&&T===s?r(T):(e.consume(T),f)}function u(T){return T===null||De(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||De(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===s?r(T):(e.consume(T),h)}function y(T){return e.attempt(n,k,g)(T)}function g(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return i>0&&We(T)?Je(e,x,"linePrefix",i+1)(T):x(T)}function x(T){return T===null||De(T)?e.check(xw,y,k)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||De(T)?(e.exit("codeFlowValue"),x(T)):(e.consume(T),b)}function k(T){return e.exit("codeFenced"),t(T)}function P(T,C,S){let O=0;return _;function _(M){return T.enter("lineEnding"),T.consume(M),T.exit("lineEnding"),L}function L(M){return T.enter("codeFencedFence"),We(M)?Je(T,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):N(M)}function N(M){return M===s?(T.enter("codeFencedFenceSequence"),D(M)):S(M)}function D(M){return M===s?(O++,T.consume(M),D):O>=a?(T.exit("codeFencedFenceSequence"),We(M)?Je(T,$,"whitespace")(M):$(M)):S(M)}function $(M){return M===null||De(M)?(T.exit("codeFencedFence"),C(M)):S(M)}}}function y8(e,t,r){let o=this;return n;function n(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return o.parser.lazy[o.now().line]?r(a):t(a)}}var Vu={name:"codeIndented",tokenize:v8},g8={tokenize:b8,partial:!0};function v8(e,t,r){let o=this;return n;function n(p){return e.enter("codeIndented"),Je(e,i,"linePrefix",5)(p)}function i(p){let c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(p):r(p)}function a(p){return p===null?l(p):De(p)?e.attempt(g8,a,l)(p):(e.enter("codeFlowValue"),s(p))}function s(p){return p===null||De(p)?(e.exit("codeFlowValue"),a(p)):(e.consume(p),s)}function l(p){return e.exit("codeIndented"),t(p)}}function b8(e,t,r){let o=this;return n;function n(a){return o.parser.lazy[o.now().line]?r(a):De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n):Je(e,i,"linePrefix",5)(a)}function i(a){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):De(a)?n(a):r(a)}}var dT={name:"codeText",tokenize:P8,resolve:x8,previous:T8};function x8(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 T8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function P8(e,t,r){let o=this,n=0,i,a;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?(a=e.enter("codeTextSequence"),i=0,d(f)):De(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||De(f)?(e.exit("codeTextData"),p(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",c(f))}}var Ty=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 i=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&ju(this.left,o),i.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),ju(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ju(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);ju(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ju(this.left,r.reverse())}}};function ju(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 Py(e){let t={},r=-1,o,n,i,a,s,l,p,c=new Ty(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,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(o[0]==="enter")o[1].contentType&&(Object.assign(t,C8(c,r)),r=t[r],p=!0);else if(o[1]._container){for(i=r,n=void 0;i--&&(a=c.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(n&&(c.get(n)[1].type="lineEndingBlank"),a[1].type="lineEnding",n=i);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 zr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!p}function C8(e,t){let r=e.get(t)[1],o=e.get(t)[2],n=t-1,i=[],a=r._tokenizer||o.parser[r.contentType](r.start),s=a.events,l=[],p={},c,d,f=-1,u=r,h=0,y=0,g=[y];for(;u;){for(;e.get(++n)[1]!==u;);i.push(n),u._tokenizer||(c=o.sliceStream(u),u.next||c.push(null),d&&a.defineSkip(u.start),u._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),u._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=u,u=u.next}for(u=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&&(y=f+1,g.push(y),u._tokenizer=void 0,u.previous=void 0,u=u.next);for(a.events=[],u?(u._tokenizer=void 0,u.previous=void 0):g.pop(),f=g.length;f--;){let v=s.slice(g[f],g[f+1]),x=i.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),f=-1;++f<l.length;)p[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return p}var fT={tokenize:R8,resolve:k8},S8={tokenize:E8,partial:!0};function k8(e){return Py(e),e}function R8(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?i(s):De(s)?e.check(S8,a,i)(s):(e.consume(s),n)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function E8(e,t,r){let o=this;return n;function n(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Je(e,i,"linePrefix")}function i(a){if(a===null||De(a))return r(a);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(a):e.interrupt(o.parser.constructs.flow,r,t)(a)}}function Cy(e,t,r,o,n,i,a,s,l){let p=l||Number.POSITIVE_INFINITY,c=0;return d;function d(v){return v===60?(e.enter(o),e.enter(n),e.enter(i),e.consume(v),e.exit(i),f):v===null||v===32||v===41||zu(v)?r(v):(e.enter(o),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(v))}function f(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(n),e.exit(o),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),u(v))}function u(v){return v===62?(e.exit("chunkString"),e.exit(s),f(v)):v===null||v===60||De(v)?r(v):(e.consume(v),v===92?h:u)}function h(v){return v===60||v===62||v===92?(e.consume(v),u):u(v)}function y(v){return!c&&(v===null||v===41||Vt(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(o),t(v)):c<p&&v===40?(e.consume(v),c++,y):v===41?(e.consume(v),c--,y):v===null||v===32||v===40||zu(v)?r(v):(e.consume(v),v===92?g:y)}function g(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function Sy(e,t,r,o,n,i){let a=this,s=0,l;return p;function p(u){return e.enter(o),e.enter(n),e.consume(u),e.exit(n),e.enter(i),c}function c(u){return s>999||u===null||u===91||u===93&&!l||u===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):u===93?(e.exit(i),e.enter(n),e.consume(u),e.exit(n),e.exit(o),t):De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(u){return u===null||u===91||u===93||De(u)||s++>999?(e.exit("chunkString"),c(u)):(e.consume(u),l||(l=!We(u)),u===92?f:d)}function f(u){return u===91||u===92||u===93?(e.consume(u),s++,d):d(u)}}function ky(e,t,r,o,n,i){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(o),e.enter(n),e.consume(f),e.exit(n),a=f===40?41:f,l):r(f)}function l(f){return f===a?(e.enter(n),e.consume(f),e.exit(n),e.exit(o),t):(e.enter(i),p(f))}function p(f){return f===a?(e.exit(i),l(a)):f===null?r(f):De(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Je(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===a||f===null||De(f)?(e.exit("chunkString"),p(f)):(e.consume(f),f===92?d:c)}function d(f){return f===a||f===92?(e.consume(f),c):c(f)}}function Os(e,t){let r;return o;function o(n){return De(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,o):We(n)?Je(e,o,r?"linePrefix":"lineSuffix")(n):t(n)}}var mT={name:"definition",tokenize:I8},O8={tokenize:_8,partial:!0};function I8(e,t,r){let o=this,n;return i;function i(u){return e.enter("definition"),a(u)}function a(u){return Sy.call(o,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function s(u){return n=gi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),l):r(u)}function l(u){return Vt(u)?Os(e,p)(u):p(u)}function p(u){return Cy(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function c(u){return e.attempt(O8,d,d)(u)}function d(u){return We(u)?Je(e,f,"whitespace")(u):f(u)}function f(u){return u===null||De(u)?(e.exit("definition"),o.parser.defined.push(n),t(u)):r(u)}}function _8(e,t,r){return o;function o(s){return Vt(s)?Os(e,n)(s):r(s)}function n(s){return ky(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return We(s)?Je(e,a,"whitespace")(s):a(s)}function a(s){return s===null||De(s)?t(s):r(s)}}var hT={name:"hardBreakEscape",tokenize:w8};function w8(e,t,r){return o;function o(i){return e.enter("hardBreakEscape"),e.consume(i),n}function n(i){return De(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var yT={name:"headingAtx",tokenize:A8,resolve:D8};function D8(e,t){let r=e.length-2,o=3,n,i;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},i={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},zr(e,o,r-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e}function A8(e,t,r){let o=0;return n;function n(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&o++<6?(e.consume(c),a):c===null||Vt(c)?(e.exit("atxHeadingSequence"),s(c)):r(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||De(c)?(e.exit("atxHeading"),t(c)):We(c)?Je(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||Vt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),p)}}var Tw=["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"],gT=["pre","script","style","textarea"];var vT={name:"htmlFlow",tokenize:B8,resolveTo:L8,concrete:!0},N8={tokenize:F8,partial:!0},M8={tokenize:z8,partial:!0};function L8(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 B8(e,t,r){let o=this,n,i,a,s,l;return p;function p(w){return c(w)}function c(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),f):w===47?(e.consume(w),i=!0,y):w===63?(e.consume(w),n=3,o.interrupt?t:R):xo(w)?(e.consume(w),a=String.fromCharCode(w),g):r(w)}function f(w){return w===45?(e.consume(w),n=2,u):w===91?(e.consume(w),n=5,s=0,h):xo(w)?(e.consume(w),n=4,o.interrupt?t:R):r(w)}function u(w){return w===45?(e.consume(w),o.interrupt?t:R):r(w)}function h(w){let ue="CDATA[";return w===ue.charCodeAt(s++)?(e.consume(w),s===ue.length?o.interrupt?t:N:h):r(w)}function y(w){return xo(w)?(e.consume(w),a=String.fromCharCode(w),g):r(w)}function g(w){if(w===null||w===47||w===62||Vt(w)){let ue=w===47,ve=a.toLowerCase();return!ue&&!i&&gT.includes(ve)?(n=1,o.interrupt?t(w):N(w)):Tw.includes(a.toLowerCase())?(n=6,ue?(e.consume(w),v):o.interrupt?t(w):N(w)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(w):i?x(w):b(w))}return w===45||cr(w)?(e.consume(w),a+=String.fromCharCode(w),g):r(w)}function v(w){return w===62?(e.consume(w),o.interrupt?t:N):r(w)}function x(w){return We(w)?(e.consume(w),x):_(w)}function b(w){return w===47?(e.consume(w),_):w===58||w===95||xo(w)?(e.consume(w),k):We(w)?(e.consume(w),b):_(w)}function k(w){return w===45||w===46||w===58||w===95||cr(w)?(e.consume(w),k):P(w)}function P(w){return w===61?(e.consume(w),T):We(w)?(e.consume(w),P):b(w)}function T(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),l=w,C):We(w)?(e.consume(w),T):S(w)}function C(w){return w===l?(e.consume(w),l=null,O):w===null||De(w)?r(w):(e.consume(w),C)}function S(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Vt(w)?P(w):(e.consume(w),S)}function O(w){return w===47||w===62||We(w)?b(w):r(w)}function _(w){return w===62?(e.consume(w),L):r(w)}function L(w){return w===null||De(w)?N(w):We(w)?(e.consume(w),L):r(w)}function N(w){return w===45&&n===2?(e.consume(w),I):w===60&&n===1?(e.consume(w),B):w===62&&n===4?(e.consume(w),X):w===63&&n===3?(e.consume(w),R):w===93&&n===5?(e.consume(w),F):De(w)&&(n===6||n===7)?(e.exit("htmlFlowData"),e.check(N8,ie,D)(w)):w===null||De(w)?(e.exit("htmlFlowData"),D(w)):(e.consume(w),N)}function D(w){return e.check(M8,$,ie)(w)}function $(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),M}function M(w){return w===null||De(w)?D(w):(e.enter("htmlFlowData"),N(w))}function I(w){return w===45?(e.consume(w),R):N(w)}function B(w){return w===47?(e.consume(w),a="",q):N(w)}function q(w){if(w===62){let ue=a.toLowerCase();return gT.includes(ue)?(e.consume(w),X):N(w)}return xo(w)&&a.length<8?(e.consume(w),a+=String.fromCharCode(w),q):N(w)}function F(w){return w===93?(e.consume(w),R):N(w)}function R(w){return w===62?(e.consume(w),X):w===45&&n===2?(e.consume(w),R):N(w)}function X(w){return w===null||De(w)?(e.exit("htmlFlowData"),ie(w)):(e.consume(w),X)}function ie(w){return e.exit("htmlFlow"),t(w)}}function z8(e,t,r){let o=this;return n;function n(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):r(a)}function i(a){return o.parser.lazy[o.now().line]?r(a):t(a)}}function F8(e,t,r){return o;function o(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(Ca,t,r)}}var bT={name:"htmlText",tokenize:$8};function $8(e,t,r){let o=this,n,i,a;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),P):R===63?(e.consume(R),b):xo(R)?(e.consume(R),S):r(R)}function p(R){return R===45?(e.consume(R),c):R===91?(e.consume(R),i=0,h):xo(R)?(e.consume(R),x):r(R)}function c(R){return R===45?(e.consume(R),u):r(R)}function d(R){return R===null?r(R):R===45?(e.consume(R),f):De(R)?(a=d,B(R)):(e.consume(R),d)}function f(R){return R===45?(e.consume(R),u):d(R)}function u(R){return R===62?I(R):R===45?f(R):d(R)}function h(R){let X="CDATA[";return R===X.charCodeAt(i++)?(e.consume(R),i===X.length?y:h):r(R)}function y(R){return R===null?r(R):R===93?(e.consume(R),g):De(R)?(a=y,B(R)):(e.consume(R),y)}function g(R){return R===93?(e.consume(R),v):y(R)}function v(R){return R===62?I(R):R===93?(e.consume(R),v):y(R)}function x(R){return R===null||R===62?I(R):De(R)?(a=x,B(R)):(e.consume(R),x)}function b(R){return R===null?r(R):R===63?(e.consume(R),k):De(R)?(a=b,B(R)):(e.consume(R),b)}function k(R){return R===62?I(R):b(R)}function P(R){return xo(R)?(e.consume(R),T):r(R)}function T(R){return R===45||cr(R)?(e.consume(R),T):C(R)}function C(R){return De(R)?(a=C,B(R)):We(R)?(e.consume(R),C):I(R)}function S(R){return R===45||cr(R)?(e.consume(R),S):R===47||R===62||Vt(R)?O(R):r(R)}function O(R){return R===47?(e.consume(R),I):R===58||R===95||xo(R)?(e.consume(R),_):De(R)?(a=O,B(R)):We(R)?(e.consume(R),O):I(R)}function _(R){return R===45||R===46||R===58||R===95||cr(R)?(e.consume(R),_):L(R)}function L(R){return R===61?(e.consume(R),N):De(R)?(a=L,B(R)):We(R)?(e.consume(R),L):O(R)}function N(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),n=R,D):De(R)?(a=N,B(R)):We(R)?(e.consume(R),N):(e.consume(R),$)}function D(R){return R===n?(e.consume(R),n=void 0,M):R===null?r(R):De(R)?(a=D,B(R)):(e.consume(R),D)}function $(R){return R===null||R===34||R===39||R===60||R===61||R===96?r(R):R===47||R===62||Vt(R)?O(R):(e.consume(R),$)}function M(R){return R===47||R===62||Vt(R)?O(R):r(R)}function I(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"),q}function q(R){return We(R)?Je(e,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):F(R)}function F(R){return e.enter("htmlTextData"),a(R)}}var Is={name:"labelEnd",tokenize:G8,resolveTo:W8,resolveAll:U8},V8={tokenize:q8},j8={tokenize:J8},H8={tokenize:K8};function U8(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 W8(e,t){let r=e.length,o=0,n,i,a,s;for(;r--;)if(n=e[r][1],i){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;e[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(a){if(e[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(i=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(a=r);let l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[a][1].end)},c={type:"labelText",start:Object.assign({},e[i+o+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",l,t],["enter",p,t]],s=qr(s,e.slice(i+1,i+o+3)),s=qr(s,[["enter",c,t]]),s=qr(s,pp(t.parser.constructs.insideSpan.null,e.slice(i+o+4,a-3),t)),s=qr(s,[["exit",c,t],e[a-2],e[a-1],["exit",p,t]]),s=qr(s,e.slice(a+1)),s=qr(s,[["exit",l,t]]),zr(e,i,e.length,s),e}function G8(e,t,r){let o=this,n=o.events.length,i,a;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){i=o.events[n][1];break}return s;function s(f){return i?i._inactive?d(f):(a=o.parser.defined.includes(gi(o.sliceSerialize({start:i.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(V8,c,a?c:d)(f):f===91?e.attempt(j8,c,a?p:d)(f):a?c(f):d(f)}function p(f){return e.attempt(H8,c,d)(f)}function c(f){return t(f)}function d(f){return i._balanced=!0,r(f)}}function q8(e,t,r){return o;function o(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),n}function n(d){return Vt(d)?Os(e,i)(d):i(d)}function i(d){return d===41?c(d):Cy(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Vt(d)?Os(e,l)(d):c(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?ky(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function p(d){return Vt(d)?Os(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function J8(e,t,r){let o=this;return n;function n(s){return Sy.call(o,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return o.parser.defined.includes(gi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function a(s){return r(s)}}function K8(e,t,r){return o;function o(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n}function n(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var xT={name:"labelStartImage",tokenize:Y8,resolveAll:Is.resolveAll};function Y8(e,t,r){let o=this;return n;function n(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):t(s)}}var TT={name:"labelStartLink",tokenize:X8,resolveAll:Is.resolveAll};function X8(e,t,r){let o=this;return n;function n(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(a):t(a)}}var Hu={name:"lineEnding",tokenize:Z8};function Z8(e,t){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Je(e,t,"linePrefix")}}var _s={name:"thematicBreak",tokenize:Q8};function Q8(e,t,r){let o=0,n;return i;function i(p){return e.enter("thematicBreak"),a(p)}function a(p){return n=p,s(p)}function s(p){return p===n?(e.enter("thematicBreakSequence"),l(p)):o>=3&&(p===null||De(p))?(e.exit("thematicBreak"),t(p)):r(p)}function l(p){return p===n?(e.consume(p),o++,l):(e.exit("thematicBreakSequence"),We(p)?Je(e,s,"whitespace")(p):s(p))}}var Fr={name:"list",tokenize:rq,continuation:{tokenize:oq},exit:iq},eq={tokenize:aq,partial:!0},tq={tokenize:nq,partial:!0};function rq(e,t,r){let o=this,n=o.events[o.events.length-1],i=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,a=0;return s;function s(u){let h=o.containerState.type||(u===42||u===43||u===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||u===o.containerState.marker:Fu(u)){if(o.containerState.type||(o.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),u===42||u===45?e.check(_s,r,p)(u):p(u);if(!o.interrupt||u===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(u)}return r(u)}function l(u){return Fu(u)&&++a<10?(e.consume(u),l):(!o.interrupt||a<2)&&(o.containerState.marker?u===o.containerState.marker:u===41||u===46)?(e.exit("listItemValue"),p(u)):r(u)}function p(u){return e.enter("listItemMarker"),e.consume(u),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||u,e.check(Ca,o.interrupt?r:c,e.attempt(eq,f,d))}function c(u){return o.containerState.initialBlankLine=!0,i++,f(u)}function d(u){return We(u)?(e.enter("listItemPrefixWhitespace"),e.consume(u),e.exit("listItemPrefixWhitespace"),f):r(u)}function f(u){return o.containerState.size=i+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(u)}}function oq(e,t,r){let o=this;return o.containerState._closeFlow=void 0,e.check(Ca,n,i);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Je(e,t,"listItemIndent",o.containerState.size+1)(s)}function i(s){return o.containerState.furtherBlankLines||!We(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,a(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(tq,t,a)(s))}function a(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Je(e,e.attempt(Fr,t,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function nq(e,t,r){let o=this;return Je(e,n,"listItemIndent",o.containerState.size+1);function n(i){let a=o.events[o.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===o.containerState.size?t(i):r(i)}}function iq(e){e.exit(this.containerState.type)}function aq(e,t,r){let o=this;return Je(e,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(i){let a=o.events[o.events.length-1];return!We(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var Ry={name:"setextUnderline",tokenize:lq,resolveTo:sq};function sq(e,t){let r=e.length,o,n,i;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),!i&&e[r][1].type==="definition"&&(i=r);let a={type:"setextHeading",start:Object.assign({},e[n][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[n][1].type="setextHeadingText",i?(e.splice(n,0,["enter",a,t]),e.splice(i+1,0,["exit",e[o][1],t]),e[o][1].end=Object.assign({},e[i][1].end)):e[o][1]=a,e.push(["exit",a,t]),e}function lq(e,t,r){let o=this,n;return i;function i(p){let c=o.events.length,d;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){d=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||d)?(e.enter("setextHeadingLine"),n=p,a(p)):r(p)}function a(p){return e.enter("setextHeadingLineSequence"),s(p)}function s(p){return p===n?(e.consume(p),s):(e.exit("setextHeadingLineSequence"),We(p)?Je(e,l,"lineSuffix")(p):l(p))}function l(p){return p===null||De(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}var Pw={tokenize:pq};function pq(e){let t=this,r=e.attempt(Ca,o,e.attempt(this.parser.constructs.flowInitial,n,Je(e,e.attempt(this.parser.constructs.flow,n,e.attempt(fT,n)),"linePrefix")));return r;function o(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function n(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var Cw={resolveAll:Ew()},Sw=Rw("string"),kw=Rw("text");function Rw(e){return{tokenize:t,resolveAll:Ew(e==="text"?cq:void 0)};function t(r){let o=this,n=this.parser.constructs[e],i=r.attempt(n,a,s);return a;function a(c){return p(c)?i(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"),i(c)):(r.consume(c),l)}function p(c){if(c===null)return!0;let d=n[c],f=-1;if(d)for(;++f<d.length;){let u=d[f];if(!u.previous||u.previous.call(o,o.previous))return!0}return!1}}}function Ew(e){return t;function t(r,o){let n=-1,i;for(;++n<=r.length;)i===void 0?r[n]&&r[n][1].type==="data"&&(i=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),n=i+2),i=void 0);return e?e(r,o):r}}function cq(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),i=n.length,a=-1,s=0,l;for(;i--;){let p=n[i];if(typeof p=="string"){for(a=p.length;p.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(p===-2)l=!0,s++;else if(p!==-1){i++;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+i,_bufferIndex:i?a:o.start._bufferIndex+a},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 Ow(e,t,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},i=[],a=[],s=[],l=!0,p={consume:k,enter:P,exit:T,attempt:O(C),check:O(S),interrupt:O(S,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:y,sliceSerialize:h,now:g,defineSkip:v,write:u},d=t.tokenize.call(c,p),f;return t.resolveAll&&i.push(t),c;function u(D){return a=qr(a,D),x(),a[a.length-1]!==null?[]:(_(t,0),c.events=pp(i,c.events,c),c.events)}function h(D,$){return dq(y(D),$)}function y(D){return uq(a,D)}function g(){let{line:D,column:$,offset:M,_index:I,_bufferIndex:B}=o;return{line:D,column:$,offset:M,_index:I,_bufferIndex:B}}function v(D){n[D.line]=D.column,N()}function x(){let D;for(;o._index<a.length;){let $=a[o._index];if(typeof $=="string")for(D=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===D&&o._bufferIndex<$.length;)b($.charCodeAt(o._bufferIndex));else b($)}}function b(D){l=void 0,f=D,d=d(D)}function k(D){De(D)?(o.line++,o.column=1,o.offset+=D===-3?2:1,N()):D!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===a[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=D,l=!0}function P(D,$){let M=$||{};return M.type=D,M.start=g(),c.events.push(["enter",M,c]),s.push(M),M}function T(D){let $=s.pop();return $.end=g(),c.events.push(["exit",$,c]),$}function C(D,$){_(D,$.from)}function S(D,$){$.restore()}function O(D,$){return M;function M(I,B,q){let F,R,X,ie;return Array.isArray(I)?ue(I):"tokenize"in I?ue([I]):w(I);function w(U){return fe;function fe(me){let Re=me!==null&&U[me],Te=me!==null&&U.null,$e=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return ue($e)(me)}}function ue(U){return F=U,R=0,U.length===0?q:ve(U[R])}function ve(U){return fe;function fe(me){return ie=L(),X=U,U.partial||(c.currentConstruct=U),U.name&&c.parser.constructs.disable.null.includes(U.name)?ae(me):U.tokenize.call($?Object.assign(Object.create(c),$):c,p,Me,ae)(me)}}function Me(U){return l=!0,D(X,ie),B}function ae(U){return l=!0,ie.restore(),++R<F.length?ve(F[R]):q}}}function _(D,$){D.resolveAll&&!i.includes(D)&&i.push(D),D.resolve&&zr(c.events,$,c.events.length-$,D.resolve(c.events.slice($),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function L(){let D=g(),$=c.previous,M=c.currentConstruct,I=c.events.length,B=Array.from(s);return{restore:q,from:I};function q(){o=D,c.previous=$,c.currentConstruct=M,c.events.length=I,s=B,N()}}function N(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function uq(e,t){let r=t.start._index,o=t.start._bufferIndex,n=t.end._index,i=t.end._bufferIndex,a;if(r===n)a=[e[r].slice(o,i)];else{if(a=e.slice(r,n),o>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(o):a.shift()}i>0&&a.push(e[n].slice(0,i))}return a}function dq(e,t){let r=-1,o=[],n;for(;++r<e.length;){let i=e[r],a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
127
+ `),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function K6(e){e=J6(e);var t=e.decimalSeparator,r=e.allowedDecimalSeparators,o=e.thousandsGroupStyle,n=e.suffix,i=e.allowNegative,a=e.allowLeadingZeros,s=e.onKeyDown;s===void 0&&(s=ma);var l=e.onBlur;l===void 0&&(l=ma);var p=e.thousandSeparator,c=e.decimalScale,d=e.fixedDecimalScale,f=e.prefix;f===void 0&&(f="");var u=e.defaultValue,h=e.value,y=e.valueIsNumericString,g=e.onValueChange,v=r_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=qh(e),b=x.decimalSeparator,k=x.allowedDecimalSeparators,P=function(F){return e_(F,e)},T=function(F,R){return G6(F,R,e)},C=ep(h)?u:h,S=y!=null?y:W6(C,f,n);ep(h)?ep(u)||(S=S||typeof u=="number"):S=S||typeof h=="number";var O=function(F){return o_(F)?F:(typeof F=="number"&&(F=a_(F)),S&&typeof c=="number"?ZI(F,c,!!d):F)},_=l_(O(h),O(u),!!S,P,T,g),L=_[0],N=L.numAsString,D=L.formattedValue,$=_[1],M=function(F){var R=F.target,X=F.key,ie=R.selectionStart,w=R.selectionEnd,ue=R.value;if(ue===void 0&&(ue=""),ie!==w){s(F);return}X==="Backspace"&&ue[0]==="-"&&ie===f.length+1&&i&&Ss(R,1),c&&d&&(X==="Backspace"&&ue[ie-1]===b?(Ss(R,ie-1),F.preventDefault()):X==="Delete"&&ue[ie]===b&&F.preventDefault()),k!=null&&k.includes(X)&&ue[ie]===b&&Ss(R,ie+1);var ve=p===!0?",":p;X==="Backspace"&&ue[ie-1]===ve&&Ss(R,ie-1),X==="Delete"&&ue[ie]===ve&&Ss(R,ie+1),s(F)},I=function(F){var R=N;if(R.match(/\d/g)||(R=""),a||(R=A6(R)),d&&c&&(R=ZI(R,c,d)),R!==N){var X=e_(R,e);$({formattedValue:X,value:R,floatValue:parseFloat(R)},{event:F,source:yu.event})}l(F)},B=function(F){return F===b?!0:gu(F)},q=function(F){var R=F.currentValue,X=F.lastValue,ie=F.formattedValue,w=F.currentValueIndex,ue=F.formattedValueIndex,ve=R[w],Me=ie[ue],ae=s_(X,R),U=ae.to;return w>=U.start&&w<U.end&&k&&k.includes(ve)&&Me===b?!0:ve===Me};return Object.assign(Object.assign({},v),{value:D,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:q,onValueChange:$,format:P,removeFormatting:T,getCaretBoundary:function(F){return q6(F,e)},onKeyDown:M,onBlur:I})}function p_(e){var t=K6(e);return Ql.createElement(j6,Object.assign({},t))}import Y6 from"react";import{motion as X6}from"framer-motion";var Z6=X6(pm),vu=Y6.forwardRef((e,t)=>{var u;let f=e,{label:r,helperText:o,error:n,style:i,size:a,color:s,disabled:l,required:p}=f,c=Ce(f,["label","helperText","error","style","size","color","disabled","required"]),d=A(Z6,j({required:p,color:n?"danger":s,size:a,disabled:l,slotProps:j({input:j({ref:t},(u=c.slotProps)==null?void 0:u.input)},c.slotProps)},c));return r?Ee(qt,{required:p,color:s,size:a,error:n,disabled:l,children:[A(Jt,{children:r}),d,o&&A(Ft,{children:o})]}):d});vu.displayName="Input";var Gr=vu;var Q6={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 YI(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split(""),i=Q6[e];return{symbol:`${t} `,thousandSeparator:r,decimalSeparator:o,placeholder:o?`${t} 0${o}${Array.from(Array(i)).map(()=>0).join("")}`:`${t} 0`,fixedDecimalScale:!!o,decimalScale:i}};var t7=f_.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(p_,le(j({},n),{onValueChange:({value:a})=>{o==null||o({target:{name:t.name,value:a}})},valueIsNumericString:!0,getInputRef:r,allowNegative:!1}))}),Jh=f_.forwardRef(function(t,r){let L=t,{currency:o="USD",name:n,onChange:i,label:a,error:s,helperText:l,required:p,disabled:c,useMinorUnit:d}=L,f=Ce(L,["currency","name","onChange","label","error","helperText","required","disabled","useMinorUnit"]),{symbol:u,thousandSeparator:h,decimalSeparator:y,placeholder:g,fixedDecimalScale:v,decimalScale:x}=c_(o),[b,k]=d_(t.value),P=u_(()=>b&&d?b/Math.pow(10,x):b,[b,d,x]),T=u_(()=>t.max&&d?t.max/Math.pow(10,x):t.max,[t.max,d,x]),[C,S]=d_(!!T&&!!P&&P>T),O=e7(N=>{var $;let D=Number(d?($=N.target.value)==null?void 0:$.replace(y,""):N.target.value);T&&Number(N.target.value)>T?S(!0):S(!1),k(D),i==null||i(le(j({},N),{target:{name:n,value:D}}))},[y,T,n,i,d]),_=A(Gr,le(j({},f),{size:"sm",ref:r,value:P,placeholder:g,onChange:O,disabled:c,required:p,color:s||C?"danger":t.color,slotProps:{input:{component:t7,decimalSeparator:y,thousandSeparator:h,prefix:u,fixedDecimalScale:v,decimalScale:x,"aria-label":f["aria-label"]}},sx:{fontFamily:"monospace"}}));return a?Ee(qt,{size:"sm",disabled:c,required:p,error:s||C,children:[A(Jt,{children:a}),_,C?A(Ft,{children:new Gh(`limit: {amount, number, ::currency/${o} unit-width-narrow}`).format({amount:T})}):l&&A(Ft,{children:l})]}):_});var m_=Jh;import O7,{useCallback as ap,useEffect as sy,useMemo as no,useRef as I_,useState as __,useId as I7}from"react";import{motion as r7}from"framer-motion";var o7=r7(Ym),bu=o7;bu.displayName="Sheet";var qo=bu;var xu=e=>{let o=e,{children:t}=o,r=Ce(o,["children"]);return A(rh,le(j({},r),{children:t}))};xu.displayName="Table";function Ex(e){let{headCells:t,showCheckbox:r,onCheckboxChange:o,slots:{checkbox:n=pu}={},slotProps:{checkbox:i={}}={}}=e;return A("thead",{children:Ee("tr",{children:[r&&A("th",{style:{width:"40px",textAlign:"center"},children:A(n,j({onChange:o},i))}),t.map(a=>A("th",{style:{width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth,textAlign:a.numeric?"right":"left"},children:a.label},a.label))]})})}Ex.displayName="TableHead";function Ox(e){let{rows:t,cellOrder:r,rowOptions:o,showCheckbox:n,onCheckboxChange:i,slots:{checkbox:a=pu}={},slotProps:{checkbox:s={}}={}}=e;return A("tbody",{children:t.map((l,p)=>Ee("tr",{children:[n&&A("td",{style:{textAlign:"center"},children:A(a,j({onChange:c=>i==null?void 0:i(c,p)},s))}),r.map(c=>{var d;return A("td",{style:{textAlign:(d=o==null?void 0:o[c])!=null&&d.numeric?"right":"left"},children:l[c]},c)})]},p))})}Ox.displayName="TableBody";import f7,{forwardRef as m7,useCallback as x_,useEffect as T_,useImperativeHandle as h7,useRef as y7,useState as P_}from"react";function bo(e){return typeof e=="string"||e instanceof String}function Ix(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function _x(e,t){return Array.isArray(t)?_x(e,(r,o)=>t.includes(o)):Object.entries(e).reduce((r,o)=>{let[n,i]=o;return t(i,n)&&(r[n]=i),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 Kh(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function tp(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(!tp(t[n],e[n]))return!1;return!0}if(r!=o)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){let i=t instanceof Date,a=e instanceof Date;if(i&&a)return t.getTime()==e.getTime();if(i!=a)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(!tp(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 Yh=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 Pe(e,t){return new Pe.InputMask(e,t)}function Dx(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?Pe.MaskedRegExp:bo(e)?Pe.MaskedPattern:e===Date?Pe.MaskedDate:e===Number?Pe.MaskedNumber:Array.isArray(e)||e===Array?Pe.MaskedDynamic:Pe.Masked&&e.prototype instanceof Pe.Masked?e:Pe.Masked&&e instanceof Pe.Masked?e.constructor:e instanceof Function?Pe.MaskedFunction:(console.warn("Mask not found for mask",e),Pe.Masked)}function fi(e){if(!e)throw new Error("Options in not defined");if(Pe.Masked){if(e.prototype instanceof Pe.Masked)return{mask:e};let t=e instanceof Pe.Masked?{mask:e}:Ix(e)&&e.mask instanceof Pe.Masked?e:{},{mask:r=void 0}=t,o=Ce(t,["mask"]);if(r){let n=r.mask;return j(le(j({},_x(r,(i,a)=>!a.startsWith("_"))),{mask:r.constructor,_mask:n}),o)}}return Ix(e)?j({},e):{mask:e}}function Mr(e){if(Pe.Masked&&e instanceof Pe.Masked)return e;let t=fi(e),r=Dx(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)}Pe.createMask=Mr;var ha=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}};Pe.MaskElement=ha;var h_=90,n7=89,mi=class extends ha{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===h_&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===n7&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===h_&&(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={}}};Pe.HTMLMaskElement=mi;var Tu=class extends mi{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}};Pe.HTMLMaskElement=mi;var rp=class extends mi{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,i=n.getSelection&&n.getSelection();i&&(i.removeAllRanges(),i.addRange(o))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}};Pe.HTMLContenteditableMaskElement=rp;var Pu=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}};Pu.MAX_LENGTH=100;var Xh=class{constructor(t,r){this.el=t instanceof ha?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new rp(t):new Tu(t),this.masked=Mr(r),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Pu,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 Pe.Masked)&&this.masked.constructor===Dx(t)){this.masked.updateOptions({mask:t});return}let r=t instanceof Pe.Masked?t:Mr({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,i=this.displayValue,a=this.unmaskedValue!==r||this.value!==o||this._rawInputValue!==n;this._unmaskedValue=r,this._value=o,this._rawInputValue=n,this.el.value!==i&&(this.el.value=i),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),a&&this._fireChangeEvents(),!this._historyChanging&&(a||this.history.isEmpty)&&this.history.push({unmaskedValue:r,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){let a=t,{mask:r}=a,o=Ce(a,["mask"]),n=!this.maskEquals(r),i=this.masked.optionsIsChanged(o);n&&(this.mask=r),i&&this.masked.updateOptions(o),(n||i)&&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 Yh({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,i=o===this.masked.rawInputValue?r.removeDirection:we.NONE,a=this.masked.nearestInputPos(r.startChangePos+n,i);i!==we.NONE&&(a=this.masked.nearestInputPos(a,we.NONE)),this.updateControl(a),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}};Pe.InputMask=Xh;var Fe=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}};Pe.ChangeDetails=Fe;var Lr=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 Kt=class e{constructor(t){this._value="",this._update(j(j({},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 Lr(this.extractInput(t,r),t)}appendTail(t){return bo(t)&&(t=new Lr(String(t))),t.appendTo(this)}_appendCharRaw(t,r){return t?(this._value+=t,new Fe({inserted:t,rawInserted:t})):new Fe}_appendChar(t,r,o){r===void 0&&(r={});let n=this.state,i;if([t,i]=this.doPrepareChar(t,r),t&&(i=i.aggregate(this._appendCharRaw(t,r)),!i.rawInserted&&this.autofix==="pad")){let a=this.state;this.state=n;let s=this.pad(r),l=this._appendCharRaw(t,r);s=s.aggregate(l),l.rawInserted||s.equals(i)?i=s:this.state=a}if(i.inserted){let a,s=this.doValidate(r)!==!1;if(s&&o!=null){let l=this.state;if(this.overwrite===!0){a=o.state;for(let c=0;c<i.rawInserted.length;++c)o.unshift(this.displayValue.length-i.tailShift)}let p=this.appendTail(o);if(s=p.rawInserted.length===o.toString().length,!(s&&p.inserted)&&this.overwrite==="shift"){this.state=l,a=o.state;for(let c=0;c<i.rawInserted.length;++c)o.shift();p=this.appendTail(o),s=p.rawInserted.length===o.toString().length}s&&p.inserted&&(this.state=l)}s||(i=new Fe,this.state=n,o&&a&&(o.state=a))}return i}_appendPlaceholder(){return new Fe}_appendEager(){return new Fe}append(t,r,o){if(!bo(t))throw new Error("value should be string");let n=bo(o)?new Lr(String(o)):o;r!=null&&r.tail&&(r._beforeTailState=this.state);let i;[t,i]=this.doPrepare(t,r);for(let a=0;a<t.length;++a){let s=this._appendChar(t[a],r,n);if(!s.rawInserted&&!this.doSkipInvalid(t[a],r,n))break;i.aggregate(s)}return(this.eager===!0||this.eager==="append")&&r!=null&&r.input&&t&&i.aggregate(this._appendEager()),n!=null&&(i.tailShift+=this.appendTail(n).tailShift),i}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 Fe}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={}),Fe.normalize(this.prepare?this.prepare(t,this,r):t)}doPrepareChar(t,r){return r===void 0&&(r={}),Fe.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,i){o===void 0&&(o=""),n===void 0&&(n=we.NONE),i===void 0&&(i={input:!0});let a=t+r,s=this.extractTail(a),l=this.eager===!0||this.eager==="remove",p;l&&(n=wx(n),p=this.extractInput(0,a,{raw:!0}));let c=t,d=new Fe;if(n!==we.NONE&&(c=this.nearestInputPos(t,r>1&&t!==0&&!l?we.NONE:n),d.tailShift=c-t),d.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);)d.aggregate(new Fe({tailShift:-1})).aggregate(this.remove(f-1))}else n===we.FORCE_RIGHT&&s.unshift();return d.aggregate(this.append(o,i,s))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!tp(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 Fe}};Kt.DEFAULTS={skipInvalid:!0};Kt.EMPTY_VALUES=[void 0,null,""];Pe.Masked=Kt;var op=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=bo(t)?new Lr(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 Lr)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 Pe.MaskedPattern))return new Lr(this.toString()).appendTo(t);let r=new Fe;for(let o=0;o<this.chunks.length;++o){let n=this.chunks[o],i=t._mapPosToBlock(t.displayValue.length),a=n.stop,s;if(a!=null&&(!i||i.index<=a)&&((n instanceof e||t._stops.indexOf(a)>=0)&&r.aggregate(t._appendPlaceholder(a)),s=n instanceof e&&t._blocks[a]),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=Ce(n,["chunks"]);Object.assign(this,o),this.chunks=r.map(i=>{let a="chunks"in i?new e:new Lr;return a.state=i,a})}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],i=n.unshift(r);if(n.toString()){if(!i)break;++o}else this.chunks.splice(o,1);if(i)return i}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 Zh=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 np=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 Fe}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 Fe;let o=this.eager===!0||this.eager==="append",i=this.char===t&&(this.isUnmasking||r.input||r.raw)&&(!r.raw||!o)&&!r.tail,a=new Fe({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(r.raw||r.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let t=new Fe;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Lr("")}appendTail(t){return bo(t)&&(t=new Lr(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 ya=class{constructor(t){let p=t,{parent:r,isOptional:o,placeholderChar:n,displayChar:i,lazy:a,eager:s}=p,l=Ce(p,["parent","isOptional","placeholderChar","displayChar","lazy","eager"]);this.masked=Mr(l),Object.assign(this,{parent:r,isOptional:o,placeholderChar:n,displayChar:i,lazy:a,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 Fe}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 Fe;let o=this.masked.state,n=this.masked._appendChar(t,this.currentMaskFlags(r));return n.inserted&&this.doValidate(r)===!1&&(n=new Fe,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 Fe:(this.isFilled=!0,new Fe({inserted:this.placeholderChar}))}_appendEager(){return new Fe}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,i=Math.min(Math.max(t,o),n);switch(r){case we.LEFT:case we.FORCE_LEFT:return this.isComplete?i:o;case we.RIGHT:case we.FORCE_RIGHT:return this.isComplete?i:n;case we.NONE:default:return i}}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 le(j({},t),{_beforeTailState:(t==null||(r=t._beforeTailState)==null?void 0:r.masked)||(t==null?void 0:t._beforeTailState)})}pad(t){return new Fe}};ya.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 Qh=class extends Kt{updateOptions(t){super.updateOptions(t)}_update(t){let r=t.mask;r&&(t.validate=o=>o.search(r)>=0),super._update(t)}};Pe.MaskedRegExp=Qh;var or=class e extends Kt{constructor(t){super(le(j(j({},e.DEFAULTS),t),{definitions:Object.assign({},ya.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 a=0;a<r.length;++a){if(this.blocks){let c=r.slice(a),d=Object.keys(this.blocks).filter(u=>c.indexOf(u)===0);d.sort((u,h)=>h.length-u.length);let f=d[0];if(f){let i=fi(this.blocks[f]),{expose:u,repeat:h}=i,y=Ce(i,["expose","repeat"]),g=le(j({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix},y),{repeat:h,parent:this}),v=h!=null?new Pe.RepeatBlock(g):Mr(g);v&&(this._blocks.push(v),u&&(this.exposeBlock=v),this._maskedBlocks[f]||(this._maskedBlocks[f]=[]),this._maskedBlocks[f].push(this._blocks.length-1)),a+=f.length-1;continue}}let s=r[a],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(++a,s=r[a],!s)break;l=!1}let p=l?new ya(le(j({isOptional:n,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar},fi(t[s])),{parent:this})):new np({char:s,eager:this.eager,isUnmasking:o});this._blocks.push(p)}}get state(){return le(j({},super.state),{_blocks:this._blocks.map(t=>t.state)})}set state(t){if(!t){this.reset();return}let n=t,{_blocks:r}=n,o=Ce(n,["_blocks"]);this._blocks.forEach((i,a)=>i.state=r[a]),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 Fe,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 i=this._blocks[n]._appendEager();if(!i.inserted)break;r.aggregate(i)}return r}_appendCharRaw(t,r){r===void 0&&(r={});let o=this._mapPosToBlock(this.displayValue.length),n=new Fe;if(!o)return n;for(let a=o.index,s;s=this._blocks[a];++a){var i;let l=s._appendChar(t,le(j({},r),{_beforeTailState:(i=r._beforeTailState)==null||(i=i._blocks)==null?void 0:i[a]}));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 op;return t===r||this._forEachBlocksInRange(t,r,(n,i,a,s)=>{let l=n.extractTail(a,s);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof op&&(l.blockIndex=i),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,(i,a,s,l)=>{n+=i.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 Fe;if(this.lazy&&t==null)return r;let o=this._mapPosToBlock(this.displayValue.length);if(!o)return r;let n=o.index,i=t!=null?t:this._blocks.length;return this._blocks.slice(n,i).forEach(a=>{if(!a.lazy||t!=null){var s;r.aggregate(a._appendPlaceholder((s=a._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],i=r.length;if(r+=n.displayValue,t<=r.length)return{index:o,offset:t-i}}}_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 i=this._mapPosToBlock(r),a=i&&n.index===i.index,s=n.offset,l=i&&a?i.offset:this._blocks[n.index].displayValue.length;if(o(this._blocks[n.index],n.index,s,l),i&&!a){for(let p=n.index+1;p<i.index;++p)o(this._blocks[p],p,0,this._blocks[p].displayValue.length);o(this._blocks[i.index],i.index,0,i.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,i,a,s)=>{o.aggregate(n.remove(a,s))}),o}nearestInputPos(t,r){if(r===void 0&&(r=we.NONE),!this._blocks.length)return 0;let o=new Zh(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,i,a,s)=>{o+=n.totalInputPositions(a,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 Fe;return this._forEachBlocksInRange(0,this.displayValue.length,o=>r.aggregate(o.pad(t))),r}};or.DEFAULTS=le(j({},Kt.DEFAULTS),{lazy:!0,placeholderChar:"_"});or.STOP_CHAR="`";or.ESCAPE_CHAR="\\";or.InputDefinition=ya;or.FixedDefinition=np;Pe.MaskedPattern=or;var ga=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:i=this.autofix}=c,a=Ce(c,["to","from","maxLength","autofix"]);this.to=r,this.from=o,this.maxLength=Math.max(String(r).length,n),this.autofix=i;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;a.mask=l.slice(0,p).replace(/0/g,"\\0")+"0".repeat(this.maxLength-p),super._update(a)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let r="",o="",[,n,i]=t.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(r="0".repeat(n.length)+i,o="9".repeat(n.length)+i),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"),[i,a]=this.boundaries(this.value+t);return Number(a)<this.from?super._appendCharRaw(o[this.value.length],r):Number(i)>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,i]=this.boundaries(r);return this.from<=Number(i)&&Number(n)<=this.to&&super.doValidate(t)}pad(t){let r=new Fe;if(this.value.length===this.maxLength)return r;let o=this.value,n=this.maxLength-this.value.length;if(n){this.reset();for(let i=0;i<n;++i)r.aggregate(super._appendCharRaw("0",t));o.split("").forEach(i=>this._appendCharRaw(i))}return r}};Pe.MaskedRange=ga;var ip=class e extends or{static extractPatternOptions(t){let i=t,{mask:r,pattern:o}=i,n=Ce(i,["mask","pattern"]);return le(j({},n),{mask:bo(r)?r:o})}constructor(t){super(e.extractPatternOptions(j(j({},e.DEFAULTS),t)))}updateOptions(t){super.updateOptions(t)}_update(t){let s=j(j({},e.DEFAULTS),t),{mask:r,pattern:o,blocks:n}=s,i=Ce(s,["mask","pattern","blocks"]),a=Object.assign({},e.GET_DEFAULT_BLOCKS());t.min&&(a.Y.from=t.min.getFullYear()),t.max&&(a.Y.to=t.max.getFullYear()),t.min&&t.max&&a.Y.from===a.Y.to&&(a.m.from=t.min.getMonth()+1,a.m.to=t.max.getMonth()+1,a.m.from===a.m.to&&(a.d.from=t.min.getDate(),a.d.to=t.max.getDate())),Object.assign(a,this.blocks,n),super._update(le(j({},i),{mask:bo(r)?r:o,blocks:a}))}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))}};ip.GET_DEFAULT_BLOCKS=()=>({d:{mask:ga,from:1,to:31,maxLength:2},m:{mask:ga,from:1,to:12,maxLength:2},Y:{mask:ga,from:1900,to:9999}});ip.DEFAULTS=le(j({},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)}});Pe.MaskedDate=ip;var Cu=class e extends Kt{constructor(t){super(j(j({},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 a=fi(r),{expose:o}=a,n=Ce(a,["expose"]),i=Mr(j({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid},n));return o&&(this.exposeMask=i),i}):[])}_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,i=this.rawInputValue,a=r.tail&&r._beforeTailState!=null?r._beforeTailState._rawInputValue:i,s=i.slice(a.length),l=this.currentMask,p=new Fe,c=l==null?void 0:l.state;return this.currentMask=this.doDispatch(t,j({},r),o),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),a&&(this.currentMask.append(a,{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 Fe;return t&&r.aggregate(this._applyDispatch("",{},t)),r.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var r,o;return le(j({},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 i;[o,i]=super.doPrepare(o,this.currentMaskFlags(r)),n=n.aggregate(i)}return[o,n]}doPrepareChar(t,r){r===void 0&&(r={});let[o,n]=super.doPrepareChar(t,r);if(this.currentMask){let i;[o,i]=super.doPrepareChar(o,this.currentMaskFlags(r)),n=n.aggregate(i)}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 Fe;return this.currentMask&&o.aggregate(this.currentMask.remove(t,r)).aggregate(this._applyDispatch()),o}get state(){var t;return le(j({},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 a=t,{compiledMasks:r,currentMaskRef:o,currentMask:n}=a,i=Ce(a,["compiledMasks","currentMaskRef","currentMask"]);r&&this.compiledMasks.forEach((s,l)=>s.state=r[l]),o!=null&&(this.currentMask=o,this.currentMask.state=n),super.state=i}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 a=t[o],{mask:n}=a,i=Ce(a,["mask"]);return tp(r,i)&&r.maskEquals(n)}):super.maskEquals(t)}typedValueEquals(t){var r;return!!((r=this.currentMask)!=null&&r.typedValueEquals(t))}};Cu.DEFAULTS=le(j({},Kt.DEFAULTS),{dispatch:(e,t,r,o)=>{if(!t.compiledMasks.length)return;let n=t.rawInputValue,i=t.compiledMasks.map((a,s)=>{let l=t.currentMask===a,p=l?a.displayValue.length:a.nearestInputPos(a.displayValue.length,we.FORCE_LEFT);return a.rawInputValue!==n?(a.reset(),a.append(n,{raw:!0})):l||a.remove(p),a.append(e,t.currentMaskFlags(r)),a.appendTail(o),{index:s,weight:a.rawInputValue.length,totalInputPositions:a.totalInputPositions(0,Math.max(p,a.nearestInputPos(a.displayValue.length,we.FORCE_LEFT)))}});return i.sort((a,s)=>s.weight-a.weight||s.totalInputPositions-a.totalInputPositions),t.compiledMasks[i[0].index]}});Pe.MaskedDynamic=Cu;var Su=class e extends or{constructor(t){super(j(j({},e.DEFAULTS),t))}updateOptions(t){super.updateOptions(t)}_update(t){let n=t,{enum:r}=n,o=Ce(n,["enum"]);if(r){let i=r.map(l=>l.length),a=Math.min(...i),s=Math.max(...i)-a;o.mask="*".repeat(a),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(i=>this.matchValue(i,this.unmaskedValue+t,o));if(n.length){n.length===1&&this._forEachBlocksInRange(0,this.value.length,(a,s)=>{let l=n[0][s];s>=this.value.length||l===a.value||(a.reset(),a._appendChar(l,r))});let i=super._appendCharRaw(n[0][this.value.length],r);return n.length===1&&n[0].slice(this.unmaskedValue.length).split("").forEach(a=>i.aggregate(super._appendCharRaw(a))),i}return new Fe}extractTail(t,r){return t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),new Lr("",t)}remove(t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.displayValue.length),t===r)return new Fe;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 i=super.remove(n,r);return i.tailShift+=n-t,i}};Su.DEFAULTS=le(j({},or.DEFAULTS),{matchValue:(e,t,r)=>e.indexOf(t,r)===r});Pe.MaskedEnum=Su;var ey=class extends Kt{updateOptions(t){super.updateOptions(t)}_update(t){super._update(le(j({},t),{validate:t.mask}))}};Pe.MaskedFunction=ey;var y_,va=class e extends Kt{constructor(t){super(j(j({},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?"("+Kh(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+r+o),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Kh).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Kh(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 i=this._value;this._value+=t;let a=this.number,s=!isNaN(a),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=i===this._value&&!r.tail)):s=!1),s&&(s=!!this._value.match(this._numberRegExp))}let p;s?p=new Fe({inserted:this._value.slice(i.length),rawInserted:l?"":t,skip:l}):(this._value=i,p=new Fe),this._value=this._insertThousandsSeparators(this._value);let c=r.tail&&r._beforeTailState?r._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return p.tailShift+=(d-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),i=this._separatorsCount(o.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(o+n));let a=this._separatorsCountFromSlice(o);return new Fe({tailShift:(a-i)*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,i,a)=>n+a),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==="")}};y_=va;va.UNMASKED_RADIX=".";va.EMPTY_VALUES=[...Kt.EMPTY_VALUES,0];va.DEFAULTS=le(j({},Kt.DEFAULTS),{mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[y_.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})});Pe.MaskedNumber=va;var ty={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Ax(e,t,r){t===void 0&&(t=ty.MASKED),r===void 0&&(r=ty.MASKED);let o=Mr(e);return n=>o.runIsolated(i=>(i[t]=n,i[r]))}function g_(e,t,r,o){return Ax(t,r,o)(e)}Pe.PIPE_TYPE=ty;Pe.createPipe=Ax;Pe.pipe=g_;var ry=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=fi(t),{repeat:i}=l,a=Ce(l,["repeat"]);this._blockOpts=Object.assign({},this._blockOpts,a);let s=Mr(this._blockOpts);this.repeat=(r=(o=i!=null?i: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(Mr(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,r){r===void 0&&(r={});let o=new Fe;for(let l=(n=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?n:Math.max(this._blocks.length-1,0),p,c;p=(a=this._blocks[l])!=null?a:c=!c&&this._allocateBlock(l);++l){var n,i,a,s;let d=p._appendChar(t,le(j({},r),{_beforeTailState:(s=r._beforeTailState)==null||(s=s._blocks)==null?void 0:s[l]}));if(d.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(o.aggregate(d),d.consumed)break}return o}_trimEmptyTail(t,r){var o,n;t===void 0&&(t=0);let i=Math.max(((o=this._mapPosToBlock(t))==null?void 0:o.index)||0,this.repeatFrom,0),a;r!=null&&(a=(n=this._mapPosToBlock(r))==null?void 0:n.index),a==null&&(a=this._blocks.length-1);let s=0;for(let l=a;i<=l&&!this._blocks[l].unmaskedValue;--l,++s);s&&(this._blocks.splice(a-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}};Pe.RepeatBlock=ry;try{globalThis.IMask=Pe}catch(e){}import Mx from"react";var Be=ko(eC(),1);import oy from"react";var v_={mask:Be.default.oneOfType([Be.default.array,Be.default.func,Be.default.string,Be.default.instanceOf(RegExp),Be.default.oneOf([Date,Number,Pe.Masked]),Be.default.instanceOf(Pe.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})])},b_=Object.keys(v_).filter(e=>e!=="value"),i7=["value","unmask","onAccept","onComplete","inputRef"],a7=b_.filter(e=>i7.indexOf(e)<0);function Nx(e){var t;let r=(t=class extends oy.Component{constructor(i){super(i),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let i=this.props,a=this._extractMaskOptionsFromProps(i);if(a.mask)this.maskRef?(this.maskRef.updateOptions(a),"value"in i&&i.value!==void 0&&(this.maskValue=i.value)):this.initMask(a);else if(this.destroyMask(),"value"in i&&i.value!==void 0){var s;(s=this.element)!=null&&s.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=i.value:this.element.value=i.value}}componentWillUnmount(){this.destroyMask()}_inputRef(i){this.element=i,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=i:this.props.inputRef(i))}initMask(i){i===void 0&&(i=this._extractMaskOptionsFromProps(this.props)),this.maskRef=Pe(this.element,i).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(i){let a=Ce(i,[]);return Object.keys(a).filter(s=>a7.indexOf(s)<0).forEach(s=>{delete a[s]}),a}_extractNonMaskProps(i){let a=Ce(i,[]);return b_.forEach(s=>{s!=="maxLength"&&delete a[s]}),"defaultValue"in a||(a.defaultValue=i.mask?"":a.value),delete a.value,a}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(i){this.maskRef&&(i=i==null&&this.props.unmask!=="typed"?"":i,this.props.unmask==="typed"?this.maskRef.typedValue=i:this.props.unmask?this.maskRef.unmaskedValue=i:this.maskRef.value=i)}_onAccept(i){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,i)}_onComplete(i){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,i)}render(){return oy.createElement(e,le(j({},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=v_,oy.forwardRef((n,i)=>oy.createElement(r,le(j({},n),{ref:i})))}var s7=Nx(e=>{let o=e,{inputRef:t}=o,r=Ce(o,["inputRef"]);return Mx.createElement("input",le(j({},r),{ref:t}))}),l7=(e,t)=>Mx.createElement(s7,le(j({},e),{ref:t})),hi=Mx.forwardRef(l7);import{useRef as AJe,useState as NJe,useCallback as MJe,useEffect as LJe}from"react";import"react";import{jsx as p7}from"react/jsx-runtime";var ba=Tr(p7("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 c7}from"framer-motion";var u7=c7(Tm),d7=E(u7)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),ku=d7;ku.displayName="DialogActions";var Bn=ku;var g7=E(Gt,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),v7=E(qo,{name:"DatePicker",slot:"sheet",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),b7=E("div",{name:"DatePicker",slot:"container"})({width:"100%"}),C_=e=>{let t=`${e.getDate()}`,r=`${e.getMonth()+1}`,o=e.getFullYear();return Number(t)<10&&(t="0"+t),Number(r)<10&&(r="0"+r),[o,r,t].join("/")},x7=f7.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(hi,le(j({},n),{inputRef:r,onAccept:a=>o({target:{name:t.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:Pe.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Pe.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Pe.MaskedRange,from:1900,to:9999}},format:C_,parse:a=>{let s=a.split("/");return new Date(Number(s[0]),Number(s[1])-1,Number(s[2]))},autofix:"pad",overwrite:!0}))}),ny=m7((e,t)=>{let T=e,{onChange:r,disabled:o,label:n,error:i,helperText:a,minDate:s,maxDate:l,disableFuture:p,disablePast:c,required:d}=T,f=Ce(T,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required"]),u=y7(null),[h,y]=P_(e.value||""),[g,v]=P_(null),x=!!g;T_(()=>{y(e.value||"")},[e.value]),T_(()=>{var C;g||(C=u.current)==null||C.blur()},[g,u]),h7(t,()=>u.current,[u.current]);let b=x_(C=>{y(C.target.value),r==null||r(C)},[r]),k=x_(C=>{v(g?null:C.currentTarget),setTimeout(()=>{var S;(S=u.current)==null||S.focus()},0)},[g,v,u]),P=A(b7,{children:A(Qr,{open:!0,children:Ee(oo,{children:[A(Gr,le(j({},f),{color:i?"danger":f.color,ref:u,size:"sm",value:h,onChange:b,placeholder:"YYYY/MM/DD",disabled:o,required:d,slotProps:{input:{component:x7,ref:u}},sx:{fontFamily:"monospace"},endDecorator:A(pr,{variant:"plain",onClick:k,children:A(ba,{})})})),x&&A(Gn,{onClickAway:()=>v(null),children:A(g7,{id:"date-picker-popper",open:!0,anchorEl:g,placement:"bottom-end",onMouseDown:C=>C.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],children:Ee(v7,{tabIndex:-1,role:"presentation",children:[A(fa,{value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([C])=>{b({target:{name:e.name,value:C_(C)}}),v(null)},minDate:s?new Date(s):void 0,maxDate:l?new Date(l):void 0,disableFuture:p,disablePast:c}),A(Bn,{sx:{p:1},children:A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{b({target:{name:e.name,value:""}}),v(null)},children:"Clear"})})]})})})]})})});return n?Ee(qt,{required:d,disabled:o,error:i,size:"sm",children:[A(Jt,{children:n}),P,a&&A(Ft,{children:a})]}):P});var S_=ny;import{motion as T7}from"framer-motion";var P7=T7(lh),Ru=e=>{let f=e,{label:t,error:r,helperText:o,color:n,size:i,disabled:a,required:s,minRows:l=2,maxRows:p=4}=f,c=Ce(f,["label","error","helperText","color","size","disabled","required","minRows","maxRows"]),d=A(P7,j({required:s,disabled:a,color:r?"danger":n,size:i,minRows:l,maxRows:p},c));return t?Ee(qt,{required:s,disabled:a,color:n,size:i,error:r,children:[A(Jt,{children:t}),d,o&&A(Ft,{children:o})]}):d};Ru.displayName="Textarea";var k_=Ru;import{useMemo as C7}from"react";import{motion as S7}from"framer-motion";var k7=S7(Gm),iy=k7;iy.displayName="Option";function Eu(e){let u=e,{label:t,helperText:r,error:o,size:n,color:i,disabled:a,required:s,onChange:l}=u,p=Ce(u,["label","helperText","error","size","color","disabled","required","onChange"]),c=C7(()=>e.options.map(h=>typeof h!="object"?{value:h,label:h}:h),[e.options]),d=(h,y)=>{var x;let g=h||{target:{}},v=le(j({},g),{target:{name:((x=g.target)==null?void 0:x.name)||e.name,value:y||void 0}});l==null||l(v)},f=A(Km,le(j({},p),{required:s,disabled:a,size:n,color:o?"danger":i,onChange:d,children:c.map(h=>A(iy,{value:h.value,children:h.label},h.value))}));return t?Ee(qt,{required:s,disabled:a,size:n,color:i,error:o,children:[A(Jt,{children:t}),f,r&&A(Ft,{children:r})]}):f}Eu.displayName="Select";var R_=Eu;import{motion as R7}from"framer-motion";var E7=R7(ch),Ou=e=>A(E7,j({},e));Ou.displayName="Tooltip";var E_=Ou;La();function w_(e){return!e.editMode&&["number","date","currency"].includes(e.type||"")?"end":"start"}var O_=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"}}),ay=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function _7(e){let{paginationModel:{page:t,pageSize:r},rowCount:o,onPageChange:n}=e,i=1,a=Math.ceil(o/r),s=[t-2,t-1].filter(d=>d>1),l=[t+1,t+2].filter(d=>d<=a-1),p=a>1&&t<a-3,c=a>1&&t>4;return A(Ar,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center",children:Ee(Ar,{direction:"row",spacing:.5,alignItems:"center",children:[A(pr,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-1),disabled:t===i,"aria-label":"Previous page",children:A(_h,{})}),t!==i&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(i),children:i}),c&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t-3),children:"..."}),s.map(d=>A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(d),children:d},d)),A(wt,{variant:"soft",size:"sm",children:t}),l.map(d=>A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(d),children:d},d)),p&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+3),children:"..."}),t!==a&&A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(a),children:a}),A(pr,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(t+1),disabled:t===a,"aria-label":"Next page",children:A(wh,{})})]})})}var w7=e=>A(Ih,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:t=>{var a;let r=t.clientX,o=(a=e.current)==null?void 0:a.getBoundingClientRect().width,n=s=>{o&&r&&(e.current.style.width=`${o+(s.clientX-r)}px`)},i=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)}}),D7=E("span",{name:"DataTable",slot:"headCellAsterisk"})(({theme:e})=>({color:"var(--ceed-palette-danger-500)",marginLeft:e.spacing(.5)})),A7=e=>{var n,i,a,s,l;let t=I_(null),r={width:e.width,minWidth:(n=e.minWidth)!=null?n:"50px",maxWidth:e.maxWidth,textAlign:w_(e),position:e.stickyHeader?void 0:"relative"},o=(i=e.resizable)==null||i?w7(t):null;return Ee("th",{id:`${e.tableId}_header_${(a=e.headerName)!=null?a:e.field}`,"aria-label":(s=e.headerName)!=null?s:e.field,ref:t,style:r,children:[(l=e.headerName)!=null?l:e.field,e.editMode&&e.required&&A(D7,{children:"*"}),o]},e.field)},N7=e=>{var P;let{tableId:t,field:r,type:o,renderCell:n,renderEditCell:i,isCellEditable:a,noWrap:s,row:l,rowId:p}=e,[c,d]=__(l[r]),f=I_(null),u=no(()=>({row:l,value:c,id:p}),[l,p,c]),h=no(()=>!!(e.editMode&&(typeof a=="function"?a(u):a==null||a)),[e.editMode,a,u]),y=no(()=>le(j({},typeof e.componentProps=="function"?e.componentProps(u):e.componentProps||{}),{size:"sm"}),[e,u]),g=no(()=>j(le(j({},y),{onChange:T=>{var C,S;(C=y.onChange)==null||C.call(y,T),d(T.target.value),o==="select"&&((S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:T.target.value}),value:T.target.value})))},onFocus:T=>{var C,S;(C=y.onFocus)==null||C.call(y,T),(S=e.onCellEditStart)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{value:c}),value:c}))},onBlur:T=>{var C,S;(C=y.onBlur)==null||C.call(y,T),o&&["number","text","longText","currency","date"].includes(o)&&((S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:c}),value:c})))}}),o==="autocomplete"&&{onChangeComplete:T=>{var C,S;(C=y.onChangeComplete)==null||C.call(y,T),d(T.target.value),(S=e.onCellEditStop)==null||S.call(e,le(j({},u),{originalRow:l,row:le(j({},u.row),{[r]:T.target.value}),value:T.target.value}))}}),[u,l,r,c,y,o,e]),v=no(()=>i?i(u):{date:A(S_,j({value:c},g)),currency:A(m_,j({value:c},g)),number:A(Gr,j({value:c,type:"number"},g)),text:A(Gr,j({value:c,type:"text"},g)),longText:A(k_,j({value:c},g)),autocomplete:A(lI,j({value:c,options:g.options||[c]},g)),select:A(R_,j({value:c,options:g.options||[c]},g))}[o||"text"],[c,g,o]),x=no(()=>{if(n)return n(u);let T=c;return{link:O7.createElement(e.component||ai,j({children:T},y))}[o||"text"]||T},[c,n,u,o,y,e]),b=no(()=>h&&v?v:x,[h,v,x]),k=no(()=>s&&e.type==="longText",[s,e.type]);return sy(()=>{d(l[r])},[l,r]),A("td",{ref:f,headers:`${t}_header_${(P=e.headerName)!=null?P:r}`,style:{textAlign:w_({type:o}),verticalAlign:h?"top":"middle"},children:k?A(E_,{title:c,placement:"bottom",style:{maxWidth:"100%"},enterDelay:1500,enterNextDelay:1500,children:A("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:b})}):b},r)},M7=e=>{let{tableId:t,columns:r,rowId:o,editMode:n,noWrap:i,row:a}=e;return A(oo,{children:r.map((s,l)=>$P(N7,le(j({},s),{tableId:t,key:`${o}_${s.field.toString()}_${l}`,row:a,rowId:o,editMode:n,noWrap:i})))})};function L7({rows:e,columns:t,rowCount:r,pagination:o,paginationMode:n,paginationModel:i,onPaginationModelChange:a,selectionModel:s=[],onSelectionModelChange:l,editMode:p,getId:c,isTotalSelected:d}){let[f,u]=__((i==null?void 0:i.page)||1),h=(i==null?void 0:i.pageSize)||20,y=ap((C,S)=>{var O,_;return(_=(O=c==null?void 0:c(C))!=null?O:C==null?void 0:C.id)!=null?_:`${(S||0)+(f-1)*h}`},[c!=null?c:f,h]),g=no(()=>new Set(s),[s]),v=no(()=>!o||n==="server"?e:e.slice((f-1)*h,(f-1)*h+h),[e,f,h,n,o]),x=no(()=>v.length>0&&v.every((C,S)=>g.has(y(C,S))),[v,g,y]),b=r||e.length,k=no(()=>d!=null?d:b>0&&s.length===b,[d,s,b]),P=no(()=>(t||Object.keys(e[0]||{}).map(S=>({field:S}))).map(S=>{var O;return le(j({},S),{isCellEditable:p&&(typeof S.isCellEditable=="function"?S.isCellEditable:(O=S.isCellEditable)!=null?O:!0)})}),[e,t,p]),T=ap(C=>{u(C),a==null||a({page:C,pageSize:h})},[a,h]);return sy(()=>{i||T(1)},[b,T,i]),sy(()=>{let C=Math.max(1,Math.ceil(b/h));f>C&&T(C)},[f,b,h,T]),sy(()=>{l==null||l([])},[f]),{rowCount:b,page:f,pageSize:h,onPaginationModelChange:T,getId:y,HeadCell:A7,BodyRow:M7,dataInPage:v,isAllSelected:x,isTotalSelected:k,isSelectedRow:ap(C=>g.has(C),[g]),onAllCheckboxChange:ap(()=>{l==null||l(x?[]:v.map(y))},[x,v,l,y]),onCheckboxChange:ap((C,S)=>{if(g.has(S)){let O=s.filter(_=>_!==S);l==null||l(O)}else{let O=[...s,S];l==null||l(O)}},[s,l,g]),columns:P,onTotalSelect:ap(()=>{l==null||l(k?[]:e.map(y),!k)},[k,e,l,y])}}function Lx(e){let ie=e,{rows:t,checkboxSelection:r,editMode:o,selectionModel:n,onSelectionModelChange:i,rowCount:a,columns:s,onPaginationModelChange:l,pagination:p,paginationMode:c,paginationModel:d,loading:f,slots:{checkbox:u=pu,toolbar:h,footer:y,loadingOverlay:g=()=>A(Nc,{value:8,variant:"plain"})}={},slotProps:{checkbox:v={},toolbar:x,background:b={}}={}}=ie,k=Ce(ie,["rows","checkboxSelection","editMode","selectionModel","onSelectionModelChange","rowCount","columns","onPaginationModelChange","pagination","paginationMode","paginationModel","loading","slots","slotProps"]),{columns:P,isAllSelected:T,isSelectedRow:C,onAllCheckboxChange:S,onCheckboxChange:O,getId:_,rowCount:L,page:N,pageSize:D,onPaginationModelChange:$,dataInPage:M,isTotalSelected:I,onTotalSelect:B,HeadCell:q,BodyRow:F}=L7(e),R=I7(),X=no(()=>({page:N,pageSize:D}),[N,D]);return Ee(Ih,{children:[(!!r||!!h)&&Ee(Ar,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center",children:[!!r&&Ee(Ar,{direction:"row",spacing:1,children:[!T&&Ee(yn,{level:"body-xs",children:[ay((n==null?void 0:n.length)||0)," items selected"]}),T&&!I&&Ee(Ar,{direction:"row",spacing:1,alignItems:"center",children:[Ee(yn,{level:"body-xs",children:["All ",ay((n==null?void 0:n.length)||0)," items on this page are selected."]}),Ee(wt,{size:"sm",variant:"plain",onClick:B,children:["Select all ",ay(L!=null?L:t.length)," items"]})]}),I&&Ee(Ar,{direction:"row",spacing:1,alignItems:"center",children:[Ee(yn,{level:"body-xs",children:["All ",ay(L!=null?L:t.length)," items are selected."]}),A(wt,{size:"sm",variant:"plain",color:"danger",onClick:B,children:"Cancel"})]})]}),h&&A(h,j({},x||{}))]}),A(qo,le(j({variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"}},b),{children:Ee(xu,le(j({},k),{children:[A("thead",{children:Ee("tr",{children:[r&&A("th",{style:{width:"40px",textAlign:"center"},children:A(u,j({onChange:S,checked:T,indeterminate:(n||[]).length>0&&!T},v))}),P.map((w,ue)=>A(q,j({tableId:R,stickyHeader:e.stickyHeader,editMode:!!w.isCellEditable},w),`${w.field.toString()}_${ue}`))]})}),Ee("tbody",{children:[A(O_,{children:!!f&&A("td",{children:A(Ih,{sx:{position:"absolute",top:0,left:0,right:0},children:A(g,{})})})}),A(O_,{}),M.map((w,ue)=>{let ve=_(w,ue);return Ee("tr",{role:r?"checkbox":void 0,tabIndex:r?-1:void 0,onClick:r?Me=>O(Me,ve):void 0,"aria-checked":r?C(ve):void 0,children:[r&&A("th",{scope:"row",style:{textAlign:"center"},children:A(u,j({onChange:Me=>O(Me,ve),checked:C(ve)},v))}),A(F,{tableId:R,columns:P,row:w,rowId:ve,editMode:o,noWrap:e.noWrap})]},ve)})]}),y&&A(y,{})]}))})),D<L&&p&&A(_7,{paginationModel:X,rowCount:L,onPageChange:$})]})}Lx.displayName="DataTable";import B7,{forwardRef as z7,useCallback as Bx,useEffect as D_,useImperativeHandle as F7,useMemo as $7,useRef as V7,useState as A_}from"react";var j7=E(Gt,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),H7=E(qo,{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})),U7=E("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),N_=([e,t])=>{let r=o=>{let n=`${o.getDate()}`,i=`${o.getMonth()+1}`,a=o.getFullYear();return Number(n)<10&&(n="0"+n),Number(i)<10&&(i="0"+i),[a,i,n].join("/")};return[r(e),t?r(t):""].join(" - ")},M_=e=>{let t=e.split(" - ")[0]||"",r=e.split(" - ")[1]||"",o=t.split("/"),n=r.split("/");return[new Date(Number(o[0]),Number(o[1])-1,Number(o[2])),new Date(Number(n[0]),Number(n[1])-1,Number(n[2]))]},W7=B7.forwardRef(function(t,r){let i=t,{onChange:o}=i,n=Ce(i,["onChange"]);return A(hi,le(j({},n),{inputRef:r,onAccept:a=>o({target:{name:t.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:Pe.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Pe.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Pe.MaskedRange,from:1900,to:9999}},format:N_,parse:M_,autofix:"pad",overwrite:!0}))}),zx=z7((e,t)=>{let S=e,{onChange:r,disabled:o,label:n,error:i,helperText:a,minDate:s,maxDate:l,disableFuture:p,disablePast:c,required:d}=S,f=Ce(S,["onChange","disabled","label","error","helperText","minDate","maxDate","disableFuture","disablePast","required"]),u=V7(null),[h,y]=A_(e.value||""),[g,v]=A_(null),x=!!g,b=$7(()=>h?M_(h):void 0,[h]);D_(()=>{y(e.value||"")},[e.value]),D_(()=>{var O;g||(O=u.current)==null||O.blur()},[g,u]),F7(t,()=>u.current,[u.current]);let k=Bx(O=>{y(O.target.value),r==null||r(O)},[r]),P=Bx(O=>{var _;v(g?null:O.currentTarget),(_=u.current)==null||_.focus()},[g,v,u]),T=Bx(([O,_])=>{!O||!_||(y(N_([O,_])),v(null))},[y,v]),C=A(U7,{children:A(Qr,{open:!0,children:Ee(oo,{children:[A(Gr,le(j({},f),{color:i?"danger":f.color,ref:t,size:"sm",value:h,onChange:k,disabled:o,required:d,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:W7,ref:u}},sx:{fontFamily:"monospace"},endDecorator:A(pr,{variant:"plain",onClick:P,children:A(ba,{})})})),x&&A(Gn,{onClickAway:()=>v(null),children:A(j7,{id:"date-range-picker-popper",open:!0,anchorEl:g,placement:"bottom-end",onMouseDown:O=>O.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}],children:Ee(H7,{tabIndex:-1,role:"presentation",children:[A(fa,{rangeSelection:!0,defaultValue:b,onChange:T,minDate:s?new Date(s):void 0,maxDate:l?new Date(l):void 0,disableFuture:p,disablePast:c}),A(Bn,{sx:{p:1},children:A(wt,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{y(""),v(null)},children:"Clear"})})]})})})]})})});return n?Ee(qt,{required:d,disabled:o,error:i,size:"sm",children:[A(Jt,{children:n}),C,a&&A(Ft,{children:a})]}):C});zx.displayName="DateRangePicker";import{motion as G7}from"framer-motion";var q7=G7(Cm),J7=E(q7)(({theme:e})=>({padding:e.spacing(0,6,5)})),Iu=J7;Iu.displayName="DialogContent";var ly=Iu;import{motion as K7}from"framer-motion";var Y7=K7(Sm),X7=E(Y7)(({theme:e})=>({padding:e.spacing(4,6)})),_u=X7;_u.displayName="DialogTitle";var py=_u;import tG from"react";import{motion as Fx}from"framer-motion";var Z7=Fx(Em),$x=Z7;$x.displayName="Modal";var L_=E(jm)({padding:0}),wu=L_;wu.displayName="ModalDialog";var Q7=E(Fx(Vm))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),cy=Q7;cy.displayName="ModalClose";var eG=Fx(Um),Vx=eG;Vx.displayName="ModalOverflow";function jx(e){let n=e,{title:t,children:r}=n,o=Ce(n,["title","children"]);return Ee(L_,le(j({},o),{children:[A(cy,{}),A(py,{children:t}),A(ly,{children:r})]}))}jx.displayName="ModalFrame";var rG=E(wu,{name:"Dialog",slot:"Root"})({padding:0}),Hx=tG.forwardRef((e,t)=>{let s=e,{title:r,children:o,actions:n,fullscreen:i}=s,a=Ce(s,["title","children","actions","fullscreen"]);return Ee(rG,le(j({layout:i?"fullscreen":"center",ref:t},a),{children:[A(py,{children:r}),A(ly,{children:o}),A(Bn,{children:n})]}))});Hx.displayName="DialogFrame";import{motion as oG}from"framer-motion";var nG=oG(km),Du=e=>A(nG,j({},e));Du.displayName="Divider";import{motion as iG}from"framer-motion";var aG=iG(Dc),Ux=e=>{var n;let o=e,{children:t}=o,r=Ce(o,["children"]);return A(aG,le(j({},r),{slotProps:le(j({},r.slotProps),{content:le(j({},(n=r.slotProps)==null?void 0:n.content),{sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}})}),children:t}))};Ux.displayName="InsetDrawer";import{motion as sG}from"framer-motion";var lG=sG(Am),Wx=lG;Wx.displayName="Grid";function B_(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var pG=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uG={};function uy(e,t){return((t||uG).jsx?cG:pG).test(e)}var dG=/[ \t\n\f\r]/g;function Gx(e){return typeof e=="object"?e.type==="text"?z_(e.value):!1:z_(e)}function z_(e){return e.replace(dG,"")===""}var yi=class{constructor(t,r,o){this.property=t,this.normal=r,o&&(this.space=o)}};yi.prototype.property={};yi.prototype.normal={};yi.prototype.space=null;function qx(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 yi(r,o,t)}function Au(e){return e.toLowerCase()}var Br=class{constructor(t,r){this.property=t,this.attribute=r}};Br.prototype.space=null;Br.prototype.boolean=!1;Br.prototype.booleanish=!1;Br.prototype.overloadedBoolean=!1;Br.prototype.number=!1;Br.prototype.commaSeparated=!1;Br.prototype.spaceSeparated=!1;Br.prototype.commaOrSpaceSeparated=!1;Br.prototype.mustUseProperty=!1;Br.prototype.defined=!1;var Nu={};Cn(Nu,{boolean:()=>Ue,booleanish:()=>Dt,commaOrSpaceSeparated:()=>io,commaSeparated:()=>xa,number:()=>he,overloadedBoolean:()=>Jx,spaceSeparated:()=>dt});var fG=0,Ue=ks(),Dt=ks(),Jx=ks(),he=ks(),dt=ks(),xa=ks(),io=ks();function ks(){return 2**++fG}var Kx=Object.keys(Nu),Rs=class extends Br{constructor(t,r,o,n){let i=-1;if(super(t,r),F_(this,"space",n),typeof o=="number")for(;++i<Kx.length;){let a=Kx[i];F_(this,Kx[i],(o&Nu[a])===Nu[a])}}};Rs.prototype.defined=!0;function F_(e,t,r){r&&(e[t]=r)}var mG={}.hasOwnProperty;function Jo(e){let t={},r={},o;for(o in e.properties)if(mG.call(e.properties,o)){let n=e.properties[o],i=new Rs(o,e.transform(e.attributes||{},o),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,r[Au(o)]=o,r[Au(i.attribute)]=o}return new yi(t,r,e.space)}var Yx=Jo({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 Xx=Jo({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function dy(e,t){return t in e?e[t]:t}function fy(e,t){return dy(e,t.toLowerCase())}var Zx=Jo({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:fy,properties:{xmlns:null,xmlnsXLink:null}});var Qx=Jo({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:dt,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:he,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:dt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Dt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null}});var $_=Jo({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:fy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xa,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:dt,autoFocus:Ue,autoPlay:Ue,blocking:dt,capture:null,charSet:null,checked:Ue,cite:null,className:dt,cols:he,colSpan:null,content:null,contentEditable:Dt,controls:Ue,controlsList:dt,coords:he|xa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Jx,draggable:Dt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:dt,height:he,hidden:Ue,high:he,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:dt,itemRef:dt,itemScope:Ue,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:he,pattern:null,ping:dt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:dt,required:Ue,reversed:Ue,rows:he,rowSpan:he,sandbox:dt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Dt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:he,security:null,unselectable:null}});var V_=Jo({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:dy,properties:{about:io,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:xa,g2:xa,glyphName:xa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:io,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:io,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:io,rev:io,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:io,requiredFeatures:io,requiredFonts:io,requiredFormats:io,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:io,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:io,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:io,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}});var hG=/^data[-\w.:]+$/i,j_=/-[a-z]/g,yG=/[A-Z]/g;function eT(e,t){let r=Au(t),o=t,n=Br;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hG.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(j_,vG);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!j_.test(i)){let a=i.replace(yG,gG);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}n=Rs}return new n(o,t)}function gG(e){return"-"+e.toLowerCase()}function vG(e){return e.charAt(1).toUpperCase()}var tT={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 H_=qx([Xx,Yx,Zx,Qx,$_],"html"),my=qx([Xx,Yx,Zx,Qx,V_],"svg");function U_(e){return e.join(" ").trim()}var rT=ko(X_(),1),Z_=rT.default.default||rT.default;var hy=Q_("end"),sp=Q_("start");function Q_(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 oT(e){let t=sp(e),r=hy(e);if(t&&r)return{start:t,end:r}}function Ta(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ew(e.position):"start"in e||"end"in e?ew(e):"line"in e||"column"in e?nT(e):""}function nT(e){return tw(e&&e.line)+":"+tw(e&&e.column)}function ew(e){return nT(e&&e.start)+"-"+nT(e&&e.end)}function tw(e){return e&&typeof e=="number"?e:1}var $t=class extends Error{constructor(t,r,o){super(),typeof r=="string"&&(o=r,r=void 0);let n="",i={},a=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i=j({},r)),typeof t=="string"?n=t:!i.cause&&t&&(a=!0,n=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof o=="string"){let l=o.indexOf(":");l===-1?i.ruleId=o:(i.source=o.slice(0,l),i.ruleId=o.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){let l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}let s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.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=Ta(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}};$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;var iT={}.hasOwnProperty,DG=new Map,AG=/[A-Z]/g,NG=/-([a-z])/g,MG=new Set(["table","tbody","thead","tfoot","tr"]),LG=new Set(["td","th"]),rw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aT(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=UG(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=HG(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:H_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=ow(n,e,void 0);return i&&typeof i!="string"?i:n.create(e,n.Fragment,{children:i||void 0},void 0)}function ow(e,t,r){if(t.type==="element")return BG(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zG(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $G(e,t,r);if(t.type==="mdxjsEsm")return FG(e,t);if(t.type==="root")return VG(e,t,r);if(t.type==="text")return jG(e,t)}function BG(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 i=iw(e,t.tagName,!1),a=WG(e,t),s=lT(e,t);return MG.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Gx(l):!0})),nw(e,a,i,t),sT(a,s),e.ancestors.pop(),e.schema=o,e.create(t,i,a,r)}function zG(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)}Lu(e,t.position)}function FG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lu(e,t.position)}function $G(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 i=t.name===null?e.Fragment:iw(e,t.name,!0),a=GG(e,t),s=lT(e,t);return nw(e,a,i,t),sT(a,s),e.ancestors.pop(),e.schema=o,e.create(t,i,a,r)}function VG(e,t,r){let o={};return sT(o,lT(e,t)),e.create(t,e.Fragment,o,r)}function jG(e,t){return t.value}function nw(e,t,r,o){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=o)}function sT(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function HG(e,t,r){return o;function o(n,i,a,s){let p=Array.isArray(a.children)?r:t;return s?p(i,a,s):p(i,a)}}function UG(e,t){return r;function r(o,n,i,a){let s=Array.isArray(i.children),l=sp(o);return t(n,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function WG(e,t){let r={},o,n;for(n in t.properties)if(n!=="children"&&iT.call(t.properties,n)){let i=qG(e,n,t.properties[n]);if(i){let[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&LG.has(t.tagName)?o=s:r[a]=s}}if(o){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return r}function GG(e,t){let r={};for(let o of t.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){let i=o.data.estree.body[0];i.type;let a=i.expression;a.type;let s=a.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else Lu(e,t.position);else{let n=o.name,i;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,i=e.evaluater.evaluateExpression(s.expression)}else Lu(e,t.position);else i=o.value===null?!0:o.value;r[n]=i}return r}function lT(e,t){let r=[],o=-1,n=e.passKeys?new Map:DG;for(;++o<t.children.length;){let i=t.children[o],a;if(e.passKeys){let l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){let p=n.get(l)||0;a=l+"-"+p,n.set(l,p+1)}}let s=ow(e,i,a);s!==void 0&&r.push(s)}return r}function qG(e,t,r){let o=eT(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=o.commaSeparated?B_(r):U_(r)),o.property==="style"){let n=typeof r=="object"?r:JG(e,String(r));return e.stylePropertyNameCase==="css"&&(n=KG(n)),["style",n]}return[e.elementAttributeNameCase==="react"&&o.space?tT[o.property]||o.property:o.attribute,r]}}function JG(e,t){let r={};try{Z_(t,o)}catch(n){if(!e.ignoreInvalidStyle){let i=n,a=new $t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=rw+"#cannot-parse-style-attribute",a}}return r;function o(n,i){let a=n;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(NG,XG)),r[a]=i}}function iw(e,t,r){let o;if(!r)o={type:"Literal",value:t};else if(t.includes(".")){let n=t.split("."),i=-1,a;for(;++i<n.length;){let s=uy(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}o=a}else o=uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(o.type==="Literal"){let n=o.value;return iT.call(e.components,n)?e.components[n]:n}if(e.evaluater)return e.evaluater.evaluateExpression(o);Lu(e)}function Lu(e,t){let r=new $t("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=rw+"#cannot-handle-mdx-estrees-without-createevaluater",r}function KG(e){let t={},r;for(r in e)iT.call(e,r)&&(t[YG(r)]=e[r]);return t}function YG(e){let t=e.replace(AG,ZG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XG(e,t){return t.toUpperCase()}function ZG(e){return"-"+e.toLowerCase()}var Bu={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 oJ,jsx as nJ,jsxs as iJ}from"react/jsx-runtime";var QG={};function pT(e,t){let r=t||QG,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return sw(e,o,n)}function sw(e,t,r){if(e8(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 aw(e.children,t,r)}return Array.isArray(e)?aw(e,t,r):""}function aw(e,t,r){let o=[],n=-1;for(;++n<e.length;)o[n]=sw(e[n],t,r);return o.join("")}function e8(e){return!!(e&&typeof e=="object")}var lw=document.createElement("i");function lp(e){let t="&"+e+";";lw.innerHTML=t;let r=lw.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function zr(e,t,r,o){let n=e.length,i=0,a;if(t<0?t=-t>n?0:n+t:t=t>n?n:t,r=r>0?r:0,o.length<1e4)a=Array.from(o),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);i<o.length;)a=o.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function qr(e,t){return e.length>0?(zr(e,e.length,0,t),e):t}var pw={}.hasOwnProperty;function cw(e){let t={},r=-1;for(;++r<e.length;)t8(t,e[r]);return t}function t8(e,t){let r;for(r in t){let n=(pw.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],a;if(i)for(a in i){pw.call(n,a)||(n[a]=[]);let s=i[a];r8(n[a],Array.isArray(s)?s:s?[s]:[])}}}function r8(e,t){let r=-1,o=[];for(;++r<t.length;)(t[r].add==="after"?e:o).push(t[r]);zr(e,0,0,o)}function yy(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 gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xo=Pa(/[A-Za-z]/),cr=Pa(/[\dA-Za-z]/),uw=Pa(/[#-'*+\--9=?A-Z^-~]/);function zu(e){return e!==null&&(e<32||e===127)}var Fu=Pa(/\d/),dw=Pa(/[\dA-Fa-f]/),fw=Pa(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function Vt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}var mw=Pa(new RegExp("\\p{P}|\\p{S}","u")),hw=Pa(/\s/);function Pa(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ko(e){let t=[],r=-1,o=0,n=0;for(;++r<e.length;){let i=e.charCodeAt(r),a="";if(i===37&&cr(e.charCodeAt(r+1))&&cr(e.charCodeAt(r+2)))n=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let s=e.charCodeAt(r+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),n=1):a="\uFFFD"}else a=String.fromCharCode(i);a&&(t.push(e.slice(o,r),encodeURIComponent(a)),o=r+n+1,a=""),n&&(r+=n,n=0)}return t.join("")+e.slice(o)}function Je(e,t,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,i=0;return a;function a(l){return We(l)?(e.enter(r),s(l)):t(l)}function s(l){return We(l)&&i++<n?(e.consume(l),s):(e.exit(r),t(l))}}var yw={tokenize:o8};function o8(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"),Je(e,t,"linePrefix")}function n(s){return e.enter("paragraph"),i(s)}function i(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return De(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}var vw={tokenize:n8},gw={tokenize:i8};function n8(e){let t=this,r=[],o=0,n,i,a;return s;function s(b){if(o<r.length){let k=r[o];return t.containerState=k[1],e.attempt(k[0].continuation,l,p)(b)}return p(b)}function l(b){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,n&&x();let k=t.events.length,P=k,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}v(o);let C=k;for(;C<t.events.length;)t.events[C][1].end=Object.assign({},T),C++;return zr(t.events,P+1,0,t.events.slice(k)),t.events.length=C,p(b)}return s(b)}function p(b){if(o===r.length){if(!n)return f(b);if(n.currentConstruct&&n.currentConstruct.concrete)return h(b);t.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gw,c,d)(b)}function c(b){return n&&x(),v(o),f(b)}function d(b){return t.parser.lazy[t.now().line]=o!==r.length,a=t.now().offset,h(b)}function f(b){return t.containerState={},e.attempt(gw,u,h)(b)}function u(b){return o++,r.push([t.currentConstruct,t.containerState]),f(b)}function h(b){if(b===null){n&&x(),v(0),e.consume(b);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:n}),y(b)}function y(b){if(b===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(b);return}return De(b)?(e.consume(b),g(e.exit("chunkFlow")),o=0,t.interrupt=void 0,s):(e.consume(b),y)}function g(b,k){let P=t.sliceStream(b);if(k&&P.push(null),b.previous=i,i&&(i.next=b),i=b,n.defineSkip(b.start),n.write(P),t.parser.lazy[b.start.line]){let T=n.events.length;for(;T--;)if(n.events[T][1].start.offset<a&&(!n.events[T][1].end||n.events[T][1].end.offset>a))return;let C=t.events.length,S=C,O,_;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(O){_=t.events[S][1].end;break}O=!0}for(v(o),T=C;T<t.events.length;)t.events[T][1].end=Object.assign({},_),T++;zr(t.events,S+1,0,t.events.slice(C)),t.events.length=T}}function v(b){let k=r.length;for(;k-- >b;){let P=r[k];t.containerState=P[1],P[0].exit.call(t,e)}r.length=b}function x(){n.write([null]),i=void 0,n=void 0,t.containerState._closeFlow=void 0}}function i8(e,t,r){return Je(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cT(e){if(e===null||Vt(e)||hw(e))return 1;if(mw(e))return 2}function pp(e,t,r){let o=[],n=-1;for(;++n<e.length;){let i=e[n].resolveAll;i&&!o.includes(i)&&(t=i(t,r),o.push(i))}return t}var $u={name:"attention",tokenize:s8,resolveAll:a8};function a8(e,t){let r=-1,o,n,i,a,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 d=Object.assign({},e[o][1].end),f=Object.assign({},e[r][1].start);bw(d,-l),bw(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[r][1].start),end:f},i={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({},a.start),end:Object.assign({},s.end)},e[o][1].end=Object.assign({},a.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",a,t],["exit",a,t],["enter",i,t]]),p=qr(p,pp(t.parser.constructs.insideSpan.null,e.slice(o+1,r),t)),p=qr(p,[["exit",i,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,zr(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 s8(e,t){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=cT(o),i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;let p=e.exit("attentionSequence"),c=cT(l),d=!c||c===2&&n||r.includes(l),f=!n||n===2&&c||r.includes(o);return p._open=!!(i===42?d:d&&(n||!f)),p._close=!!(i===42?f:f&&(c||!d)),t(l)}}function bw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var uT={name:"autolink",tokenize:l8};function l8(e,t,r){let o=0;return n;function n(u){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(u){return xo(u)?(e.consume(u),a):p(u)}function a(u){return u===43||u===45||u===46||cr(u)?(o=1,s(u)):p(u)}function s(u){return u===58?(e.consume(u),o=0,l):(u===43||u===45||u===46||cr(u))&&o++<32?(e.consume(u),s):(o=0,p(u))}function l(u){return u===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.exit("autolink"),t):u===null||u===32||u===60||zu(u)?r(u):(e.consume(u),l)}function p(u){return u===64?(e.consume(u),c):uw(u)?(e.consume(u),p):r(u)}function c(u){return cr(u)?d(u):r(u)}function d(u){return u===46?(e.consume(u),o=0,c):u===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(u),e.exit("autolinkMarker"),e.exit("autolink"),t):f(u)}function f(u){if((u===45||cr(u))&&o++<63){let h=u===45?f:d;return e.consume(u),h}return r(u)}}var Ca={tokenize:p8,partial:!0};function p8(e,t,r){return o;function o(i){return We(i)?Je(e,n,"linePrefix")(i):n(i)}function n(i){return i===null||De(i)?t(i):r(i)}}var gy={name:"blockQuote",tokenize:c8,continuation:{tokenize:u8},exit:d8};function c8(e,t,r){let o=this;return n;function n(a){if(a===62){let s=o.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return r(a)}function i(a){return We(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function u8(e,t,r){let o=this;return n;function n(a){return We(a)?Je(e,i,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(gy,t,r)(a)}}function d8(e){e.exit("blockQuote")}var vy={name:"characterEscape",tokenize:f8};function f8(e,t,r){return o;function o(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n}function n(i){return fw(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var by={name:"characterReference",tokenize:m8};function m8(e,t,r){let o=this,n=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),i=31,a=cr,c(d))}function p(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=dw,c):(e.enter("characterReferenceValue"),i=7,a=Fu,c(d))}function c(d){if(d===59&&n){let f=e.exit("characterReferenceValue");return a===cr&&!lp(o.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&n++<i?(e.consume(d),c):r(d)}}var xw={tokenize:y8,partial:!0},xy={name:"codeFenced",tokenize:h8,concrete:!0};function h8(e,t,r){let o=this,n={tokenize:P,partial:!0},i=0,a=0,s;return l;function l(T){return p(T)}function p(T){let C=o.events[o.events.length-1];return i=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,s=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(T)}function c(T){return T===s?(a++,e.consume(T),c):a<3?r(T):(e.exit("codeFencedFenceSequence"),We(T)?Je(e,d,"whitespace")(T):d(T))}function d(T){return T===null||De(T)?(e.exit("codeFencedFence"),o.interrupt?t(T):e.check(xw,y,k)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(T))}function f(T){return T===null||De(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):We(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,u,"whitespace")(T)):T===96&&T===s?r(T):(e.consume(T),f)}function u(T){return T===null||De(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||De(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===s?r(T):(e.consume(T),h)}function y(T){return e.attempt(n,k,g)(T)}function g(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return i>0&&We(T)?Je(e,x,"linePrefix",i+1)(T):x(T)}function x(T){return T===null||De(T)?e.check(xw,y,k)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||De(T)?(e.exit("codeFlowValue"),x(T)):(e.consume(T),b)}function k(T){return e.exit("codeFenced"),t(T)}function P(T,C,S){let O=0;return _;function _(M){return T.enter("lineEnding"),T.consume(M),T.exit("lineEnding"),L}function L(M){return T.enter("codeFencedFence"),We(M)?Je(T,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):N(M)}function N(M){return M===s?(T.enter("codeFencedFenceSequence"),D(M)):S(M)}function D(M){return M===s?(O++,T.consume(M),D):O>=a?(T.exit("codeFencedFenceSequence"),We(M)?Je(T,$,"whitespace")(M):$(M)):S(M)}function $(M){return M===null||De(M)?(T.exit("codeFencedFence"),C(M)):S(M)}}}function y8(e,t,r){let o=this;return n;function n(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return o.parser.lazy[o.now().line]?r(a):t(a)}}var Vu={name:"codeIndented",tokenize:v8},g8={tokenize:b8,partial:!0};function v8(e,t,r){let o=this;return n;function n(p){return e.enter("codeIndented"),Je(e,i,"linePrefix",5)(p)}function i(p){let c=o.events[o.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(p):r(p)}function a(p){return p===null?l(p):De(p)?e.attempt(g8,a,l)(p):(e.enter("codeFlowValue"),s(p))}function s(p){return p===null||De(p)?(e.exit("codeFlowValue"),a(p)):(e.consume(p),s)}function l(p){return e.exit("codeIndented"),t(p)}}function b8(e,t,r){let o=this;return n;function n(a){return o.parser.lazy[o.now().line]?r(a):De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n):Je(e,i,"linePrefix",5)(a)}function i(a){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):De(a)?n(a):r(a)}}var dT={name:"codeText",tokenize:P8,resolve:x8,previous:T8};function x8(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 T8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function P8(e,t,r){let o=this,n=0,i,a;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?(a=e.enter("codeTextSequence"),i=0,d(f)):De(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||De(f)?(e.exit("codeTextData"),p(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",c(f))}}var Ty=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 i=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&ju(this.left,o),i.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),ju(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ju(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);ju(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ju(this.left,r.reverse())}}};function ju(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 Py(e){let t={},r=-1,o,n,i,a,s,l,p,c=new Ty(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,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(o[0]==="enter")o[1].contentType&&(Object.assign(t,C8(c,r)),r=t[r],p=!0);else if(o[1]._container){for(i=r,n=void 0;i--&&(a=c.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(n&&(c.get(n)[1].type="lineEndingBlank"),a[1].type="lineEnding",n=i);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 zr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!p}function C8(e,t){let r=e.get(t)[1],o=e.get(t)[2],n=t-1,i=[],a=r._tokenizer||o.parser[r.contentType](r.start),s=a.events,l=[],p={},c,d,f=-1,u=r,h=0,y=0,g=[y];for(;u;){for(;e.get(++n)[1]!==u;);i.push(n),u._tokenizer||(c=o.sliceStream(u),u.next||c.push(null),d&&a.defineSkip(u.start),u._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),u._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=u,u=u.next}for(u=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&&(y=f+1,g.push(y),u._tokenizer=void 0,u.previous=void 0,u=u.next);for(a.events=[],u?(u._tokenizer=void 0,u.previous=void 0):g.pop(),f=g.length;f--;){let v=s.slice(g[f],g[f+1]),x=i.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),f=-1;++f<l.length;)p[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return p}var fT={tokenize:R8,resolve:k8},S8={tokenize:E8,partial:!0};function k8(e){return Py(e),e}function R8(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?i(s):De(s)?e.check(S8,a,i)(s):(e.consume(s),n)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function E8(e,t,r){let o=this;return n;function n(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Je(e,i,"linePrefix")}function i(a){if(a===null||De(a))return r(a);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(a):e.interrupt(o.parser.constructs.flow,r,t)(a)}}function Cy(e,t,r,o,n,i,a,s,l){let p=l||Number.POSITIVE_INFINITY,c=0;return d;function d(v){return v===60?(e.enter(o),e.enter(n),e.enter(i),e.consume(v),e.exit(i),f):v===null||v===32||v===41||zu(v)?r(v):(e.enter(o),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(v))}function f(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(n),e.exit(o),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),u(v))}function u(v){return v===62?(e.exit("chunkString"),e.exit(s),f(v)):v===null||v===60||De(v)?r(v):(e.consume(v),v===92?h:u)}function h(v){return v===60||v===62||v===92?(e.consume(v),u):u(v)}function y(v){return!c&&(v===null||v===41||Vt(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(o),t(v)):c<p&&v===40?(e.consume(v),c++,y):v===41?(e.consume(v),c--,y):v===null||v===32||v===40||zu(v)?r(v):(e.consume(v),v===92?g:y)}function g(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function Sy(e,t,r,o,n,i){let a=this,s=0,l;return p;function p(u){return e.enter(o),e.enter(n),e.consume(u),e.exit(n),e.enter(i),c}function c(u){return s>999||u===null||u===91||u===93&&!l||u===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):u===93?(e.exit(i),e.enter(n),e.consume(u),e.exit(n),e.exit(o),t):De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(u){return u===null||u===91||u===93||De(u)||s++>999?(e.exit("chunkString"),c(u)):(e.consume(u),l||(l=!We(u)),u===92?f:d)}function f(u){return u===91||u===92||u===93?(e.consume(u),s++,d):d(u)}}function ky(e,t,r,o,n,i){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(o),e.enter(n),e.consume(f),e.exit(n),a=f===40?41:f,l):r(f)}function l(f){return f===a?(e.enter(n),e.consume(f),e.exit(n),e.exit(o),t):(e.enter(i),p(f))}function p(f){return f===a?(e.exit(i),l(a)):f===null?r(f):De(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Je(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===a||f===null||De(f)?(e.exit("chunkString"),p(f)):(e.consume(f),f===92?d:c)}function d(f){return f===a||f===92?(e.consume(f),c):c(f)}}function Os(e,t){let r;return o;function o(n){return De(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,o):We(n)?Je(e,o,r?"linePrefix":"lineSuffix")(n):t(n)}}var mT={name:"definition",tokenize:I8},O8={tokenize:_8,partial:!0};function I8(e,t,r){let o=this,n;return i;function i(u){return e.enter("definition"),a(u)}function a(u){return Sy.call(o,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(u)}function s(u){return n=gi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),l):r(u)}function l(u){return Vt(u)?Os(e,p)(u):p(u)}function p(u){return Cy(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(u)}function c(u){return e.attempt(O8,d,d)(u)}function d(u){return We(u)?Je(e,f,"whitespace")(u):f(u)}function f(u){return u===null||De(u)?(e.exit("definition"),o.parser.defined.push(n),t(u)):r(u)}}function _8(e,t,r){return o;function o(s){return Vt(s)?Os(e,n)(s):r(s)}function n(s){return ky(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return We(s)?Je(e,a,"whitespace")(s):a(s)}function a(s){return s===null||De(s)?t(s):r(s)}}var hT={name:"hardBreakEscape",tokenize:w8};function w8(e,t,r){return o;function o(i){return e.enter("hardBreakEscape"),e.consume(i),n}function n(i){return De(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var yT={name:"headingAtx",tokenize:A8,resolve:D8};function D8(e,t){let r=e.length-2,o=3,n,i;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},i={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},zr(e,o,r-o+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e}function A8(e,t,r){let o=0;return n;function n(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&o++<6?(e.consume(c),a):c===null||Vt(c)?(e.exit("atxHeadingSequence"),s(c)):r(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||De(c)?(e.exit("atxHeading"),t(c)):We(c)?Je(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||Vt(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),p)}}var Tw=["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"],gT=["pre","script","style","textarea"];var vT={name:"htmlFlow",tokenize:B8,resolveTo:L8,concrete:!0},N8={tokenize:F8,partial:!0},M8={tokenize:z8,partial:!0};function L8(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 B8(e,t,r){let o=this,n,i,a,s,l;return p;function p(w){return c(w)}function c(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),d}function d(w){return w===33?(e.consume(w),f):w===47?(e.consume(w),i=!0,y):w===63?(e.consume(w),n=3,o.interrupt?t:R):xo(w)?(e.consume(w),a=String.fromCharCode(w),g):r(w)}function f(w){return w===45?(e.consume(w),n=2,u):w===91?(e.consume(w),n=5,s=0,h):xo(w)?(e.consume(w),n=4,o.interrupt?t:R):r(w)}function u(w){return w===45?(e.consume(w),o.interrupt?t:R):r(w)}function h(w){let ue="CDATA[";return w===ue.charCodeAt(s++)?(e.consume(w),s===ue.length?o.interrupt?t:N:h):r(w)}function y(w){return xo(w)?(e.consume(w),a=String.fromCharCode(w),g):r(w)}function g(w){if(w===null||w===47||w===62||Vt(w)){let ue=w===47,ve=a.toLowerCase();return!ue&&!i&&gT.includes(ve)?(n=1,o.interrupt?t(w):N(w)):Tw.includes(a.toLowerCase())?(n=6,ue?(e.consume(w),v):o.interrupt?t(w):N(w)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(w):i?x(w):b(w))}return w===45||cr(w)?(e.consume(w),a+=String.fromCharCode(w),g):r(w)}function v(w){return w===62?(e.consume(w),o.interrupt?t:N):r(w)}function x(w){return We(w)?(e.consume(w),x):_(w)}function b(w){return w===47?(e.consume(w),_):w===58||w===95||xo(w)?(e.consume(w),k):We(w)?(e.consume(w),b):_(w)}function k(w){return w===45||w===46||w===58||w===95||cr(w)?(e.consume(w),k):P(w)}function P(w){return w===61?(e.consume(w),T):We(w)?(e.consume(w),P):b(w)}function T(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),l=w,C):We(w)?(e.consume(w),T):S(w)}function C(w){return w===l?(e.consume(w),l=null,O):w===null||De(w)?r(w):(e.consume(w),C)}function S(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Vt(w)?P(w):(e.consume(w),S)}function O(w){return w===47||w===62||We(w)?b(w):r(w)}function _(w){return w===62?(e.consume(w),L):r(w)}function L(w){return w===null||De(w)?N(w):We(w)?(e.consume(w),L):r(w)}function N(w){return w===45&&n===2?(e.consume(w),I):w===60&&n===1?(e.consume(w),B):w===62&&n===4?(e.consume(w),X):w===63&&n===3?(e.consume(w),R):w===93&&n===5?(e.consume(w),F):De(w)&&(n===6||n===7)?(e.exit("htmlFlowData"),e.check(N8,ie,D)(w)):w===null||De(w)?(e.exit("htmlFlowData"),D(w)):(e.consume(w),N)}function D(w){return e.check(M8,$,ie)(w)}function $(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),M}function M(w){return w===null||De(w)?D(w):(e.enter("htmlFlowData"),N(w))}function I(w){return w===45?(e.consume(w),R):N(w)}function B(w){return w===47?(e.consume(w),a="",q):N(w)}function q(w){if(w===62){let ue=a.toLowerCase();return gT.includes(ue)?(e.consume(w),X):N(w)}return xo(w)&&a.length<8?(e.consume(w),a+=String.fromCharCode(w),q):N(w)}function F(w){return w===93?(e.consume(w),R):N(w)}function R(w){return w===62?(e.consume(w),X):w===45&&n===2?(e.consume(w),R):N(w)}function X(w){return w===null||De(w)?(e.exit("htmlFlowData"),ie(w)):(e.consume(w),X)}function ie(w){return e.exit("htmlFlow"),t(w)}}function z8(e,t,r){let o=this;return n;function n(a){return De(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):r(a)}function i(a){return o.parser.lazy[o.now().line]?r(a):t(a)}}function F8(e,t,r){return o;function o(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(Ca,t,r)}}var bT={name:"htmlText",tokenize:$8};function $8(e,t,r){let o=this,n,i,a;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),P):R===63?(e.consume(R),b):xo(R)?(e.consume(R),S):r(R)}function p(R){return R===45?(e.consume(R),c):R===91?(e.consume(R),i=0,h):xo(R)?(e.consume(R),x):r(R)}function c(R){return R===45?(e.consume(R),u):r(R)}function d(R){return R===null?r(R):R===45?(e.consume(R),f):De(R)?(a=d,B(R)):(e.consume(R),d)}function f(R){return R===45?(e.consume(R),u):d(R)}function u(R){return R===62?I(R):R===45?f(R):d(R)}function h(R){let X="CDATA[";return R===X.charCodeAt(i++)?(e.consume(R),i===X.length?y:h):r(R)}function y(R){return R===null?r(R):R===93?(e.consume(R),g):De(R)?(a=y,B(R)):(e.consume(R),y)}function g(R){return R===93?(e.consume(R),v):y(R)}function v(R){return R===62?I(R):R===93?(e.consume(R),v):y(R)}function x(R){return R===null||R===62?I(R):De(R)?(a=x,B(R)):(e.consume(R),x)}function b(R){return R===null?r(R):R===63?(e.consume(R),k):De(R)?(a=b,B(R)):(e.consume(R),b)}function k(R){return R===62?I(R):b(R)}function P(R){return xo(R)?(e.consume(R),T):r(R)}function T(R){return R===45||cr(R)?(e.consume(R),T):C(R)}function C(R){return De(R)?(a=C,B(R)):We(R)?(e.consume(R),C):I(R)}function S(R){return R===45||cr(R)?(e.consume(R),S):R===47||R===62||Vt(R)?O(R):r(R)}function O(R){return R===47?(e.consume(R),I):R===58||R===95||xo(R)?(e.consume(R),_):De(R)?(a=O,B(R)):We(R)?(e.consume(R),O):I(R)}function _(R){return R===45||R===46||R===58||R===95||cr(R)?(e.consume(R),_):L(R)}function L(R){return R===61?(e.consume(R),N):De(R)?(a=L,B(R)):We(R)?(e.consume(R),L):O(R)}function N(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),n=R,D):De(R)?(a=N,B(R)):We(R)?(e.consume(R),N):(e.consume(R),$)}function D(R){return R===n?(e.consume(R),n=void 0,M):R===null?r(R):De(R)?(a=D,B(R)):(e.consume(R),D)}function $(R){return R===null||R===34||R===39||R===60||R===61||R===96?r(R):R===47||R===62||Vt(R)?O(R):(e.consume(R),$)}function M(R){return R===47||R===62||Vt(R)?O(R):r(R)}function I(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"),q}function q(R){return We(R)?Je(e,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):F(R)}function F(R){return e.enter("htmlTextData"),a(R)}}var Is={name:"labelEnd",tokenize:G8,resolveTo:W8,resolveAll:U8},V8={tokenize:q8},j8={tokenize:J8},H8={tokenize:K8};function U8(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 W8(e,t){let r=e.length,o=0,n,i,a,s;for(;r--;)if(n=e[r][1],i){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;e[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(a){if(e[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(i=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(a=r);let l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},p={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[a][1].end)},c={type:"labelText",start:Object.assign({},e[i+o+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",l,t],["enter",p,t]],s=qr(s,e.slice(i+1,i+o+3)),s=qr(s,[["enter",c,t]]),s=qr(s,pp(t.parser.constructs.insideSpan.null,e.slice(i+o+4,a-3),t)),s=qr(s,[["exit",c,t],e[a-2],e[a-1],["exit",p,t]]),s=qr(s,e.slice(a+1)),s=qr(s,[["exit",l,t]]),zr(e,i,e.length,s),e}function G8(e,t,r){let o=this,n=o.events.length,i,a;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){i=o.events[n][1];break}return s;function s(f){return i?i._inactive?d(f):(a=o.parser.defined.includes(gi(o.sliceSerialize({start:i.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(V8,c,a?c:d)(f):f===91?e.attempt(j8,c,a?p:d)(f):a?c(f):d(f)}function p(f){return e.attempt(H8,c,d)(f)}function c(f){return t(f)}function d(f){return i._balanced=!0,r(f)}}function q8(e,t,r){return o;function o(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),n}function n(d){return Vt(d)?Os(e,i)(d):i(d)}function i(d){return d===41?c(d):Cy(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Vt(d)?Os(e,l)(d):c(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?ky(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function p(d){return Vt(d)?Os(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function J8(e,t,r){let o=this;return n;function n(s){return Sy.call(o,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return o.parser.defined.includes(gi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function a(s){return r(s)}}function K8(e,t,r){return o;function o(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n}function n(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var xT={name:"labelStartImage",tokenize:Y8,resolveAll:Is.resolveAll};function Y8(e,t,r){let o=this;return n;function n(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):t(s)}}var TT={name:"labelStartLink",tokenize:X8,resolveAll:Is.resolveAll};function X8(e,t,r){let o=this;return n;function n(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(a):t(a)}}var Hu={name:"lineEnding",tokenize:Z8};function Z8(e,t){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Je(e,t,"linePrefix")}}var _s={name:"thematicBreak",tokenize:Q8};function Q8(e,t,r){let o=0,n;return i;function i(p){return e.enter("thematicBreak"),a(p)}function a(p){return n=p,s(p)}function s(p){return p===n?(e.enter("thematicBreakSequence"),l(p)):o>=3&&(p===null||De(p))?(e.exit("thematicBreak"),t(p)):r(p)}function l(p){return p===n?(e.consume(p),o++,l):(e.exit("thematicBreakSequence"),We(p)?Je(e,s,"whitespace")(p):s(p))}}var Fr={name:"list",tokenize:rq,continuation:{tokenize:oq},exit:iq},eq={tokenize:aq,partial:!0},tq={tokenize:nq,partial:!0};function rq(e,t,r){let o=this,n=o.events[o.events.length-1],i=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,a=0;return s;function s(u){let h=o.containerState.type||(u===42||u===43||u===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||u===o.containerState.marker:Fu(u)){if(o.containerState.type||(o.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),u===42||u===45?e.check(_s,r,p)(u):p(u);if(!o.interrupt||u===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(u)}return r(u)}function l(u){return Fu(u)&&++a<10?(e.consume(u),l):(!o.interrupt||a<2)&&(o.containerState.marker?u===o.containerState.marker:u===41||u===46)?(e.exit("listItemValue"),p(u)):r(u)}function p(u){return e.enter("listItemMarker"),e.consume(u),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||u,e.check(Ca,o.interrupt?r:c,e.attempt(eq,f,d))}function c(u){return o.containerState.initialBlankLine=!0,i++,f(u)}function d(u){return We(u)?(e.enter("listItemPrefixWhitespace"),e.consume(u),e.exit("listItemPrefixWhitespace"),f):r(u)}function f(u){return o.containerState.size=i+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(u)}}function oq(e,t,r){let o=this;return o.containerState._closeFlow=void 0,e.check(Ca,n,i);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Je(e,t,"listItemIndent",o.containerState.size+1)(s)}function i(s){return o.containerState.furtherBlankLines||!We(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,a(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(tq,t,a)(s))}function a(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Je(e,e.attempt(Fr,t,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function nq(e,t,r){let o=this;return Je(e,n,"listItemIndent",o.containerState.size+1);function n(i){let a=o.events[o.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===o.containerState.size?t(i):r(i)}}function iq(e){e.exit(this.containerState.type)}function aq(e,t,r){let o=this;return Je(e,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(i){let a=o.events[o.events.length-1];return!We(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var Ry={name:"setextUnderline",tokenize:lq,resolveTo:sq};function sq(e,t){let r=e.length,o,n,i;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),!i&&e[r][1].type==="definition"&&(i=r);let a={type:"setextHeading",start:Object.assign({},e[n][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[n][1].type="setextHeadingText",i?(e.splice(n,0,["enter",a,t]),e.splice(i+1,0,["exit",e[o][1],t]),e[o][1].end=Object.assign({},e[i][1].end)):e[o][1]=a,e.push(["exit",a,t]),e}function lq(e,t,r){let o=this,n;return i;function i(p){let c=o.events.length,d;for(;c--;)if(o.events[c][1].type!=="lineEnding"&&o.events[c][1].type!=="linePrefix"&&o.events[c][1].type!=="content"){d=o.events[c][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||d)?(e.enter("setextHeadingLine"),n=p,a(p)):r(p)}function a(p){return e.enter("setextHeadingLineSequence"),s(p)}function s(p){return p===n?(e.consume(p),s):(e.exit("setextHeadingLineSequence"),We(p)?Je(e,l,"lineSuffix")(p):l(p))}function l(p){return p===null||De(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}var Pw={tokenize:pq};function pq(e){let t=this,r=e.attempt(Ca,o,e.attempt(this.parser.constructs.flowInitial,n,Je(e,e.attempt(this.parser.constructs.flow,n,e.attempt(fT,n)),"linePrefix")));return r;function o(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function n(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var Cw={resolveAll:Ew()},Sw=Rw("string"),kw=Rw("text");function Rw(e){return{tokenize:t,resolveAll:Ew(e==="text"?cq:void 0)};function t(r){let o=this,n=this.parser.constructs[e],i=r.attempt(n,a,s);return a;function a(c){return p(c)?i(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"),i(c)):(r.consume(c),l)}function p(c){if(c===null)return!0;let d=n[c],f=-1;if(d)for(;++f<d.length;){let u=d[f];if(!u.previous||u.previous.call(o,o.previous))return!0}return!1}}}function Ew(e){return t;function t(r,o){let n=-1,i;for(;++n<=r.length;)i===void 0?r[n]&&r[n][1].type==="data"&&(i=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),n=i+2),i=void 0);return e?e(r,o):r}}function cq(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),i=n.length,a=-1,s=0,l;for(;i--;){let p=n[i];if(typeof p=="string"){for(a=p.length;p.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(p===-2)l=!0,s++;else if(p!==-1){i++;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+i,_bufferIndex:i?a:o.start._bufferIndex+a},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 Ow(e,t,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},i=[],a=[],s=[],l=!0,p={consume:k,enter:P,exit:T,attempt:O(C),check:O(S),interrupt:O(S,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:y,sliceSerialize:h,now:g,defineSkip:v,write:u},d=t.tokenize.call(c,p),f;return t.resolveAll&&i.push(t),c;function u(D){return a=qr(a,D),x(),a[a.length-1]!==null?[]:(_(t,0),c.events=pp(i,c.events,c),c.events)}function h(D,$){return dq(y(D),$)}function y(D){return uq(a,D)}function g(){let{line:D,column:$,offset:M,_index:I,_bufferIndex:B}=o;return{line:D,column:$,offset:M,_index:I,_bufferIndex:B}}function v(D){n[D.line]=D.column,N()}function x(){let D;for(;o._index<a.length;){let $=a[o._index];if(typeof $=="string")for(D=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===D&&o._bufferIndex<$.length;)b($.charCodeAt(o._bufferIndex));else b($)}}function b(D){l=void 0,f=D,d=d(D)}function k(D){De(D)?(o.line++,o.column=1,o.offset+=D===-3?2:1,N()):D!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===a[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=D,l=!0}function P(D,$){let M=$||{};return M.type=D,M.start=g(),c.events.push(["enter",M,c]),s.push(M),M}function T(D){let $=s.pop();return $.end=g(),c.events.push(["exit",$,c]),$}function C(D,$){_(D,$.from)}function S(D,$){$.restore()}function O(D,$){return M;function M(I,B,q){let F,R,X,ie;return Array.isArray(I)?ue(I):"tokenize"in I?ue([I]):w(I);function w(U){return fe;function fe(me){let Re=me!==null&&U[me],Te=me!==null&&U.null,$e=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return ue($e)(me)}}function ue(U){return F=U,R=0,U.length===0?q:ve(U[R])}function ve(U){return fe;function fe(me){return ie=L(),X=U,U.partial||(c.currentConstruct=U),U.name&&c.parser.constructs.disable.null.includes(U.name)?ae(me):U.tokenize.call($?Object.assign(Object.create(c),$):c,p,Me,ae)(me)}}function Me(U){return l=!0,D(X,ie),B}function ae(U){return l=!0,ie.restore(),++R<F.length?ve(F[R]):q}}}function _(D,$){D.resolveAll&&!i.includes(D)&&i.push(D),D.resolve&&zr(c.events,$,c.events.length-$,D.resolve(c.events.slice($),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function L(){let D=g(),$=c.previous,M=c.currentConstruct,I=c.events.length,B=Array.from(s);return{restore:q,from:I};function q(){o=D,c.previous=$,c.currentConstruct=M,c.events.length=I,s=B,N()}}function N(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function uq(e,t){let r=t.start._index,o=t.start._bufferIndex,n=t.end._index,i=t.end._bufferIndex,a;if(r===n)a=[e[r].slice(o,i)];else{if(a=e.slice(r,n),o>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(o):a.shift()}i>0&&a.push(e[n].slice(0,i))}return a}function dq(e,t){let r=-1,o=[],n;for(;++r<e.length;){let i=e[r],a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
128
128
  `;break}case-3:{a=`\r
129
129
  `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&n)continue;a=" ";break}default:a=String.fromCharCode(i)}n=i===-2,o.push(a)}return o.join("")}var PT={};Cn(PT,{attentionMarkers:()=>xq,contentInitial:()=>mq,disable:()=>Tq,document:()=>fq,flow:()=>yq,flowInitial:()=>hq,insideSpan:()=>bq,string:()=>gq,text:()=>vq});var fq={42:Fr,43:Fr,45:Fr,48:Fr,49:Fr,50:Fr,51:Fr,52:Fr,53:Fr,54:Fr,55:Fr,56:Fr,57:Fr,62:gy},mq={91:mT},hq={[-2]:Vu,[-1]:Vu,32:Vu},yq={35:yT,42:_s,45:[Ry,_s],60:vT,61:Ry,95:_s,96:xy,126:xy},gq={38:by,92:vy},vq={[-5]:Hu,[-4]:Hu,[-3]:Hu,33:xT,38:by,42:$u,60:[uT,bT],91:TT,92:[hT,vy],93:Is,95:$u,96:dT},bq={null:[$u,Cw]},xq={null:[42,95]},Tq={null:[]};function CT(e){let r=cw([PT,...(e||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(yw),document:n(vw),flow:n(Pw),string:n(Sw),text:n(kw)};return o;function n(i){return a;function a(s){return Ow(o,i,s)}}}function ST(e){for(;!Py(e););return e}var Iw=/[\0\t\n\r]/g;function kT(){let e=1,t="",r=!0,o;return n;function n(i,a,s){let l=[],p,c,d,f,u;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,t="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(Iw.lastIndex=d,p=Iw.exec(i),f=p&&p.index!==void 0?p.index:i.length,u=i.charCodeAt(f),!p){t=i.slice(d);break}if(u===10&&d===f&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<f&&(l.push(i.slice(d,f)),e+=f-d),u){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:o=!0,e=1}d=f+1}return s&&(o&&l.push(-5),t&&l.push(t),l.push(null)),l}}var Pq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _w(e){return e.replace(Pq,Cq)}function Cq(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),i=n===120||n===88;return yy(r.slice(i?2:1),i?16:10)}return lp(r)||e}var Dw={}.hasOwnProperty;function RT(e,t,r){return typeof t!="string"&&(r=t,t=void 0),Sq(r)(ST(CT(r).document().write(kT()(e,t,!0))))}function Sq(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ye),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(Xe),blockQuote:i(fe),characterEscape:O,characterReference:O,codeFenced:i(me),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(me,a),codeText:i(Re,a),codeTextData:O,data:O,codeFlowValue:O,definition:i(Te),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i($e),hardBreakEscape:i(re),hardBreakTrailing:i(re),htmlFlow:i(te,a),htmlFlowData:O,htmlText:i(te,a),htmlTextData:O,image:i(be),label:a,link:i(ye),listItem:i(Ae),listItemValue:f,listOrdered:i(Ve,d),listUnordered:i(Ve),paragraph:i(ze),reference:w,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Xe),strong:i(Ke),thematicBreak:i(pt)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:U,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:Me,codeFenced:l(g),codeFencedFence:y,codeFencedFenceInfo:u,codeFencedFenceMeta:h,codeFlowValue:_,codeIndented:l(v),codeText:l(M),codeTextData:_,data:_,definition:l(),definitionDestinationString:k,definitionLabelString:x,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(D),htmlFlowData:_,htmlText:l($),htmlTextData:_,image:l(B),label:F,labelText:q,lineEnding:L,link:l(I),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ue,resourceDestinationString:R,resourceTitleString:X,resource:ie,setextHeading:l(S),setextHeadingLineSequence:C,setextHeadingText:T,strong:l(),thematicBreak:l()}};Aw(t,(e||{}).mdastExtensions||[]);let r={};return o;function o(Y){let de={type:"root",children:[]},ke={stack:[de],tokenStack:[],config:t,enter:s,exit:p,buffer:a,resume:c,data:r},W=[],G=-1;for(;++G<Y.length;)if(Y[G][1].type==="listOrdered"||Y[G][1].type==="listUnordered")if(Y[G][0]==="enter")W.push(G);else{let ne=W.pop();G=n(Y,ne,G)}for(G=-1;++G<Y.length;){let ne=t[Y[G][0]];Dw.call(ne,Y[G][1].type)&&ne[Y[G][1].type].call(Object.assign({sliceSerialize:Y[G][2].sliceSerialize},ke),Y[G][1])}if(ke.tokenStack.length>0){let ne=ke.tokenStack[ke.tokenStack.length-1];(ne[1]||ww).call(ke,void 0,ne[0])}for(de.position={start:Sa(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Sa(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},G=-1;++G<t.transforms.length;)de=t.transforms[G](de)||de;return de}function n(Y,de,ke){let W=de-1,G=-1,ne=!1,Ie,se,pe,Se;for(;++W<=ke;){let Ne=Y[W];switch(Ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ne[0]==="enter"?G++:G--,Se=void 0;break}case"lineEndingBlank":{Ne[0]==="enter"&&(Ie&&!Se&&!G&&!pe&&(pe=W),Se=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Se=void 0}if(!G&&Ne[0]==="enter"&&Ne[1].type==="listItemPrefix"||G===-1&&Ne[0]==="exit"&&(Ne[1].type==="listUnordered"||Ne[1].type==="listOrdered")){if(Ie){let at=W;for(se=void 0;at--;){let Ge=Y[at];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;se&&(Y[se][1].type="lineEndingBlank",ne=!0),Ge[1].type="lineEnding",se=at}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}pe&&(!se||pe<se)&&(Ie._spread=!0),Ie.end=Object.assign({},se?Y[se][1].start:Ne[1].end),Y.splice(se||W,0,["exit",Ie,Ne[2]]),W++,ke++}if(Ne[1].type==="listItemPrefix"){let at={type:"listItem",_spread:!1,start:Object.assign({},Ne[1].start),end:void 0};Ie=at,Y.splice(W,0,["enter",at,Ne[2]]),W++,ke++,pe=void 0,Se=!0}}}return Y[de][1]._spread=ne,ke}function i(Y,de){return ke;function ke(W){s.call(this,Y(W),W),de&&de.call(this,W)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(Y,de,ke){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([de,ke]),Y.position={start:Sa(de.start),end:void 0}}function l(Y){return de;function de(ke){Y&&Y.call(this,ke),p.call(this,ke)}}function p(Y,de){let ke=this.stack.pop(),W=this.tokenStack.pop();if(W)W[0].type!==Y.type&&(de?de.call(this,Y,W[0]):(W[1]||ww).call(this,Y,W[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Ta({start:Y.start,end:Y.end})+"): it\u2019s not open");ke.position.end=Sa(Y.end)}function c(){return pT(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Y){if(this.data.expectingFirstListItemValue){let de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function u(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.lang=Y}function h(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.meta=Y}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.value=Y.replace(/(\r?\n|\r)$/g,"")}function x(Y){let de=this.resume(),ke=this.stack[this.stack.length-1];ke.label=de,ke.identifier=gi(this.sliceSerialize(Y)).toLowerCase()}function b(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.title=Y}function k(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.url=Y}function P(Y){let de=this.stack[this.stack.length-1];if(!de.depth){let ke=this.sliceSerialize(Y).length;de.depth=ke}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function C(Y){let de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function O(Y){let ke=this.stack[this.stack.length-1].children,W=ke[ke.length-1];(!W||W.type!=="text")&&(W=He(),W.position={start:Sa(Y.start),end:void 0},ke.push(W)),this.stack.push(W)}function _(Y){let de=this.stack.pop();de.value+=this.sliceSerialize(Y),de.position.end=Sa(Y.end)}function L(Y){let de=this.stack[this.stack.length-1];if(this.data.atHardBreak){let ke=de.children[de.children.length-1];ke.position.end=Sa(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(O.call(this,Y),_.call(this,Y))}function N(){this.data.atHardBreak=!0}function D(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.value=Y}function $(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.value=Y}function M(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.value=Y}function I(){let Y=this.stack[this.stack.length-1];if(this.data.inReference){let de=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=de,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function B(){let Y=this.stack[this.stack.length-1];if(this.data.inReference){let de=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=de,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function q(Y){let de=this.sliceSerialize(Y),ke=this.stack[this.stack.length-2];ke.label=_w(de),ke.identifier=gi(de).toLowerCase()}function F(){let Y=this.stack[this.stack.length-1],de=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){let W=Y.children;ke.children=W}else ke.alt=de}function R(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.url=Y}function X(){let Y=this.resume(),de=this.stack[this.stack.length-1];de.title=Y}function ie(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function ue(Y){let de=this.resume(),ke=this.stack[this.stack.length-1];ke.label=de,ke.identifier=gi(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ve(Y){this.data.characterReferenceType=Y.type}function Me(Y){let de=this.sliceSerialize(Y),ke=this.data.characterReferenceType,W;ke?(W=yy(de,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):W=lp(de);let G=this.stack.pop();G.value+=W,G.position.end=Sa(Y.end)}function ae(Y){_.call(this,Y);let de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(Y)}function U(Y){_.call(this,Y);let de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(Y)}function fe(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function Te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $e(){return{type:"emphasis",children:[]}}function Xe(){return{type:"heading",depth:0,children:[]}}function re(){return{type:"break"}}function te(){return{type:"html",value:""}}function be(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function Ve(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Ae(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function ze(){return{type:"paragraph",children:[]}}function Ke(){return{type:"strong",children:[]}}function He(){return{type:"text",value:""}}function pt(){return{type:"thematicBreak"}}}function Sa(e){return{line:e.line,column:e.column,offset:e.offset}}function Aw(e,t){let r=-1;for(;++r<t.length;){let o=t[r];Array.isArray(o)?Aw(e,o):kq(e,o)}}function kq(e,t){let r;for(r in t)if(Dw.call(t,r))switch(r){case"canContainEols":{let o=t[r];o&&e[r].push(...o);break}case"transforms":{let o=t[r];o&&e[r].push(...o);break}case"enter":case"exit":{let o=t[r];o&&Object.assign(e[r],o);break}}}function ww(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ta({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is still open")}function Ey(e){let t=this;t.parser=r;function r(o){return RT(o,le(j(j({},t.data("settings")),e),{extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]}))}}function Nw(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function Mw(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
130
130
  `}]}function Lw(e,t){let r=t.value?t.value+`