(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7255],{5085:()=>{},8755:()=>{},14051:(e,t,s)=>{e.exports=s(34701)()},24769:()=>{},24964:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var i=s(95155),a=s(12115),r=s(29722),n=s(83640);s(28994);let u=(0,n.g)("tag"),l=Object.freeze({tag:u,label:`${u}__label`,icon:`${u}__icon`,rounded:`${u}--rounded`,variant:{primary:`${u}--primary`,secondary:`${u}--secondary`,outline:`${u}--outline`,tertiary:`${u}--tertiary`,pink:`${u}--pink`,red:`${u}--red`,green:`${u}--green`,blue:`${u}--blue`,orange:`${u}--orange`,purple:`${u}--purple`,violet:`${u}--violet`,blur:`${u}--blur`},size:{s:`${u}--s`,m:`${u}--m`,l:`${u}--l`},iconMargin:{left:`${u}__icon--left`,right:`${u}__icon--right`}}),o=(0,a.forwardRef)(({label:e,size:t="m",rounded:s,variant:a="primary",iconLeft:n,iconRight:u,onIconLeftClick:o,onIconRightClick:h,className:d,style:p,dataQa:c,dataId:m,...g},f)=>(0,i.jsx)(i.Fragment,{children:e&&(0,i.jsxs)("div",{ref:f,className:(0,r.A)(l.tag,l.variant[a],l.size[t],{[l.rounded]:s},d),style:p,...g,"data-id":m,"data-qa":c,children:[n&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(l.icon,l.iconMargin.left,{[l.size.l]:"l"===t}),onClick:e=>null==o?void 0:o(e),disabled:!o,children:n}),(0,i.jsx)("span",{className:(0,r.A)(l.label,l.size[t]),children:e}),u&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(l.icon,l.iconMargin.right,{[l.size.l]:"l"===t}),onClick:e=>null==h?void 0:h(e),disabled:!h,children:u})]})}));o.displayName="Tag"},25007:()=>{},28994:()=>{},34337:(e,t,s)=>{"use strict";s.d(t,{u:()=>a});var i=s(12115);let a=(e=!1)=>{let[t,s]=(0,i.useState)(e),a=(0,i.useCallback)(()=>s(!0),[]);return{value:t,show:a,hide:(0,i.useCallback)(()=>s(!1),[]),toggle:(0,i.useCallback)(()=>s(e=>!e),[])}}},34701:(e,t,s)=>{"use strict";var i=s(82114);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,s,a,r,n){if(n!==i){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:a};return s.PropTypes=s,s}},37637:(e,t,s)=>{"use strict";s.d(t,{I:()=>m});var i=s(95155),a=s(12115),r=s(76701),n=s(29722),u=s(86969);s(42879);var l=s(92681),o=s(34337),h=s(83640);s(56601);let d=(...e)=>(...t)=>{e.forEach(e=>{null==e||e(...t)})},p=(0,h.g)("input-base"),c={wrapper:p,input:`${p}__input`,container:`${p}__container`,label:`${p}__label`,field:`${p}__field`,slotLeft:`${p}__slot-left`,rightLabel:`${p}__right-label`,caption:`${p}__caption`,placeholder:{visible:`${p}__placeholder`,hidden:`${p}__hidden`},states:{primary:`${p}--primary`,secondary:`${p}--secondary`,error:`${p}--error`,success:`${p}--success`,s:`${p}--s`,m:`${p}--m`,l:`${p}--l`,focused:`${p}--focused`,disabled:`${p}--disabled`,active:`${p}--active`,hasLabel:`${p}--has-label`,accent:`${p}--accent`}},m=(0,a.forwardRef)(({icon:e,rightLabel:t,slotLeft:s,disabled:h,state:p,size:m="m",variant:g="primary",label:f,value:k,placeholder:_,maskPlaceholder:v,autoFocus:C=!1,maskPlaceholderVariant:b="default",caption:A,type:y="text",inputMode:x="text",hasCaption:E,className:F,style:w,dataQa:S,dataId:B,inputRef:V,onChange:D,onFocus:I,onBlur:M,onKeyDown:T,...P},R)=>{let O=(0,a.useId)(),{value:$,show:j,hide:N}=(0,o.u)(),L=(0,a.useRef)(null),z=(0,r.SV)([V,L]),U=(0,a.useMemo)(()=>$||!!k||!!_,[k,$,_]),q=(0,a.useCallback)(()=>{var e;null==(e=L.current)||e.focus()},[]),W=(0,a.useMemo)(()=>{if(!v)return null;let e={hidden:k??"",visible:v.substring((null==k?void 0:k.length)??0)};return v.length===(null==k?void 0:k.length)?null:e},[v,k]);return(0,a.useEffect)(()=>{var e,t,s;if(!C)return;let i=(null==(e=L.current)?void 0:e.value.length)??0;null==(t=L.current)||t.focus(),null==(s=L.current)||s.setSelectionRange(i,i)},[C]),(0,i.jsxs)("div",{className:(0,n.A)(F,c.wrapper),style:w,"data-qa":S,"data-id":B,children:[(0,i.jsxs)("div",{className:(0,n.A)(c.input,c.states[g],c.states[m],{[c.states.focused]:$,[c.states.error]:"error"===p,[c.states.success]:"success"===p,[c.states.disabled]:!!h,[c.states.hasLabel]:f}),onClick:q,ref:R,children:[s&&(0,i.jsx)("div",{className:c.slotLeft,children:s}),(0,i.jsxs)("label",{htmlFor:O,className:c.container,children:[f&&(0,i.jsx)("span",{className:(0,n.A)(c.label,{[c.states.active]:U,[c.states.s]:"s"===m,[c.states.disabled]:h,[c.states.error]:"error"===p,[c.states.success]:"success"===p}),children:f}),W&&!!k&&(0,i.jsxs)("div",{className:(0,n.A)(c.placeholder.visible,{[c.states.accent]:"accent"===b}),children:[W.hidden&&(0,i.jsx)("span",{className:c.placeholder.hidden,children:W.hidden}),W.visible]}),(0,i.jsx)("input",{...P,id:O,ref:z,className:(0,n.A)(c.field,{[c.states.s]:"s"===m,[c.states.hasLabel]:f,[c.states.disabled]:h}),type:y,inputMode:x,autoComplete:"off",placeholder:_,value:k,disabled:h,onChange:e=>{null==D||D(e.target.value,e)},onFocus:d(j,I),onBlur:d(N,M),onKeyDown:e=>{("Escape"===e.key||"Esc"===e.key)&&(e.preventDefault(),null==D||D("",{target:{value:""}})),null==T||T(e)}})]}),t&&(0,i.jsx)("div",{className:(0,n.A)(c.rightLabel,{[c.states.disabled]:h}),children:t}),e]}),(E||A)&&(0,i.jsx)(u.C,{dataQa:(0,l.g)(`${S}-caption`,!!S),className:(0,n.A)(c.caption,{[c.states.disabled]:h}),state:p,withoutIcon:!0,children:A})]})});m.displayName="InputBase"},43780:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var i=s(95155),a=s(29722),r=s(86253),n=s(83640);s(8755);let u=Object.freeze({text:(0,n.g)("text")});function l({as:e,className:t,style:s,children:n,size:o,weight:h,lineClamp:d,dataQa:p,dataId:c,...m}){return(0,i.jsx)(e||"span",{className:(0,a.A)(u.text,t),style:{...o&&{fontSize:`var(--font-size-${o})`,lineHeight:`var(--font-line-height-${o})`},...h&&{fontWeight:`var(--font-weight-${h})`},...d&&{WebkitLineClamp:d,lineClamp:d,...r.l},...s},...m,"data-id":c,"data-qa":p,children:n})}l.displayName="Text"},51736:(e,t,s)=>{"use strict";s.d(t,{k:()=>u});var i=s(12115);let a={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},r={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},n=e=>i.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},i.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10a9.971 9.971 0 007.071-2.929A9.97 9.97 0 0022 12c0-5.523-4.477-10-10-10zM3.5 12a8.5 8.5 0 1117 0 8.5 8.5 0 01-17 0zm8.872-4.977C13.657 7.18 15 8.15 15 9.761c0 .698-.179 1.238-.504 1.665-.307.401-.704.644-.98.812-.313.191-.477.293-.595.43-.083.096-.17.246-.17.584a.75.75 0 01-1.5 0c0-.66.193-1.164.531-1.558.28-.326.64-.544.89-.695l.062-.037c.287-.175.452-.29.568-.442.096-.126.198-.335.198-.759 0-.633-.532-1.158-1.309-1.252-.716-.087-1.454.236-1.717 1.2a.75.75 0 01-1.447-.394c.486-1.78 1.998-2.454 3.345-2.292zM11.999 15a1 1 0 10.002 2 1 1 0 00-.002-2z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function u({className:e,style:t,boxSize:s,size:l,onClick:o}){return i.createElement("span",{className:e,style:{...a,...o&&{cursor:"pointer"},...l&&{fontSize:`${l}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...o?{role:"button",tabIndex:"0",onClick:o}:{}},i.createElement(n,{viewBox:"0 0 24 24",style:r}))}u.displayName="IconFdsQuestionCircleO"},56082:(e,t,s)=>{"use strict";s.d(t,{H:()=>h});var i=s(95155),a=s(29722),r=s(86253),n=s(83640);s(95124);let u={display:"h1",hero:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},l=(0,n.g)("heading"),o=Object.freeze({heading:l,states:Object.freeze({display:`${l}--display`,hero:`${l}--hero`,h1:`${l}--h1`,h2:`${l}--h2`,h3:`${l}--h3`,h4:`${l}--h4`,h5:`${l}--h5`,h6:`${l}--h6`})}),h=({as:e,children:t,weight:s,type:n,lineClamp:l,className:h,style:d,dataQa:p,dataId:c,...m})=>{var g;let f=e||u[n]||"div",k=/^h[1-6]$/.test(f),_=(null==(g=n.match(/\d+/))?void 0:g[0])||1;return(0,i.jsx)(f,{className:(0,a.A)(o.heading,o.states[n],h),style:{...s?{fontWeight:`var(--font-weight-${s})`}:void 0,...l?{WebkitLineClamp:l,lineClamp:l,...r.l}:void 0,...d},role:k?null:"heading","aria-level":k?null:_,...m,"data-id":c,"data-qa":p,children:t})};h.displayName="Heading"},56601:()=>{},63959:(e,t,s)=>{"use strict";s.d(t,{D:()=>i.H});var i=s(56082)},69679:(e,t,s)=>{"use strict";s.d(t,{s:()=>a,t:()=>r});let i=(0,s(83640).g)("tooltip"),a=Object.freeze({tooltip:i,text:`${i}__text`,wrapper:`${i}__wrapper`,inverted:`${i}--inverted`}),r="M8 10C6 12.58 3.43 16 0 16L16 16C12.58 16 10 12.58 8 10Z"},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},82726:(e,t,s)=>{"use strict";s.d(t,{C:()=>o});var i=s(95155),a=s(57349),r=s(55727),n=s(29722);let u=(0,s(7596).g)("check-all","sc"),l=Object.freeze({wrapper:`${u}__wrapper`,link:`${u}__link`,icon:`${u}__icon`,iconGray:`${u}__icon--gray`}),o=({children:e,className:t,linkClassName:s,iconGrayBackground:u,Link:o,event:h,href:d,dataLayerPush:p,onClick:c})=>{let m=o??r.N;return(0,i.jsx)("div",{className:(0,n.A)(l.wrapper,t),onClick:()=>{h&&p(h)},onClickCapture:e=>{let t=e.target instanceof Element?e.target.closest("a[href]"):null;t&&e.currentTarget.contains(t)&&(null==c||c())},children:(0,i.jsxs)(m,{className:(0,n.A)(l.link,s),href:d,children:[e,(0,i.jsx)("span",{className:(0,n.A)(l.icon,{[l.iconGray]:u}),children:(0,i.jsx)(a.K,{size:24})})]})})}},85972:(e,t,s)=>{"use strict";s.d(t,{m:()=>c});var i=s(95155),a=s(12115),r=s(76701),n=s(17294),u=s(9683),l=s(29722),o=s(37370),h=s(92681),d=s(69679);s(25007);let p=({children:e,moveToBody:t})=>t?(0,i.jsx)(r.XF,{id:o.T,children:e}):(0,i.jsx)(i.Fragment,{children:e}),c=(0,a.forwardRef)(({position:e="top",text:t,zIndex:s=1,inverted:o,withoutTail:c,children:m,boundingOffset:g=12,boundaryPadding:f,moveToBody:k=!1,hideWhenOutOfBounds:_=!1,style:v,className:C,dataQa:b,dataId:A,...y},x)=>{let[E,F]=(0,a.useState)(!1),w=(0,a.useRef)(null),{refs:S,floatingStyles:B,context:V,middlewareData:D}=(0,r.we)({open:E,onOpenChange:F,placement:e,whileElementsMounted:n.ll,middleware:[(0,u.cY)({mainAxis:g}),(0,u.UU)({fallbackAxisSideDirection:"start",crossAxis:!1,...void 0!==f&&{padding:f}}),(0,u.BN)({...void 0!==f&&{padding:f}}),(0,u.UE)({element:w,padding:8}),..._?[(0,u.jD)({strategy:"escaped",padding:-24})]:[]]}),I=(0,r.Mk)(V,{delay:300}),{getReferenceProps:M,getFloatingProps:T}=(0,r.bv)([I]),P=(0,r.DL)(V,{duration:300});return(0,a.useImperativeHandle)(x,()=>({getActivatorElement:S.reference,getTooltipElement:S.floating})),(0,a.useEffect)(()=>{var e;(null==(e=D.hide)?void 0:e.escaped)&&F(!1)},[D.hide]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{"data-qa":(0,h.g)(`${b}-activator`,!!b),ref:S.setReference,...M,className:d.s.wrapper,children:m}),P.isMounted&&(0,i.jsx)(p,{moveToBody:k,children:(0,i.jsxs)("div",{role:"tooltip",ref:S.setFloating,style:{...B,...P.styles,...v,zIndex:s},className:(0,l.A)(d.s.tooltip,C,{[d.s.inverted]:o}),...T,...y,"data-qa":b,"data-id":A,children:[(0,i.jsx)("span",{className:(0,l.A)(d.s.text,{[d.s.inverted]:o}),children:t}),!c&&(0,i.jsx)(r.ie,{ref:w,context:V,width:16,d:d.t,fill:o?"var(--color-white)":"var(--color-black-500)"})]})})]})});c.displayName="Tooltip"},91501:(e,t,s)=>{"use strict";s.d(t,{g:()=>i});let i=()=>Date.now().toString()+Math.random().toString(36).slice(2,9)},92670:(e,t,s)=>{"use strict";s.d(t,{p:()=>a});let i=["credits","microCredits","autoCredits","cards"],a=(e,t)=>{if(typeof window>"u")return;let{pathname:s}=window.location;if("/"!==s&&"/home"!==s&&"/home/"!==s)return;let a=t=>{try{e({event:"data-event",eventCategory:t,eventAction:"click_button",eventLabel:"undefined",eventNameCard:"undefined",eventUrl:"undefined",eventValue:"undefined"})}catch{return}};"deposits"===t?a("ab_homepage_tolko_vklad"):(t&&i.includes(t)&&a("ab_homepage_tolko_kredit"),a("ab_homepage_krome_vkladov"))}},95124:()=>{},99639:(e,t,s)=>{"use strict";let i,a;s.r(t),s.d(t,{BestOffers:()=>eG,BestOffersTheme:()=>ev,isOsagoOrKasko:()=>eC}),s(24769);var r,n,u=s(95155),l=s(12115),o=s(66216),h=s(63959),d=s(43780),p=s(29722),c=s(92670),m=s(82726),g=s(45676),f=s(8260),k=s(57349),_=s(7596),v=s(24691),C=s(17194),b=s(51736),A=s(85972),y=s(24964);function x(e){return"string"==typeof e||e instanceof String}function E(e){var t;return"object"==typeof e&&null!=e&&(null==e||null==(t=e.constructor)?void 0:t.name)==="Object"}let F="NONE",w="LEFT",S="FORCE_LEFT",B="RIGHT",V="FORCE_RIGHT";function D(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function I(e,t){let s;if(t===e)return!0;let i=Array.isArray(t),a=Array.isArray(e);if(i&&a){if(t.length!=e.length)return!1;for(s=0;s<t.length;s++)if(!I(t[s],e[s]))return!1;return!0}if(i!=a)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){let i=t instanceof Date,a=e instanceof Date;if(i&&a)return t.getTime()==e.getTime();if(i!=a)return!1;let r=t instanceof RegExp,n=e instanceof RegExp;if(r&&n)return t.toString()==e.toString();if(r!=n)return!1;let u=Object.keys(t);for(s=0;s<u.length;s++)if(!Object.prototype.hasOwnProperty.call(e,u[s]))return!1;for(s=0;s<u.length;s++)if(!I(e[u[s]],t[u[s]]))return!1;return!0}return!!t&&!!e&&"function"==typeof t&&"function"==typeof e&&t.toString()===e.toString()}class M{constructor(e){for(Object.assign(this,e);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?F:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?B:w}}function T(e,t){return new T.InputMask(e,t)}function P(e){if(null==e)throw Error("mask property should be defined");return e instanceof RegExp?T.MaskedRegExp:x(e)?T.MaskedPattern:e===Date?T.MaskedDate:e===Number?T.MaskedNumber:Array.isArray(e)||e===Array?T.MaskedDynamic:T.Masked&&e.prototype instanceof T.Masked?e:T.Masked&&e instanceof T.Masked?e.constructor:e instanceof Function?T.MaskedFunction:(console.warn("Mask not found for mask",e),T.Masked)}function R(e){if(!e)throw Error("Options in not defined");if(T.Masked){if(e.prototype instanceof T.Masked)return{mask:e};let{mask:t,...s}=e instanceof T.Masked?{mask:e}:E(e)&&e.mask instanceof T.Masked?e:{};if(t){let e=t.mask;return{...function e(t,s){return Array.isArray(s)?e(t,(e,t)=>s.includes(t)):Object.entries(t).reduce((e,t)=>{let[i,a]=t;return s(a,i)&&(e[i]=a),e},{})}(t,(e,t)=>!t.startsWith("_")),mask:t.constructor,_mask:e,...s}}}return E(e)?{...e}:{mask:e}}function O(e){if(T.Masked&&e instanceof T.Masked)return e;let t=R(e),s=P(t.mask);if(!s)throw Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===s&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new s(t)}T.createMask=O;class ${get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}T.MaskElement=$;class j extends ${constructor(e){super(),this.input=e,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 e,t,s;return null!=(e=null==(t=(s=this.input).getRootNode)?void 0:t.call(s))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){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",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(90===e.keyCode&&e.shiftKey&&(e.metaKey||e.ctrlKey)||89===e.keyCode&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&90===e.keyCode&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(!e.isComposing&&this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}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={}}}T.HTMLMaskElement=j;class N extends j{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}T.HTMLMaskElement=j;class L extends j{get _unsafeSelectionStart(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s<i?s:i}get _unsafeSelectionEnd(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s>i?s:i}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;let s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);let i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}T.HTMLContenteditableMaskElement=L;class z{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>z.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,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}}z.MAX_LENGTH=100;class U{constructor(e,t){this.el=e instanceof $?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new L(e):new N(e),this.masked=O(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new z,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._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof T.Masked)&&this.masked.constructor===P(e))return void this.masked.updateOptions({mask:e});let t=e instanceof T.Masked?e:O({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,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(e,t){let s=this._listeners[e];s&&s.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){let t=this.masked.unmaskedValue,s=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,r=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==i;this._unmaskedValue=t,this._value=s,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){let{mask:t,...s}=e,i=!this.maskEquals(t),a=this.masked.optionsIsChanged(s);i&&(this.mask=t),a&&this.masked.updateOptions(s),(i||a)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,w))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;let s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();let t=new M({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,i=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?t.removeDirection:F,r=this.masked.nearestInputPos(t.startChangePos+i,a);a!==F&&(r=this.masked.nearestInputPos(r,F)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}T.InputMask=U;class q{static normalize(e){return Array.isArray(e)?e:[e,new q]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}T.ChangeDetails=q;class W{constructor(e,t,s){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";let t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";let e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class K{constructor(e){this._value="",this._update({...K.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new W(this.extractInput(e,t),e)}appendTail(e){return x(e)&&(e=new W(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new q({inserted:e,rawInserted:e})):new q}_appendChar(e,t,s){let i;void 0===t&&(t={});let a=this.state;if([e,i]=this.doPrepareChar(e,t),e&&!(i=i.aggregate(this._appendCharRaw(e,t))).rawInserted&&"pad"===this.autofix){let s=this.state;this.state=a;let r=this.pad(t),n=this._appendCharRaw(e,t);r=r.aggregate(n),n.rawInserted||r.equals(i)?i=r:this.state=s}if(i.inserted){let e,r=!1!==this.doValidate(t);if(r&&null!=s){let t=this.state;if(!0===this.overwrite){e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.unshift(this.displayValue.length-i.tailShift)}let a=this.appendTail(s);if(!((r=a.rawInserted.length===s.toString().length)&&a.inserted)&&"shift"===this.overwrite){this.state=t,e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.shift();r=(a=this.appendTail(s)).rawInserted.length===s.toString().length}r&&a.inserted&&(this.state=t)}!r&&(i=new q,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new q}_appendEager(){return new q}append(e,t,s){let i;if(!x(e))throw Error("value should be string");let a=x(s)?new W(String(s)):s;null!=t&&t.tail&&(t._beforeTailState=this.state),[e,i]=this.doPrepare(e,t);for(let s=0;s<e.length;++s){let r=this._appendChar(e[s],t,a);if(!r.rawInserted&&!this.doSkipInvalid(e[s],t,a))break;i.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&i.aggregate(this._appendEager()),null!=a&&(i.tailShift+=this.appendTail(a).tailShift),i}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new q}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;let t=this.rawInputValue,s=this.value,i=e();return this.rawInputValue=t,this.value&&this.value!==s&&0===s.indexOf(this.value)&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;let t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return void 0===t&&(t={}),q.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),q.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,i,a){let r;void 0===s&&(s=""),void 0===i&&(i=F),void 0===a&&(a={input:!0});let n=e+t,u=this.extractTail(n),l=!0===this.eager||"remove"===this.eager;l&&(i=function(e){switch(e){case w:return S;case B:return V;default:return e}}(i),r=this.extractInput(0,n,{raw:!0}));let o=e,h=new q;if(i!==F&&(h.tailShift=(o=this.nearestInputPos(e,t>1&&0!==e&&!l?F:i))-e),h.aggregate(this.remove(o)),l&&i!==F&&r===this.rawInputValue)if(i===S){let e;for(;r===this.rawInputValue&&(e=this.displayValue.length);)h.aggregate(new q({tailShift:-1})).aggregate(this.remove(e-1))}else i===V&&u.unshift();return h.aggregate(this.append(s,a,u))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!I(this,e)}typedValueEquals(e){let t=this.typedValue;return e===t||K.EMPTY_VALUES.includes(e)&&K.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new q}}K.DEFAULTS={skipInvalid:!0},K.EMPTY_VALUES=[void 0,null,""],T.Masked=K;class H{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=x(e)?new W(String(e)):e;let t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof W)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof H){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof T.MaskedPattern))return new W(this.toString()).appendTo(e);let t=new q;for(let s=0;s<this.chunks.length;++s){let i,a=this.chunks[s],r=e._mapPosToBlock(e.displayValue.length),n=a.stop;if(null!=n&&(!r||r.index<=n)&&((a instanceof H||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),i=a instanceof H&&e._blocks[n]),i){let s=i.appendTail(a);t.aggregate(s);let r=a.toString().slice(s.rawInserted.length);r&&t.aggregate(e.append(r,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){let{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(e=>{let t="chunks"in e?new H:new W;return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";let t=null!=e?e-this.from:e,s=0;for(;s<this.chunks.length;){let e=this.chunks[s],i=e.unshift(t);if(e.toString()){if(!i)break;++s}else this.chunks.splice(s,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){let t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class Y{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:i}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){let e=this._log.pop();return e&&(this.state=e),e}bindBlock(){!this.block&&(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,S),0!==this.offset))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,w),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,w),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,V),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,F),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,F),!0})}}class G{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new q}nearestInputPos(e,t){void 0===t&&(t=F);let s=this._value.length;switch(t){case w:case S:return 0;default:return s}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===s&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new q;let s=!0===this.eager||"append"===this.eager,i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,a=new q({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let e=new q;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new W("")}appendTail(e){return x(e)&&(e=new W(String(e))),e.appendTo(this)}append(e,t,s){let i=this._appendChar(e[0],t);return null!=s&&(i.tailShift+=this.appendTail(s).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class X{constructor(e){const{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n,...u}=e;this.masked=O(u),Object.assign(this,{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1)?(this.isFilled=!1,this.masked.remove(e,t)):new q}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new q;let s=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&!1===this.doValidate(t)&&(i=new q,this.masked.state=s),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new q:(this.isFilled=!0,new q({inserted:this.placeholderChar}))}_appendEager(){return new q}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){void 0===t&&(t=F);let s=this.value.length,i=Math.min(Math.max(e,0),s);switch(t){case w:case S:return this.isComplete?i:0;case B:case V:return this.isComplete?i:s;default:return i}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new q}}X.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Z extends K{updateOptions(e){super.updateOptions(e)}_update(e){let t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}T.MaskedRegExp=Z;class Q extends K{constructor(e){super({...Q.DEFAULTS,...e,definitions:Object.assign({},X.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){let e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let t=this.mask;if(!t||!e)return;let s=!1,i=!1;for(let a=0;a<t.length;++a){if(this.blocks){let e=t.slice(a),s=Object.keys(this.blocks).filter(t=>0===e.indexOf(t));s.sort((e,t)=>t.length-e.length);let i=s[0];if(i){let{expose:e,repeat:t,...s}=R(this.blocks[i]),r={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:t,parent:this},n=null!=t?new T.RepeatBlock(r):O(r);n&&(this._blocks.push(n),e&&(this.exposeBlock=n),this._maskedBlocks[i]||(this._maskedBlocks[i]=[]),this._maskedBlocks[i].push(this._blocks.length-1)),a+=i.length-1;continue}}let r=t[a],n=r in e;if(r===Q.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===r||"}"===r){s=!s;continue}if("["===r||"]"===r){i=!i;continue}if(r===Q.ESCAPE_CHAR){if(!(r=t[++a]))break;n=!1}let u=n?new X({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...R(e[r]),parent:this}):new G({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(u)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e)return void this.reset();let{_blocks:t,...s}=e;this._blocks.forEach((e,s)=>e.state=t[s]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;let t=new q,s=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==s)return t;this._blocks[s].isFilled&&++s;for(let e=s;e<this._blocks.length;++e){let s=this._blocks[e]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._mapPosToBlock(this.displayValue.length),i=new q;if(!s)return i;for(let r=s.index,n;n=this._blocks[r];++r){var a;let s=n._appendChar(e,{...t,_beforeTailState:null==(a=t._beforeTailState)||null==(a=a._blocks)?void 0:a[r]});if(i.aggregate(s),s.consumed)break}return i}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=new H;return e===t||this._forEachBlocksInRange(e,t,(e,t,i,a)=>{let r=e.extractTail(i,a);r.stop=this._findStopBefore(t),r.from=this._blockStartPos(t),r instanceof H&&(r.blockIndex=t),s.extend(r)}),s}extractInput(e,t,s){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===s&&(s={}),e===t)return"";let i="";return this._forEachBlocksInRange(e,t,(e,t,a,r)=>{i+=e.extractInput(a,r,s)}),i}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){let i=this._stops[s];if(i<=e)t=i;else break}return t}_appendPlaceholder(e){let t=new q;if(this.lazy&&null==e)return t;let s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;let i=s.index,a=null!=e?e:this._blocks.length;return this._blocks.slice(i,a).forEach(s=>{if(!s.lazy||null!=e){var i;t.aggregate(s._appendPlaceholder(null==(i=s._blocks)?void 0:i.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){let i=this._blocks[s],a=t.length;if(e<=(t+=i.displayValue).length)return{index:s,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+=t.displayValue.length,0)}_forEachBlocksInRange(e,t,s){void 0===t&&(t=this.displayValue.length);let i=this._mapPosToBlock(e);if(i){let e=this._mapPosToBlock(t),a=e&&i.index===e.index,r=i.offset,n=e&&a?e.offset:this._blocks[i.index].displayValue.length;if(s(this._blocks[i.index],i.index,r,n),e&&!a){for(let t=i.index+1;t<e.index;++t)s(this._blocks[t],t,0,this._blocks[t].displayValue.length);s(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s.aggregate(e.remove(i,a))}),s}nearestInputPos(e,t){if(void 0===t&&(t=F),!this._blocks.length)return 0;let s=new Y(this,e);if(t===F)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===w||t===S){if(t===w){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===w){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===S?0:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:0}return t===B||t===V?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled())?s.pos:t===V?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:this.nearestInputPos(e,w):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s+=e.totalInputPositions(i,a)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){let t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){let t=new q;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}Q.DEFAULTS={...K.DEFAULTS,lazy:!0,placeholderChar:"_"},Q.STOP_CHAR="`",Q.ESCAPE_CHAR="\\",Q.InputDefinition=X,Q.FixedDefinition=G,T.MaskedPattern=Q;class J extends Q{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){let{to:t=this.to||0,from:s=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...r}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,i),this.autofix=a;let n=String(this.from).padStart(this.maxLength,"0"),u=String(this.to).padStart(this.maxLength,"0"),l=0;for(;l<u.length&&u[l]===n[l];)++l;r.mask=u.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="",[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(t="0".repeat(i.length)+a,s="9".repeat(i.length)+a),[t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9")]}doPrepareChar(e,t){let s;return void 0===t&&(t={}),[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);let s=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],t):Number(a)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(i[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){let t=this.value;if(-1===t.search(/[^0]/)&&t.length<=this._matchFrom)return!0;let[s,i]=this.boundaries(t);return this.from<=Number(i)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){let t=new q;if(this.value.length===this.maxLength)return t;let s=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let s=0;s<i;++s)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(e=>this._appendCharRaw(e))}return t}}T.MaskedRange=J;class ee extends Q{static extractPatternOptions(e){let{mask:t,pattern:s,...i}=e;return{...i,mask:x(t)?t:s}}constructor(e){super(ee.extractPatternOptions({...ee.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){let{mask:t,pattern:s,blocks:i,...a}={...ee.DEFAULTS,...e},r=Object.assign({},ee.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,i),super._update({...a,mask:x(t)?t:s,blocks:r})}doValidate(e){let t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(ee.extractPatternOptions(e))}}ee.GET_DEFAULT_BLOCKS=()=>({d:{mask:J,from:1,to:31,maxLength:2},m:{mask:J,from:1,to:12,maxLength:2},Y:{mask:J,from:1900,to:9999}}),ee.DEFAULTS={...Q.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:(e,t)=>{let[s,i,a]=e.split(".").map(Number);return new Date(a,i-1,s)}},T.MaskedDate=ee;class et extends K{constructor(e){super({...et.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{let{expose:t,...s}=R(e),i=O({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return t&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){void 0===e&&(e=""),void 0===t&&(t={}),void 0===s&&(s="");let i=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,a=this.rawInputValue,r=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:a,n=a.slice(r.length),u=this.currentMask,l=new q,o=null==u?void 0:u.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==u?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),l.tailShift=this.currentMask.value.length-i.length),n&&(l.tailShift+=this.currentMask.append(n,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),l}_appendPlaceholder(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){let t=new q;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(s=e._beforeTailState)?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return void 0===t&&(t={}),void 0===s&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[s,i]=super.doPrepare(e,t);if(this.currentMask){let e;[s,e]=super.doPrepare(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(e,t);if(this.currentMask){let e;[s,e]=super.doPrepareChar(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return!!(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){let s=new q;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){let{compiledMasks:t,currentMaskRef:s,currentMask:i,...a}=e;t&&this.compiledMasks.forEach((e,s)=>e.state=t[s]),null!=s&&(this.currentMask=s,this.currentMask.state=i),super.state=a}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;let{mask:i,...a}=e[s];return I(t,a)&&t.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}et.DEFAULTS={...K.DEFAULTS,dispatch:(e,t,s,i)=>{if(!t.compiledMasks.length)return;let a=t.rawInputValue,r=t.compiledMasks.map((r,n)=>{let u=t.currentMask===r,l=u?r.displayValue.length:r.nearestInputPos(r.displayValue.length,S);return r.rawInputValue!==a?(r.reset(),r.append(a,{raw:!0})):u||r.remove(l),r.append(e,t.currentMaskFlags(s)),r.appendTail(i),{index:n,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(l,r.nearestInputPos(r.displayValue.length,S)))}});return r.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[r[0].index]}},T.MaskedDynamic=et;class es extends Q{constructor(e){super({...es.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){let{enum:t,...s}=e;if(t){let e=t.map(e=>e.length),i=Math.min(...e),a=Math.max(...e)-i;s.mask="*".repeat(i),a&&(s.mask+="["+"*".repeat(a)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){void 0===t&&(t={});let s=Math.min(this.nearestInputPos(0,V),this.value.length),i=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,s));if(i.length){1===i.length&&this._forEachBlocksInRange(0,this.value.length,(e,s)=>{let a=i[0][s];s>=this.value.length||a===e.value||(e.reset(),e._appendChar(a,t))});let e=super._appendCharRaw(i[0][this.value.length],t);return 1===i.length&&i[0].slice(this.unmaskedValue.length).split("").forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new q({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new W("",e)}remove(e,t){let s;if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new q;let i=Math.min(super.nearestInputPos(0,V),this.value.length);for(s=e;s>=0&&!(this.enum.filter(e=>this.matchValue(e,this.value.slice(i,s),i)).length>1);--s);let a=super.remove(s,t);return a.tailShift+=s-e,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}es.DEFAULTS={...Q.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},T.MaskedEnum=es;class ei extends K{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}T.MaskedFunction=ei;class ea extends K{constructor(e){super({...ea.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+D(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=RegExp(e+"\\d*"+t),this._mapToRadixRegExp=RegExp("["+this.mapToRadix.map(D).join("")+"]","g"),this._thousandsSeparatorRegExp=RegExp(D(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){let t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(i.skip=!0),!s||this.allowPositive||this.value||"-"===s||i.aggregate(this._appendChar("-")),[s,i]}_separatorsCount(e,t){void 0===t&&(t=!1);let s=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){let s;void 0===t&&(t={});let i=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);let r=this._value;this._value+=e;let n=!isNaN(this.number),u=!1;if(n){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(ea.UNMASKED_RADIX,this.radix),u||(u=r===this._value&&!t.tail)):n=!1),n&&(n=!!this._value.match(this._numberRegExp))}n?s=new q({inserted:this._value.slice(r.length),rawInserted:u?"":e,skip:u}):(this._value=r,s=new q),this._value=this._insertThousandsSeparators(this._value);let l=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(l);return s.tailShift+=(o-a)*this.thousandsSeparator.length,s}_findSeparatorAround(e){if(this.thousandsSeparator){let t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return -1}_adjustRangeWithSeparators(e,t){let s=this._findSeparatorAround(e);s>=0&&(e=s);let i=this._findSeparatorAround(t);return i>=0&&(t=i+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);let s=this.value.slice(0,e),i=this.value.slice(t),a=this._separatorsCount(s.length);return this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+i)),new q({tailShift:(this._separatorsCountFromSlice(s)-a)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case F:case w:case S:{let s=this._findSeparatorAround(e-1);if(s>=0){let i=s+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===S)return s}break}case B:case V:{let t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){let e=this.number,t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){let t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,s,i)=>t+i),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;let t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){void 0===t&&(t={});let i=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===ea.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ea.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(ea.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||ea.EMPTY_VALUES.includes(e)&&ea.EMPTY_VALUES.includes(this.typedValue))&&(0!==e||""!==this.value)}}ea.UNMASKED_RADIX=".",ea.EMPTY_VALUES=[...K.EMPTY_VALUES,0],ea.DEFAULTS={...K.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[ea.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})},T.MaskedNumber=ea;let er={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function en(e,t,s){void 0===t&&(t=er.MASKED),void 0===s&&(s=er.MASKED);let i=O(e);return e=>i.runIsolated(i=>(i[t]=e,i[s]))}T.PIPE_TYPE=er,T.createPipe=en,T.pipe=function(e,t,s,i){return en(t,s,i)(e)};class eu extends Q{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,i;let{repeat:a,...r}=R(e);this._blockOpts=Object.assign({},this._blockOpts,r);let n=O(this._blockOpts);this.repeat=null!=(t=null!=(s=null!=a?a:n.repeat)?s:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(i=this._blocks)?void 0:i.length)||0,this.repeatFrom)),blocks:{m:n},eager:n.eager,overwrite:n.overwrite,skipInvalid:n.skipInvalid,lazy:n.lazy,placeholderChar:n.placeholderChar,displayChar:n.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(O(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});let s=new q;for(let u=null!=(i=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?i:Math.max(this._blocks.length-1,0),l,o;l=null!=(r=this._blocks[u])?r:o=!o&&this._allocateBlock(u);++u){var i,a,r,n;let h=l._appendChar(e,{...t,_beforeTailState:null==(n=t._beforeTailState)||null==(n=n._blocks)?void 0:n[u]});if(h.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,i;let a;void 0===e&&(e=0);let r=Math.max((null==(s=this._mapPosToBlock(e))?void 0:s.index)||0,this.repeatFrom,0);null!=t&&(a=null==(i=this._mapPosToBlock(t))?void 0:i.index),null==a&&(a=this._blocks.length-1);let n=0;for(let e=a;r<=e&&!this._blocks[e].unmaskedValue;--e,++n);n&&(this._blocks.splice(a-n+1,n),this.mask=this.mask.slice(n))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return(void 0===e&&(e=0),null==t&&this.repeatTo===1/0)?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}T.RepeatBlock=eu;try{globalThis.IMask=T}catch{}var el=s(14051);let eo={mask:el.oneOfType([el.array,el.func,el.string,el.instanceOf(RegExp),el.oneOf([Date,Number,T.Masked]),el.instanceOf(T.Masked)]),value:el.any,unmask:el.oneOfType([el.bool,el.oneOf(["typed"])]),prepare:el.func,prepareChar:el.func,validate:el.func,commit:el.func,overwrite:el.oneOfType([el.bool,el.oneOf(["shift"])]),eager:el.oneOfType([el.bool,el.oneOf(["append","remove"])]),skipInvalid:el.bool,onAccept:el.func,onComplete:el.func,placeholderChar:el.string,displayChar:el.string,lazy:el.bool,definitions:el.object,blocks:el.object,enum:el.arrayOf(el.string),maxLength:el.number,from:el.number,to:el.number,pattern:el.string,format:el.func,parse:el.func,autofix:el.oneOfType([el.bool,el.oneOf(["pad"])]),radix:el.string,thousandsSeparator:el.string,mapToRadix:el.arrayOf(el.string),scale:el.number,normalizeZeros:el.bool,padFractionalZeros:el.bool,min:el.oneOfType([el.number,el.instanceOf(Date)]),max:el.oneOfType([el.number,el.instanceOf(Date)]),dispatch:el.func,inputRef:el.oneOfType([el.func,el.shape({current:el.object})])},eh=Object.keys(eo).filter(e=>"value"!==e),ed=["value","unmask","onAccept","onComplete","inputRef"],ep=eh.filter(e=>0>ed.indexOf(e)),ec=(r=e=>{let{inputRef:t,...s}=e;return l.createElement("input",{...s,ref:t})},(n=class extends l.Component{constructor(e){super(e),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let e=this.props,t=this._extractMaskOptionsFromProps(e);if(t.mask)this.maskRef?(this.maskRef.updateOptions(t),"value"in e&&void 0!==e.value&&(this.maskValue=e.value)):this.initMask(t);else if(this.destroyMask(),"value"in e&&void 0!==e.value){var s;null!=(s=this.element)&&s.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=e.value:this.element.value=e.value}}componentWillUnmount(){this.destroyMask()}_inputRef(e){this.element=e,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=e:this.props.inputRef(e))}initMask(e){void 0===e&&(e=this._extractMaskOptionsFromProps(this.props)),this.maskRef=T(this.element,e).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(e){let{...t}=e;return Object.keys(t).filter(e=>0>ep.indexOf(e)).forEach(e=>{delete t[e]}),t}_extractNonMaskProps(e){let{...t}=e;return eh.forEach(e=>{"maxLength"!==e&&delete t[e]}),"defaultValue"in t||(t.defaultValue=e.mask?"":t.value),delete t.value,t}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(e){this.maskRef&&(e=null==e&&"typed"!==this.props.unmask?"":e,"typed"===this.props.unmask?this.maskRef.typedValue=e:this.props.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e)}_onAccept(e){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,e)}_onComplete(e){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,e)}render(){return l.createElement(r,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,n.propTypes=void 0,(i=n).displayName="IMask("+(r.displayName||r.name||"Component")+")",i.propTypes=eo,l.forwardRef((e,t)=>l.createElement(i,{...e,ref:t})));l.forwardRef((e,t)=>l.createElement(ec,{...e,ref:t}));var em=s(37637);let eg=(0,l.forwardRef)(({maskOpts:e,value:t="",autoFocus:s=!1,onChange:i,onKeyDown:a,...r},n)=>{let[o,h]=(0,l.useState)(""),{ref:d,setValue:p,unmaskedValue:c}=function(e,t){let{onAccept:s,onComplete:i,ref:a=(0,l.useRef)(null),defaultValue:r,defaultUnmaskedValue:n,defaultTypedValue:u}=void 0===t?{}:t,o=(0,l.useRef)(null),[h,d]=(0,l.useState)({}),[p,c]=(0,l.useState)(""),[m,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(),_=(0,l.useCallback)(()=>{var e;null==(e=o.current)||e.destroy(),o.current=null},[]),v=(0,l.useCallback)(()=>{let e=o.current;e&&(d({value:e.value,unmaskedValue:e.unmaskedValue,typedValue:e.typedValue}),k(e.typedValue),g(e.unmaskedValue),c(e.value))},[]),C=(0,l.useCallback)(e=>{let t=o.current;t&&(v(),null==s||s(t.value,t,e))},[s]),b=(0,l.useCallback)(e=>o.current&&(null==i?void 0:i(o.current.value,o.current,e)),[i]);return(0,l.useEffect)(()=>{let{value:e,...t}=h,s=o.current;s&&void 0!==p&&(e!==p&&(s.value=p,s.value!==p&&C()),d(t))},[p]),(0,l.useEffect)(()=>{let{unmaskedValue:e,...t}=h,s=o.current;s&&void 0!==m&&(e!==m&&(s.unmaskedValue=m,s.unmaskedValue!==m&&C()),d(t))},[m]),(0,l.useEffect)(()=>{let{typedValue:e,...t}=h,s=o.current;s&&void 0!==f&&(e!==f&&(s.typedValue=f,s.masked.typedValueEquals(f)||C()),d(t))},[f]),(0,l.useEffect)(()=>{let t=a.current;if(!t||!(null!=e&&e.mask))return _();let s=o.current;s?null==s||s.updateOptions(e):t&&null!=e&&e.mask&&(o.current=T(t,e),v(),void 0!==r&&c(r),void 0!==n&&g(n),void 0!==u&&k(u))},[e,_,C]),(0,l.useEffect)(()=>{if(!o.current)return;let e=o.current;return e.on("accept",C),e.on("complete",b),()=>{e.off("accept",C),e.off("complete",b)}},[C,b]),(0,l.useEffect)(()=>_,[_]),{ref:a,maskRef:o,value:p,setValue:c,unmaskedValue:m,setUnmaskedValue:g,typedValue:f,setTypedValue:k}}(e,{onAccept:(e,t)=>{h(e),null==i||i(t.unmaskedValue,e)}});return(0,l.useEffect)(()=>{t!==c&&(p(t),h(t))},[t,p,c]),(0,l.useImperativeHandle)(n,()=>d.current),(0,u.jsx)(em.I,{...r,autoFocus:s,inputRef:d,value:o,onKeyDown:e=>{("Escape"===e.key||"Esc"===e.key)&&(e.preventDefault(),p(""),h(""),null==i||i("","")),null==a||a(e)}})});eg.displayName="InputMasked";var ef=s(55727),ek=s(66627),e_=s(17806),ev=((a=ev||{}).light="light",a.gray="gray",a);let eC=e=>"kasko"===e||"osago"===e,eb=(0,_.g)("best-offers-banner","sc"),eA=Object.freeze({bestOffersBaner:eb,wrapper:`${eb}__wrapper`,wideWrapper:`${eb}__wrapper--wide`,whiteWrapper:`${eb}__wrapper--white`,content:`${eb}__content`,header:`${eb}__header`,title:`${eb}__title`,subtitle:`${eb}__subtitle`,icon:`${eb}__icon`,iconBlack:`${eb}__icon--black`,iconWhite:`${eb}__icon--white`,image:`${eb}__image`}),ey=({title:e,image:t,url:s,description:i,backgroundColor:a,textColor:r,wide:n,theme:l,handleBannerDataLayerPush:o,className:h})=>{let c=l===ev.gray,m={"--bg-base":(null==a?void 0:a.base)??(c?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==a?void 0:a.hover)??"var(--color-gray-500)"};return(0,u.jsxs)("div",{className:(0,p.A)(eA.wrapper,h,{[eA.wideWrapper]:n}),style:m,onClick:()=>{o(),window.open(s,"_blank")},children:[(0,u.jsxs)("div",{className:eA.content,children:[(0,u.jsxs)("div",{className:eA.header,children:[(0,u.jsx)(d.E,{weight:"medium",size:"24",className:eA.title,style:{color:r},children:e}),(0,u.jsx)("div",{className:(0,p.A)(eA.icon,{[eA.iconBlack]:c&&!(null!=r&&r.includes("color-white")),[eA.iconWhite]:c&&!!(null!=r&&r.includes("color-white"))}),children:(0,u.jsx)(k.K,{size:32})})]}),i&&(0,u.jsx)(d.E,{size:"16",style:{color:r},children:i})]}),(null==t?void 0:t.url)&&(0,u.jsx)("picture",{className:eA.image,children:(0,u.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},ex=(0,_.g)("offer-card","sc"),eE=Object.freeze({offerCard:ex,wrapper:`${ex}__wrapper`,whiteWrapper:`${ex}__wrapper--white`,bankInfo:`${ex}__bankInfo`,units:`${ex}__units`,unitsColumn:`${ex}__units--column`,unit:`${ex}__unit`,unitRow:`${ex}__unit--row`,unitTitleWrapper:`${ex}__unitTitleWrapper`,unitTitle:`${ex}__unitTitle`,tooltipIcon:`${ex}__tooltipIcon`,unitValue:`${ex}__unitValue`,bottomBlock:`${ex}__bottomBlock`,tags:`${ex}__tags`,tag:`${ex}__tag`,button:`${ex}__button`,buttonRounded:`${ex}__button--rounded`,buttonAdditional:`${ex}__button--additional`}),eF={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},ew={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},eS=e=>l.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M13.328 2.869a1.444 1.444 0 00-2.65 0A694.174 694.174 0 008.47 7.85a648.96 648.96 0 00-5.196.656c-1.266.165-1.673 1.722-.823 2.553a641.289 641.289 0 003.856 3.748A704.06 704.06 0 005.29 20.22c-.214 1.16.995 2.24 2.15 1.572a650.04 650.04 0 004.562-2.66c1.504.887 3.346 1.956 4.564 2.66 1.154.667 2.363-.411 2.15-1.572a702.887 702.887 0 00-1.017-5.412 664.068 664.068 0 003.856-3.748c.85-.832.443-2.389-.824-2.553-1.383-.18-3.479-.45-5.195-.657a696.41 696.41 0 00-2.208-4.982z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function eB({className:e,style:t,boxSize:s,size:i,onClick:a}){return l.createElement("span",{className:e,style:{...eF,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},l.createElement(eS,{viewBox:"0 0 24 24",style:ew}))}eB.displayName="IconFdsStarF";let eV=({title:e,value:t,tooltip:s,textColor:i,unitsAsColumn:a,isTitleUnit:r})=>{let n;return(0,u.jsxs)("div",{className:(0,p.A)(eE.unit,{[eE.unitRow]:a}),children:[(0,u.jsxs)("div",{className:eE.unitTitleWrapper,children:[(0,u.jsx)(d.E,{size:"14",className:eE.unitTitle,children:e}),s&&(0,u.jsx)(A.m,{text:s,children:(0,u.jsx)(b.k,{className:eE.tooltipIcon})})]}),(0,u.jsx)(d.E,{weight:"medium",size:r?"18":a?"16":"24",className:eE.unitValue,style:{color:i},children:e.includes("Рейтинг")?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eB,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):(n=t.split("₽")).map((e,t)=>(0,u.jsxs)(l.Fragment,{children:[e,t<n.length-1&&(0,u.jsx)(d.E,{weight:"regular",children:"₽"})]},`${e}-${t}`))})]})},eD=({tags:e,isGrayTheme:t})=>{let s=t?"secondary":"primary";return(0,u.jsx)("div",{className:eE.tags,children:e.sort((e,t)=>e.order-t.order).map(e=>(0,u.jsx)(y.v,{className:eE.tag,label:e.label,variant:e.variant?e.variant:s,rounded:!0},e.label))})},eI=({companyName:e,name:t,url:s,logo:i,units:a,tags:r,additionalButton:n,unitsAsColumn:l,dataLayerPush:o,eventCategory:h,productType:d,theme:m,buttonClassName:g,eventValueByUnitTitle:f})=>{let k=m===ev.gray,_=s=>{(0,c.p)(o,d);let i={event:"data-event",eventCategory:h,eventAction:`click_button_${(0,C.t)(s)}_${d}`,eventLabel:(0,C.t)(`${e}_${t}`)};if(f){let e=a.find(e=>e.title.toLowerCase()===f.toLowerCase());e&&(i.eventValue=(0,C.t)(e.value))}o(i)};return(0,u.jsxs)("div",{className:(0,p.A)(eE.wrapper,{[eE.whiteWrapper]:k}),children:[(0,u.jsxs)("div",{className:eE.bankInfo,children:[i&&(0,u.jsx)("img",{src:i,width:56,height:56,alt:`${e} logo`,loading:"lazy"}),(0,u.jsx)(eV,{title:t,value:e,isTitleUnit:!0})]}),(0,u.jsx)("div",{className:(0,p.A)(eE.units,{[eE.unitsColumn]:l}),children:a.map(e=>(0,u.jsx)(eV,{title:e.title,value:e.value,tooltip:e.tooltip,textColor:e.textColor,unitsAsColumn:l},`${e.title}-${e.value}`))}),(0,u.jsxs)("div",{className:eE.bottomBlock,children:[r&&(0,u.jsx)(eD,{tags:r,isGrayTheme:k}),n&&n.text.trim().length>0&&(0,u.jsx)(v.$,{as:"a",className:(0,p.A)(eE.button,eE.buttonRounded,eE.buttonAdditional),size:"xs",label:n.text,href:null==n?void 0:n.url,variant:k?"secondary":"white",onClick:()=>_(n.text)}),(0,u.jsx)(v.$,{as:"a",className:(0,p.A)(eE.button,g),size:"xs",label:"Подробнее",href:s,onClick:()=>_("podrobnee_o_kartochke_iz")})]})]})},eM=(0,_.g)("offers-list","sc"),eT=Object.freeze({offersList:eM,wrapper:`${eM}__wrapper`,sliderWrapper:`${eM}__sliderWrapper`,offerItem:`${eM}__offerItem`,compact:`${eM}__offerItem--compact`,bannerItem:`${eM}__bannerItem`}),eP=({offers:e,banner:t,dataLayerPush:s,eventCategory:i,productType:a,theme:r,singleProduct:n})=>{let l=e.length<=2;return(0,u.jsxs)(f.A,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:eT.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,u.jsx)(f.D,{className:(0,p.A)(eT.offerItem,{[eT.compact]:n}),children:(0,u.jsx)(eI,{...e,dataLayerPush:s,eventCategory:i,productType:a,theme:r})},e.id)),t&&(0,u.jsx)(f.D,{className:eT.bannerItem,children:(0,u.jsx)(ey,{...t,handleBannerDataLayerPush:()=>{(0,c.p)(s,a),s({event:"data-event",eventCategory:i,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:a})},wide:l,theme:r})})]},a)},eR=(0,_.g)("osago-tab","sc"),eO=Object.freeze({osagoTab:eR,wrapper:`${eR}__wrapper`,card:`${eR}__card`,whiteCard:`${eR}__card--white`,image:`${eR}__image`,content:`${eR}__content`,inputWrapper:`${eR}__inputWrapper`,select:`${eR}__select`,input:`${eR}__input`,buttonLinkWrapper:`${eR}__buttonLinkWrapper`,button:`${eR}__button`,banner:`${eR}__banner`}),e$={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},ej=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],eN=Object.fromEntries(ej.map(e=>[e.value,e])),eL={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},ez="АВЕКМНОРСТУХ",eU=RegExp(`[${ez}]`,"i"),eq=RegExp(`[^0-9${ez}]`,"gi"),eW=({type:e,baseUrl:t,s3Assets:s,banner:i,dataLayerPush:a,eventCategory:r,theme:n})=>{let o="osago"===e,m=(0,e_.oq)(t,"osago"),g=(0,e_.oq)(m,"step-car"),f=(0,e_.oq)(t,"kasko"),k=(0,e_.oq)(f,"vehicle"),_=o?g:k,[b,A]=(0,l.useState)(""),[y,x]=(0,l.useState)("auto"),{mask:E,placeholder:F}=eL[y],w=n===ev.gray,S=`?${new URLSearchParams({type:o?y:"auto",license:b})}`,B=(0,e_.oq)(_,S),V=i??{...e$[e],url:o?m:f,image:s?{url:(0,e_.oq)(s,`widgets/BestOffers/${o?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},D=eN[y].label,I=(t,s)=>{a({event:"data-event",eventCategory:r,eventAction:t,eventLabel:s??e})};return(0,u.jsxs)("div",{className:eO.wrapper,children:[(0,u.jsxs)("div",{className:(0,p.A)(eO.card,{[eO.whiteCard]:w}),children:[s&&(0,u.jsx)("picture",{children:(0,u.jsx)("img",{src:`${s}/widgets/BestOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:eO.image})}),(0,u.jsxs)("div",{className:eO.content,children:[(0,u.jsxs)(h.D,{as:"h3",type:"h3",children:["Онлайн калькулятор ",o?"ОСАГО":"Каско"]}),(0,u.jsxs)("div",{className:eO.inputWrapper,children:[o&&(0,u.jsx)(ek.l,{options:ej,value:eN[y],label:"Тип транспорта",variant:w?"primary":"secondary",className:eO.select,onChange:e=>{A(""),x(e.value),I(`selector_item_${(0,C.t)(e.label)}`)}}),(0,u.jsx)(eg,{label:"Госномер",variant:w?"primary":"secondary",maskOpts:{mask:E,definitions:{a:eU}},maskPlaceholder:F,value:b,className:eO.input,onChange:(e,t)=>{A(t.replace(eq,"").toUpperCase())},onClick:()=>I(`message_field_${(0,C.t)(D)}`),onBlur:()=>I(`on_message_field_${(0,C.t)(D)}`)}),(0,u.jsxs)(d.E,{children:["У меня"," ",(0,u.jsx)(ef.N,{href:_,onClick:()=>{(0,c.p)(a),I("click_link_net_nomera",_)},children:"нет номера"})]})]}),(0,u.jsx)(v.$,{as:"a",href:B,size:"s",className:eO.button,onClick:()=>{(0,c.p)(a),I(`click_button_rasschitat_${(0,C.t)(D)}`,B)},children:"Рассчитать"})]})]}),(0,u.jsx)("div",{className:eO.banner,children:(0,u.jsx)(ey,{...V,theme:n,handleBannerDataLayerPush:()=>{(0,c.p)(a),I("click_bnr_banner_top_predlozheniy")}})})]})},eK=(0,_.g)("best-offers","sc"),eH=Object.freeze({bestOffers:eK,graySection:`${eK}--gray`,singleProduct:`${eK}--singleProduct`,titleWrapper:`${eK}__title-wrapper`,singleProductTitleWrapper:`${eK}__title-wrapper--singleProduct`,title:`${eK}__title`,singleProductTitle:`${eK}__title--singleProduct`,chips:`${eK}__chips`,warning:`${eK}__warning`,allOffersLink:`${eK}__allOffersLink`}),eY={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам",фонды:"фондам"},eG=({tabs:e,baseUrl:t,s3Assets:s,eventCategory:i="best-offers",dataLayerPush:a,singleProduct:r=!1,theme:n=ev.light,className:f,tagTitle:k="h2",initialActiveChipId:_})=>{var v;let C=n===ev.gray,b=Array.isArray(e)?e.filter(({banner:e,offers:t,productType:s})=>!!e||!!(null!=t&&t.length)||"osago"===s||"kasko"===s).map(e=>({...e,offers:Array.isArray(e.offers)?e.offers:[]})):[],A=b.map(e=>({url:e.productType,title:e.name})),y=(null==(v=A[0])?void 0:v.url)??"",[x,E]=(0,l.useState)(_??y),F=x&&b.some(e=>e.productType===x)?x:y,w=b.find(e=>e.productType===F)??b[0];if(!w)return null;let S=eY[w.name.toLowerCase()],B=S?`по ${S}`:w.name,V=eC(null==w?void 0:w.productType)&&t?(0,u.jsx)(eW,{type:w.productType,banner:w.banner,baseUrl:t,s3Assets:s,dataLayerPush:a,eventCategory:i,theme:n}):null;return(0,u.jsx)("section",{className:(0,p.A)(eH.bestOffers,f,{[eH.singleProduct]:r,[eH.graySection]:C}),children:(0,u.jsxs)(o.m,{children:[(0,u.jsx)("div",{className:(0,p.A)(eH.titleWrapper,r&&eH.singleProductTitleWrapper),children:(0,u.jsxs)(h.D,{as:k,role:void 0,"aria-level":void 0,type:r?"h2":"display",className:(0,p.A)(eH.title,r&&eH.singleProductTitle),children:["Лучшие предложения ",r?B:"сегодня"]})}),!r&&(0,u.jsx)(g.N,{items:A,maxNumberOfLines:2,activeChipId:F,variant:C?"white":"gray",className:eH.chips,onClick:e=>{(0,c.p)(a,e),E(e);let t=b.find(t=>t.productType===e);a({event:"data-event",eventCategory:i,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==t?void 0:t.productType})}}),(0,u.jsxs)("div",{children:[V??(0,u.jsx)(eP,{offers:w.offers,banner:w.banner,dataLayerPush:a,eventCategory:i,productType:w.productType,theme:n,singleProduct:r}),w.hasWarning&&(0,u.jsx)(d.E,{as:"p",size:"16",className:eH.warning,children:w.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),w.checkAllUrl&&(0,u.jsx)(m.C,{href:w.checkAllUrl,onClick:()=>(0,c.p)(a,w.productType),event:{event:"data-event",eventCategory:i,eventAction:"link",eventLabel:`Показать все предложения ${w.productType}`},dataLayerPush:a,iconGrayBackground:!C,className:eH.allOffersLink,linkClassName:w.checkAllLinkClassName,children:"Показать все предложения"})]})})}}}]);