@riab/cpm-archiving 1.1.10-beta.2 → 1.1.10-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cpm-archiving.js +1 -1
- package/package.json +1 -1
package/dist/cpm-archiving.js
CHANGED
|
@@ -262,7 +262,7 @@ See the full list of free and premium components here: ${yJ}`),console.groupEnd(
|
|
|
262
262
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jae(e,t){if(e){if(typeof e=="string")return MD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MD(e,t):void 0}}function MD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ese=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function w6(e,t,n){if(t=t||{},!(!e.country&&!e.countryCallingCode)){n=new ki(n),n.selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(zo(r,n.nationalNumberPattern())){if(qA(r,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||qA(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=$ae(ese),a;!(a=i()).done;){var o=a.value;if(qA(r,o,n))return o}}}}function qA(e,t,n){var r=n.type(t);return!r||!r.pattern()||r.possibleLengths()&&r.possibleLengths().indexOf(e.length)<0?!1:zo(e,r.pattern())}function tse(e,t,n){if(t=t||{},n=new ki(n),n.selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes())return w6(e,t,n.metadata)!==void 0;var r=t.v2?e.nationalNumber:e.phone;return zo(r,n.nationalNumberPattern())}function nse(e,t,n){var r=new ki(n),i=r.getCountryCodesForCallingCode(e);return i?i.filter(function(a){return rse(t,a,n)}):[]}function rse(e,t,n){var r=new ki(n);return r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0}var E6=2,ise=17,ase=3,hs="0-90-9٠-٩۰-۹",sse="-‐-―−ー-",ose="//",lse="..",use=" ",cse="()()[]\\[\\]",dse="~⁓∼~",S1="".concat(sse).concat(ose).concat(lse).concat(use).concat(cse).concat(dse),S6="++",fse=new RegExp("(["+hs+"])");function hse(e,t,n,r){if(t){var i=new ki(r);i.selectNumberingPlan(t,n);var a=new RegExp(i.IDDPrefix());if(e.search(a)===0){e=e.slice(e.match(a)[0].length);var o=e.match(fse);if(!(o&&o[1]!=null&&o[1].length>0&&o[1]==="0"))return e}}}function mse(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var i,a,o=r.length-1,u=o>0&&r[o];if(t.nationalPrefixTransformRule()&&u)i=e.replace(n,t.nationalPrefixTransformRule()),o>1&&(a=r[1]);else{var d=r[0];i=e.slice(d.length),u&&(a=r[1])}var h;if(u){var v=e.indexOf(r[1]),p=e.slice(0,v);p===t.numberingPlan.nationalPrefix()&&(h=t.numberingPlan.nationalPrefix())}else h=r[0];return{nationalNumber:i,nationalPrefix:h,carrierCode:a}}}return{nationalNumber:e}}function pse(e,t){var n=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=gse(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
263
263
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gse(e,t){if(e){if(typeof e=="string")return OD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OD(e,t):void 0}}function OD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vse(e,t){var n=t.countries,r=t.metadata;r=new ki(r);for(var i=pse(n),a;!(a=i()).done;){var o=a.value;if(r.selectNumberingPlan(o),r.leadingDigits()){if(e&&e.search(r.leadingDigits())===0)return o}else if(w6({phone:e,country:o},void 0,r.metadata))return o}}function mz(e,t){var n=t.nationalNumber,r=t.metadata,i=r.getCountryCodesForCallingCode(e);if(i)return i.length===1?i[0]:vse(n,{countries:i,metadata:r.metadata})}function z4(e,t,n){var r=mse(e,n),i=r.carrierCode,a=r.nationalNumber;if(a!==e){if(!bse(e,a,n))return{nationalNumber:e};if(n.numberingPlan.possibleLengths()&&(t||(t=mz(n.numberingPlan.callingCode(),{nationalNumber:a,metadata:n})),!yse(a,t,n)))return{nationalNumber:e}}return{nationalNumber:a,carrierCode:i}}function bse(e,t,n){return!(zo(e,n.nationalNumberPattern())&&!zo(t,n.nationalNumberPattern()))}function yse(e,t,n){switch(x6(e,t,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Ase(e,t,n,r,i){var a=n?A6(n,i):r;if(e.indexOf(a)===0){i=new ki(i),i.selectNumberingPlan(n,a);var o=e.slice(a.length),u=z4(o,t,i),d=u.nationalNumber,h=z4(e,t,i),v=h.nationalNumber;if(!zo(v,i.nationalNumberPattern())&&zo(d,i.nationalNumberPattern())||x6(v,t,i)==="TOO_LONG")return{countryCallingCode:a,number:o}}return{number:e}}function pz(e,t,n,r,i){if(!e)return{};var a;if(e[0]!=="+"){var o=hse(e,n,r,i);if(o&&o!==e)a=!0,e="+"+o;else{if(n||r){var u=Ase(e,t,n,r,i),d=u.countryCallingCode,h=u.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:h}}return{number:e}}}if(e[1]==="0")return{};i=new ki(i);for(var v=2;v-1<=ase&&v<=e.length;){var p=e.slice(1,v);if(i.hasCallingCode(p))return i.selectNumberingPlan(p),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:p,number:e.slice(v)};v++}return{}}function xse(e){return e.replace(new RegExp("[".concat(S1,"]+"),"g")," ").trim()}var wse=/(\$\d)/;function Ese(e,t,n){var r=n.useInternationalFormat,i=n.withNationalPrefix,a=e.replace(new RegExp(t.pattern()),r?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(wse,t.nationalPrefixFormattingRule()):t.format());return r?xse(a):a}var Sse=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Cse(e,t,n){var r=new ki(n);if(r.selectNumberingPlan(e,t),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(Sse.test(r.IDDPrefix()))return r.IDDPrefix()}var Rse=";ext=",Bd=function(t){return"([".concat(hs,"]{1,").concat(t,"})")};function gz(e){var t="20",n="15",r="9",i="6",a="[ \\t,]*",o="[:\\..]?[ \\t,-]*",u="#?",d="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",h="(?:[xx##~~]|int|int)",v="[- ]+",p="[ \\t]*",y="(?:,{2}|;)",b=Rse+Bd(t),A=a+d+o+Bd(t)+u,x=a+h+o+Bd(r)+u,w=v+Bd(i)+"#",R=p+y+o+Bd(n)+u,O=p+"(?:,)+"+o+Bd(r)+u;return b+"|"+A+"|"+x+"|"+w+"|"+R+"|"+O}var Ise="["+hs+"]{"+E6+"}",Mse="["+S6+"]{0,1}(?:["+S1+"]*["+hs+"]){3,}["+S1+hs+"]*",Ose=new RegExp("^["+S6+"]{0,1}(?:["+S1+"]*["+hs+"]){1,2}$","i"),Dse=Mse+"(?:"+gz()+")?",Pse=new RegExp("^"+Ise+"$|^"+Dse+"$","i");function jse(e){return e.length>=E6&&Pse.test(e)}function Tse(e){return Ose.test(e)}function Nse(e){var t=e.number,n=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}var DD={formatExtension:function(t,n,r){return"".concat(t).concat(r.ext()).concat(n)}};function kse(e,t,n,r){if(n?n=Fse({},DD,n):n=DD,r=new ki(r),e.country&&e.country!=="001"){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else if(e.countryCallingCode)r.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var i=r.countryCallingCode(),a=n.v2?e.nationalNumber:e.phone,o;switch(t){case"NATIONAL":return a?(o=C1(a,e.carrierCode,"NATIONAL",r,n),QA(o,e.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return a?(o=C1(a,null,"INTERNATIONAL",r,n),o="+".concat(i," ").concat(o),QA(o,e.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(a);case"RFC3966":return Nse({number:"+".concat(i).concat(a),ext:e.ext});case"IDD":if(!n.fromCountry)return;var u=Bse(a,e.carrierCode,i,n.fromCountry,r);return u?QA(u,e.ext,r,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function C1(e,t,n,r,i){var a=_se(r.formats(),e);return a?Ese(e,a,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1)}):e}function _se(e,t){return Lse(e,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(t.search(r)!==0)return!1}return zo(t,n.pattern())})}function QA(e,t,n,r){return t?r(e,t,n):e}function Bse(e,t,n,r,i){var a=A6(r,i.metadata);if(a===n){var o=C1(e,t,"NATIONAL",i);return n==="1"?n+" "+o:o}var u=Cse(r,void 0,i.metadata);if(u)return"".concat(u," ").concat(n," ").concat(C1(e,null,"INTERNATIONAL",i))}function Fse(){for(var e=1,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(;e<n.length;){if(n[e])for(var i in n[e])n[0][i]=n[e][i];e++}return n[0]}function Lse(e,t){for(var n=0;n<e.length;){if(t(e[n]))return e[n];n++}}function S0(e){"@babel/helpers - typeof";return S0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S0(e)}function PD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PD(Object(n),!0).forEach(function(r){Xse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xse(e,t,n){return(t=vz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qse(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vz(r.key),r)}}function Qse(e,t,n){return t&&qse(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vz(e){var t=Hse(e,"string");return S0(t)=="symbol"?t:t+""}function Hse(e,t){if(S0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(S0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vse=(function(){function e(t,n,r){if(zse(this,e),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(af(n)&&af(n.countries)){r=n;var i=t;if(!Yse.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=pz(i,void 0,void 0,void 0,r),o=a.countryCallingCode,u=a.number;if(n=u,t=o,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");dz(r);var d=Wse(t,r),h=d.country,v=d.countryCallingCode;this.country=h,this.countryCallingCode=v,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return Qse(e,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:nse(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Zae(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return tse(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new ki(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return w6(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return kse(this,n,r?jD(jD({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])})(),Use=function(t){return/^[A-Z]{2}$/.test(t)};function Wse(e,t){var n,r,i=new ki(t);return Use(e)?(n=e,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=e,{country:n,countryCallingCode:r}}var Yse=/^\+\d+$/;function q4(e){"@babel/helpers - typeof";return q4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q4(e)}function Gse(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Kse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zse(e,t,n){return t=R0(t),$se(e,C6()?Reflect.construct(t,n||[],R0(e).constructor):t.apply(e,n))}function $se(e,t){if(t&&(q4(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jse(e)}function Jse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eoe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C0(e,t)}function Q4(e){var t=typeof Map=="function"?new Map:void 0;return Q4=function(r){if(r===null||!noe(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return toe(r,arguments,R0(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),C0(i,r)},Q4(e)}function toe(e,t,n){if(C6())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&C0(i,n.prototype),i}function C6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(C6=function(){return!!e})()}function noe(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch(t){return typeof e=="function"}}function C0(e,t){return C0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},C0(e,t)}function R0(e){return R0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},R0(e)}var Dl=(function(e){function t(n){var r;return Kse(this,t),r=Zse(this,t,[n]),Object.setPrototypeOf(r,t.prototype),r.name=r.constructor.name,r}return eoe(t,e),Gse(t)})(Q4(Error)),TD=new RegExp("(?:"+gz()+")$","i");function roe(e){var t=e.search(TD);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(TD),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}var ioe={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function aoe(e){return ioe[e]}function soe(e,t){var n=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=ooe(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
264
264
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ooe(e,t){if(e){if(typeof e=="string")return ND(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ND(e,t):void 0}}function ND(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kD(e){for(var t="",n=soe(e.split("")),r;!(r=n()).done;){var i=r.value;t+=loe(i,t)||""}return t}function loe(e,t,n){return e==="+"?t?void 0:"+":aoe(e)}var bz="+",uoe="[\\-\\.\\(\\)]?",_D="(["+hs+"]|"+uoe+")",coe="^\\"+bz+_D+"*["+hs+"]"+_D+"*$",doe=new RegExp(coe,"g"),H4=hs,foe="["+H4+"]+((\\-)*["+H4+"])*",hoe="a-zA-Z",moe="["+hoe+"]+((\\-)*["+H4+"])*",poe="^("+foe+"\\.)*"+moe+"\\.?$",goe=new RegExp(poe,"g"),BD="tel:",V4=";phone-context=",voe=";isub=";function boe(e){var t=e.indexOf(V4);if(t<0)return null;var n=t+V4.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}function yoe(e){return e===null?!0:e.length===0?!1:doe.test(e)||goe.test(e)}function Aoe(e,t){var n=t.extractFormattedPhoneNumber,r=boe(e);if(!yoe(r))throw new Dl("NOT_A_NUMBER");var i;if(r===null)i=n(e)||"";else{i="",r.charAt(0)===bz&&(i+=r);var a=e.indexOf(BD),o;a>=0?o=a+BD.length:o=0;var u=e.indexOf(V4);i+=e.substring(o,u)}var d=i.indexOf(voe);if(d>0&&(i=i.substring(0,d)),i!=="")return i}var xoe=250,woe=new RegExp("["+S6+hs+"]"),Eoe=new RegExp("[^"+hs+"#]+$");function Soe(e,t,n){if(t=t||{},n=new ki(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry))throw t.v2?new Dl("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var r=Roe(e,t.v2,t.extract),i=r.number,a=r.ext,o=r.error;if(!i){if(t.v2)throw o==="TOO_SHORT"?new Dl("TOO_SHORT"):new Dl("NOT_A_NUMBER");return{}}var u=Moe(i,t.defaultCountry,t.defaultCallingCode,n),d=u.country,h=u.nationalNumber,v=u.countryCallingCode,p=u.countryCallingCodeSource,y=u.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new Dl("INVALID_COUNTRY");return{}}if(!h||h.length<E6){if(t.v2)throw new Dl("TOO_SHORT");return{}}if(h.length>ise){if(t.v2)throw new Dl("TOO_LONG");return{}}if(t.v2){var b=new Vse(v,h,n.metadata);return d&&(b.country=d),y&&(b.carrierCode=y),a&&(b.ext=a),b.__countryCallingCodeSource=p,b}var A=(t.extended?n.hasSelectedNumberingPlan():d)?zo(h,n.nationalNumberPattern()):!1;return t.extended?{country:d,countryCallingCode:v,carrierCode:y,valid:A,possible:A?!0:!!(t.extended===!0&&n.possibleLengths()&&hz(h,d,n)),phone:h,ext:a}:A?Ioe(d,h,a):{}}function Coe(e,t,n){if(e){if(e.length>xoe){if(n)throw new Dl("TOO_LONG");return}if(t===!1)return e;var r=e.search(woe);if(!(r<0))return e.slice(r).replace(Eoe,"")}}function Roe(e,t,n){var r=Aoe(e,{extractFormattedPhoneNumber:function(o){return Coe(o,n,t)}});if(!r)return{};if(!jse(r))return Tse(r)?{error:"TOO_SHORT"}:{};var i=roe(r);return i.ext?i:{number:r}}function Ioe(e,t,n){var r={country:e,phone:t};return n&&(r.ext=n),r}function Moe(e,t,n,r){var i=pz(kD(e),void 0,t,n,r.metadata),a=i.countryCallingCodeSource,o=i.countryCallingCode,u=i.number,d;if(o)r.selectNumberingPlan(o);else if(u&&(t||n))r.selectNumberingPlan(t,n),t&&(d=t),o=n||A6(t,r.metadata);else return{};if(!u)return{countryCallingCodeSource:a,countryCallingCode:o};var h=z4(kD(u),d,r),v=h.nationalNumber,p=h.carrierCode,y=mz(o,{nationalNumber:v,metadata:r});return y&&(d=y,y==="001"||r.selectNumberingPlan(d)),{country:d,countryCallingCode:o,countryCallingCodeSource:a,nationalNumber:v,carrierCode:p}}function I0(e){"@babel/helpers - typeof";return I0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I0(e)}function FD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FD(Object(n),!0).forEach(function(r){Ooe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ooe(e,t,n){return(t=Doe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Doe(e){var t=Poe(e,"string");return I0(t)=="symbol"?t:t+""}function Poe(e,t){if(I0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(I0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function joe(e,t,n){return Soe(e,LD(LD({},t),{},{v2:!0}),n)}function M0(e){"@babel/helpers - typeof";return M0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M0(e)}function XD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Toe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XD(Object(n),!0).forEach(function(r){Noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t,n){return(t=koe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function koe(e){var t=_oe(e,"string");return M0(t)=="symbol"?t:t+""}function _oe(e,t){if(M0(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(M0(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Boe(e,t){return zoe(e)||Xoe(e,t)||Loe(e,t)||Foe()}function Foe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
265
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Loe(e,t){if(e){if(typeof e=="string")return zD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zD(e,t):void 0}}function zD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xoe(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,u=[],d=!0,h=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(d=(r=a.call(n)).done)&&(u.push(r.value),u.length!==t);d=!0);}catch(v){h=!0,i=v}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw i}}return u}}function zoe(e){if(Array.isArray(e))return e}function qoe(e){var t=Array.prototype.slice.call(e),n=Boe(t,4),r=n[0],i=n[1],a=n[2],o=n[3],u,d,h;if(typeof r=="string")u=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")o?(d=a,h=o):(d=void 0,h=a),i&&(d=Toe({defaultCountry:i},d));else if(af(i))a?(d=i,h=a):h=i;else throw new Error("Invalid second argument: ".concat(i));return{text:u,options:d,metadata:h}}function Qoe(){var e=qoe(arguments),t=e.text,n=e.options,r=e.metadata;return joe(t,n,r)}function yz(){return Fae(Qoe,arguments)}const qD=["Facebook","Instagram","Twitter","LinkedIn"],Hoe=e=>[...e].sort((t,n)=>{const r=qD.indexOf(t.platform),i=qD.indexOf(n.platform);return r!==-1&&i!==-1?r-i:r!==-1?-1:i!==-1?1:t.platform.localeCompare(n.platform)}),QD=e=>/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e),O0=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),ru=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),HD={"/email":"email","/social_media":"social_media","/website":"website","/mobile":"mobile"},Az=e=>{if(!e)return null;const t=Object.keys(HD).find(n=>e.includes(n));return t?HD[t]:null},Voe=(e,t)=>{const r=`\\b${(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},VD=(e,t)=>{const r=`\\b${(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},U4=e=>(e==null?void 0:e.phrase)||(e==null?void 0:e.keyword)||(e==null?void 0:e.item)||"",sb=(e,t,n)=>{const r=xz(wz(e==null?void 0:e.toLowerCase()));return r?!t||!n?[]:t.filter(i=>{var d,h;const a=(h=(d=i.keyword)==null?void 0:d.toLowerCase())==null?void 0:h.trim();if(!VD(r,a))return!1;if(n.length<1)return!0;const o=n==null?void 0:n.filter(v=>{var y;const p=(y=U4(v))==null?void 0:y.toLowerCase();return p==null?void 0:p.includes(a==null?void 0:a.toLowerCase())});if(o.length===0)return!0;const u=o.reduce((v,p)=>{var A;const b=((A=U4(p))==null?void 0:A.toLowerCase()).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return v.replace(new RegExp(`\\b${b}\\b`,"gi"),"")},r);return VD(u,a)}):[]},R6=(e,t)=>{const n=xz(wz(e==null?void 0:e.toLowerCase()));return n?t==null?void 0:t.filter(r=>{const i=typeof r=="string"?r:U4(r);return!!Voe(n,i==null?void 0:i.toLowerCase())}):[]},UD=({searchWords:e,textToHighlight:t})=>{const i=[...e.filter(o=>typeof o=="string")].sort((o,u)=>u.length-o.length).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a=new RegExp(`\\b(${i.join("|")})\\b`,"gi");return[...t.matchAll(a)].map(o=>({start:o.index,end:o.index+o[0].length}))},xz=e=>e&&e.replace(/[\r?\n!@#&*()\-–—+=[\]{}|:;'"‘’“”,.<>?/]/g," "),wz=e=>e&&e.replace(/<[^>]*>/g,""),Uoe=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},WD=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),Woe=e=>e?gr(e,"MMMM do, yyyy"):"N/A",Ez=e=>{if(!e||(e==null?void 0:e.trim())==="")return!1;try{const t=e!=null&&e.trim().startsWith("+")?e==null?void 0:e.trim():`+${e==null?void 0:e.trim()}`;return yz(t).isPossible()}catch(t){return!1}},Qo=({showEdit:e,value:t,onChange:n,maxLength:r=255,className:i="w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-brand-dark-800 focus:outline-none"})=>{const a=k.useRef(null);return k.useEffect(()=>{e&&a.current&&a.current.focus()},[e]),e?c.jsx("input",{ref:a,type:"text",defaultValue:t,onChange:n,maxLength:r,className:i,onClick:o=>o.stopPropagation()}):c.jsx("span",{children:t})},Yoe=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=F=>`${F.id}_${F.itemType}`,R=(F,q)=>{b.current[q]=F.target.value},O=F=>{const q=w(F);b.current[q]=F.item,y(q)},D=F=>{const q=w(F);delete b.current[q],y(null)},C=[x.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:F})=>{const q=w(F.original);return c.jsx(Qo,{showEdit:p===q,value:F.original.item,onChange:z=>R(z,q)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:F})=>{const q=w(F.original);return c.jsx(he,{className:"",icon:p===q?kn:Qs,size:"large",onClick:z=>{var B;if(z.stopPropagation(),p===q){const X=((B=b.current[q])!=null?B:F.original.item).trim().slice(0,255);if(!ru(X)){be.error("Please enter a valid email!",{id:"edit-associated-contact"});return}if(e.find(J=>w(J)!==q&&J.item.toLowerCase()===X.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-associated-contact"});return}if(X===F.original.item){D(F.original);return}j.mutate({id:F.original.id,itemType:F.original.itemType,filterType:F.original.filterType,addedType:F.original.addedType,item:X},{onSuccess:J=>{J&&J.error_message&&!J.success||(be.success("Associated contact updated successfully",{id:"edit-associated-contact"}),D(F.original))}});return}O(F.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:F})=>{const q=w(F.original);return p===q?c.jsx(he,{className:"",icon:an,size:"large",onClick:z=>{z.stopPropagation(),D(F.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:z=>{z.stopPropagation(),d(!0),v(F.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{i(!0),requestAnimationFrame(()=>{var F;(F=A.current)==null||F.focus()})}}],M=Qf();function P(F){F&&M.mutate({id:F.id},{onSuccess:()=>{d(!1)}})}const T=zf(),j=qf();function N(){if(!ru(a))return be.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"sender",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const _=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:F=>F.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:_,onRowClick:F=>{F.toggleSelected()},bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:F=>F.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:F=>o(F.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:N,disabled:T.isPending,children:T.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>P(h),disabled:M.isPending,children:M.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},Goe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Email Domains",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!O0(B)){be.error("Please enter a valid domain!",{id:"edit-excluded-domain"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-domain"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Domain updated successfully",{id:"edit-excluded-domain"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Domain",icon:Rr,onClick:()=>{r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!O0(i))return be.error("Please enter a valid domain!",{id:"new-email-domain"});P.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},Koe=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=q=>`${q.id}_${q.itemType}`,R=(q,z)=>{b.current[z]=q.target.value},O=q=>{const z=w(q);b.current[z]=q.item,y(z)},D=q=>{const z=w(q);delete b.current[z],y(null)},C=[x.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:q})=>{const z=w(q.original);return c.jsx(Qo,{showEdit:p===z,value:q.original.item,onChange:B=>R(B,z)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:q})=>{const z=w(q.original);return c.jsx(he,{className:"",icon:p===z?kn:Qs,size:"large",onClick:B=>{var X;if(B.stopPropagation(),p===z){const V=((X=b.current[z])!=null?X:q.original.item).trim().slice(0,255);if(!WD(V)){be.error("Please enter a valid email prefix!",{id:"edit-email-prefix"});return}if(e.find(ee=>w(ee)!==z&&ee.item.toLowerCase()===V.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-email-prefix"});return}if(V===q.original.item){D(q.original);return}N.mutate({id:q.original.id,itemType:q.original.itemType,filterType:q.original.filterType,addedType:q.original.addedType,item:V},{onSuccess:ee=>{ee&&ee.error_message&&!ee.success||(be.success("Email prefix updated successfully",{id:"edit-email-prefix"}),D(q.original))}});return}O(q.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:q})=>{const z=w(q.original);return p===z?c.jsx(he,{className:"",icon:an,size:"large",onClick:B=>{B.stopPropagation(),D(q.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:B=>{B.stopPropagation(),d(!0),v(q.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{i(!0),requestAnimationFrame(()=>{var q;(q=A.current)==null||q.focus()})}}],M=jne(),P=Qf();function T(q){q&&(q.addedType=="added"?P.mutate({id:q.id},{onSuccess:()=>{d(!1)}}):M.mutate({id:q.id},{onSuccess:()=>{d(!1)}}))}const j=zf(),N=qf();function _(){if(e.find(q=>q.item==a))return i(!1),be.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!a||a.trim()==""||!WD(a))return be.error("Please enter a valid email prefix!",{id:"new-email-prefix"});j.mutate({itemType:"username",filterType:"spam_email",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const F=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:q=>q.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:F,onRowClick:q=>{q.toggleSelected()},emptyMessage:t?"Loading...":"No items found",bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search or add new prefixes",itemsLabel:"Email Prefixes",rowSelectedCheck:q=>q.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:q=>o(q.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:_,disabled:j.isPending,children:j.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>T(h),disabled:M.isPending||P.isPending,children:M.isPending||P.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},$0=({children:e,asButton:t=!1,className:n="",onClick:r,disabled:i=!1,type:a="button"})=>{const o="block font-bold";return t?c.jsx("button",{type:a,onClick:r,disabled:i,className:`${o} ${n} text-nowrap ${i?"":"cursor-pointer"}`,children:e}):c.jsx("div",{className:`${o} ${n}`,children:e})},Zoe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Recipients",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!ru(B)){be.error("Please enter a valid email!",{id:"edit-excluded-recipient"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-recipient"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Recipient updated successfully",{id:"edit-excluded-recipient"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Email",icon:Rr,onClick:()=>{r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!ru(i))return be.error("Please enter a valid email!",{id:"new-excluded-email"});P.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs($0,{asButton:!0,className:"flex items-center absolute top-3 right-8",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b-6 border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Recipient"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx($l,{onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},$oe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!ru(B)){be.error("Please enter a valid email!",{id:"edit-excluded-sender"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-sender"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Sender updated successfully",{id:"edit-excluded-sender"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Email",icon:Rr,onClick:()=>{r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!ru(i))return be.error("Please enter a valid email!",{id:"new-excluded-email"});P.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Sender"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},I6={twitter:"X",linkedin:"LinkedIn",instagram:"Instagram",facebook:"Facebook"},Br=e=>({queryKey:["keywordsAndPhrases",e],queryFn:()=>{const t=new URLSearchParams({archivingType:e});return et.get(`/Archiving/get_keywords_safe_phrases?${t.toString()}`)}}),M6=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/Archiving/add_archiving_keyword_and_added_item",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["keywordsAndPhrases",n.archivingType]}),e.invalidateQueries({queryKey:["spamPhrases"]})}})},O6=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/Archiving/edit_keyword_and_item",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["keywordsAndPhrases",n.archivingType]})}})},Sz=()=>{const e=Vt();return qt({mutationFn:({payload:t,flag:n})=>{let r="/Archiving/deactivate_archiving_keyword_and_item";return n==="reactivate"&&(r="/Archiving/reactivate_archiving_keyword_and_added_items"),n==="remove"?(r="/Archiving/remove_archiving_keyword_and_item",et.post(r,t)):et.post(r,{keywords:t})},onSuccess:(t,n)=>{const r=Array.isArray(n.payload)?n.payload[0].archivingType:n.payload.archivingType;e.invalidateQueries({queryKey:["deleteKeywords",r]}),e.invalidateQueries({queryKey:["keywordsAndPhrases",r]})}})},Joe=({classList:e=""})=>{var B;const t=Vt(),{data:n,isLoading:r}=Mt(hD()),i=(B=n==null?void 0:n.payload)!=null?B:[],[a,o]=k.useState(!1),[u,d]=k.useState(""),[h,v]=k.useState(!1),[p,y]=k.useState(),[b,A]=k.useState(null),x=k.useRef({}),w=k.useRef(null),R=ur(),O=X=>`${X.id}_${X.itemType}`,D=(X,V)=>{x.current[V]=X.target.value},C=X=>{const V=O(X);x.current[V]=X.item,A(V)},S=X=>{const V=O(X);A(null),delete x.current[V]},M=O6(),P=X=>{var ne;const V=O(X),J=((ne=x.current[V])!=null?ne:X.item).trim();if(!J){be.error("Please enter a valid phrase!",{id:"edit-spam-phrase"});return}if(i.find(U=>O(U)!==V&&U.item.toLowerCase()===J.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-spam-phrase"});return}if(J===X.item){S(X);return}M.mutate({archivingType:"email",itemId:X.id,item:J,itemType:X.itemType,filterType:"spam_phrase"},{onSuccess:U=>{if(!(U!=null&&U.success)||(U==null?void 0:U.success)===0){be.error((U==null?void 0:U.error_message)||"Error updating phrase",{id:"edit-spam-phrase"});return}be.success("Phrase updated successfully",{id:"edit-spam-phrase"}),t.invalidateQueries(hD()),S(X)},onError:()=>{be.error("Error updating phrase",{id:"edit-spam-phrase"})}})},T=[R.accessor("item",{header:"Phrase",size:"unset",cell:({row:X})=>{const V=O(X.original);return c.jsx(Qo,{showEdit:b===V,value:X.original.item,onChange:J=>D(J,V)})}}),R.display({size:65,id:"edit",header:()=>null,cell:({row:X})=>{const V=O(X.original);return c.jsx(he,{icon:b===V?kn:Qs,size:"large",onClick:J=>{if(J.stopPropagation(),b===V){P(X.original);return}C(X.original)}})}}),R.display({size:65,id:"delete",header:()=>null,cell:({row:X})=>{const V=O(X.original);return b===V?c.jsx(he,{className:"",icon:an,size:"large",onClick:J=>{J.stopPropagation(),S(X.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:J=>{J.stopPropagation(),v(!0),y(X.original)}})}})],j=[{label:"Add",icon:Rr,onClick:()=>{o(!0),requestAnimationFrame(()=>{var X;(X=w.current)==null||X.focus()})}}],N=Pne();function _(X){X&&N.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:X.id,itemType:X.itemType},{onSuccess:()=>{v(!1)}})}const F=M6();function q(){if(i.find(X=>X.item==u))return o(!1),be.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!u||u.trim()=="")return be.error("Please enter a valid phrase!",{id:"new-spam-phrase"});F.mutate({archivingType:"email",filterType:"spam_phrase",item:u},{onSuccess:()=>{d(""),o(!1)}})}const z=Qn({data:i,columns:T,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:X=>X.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${e}`,children:[c.jsx(Vr,{table:z,onRowClick:X=>{X.toggleSelected()},emptyMessage:r?"Loading...":"No items found",bordered:!1,filterButtons:j,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:X=>X.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),a&&c.jsx(wn,{title:"",width:700,onClose:()=>o(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>o(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:w,type:"text",onChange:X=>d(X.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:q,disabled:F.isPending,children:F.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),h&&c.jsx(wn,{title:"",width:700,onClose:()=>v(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>v(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>v(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>_(p),disabled:N.isPending,children:N.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},ele=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=F=>`${F.id}_${F.itemType}`,R=(F,q)=>{b.current[q]=F.target.value},O=F=>{const q=w(F);b.current[q]=F.item,y(q)},D=F=>{const q=w(F);delete b.current[q],y(null)},C=[x.accessor("item",{header:"Email Domains",size:"unset",cell:({row:F})=>{const q=w(F.original);return c.jsx(Qo,{showEdit:p===q,value:F.original.item,onChange:z=>R(z,q)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:F})=>{const q=w(F.original);return c.jsx(he,{className:"",icon:p===q?kn:Qs,size:"large",onClick:z=>{var B;if(z.stopPropagation(),p===q){const X=((B=b.current[q])!=null?B:F.original.item).trim().slice(0,255);if(!O0(X)){be.error("Please enter a valid domain!",{id:"edit-internal-domain"});return}if(e.find(J=>w(J)!==q&&J.item.toLowerCase()===X.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-internal-domain"});return}if(X===F.original.item){D(F.original);return}j.mutate({id:F.original.id,itemType:F.original.itemType,filterType:F.original.filterType,addedType:F.original.addedType,item:X},{onSuccess:J=>{J&&J.error_message&&!J.success||(be.success("Domain updated successfully",{id:"edit-internal-domain"}),D(F.original))}});return}O(F.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:F})=>{const q=w(F.original);return p===q?c.jsx(he,{className:"",icon:an,size:"large",onClick:z=>{z.stopPropagation(),D(F.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:z=>{z.stopPropagation(),d(!0),v(F.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{i(!0),requestAnimationFrame(()=>{var F;(F=A.current)==null||F.focus()})}}],M=Qf();function P(F){F&&M.mutate({id:F.id},{onSuccess:()=>{d(!1)}})}const T=zf(),j=qf();function N(){if(!O0(a))return be.error("Please enter a valid domain!",{id:"new-email-domain"});T.mutate({itemType:"domain",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const _=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:F=>F.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:_,onRowClick:F=>{F.toggleSelected()},bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:F=>F.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:F=>o(F.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:N,disabled:T.isPending,children:T.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>P(h),disabled:M.isPending,children:M.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},tle=()=>{var h,v,p,y,b,A;const{data:e,isLoading:t,isSuccess:n}=Mt(Nne()),r=(h=e==null?void 0:e.blacklist)==null?void 0:h.recipients,i=(v=e==null?void 0:e.blacklist)==null?void 0:v.sender,a=(p=e==null?void 0:e.blacklist)==null?void 0:p.domains,o=(y=e==null?void 0:e.spam_email)==null?void 0:y.usernames,u=(b=e==null?void 0:e.internal)==null?void 0:b.domains,d=(A=e==null?void 0:e.internal)==null?void 0:A.sender;return c.jsx("section",{className:"flex flex-col w-full !mb-3",children:c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),c.jsxs(G0,{children:[c.jsxs(ri,{label:"Recipients",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific recipients from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx(Zoe,{isLoading:t,data:r})]}),c.jsxs(ri,{label:"Senders",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific senders from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx($oe,{isLoading:t,data:i})]}),c.jsxs(ri,{label:"Domains",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific email domains from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx(Goe,{isLoading:t,data:a})]}),c.jsxs(ri,{label:"Spam",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),c.jsxs(fD,{children:[c.jsx(ri,{label:"Email Prefixes",onActive:()=>{},children:c.jsx(Koe,{data:o,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(ri,{label:"Phrases",onActive:()=>{},children:c.jsx(Joe,{classList:"mt-[-1px]"})})]})]}),c.jsxs(ri,{label:"Advanced",onActive:()=>{},children:[c.jsx("p",{className:"mb-10"}),c.jsx(kne,{data:u}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),c.jsxs(fD,{children:[c.jsx(ri,{label:"Internal Domains",onActive:()=>{},children:c.jsx(ele,{data:u,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(ri,{label:"Associated Contacts",onActive:()=>{},children:c.jsx(Yoe,{data:d,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},nle=e=>qt({mutationFn:()=>et.get(`/socialmedia/instagram?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Instagram account.",{id:"instagram-connection-error"})}),rle=e=>qt({mutationFn:()=>et.getText(`/socialmedia/instagram/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Instagram account.",{id:"instagram-employee-connection-error"}),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${et.getUser()}`}}),ile=e=>qt({mutationFn:()=>et.getText(`/socialmedia/linkedin/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to LinkedIn account.",{id:"linkedin-employee-connection-error"}),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${et.getUser()}`}}),ale=e=>qt({mutationFn:()=>et.getText(`/socialmedia/facebook/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Facebook account.",{id:"facebook-employee-connection-error"}),onSuccess:t=>{window.location.href=t}}),sle=(e,t)=>qt({mutationFn:n=>et.get(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`),onError:()=>be.error("Error occurred while trying to connect to Facebook account.",{id:"facebook-connection-error"}),onSuccess:n=>{window.location.href=n.firmURL}}),ole=()=>{const e=Vt();return qt({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>et.post("/socialmedia/twitter/response",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:t=>{e.invalidateQueries({queryKey:J0().queryKey}),e.invalidateQueries({queryKey:D6.queryKey}),e.invalidateQueries({queryKey:Ps().queryKey})}})},lle=()=>{const e=Vt();return qt({mutationFn:({type:t,accountType:n})=>et.post("/socialmedia/disconnect",{type:t,accountType:n}),onSuccess:()=>{e.invalidateQueries({queryKey:J0().queryKey}),e.invalidateQueries({queryKey:Ps().queryKey})}})},Cz=()=>qt({mutationFn:e=>et.put("/accountsettings/approved",{approved:e}),onSuccess:()=>{}}),ule=()=>{const e=Vt();return qt({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>et.post("/Archiving/readd_archiving_keyword_and_added_item",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:()=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},cle=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>et.post(`/Popups/archiving_view_previously_removed_keywords/${e}`)}),Ps=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>et.get("/socialmedia/check/statuses")}),R1=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await et.get("/heightenedsupervisionusers/users");if(!e||e.error)throw new Error("Error occurred while fetching users");return e}}),dle=()=>{const e=Vt();return qt({mutationFn:({types:t,employees:n})=>et.post("/employeerequests",{types:t,employees:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["settings"]})}})},Rz=()=>({queryKey:["socialmediatypes"],queryFn:()=>et.get("/socialmedia/types"),retry:!1}),J0=()=>({queryKey:["employeeaccounts"],queryFn:()=>et.get("/socialmedia/employee/accounts?url=mrc")}),D6={queryKey:["employeeAccountsStatus"],queryFn:()=>et.get("/socialmedia/employee/statuses")},Ei=({status:e})=>{if(!e)return"";const t={facebook_active:"text-[#008E28]",linkedin_active:"text-[#008E28]",instagram_active:"text-[#008E28]",twitter_active:"text-[#008E28]",active:"text-[#008E28]",facebook_connected:"text-[#008E28]",linkedin_connected:"text-[#008E28]",instagram_connected:"text-[#008E28]",twitter_connected:"text-[#008E28]",connected:"text-[#008E28]",facebook_inactive:"text-[#AA2400]",linkedin_inactive:"text-[#AA2400]",instagram_inactive:"text-[#AA2400]",twitter_inactive:"text-[#AA2400]",inactive:"text-[#AA2400]",facebook_pending:"text-[#C68900]",instagram_pending:"text-[#C68900]",linkedin_pending:"text-[#C68900]",twitter_pending:"text-[#C68900]",pending:"text-[#C68900]",facebook_unavailable:"text-[#AA2400]",linkedin_unavailable:"text-[#AA2400]",instagram_unavailable:"text-[#AA2400]",twitter_unavailable:"text-[#AA2400]",unavailable:"text-[#AA2400]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]"};let n=oa,r="",i=t[e.status];switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":case"facebook_connected":case"linkedin_connected":case"instagram_connected":case"twitter_connected":case"connected":n=UL,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=oa,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=HL,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=QJ,r="Connect";break;default:n=oa,r="N/A",i="text-[#AA2400]";break}return c.jsxs("div",{className:`inline-flex gap-1 w-22.5 h-6 items-center px-1.5 py-1 rounded-sm text-sm font-medium ${i}`,children:[c.jsx(he,{icon:n,size:"small",className:"fill-current"}),c.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},Mr={NOT_SET:0,PENDING:1,CONNECTED:2,DISCONNECTED:3},xr={iMessage:32,WhatsApp:33},Tf=e=>{switch(e){case Mr.PENDING:return{status:"pending",statusTitle:"Pending"};case Mr.CONNECTED:return{status:"active",statusTitle:"Active"};case Mr.DISCONNECTED:default:return{status:"unavailable",statusTitle:"N/A"}}},fle=(e,t)=>{let n="Inactive Connection",r="text-red-700",i=oa;if(e!==0)switch(t){case Mr.PENDING:n="Pending Connection",r="text-[#C68900]",i=HL;break;case Mr.CONNECTED:n="Active Connection",r="text-green-800",i=UL;break}return{statusText:n,statusColor:r,icon:i}},Pc=()=>({queryKey:["accountconnections"],queryFn:()=>et.get("/mobilechannelconnections/connection")}),Fd=()=>({queryKey:["mobileuserstatuses"],queryFn:()=>et.get("/mobilechannelconnections/check/statuses")}),hle=()=>qt({mutationFn:e=>et.post("/imessages",e)}),mle=()=>qt({mutationFn:e=>et.post("/whatsapp",e)}),ple=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/mobilechannelconnections/connection_request",{requests:t}),onSuccess:()=>{e.invalidateQueries({queryKey:["settings"]})}})},ob={queryKey:["mobileaccess"],queryFn:()=>et.get("/mobiles/access")},Bg={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},Iz=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{var _,F,q,z;const i=ple(),{data:a,isLoading:o,isSuccess:u}=Mt(Pc()),{data:d,isLoading:h,isSuccess:v}=Mt(R1()),{data:p,isLoading:y,isSuccess:b}=Mt(Fd()),A=Vt();k.useEffect(()=>{v&&b&&A.setQueryData(Fd().queryKey,B=>{if(!B)return{};const X={...B};return d.forEach(V=>{X[V.id]||(X[V.id]={}),Object.values(xr).forEach(J=>{X[V.id][J]||(X[V.id][J]={...Bg})})}),X})},[v,b,p,d,A]);const x=p&&d?Object.entries(p).flatMap(([B,X])=>Object.entries(X).filter(([V,J])=>J.active===1).map(([V])=>({userId:parseInt(B),integrationId:parseInt(V)})).filter(V=>!isNaN(V.userId)&&!isNaN(V.integrationId))):[],w=ur(),R=(B,X,V)=>{const J=V?1:0;A.setQueryData(Fd().queryKey,ee=>{var ne;return ee&&((ne=ee==null?void 0:ee[B])!=null&&ne[X]?{...ee,[B]:{...ee==null?void 0:ee[B],[X]:{...ee[B][X],active:J}}}:{...ee,[B]:{...ee==null?void 0:ee[B],[X]:{...Bg,active:V}}})})},O=B=>{A.setQueryData(Fd().queryKey,X=>X&&Object.fromEntries(Object.entries(X).map(([J,ee])=>[J,Object.fromEntries(Object.entries(ee).map(([ne,U])=>[ne,{...U,active:B?1:0}]))])))},D=(B,X)=>{if(isNaN(B))return be.error("You cannot send a request for 'Your Mobile Accounts'.",{id:"your-account-request",duration:5e3});A.setQueryData(Fd().queryKey,V=>{if(!(V!=null&&V[B]))return V;const J=Object.fromEntries(Object.entries(V[B]).map(([ee,ne])=>[ee,{...ne,active:X?1:0}]));return{...V,[B]:J}})},C=((_=a==null?void 0:a.whatsApp)==null?void 0:_.id)==Mr.NOT_SET?{status:"unavailable",statusTitle:"N/A"}:Tf((F=a==null?void 0:a.whatsApp)==null?void 0:F.status),M={name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:((q=a==null?void 0:a.iMessage)==null?void 0:q.id)==Mr.NOT_SET?{status:"unavailable",statusTitle:"N/A"}:Tf((z=a==null?void 0:a.iMessage)==null?void 0:z.status),whatsapp:C},P=k.useMemo(()=>{if(!d||!p)return[];const B=d.map(X=>{var V,J;return{id:X.id,name:`${X.firstName} ${X.lastName}`,imessage:((V=p==null?void 0:p[X.id])==null?void 0:V[xr==null?void 0:xr.iMessage])||Bg,whatsapp:((J=p==null?void 0:p[X.id])==null?void 0:J[xr==null?void 0:xr.WhatsApp])||Bg}});return B.unshift({...M}),B},[d,p,r]),T=[w.accessor("name",{cell:B=>B.getValue(),header:()=>e?"Name":"",size:300}),w.accessor("imessage",{cell:B=>{const X=B.getValue();return c.jsxs("label",{htmlFor:`imessage-check-${B.row.id}-${xr==null?void 0:xr.iMessage}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`imessage-check-${B.row.id}-${xr==null?void 0:xr.iMessage}`,checked:!!X.active,onChange:V=>R(B.row.id,xr==null?void 0:xr.iMessage,V.target.checked)}),c.jsx(Ei,{status:X})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),w.accessor("whatsapp",{cell:B=>{const X=B.getValue();return c.jsxs("label",{htmlFor:`whatsapp-check-${B.row.id}-${xr==null?void 0:xr.WhatsApp}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`whatsapp-check-${B.row.id}-${xr==null?void 0:xr.WhatsApp}`,checked:!!X.active,onChange:V=>R(B.row.id,xr==null?void 0:xr.WhatsApp,V.target.checked)}),c.jsx(Ei,{status:X})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&T.unshift(w.accessor("id",{header:({table:B})=>c.jsx("input",{type:"checkbox",checked:p&&x.length>0&&Object.values(p).every(X=>Object.values(X).every(V=>V.active===1)),onChange:X=>O(X.target.checked)}),cell:({row:B})=>{var V;let X=!1;if(B.id!="firm_mobile_accounts"&&B.id!="your_mobile_accounts"){const J=parseInt(B.original.id);X=x.filter(ne=>ne.userId===J).length>0&&Object.values((V=p==null?void 0:p[B.original.id])!=null?V:{}).every(ne=>ne.active===1)}return c.jsx("input",{type:"checkbox",checked:X,onChange:J=>{D(parseInt(B.original.id),J.target.checked)}})},maxSize:55}));const j=[{label:i.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(!i.isPending){if(x.length<1)return be.error("Please select at least one account!",{id:"no-selection-error",duration:5e3});i.mutate(x,{onSuccess:()=>{A.invalidateQueries({queryKey:R1().queryKey}),A.invalidateQueries({queryKey:Fd().queryKey}),be.success("To do list items have been sent for mobile setup.",{id:"mobile-request-success",duration:5e3})},onError:()=>{be.error("An error occurred while sending employee requests.",{id:"mobile-request-error",duration:5e3})}})}},icon:YL}],N=Qn({data:P,columns:T,getCoreRowModel:qn(),getPaginationRowModel:cr(),getFilteredRowModel:tr(),getRowId:B=>B.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h5",{className:"text-brand-dark-800 text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&c.jsx("p",{className:"mb-5"})]}),c.jsx(Vr,{table:N,hasGlobalFilter:t,filterButtons:j,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:h||y?"Loading...":"No accounts found"})]})},gle=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),c.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),c.jsx(Iz,{showName:!0,hasRowSelection:!0}),c.jsx(lr,{prevLink:"/setup/mobile",prevProgress:12,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:13})]});function Kl(e){return typeof e=="string"||e instanceof String}function YD(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function Mz(e,t){return Array.isArray(t)?Mz(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,a]=r;return t(a,i)&&(n[i]=a),n},{})}const Wt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function vle(e){switch(e){case Wt.LEFT:return Wt.FORCE_LEFT;case Wt.RIGHT:return Wt.FORCE_RIGHT;default:return e}}function HA(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function I1(e,t){if(t===e)return!0;const n=Array.isArray(t),r=Array.isArray(e);let i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!I1(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const a=t instanceof Date,o=e instanceof Date;if(a&&o)return t.getTime()==e.getTime();if(a!=o)return!1;const u=t instanceof RegExp,d=e instanceof RegExp;if(u&&d)return t.toString()==e.toString();if(u!=d)return!1;const h=Object.keys(t);for(i=0;i<h.length;i++)if(!Object.prototype.hasOwnProperty.call(e,h[i]))return!1;for(i=0;i<h.length;i++)if(!I1(e[h[i]],t[h[i]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}class ble{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?Wt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Wt.RIGHT:Wt.LEFT}}function sn(e,t){return new sn.InputMask(e,t)}function Oz(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?sn.MaskedRegExp:Kl(e)?sn.MaskedPattern:e===Date?sn.MaskedDate:e===Number?sn.MaskedNumber:Array.isArray(e)||e===Array?sn.MaskedDynamic:sn.Masked&&e.prototype instanceof sn.Masked?e:sn.Masked&&e instanceof sn.Masked?e.constructor:e instanceof Function?sn.MaskedFunction:(console.warn("Mask not found for mask",e),sn.Masked)}function D0(e){if(!e)throw new Error("Options in not defined");if(sn.Masked){if(e.prototype instanceof sn.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof sn.Masked?{mask:e}:YD(e)&&e.mask instanceof sn.Masked?e:{};if(t){const r=t.mask;return{...Mz(t,(i,a)=>!a.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return YD(e)?{...e}:{mask:e}}function qo(e){if(sn.Masked&&e instanceof sn.Masked)return e;const t=D0(e),n=Oz(t.mask);if(!n)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===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}sn.createMask=qo;class P6{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(n){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(n){}return t!=null?t:this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch(r){}}get isActive(){return!1}}sn.MaskElement=P6;const GD=90,yle=89;class lb extends P6{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,n,r;return(t=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=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===GD&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===yle&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===GD&&(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={}}}sn.HTMLMaskElement=lb;class Ale extends lb{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,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}sn.HTMLMaskElement=lb;class Dz extends lb{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}sn.HTMLContenteditableMaskElement=Dz;class ub{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>ub.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}}ub.MAX_LENGTH=100;class xle{constructor(t,n){this.el=t instanceof P6?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Dz(t):new Ale(t),this.masked=qo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ub,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 n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof sn.Masked)&&this.masked.constructor===Oz(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof sn.Masked?t:qo({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}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,n){const r=this._listeners[t];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(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,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,r=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...r}=t,i=!this.maskEquals(n),a=this.masked.optionsIsChanged(r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Wt.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(n);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new ble({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:Wt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Wt.NONE&&(o=this.masked.nearestInputPos(o,Wt.NONE)),this.updateControl(o),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}}sn.InputMask=xle;class An{static normalize(t){return Array.isArray(t)?t:[t,new An]}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}}sn.ChangeDetails=An;class Fs{constructor(t,n,r){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=r}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"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class ji{constructor(t){this._value="",this._update({...ji.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,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),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,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Fs(this.extractInput(t,n),t)}appendTail(t){return Kl(t)&&(t=new Fs(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new An({inserted:t,rawInserted:t})):new An}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let a;if([t,a]=this.doPrepareChar(t,n),t&&(a=a.aggregate(this._appendCharRaw(t,n)),!a.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const d=this._appendCharRaw(t,n);u=u.aggregate(d),d.rawInserted||u.equals(a)?a=u:this.state=o}if(a.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const d=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.unshift(this.displayValue.length-a.tailShift)}let h=this.appendTail(r);if(u=h.rawInserted.length===r.toString().length,!(u&&h.inserted)&&this.overwrite==="shift"){this.state=d,o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.shift();h=this.appendTail(r),u=h.rawInserted.length===r.toString().length}u&&h.inserted&&(this.state=d)}u||(a=new An,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new An}_appendEager(){return new An}append(t,n,r){if(!Kl(t))throw new Error("value should be string");const i=Kl(r)?new Fs(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,n);for(let o=0;o<t.length;++o){const u=this._appendChar(t[o],n,i);if(!u.rawInserted&&!this.doSkipInvalid(t[o],n,i))break;a.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new An}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=t();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,r=t(this);return this.state=n,delete this._isolated,r}doSkipInvalid(t,n,r){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),An.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),An.normalize(this.prepareChar?this.prepareChar(t,this,n):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,n,r,i,a){r===void 0&&(r=""),i===void 0&&(i=Wt.NONE),a===void 0&&(a={input:!0});const o=t+n,u=this.extractTail(o),d=this.eager===!0||this.eager==="remove";let h;d&&(i=vle(i),h=this.extractInput(0,o,{raw:!0}));let v=t;const p=new An;if(i!==Wt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!d?Wt.NONE:i),p.tailShift=v-t),p.aggregate(this.remove(v)),d&&i!==Wt.NONE&&h===this.rawInputValue)if(i===Wt.FORCE_LEFT){let y;for(;h===this.rawInputValue&&(y=this.displayValue.length);)p.aggregate(new An({tailShift:-1})).aggregate(this.remove(y-1))}else i===Wt.FORCE_RIGHT&&u.unshift();return p.aggregate(this.append(r,a,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!I1(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||ji.EMPTY_VALUES.includes(t)&&ji.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new An}}ji.DEFAULTS={skipInvalid:!0};ji.EMPTY_VALUES=[void 0,null,""];sn.Masked=ji;class tc{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Kl(t)?new Fs(String(t)):t;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof Fs)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof tc){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof sn.MaskedPattern))return new Fs(this.toString()).appendTo(t);const n=new An;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],a=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!a||a.index<=o)&&((i instanceof tc||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof tc&&t._blocks[o]),u){const d=u.appendTail(i);n.aggregate(d);const h=i.toString().slice(d.rawInserted.length);h&&n.aggregate(t.append(h,{tail:!0}))}else n.aggregate(t.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...r}=t;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new tc:new Fs;return a.state=i,a})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],r=n.shift();if(n.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class wle{constructor(t,n){this.masked=t,this._log=[];const{offset:r,index:i}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const 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=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;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,Wt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Wt.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,Wt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.NONE),!0})}}class Pz{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,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new An}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this._value.length;switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return r;case Wt.NONE:case Wt.RIGHT:case Wt.FORCE_RIGHT:default:return i}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new An;const r=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new An({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new An;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Fs("")}appendTail(t){return Kl(t)&&(t=new Fs(String(t))),t.appendTo(this)}append(t,n,r){const i=this._appendChar(t[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}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()}}class M1{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u,...d}=t;this.masked=qo(d),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new An}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,n){if(n===void 0&&(n={}),this.isFilled)return new An;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new An,this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,n,r){return this.masked.append(t,this.currentMaskFlags(n),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new An:(this.isFilled=!0,new An({inserted:this.placeholderChar}))}_appendEager(){return new An}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,r)}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(t,r),i);switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return this.isComplete?a:r;case Wt.RIGHT:case Wt.FORCE_RIGHT:return this.isComplete?a:i;case Wt.NONE:default:return a}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).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 n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new An}}M1.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 Ele extends ji{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}sn.MaskedRegExp=Ele;class Ti extends ji{constructor(t){super({...Ti.DEFAULTS,...t,definitions:Object.assign({},M1.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(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const h=n.slice(a),v=Object.keys(this.blocks).filter(y=>h.indexOf(y)===0);v.sort((y,b)=>b.length-y.length);const p=v[0];if(p){const{expose:y,repeat:b,...A}=D0(this.blocks[p]),x={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...A,repeat:b,parent:this},w=b!=null?new sn.RepeatBlock(x):qo(x);w&&(this._blocks.push(w),y&&(this.exposeBlock=w),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),a+=p.length-1;continue}}let o=n[a],u=o in t;if(o===Ti.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Ti.ESCAPE_CHAR){if(++a,o=n[a],!o)break;u=!1}const d=u?new M1({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...D0(t[o]),parent:this}):new Pz({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...r}=t;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}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,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new An;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new An;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var a;const d=u._appendChar(t,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]});if(i.aggregate(d),d.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new tc;return t===n||this._forEachBlocksInRange(t,n,(i,a,o,u)=>{const d=i.extractTail(o,u);d.stop=this._findStopBefore(a),d.from=this._blockStartPos(a),d instanceof tc&&(d.blockIndex=a),r.extend(d)}),r}extractInput(t,n,r){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),t===n)return"";let i="";return this._forEachBlocksInRange(t,n,(a,o,u,d)=>{i+=a.extractInput(u,d,r)}),i}_findStopBefore(t){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=t)n=i;else break}return n}_appendPlaceholder(t){const n=new An;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||t!=null){var u;n.aggregate(o._appendPlaceholder((u=o._blocks)==null?void 0:u.length))}}),n}_mapPosToBlock(t){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(t,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,u=i.offset,d=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,d),a&&!o){for(let h=i.index+1;h<a.index;++h)r(this._blocks[h],h,0,this._blocks[h].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._forEachBlocksInRange(t,n,(i,a,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Wt.NONE),!this._blocks.length)return 0;const r=new wle(this,t);if(n===Wt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Wt.LEFT||n===Wt.FORCE_LEFT){if(n===Wt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Wt.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:n===Wt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Wt.RIGHT||n===Wt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Wt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Wt.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,n,(i,a,o,u)=>{r+=i.totalInputPositions(o,u)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(r=>this._blocks[r]):[]}pad(t){const n=new An;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Ti.DEFAULTS={...ji.DEFAULTS,lazy:!0,placeholderChar:"_"};Ti.STOP_CHAR="`";Ti.ESCAPE_CHAR="\\";Ti.InputDefinition=M1;Ti.FixedDefinition=Pz;sn.MaskedPattern=Ti;class $v extends Ti{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const u=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let h=0;for(;h<d.length&&d[h]===u[h];)++h;o.mask=d.slice(0,h).replace(/0/g,"\\0")+"0".repeat(this.maxLength-h),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",r="";const[,i,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(t,n){n===void 0&&(n={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(a)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(i[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new An;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let a=0;a<i;++a)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(a=>this._appendCharRaw(a))}return n}}sn.MaskedRange=$v;const Sle="d{.}`m{.}`Y";class Do extends Ti{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Kl(n)?n:r}}constructor(t){super(Do.extractPatternOptions({...Do.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...a}={...Do.DEFAULTS,...t},o=Object.assign({},Do.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,i),super._update({...a,mask:Kl(n)?n:r,blocks:o})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=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(Do.extractPatternOptions(t))}}Do.GET_DEFAULT_BLOCKS=()=>({d:{mask:$v,from:1,to:31,maxLength:2},m:{mask:$v,from:1,to:12,maxLength:2},Y:{mask:$v,from:1900,to:9999}});Do.DEFAULTS={...Ti.DEFAULTS,mask:Date,pattern:Sle,format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[n,r,i].join(".")},parse:(e,t)=>{const[n,r,i]=e.split(".").map(Number);return new Date(i,r-1,n)}};sn.MaskedDate=Do;class cb extends ji{constructor(t){super({...cb.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(n=>{const{expose:r,...i}=D0(n),a=qo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._applyDispatch(t,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),r}_applyDispatch(t,n,r){t===void 0&&(t=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,u=a.slice(o.length),d=this.currentMask,h=new An,v=d==null?void 0:d.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),h.tailShift=this.currentMask.value.length-i.length),u&&(h.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):v&&(this.currentMask.state=v)),h}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new An;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,r;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(t,this,n,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[r,i]=super.doPrepare(t,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.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 n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}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,n){const r=new An;return this.currentMask&&r.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(t,n,r){return this.currentMask?this.currentMask.extractInput(t,n,r):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}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((n,r)=>{if(!t[r])return;const{mask:i,...a}=t[r];return I1(n,a)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}cb.DEFAULTS={...ji.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,a=t.compiledMasks.map((o,u)=>{const d=t.currentMask===o,h=d?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):d||o.remove(h),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:u,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(h,o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT)))}});return a.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[a[0].index]}};sn.MaskedDynamic=cb;class db extends Ti{constructor(t){super({...db.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}_appendCharRaw(t,n){n===void 0&&(n={});const r=Math.min(this.nearestInputPos(0,Wt.FORCE_RIGHT),this.value.length),i=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const d=i[0][u];u>=this.value.length||d===o.value||(o.reset(),o._appendChar(d,n))});const a=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>a.aggregate(super._appendCharRaw(o))),a}return new An({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Fs("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new An;const r=Math.min(super.nearestInputPos(0,Wt.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(r,i),r)).length>1);--i);const a=super.remove(i,n);return a.tailShift+=i-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}db.DEFAULTS={...Ti.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};sn.MaskedEnum=db;class Cle extends ji{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}sn.MaskedFunction=Cle;var jz;class Ea extends ji{constructor(t){super({...Ea.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+HA(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(HA).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(HA(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(t,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,r))}_appendCharRaw(t,n){n===void 0&&(n={});const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),d=!1;if(u){let y;this.min!=null&&this.min<0&&this.number<this.min&&(y=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(y=this.max),y!=null&&(this.autofix?(this._value=this.format(y,this).replace(Ea.UNMASKED_RADIX,this.radix),d||(d=a===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let h;u?h=new An({inserted:this._value.slice(a.length),rawInserted:d?"":t,skip:d}):(this._value=a,h=new An),this._value=this._insertThousandsSeparators(this._value);const v=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(v);return h.tailShift+=(p-i)*this.thousandsSeparator.length,h}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,n){const r=this._findSeparatorAround(t);r>=0&&(t=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const r=this.value.slice(0,t),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new An({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Wt.NONE:case Wt.LEFT:case Wt.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(t<i||this.value.length<=i||n===Wt.FORCE_LEFT)return r}break}case Wt.RIGHT:case Wt.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,r){n===void 0&&(n={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===Ea.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Ea.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(Ea.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)||Ea.EMPTY_VALUES.includes(t)&&Ea.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}jz=Ea;Ea.UNMASKED_RADIX=".";Ea.EMPTY_VALUES=[...ji.EMPTY_VALUES,0];Ea.DEFAULTS={...ji.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[jz.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})};sn.MaskedNumber=Ea;const W4={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Tz(e,t,n){t===void 0&&(t=W4.MASKED),n===void 0&&(n=W4.MASKED);const r=qo(e);return i=>r.runIsolated(a=>(a[t]=i,a[n]))}function Rle(e,t,n,r){return Tz(t,n,r)(e)}sn.PIPE_TYPE=W4;sn.createPipe=Tz;sn.pipe=Rle;class Ile extends Ti{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 n,r,i;const{repeat:a,...o}=D0(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=qo(this._blockOpts);this.repeat=(n=(r=a!=null?a:u.repeat)!=null?r:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.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(qo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new An;for(let d=(i=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?i:Math.max(this._blocks.length-1,0),h,v;h=(o=this._blocks[d])!=null?o:v=!v&&this._allocateBlock(d);++d){var i,a,o,u;const p=h._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[d]});if(p.skip&&v){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(p),p.consumed)break}return r}_trimEmptyTail(t,n){var r,i;t===void 0&&(t=0);const a=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let o;n!=null&&(o=(i=this._mapPosToBlock(n))==null?void 0:i.index),o==null&&(o=this._blocks.length-1);let u=0;for(let d=o;a<=d&&!this._blocks[d].unmaskedValue;--d,++u);u&&(this._blocks.splice(o-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._trimEmptyTail(t,n),r}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}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}}sn.RepeatBlock=Ile;try{globalThis.IMask=sn}catch(e){}const Nz={mask:de.oneOfType([de.array,de.func,de.string,de.instanceOf(RegExp),de.oneOf([Date,Number,sn.Masked]),de.instanceOf(sn.Masked)]),value:de.any,unmask:de.oneOfType([de.bool,de.oneOf(["typed"])]),prepare:de.func,prepareChar:de.func,validate:de.func,commit:de.func,overwrite:de.oneOfType([de.bool,de.oneOf(["shift"])]),eager:de.oneOfType([de.bool,de.oneOf(["append","remove"])]),skipInvalid:de.bool,onAccept:de.func,onComplete:de.func,placeholderChar:de.string,displayChar:de.string,lazy:de.bool,definitions:de.object,blocks:de.object,enum:de.arrayOf(de.string),maxLength:de.number,from:de.number,to:de.number,pattern:de.string,format:de.func,parse:de.func,autofix:de.oneOfType([de.bool,de.oneOf(["pad"])]),radix:de.string,thousandsSeparator:de.string,mapToRadix:de.arrayOf(de.string),scale:de.number,normalizeZeros:de.bool,padFractionalZeros:de.bool,min:de.oneOfType([de.number,de.instanceOf(Date)]),max:de.oneOfType([de.number,de.instanceOf(Date)]),dispatch:de.func,inputRef:de.oneOfType([de.func,de.shape({current:de.object})])},kz=Object.keys(Nz).filter(e=>e!=="value"),Mle=["value","unmask","onAccept","onComplete","inputRef"],Ole=kz.filter(e=>Mle.indexOf(e)<0);function Dle(e){var t;const n=(t=class extends or.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=sn(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(u=>Ole.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(a){const{...o}=a;return kz.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return or.createElement(e,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},t.displayName=void 0,t.propTypes=void 0,t),r=e.displayName||e.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=Nz,or.forwardRef((i,a)=>or.createElement(n,{...i,ref:a}))}const Ple=Dle(e=>{let{inputRef:t,...n}=e;return or.createElement("input",{...n,ref:t})}),jle=(e,t)=>or.createElement(Ple,{...e,ref:t}),Tle=or.forwardRef(jle);var VA={exports:{}},UA={},WA={},YA={exports:{}},GA={exports:{}},KA={exports:{}},ZA={exports:{}},KD;function Vf(){return KD||(KD=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ZA)),ZA.exports}var $A={exports:{}},ZD;function Nle(){return ZD||(ZD=1,(function(e){var t=Vf().default;function n(r,i){if(t(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var o=a.call(r,i||"default");if(t(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})($A)),$A.exports}var $D;function _z(){return $D||($D=1,(function(e){var t=Vf().default,n=Nle();function r(i){var a=n(i,"string");return t(a)=="symbol"?a:a+""}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(KA)),KA.exports}var JD;function fb(){return JD||(JD=1,(function(e){var t=_z();function n(r,i,a){return(i=t(i))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(GA)),GA.exports}var eP;function Uf(){return eP||(eP=1,(function(e){var t=fb();function n(i,a){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);a&&(u=u.filter(function(d){return Object.getOwnPropertyDescriptor(i,d).enumerable})),o.push.apply(o,u)}return o}function r(i){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?n(Object(o),!0).forEach(function(u){t(i,u,o[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(o,u))})}return i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(YA)),YA.exports}var JA={exports:{}},ex={exports:{}},tP;function kle(){return tP||(tP=1,(function(e){function t(n){if(Array.isArray(n))return n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ex)),ex.exports}var tx={exports:{}},nP;function _le(){return nP||(nP=1,(function(e){function t(n,r){var i=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,u,d,h=[],v=!0,p=!1;try{if(u=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(h.push(a.value),h.length!==r);v=!0);}catch(y){p=!0,o=y}finally{try{if(!v&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(p)throw o}}return h}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(tx)),tx.exports}var nx={exports:{}},rx={exports:{}},rP;function Bz(){return rP||(rP=1,(function(e){function t(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,a=Array(r);i<r;i++)a[i]=n[i];return a}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(rx)),rx.exports}var iP;function Fz(){return iP||(iP=1,(function(e){var t=Bz();function n(r,i){if(r){if(typeof r=="string")return t(r,i);var a={}.toString.call(r).slice(8,-1);return a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set"?Array.from(r):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(r,i):void 0}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(nx)),nx.exports}var ix={exports:{}},aP;function Ble(){return aP||(aP=1,(function(e){function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
265
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Loe(e,t){if(e){if(typeof e=="string")return zD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zD(e,t):void 0}}function zD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xoe(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,u=[],d=!0,h=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(d=(r=a.call(n)).done)&&(u.push(r.value),u.length!==t);d=!0);}catch(v){h=!0,i=v}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw i}}return u}}function zoe(e){if(Array.isArray(e))return e}function qoe(e){var t=Array.prototype.slice.call(e),n=Boe(t,4),r=n[0],i=n[1],a=n[2],o=n[3],u,d,h;if(typeof r=="string")u=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")o?(d=a,h=o):(d=void 0,h=a),i&&(d=Toe({defaultCountry:i},d));else if(af(i))a?(d=i,h=a):h=i;else throw new Error("Invalid second argument: ".concat(i));return{text:u,options:d,metadata:h}}function Qoe(){var e=qoe(arguments),t=e.text,n=e.options,r=e.metadata;return joe(t,n,r)}function yz(){return Fae(Qoe,arguments)}const qD=["Facebook","Instagram","Twitter","LinkedIn"],Hoe=e=>[...e].sort((t,n)=>{const r=qD.indexOf(t.platform),i=qD.indexOf(n.platform);return r!==-1&&i!==-1?r-i:r!==-1?-1:i!==-1?1:t.platform.localeCompare(n.platform)}),QD=e=>/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e),O0=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),ru=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),HD={"/email":"email","/social_media":"social_media","/website":"website","/mobile":"mobile"},Az=e=>{if(!e)return null;const t=Object.keys(HD).find(n=>e.includes(n));return t?HD[t]:null},Voe=(e,t)=>{const r=`\\b${(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},VD=(e,t)=>{const r=`\\b${(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},U4=e=>(e==null?void 0:e.phrase)||(e==null?void 0:e.keyword)||(e==null?void 0:e.item)||"",sb=(e,t,n)=>{const r=xz(wz(e==null?void 0:e.toLowerCase()));return r?!t||!n?[]:t.filter(i=>{var d,h;const a=(h=(d=i.keyword)==null?void 0:d.toLowerCase())==null?void 0:h.trim();if(!VD(r,a))return!1;if(n.length<1)return!0;const o=n==null?void 0:n.filter(v=>{var y;const p=(y=U4(v))==null?void 0:y.toLowerCase();return p==null?void 0:p.includes(a==null?void 0:a.toLowerCase())});if(o.length===0)return!0;const u=o.reduce((v,p)=>{var A;const b=((A=U4(p))==null?void 0:A.toLowerCase()).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return v.replace(new RegExp(`\\b${b}\\b`,"gi"),"")},r);return VD(u,a)}):[]},R6=(e,t)=>{const n=xz(wz(e==null?void 0:e.toLowerCase()));return n?t==null?void 0:t.filter(r=>{const i=typeof r=="string"?r:U4(r);return!!Voe(n,i==null?void 0:i.toLowerCase())}):[]},UD=({searchWords:e,textToHighlight:t})=>{const i=[...e.filter(o=>typeof o=="string")].sort((o,u)=>u.length-o.length).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a=new RegExp(`\\b(${i.join("|")})\\b`,"gi");return[...t.matchAll(a)].map(o=>({start:o.index,end:o.index+o[0].length}))},xz=e=>e&&e.replace(/[\r?\n!@#&*()\-–—+=[\]{}|:;'"‘’“”,.<>?/]/g," "),wz=e=>e&&e.replace(/<[^>]*>/g,""),Uoe=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},WD=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),Woe=e=>e?gr(e,"MMMM do, yyyy"):"N/A",Ez=e=>{if(!e||(e==null?void 0:e.trim())==="")return!1;try{const t=e!=null&&e.trim().startsWith("+")?e==null?void 0:e.trim():`+${e==null?void 0:e.trim()}`;return yz(t).isPossible()}catch(t){return!1}},Qo=({showEdit:e,value:t,onChange:n,maxLength:r=255,className:i="w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-brand-dark-800 focus:outline-none"})=>{const a=k.useRef(null);return k.useEffect(()=>{e&&a.current&&a.current.focus()},[e]),e?c.jsx("input",{ref:a,type:"text",defaultValue:t,onChange:n,maxLength:r,className:i,onClick:o=>o.stopPropagation()}):c.jsx("span",{children:t})},Yoe=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=F=>`${F.id}_${F.itemType}`,R=(F,q)=>{b.current[q]=F.target.value},O=F=>{const q=w(F);b.current[q]=F.item,y(q)},D=F=>{const q=w(F);delete b.current[q],y(null)},C=[x.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:F})=>{const q=w(F.original);return c.jsx(Qo,{showEdit:p===q,value:F.original.item,onChange:z=>R(z,q)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:F})=>{const q=w(F.original);return c.jsx(he,{className:"",icon:p===q?kn:Qs,size:"large",onClick:z=>{var B;if(z.stopPropagation(),p===q){const X=((B=b.current[q])!=null?B:F.original.item).trim().slice(0,255);if(!ru(X)){be.error("Please enter a valid email!",{id:"edit-associated-contact"});return}if(e.find(J=>w(J)!==q&&J.item.toLowerCase()===X.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-associated-contact"});return}if(X===F.original.item){D(F.original);return}j.mutate({id:F.original.id,itemType:F.original.itemType,filterType:F.original.filterType,addedType:F.original.addedType,item:X},{onSuccess:J=>{J&&J.error_message&&!J.success||(be.success("Associated contact updated successfully",{id:"edit-associated-contact"}),D(F.original))}});return}O(F.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:F})=>{const q=w(F.original);return p===q?c.jsx(he,{className:"",icon:an,size:"large",onClick:z=>{z.stopPropagation(),D(F.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:z=>{z.stopPropagation(),d(!0),v(F.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{y(null),i(!0),requestAnimationFrame(()=>{var F;(F=A.current)==null||F.focus()})}}],M=Qf();function P(F){F&&M.mutate({id:F.id},{onSuccess:()=>{d(!1)}})}const T=zf(),j=qf();function N(){if(!ru(a))return be.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"sender",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const _=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:F=>F.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:_,onRowClick:F=>{F.toggleSelected()},bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:F=>F.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:F=>o(F.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:N,disabled:T.isPending,children:T.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>P(h),disabled:M.isPending,children:M.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},Goe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Email Domains",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!O0(B)){be.error("Please enter a valid domain!",{id:"edit-excluded-domain"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-domain"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Domain updated successfully",{id:"edit-excluded-domain"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Domain",icon:Rr,onClick:()=>{p(null),r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!O0(i))return be.error("Please enter a valid domain!",{id:"new-email-domain"});P.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},Koe=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=q=>`${q.id}_${q.itemType}`,R=(q,z)=>{b.current[z]=q.target.value},O=q=>{const z=w(q);b.current[z]=q.item,y(z)},D=q=>{const z=w(q);delete b.current[z],y(null)},C=[x.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:q})=>{const z=w(q.original);return c.jsx(Qo,{showEdit:p===z,value:q.original.item,onChange:B=>R(B,z)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:q})=>{const z=w(q.original);return c.jsx(he,{className:"",icon:p===z?kn:Qs,size:"large",onClick:B=>{var X;if(B.stopPropagation(),p===z){const V=((X=b.current[z])!=null?X:q.original.item).trim().slice(0,255);if(!WD(V)){be.error("Please enter a valid email prefix!",{id:"edit-email-prefix"});return}if(e.find(ee=>w(ee)!==z&&ee.item.toLowerCase()===V.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-email-prefix"});return}if(V===q.original.item){D(q.original);return}N.mutate({id:q.original.id,itemType:q.original.itemType,filterType:q.original.filterType,addedType:q.original.addedType,item:V},{onSuccess:ee=>{ee&&ee.error_message&&!ee.success||(be.success("Email prefix updated successfully",{id:"edit-email-prefix"}),D(q.original))}});return}O(q.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:q})=>{const z=w(q.original);return p===z?c.jsx(he,{className:"",icon:an,size:"large",onClick:B=>{B.stopPropagation(),D(q.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:B=>{B.stopPropagation(),d(!0),v(q.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{y(null),i(!0),requestAnimationFrame(()=>{var q;(q=A.current)==null||q.focus()})}}],M=jne(),P=Qf();function T(q){q&&(q.addedType=="added"?P.mutate({id:q.id},{onSuccess:()=>{d(!1)}}):M.mutate({id:q.id},{onSuccess:()=>{d(!1)}}))}const j=zf(),N=qf();function _(){if(e.find(q=>q.item==a))return i(!1),be.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!a||a.trim()==""||!WD(a))return be.error("Please enter a valid email prefix!",{id:"new-email-prefix"});j.mutate({itemType:"username",filterType:"spam_email",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const F=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:q=>q.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:F,onRowClick:q=>{q.toggleSelected()},emptyMessage:t?"Loading...":"No items found",bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search or add new prefixes",itemsLabel:"Email Prefixes",rowSelectedCheck:q=>q.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:q=>o(q.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:_,disabled:j.isPending,children:j.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>T(h),disabled:M.isPending||P.isPending,children:M.isPending||P.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},$0=({children:e,asButton:t=!1,className:n="",onClick:r,disabled:i=!1,type:a="button"})=>{const o="block font-bold";return t?c.jsx("button",{type:a,onClick:r,disabled:i,className:`${o} ${n} text-nowrap ${i?"":"cursor-pointer"}`,children:e}):c.jsx("div",{className:`${o} ${n}`,children:e})},Zoe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Recipients",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!ru(B)){be.error("Please enter a valid email!",{id:"edit-excluded-recipient"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-recipient"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Recipient updated successfully",{id:"edit-excluded-recipient"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Email",icon:Rr,onClick:()=>{p(null),r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!ru(i))return be.error("Please enter a valid email!",{id:"new-excluded-email"});P.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs($0,{asButton:!0,className:"flex items-center absolute top-3 right-8",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b-6 border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Recipient"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx($l,{onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},$oe=({data:e=[],isLoading:t=!1})=>{const[n,r]=k.useState(!1),[i,a]=k.useState(""),[o,u]=k.useState(!1),[d,h]=k.useState(),[v,p]=k.useState(null),y=k.useRef({}),b=k.useRef(null),A=ur(),x=_=>`${_.id}_${_.itemType}`,w=(_,F)=>{y.current[F]=_.target.value},R=_=>{const F=x(_);y.current[F]=_.item,p(F)},O=_=>{const F=x(_);delete y.current[F],p(null)},D=[A.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:_})=>{const F=x(_.original);return c.jsx(Qo,{showEdit:v===F,value:_.original.item,onChange:q=>w(q,F)})}}),A.display({size:65,id:"edit",header:()=>null,cell:({row:_})=>{const F=x(_.original);return c.jsx(he,{className:"",icon:v===F?kn:Qs,size:"large",onClick:q=>{var z;if(q.stopPropagation(),v===F){const B=((z=y.current[F])!=null?z:_.original.item).trim().slice(0,255);if(!ru(B)){be.error("Please enter a valid email!",{id:"edit-excluded-sender"});return}if(e.find(V=>x(V)!==F&&V.item.toLowerCase()===B.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-excluded-sender"});return}if(B===_.original.item){O(_.original);return}T.mutate({id:_.original.id,itemType:_.original.itemType,filterType:_.original.filterType,addedType:_.original.addedType,item:B},{onSuccess:V=>{V&&V.error_message&&!V.success||(be.success("Sender updated successfully",{id:"edit-excluded-sender"}),O(_.original))}});return}R(_.original)}})}}),A.display({size:65,id:"delete",header:()=>null,cell:({row:_})=>{const F=x(_.original);return v===F?c.jsx(he,{className:"",icon:an,size:"large",onClick:q=>{q.stopPropagation(),O(_.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:q=>{q.stopPropagation(),u(!0),h(_.original)}})}})],C=[{label:"Add Email",icon:Rr,onClick:()=>{p(null),r(!0),requestAnimationFrame(()=>{var _;(_=b.current)==null||_.focus()})}}],S=Qf();function M(_){_&&S.mutate({id:_.id},{onSuccess:()=>{u(!1)}})}const P=zf(),T=qf();function j(){if(!ru(i))return be.error("Please enter a valid email!",{id:"new-excluded-email"});P.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const N=Qn({data:e,columns:D,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:_=>_.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),c.jsx(Vr,{table:N,onRowClick:_=>{_.toggleSelected()},bordered:!1,filterButtons:C,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:_=>_.original.checked===1,maxHeight:null,paginationControlLabel:null}),n&&c.jsx(wn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:b,type:"text",onChange:_=>a(_.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:j,disabled:P.isPending,children:P.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),o&&c.jsx(wn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-brand-dark-500 mb-5! text-xl font-semibold pb-2",children:"Delete Sender"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>M(d),disabled:S.isPending,children:S.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},I6={twitter:"X",linkedin:"LinkedIn",instagram:"Instagram",facebook:"Facebook"},Br=e=>({queryKey:["keywordsAndPhrases",e],queryFn:()=>{const t=new URLSearchParams({archivingType:e});return et.get(`/Archiving/get_keywords_safe_phrases?${t.toString()}`)}}),M6=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/Archiving/add_archiving_keyword_and_added_item",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["keywordsAndPhrases",n.archivingType]}),e.invalidateQueries({queryKey:["spamPhrases"]})}})},O6=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/Archiving/edit_keyword_and_item",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["keywordsAndPhrases",n.archivingType]})}})},Sz=()=>{const e=Vt();return qt({mutationFn:({payload:t,flag:n})=>{let r="/Archiving/deactivate_archiving_keyword_and_item";return n==="reactivate"&&(r="/Archiving/reactivate_archiving_keyword_and_added_items"),n==="remove"?(r="/Archiving/remove_archiving_keyword_and_item",et.post(r,t)):et.post(r,{keywords:t})},onSuccess:(t,n)=>{const r=Array.isArray(n.payload)?n.payload[0].archivingType:n.payload.archivingType;e.invalidateQueries({queryKey:["deleteKeywords",r]}),e.invalidateQueries({queryKey:["keywordsAndPhrases",r]})}})},Joe=({classList:e=""})=>{var B;const t=Vt(),{data:n,isLoading:r}=Mt(hD()),i=(B=n==null?void 0:n.payload)!=null?B:[],[a,o]=k.useState(!1),[u,d]=k.useState(""),[h,v]=k.useState(!1),[p,y]=k.useState(),[b,A]=k.useState(null),x=k.useRef({}),w=k.useRef(null),R=ur(),O=X=>`${X.id}_${X.itemType}`,D=(X,V)=>{x.current[V]=X.target.value},C=X=>{const V=O(X);x.current[V]=X.item,A(V)},S=X=>{const V=O(X);A(null),delete x.current[V]},M=O6(),P=X=>{var ne;const V=O(X),J=((ne=x.current[V])!=null?ne:X.item).trim();if(!J){be.error("Please enter a valid phrase!",{id:"edit-spam-phrase"});return}if(i.find(U=>O(U)!==V&&U.item.toLowerCase()===J.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-spam-phrase"});return}if(J===X.item){S(X);return}M.mutate({archivingType:"email",itemId:X.id,item:J,itemType:X.itemType,filterType:"spam_phrase"},{onSuccess:U=>{if(!(U!=null&&U.success)||(U==null?void 0:U.success)===0){be.error((U==null?void 0:U.error_message)||"Error updating phrase",{id:"edit-spam-phrase"});return}be.success("Phrase updated successfully",{id:"edit-spam-phrase"}),t.invalidateQueries(hD()),S(X)},onError:()=>{be.error("Error updating phrase",{id:"edit-spam-phrase"})}})},T=[R.accessor("item",{header:"Phrase",size:"unset",cell:({row:X})=>{const V=O(X.original);return c.jsx(Qo,{showEdit:b===V,value:X.original.item,onChange:J=>D(J,V)})}}),R.display({size:65,id:"edit",header:()=>null,cell:({row:X})=>{const V=O(X.original);return c.jsx(he,{icon:b===V?kn:Qs,size:"large",onClick:J=>{if(J.stopPropagation(),b===V){P(X.original);return}C(X.original)}})}}),R.display({size:65,id:"delete",header:()=>null,cell:({row:X})=>{const V=O(X.original);return b===V?c.jsx(he,{className:"",icon:an,size:"large",onClick:J=>{J.stopPropagation(),S(X.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:J=>{J.stopPropagation(),v(!0),y(X.original)}})}})],j=[{label:"Add",icon:Rr,onClick:()=>{A(null),o(!0),requestAnimationFrame(()=>{var X;(X=w.current)==null||X.focus()})}}],N=Pne();function _(X){X&&N.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:X.id,itemType:X.itemType},{onSuccess:()=>{v(!1)}})}const F=M6();function q(){if(i.find(X=>X.item==u))return o(!1),be.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!u||u.trim()=="")return be.error("Please enter a valid phrase!",{id:"new-spam-phrase"});F.mutate({archivingType:"email",filterType:"spam_phrase",item:u},{onSuccess:()=>{d(""),o(!1)}})}const z=Qn({data:i,columns:T,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:X=>X.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${e}`,children:[c.jsx(Vr,{table:z,onRowClick:X=>{X.toggleSelected()},emptyMessage:r?"Loading...":"No items found",bordered:!1,filterButtons:j,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:X=>X.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),a&&c.jsx(wn,{title:"",width:700,onClose:()=>o(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>o(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:w,type:"text",onChange:X=>d(X.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"ml-3 py-3",onClick:q,disabled:F.isPending,children:F.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),h&&c.jsx(wn,{title:"",width:700,onClose:()=>v(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>v(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>v(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>_(p),disabled:N.isPending,children:N.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},ele=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=k.useState(!1),[a,o]=k.useState(""),[u,d]=k.useState(!1),[h,v]=k.useState(),[p,y]=k.useState(null),b=k.useRef({}),A=k.useRef(null),x=ur(),w=F=>`${F.id}_${F.itemType}`,R=(F,q)=>{b.current[q]=F.target.value},O=F=>{const q=w(F);b.current[q]=F.item,y(q)},D=F=>{const q=w(F);delete b.current[q],y(null)},C=[x.accessor("item",{header:"Email Domains",size:"unset",cell:({row:F})=>{const q=w(F.original);return c.jsx(Qo,{showEdit:p===q,value:F.original.item,onChange:z=>R(z,q)})}}),x.display({size:65,id:"edit",header:()=>null,cell:({row:F})=>{const q=w(F.original);return c.jsx(he,{className:"",icon:p===q?kn:Qs,size:"large",onClick:z=>{var B;if(z.stopPropagation(),p===q){const X=((B=b.current[q])!=null?B:F.original.item).trim().slice(0,255);if(!O0(X)){be.error("Please enter a valid domain!",{id:"edit-internal-domain"});return}if(e.find(J=>w(J)!==q&&J.item.toLowerCase()===X.toLowerCase())){be.error("Whoops! The item you entered already exists in this list.",{id:"edit-internal-domain"});return}if(X===F.original.item){D(F.original);return}j.mutate({id:F.original.id,itemType:F.original.itemType,filterType:F.original.filterType,addedType:F.original.addedType,item:X},{onSuccess:J=>{J&&J.error_message&&!J.success||(be.success("Domain updated successfully",{id:"edit-internal-domain"}),D(F.original))}});return}O(F.original)}})}}),x.display({size:65,id:"delete",header:()=>null,cell:({row:F})=>{const q=w(F.original);return p===q?c.jsx(he,{className:"",icon:an,size:"large",onClick:z=>{z.stopPropagation(),D(F.original)}}):c.jsx(he,{className:"",icon:Ga,size:"large",onClick:z=>{z.stopPropagation(),d(!0),v(F.original)}})}})],S=[{label:"Add",icon:Rr,onClick:()=>{y(null),i(!0),requestAnimationFrame(()=>{var F;(F=A.current)==null||F.focus()})}}],M=Qf();function P(F){F&&M.mutate({id:F.id},{onSuccess:()=>{d(!1)}})}const T=zf(),j=qf();function N(){if(!O0(a))return be.error("Please enter a valid domain!",{id:"new-email-domain"});T.mutate({itemType:"domain",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const _=Qn({data:e,columns:C,getCoreRowModel:qn(),getPaginationRowModel:cr(),getRowId:F=>F.id.toString(),getFilteredRowModel:tr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Vr,{table:_,onRowClick:F=>{F.toggleSelected()},bordered:!1,filterButtons:S,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:F=>F.original.checked===1,collapseSearchAndFilters:!0,maxHeight:null,paginationControlLabel:null}),r&&c.jsx(wn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"text-brand-dark-800 border-b-6 border-brand-dark-500 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:A,type:"text",onChange:F=>o(F.target.value),className:"mb-0! w-full px-4 py-3 border border-gray-300! rounded-md bg-white text-brand-dark-800! focus:outline-none"}),c.jsx(cn,{className:"py-3",onClick:N,disabled:T.isPending,children:T.isPending?c.jsx(Gt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(he,{className:"mr-2",icon:Rr,size:"medium"})," ","Add"]})})]})]})}),u&&c.jsx(wn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-brand-dark-800 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(he,{size:"medium",className:"mr-1",icon:an})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-brand-dark-500 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx(cn,{onClick:()=>P(h),disabled:M.isPending,children:M.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Remove"})]})]})})]})},tle=()=>{var h,v,p,y,b,A;const{data:e,isLoading:t,isSuccess:n}=Mt(Nne()),r=(h=e==null?void 0:e.blacklist)==null?void 0:h.recipients,i=(v=e==null?void 0:e.blacklist)==null?void 0:v.sender,a=(p=e==null?void 0:e.blacklist)==null?void 0:p.domains,o=(y=e==null?void 0:e.spam_email)==null?void 0:y.usernames,u=(b=e==null?void 0:e.internal)==null?void 0:b.domains,d=(A=e==null?void 0:e.internal)==null?void 0:A.sender;return c.jsx("section",{className:"flex flex-col w-full !mb-3",children:c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),c.jsxs(G0,{children:[c.jsxs(ri,{label:"Recipients",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific recipients from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx(Zoe,{isLoading:t,data:r})]}),c.jsxs(ri,{label:"Senders",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific senders from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx($oe,{isLoading:t,data:i})]}),c.jsxs(ri,{label:"Domains",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Exclude specific email domains from your email review. Changes to review settings will go into effect in your next review period."}),c.jsx(Goe,{isLoading:t,data:a})]}),c.jsxs(ri,{label:"Spam",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),c.jsxs(fD,{children:[c.jsx(ri,{label:"Email Prefixes",onActive:()=>{},children:c.jsx(Koe,{data:o,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(ri,{label:"Phrases",onActive:()=>{},children:c.jsx(Joe,{classList:"mt-[-1px]"})})]})]}),c.jsxs(ri,{label:"Advanced",onActive:()=>{},children:[c.jsx("p",{className:"mb-10"}),c.jsx(kne,{data:u}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),c.jsxs(fD,{children:[c.jsx(ri,{label:"Internal Domains",onActive:()=>{},children:c.jsx(ele,{data:u,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(ri,{label:"Associated Contacts",onActive:()=>{},children:c.jsx(Yoe,{data:d,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},nle=e=>qt({mutationFn:()=>et.get(`/socialmedia/instagram?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Instagram account.",{id:"instagram-connection-error"})}),rle=e=>qt({mutationFn:()=>et.getText(`/socialmedia/instagram/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Instagram account.",{id:"instagram-employee-connection-error"}),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${et.getUser()}`}}),ile=e=>qt({mutationFn:()=>et.getText(`/socialmedia/linkedin/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to LinkedIn account.",{id:"linkedin-employee-connection-error"}),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${et.getUser()}`}}),ale=e=>qt({mutationFn:()=>et.getText(`/socialmedia/facebook/employee?url=${e}`),onError:()=>be.error("Error occurred while trying to connect to Facebook account.",{id:"facebook-employee-connection-error"}),onSuccess:t=>{window.location.href=t}}),sle=(e,t)=>qt({mutationFn:n=>et.get(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`),onError:()=>be.error("Error occurred while trying to connect to Facebook account.",{id:"facebook-connection-error"}),onSuccess:n=>{window.location.href=n.firmURL}}),ole=()=>{const e=Vt();return qt({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>et.post("/socialmedia/twitter/response",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:t=>{e.invalidateQueries({queryKey:J0().queryKey}),e.invalidateQueries({queryKey:D6.queryKey}),e.invalidateQueries({queryKey:Ps().queryKey})}})},lle=()=>{const e=Vt();return qt({mutationFn:({type:t,accountType:n})=>et.post("/socialmedia/disconnect",{type:t,accountType:n}),onSuccess:()=>{e.invalidateQueries({queryKey:J0().queryKey}),e.invalidateQueries({queryKey:Ps().queryKey})}})},Cz=()=>qt({mutationFn:e=>et.put("/accountsettings/approved",{approved:e}),onSuccess:()=>{}}),ule=()=>{const e=Vt();return qt({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>et.post("/Archiving/readd_archiving_keyword_and_added_item",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:()=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},cle=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>et.post(`/Popups/archiving_view_previously_removed_keywords/${e}`)}),Ps=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>et.get("/socialmedia/check/statuses")}),R1=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await et.get("/heightenedsupervisionusers/users");if(!e||e.error)throw new Error("Error occurred while fetching users");return e}}),dle=()=>{const e=Vt();return qt({mutationFn:({types:t,employees:n})=>et.post("/employeerequests",{types:t,employees:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["settings"]})}})},Rz=()=>({queryKey:["socialmediatypes"],queryFn:()=>et.get("/socialmedia/types"),retry:!1}),J0=()=>({queryKey:["employeeaccounts"],queryFn:()=>et.get("/socialmedia/employee/accounts?url=mrc")}),D6={queryKey:["employeeAccountsStatus"],queryFn:()=>et.get("/socialmedia/employee/statuses")},Ei=({status:e})=>{if(!e)return"";const t={facebook_active:"text-[#008E28]",linkedin_active:"text-[#008E28]",instagram_active:"text-[#008E28]",twitter_active:"text-[#008E28]",active:"text-[#008E28]",facebook_connected:"text-[#008E28]",linkedin_connected:"text-[#008E28]",instagram_connected:"text-[#008E28]",twitter_connected:"text-[#008E28]",connected:"text-[#008E28]",facebook_inactive:"text-[#AA2400]",linkedin_inactive:"text-[#AA2400]",instagram_inactive:"text-[#AA2400]",twitter_inactive:"text-[#AA2400]",inactive:"text-[#AA2400]",facebook_pending:"text-[#C68900]",instagram_pending:"text-[#C68900]",linkedin_pending:"text-[#C68900]",twitter_pending:"text-[#C68900]",pending:"text-[#C68900]",facebook_unavailable:"text-[#AA2400]",linkedin_unavailable:"text-[#AA2400]",instagram_unavailable:"text-[#AA2400]",twitter_unavailable:"text-[#AA2400]",unavailable:"text-[#AA2400]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]"};let n=oa,r="",i=t[e.status];switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":case"facebook_connected":case"linkedin_connected":case"instagram_connected":case"twitter_connected":case"connected":n=UL,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=oa,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=HL,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=QJ,r="Connect";break;default:n=oa,r="N/A",i="text-[#AA2400]";break}return c.jsxs("div",{className:`inline-flex gap-1 w-22.5 h-6 items-center px-1.5 py-1 rounded-sm text-sm font-medium ${i}`,children:[c.jsx(he,{icon:n,size:"small",className:"fill-current"}),c.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},Mr={NOT_SET:0,PENDING:1,CONNECTED:2,DISCONNECTED:3},xr={iMessage:32,WhatsApp:33},Tf=e=>{switch(e){case Mr.PENDING:return{status:"pending",statusTitle:"Pending"};case Mr.CONNECTED:return{status:"active",statusTitle:"Active"};case Mr.DISCONNECTED:default:return{status:"unavailable",statusTitle:"N/A"}}},fle=(e,t)=>{let n="Inactive Connection",r="text-red-700",i=oa;if(e!==0)switch(t){case Mr.PENDING:n="Pending Connection",r="text-[#C68900]",i=HL;break;case Mr.CONNECTED:n="Active Connection",r="text-green-800",i=UL;break}return{statusText:n,statusColor:r,icon:i}},Pc=()=>({queryKey:["accountconnections"],queryFn:()=>et.get("/mobilechannelconnections/connection")}),Fd=()=>({queryKey:["mobileuserstatuses"],queryFn:()=>et.get("/mobilechannelconnections/check/statuses")}),hle=()=>qt({mutationFn:e=>et.post("/imessages",e)}),mle=()=>qt({mutationFn:e=>et.post("/whatsapp",e)}),ple=()=>{const e=Vt();return qt({mutationFn:t=>et.post("/mobilechannelconnections/connection_request",{requests:t}),onSuccess:()=>{e.invalidateQueries({queryKey:["settings"]})}})},ob={queryKey:["mobileaccess"],queryFn:()=>et.get("/mobiles/access")},Bg={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},Iz=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{var _,F,q,z;const i=ple(),{data:a,isLoading:o,isSuccess:u}=Mt(Pc()),{data:d,isLoading:h,isSuccess:v}=Mt(R1()),{data:p,isLoading:y,isSuccess:b}=Mt(Fd()),A=Vt();k.useEffect(()=>{v&&b&&A.setQueryData(Fd().queryKey,B=>{if(!B)return{};const X={...B};return d.forEach(V=>{X[V.id]||(X[V.id]={}),Object.values(xr).forEach(J=>{X[V.id][J]||(X[V.id][J]={...Bg})})}),X})},[v,b,p,d,A]);const x=p&&d?Object.entries(p).flatMap(([B,X])=>Object.entries(X).filter(([V,J])=>J.active===1).map(([V])=>({userId:parseInt(B),integrationId:parseInt(V)})).filter(V=>!isNaN(V.userId)&&!isNaN(V.integrationId))):[],w=ur(),R=(B,X,V)=>{const J=V?1:0;A.setQueryData(Fd().queryKey,ee=>{var ne;return ee&&((ne=ee==null?void 0:ee[B])!=null&&ne[X]?{...ee,[B]:{...ee==null?void 0:ee[B],[X]:{...ee[B][X],active:J}}}:{...ee,[B]:{...ee==null?void 0:ee[B],[X]:{...Bg,active:V}}})})},O=B=>{A.setQueryData(Fd().queryKey,X=>X&&Object.fromEntries(Object.entries(X).map(([J,ee])=>[J,Object.fromEntries(Object.entries(ee).map(([ne,U])=>[ne,{...U,active:B?1:0}]))])))},D=(B,X)=>{if(isNaN(B))return be.error("You cannot send a request for 'Your Mobile Accounts'.",{id:"your-account-request",duration:5e3});A.setQueryData(Fd().queryKey,V=>{if(!(V!=null&&V[B]))return V;const J=Object.fromEntries(Object.entries(V[B]).map(([ee,ne])=>[ee,{...ne,active:X?1:0}]));return{...V,[B]:J}})},C=((_=a==null?void 0:a.whatsApp)==null?void 0:_.id)==Mr.NOT_SET?{status:"unavailable",statusTitle:"N/A"}:Tf((F=a==null?void 0:a.whatsApp)==null?void 0:F.status),M={name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:((q=a==null?void 0:a.iMessage)==null?void 0:q.id)==Mr.NOT_SET?{status:"unavailable",statusTitle:"N/A"}:Tf((z=a==null?void 0:a.iMessage)==null?void 0:z.status),whatsapp:C},P=k.useMemo(()=>{if(!d||!p)return[];const B=d.map(X=>{var V,J;return{id:X.id,name:`${X.firstName} ${X.lastName}`,imessage:((V=p==null?void 0:p[X.id])==null?void 0:V[xr==null?void 0:xr.iMessage])||Bg,whatsapp:((J=p==null?void 0:p[X.id])==null?void 0:J[xr==null?void 0:xr.WhatsApp])||Bg}});return B.unshift({...M}),B},[d,p,r]),T=[w.accessor("name",{cell:B=>B.getValue(),header:()=>e?"Name":"",size:300}),w.accessor("imessage",{cell:B=>{const X=B.getValue();return c.jsxs("label",{htmlFor:`imessage-check-${B.row.id}-${xr==null?void 0:xr.iMessage}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`imessage-check-${B.row.id}-${xr==null?void 0:xr.iMessage}`,checked:!!X.active,onChange:V=>R(B.row.id,xr==null?void 0:xr.iMessage,V.target.checked)}),c.jsx(Ei,{status:X})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),w.accessor("whatsapp",{cell:B=>{const X=B.getValue();return c.jsxs("label",{htmlFor:`whatsapp-check-${B.row.id}-${xr==null?void 0:xr.WhatsApp}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`whatsapp-check-${B.row.id}-${xr==null?void 0:xr.WhatsApp}`,checked:!!X.active,onChange:V=>R(B.row.id,xr==null?void 0:xr.WhatsApp,V.target.checked)}),c.jsx(Ei,{status:X})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&T.unshift(w.accessor("id",{header:({table:B})=>c.jsx("input",{type:"checkbox",checked:p&&x.length>0&&Object.values(p).every(X=>Object.values(X).every(V=>V.active===1)),onChange:X=>O(X.target.checked)}),cell:({row:B})=>{var V;let X=!1;if(B.id!="firm_mobile_accounts"&&B.id!="your_mobile_accounts"){const J=parseInt(B.original.id);X=x.filter(ne=>ne.userId===J).length>0&&Object.values((V=p==null?void 0:p[B.original.id])!=null?V:{}).every(ne=>ne.active===1)}return c.jsx("input",{type:"checkbox",checked:X,onChange:J=>{D(parseInt(B.original.id),J.target.checked)}})},maxSize:55}));const j=[{label:i.isPending?c.jsx(Gt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(!i.isPending){if(x.length<1)return be.error("Please select at least one account!",{id:"no-selection-error",duration:5e3});i.mutate(x,{onSuccess:()=>{A.invalidateQueries({queryKey:R1().queryKey}),A.invalidateQueries({queryKey:Fd().queryKey}),be.success("To do list items have been sent for mobile setup.",{id:"mobile-request-success",duration:5e3})},onError:()=>{be.error("An error occurred while sending employee requests.",{id:"mobile-request-error",duration:5e3})}})}},icon:YL}],N=Qn({data:P,columns:T,getCoreRowModel:qn(),getPaginationRowModel:cr(),getFilteredRowModel:tr(),getRowId:B=>B.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h5",{className:"text-brand-dark-800 text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&c.jsx("p",{className:"mb-5"})]}),c.jsx(Vr,{table:N,hasGlobalFilter:t,filterButtons:j,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:h||y?"Loading...":"No accounts found"})]})},gle=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),c.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),c.jsx(Iz,{showName:!0,hasRowSelection:!0}),c.jsx(lr,{prevLink:"/setup/mobile",prevProgress:12,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:13})]});function Kl(e){return typeof e=="string"||e instanceof String}function YD(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function Mz(e,t){return Array.isArray(t)?Mz(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,a]=r;return t(a,i)&&(n[i]=a),n},{})}const Wt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function vle(e){switch(e){case Wt.LEFT:return Wt.FORCE_LEFT;case Wt.RIGHT:return Wt.FORCE_RIGHT;default:return e}}function HA(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function I1(e,t){if(t===e)return!0;const n=Array.isArray(t),r=Array.isArray(e);let i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!I1(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const a=t instanceof Date,o=e instanceof Date;if(a&&o)return t.getTime()==e.getTime();if(a!=o)return!1;const u=t instanceof RegExp,d=e instanceof RegExp;if(u&&d)return t.toString()==e.toString();if(u!=d)return!1;const h=Object.keys(t);for(i=0;i<h.length;i++)if(!Object.prototype.hasOwnProperty.call(e,h[i]))return!1;for(i=0;i<h.length;i++)if(!I1(e[h[i]],t[h[i]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}class ble{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?Wt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Wt.RIGHT:Wt.LEFT}}function sn(e,t){return new sn.InputMask(e,t)}function Oz(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?sn.MaskedRegExp:Kl(e)?sn.MaskedPattern:e===Date?sn.MaskedDate:e===Number?sn.MaskedNumber:Array.isArray(e)||e===Array?sn.MaskedDynamic:sn.Masked&&e.prototype instanceof sn.Masked?e:sn.Masked&&e instanceof sn.Masked?e.constructor:e instanceof Function?sn.MaskedFunction:(console.warn("Mask not found for mask",e),sn.Masked)}function D0(e){if(!e)throw new Error("Options in not defined");if(sn.Masked){if(e.prototype instanceof sn.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof sn.Masked?{mask:e}:YD(e)&&e.mask instanceof sn.Masked?e:{};if(t){const r=t.mask;return{...Mz(t,(i,a)=>!a.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return YD(e)?{...e}:{mask:e}}function qo(e){if(sn.Masked&&e instanceof sn.Masked)return e;const t=D0(e),n=Oz(t.mask);if(!n)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===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}sn.createMask=qo;class P6{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(n){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(n){}return t!=null?t:this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch(r){}}get isActive(){return!1}}sn.MaskElement=P6;const GD=90,yle=89;class lb extends P6{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,n,r;return(t=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=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===GD&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===yle&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===GD&&(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={}}}sn.HTMLMaskElement=lb;class Ale extends lb{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,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}sn.HTMLMaskElement=lb;class Dz extends lb{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}sn.HTMLContenteditableMaskElement=Dz;class ub{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>ub.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}}ub.MAX_LENGTH=100;class xle{constructor(t,n){this.el=t instanceof P6?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Dz(t):new Ale(t),this.masked=qo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ub,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 n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof sn.Masked)&&this.masked.constructor===Oz(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof sn.Masked?t:qo({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}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,n){const r=this._listeners[t];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(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,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,r=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...r}=t,i=!this.maskEquals(n),a=this.masked.optionsIsChanged(r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Wt.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(n);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new ble({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=r===this.masked.rawInputValue?n.removeDirection:Wt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Wt.NONE&&(o=this.masked.nearestInputPos(o,Wt.NONE)),this.updateControl(o),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}}sn.InputMask=xle;class An{static normalize(t){return Array.isArray(t)?t:[t,new An]}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}}sn.ChangeDetails=An;class Fs{constructor(t,n,r){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=r}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"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class ji{constructor(t){this._value="",this._update({...ji.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,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),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,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Fs(this.extractInput(t,n),t)}appendTail(t){return Kl(t)&&(t=new Fs(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new An({inserted:t,rawInserted:t})):new An}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let a;if([t,a]=this.doPrepareChar(t,n),t&&(a=a.aggregate(this._appendCharRaw(t,n)),!a.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const d=this._appendCharRaw(t,n);u=u.aggregate(d),d.rawInserted||u.equals(a)?a=u:this.state=o}if(a.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const d=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.unshift(this.displayValue.length-a.tailShift)}let h=this.appendTail(r);if(u=h.rawInserted.length===r.toString().length,!(u&&h.inserted)&&this.overwrite==="shift"){this.state=d,o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.shift();h=this.appendTail(r),u=h.rawInserted.length===r.toString().length}u&&h.inserted&&(this.state=d)}u||(a=new An,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new An}_appendEager(){return new An}append(t,n,r){if(!Kl(t))throw new Error("value should be string");const i=Kl(r)?new Fs(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=this.doPrepare(t,n);for(let o=0;o<t.length;++o){const u=this._appendChar(t[o],n,i);if(!u.rawInserted&&!this.doSkipInvalid(t[o],n,i))break;a.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new An}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=t();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,r=t(this);return this.state=n,delete this._isolated,r}doSkipInvalid(t,n,r){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),An.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),An.normalize(this.prepareChar?this.prepareChar(t,this,n):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,n,r,i,a){r===void 0&&(r=""),i===void 0&&(i=Wt.NONE),a===void 0&&(a={input:!0});const o=t+n,u=this.extractTail(o),d=this.eager===!0||this.eager==="remove";let h;d&&(i=vle(i),h=this.extractInput(0,o,{raw:!0}));let v=t;const p=new An;if(i!==Wt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!d?Wt.NONE:i),p.tailShift=v-t),p.aggregate(this.remove(v)),d&&i!==Wt.NONE&&h===this.rawInputValue)if(i===Wt.FORCE_LEFT){let y;for(;h===this.rawInputValue&&(y=this.displayValue.length);)p.aggregate(new An({tailShift:-1})).aggregate(this.remove(y-1))}else i===Wt.FORCE_RIGHT&&u.unshift();return p.aggregate(this.append(r,a,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!I1(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||ji.EMPTY_VALUES.includes(t)&&ji.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new An}}ji.DEFAULTS={skipInvalid:!0};ji.EMPTY_VALUES=[void 0,null,""];sn.Masked=ji;class tc{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Kl(t)?new Fs(String(t)):t;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof Fs)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof tc){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof sn.MaskedPattern))return new Fs(this.toString()).appendTo(t);const n=new An;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],a=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!a||a.index<=o)&&((i instanceof tc||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof tc&&t._blocks[o]),u){const d=u.appendTail(i);n.aggregate(d);const h=i.toString().slice(d.rawInserted.length);h&&n.aggregate(t.append(h,{tail:!0}))}else n.aggregate(t.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...r}=t;Object.assign(this,r),this.chunks=n.map(i=>{const a="chunks"in i?new tc:new Fs;return a.state=i,a})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],r=n.shift();if(n.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class wle{constructor(t,n){this.masked=t,this._log=[];const{offset:r,index:i}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const 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=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;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,Wt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Wt.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,Wt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.NONE),!0})}}class Pz{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,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new An}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this._value.length;switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return r;case Wt.NONE:case Wt.RIGHT:case Wt.FORCE_RIGHT:default:return i}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new An;const r=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new An({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new An;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Fs("")}appendTail(t){return Kl(t)&&(t=new Fs(String(t))),t.appendTo(this)}append(t,n,r){const i=this._appendChar(t[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}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()}}class M1{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u,...d}=t;this.masked=qo(d),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new An}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,n){if(n===void 0&&(n={}),this.isFilled)return new An;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new An,this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,n,r){return this.masked.append(t,this.currentMaskFlags(n),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new An:(this.isFilled=!0,new An({inserted:this.placeholderChar}))}_appendEager(){return new An}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,r)}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(t,r),i);switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return this.isComplete?a:r;case Wt.RIGHT:case Wt.FORCE_RIGHT:return this.isComplete?a:i;case Wt.NONE:default:return a}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).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 n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new An}}M1.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 Ele extends ji{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}sn.MaskedRegExp=Ele;class Ti extends ji{constructor(t){super({...Ti.DEFAULTS,...t,definitions:Object.assign({},M1.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(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){const h=n.slice(a),v=Object.keys(this.blocks).filter(y=>h.indexOf(y)===0);v.sort((y,b)=>b.length-y.length);const p=v[0];if(p){const{expose:y,repeat:b,...A}=D0(this.blocks[p]),x={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...A,repeat:b,parent:this},w=b!=null?new sn.RepeatBlock(x):qo(x);w&&(this._blocks.push(w),y&&(this.exposeBlock=w),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),a+=p.length-1;continue}}let o=n[a],u=o in t;if(o===Ti.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Ti.ESCAPE_CHAR){if(++a,o=n[a],!o)break;u=!1}const d=u?new M1({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...D0(t[o]),parent:this}):new Pz({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...r}=t;this._blocks.forEach((i,a)=>i.state=n[a]),super.state=r}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,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new An;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new An;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var a;const d=u._appendChar(t,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]});if(i.aggregate(d),d.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new tc;return t===n||this._forEachBlocksInRange(t,n,(i,a,o,u)=>{const d=i.extractTail(o,u);d.stop=this._findStopBefore(a),d.from=this._blockStartPos(a),d instanceof tc&&(d.blockIndex=a),r.extend(d)}),r}extractInput(t,n,r){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),t===n)return"";let i="";return this._forEachBlocksInRange(t,n,(a,o,u,d)=>{i+=a.extractInput(u,d,r)}),i}_findStopBefore(t){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=t)n=i;else break}return n}_appendPlaceholder(t){const n=new An;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(i,a).forEach(o=>{if(!o.lazy||t!=null){var u;n.aggregate(o._appendPlaceholder((u=o._blocks)==null?void 0:u.length))}}),n}_mapPosToBlock(t){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],a=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(t,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const a=this._mapPosToBlock(n),o=a&&i.index===a.index,u=i.offset,d=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,d),a&&!o){for(let h=i.index+1;h<a.index;++h)r(this._blocks[h],h,0,this._blocks[h].displayValue.length);r(this._blocks[a.index],a.index,0,a.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._forEachBlocksInRange(t,n,(i,a,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Wt.NONE),!this._blocks.length)return 0;const r=new wle(this,t);if(n===Wt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Wt.LEFT||n===Wt.FORCE_LEFT){if(n===Wt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Wt.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:n===Wt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Wt.RIGHT||n===Wt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Wt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Wt.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,n,(i,a,o,u)=>{r+=i.totalInputPositions(o,u)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(r=>this._blocks[r]):[]}pad(t){const n=new An;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Ti.DEFAULTS={...ji.DEFAULTS,lazy:!0,placeholderChar:"_"};Ti.STOP_CHAR="`";Ti.ESCAPE_CHAR="\\";Ti.InputDefinition=M1;Ti.FixedDefinition=Pz;sn.MaskedPattern=Ti;class $v extends Ti{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const u=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let h=0;for(;h<d.length&&d[h]===u[h];)++h;o.mask=d.slice(0,h).replace(/0/g,"\\0")+"0".repeat(this.maxLength-h),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",r="";const[,i,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(t,n){n===void 0&&(n={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(a)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(i[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new An;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let a=0;a<i;++a)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(a=>this._appendCharRaw(a))}return n}}sn.MaskedRange=$v;const Sle="d{.}`m{.}`Y";class Do extends Ti{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Kl(n)?n:r}}constructor(t){super(Do.extractPatternOptions({...Do.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...a}={...Do.DEFAULTS,...t},o=Object.assign({},Do.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,i),super._update({...a,mask:Kl(n)?n:r,blocks:o})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=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(Do.extractPatternOptions(t))}}Do.GET_DEFAULT_BLOCKS=()=>({d:{mask:$v,from:1,to:31,maxLength:2},m:{mask:$v,from:1,to:12,maxLength:2},Y:{mask:$v,from:1900,to:9999}});Do.DEFAULTS={...Ti.DEFAULTS,mask:Date,pattern:Sle,format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[n,r,i].join(".")},parse:(e,t)=>{const[n,r,i]=e.split(".").map(Number);return new Date(i,r-1,n)}};sn.MaskedDate=Do;class cb extends ji{constructor(t){super({...cb.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(n=>{const{expose:r,...i}=D0(n),a=qo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._applyDispatch(t,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),r}_applyDispatch(t,n,r){t===void 0&&(t=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,u=a.slice(o.length),d=this.currentMask,h=new An,v=d==null?void 0:d.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),h.tailShift=this.currentMask.value.length-i.length),u&&(h.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):v&&(this.currentMask.state=v)),h}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new An;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,r;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(t,this,n,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[r,i]=super.doPrepare(t,n);if(this.currentMask){let a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.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 n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}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,n){const r=new An;return this.currentMask&&r.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...a}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}extractInput(t,n,r){return this.currentMask?this.currentMask.extractInput(t,n,r):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}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((n,r)=>{if(!t[r])return;const{mask:i,...a}=t[r];return I1(n,a)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}cb.DEFAULTS={...ji.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,a=t.compiledMasks.map((o,u)=>{const d=t.currentMask===o,h=d?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):d||o.remove(h),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:u,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(h,o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT)))}});return a.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[a[0].index]}};sn.MaskedDynamic=cb;class db extends Ti{constructor(t){super({...db.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}_appendCharRaw(t,n){n===void 0&&(n={});const r=Math.min(this.nearestInputPos(0,Wt.FORCE_RIGHT),this.value.length),i=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const d=i[0][u];u>=this.value.length||d===o.value||(o.reset(),o._appendChar(d,n))});const a=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>a.aggregate(super._appendCharRaw(o))),a}return new An({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Fs("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new An;const r=Math.min(super.nearestInputPos(0,Wt.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(r,i),r)).length>1);--i);const a=super.remove(i,n);return a.tailShift+=i-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}db.DEFAULTS={...Ti.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};sn.MaskedEnum=db;class Cle extends ji{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}sn.MaskedFunction=Cle;var jz;class Ea extends ji{constructor(t){super({...Ea.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+HA(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(HA).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(HA(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(t,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,r))}_appendCharRaw(t,n){n===void 0&&(n={});const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),d=!1;if(u){let y;this.min!=null&&this.min<0&&this.number<this.min&&(y=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(y=this.max),y!=null&&(this.autofix?(this._value=this.format(y,this).replace(Ea.UNMASKED_RADIX,this.radix),d||(d=a===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let h;u?h=new An({inserted:this._value.slice(a.length),rawInserted:d?"":t,skip:d}):(this._value=a,h=new An),this._value=this._insertThousandsSeparators(this._value);const v=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(v);return h.tailShift+=(p-i)*this.thousandsSeparator.length,h}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,n){const r=this._findSeparatorAround(t);r>=0&&(t=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const r=this.value.slice(0,t),i=this.value.slice(n),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new An({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Wt.NONE:case Wt.LEFT:case Wt.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(t<i||this.value.length<=i||n===Wt.FORCE_LEFT)return r}break}case Wt.RIGHT:case Wt.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,a,o)=>i+o),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,r){n===void 0&&(n={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===Ea.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Ea.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(Ea.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)||Ea.EMPTY_VALUES.includes(t)&&Ea.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}jz=Ea;Ea.UNMASKED_RADIX=".";Ea.EMPTY_VALUES=[...ji.EMPTY_VALUES,0];Ea.DEFAULTS={...ji.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[jz.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})};sn.MaskedNumber=Ea;const W4={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Tz(e,t,n){t===void 0&&(t=W4.MASKED),n===void 0&&(n=W4.MASKED);const r=qo(e);return i=>r.runIsolated(a=>(a[t]=i,a[n]))}function Rle(e,t,n,r){return Tz(t,n,r)(e)}sn.PIPE_TYPE=W4;sn.createPipe=Tz;sn.pipe=Rle;class Ile extends Ti{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 n,r,i;const{repeat:a,...o}=D0(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=qo(this._blockOpts);this.repeat=(n=(r=a!=null?a:u.repeat)!=null?r:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.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(qo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new An;for(let d=(i=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?i:Math.max(this._blocks.length-1,0),h,v;h=(o=this._blocks[d])!=null?o:v=!v&&this._allocateBlock(d);++d){var i,a,o,u;const p=h._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[d]});if(p.skip&&v){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(p),p.consumed)break}return r}_trimEmptyTail(t,n){var r,i;t===void 0&&(t=0);const a=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let o;n!=null&&(o=(i=this._mapPosToBlock(n))==null?void 0:i.index),o==null&&(o=this._blocks.length-1);let u=0;for(let d=o;a<=d&&!this._blocks[d].unmaskedValue;--d,++u);u&&(this._blocks.splice(o-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._trimEmptyTail(t,n),r}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}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}}sn.RepeatBlock=Ile;try{globalThis.IMask=sn}catch(e){}const Nz={mask:de.oneOfType([de.array,de.func,de.string,de.instanceOf(RegExp),de.oneOf([Date,Number,sn.Masked]),de.instanceOf(sn.Masked)]),value:de.any,unmask:de.oneOfType([de.bool,de.oneOf(["typed"])]),prepare:de.func,prepareChar:de.func,validate:de.func,commit:de.func,overwrite:de.oneOfType([de.bool,de.oneOf(["shift"])]),eager:de.oneOfType([de.bool,de.oneOf(["append","remove"])]),skipInvalid:de.bool,onAccept:de.func,onComplete:de.func,placeholderChar:de.string,displayChar:de.string,lazy:de.bool,definitions:de.object,blocks:de.object,enum:de.arrayOf(de.string),maxLength:de.number,from:de.number,to:de.number,pattern:de.string,format:de.func,parse:de.func,autofix:de.oneOfType([de.bool,de.oneOf(["pad"])]),radix:de.string,thousandsSeparator:de.string,mapToRadix:de.arrayOf(de.string),scale:de.number,normalizeZeros:de.bool,padFractionalZeros:de.bool,min:de.oneOfType([de.number,de.instanceOf(Date)]),max:de.oneOfType([de.number,de.instanceOf(Date)]),dispatch:de.func,inputRef:de.oneOfType([de.func,de.shape({current:de.object})])},kz=Object.keys(Nz).filter(e=>e!=="value"),Mle=["value","unmask","onAccept","onComplete","inputRef"],Ole=kz.filter(e=>Mle.indexOf(e)<0);function Dle(e){var t;const n=(t=class extends or.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=sn(this.element,a).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(a){const{...o}=a;return Object.keys(o).filter(u=>Ole.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(a){const{...o}=a;return kz.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=a.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return or.createElement(e,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},t.displayName=void 0,t.propTypes=void 0,t),r=e.displayName||e.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=Nz,or.forwardRef((i,a)=>or.createElement(n,{...i,ref:a}))}const Ple=Dle(e=>{let{inputRef:t,...n}=e;return or.createElement("input",{...n,ref:t})}),jle=(e,t)=>or.createElement(Ple,{...e,ref:t}),Tle=or.forwardRef(jle);var VA={exports:{}},UA={},WA={},YA={exports:{}},GA={exports:{}},KA={exports:{}},ZA={exports:{}},KD;function Vf(){return KD||(KD=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ZA)),ZA.exports}var $A={exports:{}},ZD;function Nle(){return ZD||(ZD=1,(function(e){var t=Vf().default;function n(r,i){if(t(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var o=a.call(r,i||"default");if(t(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})($A)),$A.exports}var $D;function _z(){return $D||($D=1,(function(e){var t=Vf().default,n=Nle();function r(i){var a=n(i,"string");return t(a)=="symbol"?a:a+""}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(KA)),KA.exports}var JD;function fb(){return JD||(JD=1,(function(e){var t=_z();function n(r,i,a){return(i=t(i))in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(GA)),GA.exports}var eP;function Uf(){return eP||(eP=1,(function(e){var t=fb();function n(i,a){var o=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);a&&(u=u.filter(function(d){return Object.getOwnPropertyDescriptor(i,d).enumerable})),o.push.apply(o,u)}return o}function r(i){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?n(Object(o),!0).forEach(function(u){t(i,u,o[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(o,u))})}return i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(YA)),YA.exports}var JA={exports:{}},ex={exports:{}},tP;function kle(){return tP||(tP=1,(function(e){function t(n){if(Array.isArray(n))return n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ex)),ex.exports}var tx={exports:{}},nP;function _le(){return nP||(nP=1,(function(e){function t(n,r){var i=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,u,d,h=[],v=!0,p=!1;try{if(u=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(h.push(a.value),h.length!==r);v=!0);}catch(y){p=!0,o=y}finally{try{if(!v&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(p)throw o}}return h}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(tx)),tx.exports}var nx={exports:{}},rx={exports:{}},rP;function Bz(){return rP||(rP=1,(function(e){function t(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,a=Array(r);i<r;i++)a[i]=n[i];return a}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(rx)),rx.exports}var iP;function Fz(){return iP||(iP=1,(function(e){var t=Bz();function n(r,i){if(r){if(typeof r=="string")return t(r,i);var a={}.toString.call(r).slice(8,-1);return a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set"?Array.from(r):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(r,i):void 0}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(nx)),nx.exports}var ix={exports:{}},aP;function Ble(){return aP||(aP=1,(function(e){function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
266
266
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ix)),ix.exports}var sP;function hb(){return sP||(sP=1,(function(e){var t=kle(),n=_le(),r=Fz(),i=Ble();function a(o,u){return t(o)||n(o,u)||r(o,u)||i()}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(JA)),JA.exports}var ax={exports:{}},sx={exports:{}},oP;function Fle(){return oP||(oP=1,(function(e){function t(n,r){if(n==null)return{};var i={};for(var a in n)if({}.hasOwnProperty.call(n,a)){if(r.indexOf(a)!==-1)continue;i[a]=n[a]}return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(sx)),sx.exports}var lP;function Wf(){return lP||(lP=1,(function(e){var t=Fle();function n(r,i){if(r==null)return{};var a,o,u=t(r,i);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(r);for(o=0;o<d.length;o++)a=d[o],i.indexOf(a)===-1&&{}.propertyIsEnumerable.call(r,a)&&(u[a]=r[a])}return u}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ax)),ax.exports}var uP;function Lz(){if(uP)return WA;uP=1;var e=Uf(),t=hb(),n=Wf(),r=Ln(),i=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function a(o){var u=o.defaultInputValue,d=u===void 0?"":u,h=o.defaultMenuIsOpen,v=h===void 0?!1:h,p=o.defaultValue,y=p===void 0?null:p,b=o.inputValue,A=o.menuIsOpen,x=o.onChange,w=o.onInputChange,R=o.onMenuClose,O=o.onMenuOpen,D=o.value,C=n(o,i),S=r.useState(b!==void 0?b:d),M=t(S,2),P=M[0],T=M[1],j=r.useState(A!==void 0?A:v),N=t(j,2),_=N[0],F=N[1],q=r.useState(D!==void 0?D:y),z=t(q,2),B=z[0],X=z[1],V=r.useCallback(function(Y,K){typeof x=="function"&&x(Y,K),X(Y)},[x]),J=r.useCallback(function(Y,K){var re;typeof w=="function"&&(re=w(Y,K)),T(re!==void 0?re:Y)},[w]),ee=r.useCallback(function(){typeof O=="function"&&O(),F(!0)},[O]),ne=r.useCallback(function(){typeof R=="function"&&R(),F(!1)},[R]),U=b!==void 0?b:P,H=A!==void 0?A:_,W=D!==void 0?D:B;return e(e({},C),{},{inputValue:U,menuIsOpen:H,onChange:V,onInputChange:J,onMenuClose:ne,onMenuOpen:ee,value:W})}return WA.useStateManager=a,WA}var go={},ox={exports:{}},cP;function j6(){return cP||(cP=1,(function(e){function t(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(ox)),ox.exports}var lx={exports:{}},dP;function T6(){return dP||(dP=1,(function(e){var t=_z();function n(i,a){for(var o=0;o<a.length;o++){var u=a[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,t(u.key),u)}}function r(i,a,o){return a&&n(i.prototype,a),o&&n(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(lx)),lx.exports}var ux={exports:{}},cx={exports:{}},fP;function Lle(){return fP||(fP=1,(function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(cx)),cx.exports}var hP;function N6(){return hP||(hP=1,(function(e){var t=Lle();function n(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),i&&t(r,i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ux)),ux.exports}var dx={exports:{}},fx={exports:{}},mP;function Xle(){return mP||(mP=1,(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(fx)),fx.exports}var hx={exports:{}},pP;function zle(){return pP||(pP=1,(function(e){function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(hx)),hx.exports}var mx={exports:{}},px={exports:{}},gP;function qle(){return gP||(gP=1,(function(e){function t(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(px)),px.exports}var vP;function Qle(){return vP||(vP=1,(function(e){var t=Vf().default,n=qle();function r(i,a){if(a&&(t(a)=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(mx)),mx.exports}var bP;function k6(){return bP||(bP=1,(function(e){var t=Xle(),n=zle(),r=Qle();function i(a){var o=n();return function(){var u,d=t(a);if(o){var h=t(this).constructor;u=Reflect.construct(d,arguments,h)}else u=d.apply(this,arguments);return r(this,u)}}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports})(dx)),dx.exports}var gx={exports:{}},vx={exports:{}},yP;function Hle(){return yP||(yP=1,(function(e){var t=Bz();function n(r){if(Array.isArray(r))return t(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(vx)),vx.exports}var bx={exports:{}},AP;function Vle(){return AP||(AP=1,(function(e){function t(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(bx)),bx.exports}var yx={exports:{}},xP;function Ule(){return xP||(xP=1,(function(e){function t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
267
267
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(yx)),yx.exports}var wP;function mb(){return wP||(wP=1,(function(e){var t=Hle(),n=Vle(),r=Fz(),i=Ule();function a(o){return t(o)||n(o)||r(o)||i()}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(gx)),gx.exports}var pn={},Ax={exports:{}},EP;function _6(){return EP||(EP=1,(function(e){function t(n,r){return r||(r=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}}))}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ax)),Ax.exports}var i0={exports:{}},a0={exports:{}},Wle=a0.exports,SP;function Yle(){return SP||(SP=1,(function(e,t){(function(n,r){r(t)})(Wle,(function(n){const r=["top","right","bottom","left"],i=["start","end"],a=r.reduce((ie,ce)=>ie.concat(ce,ce+"-"+i[0],ce+"-"+i[1]),[]),o=Math.min,u=Math.max,d={left:"right",right:"left",bottom:"top",top:"bottom"},h={start:"end",end:"start"};function v(ie,ce,De){return u(ie,o(ce,De))}function p(ie,ce){return typeof ie=="function"?ie(ce):ie}function y(ie){return ie.split("-")[0]}function b(ie){return ie.split("-")[1]}function A(ie){return ie==="x"?"y":"x"}function x(ie){return ie==="y"?"height":"width"}const w=new Set(["top","bottom"]);function R(ie){return w.has(y(ie))?"y":"x"}function O(ie){return A(R(ie))}function D(ie,ce,De){De===void 0&&(De=!1);const pe=b(ie),ye=O(ie),Be=x(ye);let $e=ye==="x"?pe===(De?"end":"start")?"right":"left":pe==="start"?"bottom":"top";return ce.reference[Be]>ce.floating[Be]&&($e=F($e)),[$e,F($e)]}function C(ie){const ce=F(ie);return[S(ie),ce,S(ce)]}function S(ie){return ie.replace(/start|end/g,ce=>h[ce])}const M=["left","right"],P=["right","left"],T=["top","bottom"],j=["bottom","top"];function N(ie,ce,De){switch(ie){case"top":case"bottom":return De?ce?P:M:ce?M:P;case"left":case"right":return ce?T:j;default:return[]}}function _(ie,ce,De,pe){const ye=b(ie);let Be=N(y(ie),De==="start",pe);return ye&&(Be=Be.map($e=>$e+"-"+ye),ce&&(Be=Be.concat(Be.map(S)))),Be}function F(ie){return ie.replace(/left|right|bottom|top/g,ce=>d[ce])}function q(ie){return{top:0,right:0,bottom:0,left:0,...ie}}function z(ie){return typeof ie!="number"?q(ie):{top:ie,right:ie,bottom:ie,left:ie}}function B(ie){const{x:ce,y:De,width:pe,height:ye}=ie;return{width:pe,height:ye,top:De,left:ce,right:ce+pe,bottom:De+ye,x:ce,y:De}}function X(ie,ce,De){let{reference:pe,floating:ye}=ie;const Be=R(ce),$e=O(ce),it=x($e),xt=y(ce),wt=Be==="y",At=pe.x+pe.width/2-ye.width/2,vt=pe.y+pe.height/2-ye.height/2,Et=pe[it]/2-ye[it]/2;let pt;switch(xt){case"top":pt={x:At,y:pe.y-ye.height};break;case"bottom":pt={x:At,y:pe.y+pe.height};break;case"right":pt={x:pe.x+pe.width,y:vt};break;case"left":pt={x:pe.x-ye.width,y:vt};break;default:pt={x:pe.x,y:pe.y}}switch(b(ce)){case"start":pt[$e]-=Et*(De&&wt?-1:1);break;case"end":pt[$e]+=Et*(De&&wt?-1:1);break}return pt}async function V(ie,ce){var De;ce===void 0&&(ce={});const{x:pe,y:ye,platform:Be,rects:$e,elements:it,strategy:xt}=ie,{boundary:wt="clippingAncestors",rootBoundary:At="viewport",elementContext:vt="floating",altBoundary:Et=!1,padding:pt=0}=p(ce,ie),ft=z(pt),Z=it[Et?vt==="floating"?"reference":"floating":vt],Ue=B(await Be.getClippingRect({element:(De=await(Be.isElement==null?void 0:Be.isElement(Z)))==null||De?Z:Z.contextElement||await(Be.getDocumentElement==null?void 0:Be.getDocumentElement(it.floating)),boundary:wt,rootBoundary:At,strategy:xt})),ct=vt==="floating"?{x:pe,y:ye,width:$e.floating.width,height:$e.floating.height}:$e.reference,oe=await(Be.getOffsetParent==null?void 0:Be.getOffsetParent(it.floating)),Ee=await(Be.isElement==null?void 0:Be.isElement(oe))?await(Be.getScale==null?void 0:Be.getScale(oe))||{x:1,y:1}:{x:1,y:1},Ye=B(Be.convertOffsetParentRelativeRectToViewportRelativeRect?await Be.convertOffsetParentRelativeRectToViewportRelativeRect({elements:it,rect:ct,offsetParent:oe,strategy:xt}):ct);return{top:(Ue.top-Ye.top+ft.top)/Ee.y,bottom:(Ye.bottom-Ue.bottom+ft.bottom)/Ee.y,left:(Ue.left-Ye.left+ft.left)/Ee.x,right:(Ye.right-Ue.right+ft.right)/Ee.x}}const J=async(ie,ce,De)=>{const{placement:pe="bottom",strategy:ye="absolute",middleware:Be=[],platform:$e}=De,it=Be.filter(Boolean),xt=await($e.isRTL==null?void 0:$e.isRTL(ce));let wt=await $e.getElementRects({reference:ie,floating:ce,strategy:ye}),{x:At,y:vt}=X(wt,pe,xt),Et=pe,pt={},ft=0;for(let Z=0;Z<it.length;Z++){var St;const{name:Ue,fn:ct}=it[Z],{x:oe,y:Ee,data:Ye,reset:bt}=await ct({x:At,y:vt,initialPlacement:pe,placement:Et,strategy:ye,middlewareData:pt,rects:wt,platform:{...$e,detectOverflow:(St=$e.detectOverflow)!=null?St:V},elements:{reference:ie,floating:ce}});At=oe!=null?oe:At,vt=Ee!=null?Ee:vt,pt={...pt,[Ue]:{...pt[Ue],...Ye}},bt&&ft<=50&&(ft++,typeof bt=="object"&&(bt.placement&&(Et=bt.placement),bt.rects&&(wt=bt.rects===!0?await $e.getElementRects({reference:ie,floating:ce,strategy:ye}):bt.rects),{x:At,y:vt}=X(wt,Et,xt)),Z=-1)}return{x:At,y:vt,placement:Et,strategy:ye,middlewareData:pt}},ee=ie=>({name:"arrow",options:ie,async fn(ce){const{x:De,y:pe,placement:ye,rects:Be,platform:$e,elements:it,middlewareData:xt}=ce,{element:wt,padding:At=0}=p(ie,ce)||{};if(wt==null)return{};const vt=z(At),Et={x:De,y:pe},pt=O(ye),ft=x(pt),St=await $e.getDimensions(wt),Z=pt==="y",Ue=Z?"top":"left",ct=Z?"bottom":"right",oe=Z?"clientHeight":"clientWidth",Ee=Be.reference[ft]+Be.reference[pt]-Et[pt]-Be.floating[ft],Ye=Et[pt]-Be.reference[pt],bt=await($e.getOffsetParent==null?void 0:$e.getOffsetParent(wt));let yt=bt?bt[oe]:0;(!yt||!await($e.isElement==null?void 0:$e.isElement(bt)))&&(yt=it.floating[oe]||Be.floating[ft]);const Zt=Ee/2-Ye/2,Qt=yt/2-St[ft]/2-1,Ot=o(vt[Ue],Qt),Kt=o(vt[ct],Qt),ae=Ot,we=yt-St[ft]-Kt,Me=yt/2-St[ft]/2+Zt,Se=v(ae,Me,we),rt=!xt.arrow&&b(ye)!=null&&Me!==Se&&Be.reference[ft]/2-(Me<ae?Ot:Kt)-St[ft]/2<0,gt=rt?Me<ae?Me-ae:Me-we:0;return{[pt]:Et[pt]+gt,data:{[pt]:Se,centerOffset:Me-Se-gt,...rt&&{alignmentOffset:gt}},reset:rt}}});function ne(ie,ce,De){return(ie?[...De.filter(ye=>b(ye)===ie),...De.filter(ye=>b(ye)!==ie)]:De.filter(ye=>y(ye)===ye)).filter(ye=>ie?b(ye)===ie||(ce?S(ye)!==ye:!1):!0)}const U=function(ie){return ie===void 0&&(ie={}),{name:"autoPlacement",options:ie,async fn(ce){var De,pe,ye;const{rects:Be,middlewareData:$e,placement:it,platform:xt,elements:wt}=ce,{crossAxis:At=!1,alignment:vt,allowedPlacements:Et=a,autoAlignment:pt=!0,...ft}=p(ie,ce),St=vt!==void 0||Et===a?ne(vt||null,pt,Et):Et,Z=await xt.detectOverflow(ce,ft),Ue=((De=$e.autoPlacement)==null?void 0:De.index)||0,ct=St[Ue];if(ct==null)return{};const oe=D(ct,Be,await(xt.isRTL==null?void 0:xt.isRTL(wt.floating)));if(it!==ct)return{reset:{placement:St[0]}};const Ee=[Z[y(ct)],Z[oe[0]],Z[oe[1]]],Ye=[...((pe=$e.autoPlacement)==null?void 0:pe.overflows)||[],{placement:ct,overflows:Ee}],bt=St[Ue+1];if(bt)return{data:{index:Ue+1,overflows:Ye},reset:{placement:bt}};const yt=Ye.map(Ot=>{const Kt=b(Ot.placement);return[Ot.placement,Kt&&At?Ot.overflows.slice(0,2).reduce((ae,we)=>ae+we,0):Ot.overflows[0],Ot.overflows]}).sort((Ot,Kt)=>Ot[1]-Kt[1]),Qt=((ye=yt.filter(Ot=>Ot[2].slice(0,b(Ot[0])?2:3).every(Kt=>Kt<=0))[0])==null?void 0:ye[0])||yt[0][0];return Qt!==it?{data:{index:Ue+1,overflows:Ye},reset:{placement:Qt}}:{}}}},H=function(ie){return ie===void 0&&(ie={}),{name:"flip",options:ie,async fn(ce){var De,pe;const{placement:ye,middlewareData:Be,rects:$e,initialPlacement:it,platform:xt,elements:wt}=ce,{mainAxis:At=!0,crossAxis:vt=!0,fallbackPlacements:Et,fallbackStrategy:pt="bestFit",fallbackAxisSideDirection:ft="none",flipAlignment:St=!0,...Z}=p(ie,ce);if((De=Be.arrow)!=null&&De.alignmentOffset)return{};const Ue=y(ye),ct=R(it),oe=y(it)===it,Ee=await(xt.isRTL==null?void 0:xt.isRTL(wt.floating)),Ye=Et||(oe||!St?[F(it)]:C(it)),bt=ft!=="none";!Et&&bt&&Ye.push(..._(it,St,ft,Ee));const yt=[it,...Ye],Zt=await xt.detectOverflow(ce,Z),Qt=[];let Ot=((pe=Be.flip)==null?void 0:pe.overflows)||[];if(At&&Qt.push(Zt[Ue]),vt){const Me=D(ye,$e,Ee);Qt.push(Zt[Me[0]],Zt[Me[1]])}if(Ot=[...Ot,{placement:ye,overflows:Qt}],!Qt.every(Me=>Me<=0)){var Kt,ae;const Me=(((Kt=Be.flip)==null?void 0:Kt.index)||0)+1,Se=yt[Me];if(Se&&(!(vt==="alignment"?ct!==R(Se):!1)||Ot.every(at=>R(at.placement)===ct?at.overflows[0]>0:!0)))return{data:{index:Me,overflows:Ot},reset:{placement:Se}};let rt=(ae=Ot.filter(gt=>gt.overflows[0]<=0).sort((gt,at)=>gt.overflows[1]-at.overflows[1])[0])==null?void 0:ae.placement;if(!rt)switch(pt){case"bestFit":{var we;const gt=(we=Ot.filter(at=>{if(bt){const Ct=R(at.placement);return Ct===ct||Ct==="y"}return!0}).map(at=>[at.placement,at.overflows.filter(Ct=>Ct>0).reduce((Ct,Ft)=>Ct+Ft,0)]).sort((at,Ct)=>at[1]-Ct[1])[0])==null?void 0:we[0];gt&&(rt=gt);break}case"initialPlacement":rt=it;break}if(ye!==rt)return{reset:{placement:rt}}}return{}}}};function W(ie,ce){return{top:ie.top-ce.height,right:ie.right-ce.width,bottom:ie.bottom-ce.height,left:ie.left-ce.width}}function Y(ie){return r.some(ce=>ie[ce]>=0)}const K=function(ie){return ie===void 0&&(ie={}),{name:"hide",options:ie,async fn(ce){const{rects:De,platform:pe}=ce,{strategy:ye="referenceHidden",...Be}=p(ie,ce);switch(ye){case"referenceHidden":{const $e=await pe.detectOverflow(ce,{...Be,elementContext:"reference"}),it=W($e,De.reference);return{data:{referenceHiddenOffsets:it,referenceHidden:Y(it)}}}case"escaped":{const $e=await pe.detectOverflow(ce,{...Be,altBoundary:!0}),it=W($e,De.floating);return{data:{escapedOffsets:it,escaped:Y(it)}}}default:return{}}}}};function re(ie){const ce=o(...ie.map(Be=>Be.left)),De=o(...ie.map(Be=>Be.top)),pe=u(...ie.map(Be=>Be.right)),ye=u(...ie.map(Be=>Be.bottom));return{x:ce,y:De,width:pe-ce,height:ye-De}}function me(ie){const ce=ie.slice().sort((ye,Be)=>ye.y-Be.y),De=[];let pe=null;for(let ye=0;ye<ce.length;ye++){const Be=ce[ye];!pe||Be.y-pe.y>pe.height/2?De.push([Be]):De[De.length-1].push(Be),pe=Be}return De.map(ye=>B(re(ye)))}const ve=function(ie){return ie===void 0&&(ie={}),{name:"inline",options:ie,async fn(ce){const{placement:De,elements:pe,rects:ye,platform:Be,strategy:$e}=ce,{padding:it=2,x:xt,y:wt}=p(ie,ce),At=Array.from(await(Be.getClientRects==null?void 0:Be.getClientRects(pe.reference))||[]),vt=me(At),Et=B(re(At)),pt=z(it);function ft(){if(vt.length===2&&vt[0].left>vt[1].right&&xt!=null&&wt!=null)return vt.find(Z=>xt>Z.left-pt.left&&xt<Z.right+pt.right&&wt>Z.top-pt.top&&wt<Z.bottom+pt.bottom)||Et;if(vt.length>=2){if(R(De)==="y"){const Ot=vt[0],Kt=vt[vt.length-1],ae=y(De)==="top",we=Ot.top,Me=Kt.bottom,Se=ae?Ot.left:Kt.left,rt=ae?Ot.right:Kt.right,gt=rt-Se,at=Me-we;return{top:we,bottom:Me,left:Se,right:rt,width:gt,height:at,x:Se,y:we}}const Z=y(De)==="left",Ue=u(...vt.map(Ot=>Ot.right)),ct=o(...vt.map(Ot=>Ot.left)),oe=vt.filter(Ot=>Z?Ot.left===ct:Ot.right===Ue),Ee=oe[0].top,Ye=oe[oe.length-1].bottom,bt=ct,yt=Ue,Zt=yt-bt,Qt=Ye-Ee;return{top:Ee,bottom:Ye,left:bt,right:yt,width:Zt,height:Qt,x:bt,y:Ee}}return Et}const St=await Be.getElementRects({reference:{getBoundingClientRect:ft},floating:pe.floating,strategy:$e});return ye.reference.x!==St.reference.x||ye.reference.y!==St.reference.y||ye.reference.width!==St.reference.width||ye.reference.height!==St.reference.height?{reset:{rects:St}}:{}}}},Te=new Set(["left","top"]);async function Ge(ie,ce){const{placement:De,platform:pe,elements:ye}=ie,Be=await(pe.isRTL==null?void 0:pe.isRTL(ye.floating)),$e=y(De),it=b(De),xt=R(De)==="y",wt=Te.has($e)?-1:1,At=Be&&xt?-1:1,vt=p(ce,ie);let{mainAxis:Et,crossAxis:pt,alignmentAxis:ft}=typeof vt=="number"?{mainAxis:vt,crossAxis:0,alignmentAxis:null}:{mainAxis:vt.mainAxis||0,crossAxis:vt.crossAxis||0,alignmentAxis:vt.alignmentAxis};return it&&typeof ft=="number"&&(pt=it==="end"?ft*-1:ft),xt?{x:pt*At,y:Et*wt}:{x:Et*wt,y:pt*At}}const mt=function(ie){return ie===void 0&&(ie=0),{name:"offset",options:ie,async fn(ce){var De,pe;const{x:ye,y:Be,placement:$e,middlewareData:it}=ce,xt=await Ge(ce,ie);return $e===((De=it.offset)==null?void 0:De.placement)&&(pe=it.arrow)!=null&&pe.alignmentOffset?{}:{x:ye+xt.x,y:Be+xt.y,data:{...xt,placement:$e}}}}},Rt=function(ie){return ie===void 0&&(ie={}),{name:"shift",options:ie,async fn(ce){const{x:De,y:pe,placement:ye,platform:Be}=ce,{mainAxis:$e=!0,crossAxis:it=!1,limiter:xt={fn:Ue=>{let{x:ct,y:oe}=Ue;return{x:ct,y:oe}}},...wt}=p(ie,ce),At={x:De,y:pe},vt=await Be.detectOverflow(ce,wt),Et=R(y(ye)),pt=A(Et);let ft=At[pt],St=At[Et];if($e){const Ue=pt==="y"?"top":"left",ct=pt==="y"?"bottom":"right",oe=ft+vt[Ue],Ee=ft-vt[ct];ft=v(oe,ft,Ee)}if(it){const Ue=Et==="y"?"top":"left",ct=Et==="y"?"bottom":"right",oe=St+vt[Ue],Ee=St-vt[ct];St=v(oe,St,Ee)}const Z=xt.fn({...ce,[pt]:ft,[Et]:St});return{...Z,data:{x:Z.x-De,y:Z.y-pe,enabled:{[pt]:$e,[Et]:it}}}}}},dt=function(ie){return ie===void 0&&(ie={}),{options:ie,fn(ce){const{x:De,y:pe,placement:ye,rects:Be,middlewareData:$e}=ce,{offset:it=0,mainAxis:xt=!0,crossAxis:wt=!0}=p(ie,ce),At={x:De,y:pe},vt=R(ye),Et=A(vt);let pt=At[Et],ft=At[vt];const St=p(it,ce),Z=typeof St=="number"?{mainAxis:St,crossAxis:0}:{mainAxis:0,crossAxis:0,...St};if(xt){const oe=Et==="y"?"height":"width",Ee=Be.reference[Et]-Be.floating[oe]+Z.mainAxis,Ye=Be.reference[Et]+Be.reference[oe]-Z.mainAxis;pt<Ee?pt=Ee:pt>Ye&&(pt=Ye)}if(wt){var Ue,ct;const oe=Et==="y"?"width":"height",Ee=Te.has(y(ye)),Ye=Be.reference[vt]-Be.floating[oe]+(Ee&&((Ue=$e.offset)==null?void 0:Ue[vt])||0)+(Ee?0:Z.crossAxis),bt=Be.reference[vt]+Be.reference[oe]+(Ee?0:((ct=$e.offset)==null?void 0:ct[vt])||0)-(Ee?Z.crossAxis:0);ft<Ye?ft=Ye:ft>bt&&(ft=bt)}return{[Et]:pt,[vt]:ft}}}},Ke=function(ie){return ie===void 0&&(ie={}),{name:"size",options:ie,async fn(ce){var De,pe;const{placement:ye,rects:Be,platform:$e,elements:it}=ce,{apply:xt=()=>{},...wt}=p(ie,ce),At=await $e.detectOverflow(ce,wt),vt=y(ye),Et=b(ye),pt=R(ye)==="y",{width:ft,height:St}=Be.floating;let Z,Ue;vt==="top"||vt==="bottom"?(Z=vt,Ue=Et===(await($e.isRTL==null?void 0:$e.isRTL(it.floating))?"start":"end")?"left":"right"):(Ue=vt,Z=Et==="end"?"top":"bottom");const ct=St-At.top-At.bottom,oe=ft-At.left-At.right,Ee=o(St-At[Z],ct),Ye=o(ft-At[Ue],oe),bt=!ce.middlewareData.shift;let yt=Ee,Zt=Ye;if((De=ce.middlewareData.shift)!=null&&De.enabled.x&&(Zt=oe),(pe=ce.middlewareData.shift)!=null&&pe.enabled.y&&(yt=ct),bt&&!Et){const Ot=u(At.left,0),Kt=u(At.right,0),ae=u(At.top,0),we=u(At.bottom,0);pt?Zt=ft-2*(Ot!==0||Kt!==0?Ot+Kt:u(At.left,At.right)):yt=St-2*(ae!==0||we!==0?ae+we:u(At.top,At.bottom))}await xt({...ce,availableWidth:Zt,availableHeight:yt});const Qt=await $e.getDimensions(it.floating);return ft!==Qt.width||St!==Qt.height?{reset:{rects:!0}}:{}}}};n.arrow=ee,n.autoPlacement=U,n.computePosition=J,n.detectOverflow=V,n.flip=H,n.hide=K,n.inline=ve,n.limitShift=dt,n.offset=mt,n.rectToClientRect=B,n.shift=Rt,n.size=Ke}))})(a0,a0.exports)),a0.exports}var Gle=i0.exports,CP;function Kle(){return CP||(CP=1,(function(e,t){(function(n,r){r(t,Yle())})(Gle,(function(n,r){const i=Math.min,a=Math.max,o=Math.round,u=Math.floor,d=ae=>({x:ae,y:ae});function h(){return typeof window!="undefined"}function v(ae){return b(ae)?(ae.nodeName||"").toLowerCase():"#document"}function p(ae){var we;return(ae==null||(we=ae.ownerDocument)==null?void 0:we.defaultView)||window}function y(ae){var we;return(we=(b(ae)?ae.ownerDocument:ae.document)||window.document)==null?void 0:we.documentElement}function b(ae){return h()?ae instanceof Node||ae instanceof p(ae).Node:!1}function A(ae){return h()?ae instanceof Element||ae instanceof p(ae).Element:!1}function x(ae){return h()?ae instanceof HTMLElement||ae instanceof p(ae).HTMLElement:!1}function w(ae){return!h()||typeof ShadowRoot=="undefined"?!1:ae instanceof ShadowRoot||ae instanceof p(ae).ShadowRoot}const R=new Set(["inline","contents"]);function O(ae){const{overflow:we,overflowX:Me,overflowY:Se,display:rt}=B(ae);return/auto|scroll|overlay|hidden|clip/.test(we+Se+Me)&&!R.has(rt)}const D=new Set(["table","td","th"]);function C(ae){return D.has(v(ae))}const S=[":popover-open",":modal"];function M(ae){return S.some(we=>{try{return ae.matches(we)}catch(Me){return!1}})}const P=["transform","translate","scale","rotate","perspective"],T=["transform","translate","scale","rotate","perspective","filter"],j=["paint","layout","strict","content"];function N(ae){const we=F(),Me=A(ae)?B(ae):ae;return P.some(Se=>Me[Se]?Me[Se]!=="none":!1)||(Me.containerType?Me.containerType!=="normal":!1)||!we&&(Me.backdropFilter?Me.backdropFilter!=="none":!1)||!we&&(Me.filter?Me.filter!=="none":!1)||T.some(Se=>(Me.willChange||"").includes(Se))||j.some(Se=>(Me.contain||"").includes(Se))}function _(ae){let we=V(ae);for(;x(we)&&!z(we);){if(N(we))return we;if(M(we))return null;we=V(we)}return null}function F(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const q=new Set(["html","body","#document"]);function z(ae){return q.has(v(ae))}function B(ae){return p(ae).getComputedStyle(ae)}function X(ae){return A(ae)?{scrollLeft:ae.scrollLeft,scrollTop:ae.scrollTop}:{scrollLeft:ae.scrollX,scrollTop:ae.scrollY}}function V(ae){if(v(ae)==="html")return ae;const we=ae.assignedSlot||ae.parentNode||w(ae)&&ae.host||y(ae);return w(we)?we.host:we}function J(ae){const we=V(ae);return z(we)?ae.ownerDocument?ae.ownerDocument.body:ae.body:x(we)&&O(we)?we:J(we)}function ee(ae,we,Me){var Se;we===void 0&&(we=[]),Me===void 0&&(Me=!0);const rt=J(ae),gt=rt===((Se=ae.ownerDocument)==null?void 0:Se.body),at=p(rt);if(gt){const Ct=ne(at);return we.concat(at,at.visualViewport||[],O(rt)?rt:[],Ct&&Me?ee(Ct):[])}return we.concat(rt,ee(rt,[],Me))}function ne(ae){return ae.parent&&Object.getPrototypeOf(ae.parent)?ae.frameElement:null}function U(ae){const we=B(ae);let Me=parseFloat(we.width)||0,Se=parseFloat(we.height)||0;const rt=x(ae),gt=rt?ae.offsetWidth:Me,at=rt?ae.offsetHeight:Se,Ct=o(Me)!==gt||o(Se)!==at;return Ct&&(Me=gt,Se=at),{width:Me,height:Se,$:Ct}}function H(ae){return A(ae)?ae:ae.contextElement}function W(ae){const we=H(ae);if(!x(we))return d(1);const Me=we.getBoundingClientRect(),{width:Se,height:rt,$:gt}=U(we);let at=(gt?o(Me.width):Me.width)/Se,Ct=(gt?o(Me.height):Me.height)/rt;return(!at||!Number.isFinite(at))&&(at=1),(!Ct||!Number.isFinite(Ct))&&(Ct=1),{x:at,y:Ct}}const Y=d(0);function K(ae){const we=p(ae);return!F()||!we.visualViewport?Y:{x:we.visualViewport.offsetLeft,y:we.visualViewport.offsetTop}}function re(ae,we,Me){return we===void 0&&(we=!1),!Me||we&&Me!==p(ae)?!1:we}function me(ae,we,Me,Se){we===void 0&&(we=!1),Me===void 0&&(Me=!1);const rt=ae.getBoundingClientRect(),gt=H(ae);let at=d(1);we&&(Se?A(Se)&&(at=W(Se)):at=W(ae));const Ct=re(gt,Me,Se)?K(gt):d(0);let Ft=(rt.left+Ct.x)/at.x,_t=(rt.top+Ct.y)/at.y,Jt=rt.width/at.x,ge=rt.height/at.y;if(gt){const xe=p(gt),Fe=Se&&A(Se)?p(Se):Se;let ze=xe,Q=ne(ze);for(;Q&&Se&&Fe!==ze;){const Re=W(Q),qe=Q.getBoundingClientRect(),ot=B(Q),ue=qe.left+(Q.clientLeft+parseFloat(ot.paddingLeft))*Re.x,Ne=qe.top+(Q.clientTop+parseFloat(ot.paddingTop))*Re.y;Ft*=Re.x,_t*=Re.y,Jt*=Re.x,ge*=Re.y,Ft+=ue,_t+=Ne,ze=p(Q),Q=ne(ze)}}return r.rectToClientRect({width:Jt,height:ge,x:Ft,y:_t})}function ve(ae,we){const Me=X(ae).scrollLeft;return we?we.left+Me:me(y(ae)).left+Me}function Te(ae,we){const Me=ae.getBoundingClientRect(),Se=Me.left+we.scrollLeft-ve(ae,Me),rt=Me.top+we.scrollTop;return{x:Se,y:rt}}function Ge(ae){let{elements:we,rect:Me,offsetParent:Se,strategy:rt}=ae;const gt=rt==="fixed",at=y(Se),Ct=we?M(we.floating):!1;if(Se===at||Ct&>)return Me;let Ft={scrollLeft:0,scrollTop:0},_t=d(1);const Jt=d(0),ge=x(Se);if((ge||!ge&&!gt)&&((v(Se)!=="body"||O(at))&&(Ft=X(Se)),x(Se))){const Fe=me(Se);_t=W(Se),Jt.x=Fe.x+Se.clientLeft,Jt.y=Fe.y+Se.clientTop}const xe=at&&!ge&&!gt?Te(at,Ft):d(0);return{width:Me.width*_t.x,height:Me.height*_t.y,x:Me.x*_t.x-Ft.scrollLeft*_t.x+Jt.x+xe.x,y:Me.y*_t.y-Ft.scrollTop*_t.y+Jt.y+xe.y}}function mt(ae){return Array.from(ae.getClientRects())}function Rt(ae){const we=y(ae),Me=X(ae),Se=ae.ownerDocument.body,rt=a(we.scrollWidth,we.clientWidth,Se.scrollWidth,Se.clientWidth),gt=a(we.scrollHeight,we.clientHeight,Se.scrollHeight,Se.clientHeight);let at=-Me.scrollLeft+ve(ae);const Ct=-Me.scrollTop;return B(Se).direction==="rtl"&&(at+=a(we.clientWidth,Se.clientWidth)-rt),{width:rt,height:gt,x:at,y:Ct}}const dt=25;function Ke(ae,we){const Me=p(ae),Se=y(ae),rt=Me.visualViewport;let gt=Se.clientWidth,at=Se.clientHeight,Ct=0,Ft=0;if(rt){gt=rt.width,at=rt.height;const Jt=F();(!Jt||Jt&&we==="fixed")&&(Ct=rt.offsetLeft,Ft=rt.offsetTop)}const _t=ve(Se);if(_t<=0){const Jt=Se.ownerDocument,ge=Jt.body,xe=getComputedStyle(ge),Fe=Jt.compatMode==="CSS1Compat"&&parseFloat(xe.marginLeft)+parseFloat(xe.marginRight)||0,ze=Math.abs(Se.clientWidth-ge.clientWidth-Fe);ze<=dt&&(gt-=ze)}else _t<=dt&&(gt+=_t);return{width:gt,height:at,x:Ct,y:Ft}}const ie=new Set(["absolute","fixed"]);function ce(ae,we){const Me=me(ae,!0,we==="fixed"),Se=Me.top+ae.clientTop,rt=Me.left+ae.clientLeft,gt=x(ae)?W(ae):d(1),at=ae.clientWidth*gt.x,Ct=ae.clientHeight*gt.y,Ft=rt*gt.x,_t=Se*gt.y;return{width:at,height:Ct,x:Ft,y:_t}}function De(ae,we,Me){let Se;if(we==="viewport")Se=Ke(ae,Me);else if(we==="document")Se=Rt(y(ae));else if(A(we))Se=ce(we,Me);else{const rt=K(ae);Se={x:we.x-rt.x,y:we.y-rt.y,width:we.width,height:we.height}}return r.rectToClientRect(Se)}function pe(ae,we){const Me=V(ae);return Me===we||!A(Me)||z(Me)?!1:B(Me).position==="fixed"||pe(Me,we)}function ye(ae,we){const Me=we.get(ae);if(Me)return Me;let Se=ee(ae,[],!1).filter(Ct=>A(Ct)&&v(Ct)!=="body"),rt=null;const gt=B(ae).position==="fixed";let at=gt?V(ae):ae;for(;A(at)&&!z(at);){const Ct=B(at),Ft=N(at);!Ft&&Ct.position==="fixed"&&(rt=null),(gt?!Ft&&!rt:!Ft&&Ct.position==="static"&&!!rt&&ie.has(rt.position)||O(at)&&!Ft&&pe(ae,at))?Se=Se.filter(Jt=>Jt!==at):rt=Ct,at=V(at)}return we.set(ae,Se),Se}function Be(ae){let{element:we,boundary:Me,rootBoundary:Se,strategy:rt}=ae;const at=[...Me==="clippingAncestors"?M(we)?[]:ye(we,this._c):[].concat(Me),Se],Ct=at[0],Ft=at.reduce((_t,Jt)=>{const ge=De(we,Jt,rt);return _t.top=a(ge.top,_t.top),_t.right=i(ge.right,_t.right),_t.bottom=i(ge.bottom,_t.bottom),_t.left=a(ge.left,_t.left),_t},De(we,Ct,rt));return{width:Ft.right-Ft.left,height:Ft.bottom-Ft.top,x:Ft.left,y:Ft.top}}function $e(ae){const{width:we,height:Me}=U(ae);return{width:we,height:Me}}function it(ae,we,Me){const Se=x(we),rt=y(we),gt=Me==="fixed",at=me(ae,!0,gt,we);let Ct={scrollLeft:0,scrollTop:0};const Ft=d(0);function _t(){Ft.x=ve(rt)}if(Se||!Se&&!gt)if((v(we)!=="body"||O(rt))&&(Ct=X(we)),Se){const Fe=me(we,!0,gt,we);Ft.x=Fe.x+we.clientLeft,Ft.y=Fe.y+we.clientTop}else rt&&_t();gt&&!Se&&rt&&_t();const Jt=rt&&!Se&&!gt?Te(rt,Ct):d(0),ge=at.left+Ct.scrollLeft-Ft.x-Jt.x,xe=at.top+Ct.scrollTop-Ft.y-Jt.y;return{x:ge,y:xe,width:at.width,height:at.height}}function xt(ae){return B(ae).position==="static"}function wt(ae,we){if(!x(ae)||B(ae).position==="fixed")return null;if(we)return we(ae);let Me=ae.offsetParent;return y(ae)===Me&&(Me=Me.ownerDocument.body),Me}function At(ae,we){const Me=p(ae);if(M(ae))return Me;if(!x(ae)){let rt=V(ae);for(;rt&&!z(rt);){if(A(rt)&&!xt(rt))return rt;rt=V(rt)}return Me}let Se=wt(ae,we);for(;Se&&C(Se)&&xt(Se);)Se=wt(Se,we);return Se&&z(Se)&&xt(Se)&&!N(Se)?Me:Se||_(ae)||Me}const vt=async function(ae){const we=this.getOffsetParent||At,Me=this.getDimensions,Se=await Me(ae.floating);return{reference:it(ae.reference,await we(ae.floating),ae.strategy),floating:{x:0,y:0,width:Se.width,height:Se.height}}};function Et(ae){return B(ae).direction==="rtl"}const pt={convertOffsetParentRelativeRectToViewportRelativeRect:Ge,getDocumentElement:y,getClippingRect:Be,getOffsetParent:At,getElementRects:vt,getClientRects:mt,getDimensions:$e,getScale:W,isElement:A,isRTL:Et};function ft(ae,we){return ae.x===we.x&&ae.y===we.y&&ae.width===we.width&&ae.height===we.height}function St(ae,we){let Me=null,Se;const rt=y(ae);function gt(){var Ct;clearTimeout(Se),(Ct=Me)==null||Ct.disconnect(),Me=null}function at(Ct,Ft){Ct===void 0&&(Ct=!1),Ft===void 0&&(Ft=1),gt();const _t=ae.getBoundingClientRect(),{left:Jt,top:ge,width:xe,height:Fe}=_t;if(Ct||we(),!xe||!Fe)return;const ze=u(ge),Q=u(rt.clientWidth-(Jt+xe)),Re=u(rt.clientHeight-(ge+Fe)),qe=u(Jt),ue={rootMargin:-ze+"px "+-Q+"px "+-Re+"px "+-qe+"px",threshold:a(0,i(1,Ft))||1};let Ne=!0;function Je(ht){const He=ht[0].intersectionRatio;if(He!==Ft){if(!Ne)return at();He?at(!1,He):Se=setTimeout(()=>{at(!1,1e-7)},1e3)}He===1&&!ft(_t,ae.getBoundingClientRect())&&at(),Ne=!1}try{Me=new IntersectionObserver(Je,{...ue,root:rt.ownerDocument})}catch(ht){Me=new IntersectionObserver(Je,ue)}Me.observe(ae)}return at(!0),gt}function Z(ae,we,Me,Se){Se===void 0&&(Se={});const{ancestorScroll:rt=!0,ancestorResize:gt=!0,elementResize:at=typeof ResizeObserver=="function",layoutShift:Ct=typeof IntersectionObserver=="function",animationFrame:Ft=!1}=Se,_t=H(ae),Jt=rt||gt?[..._t?ee(_t):[],...ee(we)]:[];Jt.forEach(qe=>{rt&&qe.addEventListener("scroll",Me,{passive:!0}),gt&&qe.addEventListener("resize",Me)});const ge=_t&&Ct?St(_t,Me):null;let xe=-1,Fe=null;at&&(Fe=new ResizeObserver(qe=>{let[ot]=qe;ot&&ot.target===_t&&Fe&&(Fe.unobserve(we),cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{var ue;(ue=Fe)==null||ue.observe(we)})),Me()}),_t&&!Ft&&Fe.observe(_t),Fe.observe(we));let ze,Q=Ft?me(ae):null;Ft&&Re();function Re(){const qe=me(ae);Q&&!ft(Q,qe)&&Me(),Q=qe,ze=requestAnimationFrame(Re)}return Me(),()=>{var qe;Jt.forEach(ot=>{rt&&ot.removeEventListener("scroll",Me),gt&&ot.removeEventListener("resize",Me)}),ge==null||ge(),(qe=Fe)==null||qe.disconnect(),Fe=null,Ft&&cancelAnimationFrame(ze)}}const Ue=r.detectOverflow,ct=r.offset,oe=r.autoPlacement,Ee=r.shift,Ye=r.flip,bt=r.size,yt=r.hide,Zt=r.arrow,Qt=r.inline,Ot=r.limitShift,Kt=(ae,we,Me)=>{const Se=new Map,rt={platform:pt,...Me},gt={...rt.platform,_c:Se};return r.computePosition(ae,we,{...rt,platform:gt})};n.arrow=Zt,n.autoPlacement=oe,n.autoUpdate=Z,n.computePosition=Kt,n.detectOverflow=Ue,n.flip=Ye,n.getOverflowAncestors=ee,n.hide=yt,n.inline=Qt,n.limitShift=Ot,n.offset=ct,n.platform=pt,n.shift=Ee,n.size=bt}))})(i0,i0.exports)),i0.exports}var xx={},RP;function B6(){return RP||(RP=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ln(),n=typeof document!="undefined",r=function(){},i=n?t.useLayoutEffect:r;e.default=i})(xx)),xx}var IP;function F6(){if(IP)return pn;IP=1;var e=Uf(),t=Bf(),n=q1(),r=hb(),i=Wf(),a=Vf(),o=_6(),u=fb(),d=Ln(),h=_0(),v=Kle(),p=B6();function y(ke){return ke&&ke.__esModule?ke:{default:ke}}var b=y(p),A=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],x=function(){};function w(ke,$){return $?$[0]==="-"?ke+$:ke+"__"+$:ke}function R(ke,$){for(var _e=arguments.length,Oe=new Array(_e>2?_e-2:0),Qe=2;Qe<_e;Qe++)Oe[Qe-2]=arguments[Qe];var ut=[].concat(Oe);if($&&ke)for(var nt in $)$.hasOwnProperty(nt)&&$[nt]&&ut.push("".concat(w(ke,nt)));return ut.filter(function(Pt){return Pt}).map(function(Pt){return String(Pt).trim()}).join(" ")}var O=function($){return H($)?$.filter(Boolean):a($)==="object"&&$!==null?[$]:[]},D=function($){$.className,$.clearValue,$.cx,$.getStyles,$.getClassNames,$.getValue,$.hasValue,$.isMulti,$.isRtl,$.options,$.selectOption,$.selectProps,$.setValue,$.theme;var _e=i($,A);return e({},_e)},C=function($,_e,Oe){var Qe=$.cx,ut=$.getStyles,nt=$.getClassNames,Pt=$.className;return{css:ut(_e,$),className:Qe(Oe!=null?Oe:{},nt(_e,$),Pt)}};function S(ke,$,_e){if(_e){var Oe=_e(ke,$);if(typeof Oe=="string")return Oe}return ke}function M(ke){return[document.documentElement,document.body,window].indexOf(ke)>-1}function P(ke){return M(ke)?window.innerHeight:ke.clientHeight}function T(ke){return M(ke)?window.pageYOffset:ke.scrollTop}function j(ke,$){if(M(ke)){window.scrollTo(0,$);return}ke.scrollTop=$}function N(ke){var $=getComputedStyle(ke),_e=$.position==="absolute",Oe=/(auto|scroll)/;if($.position==="fixed")return document.documentElement;for(var Qe=ke;Qe=Qe.parentElement;)if($=getComputedStyle(Qe),!(_e&&$.position==="static")&&Oe.test($.overflow+$.overflowY+$.overflowX))return Qe;return document.documentElement}function _(ke,$,_e,Oe){return _e*((ke=ke/Oe-1)*ke*ke+1)+$}function F(ke,$){var _e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:x,Qe=T(ke),ut=$-Qe,nt=10,Pt=0;function Ht(){Pt+=nt;var xn=_(Pt,Qe,ut,_e);j(ke,xn),Pt<_e?window.requestAnimationFrame(Ht):Oe(ke)}Ht()}function q(ke,$){var _e=ke.getBoundingClientRect(),Oe=$.getBoundingClientRect(),Qe=$.offsetHeight/3;Oe.bottom+Qe>_e.bottom?j(ke,Math.min($.offsetTop+$.clientHeight-ke.offsetHeight+Qe,ke.scrollHeight)):Oe.top-Qe<_e.top&&j(ke,Math.max($.offsetTop-Qe,0))}function z(ke){var $=ke.getBoundingClientRect();return{bottom:$.bottom,height:$.height,left:$.left,right:$.right,top:$.top,width:$.width}}function B(){try{return document.createEvent("TouchEvent"),!0}catch(ke){return!1}}function X(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(ke){return!1}}var V=!1,J={get passive(){return V=!0}},ee=typeof window!="undefined"?window:{};ee.addEventListener&&ee.removeEventListener&&(ee.addEventListener("p",x,J),ee.removeEventListener("p",x,!1));var ne=V;function U(ke){return ke!=null}function H(ke){return Array.isArray(ke)}function W(ke,$,_e){return ke?$:_e}function Y(ke){return ke}function K(ke){return ke}var re=function($){for(var _e=arguments.length,Oe=new Array(_e>1?_e-1:0),Qe=1;Qe<_e;Qe++)Oe[Qe-1]=arguments[Qe];var ut=Object.entries($).filter(function(nt){var Pt=r(nt,1),Ht=Pt[0];return!Oe.includes(Ht)});return ut.reduce(function(nt,Pt){var Ht=r(Pt,2),xn=Ht[0],Bn=Ht[1];return nt[xn]=Bn,nt},{})},me=["children","innerProps"],ve=["children","innerProps"];function Te(ke){var $=ke.maxHeight,_e=ke.menuEl,Oe=ke.minHeight,Qe=ke.placement,ut=ke.shouldScroll,nt=ke.isFixedPosition,Pt=ke.controlHeight,Ht=N(_e),xn={placement:"bottom",maxHeight:$};if(!_e||!_e.offsetParent)return xn;var Bn=Ht.getBoundingClientRect(),fr=Bn.height,Kn=_e.getBoundingClientRect(),fi=Kn.bottom,hi=Kn.height,mi=Kn.top,pi=_e.offsetParent.getBoundingClientRect(),_n=pi.top,Bi=nt?window.innerHeight:P(Ht),jr=T(Ht),pr=parseInt(getComputedStyle(_e).marginBottom,10),gi=parseInt(getComputedStyle(_e).marginTop,10),Yr=_n-gi,Ir=Bi-mi,Tr=Yr+jr,fa=fr-jr-mi,Za=fi-Bi+jr+pr,Vs=jr+mi-gi,Zi=160;switch(Qe){case"auto":case"bottom":if(Ir>=hi)return{placement:"bottom",maxHeight:$};if(fa>=hi&&!nt)return ut&&F(Ht,Za,Zi),{placement:"bottom",maxHeight:$};if(!nt&&fa>=Oe||nt&&Ir>=Oe){ut&&F(Ht,Za,Zi);var Fi=nt?Ir-pr:fa-pr;return{placement:"bottom",maxHeight:Fi}}if(Qe==="auto"||nt){var vs=$,Ma=nt?Yr:Tr;return Ma>=Oe&&(vs=Math.min(Ma-pr-Pt,$)),{placement:"top",maxHeight:vs}}if(Qe==="bottom")return ut&&j(Ht,Za),{placement:"bottom",maxHeight:$};break;case"top":if(Yr>=hi)return{placement:"top",maxHeight:$};if(Tr>=hi&&!nt)return ut&&F(Ht,Vs,Zi),{placement:"top",maxHeight:$};if(!nt&&Tr>=Oe||nt&&Yr>=Oe){var Li=$;return(!nt&&Tr>=Oe||nt&&Yr>=Oe)&&(Li=nt?Yr-gi:Tr-gi),ut&&F(Ht,Vs,Zi),{placement:"top",maxHeight:Li}}return{placement:"bottom",maxHeight:$};default:throw new Error('Invalid placement provided "'.concat(Qe,'".'))}return xn}function Ge(ke){var $={bottom:"top",top:"bottom"};return ke?$[ke]:"bottom"}var mt=function($){return $==="auto"?"bottom":$},Rt=function($,_e){var Oe,Qe=$.placement,ut=$.theme,nt=ut.borderRadius,Pt=ut.spacing,Ht=ut.colors;return e((Oe={label:"menu"},u(Oe,Ge(Qe),"100%"),u(Oe,"position","absolute"),u(Oe,"width","100%"),u(Oe,"zIndex",1),Oe),_e?{}:{backgroundColor:Ht.neutral0,borderRadius:nt,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:Pt.menuGutter,marginTop:Pt.menuGutter})},dt=d.createContext(null),Ke=function($){var _e=$.children,Oe=$.minMenuHeight,Qe=$.maxMenuHeight,ut=$.menuPlacement,nt=$.menuPosition,Pt=$.menuShouldScrollIntoView,Ht=$.theme,xn=d.useContext(dt)||{},Bn=xn.setPortalPlacement,fr=d.useRef(null),Kn=d.useState(Qe),fi=r(Kn,2),hi=fi[0],mi=fi[1],pi=d.useState(null),_n=r(pi,2),Bi=_n[0],jr=_n[1],pr=Ht.spacing.controlHeight;return b.default(function(){var gi=fr.current;if(gi){var Yr=nt==="fixed",Ir=Pt&&!Yr,Tr=Te({maxHeight:Qe,menuEl:gi,minHeight:Oe,placement:ut,shouldScroll:Ir,isFixedPosition:Yr,controlHeight:pr});mi(Tr.maxHeight),jr(Tr.placement),Bn==null||Bn(Tr.placement)}},[Qe,ut,nt,Pt,Oe,Bn,pr]),_e({ref:fr,placerProps:e(e({},$),{},{placement:Bi||mt(ut),maxHeight:hi})})},ie=function($){var _e=$.children,Oe=$.innerRef,Qe=$.innerProps;return n.jsx("div",t({},C($,"menu",{menu:!0}),{ref:Oe},Qe),_e)},ce=ie,De=function($,_e){var Oe=$.maxHeight,Qe=$.theme.spacing.baseUnit;return e({maxHeight:Oe,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},_e?{}:{paddingBottom:Qe,paddingTop:Qe})},pe=function($){var _e=$.children,Oe=$.innerProps,Qe=$.innerRef,ut=$.isMulti;return n.jsx("div",t({},C($,"menuList",{"menu-list":!0,"menu-list--is-multi":ut}),{ref:Qe},Oe),_e)},ye=function($,_e){var Oe=$.theme,Qe=Oe.spacing.baseUnit,ut=Oe.colors;return e({textAlign:"center"},_e?{}:{color:ut.neutral40,padding:"".concat(Qe*2,"px ").concat(Qe*3,"px")})},Be=ye,$e=ye,it=function($){var _e=$.children,Oe=_e===void 0?"No options":_e,Qe=$.innerProps,ut=i($,me);return n.jsx("div",t({},C(e(e({},ut),{},{children:Oe,innerProps:Qe}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),Qe),Oe)},xt=function($){var _e=$.children,Oe=_e===void 0?"Loading...":_e,Qe=$.innerProps,ut=i($,ve);return n.jsx("div",t({},C(e(e({},ut),{},{children:Oe,innerProps:Qe}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),Qe),Oe)},wt=function($){var _e=$.rect,Oe=$.offset,Qe=$.position;return{left:_e.left,position:Qe,top:Oe,width:_e.width,zIndex:1}},At=function($){var _e=$.appendTo,Oe=$.children,Qe=$.controlElement,ut=$.innerProps,nt=$.menuPlacement,Pt=$.menuPosition,Ht=d.useRef(null),xn=d.useRef(null),Bn=d.useState(mt(nt)),fr=r(Bn,2),Kn=fr[0],fi=fr[1],hi=d.useMemo(function(){return{setPortalPlacement:fi}},[]),mi=d.useState(null),pi=r(mi,2),_n=pi[0],Bi=pi[1],jr=d.useCallback(function(){if(Qe){var Ir=z(Qe),Tr=Pt==="fixed"?0:window.pageYOffset,fa=Ir[Kn]+Tr;(fa!==(_n==null?void 0:_n.offset)||Ir.left!==(_n==null?void 0:_n.rect.left)||Ir.width!==(_n==null?void 0:_n.rect.width))&&Bi({offset:fa,rect:Ir})}},[Qe,Pt,Kn,_n==null?void 0:_n.offset,_n==null?void 0:_n.rect.left,_n==null?void 0:_n.rect.width]);b.default(function(){jr()},[jr]);var pr=d.useCallback(function(){typeof xn.current=="function"&&(xn.current(),xn.current=null),Qe&&Ht.current&&(xn.current=v.autoUpdate(Qe,Ht.current,jr,{elementResize:"ResizeObserver"in window}))},[Qe,jr]);b.default(function(){pr()},[pr]);var gi=d.useCallback(function(Ir){Ht.current=Ir,pr()},[pr]);if(!_e&&Pt!=="fixed"||!_n)return null;var Yr=n.jsx("div",t({ref:gi},C(e(e({},$),{},{offset:_n.offset,position:Pt,rect:_n.rect}),"menuPortal",{"menu-portal":!0}),ut),Oe);return n.jsx(dt.Provider,{value:hi},_e?h.createPortal(Yr,_e):Yr)},vt=function($){var _e=$.isDisabled,Oe=$.isRtl;return{label:"container",direction:Oe?"rtl":void 0,pointerEvents:_e?"none":void 0,position:"relative"}},Et=function($){var _e=$.children,Oe=$.innerProps,Qe=$.isDisabled,ut=$.isRtl;return n.jsx("div",t({},C($,"container",{"--is-disabled":Qe,"--is-rtl":ut}),Oe),_e)},pt=function($,_e){var Oe=$.theme.spacing,Qe=$.isMulti,ut=$.hasValue,nt=$.selectProps.controlShouldRenderValue;return e({alignItems:"center",display:Qe&&ut&&nt?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},_e?{}:{padding:"".concat(Oe.baseUnit/2,"px ").concat(Oe.baseUnit*2,"px")})},ft=function($){var _e=$.children,Oe=$.innerProps,Qe=$.isMulti,ut=$.hasValue;return n.jsx("div",t({},C($,"valueContainer",{"value-container":!0,"value-container--is-multi":Qe,"value-container--has-value":ut}),Oe),_e)},St=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Z=function($){var _e=$.children,Oe=$.innerProps;return n.jsx("div",t({},C($,"indicatorsContainer",{indicators:!0}),Oe),_e)},Ue,ct=["size"],oe=["innerProps","isRtl","size"],Ee={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Ye=function($){var _e=$.size,Oe=i($,ct);return n.jsx("svg",t({height:_e,width:_e,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ee},Oe))},bt=function($){return n.jsx(Ye,t({size:20},$),n.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},yt=function($){return n.jsx(Ye,t({size:20},$),n.jsx("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Zt=function($,_e){var Oe=$.isFocused,Qe=$.theme,ut=Qe.spacing.baseUnit,nt=Qe.colors;return e({label:"indicatorContainer",display:"flex",transition:"color 150ms"},_e?{}:{color:Oe?nt.neutral60:nt.neutral20,padding:ut*2,":hover":{color:Oe?nt.neutral80:nt.neutral40}})},Qt=Zt,Ot=function($){var _e=$.children,Oe=$.innerProps;return n.jsx("div",t({},C($,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),Oe),_e||n.jsx(yt,null))},Kt=Zt,ae=function($){var _e=$.children,Oe=$.innerProps;return n.jsx("div",t({},C($,"clearIndicator",{indicator:!0,"clear-indicator":!0}),Oe),_e||n.jsx(bt,null))},we=function($,_e){var Oe=$.isDisabled,Qe=$.theme,ut=Qe.spacing.baseUnit,nt=Qe.colors;return e({label:"indicatorSeparator",alignSelf:"stretch",width:1},_e?{}:{backgroundColor:Oe?nt.neutral10:nt.neutral20,marginBottom:ut*2,marginTop:ut*2})},Me=function($){var _e=$.innerProps;return n.jsx("span",t({},_e,C($,"indicatorSeparator",{"indicator-separator":!0})))},Se=n.keyframes(Ue||(Ue=o([`
|
|
268
268
|
0%, 80%, 100% { opacity: 0; }
|