dealposbooks 1.0.8 → 1.0.9
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/3rdpartylicenses.txt +26 -26
- package/assets/scss/fonts/montserrat/Montserrat-Bold.woff2 +0 -0
- package/assets/scss/fonts/montserrat/Montserrat-Italic.woff2 +0 -0
- package/assets/scss/fonts/montserrat/Montserrat-Regular.woff2 +0 -0
- package/assets/scss/fonts/montserrat/Montserrat-SemiBold.woff2 +0 -0
- package/assets/scss/layouts/_layout.scss +6 -6
- package/assets/scss/layouts/_sidebar.scss +8 -6
- package/assets/scss/style.scss +20 -8
- package/assets/scss/variables/_variables.scss +12 -51
- package/{chunk-7X454BGN.js → chunk-25PFXJAK.js} +1 -1
- package/{chunk-4Z6KFX2O.js → chunk-2ODJIB2A.js} +2 -2
- package/chunk-2RWUYFYR.js +1 -0
- package/chunk-3GWDCNXX.js +397 -0
- package/{chunk-7RH6F4PN.js → chunk-4ANSU2AT.js} +3 -1
- package/{chunk-UZFJYFH2.js → chunk-52HZNWBM.js} +4 -2
- package/{chunk-2QCAOSMO.js → chunk-63UNI6LK.js} +1 -1
- package/chunk-7LG2CFYI.js +1 -0
- package/{chunk-33RD6RQS.js → chunk-AH4LZWJY.js} +1 -1
- package/chunk-AKBPKNCH.js +1 -0
- package/chunk-AOB6BRGQ.js +1 -0
- package/{chunk-YUFMXLRG.js → chunk-ATVC2UCR.js} +1 -1
- package/chunk-AWY6AD76.js +1 -0
- package/chunk-B4JAAGJX.js +1 -0
- package/chunk-BGKS3L73.js +246 -0
- package/{chunk-URKXDZJE.js → chunk-C66O26ZI.js} +1 -1
- package/chunk-C6Q5SG76.js +1 -0
- package/chunk-DOKYUX3G.js +1 -0
- package/{chunk-6TJIZZK6.js → chunk-E6EWXQXJ.js} +1 -1
- package/{chunk-EE4WG35V.js → chunk-E6QGADC5.js} +6 -2
- package/chunk-EN5MVYJQ.js +180 -0
- package/chunk-EP22HTZC.js +300 -0
- package/chunk-FJ7O4K2Y.js +1 -0
- package/chunk-FVXLQNAC.js +193 -0
- package/chunk-G52TDPSD.js +297 -0
- package/chunk-GCTIPWTU.js +1 -0
- package/chunk-GMTXOQ6X.js +1 -0
- package/chunk-GRTIJ77T.js +1 -0
- package/chunk-HG23WDL5.js +1660 -0
- package/chunk-I4HDCL3W.js +1 -0
- package/{chunk-MQJQRREL.js → chunk-I7MT7OUB.js} +1 -1
- package/chunk-ISXV3FIH.js +1 -0
- package/{chunk-QUR72LET.js → chunk-JFAO2CIB.js} +1 -1
- package/chunk-JQNCWTZN.js +1 -0
- package/{chunk-ONU5ICNZ.js → chunk-JT2WCR5Q.js} +1 -1
- package/chunk-JXNLXEJT.js +1 -0
- package/chunk-K36WQVFR.js +1 -0
- package/{chunk-U2S74ZLK.js → chunk-KFHCGO62.js} +1 -1
- package/chunk-LCATVZKP.js +141 -0
- package/chunk-LJMMN36O.js +1 -0
- package/{chunk-I72ECAQH.js → chunk-MNPBLC23.js} +1 -1
- package/chunk-NQ24E7JY.js +1 -0
- package/chunk-NTDTN5DF.js +1 -0
- package/{chunk-2XZW23PQ.js → chunk-O7OAT4UO.js} +1 -1
- package/chunk-OHVHLILJ.js +1 -0
- package/chunk-OJWZH7AB.js +301 -0
- package/{chunk-D5U6AOFB.js → chunk-PG4QL7N2.js} +1 -1
- package/{chunk-2LKTSMUI.js → chunk-PNAWRNGD.js} +7 -7
- package/chunk-QJ2XA575.js +1 -0
- package/chunk-RJYIKNTI.js +1 -0
- package/chunk-RR5AUWZO.js +1 -0
- package/chunk-RSHFIZV3.js +7 -0
- package/chunk-SQKLMC5H.js +231 -0
- package/chunk-T3ZCO6EC.js +1 -0
- package/chunk-T7R7C3RX.js +1 -0
- package/chunk-TJSPXPO6.js +59 -0
- package/chunk-TNXHYK2R.js +7 -0
- package/chunk-TTG6XQNP.js +1 -0
- package/chunk-UC2RR4WT.js +210 -0
- package/chunk-UOFRXQI7.js +1 -0
- package/{chunk-M4ZOPGSP.js → chunk-UVBFYB2X.js} +1 -1
- package/chunk-WCQQSWYQ.js +616 -0
- package/{chunk-ZT4NOONZ.js → chunk-WTRMIJHX.js} +1 -1
- package/chunk-Z4SGDPGH.js +821 -0
- package/chunk-ZNN2E36Y.js +1 -0
- package/index.html +3 -3
- package/main-F2OQVLJM.js +1 -0
- package/package.json +1 -1
- package/styles-GUJHQHWA.css +1 -0
- package/chunk-3ROVFYLI.js +0 -189
- package/chunk-3UAQZJAG.js +0 -180
- package/chunk-7KARVIIN.js +0 -1
- package/chunk-A3I2VQNX.js +0 -141
- package/chunk-A3MXO6MA.js +0 -1
- package/chunk-B5ZO2I4D.js +0 -2
- package/chunk-BP2JJ6HZ.js +0 -160
- package/chunk-BWO4PVAG.js +0 -301
- package/chunk-C4WUUVLC.js +0 -1
- package/chunk-CH2GYE5J.js +0 -1
- package/chunk-DF2QDC4T.js +0 -1
- package/chunk-DKWZOSVY.js +0 -59
- package/chunk-EEJWF26F.js +0 -1
- package/chunk-EQDQRRRY.js +0 -1
- package/chunk-F7FJPDUV.js +0 -1
- package/chunk-FDDNZH4H.js +0 -1633
- package/chunk-FYNIFRG5.js +0 -1
- package/chunk-HKMI4ZYY.js +0 -393
- package/chunk-HU6SF3HD.js +0 -1
- package/chunk-IWUDRSTJ.js +0 -235
- package/chunk-KJWN47PL.js +0 -1
- package/chunk-MVGPOIFT.js +0 -1
- package/chunk-OHEAUNEW.js +0 -1
- package/chunk-P4OJNULI.js +0 -1
- package/chunk-PCJXJ6O4.js +0 -370
- package/chunk-PFXPLNMA.js +0 -1
- package/chunk-PQTHPF23.js +0 -7
- package/chunk-PV6INEW2.js +0 -1
- package/chunk-QPA73UD5.js +0 -616
- package/chunk-RFZOXUTS.js +0 -1
- package/chunk-RIUEIX64.js +0 -1
- package/chunk-UPDO63XT.js +0 -1
- package/chunk-UQ3SWGEA.js +0 -1
- package/chunk-WZKSD7XN.js +0 -284
- package/chunk-X2CQD76I.js +0 -208
- package/chunk-YX7446ZM.js +0 -1
- package/chunk-Z53S4NM2.js +0 -736
- package/main-U76NYT5G.js +0 -1
- package/styles-OZO2XDGZ.css +0 -1
package/chunk-QPA73UD5.js
DELETED
|
@@ -1,616 +0,0 @@
|
|
|
1
|
-
import{a as Ui,b as ji}from"./chunk-YUFMXLRG.js";import{a as In}from"./chunk-2QCAOSMO.js";import{a as Gi}from"./chunk-7KARVIIN.js";import{b as ma,c as da}from"./chunk-HKMI4ZYY.js";import{a as ua}from"./chunk-D5U6AOFB.js";import{a as De}from"./chunk-G4XX7EU2.js";import{a as On,b as Ji,c as $i}from"./chunk-WZKSD7XN.js";import{a as Ko}from"./chunk-DF2QDC4T.js";import{a as oi,b as ai}from"./chunk-EE4WG35V.js";import{a as pa,b as ha}from"./chunk-URKXDZJE.js";import"./chunk-M4ZOPGSP.js";import"./chunk-U2S74ZLK.js";import{a as $e}from"./chunk-OHEAUNEW.js";import{a as Kn,b as Wn}from"./chunk-KJWN47PL.js";import{b as Bi,c as zi,d as Tn,e as Fn,f as Vt,h as la,i as ca,j as At}from"./chunk-FDDNZH4H.js";import{e as Zo,i as ii,j as ni}from"./chunk-PCJXJ6O4.js";import"./chunk-7RH6F4PN.js";import"./chunk-DKWZOSVY.js";import{a as kn,b as Dt}from"./chunk-I72ECAQH.js";import{a as Qo,b as Yo,c as ra,d as sa,e as Mi,f as Ri,g as Et}from"./chunk-3UAQZJAG.js";import{a as Ai,e as xt,f as ti}from"./chunk-Z53S4NM2.js";import{a as Li,b as ea,c as ta,d as ia,e as na,f as oa,g as aa}from"./chunk-YX7446ZM.js";import{c as wn,e as $o,h as Nt,i as Gn,m as Vi,n as qo,q as En,s as Pn,t as Xt,u as ei,v as Xo}from"./chunk-2LKTSMUI.js";import{B as Jn,Ca as Ni,G as $n,Ga as Di,Ha as tt,I as Wo,Ia as It,Pa as Yt,Y as xn,a as jo,b as Si,c as et,e as wi,f as Ci,g as Ot,h as M,ja as Ho,l as xi,m as Ei,n as Pi,o as ki,p as _n,q as Jo,t as Ti,w as jn,x as Zt,ya as Yi,z as Qt}from"./chunk-3ROVFYLI.js";import{a as Ii,d as Go}from"./chunk-P4OJNULI.js";import{c as Cn,d as Fi,f as mi,h as Oi,i as zn,k as Un}from"./chunk-S35HUXPS.js";import{b as yn,e as zo,k as Uo,m as qt,p as bn,w as Sn}from"./chunk-7X454BGN.js";import{d as Lo,k as Ct,l as Mo,m as Ro,n as Xe,o as bi,p as Wt,q as Bo,r as vn,s as Ft,t as Be,v as Ht}from"./chunk-C4WUUVLC.js";import{$b as N,Ab as dn,Ac as ke,Bc as yi,Cb as wt,Cc as No,Da as lt,E as cn,Ea as mn,Eb as vi,Ec as Do,Fb as A,Hc as Vo,Ia as xo,J as fi,Jc as Me,Kc as Ke,La as Ve,Lc as Qi,Mb as Fo,Mc as ce,Nb as ge,Ob as y,Pb as Kt,Qb as Oo,Rb as vt,Sb as ct,Ub as Re,Vb as Tt,Vc as bt,Wb as Bn,Wc as _i,X as _o,Xb as yt,Xc as at,Yb as _t,Z as Zi,Zb as p,Zc as fn,_b as m,_c as Ao,aa as Fe,ac as de,bc as pe,c as Rn,cc as Ye,dc as te,fa as bo,fb as Eo,g as Bt,ga as ft,gb as Po,ha as $t,hc as G,ic as k,jc as pn,kb as f,kc as hn,la as un,lb as zt,lc as Je,ma as K,mc as ut,nc as ue,o as gi,oc as me,pc as Io,qc as x,rb as ko,rc as oe,sb as To,sc as ot,t as Pt,ta as So,tc as gn,ua as R,va as B,wa as wo,xa as Qe,yb as Pe,yc as Ge,za as Co,zb as Gt,zc as Oe}from"./chunk-PQTHPF23.js";import{a as fe,b as Te,d as yo,e as ui}from"./chunk-EQDQRRRY.js";var ya=yo((en,Zn)=>{var va,Xi;va=en,Xi=()=>(()=>{var n={d:(s,v)=>{for(var P in v)n.o(v,P)&&!n.o(s,P)&&Object.defineProperty(s,P,{enumerable:!0,get:v[P]})},o:(s,v)=>Object.prototype.hasOwnProperty.call(s,v)},h={};n.d(h,{default:()=>qi});var i={allowedTagList:["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","input","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"]};Object.freeze(i.allowedTagList),Object.defineProperty(i,"allowedTagList",{configurable:!1,writable:!1}),i.fromCharCodeKeyCode={0:"LaunchCalculator",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",91:"OS",92:"OSRight",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",173:"-",182:"MyComputer",183:"MyCalculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta",225:"AltGraph"},Object.freeze(i.fromCharCodeKeyCode),Object.defineProperty(i,"fromCharCodeKeyCode",{configurable:!1,writable:!1}),i.keyName={Unidentified:"Unidentified",AndroidDefault:"AndroidDefault",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",OSLeft:"OS",OSRight:"OS",Command:"OS",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",LeftArrow:"ArrowLeft",UpArrow:"ArrowUp",RightArrow:"ArrowRight",DownArrow:"ArrowDown",End:"End",Home:"Home",PageUp:"PageUp",PageDown:"PageDown",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftParenthesis:"(",RightParenthesis:")",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",NumpadDot:".",NumpadDotAlt:",",NumpadMultiply:"*",NumpadPlus:"+",NumpadMinus:"-",NumpadSubtract:"-",NumpadSlash:"/",NumpadDotObsoleteBrowsers:"Decimal",NumpadMultiplyObsoleteBrowsers:"Multiply",NumpadPlusObsoleteBrowsers:"Add",NumpadMinusObsoleteBrowsers:"Subtract",NumpadSlashObsoleteBrowsers:"Divide",_allFnKeys:["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"],_someNonPrintableKeys:["Tab","Enter","Shift","ShiftLeft","ShiftRight","Control","ControlLeft","ControlRight","Alt","AltLeft","AltRight","Pause","CapsLock","Escape"],_directionKeys:["PageUp","PageDown","End","Home","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"]},Object.freeze(i.keyName._allFnKeys),Object.freeze(i.keyName._someNonPrintableKeys),Object.freeze(i.keyName._directionKeys),Object.freeze(i.keyName),Object.defineProperty(i,"keyName",{configurable:!1,writable:!1}),Object.freeze(i);let l=i;function c(s){return function(v){if(Array.isArray(v))return ve(v)}(s)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(s)||L(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _(){return _=Object.assign?Object.assign.bind():function(s){for(var v=1;v<arguments.length;v++){var P=arguments[v];for(var F in P)Object.prototype.hasOwnProperty.call(P,F)&&(s[F]=P[F])}return s},_.apply(this,arguments)}function V(s,v){return function(P){if(Array.isArray(P))return P}(s)||function(P,F){var e=P==null?null:typeof Symbol<"u"&&P[Symbol.iterator]||P["@@iterator"];if(e!=null){var t,r,o,u,g=[],S=!0,E=!1;try{if(o=(e=e.call(P)).next,F===0){if(Object(e)!==e)return;S=!1}else for(;!(S=(t=o.call(e)).done)&&(g.push(t.value),g.length!==F);S=!0);}catch(O){E=!0,r=O}finally{try{if(!S&&e.return!=null&&(u=e.return(),Object(u)!==u))return}finally{if(E)throw r}}return g}}(s,v)||L(s,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function L(s,v){if(s){if(typeof s=="string")return ve(s,v);var P=Object.prototype.toString.call(s).slice(8,-1);return P==="Object"&&s.constructor&&(P=s.constructor.name),P==="Map"||P==="Set"?Array.from(s):P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P)?ve(s,v):void 0}}function ve(s,v){(v==null||v>s.length)&&(v=s.length);for(var P=0,F=new Array(v);P<v;P++)F[P]=s[P];return F}function Se(s){return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Se(s)}function dt(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(Se(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(Se(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),Se(t)==="symbol"?t:String(t)),F)}var e,t}var a=function(){function s(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,s)}var v,P,F;return v=s,F=[{key:"isNull",value:function(e){return e===null}},{key:"isUndefined",value:function(e){return e===void 0}},{key:"isUndefinedOrNullOrEmpty",value:function(e){return e==null||e===""}},{key:"isString",value:function(e){return typeof e=="string"||e instanceof String}},{key:"isEmptyString",value:function(e){return e===""}},{key:"isBoolean",value:function(e){return typeof e=="boolean"}},{key:"isTrueOrFalseString",value:function(e){var t=String(e).toLowerCase();return t==="true"||t==="false"}},{key:"isObject",value:function(e){return Se(e)==="object"&&e!==null&&!Array.isArray(e)}},{key:"isEmptyObj",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}},{key:"isNumberStrict",value:function(e){return typeof e=="number"}},{key:"isNumber",value:function(e){return!this.isArray(e)&&!isNaN(parseFloat(e))&&isFinite(e)}},{key:"isDigit",value:function(e){return/\d/.test(e)}},{key:"isNumberOrArabic",value:function(e){var t=this.arabicToLatinNumbers(e,!1,!0,!0);return this.isNumber(t)}},{key:"isInt",value:function(e){return typeof e=="number"&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}},{key:"isFunction",value:function(e){return typeof e=="function"}},{key:"contains",value:function(e,t){return!(!this.isString(e)||!this.isString(t)||e===""||t==="")&&e.indexOf(t)!==-1}},{key:"isInArray",value:function(e,t){return!(!this.isArray(t)||t===[]||this.isUndefined(e))&&t.indexOf(e)!==-1}},{key:"isArray",value:function(e){if(Object.prototype.toString.call([])==="[object Array]")return Array.isArray(e)||Se(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]";throw new Error("toString message changed for Object Array")}},{key:"isElement",value:function(e){return typeof Element<"u"&&e instanceof Element}},{key:"isInputElement",value:function(e){return this.isElement(e)&&e.tagName.toLowerCase()==="input"}},{key:"decimalPlaces",value:function(e){var t=V(e.split("."),2)[1];return this.isUndefined(t)?0:t.length}},{key:"indexFirstNonZeroDecimalPlace",value:function(e){var t=V(String(Math.abs(e)).split("."),2)[1];if(this.isUndefined(t))return 0;var r=t.lastIndexOf("0");return r===-1?r=0:r+=2,r}},{key:"keyCodeNumber",value:function(e){return e.which===void 0?e.keyCode:e.which}},{key:"character",value:function(e){var t;if(e.key==="Unidentified"||e.key===void 0||this.isSeleniumBot()){var r=this.keyCodeNumber(e);if(r===229)return l.keyName.AndroidDefault;var o=l.fromCharCodeKeyCode[r];t=s.isUndefinedOrNullOrEmpty(o)?String.fromCharCode(r):o}else switch(e.key){case"Add":t=l.keyName.NumpadPlus;break;case"Apps":t=l.keyName.ContextMenu;break;case"Crsel":t=l.keyName.CrSel;break;case"Decimal":t=e.char?e.char:l.keyName.NumpadDot;break;case"Del":t=l.keyName.Delete;break;case"Divide":t=l.keyName.NumpadSlash;break;case"Down":t=l.keyName.DownArrow;break;case"Esc":t=l.keyName.Esc;break;case"Exsel":t=l.keyName.ExSel;break;case"Left":t=l.keyName.LeftArrow;break;case"Meta":case"Super":t=l.keyName.OSLeft;break;case"Multiply":t=l.keyName.NumpadMultiply;break;case"Right":t=l.keyName.RightArrow;break;case"Spacebar":t=l.keyName.Space;break;case"Subtract":t=l.keyName.NumpadMinus;break;case"Up":t=l.keyName.UpArrow;break;default:t=e.key}return t}},{key:"browser",value:function(){var e,t=navigator.userAgent,r=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(r[1])?{name:"ie",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:r[1]==="Chrome"&&(e=t.match(/\b(OPR|Edge)\/(\d+)/))!==null?{name:e[1].replace("OPR","opera"),version:e[2]}:(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!==null&&r.splice(1,1,e[1]),{name:r[0].toLowerCase(),version:r[1]})}},{key:"isSeleniumBot",value:function(){return window.navigator.webdriver===!0}},{key:"isNegative",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-",r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return e===t||e!==""&&(s.isNumber(e)?e<0:r?this.contains(e,t):this.isNegativeStrict(e,t))}},{key:"isNegativeStrict",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-";return e.charAt(0)===t}},{key:"isNegativeWithBrackets",value:function(e,t,r){return e.charAt(0)===t&&this.contains(e,r)}},{key:"isZeroOrHasNoValue",value:function(e){return!/[1-9]/g.test(e)}},{key:"setRawNegativeSign",value:function(e){return this.isNegativeStrict(e,"-")?e:"-".concat(e)}},{key:"replaceCharAt",value:function(e,t,r){return"".concat(e.substr(0,t)).concat(r).concat(e.substr(t+r.length))}},{key:"clampToRangeLimits",value:function(e,t){return Math.max(t.minimumValue,Math.min(t.maximumValue,e))}},{key:"countNumberCharactersOnTheCaretLeftSide",value:function(e,t,r){for(var o=new RegExp("[0-9".concat(r,"-]")),u=0,g=0;g<t;g++)o.test(e[g])&&u++;return u}},{key:"findCaretPositionInFormattedNumber",value:function(e,t,r,o){var u,g=r.length,S=e.length,E=0;for(u=0;u<g&&E<S&&E<t;u++)(e[E]===r[u]||e[E]==="."&&r[u]===o)&&E++;return u}},{key:"countCharInText",value:function(e,t){for(var r=0,o=0;o<t.length;o++)t[o]===e&&r++;return r}},{key:"convertCharacterCountToIndexPosition",value:function(e){return Math.max(e,e-1)}},{key:"getElementSelection",value:function(e){var t,r={};try{t=this.isUndefined(e.selectionStart)}catch{t=!1}try{if(t){var o=window.getSelection().getRangeAt(0);r.start=o.startOffset,r.end=o.endOffset,r.length=r.end-r.start}else r.start=e.selectionStart,r.end=e.selectionEnd,r.length=r.end-r.start}catch{r.start=0,r.end=0,r.length=0}return r}},{key:"setElementSelection",value:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(this.isUndefinedOrNullOrEmpty(r)&&(r=t),this.isInputElement(e))e.setSelectionRange(t,r);else if(!s.isNull(e.firstChild)){var o=document.createRange();o.setStart(e.firstChild,t),o.setEnd(e.firstChild,r);var u=window.getSelection();u.removeAllRanges(),u.addRange(o)}}},{key:"throwError",value:function(e){throw new Error(e)}},{key:"warning",value:function(e){(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&console.warn("Warning: ".concat(e))}},{key:"isWheelEvent",value:function(e){return e instanceof WheelEvent}},{key:"isWheelUpEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY<0}},{key:"isWheelDownEvent",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)||this.throwError("The event passed as a parameter is not a valid wheel event, '".concat(e.type,"' given.")),e.deltaY>0}},{key:"isWheelEventWithZeroDeltaY",value:function(e){return this.isWheelEvent(e)&&!this.isUndefinedOrNullOrEmpty(e.deltaY)&&e.deltaY===0}},{key:"forceDecimalPlaces",value:function(e,t){var r=V(String(e).split("."),2),o=r[0],u=r[1];return u?"".concat(o,".").concat(u.substr(0,t)):e}},{key:"roundToNearest",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;return e===0?0:(t===0&&this.throwError("The `stepPlace` used to round is equal to `0`. This value must not be equal to zero."),Math.round(e/t)*t)}},{key:"modifyAndRoundToNearestAuto",value:function(e,t,r){e=Number(this.forceDecimalPlaces(e,r));var o=Math.abs(e);if(o>=0&&o<1){var u,g=Math.pow(10,-r);if(e===0)return t?g:-g;var S,E=r,O=this.indexFirstNonZeroDecimalPlace(e);return u=O>=E-1?g:Math.pow(10,-(O+1)),S=t?e+u:e-u,this.roundToNearest(S,u)}e=parseInt(e,10);var d,T=Math.abs(e).toString().length;switch(T){case 1:d=0;break;case 2:case 3:d=1;break;case 4:case 5:d=2;break;default:d=T-3}var D,$=Math.pow(10,d);return(D=t?e+$:e-$)<=10&&D>=-10?D:this.roundToNearest(D,$)}},{key:"addAndRoundToNearestAuto",value:function(e,t){return this.modifyAndRoundToNearestAuto(e,!0,t)}},{key:"subtractAndRoundToNearestAuto",value:function(e,t){return this.modifyAndRoundToNearestAuto(e,!1,t)}},{key:"arabicToLatinNumbers",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(this.isNull(e))return e;var u=e.toString();if(u==="")return e;if(u.match(/[٠١٢٣٤٥٦٧٨٩۴۵۶]/g)===null)return t&&(u=Number(u)),u;r&&(u=u.replace(/٫/,".")),o&&(u=u.replace(/٬/g,"")),u=u.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(S){return S.charCodeAt(0)-1632}).replace(/[۰۱۲۳۴۵۶۷۸۹]/g,function(S){return S.charCodeAt(0)-1776});var g=Number(u);return isNaN(g)?g:(t&&(u=g),u)}},{key:"triggerEvent",value:function(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],g=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];window.CustomEvent?t=new CustomEvent(e,{detail:o,bubbles:u,cancelable:g}):(t=document.createEvent("CustomEvent")).initCustomEvent(e,u,g,{detail:o}),r.dispatchEvent(t)}},{key:"parseStr",value:function(e){var t,r,o,u,g={};if(e===0&&1/e<0&&(e="-0"),e=e.toString(),this.isNegativeStrict(e,"-")?(e=e.slice(1),g.s=-1):g.s=1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),t<0&&(t=e.length),(r=e.search(/[1-9]/i)===-1?e.length:e.search(/[1-9]/i))===(o=e.length))g.e=0,g.c=[0];else{for(u=o-1;e.charAt(u)==="0";u-=1)o-=1;for(o-=1,g.e=t-r-1,g.c=[],t=0;r<=o;r+=1)g.c[t]=+e.charAt(r),t+=1}return g}},{key:"testMinMax",value:function(e,t){var r=t.c,o=e.c,u=t.s,g=e.s,S=t.e,E=e.e;if(!r[0]||!o[0])return r[0]?u:o[0]?-g:0;if(u!==g)return u;var O=u<0;if(S!==E)return S>E^O?1:-1;for(u=-1,g=(S=r.length)<(E=o.length)?S:E,u+=1;u<g;u+=1)if(r[u]!==o[u])return r[u]>o[u]^O?1:-1;return S===E?0:S>E^O?1:-1}},{key:"randomString",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5;return Math.random().toString(36).substr(2,e)}},{key:"domElement",value:function(e){var t;return t=s.isString(e)?document.querySelector(e):e,t}},{key:"getElementValue",value:function(e){return e.tagName.toLowerCase()==="input"?e.value:this.text(e)}},{key:"setElementValue",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.tagName.toLowerCase()==="input"?e.value=t:e.textContent=t}},{key:"setInvalidState",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Invalid";(t===""||this.isNull(t))&&this.throwError("Cannot set the invalid state with an empty message."),e.setCustomValidity(t)}},{key:"setValidState",value:function(e){e.setCustomValidity("")}},{key:"cloneObject",value:function(e){return _({},e)}},{key:"camelize",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"-",r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],o=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];if(this.isNull(e))return null;r&&(e=e.replace(/^data-/,""));var u=e.split(t).map(function(g){return"".concat(g.charAt(0).toUpperCase()).concat(g.slice(1))});return u=u.join(""),o&&(u="".concat(u.charAt(0).toLowerCase()).concat(u.slice(1))),u}},{key:"text",value:function(e){var t=e.nodeType;return t===Node.ELEMENT_NODE||t===Node.DOCUMENT_NODE||t===Node.DOCUMENT_FRAGMENT_NODE?e.textContent:t===Node.TEXT_NODE?e.nodeValue:""}},{key:"setText",value:function(e,t){var r=e.nodeType;r!==Node.ELEMENT_NODE&&r!==Node.DOCUMENT_NODE&&r!==Node.DOCUMENT_FRAGMENT_NODE||(e.textContent=t)}},{key:"filterOut",value:function(e,t){var r=this;return e.filter(function(o){return!r.isInArray(o,t)})}},{key:"trimPaddedZerosFromDecimalPlaces",value:function(e){if((e=String(e))==="")return"";var t=V(e.split("."),2),r=t[0],o=t[1];if(this.isUndefinedOrNullOrEmpty(o))return r;var u=o.replace(/0+$/g,"");return u===""?r:"".concat(r,".").concat(u)}},{key:"getHoveredElement",value:function(){var e=c(document.querySelectorAll(":hover"));return e[e.length-1]}},{key:"arrayTrim",value:function(e,t){var r=e.length;return r===0||t>r?e:t<0?[]:(e.length=parseInt(t,10),e)}},{key:"arrayUnique",value:function(){var e;return c(new Set((e=[]).concat.apply(e,arguments)))}},{key:"mergeMaps",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Map(t.reduce(function(o,u){return o.concat(c(u))},[]))}},{key:"objectKeyLookup",value:function(e,t){var r=Object.entries(e).find(function(u){return u[1]===t}),o=null;return r!==void 0&&(o=r[0]),o}},{key:"insertAt",value:function(e,t,r){if(r>(e=String(e)).length)throw new Error("The given index is out of the string range.");if(t.length!==1)throw new Error("The given string `char` should be only one character long.");return e===""&&r===0?t:"".concat(e.slice(0,r)).concat(t).concat(e.slice(r))}},{key:"scientificToDecimal",value:function(e){var t=Number(e);if(isNaN(t))return NaN;if(e=String(e),!this.contains(e,"e")&&!this.contains(e,"E"))return e;var r=V(e.split(/e/i),2),o=r[0],u=r[1],g=o<0;g&&(o=o.replace("-",""));var S=+u<0;S&&(u=u.replace("-",""));var E,O=V(o.split(/\./),2),d=O[0],T=O[1];return S?(E=d.length>u?this.insertAt(d,".",d.length-u):"0.".concat("0".repeat(u-d.length)).concat(d),E="".concat(E).concat(T||"")):T?(o="".concat(d).concat(T),E=u<T.length?this.insertAt(o,".",+u+d.length):"".concat(o).concat("0".repeat(u-T.length))):(o=o.replace(".",""),E="".concat(o).concat("0".repeat(Number(u)))),g&&(E="-".concat(E)),E}}],(P=null)&&dt(v.prototype,P),F&&dt(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function pt(s){return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},pt(s)}function Ut(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(pt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(pt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),pt(t)==="symbol"?t:String(t)),F)}var e,t}var jt=function(){function s(e){if(function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,s),e===null)throw new Error("Invalid AST")}var v,P,F;return v=s,(P=[{key:"evaluate",value:function(e){if(e==null)throw new Error("Invalid AST sub-tree");if(e.type==="number")return e.value;if(e.type==="unaryMinus")return-this.evaluate(e.left);var t=this.evaluate(e.left),r=this.evaluate(e.right);switch(e.type){case"op_+":return Number(t)+Number(r);case"op_-":return t-r;case"op_*":return t*r;case"op_/":return t/r;default:throw new Error("Invalid operator '".concat(e.type,"'"))}}}])&&Ut(v.prototype,P),F&&Ut(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Lt(s){return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Lt(s)}function on(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(Lt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(Lt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),Lt(t)==="symbol"?t:String(t)),F)}var e,t}var ht=function(){function s(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,s)}var v,P,F;return v=s,F=[{key:"createNode",value:function(e,t,r){var o=new s;return o.type=e,o.left=t,o.right=r,o}},{key:"createUnaryNode",value:function(e){var t=new s;return t.type="unaryMinus",t.left=e,t.right=null,t}},{key:"createLeaf",value:function(e){var t=new s;return t.type="number",t.value=e,t}}],(P=null)&&on(v.prototype,P),F&&on(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Jt(s){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Jt(s)}function pi(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(Jt(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(Jt(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),Jt(t)==="symbol"?t:String(t)),F)}var e,t}function kt(s,v,P){return v&&pi(s.prototype,v),P&&pi(s,P),Object.defineProperty(s,"prototype",{writable:!1}),s}var ye=kt(function s(v,P,F){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,s),this.type=v,this.value=P,this.symbol=F});function w(s){return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},w(s)}function C(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(w(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(w(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),w(t)==="symbol"?t:String(t)),F)}var e,t}var I=function(){function s(e){(function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")})(this,s),this.text=e,this.textLength=e.length,this.index=0,this.token=new ye("Error",0,0)}var v,P,F;return v=s,P=[{key:"_skipSpaces",value:function(){for(;this.text[this.index]===" "&&this.index<=this.textLength;)this.index++}},{key:"getIndex",value:function(){return this.index}},{key:"getNextToken",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:".";if(this._skipSpaces(),this.textLength===this.index)return this.token.type="EOT",this.token;if(a.isDigit(this.text[this.index]))return this.token.type="num",this.token.value=this._getNumber(e),this.token;switch(this.token.type="Error",this.text[this.index]){case"+":this.token.type="+";break;case"-":this.token.type="-";break;case"*":this.token.type="*";break;case"/":this.token.type="/";break;case"(":this.token.type="(";break;case")":this.token.type=")"}if(this.token.type==="Error")throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(this.token.index,"' in the token function"));return this.token.symbol=this.text[this.index],this.index++,this.token}},{key:"_getNumber",value:function(e){this._skipSpaces();for(var t=this.index;this.index<=this.textLength&&a.isDigit(this.text[this.index]);)this.index++;for(this.text[this.index]===e&&this.index++;this.index<=this.textLength&&a.isDigit(this.text[this.index]);)this.index++;if(this.index===t)throw new Error("No number has been found while it was expected");return this.text.substring(t,this.index).replace(e,".")}}],P&&C(v.prototype,P),F&&C(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function z(s){return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},z(s)}function U(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,(e=F.key,t=void 0,t=function(r,o){if(z(r)!=="object"||r===null)return r;var u=r[Symbol.toPrimitive];if(u!==void 0){var g=u.call(r,o||"default");if(z(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}(e,"string"),z(t)==="symbol"?t:String(t)),F)}var e,t}var Y=function(){function s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".";return function(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,s),this.text=e,this.decimalCharacter=t,this.lexer=new I(e),this.token=this.lexer.getNextToken(this.decimalCharacter),this._exp()}var v,P,F;return v=s,(P=[{key:"_exp",value:function(){var e=this._term(),t=this._moreExp();return ht.createNode("op_+",e,t)}},{key:"_moreExp",value:function(){var e,t;switch(this.token.type){case"+":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),t=this._moreExp(),ht.createNode("op_+",t,e);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._term(),t=this._moreExp(),ht.createNode("op_-",t,e)}return ht.createLeaf(0)}},{key:"_term",value:function(){var e=this._factor(),t=this._moreTerms();return ht.createNode("op_*",e,t)}},{key:"_moreTerms",value:function(){var e,t;switch(this.token.type){case"*":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),t=this._moreTerms(),ht.createNode("op_*",t,e);case"/":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._factor(),t=this._moreTerms(),ht.createNode("op_/",t,e)}return ht.createLeaf(1)}},{key:"_factor",value:function(){var e,t,r;switch(this.token.type){case"num":return r=this.token.value,this.token=this.lexer.getNextToken(this.decimalCharacter),ht.createLeaf(r);case"-":return this.token=this.lexer.getNextToken(this.decimalCharacter),t=this._factor(),ht.createUnaryNode(t);case"(":return this.token=this.lexer.getNextToken(this.decimalCharacter),e=this._exp(),this._match(")"),e;default:throw new Error("Unexpected token '".concat(this.token.symbol,"' with type '").concat(this.token.type,"' at position '").concat(this.token.index,"' in the factor function"))}}},{key:"_match",value:function(e){var t=this.lexer.getIndex()-1;if(this.text[t]!==e)throw new Error("Unexpected token '".concat(this.token.symbol,"' at position '").concat(t,"' in the match function"));this.token=this.lexer.getNextToken(this.decimalCharacter)}}])&&U(v.prototype,P),F&&U(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();function Ee(s){return function(v){if(Array.isArray(v))return q(v)}(s)||function(v){if(typeof Symbol<"u"&&v[Symbol.iterator]!=null||v["@@iterator"]!=null)return Array.from(v)}(s)||it(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function X(s,v){return function(P){if(Array.isArray(P))return P}(s)||function(P,F){var e=P==null?null:typeof Symbol<"u"&&P[Symbol.iterator]||P["@@iterator"];if(e!=null){var t,r,o,u,g=[],S=!0,E=!1;try{if(o=(e=e.call(P)).next,F===0){if(Object(e)!==e)return;S=!1}else for(;!(S=(t=o.call(e)).done)&&(g.push(t.value),g.length!==F);S=!0);}catch(O){E=!0,r=O}finally{try{if(!S&&e.return!=null&&(u=e.return(),Object(u)!==u))return}finally{if(E)throw r}}return g}}(s,v)||it(s,v)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function it(s,v){if(s){if(typeof s=="string")return q(s,v);var P=Object.prototype.toString.call(s).slice(8,-1);return P==="Object"&&s.constructor&&(P=s.constructor.name),P==="Map"||P==="Set"?Array.from(s):P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P)?q(s,v):void 0}}function q(s,v){(v==null||v>s.length)&&(v=s.length);for(var P=0,F=new Array(v);P<v;P++)F[P]=s[P];return F}function re(){return re=Object.assign?Object.assign.bind():function(s){for(var v=1;v<arguments.length;v++){var P=arguments[v];for(var F in P)Object.prototype.hasOwnProperty.call(P,F)&&(s[F]=P[F])}return s},re.apply(this,arguments)}function J(s){return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},J(s)}function ze(s,v){for(var P=0;P<v.length;P++){var F=v[P];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(s,ie(F.key),F)}}function H(s,v,P){return(v=ie(v))in s?Object.defineProperty(s,v,{value:P,enumerable:!0,configurable:!0,writable:!0}):s[v]=P,s}function ie(s){var v=function(P,F){if(J(P)!=="object"||P===null)return P;var e=P[Symbol.toPrimitive];if(e!==void 0){var t=e.call(P,F||"default");if(J(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(P)}(s,"string");return J(v)==="symbol"?v:String(v)}var j,b=function(){function s(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;(function(d,T){if(!(d instanceof T))throw new TypeError("Cannot call a class as a function")})(this,s);var u=s._setArgumentsValues(t,r,o),g=u.domElement,S=u.initialValue,E=u.userOptions;if(this.domElement=g,this.defaultRawValue="",this._setSettings(E,!1),this._checkElement(),this.savedCancellableValue=null,this.historyTable=[],this.historyTableIndex=-1,this.onGoingRedo=!1,this.parentForm=this._getParentForm(),!this.runOnce&&this.settings.formatOnPageLoad)this._formatDefaultValueOnPageLoad(S);else{var O;if(a.isNull(S))switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.min:O=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:O=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:O="0";break;case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:O="";break;case s.options.emptyInputBehavior.null:O=null;break;default:O=this.settings.emptyInputBehavior}else O=S;this._setElementAndRawValue(O)}this.runOnce=!0,this.hasEventListeners=!1,(this.isInputElement||this.isContentEditable)&&(this.settings.noEventListeners||this._createEventListeners(),this._setWritePermissions(!0)),this._saveInitialValues(S),this.storageNamePrefix="AUTO_",this._setPersistentStorageName(),this.validState=!0,this.isFocused=!1,this.isWheelEvent=!1,this.isDropEvent=!1,this.isEditing=!1,this.rawValueOnFocus=void 0,this.internalModification=!1,this.attributeToWatch=this._getAttributeToWatch(),this.getterSetter=Object.getOwnPropertyDescriptor(this.domElement.__proto__,this.attributeToWatch),this._addWatcher(),this.settings.createLocalList&&this._createLocalList(),this.constructor._addToGlobalList(this),this.global={set:function(d){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.autoNumericLocalList.forEach(function(D){D.set(d,T)})},setUnformatted:function(d){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;e.autoNumericLocalList.forEach(function(D){D.setUnformatted(d,T)})},get:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.get())}),e._executeCallback(T,d),T},getNumericString:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getNumericString())}),e._executeCallback(T,d),T},getFormatted:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getFormatted())}),e._executeCallback(T,d),T},getNumber:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getNumber())}),e._executeCallback(T,d),T},getLocalized:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,T=[];return e.autoNumericLocalList.forEach(function(D){T.push(D.getLocalized())}),e._executeCallback(T,d),T},reformat:function(){e.autoNumericLocalList.forEach(function(d){d.reformat()})},unformat:function(){e.autoNumericLocalList.forEach(function(d){d.unformat()})},unformatLocalized:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;e.autoNumericLocalList.forEach(function(T){T.unformatLocalized(d)})},update:function(){for(var d=arguments.length,T=new Array(d),D=0;D<d;D++)T[D]=arguments[D];e.autoNumericLocalList.forEach(function($){$.update.apply($,T)})},isPristine:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],T=!0;return e.autoNumericLocalList.forEach(function(D){T&&!D.isPristine(d)&&(T=!1)}),T},clear:function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];e.autoNumericLocalList.forEach(function(T){T.clear(d)})},remove:function(){e.autoNumericLocalList.forEach(function(d){d.remove()})},wipe:function(){e.autoNumericLocalList.forEach(function(d){d.wipe()})},nuke:function(){e.autoNumericLocalList.forEach(function(d){d.nuke()})},has:function(d){return d instanceof s?e.autoNumericLocalList.has(d.node()):e.autoNumericLocalList.has(d)},addObject:function(d){var T,D;d instanceof s?(T=d.node(),D=d):(T=d,D=s.getAutoNumericElement(T)),e._hasLocalList()||e._createLocalList();var $,W=D._getLocalList();W.size===0&&(D._createLocalList(),W=D._getLocalList()),W instanceof Map?$=a.mergeMaps(e._getLocalList(),W):(e._addToLocalList(T,D),$=e._getLocalList()),$.forEach(function(ee){ee._setLocalList($)})},removeObject:function(d){var T,D,$=arguments.length>1&&arguments[1]!==void 0&&arguments[1];d instanceof s?(T=d.node(),D=d):(T=d,D=s.getAutoNumericElement(T));var W=e.autoNumericLocalList;e.autoNumericLocalList.delete(T),W.forEach(function(ee){ee._setLocalList(e.autoNumericLocalList)}),$||T!==e.node()?D._createLocalList():D._setLocalList(new Map)},empty:function(){var d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];e.autoNumericLocalList.forEach(function(T){d?T._createLocalList():T._setLocalList(new Map)})},elements:function(){var d=[];return e.autoNumericLocalList.forEach(function(T){d.push(T.node())}),d},getList:function(){return e.autoNumericLocalList},size:function(){return e.autoNumericLocalList.size}},this.options={reset:function(){return e.settings={rawValue:e.defaultRawValue},e.update(s.defaultSettings),e},allowDecimalPadding:function(d){return e.update({allowDecimalPadding:d}),e},alwaysAllowDecimalCharacter:function(d){return e.update({alwaysAllowDecimalCharacter:d}),e},caretPositionOnFocus:function(d){return e.settings.caretPositionOnFocus=d,e},createLocalList:function(d){return e.settings.createLocalList=d,e.settings.createLocalList?e._hasLocalList()||e._createLocalList():e._deleteLocalList(),e},currencySymbol:function(d){return e.update({currencySymbol:d}),e},currencySymbolPlacement:function(d){return e.update({currencySymbolPlacement:d}),e},decimalCharacter:function(d){return e.update({decimalCharacter:d}),e},decimalCharacterAlternative:function(d){return e.settings.decimalCharacterAlternative=d,e},decimalPlaces:function(d){return a.warning("Using `options.decimalPlaces()` instead of calling the specific `options.decimalPlacesRawValue()`, `options.decimalPlacesShownOnFocus()` and `options.decimalPlacesShownOnBlur()` methods will reset those options.\nPlease call the specific methods if you do not want to reset those.",e.settings.showWarnings),e.update({decimalPlaces:d}),e},decimalPlacesRawValue:function(d){return e.update({decimalPlacesRawValue:d}),e},decimalPlacesShownOnBlur:function(d){return e.update({decimalPlacesShownOnBlur:d}),e},decimalPlacesShownOnFocus:function(d){return e.update({decimalPlacesShownOnFocus:d}),e},defaultValueOverride:function(d){return e.update({defaultValueOverride:d}),e},digitalGroupSpacing:function(d){return e.update({digitalGroupSpacing:d}),e},digitGroupSeparator:function(d){return e.update({digitGroupSeparator:d}),e},divisorWhenUnfocused:function(d){return e.update({divisorWhenUnfocused:d}),e},emptyInputBehavior:function(d){return e.rawValue===null&&d!==s.options.emptyInputBehavior.null&&(a.warning("You are trying to modify the `emptyInputBehavior` option to something different than `'null'` (".concat(d,"), but the element raw value is currently set to `null`. This would result in an invalid `rawValue`. In order to fix that, the element value has been changed to the empty string `''`."),e.settings.showWarnings),e.rawValue=""),e.update({emptyInputBehavior:d}),e},eventBubbles:function(d){return e.settings.eventBubbles=d,e},eventIsCancelable:function(d){return e.settings.eventIsCancelable=d,e},failOnUnknownOption:function(d){return e.settings.failOnUnknownOption=d,e},formatOnPageLoad:function(d){return e.settings.formatOnPageLoad=d,e},formulaMode:function(d){return e.settings.formulaMode=d,e},historySize:function(d){return e.settings.historySize=d,e},invalidClass:function(d){return e.settings.invalidClass=d,e},isCancellable:function(d){return e.settings.isCancellable=d,e},leadingZero:function(d){return e.update({leadingZero:d}),e},maximumValue:function(d){return e.update({maximumValue:d}),e},minimumValue:function(d){return e.update({minimumValue:d}),e},modifyValueOnUpDownArrow:function(d){return e.settings.modifyValueOnUpDownArrow=d,e},modifyValueOnWheel:function(d){return e.settings.modifyValueOnWheel=d,e},negativeBracketsTypeOnBlur:function(d){return e.update({negativeBracketsTypeOnBlur:d}),e},negativePositiveSignPlacement:function(d){return e.update({negativePositiveSignPlacement:d}),e},negativeSignCharacter:function(d){return e.update({negativeSignCharacter:d}),e},negativePositiveSignBehavior:function(d){return e.settings.negativePositiveSignBehavior=d,e},noEventListeners:function(d){return d===s.options.noEventListeners.noEvents&&e.settings.noEventListeners===s.options.noEventListeners.addEvents&&e._removeEventListeners(),e.update({noEventListeners:d}),e},onInvalidPaste:function(d){return e.settings.onInvalidPaste=d,e},outputFormat:function(d){return e.settings.outputFormat=d,e},overrideMinMaxLimits:function(d){return e.update({overrideMinMaxLimits:d}),e},positiveSignCharacter:function(d){return e.update({positiveSignCharacter:d}),e},rawValueDivisor:function(d){return e.update({rawValueDivisor:d}),e},readOnly:function(d){return e.settings.readOnly=d,e._setWritePermissions(),e},roundingMethod:function(d){return e.update({roundingMethod:d}),e},saveValueToSessionStorage:function(d){return e.update({saveValueToSessionStorage:d}),e},symbolWhenUnfocused:function(d){return e.update({symbolWhenUnfocused:d}),e},selectNumberOnly:function(d){return e.settings.selectNumberOnly=d,e},selectOnFocus:function(d){return e.settings.selectOnFocus=d,e},serializeSpaces:function(d){return e.settings.serializeSpaces=d,e},showOnlyNumbersOnFocus:function(d){return e.update({showOnlyNumbersOnFocus:d}),e},showPositiveSign:function(d){return e.update({showPositiveSign:d}),e},showWarnings:function(d){return e.settings.showWarnings=d,e},styleRules:function(d){return e.update({styleRules:d}),e},suffixText:function(d){return e.update({suffixText:d}),e},unformatOnHover:function(d){return e.settings.unformatOnHover=d,e},unformatOnSubmit:function(d){return e.settings.unformatOnSubmit=d,e},upDownStep:function(d){return e.settings.upDownStep=d,e},valuesToStrings:function(d){return e.update({valuesToStrings:d}),e},watchExternalChanges:function(d){return e.update({watchExternalChanges:d}),e},wheelOn:function(d){return e.settings.wheelOn=d,e},wheelStep:function(d){return e.settings.wheelStep=d,e}},this._triggerEvent(s.events.initialized,this.domElement,{newValue:a.getElementValue(this.domElement),newRawValue:this.rawValue,error:null,aNElement:this})}var v,P,F;return v=s,P=[{key:"_saveInitialValues",value:function(e){this.initialValueHtmlAttribute=a.scientificToDecimal(this.domElement.getAttribute("value")),a.isNull(this.initialValueHtmlAttribute)&&(this.initialValueHtmlAttribute=""),this.initialValue=e,a.isNull(this.initialValue)&&(this.initialValue="")}},{key:"_createEventListeners",value:function(){var e=this;this.formulaMode=!1,this.compositioning=!1,this._onFocusInFunc=function(t){e._onFocusIn(t)},this._onFocusInAndMouseEnterFunc=function(t){e._onFocusInAndMouseEnter(t)},this._onFocusFunc=function(){e._onFocus()},this._onKeydownFunc=function(t){e._onKeydown(t)},this._onKeypressFunc=function(t){e._onKeypress(t)},this._onKeyupFunc=function(t){e._onKeyup(t)},this._onFocusOutAndMouseLeaveFunc=function(t){e._onFocusOutAndMouseLeave(t)},this._onPasteFunc=function(t){e._onPaste(t)},this._onWheelFunc=function(t){e._onWheel(t)},this._onDropFunc=function(t){e._onDrop(t)},this._onKeydownGlobalFunc=function(t){e._onKeydownGlobal(t)},this._onKeyupGlobalFunc=function(t){e._onKeyupGlobal(t)},this._onCompositionstartFunc=function(t){e._onCompositionstart(t)},this._onCompositionendFunc=function(t){e._onCompositionend(t)},this.domElement.addEventListener("focusin",this._onFocusInFunc,!1),this.domElement.addEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("focus",this._onFocusFunc,!1),this.domElement.addEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.addEventListener("keydown",this._onKeydownFunc,!1),this.domElement.addEventListener("keypress",this._onKeypressFunc,!1),this.domElement.addEventListener("keyup",this._onKeyupFunc,!1),this.domElement.addEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.addEventListener("paste",this._onPasteFunc,!1),this.domElement.addEventListener("wheel",this._onWheelFunc,!1),this.domElement.addEventListener("drop",this._onDropFunc,!1),this.domElement.addEventListener("compositionstart",this._onCompositionstartFunc,!1),this.domElement.addEventListener("compositionend",this._onCompositionendFunc,!1),this._setupFormListener(),this.hasEventListeners=!0,s._doesGlobalListExists()||(document.addEventListener("keydown",this._onKeydownGlobalFunc,!1),document.addEventListener("keyup",this._onKeyupGlobalFunc,!1))}},{key:"_removeEventListeners",value:function(){this.domElement.removeEventListener("focusin",this._onFocusInFunc,!1),this.domElement.removeEventListener("focus",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("focus",this._onFocusFunc,!1),this.domElement.removeEventListener("mouseenter",this._onFocusInAndMouseEnterFunc,!1),this.domElement.removeEventListener("blur",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("mouseleave",this._onFocusOutAndMouseLeaveFunc,!1),this.domElement.removeEventListener("keydown",this._onKeydownFunc,!1),this.domElement.removeEventListener("keypress",this._onKeypressFunc,!1),this.domElement.removeEventListener("keyup",this._onKeyupFunc,!1),this.domElement.removeEventListener("paste",this._onPasteFunc,!1),this.domElement.removeEventListener("wheel",this._onWheelFunc,!1),this.domElement.removeEventListener("drop",this._onDropFunc,!1),this.domElement.removeEventListener("compositionstart",this._onCompositionstartFunc,!1),this.domElement.removeEventListener("compositionend",this._onCompositionendFunc,!1),this._removeFormListener(),this.hasEventListeners=!1,document.removeEventListener("keydown",this._onKeydownGlobalFunc,!1),document.removeEventListener("keyup",this._onKeyupGlobalFunc,!1)}},{key:"_updateEventListeners",value:function(){this.settings.noEventListeners||this.hasEventListeners||this._createEventListeners(),this.settings.noEventListeners&&this.hasEventListeners&&this._removeEventListeners()}},{key:"_setupFormListener",value:function(){var e=this;a.isNull(this.parentForm)||(this._onFormSubmitFunc=function(){e._onFormSubmit()},this._onFormResetFunc=function(){e._onFormReset()},this._hasParentFormCounter()?this._incrementParentFormCounter():(this._initializeFormCounterToOne(),this.parentForm.addEventListener("submit",this._onFormSubmitFunc,!1),this.parentForm.addEventListener("reset",this._onFormResetFunc,!1),this._storeFormHandlerFunction()))}},{key:"_removeFormListener",value:function(){if(!a.isNull(this.parentForm)){var e=this._getParentFormCounter();e===1?(this.parentForm.removeEventListener("submit",this._getFormHandlerFunction().submitFn,!1),this.parentForm.removeEventListener("reset",this._getFormHandlerFunction().resetFn,!1),this._removeFormDataSetInfo()):e>1?this._decrementParentFormCounter():a.throwError("The AutoNumeric object count on the form is incoherent.")}}},{key:"_hasParentFormCounter",value:function(){return"anCount"in this.parentForm.dataset}},{key:"_getParentFormCounter",value:function(){return Number(this.parentForm.dataset.anCount)}},{key:"_initializeFormCounterToOne",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._getFormElement(e).dataset.anCount=1}},{key:"_incrementParentFormCounter",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._getFormElement(e).dataset.anCount++}},{key:"_decrementParentFormCounter",value:function(){this.parentForm.dataset.anCount--}},{key:"_hasFormHandlerFunction",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return"anFormHandler"in this._getFormElement(e).dataset}},{key:"_getFormElement",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?this.parentForm:e}},{key:"_storeFormHandlerFunction",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.constructor._doesFormHandlerListExists()||this.constructor._createFormHandlerList();var t=a.randomString();this._getFormElement(e).dataset.anFormHandler=t,window.aNFormHandlerMap.set(t,{submitFn:this._onFormSubmitFunc,resetFn:this._onFormResetFunc})}},{key:"_getFormHandlerKey",value:function(){this._hasFormHandlerFunction()||a.throwError("Unable to retrieve the form handler name");var e=this.parentForm.dataset.anFormHandler;return e===""&&a.throwError("The form handler name is invalid"),e}},{key:"_getFormHandlerFunction",value:function(){var e=this._getFormHandlerKey();return window.aNFormHandlerMap.get(e)}},{key:"_removeFormDataSetInfo",value:function(){this._decrementParentFormCounter(),window.aNFormHandlerMap.delete(this._getFormHandlerKey()),this.parentForm.removeAttribute("data-an-count"),this.parentForm.removeAttribute("data-an-form-handler")}},{key:"_setWritePermissions",value:function(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.domElement.readOnly||this.settings.readOnly?this._setReadOnly():this._setReadWrite()}},{key:"_setReadOnly",value:function(){this.isInputElement?this.domElement.readOnly=!0:this.domElement.setAttribute("contenteditable",!1)}},{key:"_setReadWrite",value:function(){this.isInputElement?this.domElement.readOnly=!1:this.domElement.setAttribute("contenteditable",!0)}},{key:"_addWatcher",value:function(){var e=this;if(!a.isUndefined(this.getterSetter)){var t=this.getterSetter,r=t.set,o=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return o.call(e.domElement)},set:function(u){r.call(e.domElement,u),e.settings.watchExternalChanges&&!e.internalModification&&e.set(u)}})}}},{key:"_removeWatcher",value:function(){var e=this;if(!a.isUndefined(this.getterSetter)){var t=this.getterSetter,r=t.set,o=t.get;Object.defineProperty(this.domElement,this.attributeToWatch,{configurable:!0,get:function(){return o.call(e.domElement)},set:function(u){r.call(e.domElement,u)}})}}},{key:"_getAttributeToWatch",value:function(){var e;if(this.isInputElement)e="value";else{var t=this.domElement.nodeType;t===Node.ELEMENT_NODE||t===Node.DOCUMENT_NODE||t===Node.DOCUMENT_FRAGMENT_NODE?e="textContent":t===Node.TEXT_NODE&&(e="nodeValue")}return e}},{key:"_historyTableAdd",value:function(){var e=this.historyTable.length===0;if(e||this.rawValue!==this._historyTableCurrentValueUsed()){var t=!0;if(!e){var r=this.historyTableIndex+1;r<this.historyTable.length&&this.rawValue===this.historyTable[r].value?t=!1:a.arrayTrim(this.historyTable,this.historyTableIndex+1)}if(this.historyTableIndex++,t){var o=a.getElementSelection(this.domElement);this.selectionStart=o.start,this.selectionEnd=o.end,this.historyTable.push({value:this.rawValue,start:this.selectionStart+1,end:this.selectionEnd+1}),this.historyTable.length>1&&(this.historyTable[this.historyTableIndex-1].start=this.selectionStart,this.historyTable[this.historyTableIndex-1].end=this.selectionEnd)}this.historyTable.length>this.settings.historySize&&this._historyTableForget()}}},{key:"_historyTableUndoOrRedo",value:function(){var e;if(arguments.length>0&&arguments[0]!==void 0&&!arguments[0]?(e=this.historyTableIndex+1<this.historyTable.length)&&this.historyTableIndex++:(e=this.historyTableIndex>0)&&this.historyTableIndex--,e){var t=this.historyTable[this.historyTableIndex];this.set(t.value,null,!1),a.setElementSelection(this.domElement,t.start,t.end)}}},{key:"_historyTableUndo",value:function(){this._historyTableUndoOrRedo(!0)}},{key:"_historyTableRedo",value:function(){this._historyTableUndoOrRedo(!1)}},{key:"_historyTableForget",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=[],r=0;r<e;r++)t.push(this.historyTable.shift()),this.historyTableIndex--,this.historyTableIndex<0&&(this.historyTableIndex=0);return t.length===1?t[0]:t}},{key:"_historyTableCurrentValueUsed",value:function(){var e=this.historyTableIndex;return e<0&&(e=0),a.isUndefinedOrNullOrEmpty(this.historyTable[e])?"":this.historyTable[e].value}},{key:"_parseStyleRules",value:function(){var e=this;a.isUndefinedOrNullOrEmpty(this.settings.styleRules)||this.rawValue===""||(a.isUndefinedOrNullOrEmpty(this.settings.styleRules.positive)||(this.rawValue>=0?this._addCSSClass(this.settings.styleRules.positive):this._removeCSSClass(this.settings.styleRules.positive)),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.negative)||(this.rawValue<0?this._addCSSClass(this.settings.styleRules.negative):this._removeCSSClass(this.settings.styleRules.negative)),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.ranges)||this.settings.styleRules.ranges.length===0||this.settings.styleRules.ranges.forEach(function(t){e.rawValue>=t.min&&e.rawValue<t.max?e._addCSSClass(t.class):e._removeCSSClass(t.class)}),a.isUndefinedOrNullOrEmpty(this.settings.styleRules.userDefined)||this.settings.styleRules.userDefined.length===0||this.settings.styleRules.userDefined.forEach(function(t){if(a.isFunction(t.callback))if(a.isString(t.classes))t.callback(e.rawValue)?e._addCSSClass(t.classes):e._removeCSSClass(t.classes);else if(a.isArray(t.classes))if(t.classes.length===2)t.callback(e.rawValue)?(e._addCSSClass(t.classes[0]),e._removeCSSClass(t.classes[1])):(e._removeCSSClass(t.classes[0]),e._addCSSClass(t.classes[1]));else if(t.classes.length>2){var r=t.callback(e.rawValue);a.isArray(r)?t.classes.forEach(function(o,u){a.isInArray(u,r)?e._addCSSClass(o):e._removeCSSClass(o)}):a.isInt(r)?t.classes.forEach(function(o,u){u===r?e._addCSSClass(o):e._removeCSSClass(o)}):a.isNull(r)?t.classes.forEach(function(o){e._removeCSSClass(o)}):a.throwError("The callback result is not an array nor a valid array index, ".concat(J(r)," given."))}else a.throwError("The classes attribute is not valid for the `styleRules` option.");else a.isUndefinedOrNullOrEmpty(t.classes)?t.callback(e):a.throwError("The callback/classes structure is not valid for the `styleRules` option.");else a.warning("The given `styleRules` callback is not a function, ".concat(J(t.callback)," given."),e.settings.showWarnings)}))}},{key:"_addCSSClass",value:function(e){this.domElement.classList.add(e)}},{key:"_removeCSSClass",value:function(e){this.domElement.classList.remove(e)}},{key:"update",value:function(){for(var e=this,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];Array.isArray(r)&&Array.isArray(r[0])&&(r=r[0]);var u=a.cloneObject(this.settings),g=this.rawValue,S={};a.isUndefinedOrNullOrEmpty(r)||r.length===0?S=null:r.length>=1&&r.forEach(function(E){e.constructor._isPreDefinedOptionValid(E)&&(E=e.constructor._getOptionObject(E)),re(S,E)});try{this._setSettings(S,!0),this._setWritePermissions(),this._updateEventListeners(),this.set(g)}catch(E){return this._setSettings(u,!0),a.throwError("Unable to update the settings, those are invalid: [".concat(E,"]")),this}return this}},{key:"getSettings",value:function(){return this.settings}},{key:"set",value:function(e){var t,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(a.isUndefined(e))return a.warning("You are trying to set an 'undefined' value ; an error could have occurred.",this.settings.showWarnings),this;if(a.isNull(o)||this._setSettings(o,!0),e===null&&this.settings.emptyInputBehavior!==s.options.emptyInputBehavior.null)return a.warning("You are trying to set the `null` value while the `emptyInputBehavior` option is set to ".concat(this.settings.emptyInputBehavior,". If you want to be able to set the `null` value, you need to change the 'emptyInputBehavior' option to `'null'`."),this.settings.showWarnings),this;if(e===null)return this._setElementAndRawValue(null,null,u),this._saveValueToPersistentStorage(),this;if(t=this.constructor._toNumericValue(e,this.settings),isNaN(Number(t)))return a.warning("The value you are trying to set results in `NaN`. The element value is set to the empty string instead.",this.settings.showWarnings),this.setValue("",u),this;if(t==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:t=0;break;case s.options.emptyInputBehavior.min:t=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:t=this.settings.maximumValue;break;default:a.isNumber(this.settings.emptyInputBehavior)&&(t=Number(this.settings.emptyInputBehavior))}if(t!==""){var g=X(this.constructor._checkIfInRangeWithOverrideOption(t,this.settings),2),S=g[0],E=g[1];if(S&&E&&this.settings.valuesToStrings&&this._checkValuesToStrings(t))return this._setElementAndRawValue(this.settings.valuesToStrings[t],t,u),this._saveValueToPersistentStorage(),this;if(a.isZeroOrHasNoValue(t)&&(t="0"),S&&E){var O=this.constructor._roundRawValue(t,this.settings);return O=this._trimLeadingAndTrailingZeros(O.replace(this.settings.decimalCharacter,".")),t=this._getRawValueToFormat(t),this.isFocused?t=this.constructor._roundFormattedValueShownOnFocus(t,this.settings):(this.settings.divisorWhenUnfocused&&(t=(t/=this.settings.divisorWhenUnfocused).toString()),t=this.constructor._roundFormattedValueShownOnBlur(t,this.settings)),t=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(t,this.settings),t=this.constructor._addGroupSeparators(t,this.settings,this.isFocused,this.rawValue,O),!this.isFocused&&this.settings.symbolWhenUnfocused&&(t="".concat(t).concat(this.settings.symbolWhenUnfocused)),(this.settings.decimalPlacesShownOnFocus||this.settings.divisorWhenUnfocused)&&this._saveValueToPersistentStorage(),this._setElementAndRawValue(t,O,u),this._setValidOrInvalidState(O),this}return this._triggerRangeEvents(S,E),a.throwError("The value [".concat(t,"] being set falls outside of the minimumValue [").concat(this.settings.minimumValue,"] and maximumValue [").concat(this.settings.maximumValue,"] range set for this element")),this._removeValueFromPersistentStorage(),this.setValue("",u),this}return r=this.settings.emptyInputBehavior===s.options.emptyInputBehavior.always?this.settings.currencySymbol:"",this._setElementAndRawValue(r,"",u),this}},{key:"setUnformatted",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(e===null||a.isUndefined(e))return this;a.isNull(t)||this._setSettings(t,!0);var r=this.constructor._removeBrackets(e,this.settings),o=this.constructor._stripAllNonNumberCharacters(r,this.settings,!0,this.isFocused);return a.isNumber(o)||a.throwError("The value is not a valid one, it's not a numeric string nor a recognized currency."),this.constructor._isWithinRangeWithOverrideOption(o,this.settings)?this.setValue(e):a.throwError("The value is out of the range limits [".concat(this.settings.minimumValue,", ").concat(this.settings.maximumValue,"].")),this}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._setElementAndRawValue(e,t),this}},{key:"_setRawValue",value:function(e){var t=this,r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this.rawValue!==e){var o=this.rawValue;this.rawValue=e,!a.isNull(this.settings.rawValueDivisor)&&this.settings.rawValueDivisor!==0&&e!==""&&e!==null&&this._isUserManuallyEditingTheValue()&&(this.rawValue/=this.settings.rawValueDivisor),this._triggerEvent(s.events.rawValueModified,this.domElement,{oldRawValue:o,newRawValue:this.rawValue,isPristine:this.isPristine(!0),error:null,aNElement:this}),this._parseStyleRules(),r&&window.requestAnimationFrame(function(){return t._historyTableAdd()})}}},{key:"_setElementValue",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=a.getElementValue(this.domElement);return e!==r&&(this.internalModification=!0,a.setElementValue(this.domElement,e),this.internalModification=!1,t&&this._triggerEvent(s.events.formatted,this.domElement,{oldValue:r,newValue:e,oldRawValue:this.rawValue,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this})),this}},{key:"_setElementAndRawValue",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return a.isNull(t)?t=e:a.isBoolean(t)&&(r=t,t=e),this._setElementValue(e),this._setRawValue(t,r),this}},{key:"_getRawValueToFormat",value:function(e){return a.isNull(this.settings.rawValueDivisor)||this.settings.rawValueDivisor===0||e===""||e===null?e:e*this.settings.rawValueDivisor}},{key:"_checkValuesToStrings",value:function(e){return this.constructor._checkValuesToStringsArray(e,this.valuesToStringsKeys)}},{key:"_isUserManuallyEditingTheValue",value:function(){return this.isFocused&&this.isEditing||this.isDropEvent}},{key:"_executeCallback",value:function(e,t){!a.isNull(t)&&a.isFunction(t)&&t(e,this)}},{key:"_triggerEvent",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;a.triggerEvent(e,t,r,this.settings.eventBubbles,this.settings.eventIsCancelable)}},{key:"get",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.getNumericString(e)}},{key:"getNumericString",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(this.rawValue)?null:a.trimPaddedZerosFromDecimalPlaces(this.rawValue),this._executeCallback(e,t),e}},{key:"getFormatted",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;"value"in this.domElement||"textContent"in this.domElement||a.throwError("Unable to get the formatted string from the element.");var t=a.getElementValue(this.domElement);return this._executeCallback(t,e),t}},{key:"getNumber",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=this.rawValue===null?null:this.constructor._toLocale(this.getNumericString(),"number",this.settings),this._executeCallback(e,t),e}},{key:"getLocalized",value:function(){var e,t,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;a.isFunction(r)&&a.isNull(o)&&(o=r,r=null),(e=a.isEmptyString(this.rawValue)?"":""+Number(this.rawValue))!=""&&Number(e)===0&&this.settings.leadingZero!==s.options.leadingZero.keep&&(e="0"),t=a.isNull(r)?this.settings.outputFormat:r;var u=this.constructor._toLocale(e,t,this.settings);return this._executeCallback(u,o),u}},{key:"reformat",value:function(){return this.set(this.rawValue),this}},{key:"unformat",value:function(){return this._setElementValue(this.getNumericString()),this}},{key:"unformatLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._setElementValue(this.getLocalized(e)),this}},{key:"isPristine",value:function(){return arguments.length>0&&arguments[0]!==void 0&&!arguments[0]?this.initialValueHtmlAttribute===this.getFormatted():this.initialValue===this.getNumericString()}},{key:"select",value:function(){return this.settings.selectNumberOnly?this.selectNumber():this._defaultSelectAll(),this}},{key:"_defaultSelectAll",value:function(){a.setElementSelection(this.domElement,0,a.getElementValue(this.domElement).length)}},{key:"selectNumber",value:function(){var e,t,r=a.getElementValue(this.domElement),o=r.length,u=this.settings.currencySymbol.length,g=this.settings.currencySymbolPlacement,S=a.isNegative(r,this.settings.negativeSignCharacter)?1:0,E=this.settings.suffixText.length;if(e=g===s.options.currencySymbolPlacement.suffix?0:this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left&&S===1&&u>0?u+1:u,g===s.options.currencySymbolPlacement.prefix)t=o-E;else switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:t=o-(E+u);break;case s.options.negativePositiveSignPlacement.right:t=u>0?o-(u+S+E):o-(u+E);break;default:t=o-(u+E)}return a.setElementSelection(this.domElement,e,t),this}},{key:"selectInteger",value:function(){var e=0,t=this.rawValue>=0;this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.prefix&&(this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none)||(this.settings.showPositiveSign&&t||!t&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left)&&(e+=1),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(e+=this.settings.currencySymbol.length);var r=a.getElementValue(this.domElement),o=r.indexOf(this.settings.decimalCharacter);return o===-1&&(o=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?r.length-this.settings.currencySymbol.length:r.length,t||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.suffix&&this.settings.currencySymbolPlacement!==s.options.currencySymbolPlacement.suffix||(o-=1),o-=this.settings.suffixText.length),a.setElementSelection(this.domElement,e,o),this}},{key:"selectDecimal",value:function(){var e,t,r=a.getElementValue(this.domElement).indexOf(this.settings.decimalCharacter);return r===-1?(r=0,e=0):(r+=1,t=this.isFocused?this.settings.decimalPlacesShownOnFocus:this.settings.decimalPlacesShownOnBlur,e=r+Number(t)),a.setElementSelection(this.domElement,r,e),this}},{key:"node",value:function(){return this.domElement}},{key:"parent",value:function(){return this.domElement.parentNode}},{key:"detach",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(t)?this.domElement:t.node(),this._removeFromLocalList(e),this}},{key:"attach",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this._addToLocalList(e.node()),t&&e.update(this.settings),this}},{key:"formatOther",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._formatOrUnformatOther(!0,e,t)}},{key:"unformatOther",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._formatOrUnformatOther(!1,e,t)}},{key:"_formatOrUnformatOther",value:function(e,t){var r,o,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(r=a.isNull(u)?this.settings:this._cloneAndMergeSettings(u),a.isElement(t)){var g=a.getElementValue(t);return o=e?s.format(g,r):s.unformat(g,r),a.setElementValue(t,o),null}return o=e?s.format(t,r):s.unformat(t,r)}},{key:"init",value:function(e){var t=this,r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],o=!1,u=[];if(a.isString(e)?u=Ee(document.querySelectorAll(e)):a.isElement(e)?(u.push(e),o=!0):a.isArray(e)?u=e:a.throwError("The given parameters to the 'init' function are invalid."),u.length===0)return a.warning("No valid DOM elements were given hence no AutoNumeric object were instantiated.",!0),[];var g=this._getLocalList(),S=[];return u.forEach(function(E){var O=t.settings.createLocalList;r&&(t.settings.createLocalList=!1);var d=new s(E,a.getElementValue(E),t.settings);r&&(d._setLocalList(g),t._addToLocalList(E,d),t.settings.createLocalList=O),S.push(d)}),o?S[0]:S}},{key:"clear",value:function(){if(arguments.length>0&&arguments[0]!==void 0&&arguments[0]){var e={emptyInputBehavior:s.options.emptyInputBehavior.focus};this.set("",e)}else this.set("");return this}},{key:"remove",value:function(){this._removeValueFromPersistentStorage(),this._removeEventListeners(),this._removeWatcher(),this._removeFromLocalList(this.domElement),this.constructor._removeFromGlobalList(this)}},{key:"wipe",value:function(){this._setElementValue("",!1),this.remove()}},{key:"nuke",value:function(){this.remove(),this.domElement.parentNode.removeChild(this.domElement)}},{key:"form",value:function(){if(arguments.length>0&&arguments[0]!==void 0&&arguments[0]||a.isUndefinedOrNullOrEmpty(this.parentForm)){var e=this._getParentForm();if(!a.isNull(e)&&e!==this.parentForm){var t=this._getFormAutoNumericChildren(this.parentForm);this.parentForm.dataset.anCount=t.length,this._hasFormHandlerFunction(e)?this._incrementParentFormCounter(e):(this._storeFormHandlerFunction(e),this._initializeFormCounterToOne(e))}this.parentForm=e}return this.parentForm}},{key:"_getFormAutoNumericChildren",value:function(e){var t=this,r=Ee(e.elements),o=this._getContenteditableElements(e);return a.arrayUnique(r,o).filter(function(u){return t.constructor.isManagedByAutoNumeric(u)})}},{key:"_getContenteditableElements",value:function(e){if(a.isUndefinedOrNullOrEmpty(e)||!e.hasAttribute("id"))return[];var t=Ee(e.querySelectorAll("[contenteditable=true]")),r=Ee(document.querySelectorAll("*:not(input)[form=".concat(e.getAttribute("id"),"][contenteditable=true]")));return a.arrayUnique(t,r)}},{key:"_getParentForm",value:function(){if(!a.isUndefined(this.domElement.form))return this.domElement.form;if(this.domElement.tagName.toLowerCase()==="body")return null;var e,t=this.domElement;do{if(t=t.parentNode,a.isNull(t))return null;if((e=t.tagName?t.tagName.toLowerCase():"")==="body")break}while(e!=="form");return e==="form"?t:null}},{key:"formNumericString",value:function(){return this.constructor._serializeNumericString(this.form(),this.settings.serializeSpaces)}},{key:"formFormatted",value:function(){return this.constructor._serializeFormatted(this.form(),this.settings.serializeSpaces)}},{key:"formLocalized",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(t)?this.settings.outputFormat:t,this.constructor._serializeLocalized(this.form(),this.settings.serializeSpaces,e)}},{key:"formArrayNumericString",value:function(){return this.constructor._serializeNumericStringArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayFormatted",value:function(){return this.constructor._serializeFormattedArray(this.form(),this.settings.serializeSpaces)}},{key:"formArrayLocalized",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e=a.isNull(t)?this.settings.outputFormat:t,this.constructor._serializeLocalizedArray(this.form(),this.settings.serializeSpaces,e)}},{key:"formJsonNumericString",value:function(){return JSON.stringify(this.formArrayNumericString())}},{key:"formJsonFormatted",value:function(){return JSON.stringify(this.formArrayFormatted())}},{key:"formJsonLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return JSON.stringify(this.formArrayLocalized(e))}},{key:"formUnformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformat()}),this}},{key:"formUnformatLocalized",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).unformatLocalized()}),this}},{key:"formReformat",value:function(){return this.constructor._getChildANInputElement(this.form()).forEach(function(e){s.getAutoNumericElement(e).reformat()}),this}},{key:"formSubmitNumericString",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?(this.formUnformat(),this.form().submit(),this.formReformat()):a.isFunction(e)?e(this.formNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitFormatted",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return a.isNull(e)?this.form().submit():a.isFunction(e)?e(this.formFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitLocalized",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isNull(t)?(this.formUnformatLocalized(),this.form().submit(),this.formReformat()):a.isFunction(t)?t(this.formLocalized(e)):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayNumericString",value:function(e){return a.isFunction(e)?e(this.formArrayNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayFormatted",value:function(e){return a.isFunction(e)?e(this.formArrayFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitArrayLocalized",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isFunction(e)?e(this.formArrayLocalized(t)):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonNumericString",value:function(e){return a.isFunction(e)?e(this.formJsonNumericString()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonFormatted",value:function(e){return a.isFunction(e)?e(this.formJsonFormatted()):a.throwError("The given callback is not a function."),this}},{key:"formSubmitJsonLocalized",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isFunction(e)?e(this.formJsonLocalized(t)):a.throwError("The given callback is not a function."),this}},{key:"_createLocalList",value:function(){this.autoNumericLocalList=new Map,this._addToLocalList(this.domElement)}},{key:"_deleteLocalList",value:function(){delete this.autoNumericLocalList}},{key:"_setLocalList",value:function(e){this.autoNumericLocalList=e}},{key:"_getLocalList",value:function(){return this.autoNumericLocalList}},{key:"_hasLocalList",value:function(){return this.autoNumericLocalList instanceof Map&&this.autoNumericLocalList.size!==0}},{key:"_addToLocalList",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;a.isNull(t)&&(t=this),a.isUndefined(this.autoNumericLocalList)?a.throwError("The local list provided does not exists when trying to add an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.set(e,t)}},{key:"_removeFromLocalList",value:function(e){a.isUndefined(this.autoNumericLocalList)?this.settings.createLocalList&&a.throwError("The local list provided does not exists when trying to remove an element. [".concat(this.autoNumericLocalList,"] given.")):this.autoNumericLocalList.delete(e)}},{key:"_mergeSettings",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];re.apply(void 0,[this.settings].concat(t))}},{key:"_cloneAndMergeSettings",value:function(){for(var e={},t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return re.apply(void 0,[e,this.settings].concat(r)),e}},{key:"_updatePredefinedOptions",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a.isNull(t)?this.update(e):(this._mergeSettings(e,t),this.update(this.settings)),this}},{key:"french",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().French,e),this}},{key:"northAmerican",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().NorthAmerican,e),this}},{key:"british",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().British,e),this}},{key:"swiss",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Swiss,e),this}},{key:"japanese",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Japanese,e),this}},{key:"spanish",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Spanish,e),this}},{key:"chinese",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Chinese,e),this}},{key:"brazilian",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this._updatePredefinedOptions(s.getPredefinedOptions().Brazilian,e),this}},{key:"_runCallbacksFoundInTheSettingsObject",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];if(typeof t=="function")this.settings[e]=t(this,e);else{var r="";e in this.domElement.dataset&&(r=this.domElement.dataset[e]),r=a.camelize(r),typeof this.settings[r]=="function"&&(this.settings[e]=r(this,e))}}}},{key:"_setTrailingNegativeSignInfo",value:function(){this.isTrailingNegative=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right)}},{key:"_modifyNegativeSignAndDecimalCharacterForRawValue",value:function(e){return this.settings.decimalCharacter!=="."&&(e=e.replace(this.settings.decimalCharacter,".")),this.settings.negativeSignCharacter!=="-"&&this.settings.isNegativeSignAllowed&&(e=e.replace(this.settings.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}},{key:"_initialCaretPosition",value:function(e){a.isNull(this.settings.caretPositionOnFocus)&&this.settings.selectOnFocus===s.options.selectOnFocus.doNotSelect&&a.throwError("`_initialCaretPosition()` should never be called when the `caretPositionOnFocus` option is `null`.");var t=this.rawValue<0,r=a.isZeroOrHasNoValue(e),o=e.length,u=0,g=0,S=!1,E=0;this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.start&&(u=(e=(e=(e=e.replace(this.settings.negativeSignCharacter,"")).replace(this.settings.positiveSignCharacter,"")).replace(this.settings.currencySymbol,"")).length,S=a.contains(e,this.settings.decimalCharacter),this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalLeft&&this.settings.caretPositionOnFocus!==s.options.caretPositionOnFocus.decimalRight||(S?(g=e.indexOf(this.settings.decimalCharacter),E=this.settings.decimalCharacter.length):(g=u,E=0)));var O="";t?O=this.settings.negativeSignCharacter:this.settings.showPositiveSign&&!r&&(O=this.settings.positiveSignCharacter);var d,T=O.length,D=this.settings.currencySymbol.length;if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D;break;case s.options.negativePositiveSignPlacement.suffix:d=D}else d=D;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=o;break;case s.options.negativePositiveSignPlacement.suffix:d=D+u}else d=o;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D+g;break;case s.options.negativePositiveSignPlacement.suffix:d=D+g}else d=D+g;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.right:d=T+D+g+E;break;case s.options.negativePositiveSignPlacement.suffix:d=D+g+E}else d=D+g+E}else if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix){if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.start)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=0;break;case s.options.negativePositiveSignPlacement.prefix:d=T}else d=0;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.end)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=u;break;case s.options.negativePositiveSignPlacement.prefix:d=T+u}else d=u;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalLeft)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=g;break;case s.options.negativePositiveSignPlacement.prefix:d=T+g}else d=g;else if(this.settings.caretPositionOnFocus===s.options.caretPositionOnFocus.decimalRight)if(this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(t||!t&&this.settings.showPositiveSign&&!r))switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:case s.options.negativePositiveSignPlacement.left:d=g+E;break;case s.options.negativePositiveSignPlacement.prefix:d=T+g+E}else d=g+E}return d}},{key:"_triggerRangeEvents",value:function(e,t){e||this._triggerEvent(s.events.minRangeExceeded,this.domElement),t||this._triggerEvent(s.events.maxRangeExceeded,this.domElement)}},{key:"_setInvalidState",value:function(){this.isInputElement?a.setInvalidState(this.domElement):this._addCSSClass(this.settings.invalidClass),this._triggerEvent(s.events.invalidValue,this.domElement),this.validState=!1}},{key:"_setValidState",value:function(){this.isInputElement?a.setValidState(this.domElement):this._removeCSSClass(this.settings.invalidClass),this.validState||this._triggerEvent(s.events.correctedValue,this.domElement),this.validState=!0}},{key:"_setValidOrInvalidState",value:function(e){if(this.settings.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid){var t=this.constructor._isMinimumRangeRespected(e,this.settings),r=this.constructor._isMaximumRangeRespected(e,this.settings);t&&r?this._setValidState():this._setInvalidState(),this._triggerRangeEvents(t,r)}}},{key:"_keepAnOriginalSettingsCopy",value:function(){this.originalDigitGroupSeparator=this.settings.digitGroupSeparator,this.originalCurrencySymbol=this.settings.currencySymbol,this.originalSuffixText=this.settings.suffixText}},{key:"_trimLeadingAndTrailingZeros",value:function(e){if(e===""||e===null)return e;if(this.settings.leadingZero!==s.options.leadingZero.keep){if(Number(e)===0)return"0";e=e.replace(/^(-)?0+(?=\d)/g,"$1")}return a.contains(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1")),e=e.replace(/\.$/,"")}},{key:"_setPersistentStorageName",value:function(){this.settings.saveValueToSessionStorage&&(this.domElement.name===""||a.isUndefined(this.domElement.name)?this.rawValueStorageName="".concat(this.storageNamePrefix).concat(this.domElement.id):this.rawValueStorageName="".concat(this.storageNamePrefix).concat(decodeURIComponent(this.domElement.name)))}},{key:"_saveValueToPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&sessionStorage.setItem(this.rawValueStorageName,this.rawValue)}},{key:"_getValueFromPersistentStorage",value:function(){return this.settings.saveValueToSessionStorage?sessionStorage.getItem(this.rawValueStorageName):(a.warning("`_getValueFromPersistentStorage()` is called but `settings.saveValueToSessionStorage` is false. There must be an error that needs fixing.",this.settings.showWarnings),null)}},{key:"_removeValueFromPersistentStorage",value:function(){this.settings.saveValueToSessionStorage&&sessionStorage.removeItem(this.rawValueStorageName)}},{key:"_getDefaultValue",value:function(e){var t=e.getAttribute("value");return a.isNull(t)?"":t}},{key:"_onFocusInAndMouseEnter",value:function(e){if(this.isEditing=!1,!this.formulaMode&&this.settings.unformatOnHover&&e.type==="mouseenter"&&e.altKey)this.constructor._unformatAltHovered(this);else if(e.type==="focus"&&(this.isFocused=!0,this.rawValueOnFocus=this.rawValue),e.type==="focus"&&this.settings.unformatOnHover&&this.hoveredWithAlt&&this.constructor._reformatAltHovered(this),e.type==="focus"||e.type==="mouseenter"&&!this.isFocused){var t=null;this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus&&this.rawValue<0&&this.settings.negativeBracketsTypeOnBlur!==null&&this.settings.isNegativeSignAllowed&&(t=this.constructor._removeBrackets(a.getElementValue(this.domElement),this.settings));var r=this._getRawValueToFormat(this.rawValue);if(r!==""){var o=this.constructor._roundFormattedValueShownOnFocusOrBlur(r,this.settings,this.isFocused);this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers?(this.settings.digitGroupSeparator="",this.settings.currencySymbol="",this.settings.suffixText="",t=o.replace(".",this.settings.decimalCharacter)):t=a.isNull(o)?"":this.constructor._addGroupSeparators(o.replace(".",this.settings.decimalCharacter),this.settings,this.isFocused,r)}a.isNull(t)?this.valueOnFocus="":this.valueOnFocus=t,this.lastVal=this.valueOnFocus;var u=this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(this.valueOnFocus,this.settings),g=this.constructor._orderValueCurrencySymbolAndSuffixText(this.valueOnFocus,this.settings,!0),S=u&&g!==""&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.focus;S&&(t=g),a.isNull(t)||this._setElementValue(t),S&&g===this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&a.setElementSelection(e.target,0)}}},{key:"_onFocus",value:function(){this.settings.isCancellable&&this._saveCancellableValue()}},{key:"_onFocusIn",value:function(e){this.settings.selectOnFocus?this.select():a.isNull(this.settings.caretPositionOnFocus)||a.setElementSelection(e.target,this._initialCaretPosition(a.getElementValue(this.domElement)))}},{key:"_enterFormulaMode",value:function(){this.settings.formulaMode&&(this.formulaMode=!0,a.setElementValue(this.domElement,"="),a.setElementSelection(this.domElement,1))}},{key:"_exitFormulaMode",value:function(){var e,t=a.getElementValue(this.domElement);t=t.replace(/^\s*=/,"");try{var r=new Y(t,this.settings.decimalCharacter);e=new jt().evaluate(r)}catch{return this._triggerEvent(s.events.invalidFormula,this.domElement,{formula:t,aNElement:this}),this.reformat(),void(this.formulaMode=!1)}this._triggerEvent(s.events.validFormula,this.domElement,{formula:t,result:e,aNElement:this}),this.set(e),this.formulaMode=!1}},{key:"_acceptNonPrintableKeysInFormulaMode",value:function(){return this.eventKey===l.keyName.Backspace||this.eventKey===l.keyName.Delete||this.eventKey===l.keyName.LeftArrow||this.eventKey===l.keyName.RightArrow||this.eventKey===l.keyName.Home||this.eventKey===l.keyName.End}},{key:"_onKeydown",value:function(e){if(!this.compositioning)if(this.formatted=!1,this.isEditing=!0,this.formulaMode||this.isFocused||!this.settings.unformatOnHover||!e.altKey||this.domElement!==a.getHoveredElement()){if(this._updateEventKeyInfo(e),this.keydownEventCounter+=1,this.keydownEventCounter===1&&(this.initialValueOnFirstKeydown=a.getElementValue(e.target),this.initialRawValueOnFirstKeydown=this.rawValue),this.formulaMode){if(this.eventKey===l.keyName.Esc)return this.formulaMode=!1,void this.reformat();if(this.eventKey===l.keyName.Enter)return void this._exitFormulaMode();if(this._acceptNonPrintableKeysInFormulaMode())return}else{if(this.eventKey===l.keyName.Equal)return void this._enterFormulaMode();if(this.settings.modifyValueOnUpDownArrow&&(this.eventKey===l.keyName.UpArrow||this.eventKey===l.keyName.DownArrow))return void this.upDownArrowAction(e)}if(this.domElement.readOnly||this.settings.readOnly||this.domElement.disabled)this.processed=!0;else{this.eventKey===l.keyName.Esc&&(e.preventDefault(),this.settings.isCancellable&&this.rawValue!==this.savedCancellableValue&&(this.set(this.savedCancellableValue),this._triggerEvent(s.events.native.input,e.target)),this.select());var t=a.getElementValue(e.target);if(this.eventKey===l.keyName.Enter&&this.rawValue!==this.rawValueOnFocus&&(this._triggerEvent(s.events.native.change,e.target),this.valueOnFocus=t,this.rawValueOnFocus=this.rawValue,this.settings.isCancellable&&this._saveCancellableValue()),this._updateInternalProperties(e),this._processNonPrintableKeysAndShortcuts(e))this.processed=!0;else if(this.eventKey===l.keyName.Backspace||this.eventKey===l.keyName.Delete){var r=this._processCharacterDeletion(e);if(this.processed=!0,!r)return void e.preventDefault();this._formatValue(e),(t=a.getElementValue(e.target))!==this.lastVal&&this.throwInput&&(this._triggerEvent(s.events.native.input,e.target),e.preventDefault()),this.lastVal=t,this.throwInput=!0}}}else this.constructor._unformatAltHovered(this)}},{key:"_onKeypress",value:function(e){if(!this.compositioning){if(this.formulaMode){if(this._acceptNonPrintableKeysInFormulaMode()||this.settings.formulaChars.test(this.eventKey))return;e.preventDefault()}else if(this.eventKey!==l.keyName.Insert){var t=this.processed;if(this._updateInternalProperties(e),!this._processNonPrintableKeysAndShortcuts(e))if(t)e.preventDefault();else{if(this._processCharacterInsertion()){this._formatValue(e);var r=a.getElementValue(e.target);if(r!==this.lastVal&&this.throwInput)this._triggerEvent(s.events.native.input,e.target),e.preventDefault();else{if((this.eventKey===this.settings.decimalCharacter||this.eventKey===this.settings.decimalCharacterAlternative)&&a.getElementSelection(e.target).start===a.getElementSelection(e.target).end&&a.getElementSelection(e.target).start===r.indexOf(this.settings.decimalCharacter)){var o=a.getElementSelection(e.target).start+1;a.setElementSelection(e.target,o)}e.preventDefault()}return this.lastVal=a.getElementValue(e.target),this.throwInput=!0,void this._setValidOrInvalidState(this.rawValue)}e.preventDefault()}}}}},{key:"_onKeyup",value:function(e){if(!this.compositioning&&(this.isEditing=!1,this.keydownEventCounter=0,!this.formulaMode))if(this.settings.isCancellable&&this.eventKey===l.keyName.Esc)e.preventDefault();else{if(this._updateEventKeyInfo(e),this.eventKey===l.keyName.Z||this.eventKey===l.keyName.z){if(e.ctrlKey&&e.shiftKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(e.ctrlKey&&!e.shiftKey){if(!this.onGoingRedo)return e.preventDefault(),this._historyTableUndo(),void this._triggerEvent(s.events.native.input,e.target);this.onGoingRedo=!1}}else if((this.eventKey===l.keyName.Y||this.eventKey===l.keyName.y)&&e.ctrlKey)return e.preventDefault(),this._historyTableRedo(),this._triggerEvent(s.events.native.input,e.target),void(this.onGoingRedo=!0);if(this.onGoingRedo&&(e.ctrlKey||e.shiftKey)&&(this.onGoingRedo=!1),(e.ctrlKey||e.metaKey)&&(this.eventKey===l.keyName.X||this.eventKey===l.keyName.x)){var t=a.getElementSelection(this.domElement).start,r=this.constructor._toNumericValue(a.getElementValue(e.target),this.settings);this.set(r),this._setCaretPosition(t)}if(this.eventKey===l.keyName.Alt&&this.settings.unformatOnHover&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(!e.ctrlKey&&!e.metaKey||this.eventKey!==l.keyName.Backspace&&this.eventKey!==l.keyName.Delete){this._updateInternalProperties(e);var o=this._processNonPrintableKeysAndShortcuts(e);delete this.valuePartsBeforePaste;var u=a.getElementValue(e.target);if(!(o||u===""&&this.initialValueOnFirstKeydown==="")&&(u===this.settings.currencySymbol?this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.setElementSelection(e.target,0):a.setElementSelection(e.target,this.settings.currencySymbol.length):this.eventKey===l.keyName.Tab&&a.setElementSelection(e.target,0,u.length),(u===this.settings.suffixText||this.rawValue===""&&this.settings.currencySymbol!==""&&this.settings.suffixText!=="")&&a.setElementSelection(e.target,0),this.settings.decimalPlacesShownOnFocus!==null&&this._saveValueToPersistentStorage(),this.formatted||this._formatValue(e),this._setValidOrInvalidState(this.rawValue),this._saveRawValueForAndroid(),u!==this.initialValueOnFirstKeydown&&this._triggerEvent(s.events.formatted,e.target,{oldValue:this.initialValueOnFirstKeydown,newValue:u,oldRawValue:this.initialRawValueOnFirstKeydown,newRawValue:this.rawValue,isPristine:this.isPristine(!1),error:null,aNElement:this}),this.historyTable.length>1)){var g=a.getElementSelection(this.domElement);this.selectionStart=g.start,this.selectionEnd=g.end,this.historyTable[this.historyTableIndex].start=this.selectionStart,this.historyTable[this.historyTableIndex].end=this.selectionEnd}}else{var S=a.getElementValue(e.target);this._setRawValue(this._formatOrUnformatOther(!1,S))}}}},{key:"_saveRawValueForAndroid",value:function(){if(this.eventKey===l.keyName.AndroidDefault){var e=this.constructor._stripAllNonNumberCharactersExceptCustomDecimalChar(this.getFormatted(),this.settings,!0,this.isFocused);e=this.constructor._convertToNumericString(e,this.settings),this._setRawValue(e)}}},{key:"_onFocusOutAndMouseLeave",value:function(e){if(this.isEditing=!1,e.type!=="mouseleave"||!this.formulaMode){if(this.settings.unformatOnHover&&e.type==="mouseleave"&&this.hoveredWithAlt)this.constructor._reformatAltHovered(this);else if(e.type==="mouseleave"&&!this.isFocused||e.type==="blur"){e.type==="blur"&&this.formulaMode&&this._exitFormulaMode(),this._saveValueToPersistentStorage(),this.settings.showOnlyNumbersOnFocus===s.options.showOnlyNumbersOnFocus.onlyNumbers&&(this.settings.digitGroupSeparator=this.originalDigitGroupSeparator,this.settings.currencySymbol=this.originalCurrencySymbol,this.settings.suffixText=this.originalSuffixText);var t=this._getRawValueToFormat(this.rawValue),r=a.isNull(t),o=X(this.constructor._checkIfInRangeWithOverrideOption(t,this.settings),2),u=o[0],g=o[1],S=!1;if(t===""||r||(this._triggerRangeEvents(u,g),this.settings.valuesToStrings&&this._checkValuesToStrings(t)&&(this._setElementValue(this.settings.valuesToStrings[t]),S=!0)),!S){var E;if(E=r||t===""?t:String(t),t===""||r){if(t==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.zero:this._setRawValue("0"),E=this.constructor._roundValue("0",this.settings,0);break;case s.options.emptyInputBehavior.min:this._setRawValue(this.settings.minimumValue),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.minimumValue,this.settings,this.isFocused);break;case s.options.emptyInputBehavior.max:this._setRawValue(this.settings.maximumValue),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.maximumValue,this.settings,this.isFocused);break;default:a.isNumber(this.settings.emptyInputBehavior)&&(this._setRawValue(this.settings.emptyInputBehavior),E=this.constructor._roundFormattedValueShownOnFocusOrBlur(this.settings.emptyInputBehavior,this.settings,this.isFocused))}}else u&&g&&!this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(t,this.settings)?(E=this._modifyNegativeSignAndDecimalCharacterForRawValue(E),this.settings.divisorWhenUnfocused&&!a.isNull(E)&&(E=(E/=this.settings.divisorWhenUnfocused).toString()),E=this.constructor._roundFormattedValueShownOnBlur(E,this.settings),E=this.constructor._modifyNegativeSignAndDecimalCharacterForFormattedValue(E,this.settings)):this._triggerRangeEvents(u,g);var O=this.constructor._orderValueCurrencySymbolAndSuffixText(E,this.settings,!1);this.constructor._isElementValueEmptyOrOnlyTheNegativeSign(E,this.settings)||r&&this.settings.emptyInputBehavior===s.options.emptyInputBehavior.null||(O=this.constructor._addGroupSeparators(E,this.settings,!1,t)),O===t&&t!==""&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.never&&this.settings.allowDecimalPadding!==s.options.allowDecimalPadding.floats||(this.settings.symbolWhenUnfocused&&t!==""&&t!==null&&(O="".concat(O).concat(this.settings.symbolWhenUnfocused)),this._setElementValue(O))}this._setValidOrInvalidState(this.rawValue),e.type==="blur"&&this._onBlur(e)}}}},{key:"_onPaste",value:function(e){if(e.preventDefault(),!(this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var t,r;e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):a.throwError("Unable to retrieve the pasted value. Please use a modern browser (i.e. Firefox or Chromium)."),r=e.target.tagName?e.target:e.explicitOriginalTarget;var o=a.getElementValue(r),u=r.selectionStart||0,g=r.selectionEnd||0,S=g-u;if(S===o.length){var E=this._preparePastedText(t),O=a.arabicToLatinNumbers(E,!1,!1,!1);return O==="."||O===""||O!=="."&&!a.isNumber(O)?(this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(t,"' is not a valid paste content.")))):(this.set(O),this.formatted=!0,void this._triggerEvent(s.events.native.input,r))}var d=a.isNegativeStrict(t,this.settings.negativeSignCharacter);d&&(t=t.slice(1,t.length));var T,D,$=this._preparePastedText(t);if((T=$==="."?".":a.arabicToLatinNumbers($,!1,!1,!1))!=="."&&(!a.isNumber(T)||T===""))return this.formatted=!0,void(this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(t,"' is not a valid paste content.")));var W,ee,qe=a.isNegativeStrict(this.getNumericString(),this.settings.negativeSignCharacter);d&&!qe?(qe=!0,W=!0):W=!1;var rt=o.slice(0,u),st=o.slice(g,o.length);ee=u!==g?this._preparePastedText(rt+st):this._preparePastedText(o),qe&&(ee=a.setRawNegativeSign(ee)),D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter)),W&&D++;var Ze=ee.slice(0,D),si=ee.slice(D,ee.length),an=!1;T==="."&&(a.contains(Ze,".")&&(an=!0,Ze=Ze.replace(".","")),si=si.replace(".",""));var Mn=!1;switch(Ze===""&&si==="-"&&(Ze="-",si="",Mn=!0),this.settings.onInvalidPaste){case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:for(var ho=a.parseStr(this.settings.minimumValue),go=a.parseStr(this.settings.maximumValue),li=ee,ci=0,Ka=Ze;ci<T.length&&(ee=(Ka+=T[ci])+si,this.constructor._checkIfInRange(ee,ho,go));)li=ee,ci++;if(D+=ci,Mn&&D++,this.settings.onInvalidPaste===s.options.onInvalidPaste.truncate){ee=li,an&&D--;break}for(var hi=D,Wa=li.length;ci<T.length&&hi<Wa;)if(li[hi]!=="."){if(ee=a.replaceCharAt(li,hi,T[ci]),!this.constructor._checkIfInRange(ee,ho,go))break;li=ee,ci++,hi++}else hi++;D=hi,an&&D--,ee=li;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.ignore:case s.options.onInvalidPaste.clamp:default:if(ee="".concat(Ze).concat(T).concat(si),u===g)D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter))+T.length;else if(si==="")D=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,u,this.settings.decimalCharacter))+T.length,Mn&&D++;else{var Ha=a.convertCharacterCountToIndexPosition(a.countNumberCharactersOnTheCaretLeftSide(o,g,this.settings.decimalCharacter)),qa=a.getElementValue(r).slice(u,g);D=Ha-S+a.countCharInText(this.settings.digitGroupSeparator,qa)+T.length}W&&D++,an&&D--}if(a.isNumber(ee)&&ee!==""){var rn=!1,fo=!1;try{this.set(ee),rn=!0}catch{var sn;switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:sn=a.clampToRangeLimits(ee,this.settings);try{this.set(sn)}catch{a.throwError("Fatal error: Unable to set the clamped value '".concat(sn,"'."))}fo=!0,rn=!0,ee=sn;break;case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:a.throwError("The pasted value '".concat(t,"' results in a value '").concat(ee,"' that is outside of the minimum [").concat(this.settings.minimumValue,"] and maximum [").concat(this.settings.maximumValue,"] value range."));case s.options.onInvalidPaste.ignore:default:return}}var vo,ln=a.getElementValue(r);if(rn)switch(this.settings.onInvalidPaste){case s.options.onInvalidPaste.clamp:if(fo){this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?a.setElementSelection(r,ln.length-this.settings.currencySymbol.length):a.setElementSelection(r,ln.length);break}case s.options.onInvalidPaste.error:case s.options.onInvalidPaste.ignore:case s.options.onInvalidPaste.truncate:case s.options.onInvalidPaste.replace:default:vo=a.findCaretPositionInFormattedNumber(ee,D,ln,this.settings.decimalCharacter),a.setElementSelection(r,vo)}rn&&o!==ln&&this._triggerEvent(s.events.native.input,r)}else this.settings.onInvalidPaste===s.options.onInvalidPaste.error&&a.throwError("The pasted value '".concat(t,"' would result into an invalid content '").concat(ee,"'."))}}},{key:"_onBlur",value:function(e){this.isFocused=!1,this.isEditing=!1,a.trimPaddedZerosFromDecimalPlaces(this.rawValue)!==a.trimPaddedZerosFromDecimalPlaces(this.rawValueOnFocus)&&this._triggerEvent(s.events.native.change,e.target),this.rawValueOnFocus=void 0}},{key:"_wheelAndUpDownActions",value:function(e,t,r,o){var u,g=e.target.selectionStart||0,S=e.target.selectionEnd||0,E=this.rawValue;if(u=+(u=a.isUndefinedOrNullOrEmpty(E)?this.settings.minimumValue>0||this.settings.maximumValue<0?t?this.settings.minimumValue:this.settings.maximumValue:0:E),a.isNumber(o)){var O=+o;t?u+=O:r&&(u-=O)}else t?u=a.addAndRoundToNearestAuto(u,this.settings.decimalPlacesRawValue):r&&(u=a.subtractAndRoundToNearestAuto(u,this.settings.decimalPlacesRawValue));(u=a.clampToRangeLimits(u,this.settings))!==+E&&(this.set(u),this._triggerEvent(s.events.native.input,e.target)),e.preventDefault(),this._setSelection(g,S)}},{key:"upDownArrowAction",value:function(e){if(!(this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled)){var t=!1,r=!1;this.eventKey===l.keyName.UpArrow?t=!0:this.eventKey===l.keyName.DownArrow?r=!0:a.throwError("Something has gone wrong since neither an Up or Down arrow key is detected, but the function was still called!"),this._wheelAndUpDownActions(e,t,r,this.settings.upDownStep)}}},{key:"_onWheel",value:function(e){this.formulaMode||this.settings.readOnly||this.domElement.readOnly||this.domElement.disabled||this.settings.modifyValueOnWheel&&(this.settings.wheelOn===s.options.wheelOn.focus?this.isFocused?e.shiftKey||this.wheelAction(e):e.shiftKey&&this.wheelAction(e):this.settings.wheelOn===s.options.wheelOn.hover?e.shiftKey?(e.preventDefault(),window.scrollBy(0,a.isNegativeStrict(String(e.deltaY))?-50:50)):this.wheelAction(e):a.throwError("Unknown `wheelOn` option."))}},{key:"wheelAction",value:function(e){this.isWheelEvent=!0;var t=!1,r=!1,o=!1;a.isWheelUpEvent(e)?t=!0:a.isWheelDownEvent(e)?r=!0:a.isWheelEventWithZeroDeltaY(e)?o=!0:a.throwError("The event is not a 'wheel' event."),o||this._wheelAndUpDownActions(e,t,r,this.settings.wheelStep),this.isWheelEvent=!1}},{key:"_onDrop",value:function(e){if(!this.formulaMode){this.isDropEvent=!0,e.preventDefault();var t=e.dataTransfer.getData("text/plain"),r=this.unformatOther(t),o=this.rawValue;this.set(r),this.isDropEvent=!1;var u=this.constructor._toNumericValue(r,this.settings);isNaN(Number(u))||a.trimPaddedZerosFromDecimalPlaces(o)!==a.trimPaddedZerosFromDecimalPlaces(u)&&this._triggerEvent(s.events.native.change,this.domElement)}}},{key:"_onFormSubmit",value:function(){var e=this;return this._getFormAutoNumericChildren(this.parentForm).map(function(t){return e.constructor.getAutoNumericElement(t)}).forEach(function(t){return t._unformatOnSubmit()}),!0}},{key:"_onFormReset",value:function(){var e=this;this._getFormAutoNumericChildren(this.parentForm).map(function(t){return e.constructor.getAutoNumericElement(t)}).forEach(function(t){var r=e._getDefaultValue(t.node());setTimeout(function(){return t.set(r)},0)})}},{key:"_unformatOnSubmit",value:function(){this.settings.unformatOnSubmit&&this._setElementValue(this.rawValue)}},{key:"_onKeydownGlobal",value:function(e){if(a.character(e)===l.keyName.Alt){var t=a.getHoveredElement();if(s.isManagedByAutoNumeric(t)){var r=s.getAutoNumericElement(t);!r.formulaMode&&r.settings.unformatOnHover&&this.constructor._unformatAltHovered(r)}}}},{key:"_onKeyupGlobal",value:function(e){if(a.character(e)===l.keyName.Alt){var t=a.getHoveredElement();if(s.isManagedByAutoNumeric(t)){var r=s.getAutoNumericElement(t);if(r.formulaMode||!r.settings.unformatOnHover)return;this.constructor._reformatAltHovered(r)}}}},{key:"_onCompositionstart",value:function(e){var t={key:l.keyName.Space,which:"32",keyCode:"32"},r=new KeyboardEvent("keydown",t);e.target.dispatchEvent(r),this.compositioning=!0}},{key:"_onCompositionend",value:function(e){this.compositioning=!1;var t={key:l.keyName.Space,which:"32",keyCode:"32"},r=new KeyboardEvent("keypress",t);e.target.dispatchEvent(r);var o=new KeyboardEvent("keyup",t);e.target.dispatchEvent(o)}},{key:"_isElementTagSupported",value:function(){return a.isElement(this.domElement)||a.throwError("The DOM element is not valid, ".concat(this.domElement," given.")),a.isInArray(this.domElement.tagName.toLowerCase(),this.allowedTagList)}},{key:"_isInputElement",value:function(){return this.domElement.tagName.toLowerCase()==="input"}},{key:"_isInputTypeSupported",value:function(){return this.domElement.type==="text"||this.domElement.type==="hidden"||this.domElement.type==="tel"||a.isUndefinedOrNullOrEmpty(this.domElement.type)}},{key:"_checkElement",value:function(){var e=this.domElement.tagName.toLowerCase();this._isElementTagSupported()||a.throwError("The <".concat(e,"> tag is not supported by autoNumeric")),this._isInputElement()?(this._isInputTypeSupported()||a.throwError('The input type "'.concat(this.domElement.type,'" is not supported by autoNumeric')),this.isInputElement=!0):(this.isInputElement=!1,this.isContentEditable=this._isContentEditable(this.domElement))}},{key:"_isContentEditable",value:function(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")==="true"}},{key:"_formatDefaultValueOnPageLoad",value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=!0;if(a.isNull(t)?(e=a.getElementValue(this.domElement).trim(),this.domElement.setAttribute("value",e)):e=t,this.isInputElement||this.isContentEditable){var o=this.constructor._toNumericValue(e,this.settings);if(this.domElement.hasAttribute("value")&&this.domElement.getAttribute("value")!==""){if(this.settings.defaultValueOverride!==null&&this.settings.defaultValueOverride.toString()!==e||this.settings.defaultValueOverride===null&&e!==""&&e!==this.domElement.getAttribute("value")||e!==""&&this.domElement.getAttribute("type")==="hidden"&&!a.isNumber(o)){if(this.settings.saveValueToSessionStorage&&(this.settings.decimalPlacesShownOnFocus!==null||this.settings.divisorWhenUnfocused)&&this._setRawValue(this._getValueFromPersistentStorage()),!this.settings.saveValueToSessionStorage){var u=this.constructor._removeBrackets(e,this.settings);(this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&this.settings.negativeSignCharacter!==""&&a.isNegative(e,this.settings.negativeSignCharacter)?this._setRawValue("-".concat(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))):this._setRawValue(this.constructor._stripAllNonNumberCharacters(u,this.settings,!0,this.isFocused))}r=!1}}else isNaN(Number(o))||o===1/0?a.throwError("The value [".concat(e,"] used in the input is not a valid value autoNumeric can work with.")):(this.set(o),r=!1);if(e==="")switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:break;case s.options.emptyInputBehavior.always:this._setElementValue(this.settings.currencySymbol);break;case s.options.emptyInputBehavior.min:this.set(this.settings.minimumValue);break;case s.options.emptyInputBehavior.max:this.set(this.settings.maximumValue);break;case s.options.emptyInputBehavior.zero:this.set("0");break;case s.options.emptyInputBehavior.null:this.set(null);break;default:this.set(this.settings.emptyInputBehavior)}else r&&e===this.domElement.getAttribute("value")&&this.set(e)}else this.settings.defaultValueOverride!==null&&this.settings.defaultValueOverride!==e||this.set(e)}},{key:"_calculateVMinAndVMaxIntegerSizes",value:function(){var e=X(this.settings.maximumValue.toString().split("."),1)[0],t=X(this.settings.minimumValue||this.settings.minimumValue===0?this.settings.minimumValue.toString().split("."):[],1)[0];e=e.replace(this.settings.negativeSignCharacter,""),t=t.replace(this.settings.negativeSignCharacter,""),this.settings.mIntPos=Math.max(e.length,1),this.settings.mIntNeg=Math.max(t.length,1)}},{key:"_calculateValuesToStringsKeys",value:function(){this.settings.valuesToStrings?this.valuesToStringsKeys=Object.keys(this.settings.valuesToStrings):this.valuesToStringsKeys=[]}},{key:"_transformOptionsValuesToDefaultTypes",value:function(){for(var e in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,e)){var t=this.settings[e];t!=="true"&&t!=="false"||(this.settings[e]=t==="true"),typeof t=="number"&&(this.settings[e]=t.toString())}}},{key:"_setSettings",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];!t&&a.isNull(e)||this.constructor._convertOldOptionsToNewOnes(e),t?("decimalPlacesRawValue"in e&&(this.settings.originalDecimalPlacesRawValue=e.decimalPlacesRawValue),"decimalPlaces"in e&&(this.settings.originalDecimalPlaces=e.decimalPlaces),this.constructor._calculateDecimalPlacesOnUpdate(e,this.settings),this._mergeSettings(e)):(this.settings={},this._mergeSettings(this.constructor.getDefaultConfig(),this.domElement.dataset,e,{rawValue:this.defaultRawValue}),this.caretFix=!1,this.throwInput=!0,this.allowedTagList=l.allowedTagList,this.runOnce=!1,this.hoveredWithAlt=!1),this._transformOptionsValuesToDefaultTypes(),this._runCallbacksFoundInTheSettingsObject(),this.constructor._correctNegativePositiveSignPlacementOption(this.settings),this.constructor._correctCaretPositionOnFocusAndSelectOnFocusOptions(this.settings),this.constructor._setNegativePositiveSignPermissions(this.settings),t||(a.isNull(e)||!e.decimalPlaces?this.settings.originalDecimalPlaces=null:this.settings.originalDecimalPlaces=e.decimalPlaces,this.settings.originalDecimalPlacesRawValue=this.settings.decimalPlacesRawValue,this.constructor._calculateDecimalPlacesOnInit(this.settings)),this._calculateVMinAndVMaxIntegerSizes(),this._setTrailingNegativeSignInfo(),this.regex={},this.constructor._cachesUsualRegularExpressions(this.settings,this.regex),this.constructor._setBrackets(this.settings),this._calculateValuesToStringsKeys(),a.isEmptyObj(this.settings)&&a.throwError("Unable to set the settings, those are invalid ; an empty object was given."),this.constructor.validate(this.settings,!1,e),this._keepAnOriginalSettingsCopy()}},{key:"_preparePastedText",value:function(e){return this.constructor._stripAllNonNumberCharacters(e,this.settings,!0,this.isFocused)}},{key:"_updateInternalProperties",value:function(){this.selection=a.getElementSelection(this.domElement),this.processed=!1}},{key:"_updateEventKeyInfo",value:function(e){this.eventKey=a.character(e)}},{key:"_saveCancellableValue",value:function(){this.savedCancellableValue=this.rawValue}},{key:"_setSelection",value:function(e,t){e=Math.max(e,0),t=Math.min(t,a.getElementValue(this.domElement).length),this.selection={start:e,end:t,length:t-e},a.setElementSelection(this.domElement,e,t)}},{key:"_setCaretPosition",value:function(e){this._setSelection(e,e)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=a.getElementValue(this.domElement);return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=X(this._getLeftAndRightPartAroundTheSelection(),2),t=e[0],r=e[1];if(t===""&&r==="")return["",""];var o=!0;return this.eventKey!==l.keyName.Hyphen&&this.eventKey!==l.keyName.Minus||Number(t)!==0||(o=!1),this.isTrailingNegative&&(a.isNegative(r,this.settings.negativeSignCharacter)&&!a.isNegative(t,this.settings.negativeSignCharacter)||r===""&&a.isNegative(t,this.settings.negativeSignCharacter,!0))&&(t=t.replace(this.settings.negativeSignCharacter,""),r=r.replace(this.settings.negativeSignCharacter,""),t=t.replace("-",""),r=r.replace("-",""),t="-".concat(t)),[t=s._stripAllNonNumberCharactersExceptCustomDecimalChar(t,this.settings,o,this.isFocused),r=s._stripAllNonNumberCharactersExceptCustomDecimalChar(r,this.settings,!1,this.isFocused)]}},{key:"_normalizeParts",value:function(e,t){var r=!0;this.eventKey!==l.keyName.Hyphen&&this.eventKey!==l.keyName.Minus||Number(e)!==0||(r=!1),this.isTrailingNegative&&a.isNegative(t,this.settings.negativeSignCharacter)&&!a.isNegative(e,this.settings.negativeSignCharacter)&&(e="-".concat(e),t=t.replace(this.settings.negativeSignCharacter,"")),e=s._stripAllNonNumberCharactersExceptCustomDecimalChar(e,this.settings,r,this.isFocused),t=s._stripAllNonNumberCharactersExceptCustomDecimalChar(t,this.settings,!1,this.isFocused),this.settings.leadingZero!==s.options.leadingZero.deny||this.eventKey!==l.keyName.num0&&this.eventKey!==l.keyName.numpad0||Number(e)!==0||a.contains(e,this.settings.decimalCharacter)||t===""||(e=e.substring(0,e.length-1));var o=e+t;if(this.settings.decimalCharacter){var u=o.match(new RegExp("^".concat(this.regex.aNegRegAutoStrip,"\\").concat(this.settings.decimalCharacter)));u&&(o=(e=e.replace(u[1],u[1]+"0"))+t)}return[e,t,o]}},{key:"_setValueParts",value:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=X(this._normalizeParts(e,t),3),u=o[0],g=o[1],S=o[2],E=X(s._checkIfInRangeWithOverrideOption(S,this.settings),2),O=E[0],d=E[1];if(O&&d){var T=s._truncateDecimalPlaces(S,this.settings,r,this.settings.decimalPlacesRawValue).replace(this.settings.decimalCharacter,".");if(T===""||T===this.settings.negativeSignCharacter){var D;switch(this.settings.emptyInputBehavior){case s.options.emptyInputBehavior.focus:case s.options.emptyInputBehavior.press:case s.options.emptyInputBehavior.always:D="";break;case s.options.emptyInputBehavior.min:D=this.settings.minimumValue;break;case s.options.emptyInputBehavior.max:D=this.settings.maximumValue;break;case s.options.emptyInputBehavior.zero:D="0";break;case s.options.emptyInputBehavior.null:D=null;break;default:D=this.settings.emptyInputBehavior}this._setRawValue(D)}else this._setRawValue(this._trimLeadingAndTrailingZeros(T));var $=s._truncateDecimalPlaces(S,this.settings,r,this.settings.decimalPlacesShownOnFocus),W=u.length;return W>$.length&&(W=$.length),W===1&&u==="0"&&this.settings.leadingZero===s.options.leadingZero.deny&&(W=g===""||u==="0"&&g!==""?1:0),this._setElementValue($,!1),this._setCaretPosition(W),!0}return this._triggerRangeEvents(O,d),!1}},{key:"_getSignPosition",value:function(){var e;if(this.settings.currencySymbol){var t=this.settings.currencySymbol.length,r=a.getElementValue(this.domElement);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)e=this.settings.negativeSignCharacter&&r&&r.charAt(0)===this.settings.negativeSignCharacter?[1,t+1]:[0,t];else{var o=r.length;e=[o-t,o]}}else e=[1e3,-1];return e}},{key:"_expandSelectionOnSign",value:function(){var e=X(this._getSignPosition(),2),t=e[0],r=e[1],o=this.selection;o.start<r&&o.end>t&&((o.start<t||o.end>r)&&a.getElementValue(this.domElement).substring(Math.max(o.start,t),Math.min(o.end,r)).match(/^\s*$/)?o.start<t?this._setSelection(o.start,t):this._setSelection(r,o.end):this._setSelection(Math.min(o.start,t),Math.max(o.end,r)))}},{key:"_checkPaste",value:function(){if(!this.formatted&&!a.isUndefined(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,t=X(this._getLeftAndRightPartAroundTheSelection(),2),r=t[0],o=t[1];delete this.valuePartsBeforePaste;var u=r.substr(0,e[0].length)+s._stripAllNonNumberCharactersExceptCustomDecimalChar(r.substr(e[0].length),this.settings,!0,this.isFocused);this._setValueParts(u,o,!0)||(this._setElementValue(e.join(""),!1),this._setCaretPosition(e[0].length))}}},{key:"_processNonPrintableKeysAndShortcuts",value:function(e){if((e.ctrlKey||e.metaKey)&&e.type==="keyup"&&!a.isUndefined(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKey===l.keyName.Insert)return this._checkPaste(),!1;if(this.constructor._shouldSkipEventKey(this.eventKey))return!0;if((e.ctrlKey||e.metaKey)&&this.eventKey===l.keyName.a)return this.settings.selectNumberOnly&&(e.preventDefault(),this.selectNumber()),!0;if((e.ctrlKey||e.metaKey)&&(this.eventKey===l.keyName.c||this.eventKey===l.keyName.v||this.eventKey===l.keyName.x))return e.type==="keydown"&&this._expandSelectionOnSign(),this.eventKey!==l.keyName.v&&this.eventKey!==l.keyName.Insert||(e.type==="keydown"||e.type==="keypress"?a.isUndefined(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),e.type==="keydown"||e.type==="keypress"||this.eventKey===l.keyName.c;if(e.ctrlKey||e.metaKey)return!(this.eventKey===l.keyName.Z||this.eventKey===l.keyName.z);if(this.eventKey===l.keyName.LeftArrow||this.eventKey===l.keyName.RightArrow){if(e.type==="keydown"&&!e.shiftKey){var t=a.getElementValue(this.domElement);this.eventKey!==l.keyName.LeftArrow||t.charAt(this.selection.start-2)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start-2)!==this.settings.decimalCharacter?this.eventKey!==l.keyName.RightArrow||t.charAt(this.selection.start+1)!==this.settings.digitGroupSeparator&&t.charAt(this.selection.start+1)!==this.settings.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)}return!0}return a.isInArray(this.eventKey,l.keyName._directionKeys)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var t=X(e,2),r=t[0],o=t[1],u=a.getElementValue(this.domElement),g=a.isNegative(u,this.settings.negativeSignCharacter);if(this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix&&(this.eventKey===l.keyName.Backspace?(this.caretFix=this.selection.start>=u.indexOf(this.settings.suffixText)&&this.settings.suffixText!=="",u.charAt(this.selection.start-1)==="-"?r=r.substring(1):this.selection.start<=u.length-this.settings.suffixText.length&&(r=r.substring(0,r.length-1))):(this.caretFix=this.selection.start>=u.indexOf(this.settings.suffixText)&&this.settings.suffixText!=="",this.selection.start>=u.indexOf(this.settings.currencySymbol)+this.settings.currencySymbol.length&&(o=o.substring(1,o.length)),a.isNegative(r,this.settings.negativeSignCharacter)&&u.charAt(this.selection.start)==="-"&&(r=r.substring(1)))),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)switch(this.settings.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===l.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length&&g?r=r.substring(1):r!=="-"&&(this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)||!g)&&(r=r.substring(0,r.length-1)):(r[0]==="-"&&(o=o.substring(1)),this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&g&&(r=r.substring(1)));break;case s.options.negativePositiveSignPlacement.right:this.caretFix=this.selection.start>=u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length,this.eventKey===l.keyName.Backspace?this.selection.start===u.indexOf(this.settings.negativeSignCharacter)+this.settings.negativeSignCharacter.length?r=r.substring(1):r!=="-"&&this.selection.start<=u.indexOf(this.settings.negativeSignCharacter)-this.settings.currencySymbol.length?r=r.substring(0,r.length-1):r===""||g||(r=r.substring(0,r.length-1)):(this.caretFix=this.selection.start>=u.indexOf(this.settings.currencySymbol)&&this.settings.currencySymbol!=="",this.selection.start===u.indexOf(this.settings.negativeSignCharacter)&&(r=r.substring(1)),o=o.substring(1))}return[r,o]}},{key:"_processCharacterDeletion",value:function(e){var t,r;if(this.selection.length){this._expandSelectionOnSign();var o=X(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);t=o[0],r=o[1]}else{var u=X(this._getUnformattedLeftAndRightPartAroundTheSelection(),2);if(t=u[0],r=u[1],t===""&&r===""&&(this.throwInput=!1),this.isTrailingNegative&&a.isNegative(a.getElementValue(this.domElement),this.settings.negativeSignCharacter)){var g=X(this._processCharacterDeletionIfTrailingNegativeSign([t,r]),2);t=g[0],r=g[1]}else this.eventKey===l.keyName.Backspace?t=t.substring(0,t.length-1):r=r.substring(1,r.length)}return!!this.constructor._isWithinRangeWithOverrideOption("".concat(t).concat(r),this.settings)&&a.getElementValue(e.target)!==this.settings.currencySymbol&&(this._setValueParts(t,r),!0)}},{key:"_isDecimalCharacterInsertionAllowed",value:function(){return String(this.settings.decimalPlacesShownOnFocus)!==String(s.options.decimalPlacesShownOnFocus.none)&&String(this.settings.decimalPlaces)!==String(s.options.decimalPlaces.none)}},{key:"_processCharacterInsertion",value:function(){var e=X(this._getUnformattedLeftAndRightPartAroundTheSelection(),2),t=e[0],r=e[1];if(this.eventKey!==l.keyName.AndroidDefault&&(this.throwInput=!0),this.eventKey===this.settings.decimalCharacter||this.settings.decimalCharacterAlternative&&this.eventKey===this.settings.decimalCharacterAlternative){if(!this._isDecimalCharacterInsertionAllowed()||!this.settings.decimalCharacter)return!1;if(this.settings.alwaysAllowDecimalCharacter)t=t.replace(this.settings.decimalCharacter,""),r=r.replace(this.settings.decimalCharacter,"");else{if(a.contains(t,this.settings.decimalCharacter)||r.indexOf(this.settings.decimalCharacter)>0)return!0;r.indexOf(this.settings.decimalCharacter)===0&&(r=r.substr(1))}return this.settings.negativeSignCharacter&&a.contains(r,this.settings.negativeSignCharacter)&&(t="".concat(this.settings.negativeSignCharacter).concat(t),r=r.replace(this.settings.negativeSignCharacter,"")),this._setValueParts(t+this.settings.decimalCharacter,r),!0}if((this.eventKey==="-"||this.eventKey==="+")&&this.settings.isNegativeSignAllowed)return t===""&&a.contains(r,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="+")&&(r=r.replace("-","")):a.isNegativeStrict(t,"-")?(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="+")&&(t=t.replace("-","")):(this.settings.negativePositiveSignBehavior||!this.settings.negativePositiveSignBehavior&&this.eventKey==="-")&&(t="".concat(this.settings.negativeSignCharacter).concat(t)),this._setValueParts(t,r),!0;var o=Number(this.eventKey);return o>=0&&o<=9?(this.settings.isNegativeSignAllowed&&t===""&&a.contains(r,"-")&&(t="-",r=r.substring(1,r.length)),this.settings.maximumValue<=0&&this.settings.minimumValue<this.settings.maximumValue&&!a.contains(a.getElementValue(this.domElement),this.settings.negativeSignCharacter)&&this.eventKey!=="0"&&(t="-".concat(t)),this._setValueParts("".concat(t).concat(this.eventKey),r),!0):(this.throwInput=!1,!1)}},{key:"_formatValue",value:function(e){var t=a.getElementValue(this.domElement),r=X(this._getUnformattedLeftAndRightPartAroundTheSelection(),1)[0];if((this.settings.digitGroupSeparator===""||this.settings.digitGroupSeparator!==""&&!a.contains(t,this.settings.digitGroupSeparator))&&(this.settings.currencySymbol===""||this.settings.currencySymbol!==""&&!a.contains(t,this.settings.currencySymbol))){var o=X(t.split(this.settings.decimalCharacter),1)[0],u="";a.isNegative(o,this.settings.negativeSignCharacter)&&(u=this.settings.negativeSignCharacter,o=o.replace(this.settings.negativeSignCharacter,""),r=r.replace("-","")),u===""&&o.length>this.settings.mIntPos&&r.charAt(0)==="0"&&(r=r.slice(1)),u===this.settings.negativeSignCharacter&&o.length>this.settings.mIntNeg&&r.charAt(0)==="0"&&(r=r.slice(1)),this.isTrailingNegative||(r="".concat(u).concat(r))}var g=this.constructor._addGroupSeparators(t,this.settings,this.isFocused,this.rawValue),S=g.length;if(g){var E,O=r.split("");if((this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix||this.settings.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.prefix&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)&&O[0]===this.settings.negativeSignCharacter&&!this.settings.isNegativeSignAllowed&&(O.shift(),(this.eventKey===l.keyName.Backspace||this.eventKey===l.keyName.Delete)&&this.caretFix&&((this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.left||this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.suffix)&&(O.push(this.settings.negativeSignCharacter),this.caretFix=e.type==="keydown"),this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&this.settings.negativePositiveSignPlacement===s.options.negativePositiveSignPlacement.right))){var d=this.settings.currencySymbol.split(""),T=["\\","^","$",".","|","?","*","+","(",")","["],D=[];d.forEach(function(ee,qe){qe=d[ee],a.isInArray(qe,T)?D.push("\\"+qe):D.push(qe)}),this.eventKey===l.keyName.Backspace&&this.settings.negativeSignCharacter==="-"&&D.push("-"),O.push(D.join("")),this.caretFix=e.type==="keydown"}for(var $=0;$<O.length;$++)O[$].match("\\d")||(O[$]="\\"+O[$]);E=this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix?new RegExp("^.*?".concat(O.join(".*?"))):new RegExp("^.*?[".concat(this.settings.currencySymbol,"]*").concat(O.join(".*?")));var W=g.match(E);W?(S=W[0].length,this.settings.showPositiveSign&&(S===0&&W.input.charAt(0)===this.settings.positiveSignCharacter&&(S=W.input.indexOf(this.settings.currencySymbol)===1?this.settings.currencySymbol.length+1:1),S===0&&W.input.charAt(this.settings.currencySymbol.length)===this.settings.positiveSignCharacter&&(S=this.settings.currencySymbol.length+1)),(S===0&&g.charAt(0)!==this.settings.negativeSignCharacter||S===1&&g.charAt(0)===this.settings.negativeSignCharacter)&&this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix&&(S=this.settings.currencySymbol.length+(a.isNegativeStrict(g,this.settings.negativeSignCharacter)?1:0))):(this.settings.currencySymbol&&this.settings.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix&&(S-=this.settings.currencySymbol.length),this.settings.suffixText&&(S-=this.settings.suffixText.length))}g!==t&&(this._setElementValue(g,!1),this._setCaretPosition(S)),this.formatted=!0}}],F=[{key:"version",value:function(){return"4.10.8"}},{key:"_setArgumentsValues",value:function(e,t,r){a.isNull(e)&&a.throwError("At least one valid parameter is needed in order to initialize an AutoNumeric object");var o,u,g,S=a.isElement(e),E=a.isString(e),O=a.isObject(t),d=Array.isArray(t)&&t.length>0,T=a.isNumberOrArabic(t)||t==="",D=this._isPreDefinedOptionValid(t),$=a.isNull(t),W=a.isEmptyString(t),ee=a.isObject(r),qe=Array.isArray(r)&&r.length>0,rt=a.isNull(r),st=this._isPreDefinedOptionValid(r);return S&&$&&rt?(o=e,g=null,u=null):S&&T&&rt?(o=e,g=t,u=null):S&&O&&rt?(o=e,g=null,u=t):S&&D&&rt?(o=e,g=null,u=this._getOptionObject(t)):S&&d&&rt?(o=e,g=null,u=this.mergeOptions(t)):S&&($||W)&&ee?(o=e,g=null,u=r):S&&($||W)&&qe?(o=e,g=null,u=this.mergeOptions(r)):E&&$&&rt?(o=document.querySelector(e),g=null,u=null):E&&O&&rt?(o=document.querySelector(e),g=null,u=t):E&&D&&rt?(o=document.querySelector(e),g=null,u=this._getOptionObject(t)):E&&d&&rt?(o=document.querySelector(e),g=null,u=this.mergeOptions(t)):E&&($||W)&&ee?(o=document.querySelector(e),g=null,u=r):E&&($||W)&&qe?(o=document.querySelector(e),g=null,u=this.mergeOptions(r)):E&&T&&rt?(o=document.querySelector(e),g=t,u=null):E&&T&&ee?(o=document.querySelector(e),g=t,u=r):E&&T&&st?(o=document.querySelector(e),g=t,u=this._getOptionObject(r)):E&&T&&qe?(o=document.querySelector(e),g=t,u=this.mergeOptions(r)):S&&T&&ee?(o=e,g=t,u=r):S&&T&&st?(o=e,g=t,u=this._getOptionObject(r)):S&&T&&qe?(o=e,g=t,u=this.mergeOptions(r)):a.throwError("The parameters given to the AutoNumeric object are not valid, '".concat(e,"', '").concat(t,"' and '").concat(r,"' given.")),a.isNull(o)&&a.throwError("The selector '".concat(e,"' did not select any valid DOM element. Please check on which element you called AutoNumeric.")),{domElement:o,initialValue:g,userOptions:u}}},{key:"mergeOptions",value:function(e){var t=this,r={};return e.forEach(function(o){re(r,t._getOptionObject(o))}),r}},{key:"_isPreDefinedOptionValid",value:function(e){return Object.prototype.hasOwnProperty.call(s.predefinedOptions,e)}},{key:"_getOptionObject",value:function(e){var t;return a.isString(e)?(t=s.getPredefinedOptions()[e])==null&&a.warning("The given pre-defined option [".concat(e,"] is not recognized by autoNumeric. Please check that pre-defined option name."),!0):t=e,t}},{key:"_doesFormHandlerListExists",value:function(){var e=J(window.aNFormHandlerMap);return e!=="undefined"&&e==="object"}},{key:"_createFormHandlerList",value:function(){window.aNFormHandlerMap=new Map}},{key:"_checkValuesToStringsArray",value:function(e,t){return a.isInArray(String(e),t)}},{key:"_checkValuesToStringsSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.keys(t.valuesToStrings))}},{key:"_checkStringsToValuesSettings",value:function(e,t){return this._checkValuesToStringsArray(e,Object.values(t.valuesToStrings))}},{key:"_unformatAltHovered",value:function(e){e.hoveredWithAlt=!0,e.unformat()}},{key:"_reformatAltHovered",value:function(e){e.hoveredWithAlt=!1,e.reformat()}},{key:"_getChildANInputElement",value:function(e){var t=this,r=e.getElementsByTagName("input"),o=[];return Array.prototype.slice.call(r,0).forEach(function(u){t.test(u)&&o.push(u)}),o}},{key:"test",value:function(e){return this._isInGlobalList(a.domElement(e))}},{key:"_createWeakMap",value:function(e){window[e]=new WeakMap}},{key:"_createGlobalList",value:function(){this.autoNumericGlobalListName="autoNumericGlobalList",this._createWeakMap(this.autoNumericGlobalListName)}},{key:"_doesGlobalListExists",value:function(){var e=J(window[this.autoNumericGlobalListName]);return e!=="undefined"&&e==="object"}},{key:"_addToGlobalList",value:function(e){this._doesGlobalListExists()||this._createGlobalList();var t=e.node();if(this._isInGlobalList(t)){if(this._getFromGlobalList(t)===this)return;a.warning("A reference to the DOM element you just initialized already exists in the global AutoNumeric element list. Please make sure to not initialize the same DOM element multiple times.",e.getSettings().showWarnings)}window[this.autoNumericGlobalListName].set(t,e)}},{key:"_removeFromGlobalList",value:function(e){this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].delete(e.node())}},{key:"_getFromGlobalList",value:function(e){return this._doesGlobalListExists()?window[this.autoNumericGlobalListName].get(e):null}},{key:"_isInGlobalList",value:function(e){return!!this._doesGlobalListExists()&&window[this.autoNumericGlobalListName].has(e)}},{key:"validate",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;!a.isUndefinedOrNullOrEmpty(e)&&a.isObject(e)||a.throwError("The userOptions are invalid ; it should be a valid object, [".concat(e,"] given."));var o,u=a.isObject(r);u||a.isNull(r)||a.throwError("The 'originalOptions' parameter is invalid ; it should either be a valid option object or `null`, [".concat(e,"] given.")),a.isNull(e)||this._convertOldOptionsToNewOnes(e),o=t?re({},this.getDefaultConfig(),e):e,a.isTrueOrFalseString(o.showWarnings)||a.isBoolean(o.showWarnings)||a.throwError("The debug option 'showWarnings' is invalid ; it should be either 'true' or 'false', [".concat(o.showWarnings,"] given."));var g,S=/^[0-9]+$/,E=/[0-9]+/,O=/^-?[0-9]+(\.?[0-9]+)?$/,d=/^[0-9]+(\.?[0-9]+)?$/;a.isTrueOrFalseString(o.allowDecimalPadding)||a.isBoolean(o.allowDecimalPadding)||o.allowDecimalPadding===s.options.allowDecimalPadding.floats||a.isNumber(o.allowDecimalPadding)&&o.allowDecimalPadding>0||a.throwError("The decimal padding option 'allowDecimalPadding' is invalid ; it should either be `false`, `true`, `'floats'` or a positive integer superior to 0, [".concat(o.allowDecimalPadding,"] given.")),a.isNumber(o.allowDecimalPadding)&&o.allowDecimalPadding>o.decimalPlaces&&a.warning("Setting 'allowDecimalPadding' to a number [".concat(o.allowDecimalPadding,"] superior to the current 'decimalPlaces' settings [").concat(o.decimalPlaces,"] is useless, since the padding will not be shown."),o.showWarnings),o.allowDecimalPadding!==s.options.allowDecimalPadding.never&&o.allowDecimalPadding!=="false"||o.decimalPlaces===s.options.decimalPlaces.none&&o.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.none&&o.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.none||a.warning("Setting 'allowDecimalPadding' to [".concat(o.allowDecimalPadding,"] will override the current 'decimalPlaces*' settings [").concat(o.decimalPlaces,", ").concat(o.decimalPlacesShownOnBlur," and ").concat(o.decimalPlacesShownOnFocus,"]."),o.showWarnings),a.isTrueOrFalseString(o.alwaysAllowDecimalCharacter)||a.isBoolean(o.alwaysAllowDecimalCharacter)||a.throwError("The option 'alwaysAllowDecimalCharacter' is invalid ; it should either be `true` or `false`, [".concat(o.alwaysAllowDecimalCharacter,"] given.")),a.isNull(o.caretPositionOnFocus)||a.isInArray(o.caretPositionOnFocus,[s.options.caretPositionOnFocus.start,s.options.caretPositionOnFocus.end,s.options.caretPositionOnFocus.decimalLeft,s.options.caretPositionOnFocus.decimalRight])||a.throwError("The display on empty string option 'caretPositionOnFocus' is invalid ; it should either be `null`, 'focus', 'press', 'always' or 'zero', [".concat(o.caretPositionOnFocus,"] given.")),g=u?r:this._correctCaretPositionOnFocusAndSelectOnFocusOptions(e),a.isNull(g)||g.caretPositionOnFocus===s.options.caretPositionOnFocus.doNoForceCaretPosition||g.selectOnFocus!==s.options.selectOnFocus.select||a.warning("The 'selectOnFocus' option is set to 'select', which is in conflict with the 'caretPositionOnFocus' which is set to '".concat(g.caretPositionOnFocus,"'. As a result, if this has been called when instantiating an AutoNumeric object, the 'selectOnFocus' option is forced to 'doNotSelect'."),o.showWarnings),a.isInArray(o.digitGroupSeparator,[s.options.digitGroupSeparator.comma,s.options.digitGroupSeparator.dot,s.options.digitGroupSeparator.normalSpace,s.options.digitGroupSeparator.thinSpace,s.options.digitGroupSeparator.narrowNoBreakSpace,s.options.digitGroupSeparator.noBreakSpace,s.options.digitGroupSeparator.noSeparator,s.options.digitGroupSeparator.apostrophe,s.options.digitGroupSeparator.arabicThousandsSeparator,s.options.digitGroupSeparator.dotAbove,s.options.digitGroupSeparator.privateUseTwo])||a.throwError(`The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '\u066C', '\u02D9', "'", '\x92', ' ', '\u2009', '\u202F', '\xA0' or empty (''), [`.concat(o.digitGroupSeparator,"] given.")),a.isTrueOrFalseString(o.showOnlyNumbersOnFocus)||a.isBoolean(o.showOnlyNumbersOnFocus)||a.throwError("The 'showOnlyNumbersOnFocus' option is invalid ; it should be either 'true' or 'false', [".concat(o.showOnlyNumbersOnFocus,"] given.")),a.isInArray(o.digitalGroupSpacing,[s.options.digitalGroupSpacing.two,s.options.digitalGroupSpacing.twoThree,s.options.digitalGroupSpacing.twoScaled,s.options.digitalGroupSpacing.three,s.options.digitalGroupSpacing.four])||o.digitalGroupSpacing>=2&&o.digitalGroupSpacing<=4||a.throwError("The grouping separator option for thousands 'digitalGroupSpacing' is invalid ; it should be '2', '2t', '2s', '3', or '4', [".concat(o.digitalGroupSpacing,"] given.")),a.isInArray(o.decimalCharacter,[s.options.decimalCharacter.comma,s.options.decimalCharacter.dot,s.options.decimalCharacter.middleDot,s.options.decimalCharacter.arabicDecimalSeparator,s.options.decimalCharacter.decimalSeparatorKeySymbol])||a.throwError("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '\xB7', '\u2396' or '\u066B', [".concat(o.decimalCharacter,"] given.")),o.decimalCharacter===o.digitGroupSeparator&&a.throwError("autoNumeric will not function properly when the decimal character 'decimalCharacter' [".concat(o.decimalCharacter,"] and the thousand separator 'digitGroupSeparator' [").concat(o.digitGroupSeparator,"] are the same character.")),a.isNull(o.decimalCharacterAlternative)||a.isString(o.decimalCharacterAlternative)||a.throwError("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, [".concat(o.decimalCharacterAlternative,"] given.")),o.currencySymbol===""||a.isString(o.currencySymbol)||a.throwError("The currency symbol option 'currencySymbol' is invalid ; it should be a string, [".concat(o.currencySymbol,"] given.")),a.isInArray(o.currencySymbolPlacement,[s.options.currencySymbolPlacement.prefix,s.options.currencySymbolPlacement.suffix])||a.throwError("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), [".concat(o.currencySymbolPlacement,"] given.")),a.isInArray(o.negativePositiveSignPlacement,[s.options.negativePositiveSignPlacement.prefix,s.options.negativePositiveSignPlacement.suffix,s.options.negativePositiveSignPlacement.left,s.options.negativePositiveSignPlacement.right,s.options.negativePositiveSignPlacement.none])||a.throwError("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', [".concat(o.negativePositiveSignPlacement,"] given.")),a.isTrueOrFalseString(o.showPositiveSign)||a.isBoolean(o.showPositiveSign)||a.throwError("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'true' or 'false', [".concat(o.showPositiveSign,"] given.")),(!a.isString(o.suffixText)||o.suffixText!==""&&(a.isNegative(o.suffixText,o.negativeSignCharacter)||E.test(o.suffixText)))&&a.throwError("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '".concat(o.negativeSignCharacter,"' nor any numerical characters, [").concat(o.suffixText,"] given.")),(!a.isString(o.negativeSignCharacter)||o.negativeSignCharacter.length!==1||a.isUndefinedOrNullOrEmpty(o.negativeSignCharacter)||E.test(o.negativeSignCharacter))&&a.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(o.negativeSignCharacter,"] given.")),(!a.isString(o.positiveSignCharacter)||o.positiveSignCharacter.length!==1||a.isUndefinedOrNullOrEmpty(o.positiveSignCharacter)||E.test(o.positiveSignCharacter))&&a.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should be a single character, and cannot be any numerical characters, [".concat(o.positiveSignCharacter,"] given.\nIf you want to show the positive sign character, you need to set the `showPositiveSign` option to `true`.")),o.negativeSignCharacter===o.positiveSignCharacter&&a.throwError("The positive 'positiveSignCharacter' and negative 'negativeSignCharacter' sign characters cannot be identical ; [".concat(o.negativeSignCharacter,"] given.")),a.isTrueOrFalseString(o.negativePositiveSignBehavior)||a.isBoolean(o.negativePositiveSignBehavior)||a.throwError("The option 'negativePositiveSignBehavior' is invalid ; it should be either 'true' or 'false', [".concat(o.negativePositiveSignBehavior,"] given."));var T=X(a.isNull(o.negativeBracketsTypeOnBlur)?["",""]:o.negativeBracketsTypeOnBlur.split(","),2),D=T[0],$=T[1];(a.contains(o.digitGroupSeparator,o.negativeSignCharacter)||a.contains(o.decimalCharacter,o.negativeSignCharacter)||a.contains(o.decimalCharacterAlternative,o.negativeSignCharacter)||a.contains(D,o.negativeSignCharacter)||a.contains($,o.negativeSignCharacter)||a.contains(o.suffixText,o.negativeSignCharacter))&&a.throwError("The negative sign character option 'negativeSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(o.negativeSignCharacter,"] given.")),(a.contains(o.digitGroupSeparator,o.positiveSignCharacter)||a.contains(o.decimalCharacter,o.positiveSignCharacter)||a.contains(o.decimalCharacterAlternative,o.positiveSignCharacter)||a.contains(D,o.positiveSignCharacter)||a.contains($,o.positiveSignCharacter)||a.contains(o.suffixText,o.positiveSignCharacter))&&a.throwError("The positive sign character option 'positiveSignCharacter' is invalid ; it should not be equal or a part of the digit separator, the decimal character, the decimal character alternative, the negative brackets or the suffix text, [".concat(o.positiveSignCharacter,"] given.")),a.isNull(o.overrideMinMaxLimits)||a.isInArray(o.overrideMinMaxLimits,[s.options.overrideMinMaxLimits.ceiling,s.options.overrideMinMaxLimits.floor,s.options.overrideMinMaxLimits.ignore,s.options.overrideMinMaxLimits.invalid])||a.throwError("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor', 'ignore' or 'invalid', [".concat(o.overrideMinMaxLimits,"] given.")),o.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.invalid&&o.overrideMinMaxLimits!==s.options.overrideMinMaxLimits.ignore&&(o.minimumValue>0||o.maximumValue<0)&&a.warning("You've set a `minimumValue` or a `maximumValue` excluding the value `0`. AutoNumeric will force the users to always have a valid value in the input, hence preventing them to clear the field. If you want to allow for temporary invalid values (i.e. out-of-range), you should use the 'invalid' option for the 'overrideMinMaxLimits' setting."),a.isString(o.maximumValue)&&O.test(o.maximumValue)||a.throwError("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.maximumValue,"] given.")),a.isString(o.minimumValue)&&O.test(o.minimumValue)||a.throwError("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.minimumValue,"] given.")),parseFloat(o.minimumValue)>parseFloat(o.maximumValue)&&a.throwError("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' [".concat(o.minimumValue,"] should be smaller than 'maximumValue' [").concat(o.maximumValue,"].")),a.isInt(o.decimalPlaces)&&o.decimalPlaces>=0||a.isString(o.decimalPlaces)&&S.test(o.decimalPlaces)||a.throwError("The number of decimal places option 'decimalPlaces' is invalid ; it should be a positive integer, [".concat(o.decimalPlaces,"] given.")),a.isNull(o.decimalPlacesRawValue)||a.isInt(o.decimalPlacesRawValue)&&o.decimalPlacesRawValue>=0||a.isString(o.decimalPlacesRawValue)&&S.test(o.decimalPlacesRawValue)||a.throwError("The number of decimal places for the raw value option 'decimalPlacesRawValue' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesRawValue,"] given.")),this._validateDecimalPlacesRawValue(o),a.isNull(o.decimalPlacesShownOnFocus)||S.test(String(o.decimalPlacesShownOnFocus))||a.throwError("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesShownOnFocus,"] given.")),!a.isNull(o.decimalPlacesShownOnFocus)&&Number(o.decimalPlaces)>Number(o.decimalPlacesShownOnFocus)&&a.warning("The extended decimal places 'decimalPlacesShownOnFocus' [".concat(o.decimalPlacesShownOnFocus,"] should be greater than the 'decimalPlaces' [").concat(o.decimalPlaces,"] value. Currently, this will limit the ability of your user to manually change some of the decimal places. Do you really want to do that?"),o.showWarnings),(a.isNull(o.divisorWhenUnfocused)||d.test(o.divisorWhenUnfocused))&&o.divisorWhenUnfocused!==0&&o.divisorWhenUnfocused!=="0"&&o.divisorWhenUnfocused!==1&&o.divisorWhenUnfocused!=="1"||a.throwError("The divisor option 'divisorWhenUnfocused' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(o.divisorWhenUnfocused,"] given.")),a.isNull(o.decimalPlacesShownOnBlur)||S.test(o.decimalPlacesShownOnBlur)||a.throwError("The number of decimals shown when unfocused option 'decimalPlacesShownOnBlur' is invalid ; it should be a positive integer or `null`, [".concat(o.decimalPlacesShownOnBlur,"] given.")),a.isNull(o.symbolWhenUnfocused)||a.isString(o.symbolWhenUnfocused)||a.throwError("The symbol to show when unfocused option 'symbolWhenUnfocused' is invalid ; it should be a string, [".concat(o.symbolWhenUnfocused,"] given.")),a.isTrueOrFalseString(o.saveValueToSessionStorage)||a.isBoolean(o.saveValueToSessionStorage)||a.throwError("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'true' or 'false', [".concat(o.saveValueToSessionStorage,"] given.")),a.isInArray(o.onInvalidPaste,[s.options.onInvalidPaste.error,s.options.onInvalidPaste.ignore,s.options.onInvalidPaste.clamp,s.options.onInvalidPaste.truncate,s.options.onInvalidPaste.replace])||a.throwError("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), [".concat(o.onInvalidPaste,"] given.")),a.isInArray(o.roundingMethod,[s.options.roundingMethod.halfUpSymmetric,s.options.roundingMethod.halfUpAsymmetric,s.options.roundingMethod.halfDownSymmetric,s.options.roundingMethod.halfDownAsymmetric,s.options.roundingMethod.halfEvenBankersRounding,s.options.roundingMethod.upRoundAwayFromZero,s.options.roundingMethod.downRoundTowardZero,s.options.roundingMethod.toCeilingTowardPositiveInfinity,s.options.roundingMethod.toFloorTowardNegativeInfinity,s.options.roundingMethod.toNearest05,s.options.roundingMethod.toNearest05Alt,s.options.roundingMethod.upToNext05,s.options.roundingMethod.downToNext05])||a.throwError("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), [".concat(o.roundingMethod,"] given.")),a.isNull(o.negativeBracketsTypeOnBlur)||a.isInArray(o.negativeBracketsTypeOnBlur,[s.options.negativeBracketsTypeOnBlur.parentheses,s.options.negativeBracketsTypeOnBlur.brackets,s.options.negativeBracketsTypeOnBlur.chevrons,s.options.negativeBracketsTypeOnBlur.curlyBraces,s.options.negativeBracketsTypeOnBlur.angleBrackets,s.options.negativeBracketsTypeOnBlur.japaneseQuotationMarks,s.options.negativeBracketsTypeOnBlur.halfBrackets,s.options.negativeBracketsTypeOnBlur.whiteSquareBrackets,s.options.negativeBracketsTypeOnBlur.quotationMarks,s.options.negativeBracketsTypeOnBlur.guillemets])||a.throwError("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>', '{,}', '\u3008,\u3009', '\uFF62,\uFF63', '\u2E24,\u2E25', '\u27E6,\u27E7', '\u2039,\u203A' or '\xAB,\xBB', [".concat(o.negativeBracketsTypeOnBlur,"] given.")),(a.isString(o.emptyInputBehavior)||a.isNumber(o.emptyInputBehavior))&&(a.isInArray(o.emptyInputBehavior,[s.options.emptyInputBehavior.focus,s.options.emptyInputBehavior.press,s.options.emptyInputBehavior.always,s.options.emptyInputBehavior.min,s.options.emptyInputBehavior.max,s.options.emptyInputBehavior.zero,s.options.emptyInputBehavior.null])||O.test(o.emptyInputBehavior))||a.throwError("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always', 'min', 'max', 'zero', 'null', a number, or a string that represents a number, [".concat(o.emptyInputBehavior,"] given.")),o.emptyInputBehavior===s.options.emptyInputBehavior.zero&&(o.minimumValue>0||o.maximumValue<0)&&a.throwError("The 'emptyInputBehavior' option is set to 'zero', but this value is outside of the range defined by 'minimumValue' and 'maximumValue' [".concat(o.minimumValue,", ").concat(o.maximumValue,"].")),O.test(String(o.emptyInputBehavior))&&(this._isWithinRangeWithOverrideOption(o.emptyInputBehavior,o)||a.throwError("The 'emptyInputBehavior' option is set to a number or a string that represents a number, but its value [".concat(o.emptyInputBehavior,"] is outside of the range defined by the 'minimumValue' and 'maximumValue' options [").concat(o.minimumValue,", ").concat(o.maximumValue,"]."))),a.isTrueOrFalseString(o.eventBubbles)||a.isBoolean(o.eventBubbles)||a.throwError("The event bubbles option 'eventBubbles' is invalid ; it should be either 'true' or 'false', [".concat(o.eventBubbles,"] given.")),a.isTrueOrFalseString(o.eventIsCancelable)||a.isBoolean(o.eventIsCancelable)||a.throwError("The event is cancelable option 'eventIsCancelable' is invalid ; it should be either 'true' or 'false', [".concat(o.eventIsCancelable,"] given.")),!a.isBoolean(o.invalidClass)&&/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(o.invalidClass)||a.throwError("The name of the 'invalidClass' option is not a valid CSS class name ; it should not be empty, and should follow the '^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$' regex, [".concat(o.invalidClass,"] given.")),a.isInArray(o.leadingZero,[s.options.leadingZero.allow,s.options.leadingZero.deny,s.options.leadingZero.keep])||a.throwError("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', [".concat(o.leadingZero,"] given.")),a.isTrueOrFalseString(o.formatOnPageLoad)||a.isBoolean(o.formatOnPageLoad)||a.throwError("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'true' or 'false', [".concat(o.formatOnPageLoad,"] given.")),a.isTrueOrFalseString(o.formulaMode)||a.isBoolean(o.formulaMode)||a.throwError("The formula mode option 'formulaMode' is invalid ; it should be either 'true' or 'false', [".concat(o.formulaMode,"] given.")),S.test(o.historySize)&&o.historySize!==0||a.throwError("The history size option 'historySize' is invalid ; it should be a positive integer, [".concat(o.historySize,"] given.")),a.isTrueOrFalseString(o.selectNumberOnly)||a.isBoolean(o.selectNumberOnly)||a.throwError("The select number only option 'selectNumberOnly' is invalid ; it should be either 'true' or 'false', [".concat(o.selectNumberOnly,"] given.")),a.isTrueOrFalseString(o.selectOnFocus)||a.isBoolean(o.selectOnFocus)||a.throwError("The select on focus option 'selectOnFocus' is invalid ; it should be either 'true' or 'false', [".concat(o.selectOnFocus,"] given.")),a.isNull(o.defaultValueOverride)||o.defaultValueOverride===""||O.test(o.defaultValueOverride)||a.throwError("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, [".concat(o.defaultValueOverride,"] given.")),a.isTrueOrFalseString(o.unformatOnSubmit)||a.isBoolean(o.unformatOnSubmit)||a.throwError("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'true' or 'false', [".concat(o.unformatOnSubmit,"] given.")),a.isNull(o.valuesToStrings)||a.isObject(o.valuesToStrings)||a.throwError("The option 'valuesToStrings' is invalid ; it should be an object, ideally with 'key -> value' entries, [".concat(o.valuesToStrings,"] given.")),a.isNull(o.outputFormat)||a.isInArray(o.outputFormat,[s.options.outputFormat.string,s.options.outputFormat.number,s.options.outputFormat.dot,s.options.outputFormat.negativeDot,s.options.outputFormat.comma,s.options.outputFormat.negativeComma,s.options.outputFormat.dotNegative,s.options.outputFormat.commaNegative])||a.throwError("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', [".concat(o.outputFormat,"] given.")),a.isTrueOrFalseString(o.isCancellable)||a.isBoolean(o.isCancellable)||a.throwError("The cancellable behavior option 'isCancellable' is invalid ; it should be either 'true' or 'false', [".concat(o.isCancellable,"] given.")),a.isTrueOrFalseString(o.modifyValueOnUpDownArrow)||a.isBoolean(o.modifyValueOnUpDownArrow)||a.throwError("The increment/decrement on up and down arrow keys 'modifyValueOnUpDownArrow' is invalid ; it should be either 'true' or 'false', [".concat(o.modifyValueOnUpDownArrow,"] given.")),a.isTrueOrFalseString(o.modifyValueOnWheel)||a.isBoolean(o.modifyValueOnWheel)||a.throwError("The increment/decrement on mouse wheel option 'modifyValueOnWheel' is invalid ; it should be either 'true' or 'false', [".concat(o.modifyValueOnWheel,"] given.")),a.isTrueOrFalseString(o.watchExternalChanges)||a.isBoolean(o.watchExternalChanges)||a.throwError("The option 'watchExternalChanges' is invalid ; it should be either 'true' or 'false', [".concat(o.watchExternalChanges,"] given.")),a.isInArray(o.wheelOn,[s.options.wheelOn.focus,s.options.wheelOn.hover])||a.throwError("The wheel behavior option 'wheelOn' is invalid ; it should either be 'focus' or 'hover', [".concat(o.wheelOn,"] given.")),(!a.isString(o.upDownStep)&&!a.isNumber(o.upDownStep)||o.upDownStep!=="progressive"&&!d.test(o.upDownStep)||Number(o.upDownStep)===0)&&a.throwError("The up/down arrow step value option 'upDownStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(o.upDownStep,"] given.")),(!a.isString(o.wheelStep)&&!a.isNumber(o.wheelStep)||o.wheelStep!=="progressive"&&!d.test(o.wheelStep)||Number(o.wheelStep)===0)&&a.throwError("The wheel step value option 'wheelStep' is invalid ; it should either be the string 'progressive', or a number or a string that represents a positive number (excluding zero), [".concat(o.wheelStep,"] given.")),a.isInArray(o.serializeSpaces,[s.options.serializeSpaces.plus,s.options.serializeSpaces.percent])||a.throwError("The space replacement character option 'serializeSpaces' is invalid ; it should either be '+' or '%20', [".concat(o.serializeSpaces,"] given.")),a.isTrueOrFalseString(o.noEventListeners)||a.isBoolean(o.noEventListeners)||a.throwError("The option 'noEventListeners' that prevent the creation of event listeners is invalid ; it should be either 'true' or 'false', [".concat(o.noEventListeners,"] given.")),a.isNull(o.styleRules)||a.isObject(o.styleRules)&&(Object.prototype.hasOwnProperty.call(o.styleRules,"positive")||Object.prototype.hasOwnProperty.call(o.styleRules,"negative")||Object.prototype.hasOwnProperty.call(o.styleRules,"ranges")||Object.prototype.hasOwnProperty.call(o.styleRules,"userDefined"))||a.throwError("The option 'styleRules' is invalid ; it should be a correctly structured object, with one or more 'positive', 'negative', 'ranges' or 'userDefined' attributes, [".concat(o.styleRules,"] given.")),a.isNull(o.styleRules)||!Object.prototype.hasOwnProperty.call(o.styleRules,"userDefined")||a.isNull(o.styleRules.userDefined)||o.styleRules.userDefined.forEach(function(W){Object.prototype.hasOwnProperty.call(W,"callback")&&!a.isFunction(W.callback)&&a.throwError("The callback defined in the `userDefined` attribute is not a function, ".concat(J(W.callback)," given."))}),(a.isNull(o.rawValueDivisor)||d.test(o.rawValueDivisor))&&o.rawValueDivisor!==0&&o.rawValueDivisor!=="0"&&o.rawValueDivisor!==1&&o.rawValueDivisor!=="1"||a.throwError("The raw value divisor option 'rawValueDivisor' is invalid ; it should be a positive number higher than one, preferably an integer, [".concat(o.rawValueDivisor,"] given.")),a.isTrueOrFalseString(o.readOnly)||a.isBoolean(o.readOnly)||a.throwError("The option 'readOnly' is invalid ; it should be either 'true' or 'false', [".concat(o.readOnly,"] given.")),a.isTrueOrFalseString(o.unformatOnHover)||a.isBoolean(o.unformatOnHover)||a.throwError("The option 'unformatOnHover' is invalid ; it should be either 'true' or 'false', [".concat(o.unformatOnHover,"] given.")),a.isTrueOrFalseString(o.failOnUnknownOption)||a.isBoolean(o.failOnUnknownOption)||a.throwError("The debug option 'failOnUnknownOption' is invalid ; it should be either 'true' or 'false', [".concat(o.failOnUnknownOption,"] given.")),a.isTrueOrFalseString(o.createLocalList)||a.isBoolean(o.createLocalList)||a.throwError("The debug option 'createLocalList' is invalid ; it should be either 'true' or 'false', [".concat(o.createLocalList,"] given."))}},{key:"_validateDecimalPlacesRawValue",value:function(e){a.isNull(e.decimalPlacesRawValue)||(e.decimalPlacesRawValue<e.decimalPlaces&&a.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones to display [").concat(e.decimalPlaces,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlaces`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnFocus&&a.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown on focus [").concat(e.decimalPlacesShownOnFocus,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnFocus`."),e.showWarnings),e.decimalPlacesRawValue<e.decimalPlacesShownOnBlur&&a.warning("The number of decimal places to store in the raw value [".concat(e.decimalPlacesRawValue,"] is lower than the ones shown when unfocused [").concat(e.decimalPlacesShownOnBlur,"]. This will likely confuse your users.\nTo solve that, you'd need to either set `decimalPlacesRawValue` to `null`, or set a number of decimal places for the raw value equal of bigger than `decimalPlacesShownOnBlur`."),e.showWarnings))}},{key:"areSettingsValid",value:function(e){var t=!0;try{this.validate(e,!0)}catch{t=!1}return t}},{key:"getDefaultConfig",value:function(){return s.defaultSettings}},{key:"getPredefinedOptions",value:function(){return s.predefinedOptions}},{key:"_generateOptionsObjectFromOptionsArray",value:function(e){var t,r=this;return a.isUndefinedOrNullOrEmpty(e)||e.length===0?t=null:(t={},e.length===1&&Array.isArray(e[0])?e[0].forEach(function(o){re(t,r._getOptionObject(o))}):e.length>=1&&e.forEach(function(o){re(t,r._getOptionObject(o))})),t}},{key:"format",value:function(e){if(a.isUndefined(e)||e===null)return null;var t;t=a.isElement(e)?a.getElementValue(e):e,a.isString(t)||a.isNumber(t)||a.throwError('The value "'.concat(t,'" being "set" is not numeric and therefore cannot be used appropriately.'));for(var r=arguments.length,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];var g=this._generateOptionsObjectFromOptionsArray(o),S=re({},this.getDefaultConfig(),g);S.isNegativeSignAllowed=t<0,S.isPositiveSignAllowed=t>=0,this._setBrackets(S),this._cachesUsualRegularExpressions(S,{});var E=this._toNumericValue(t,S);return isNaN(Number(E))&&a.throwError("The value [".concat(E,"] that you are trying to format is not a recognized number.")),this._isWithinRangeWithOverrideOption(E,S)||(a.triggerEvent(s.events.formatted,document,{oldValue:null,newValue:null,oldRawValue:null,newRawValue:null,isPristine:null,error:"Range test failed",aNElement:null},!0,!0),a.throwError("The value [".concat(E,"] being set falls outside of the minimumValue [").concat(S.minimumValue,"] and maximumValue [").concat(S.maximumValue,"] range set for this element"))),S.valuesToStrings&&this._checkValuesToStringsSettings(t,S)?S.valuesToStrings[t]:(this._correctNegativePositiveSignPlacementOption(S),this._calculateDecimalPlacesOnInit(S),a.isUndefinedOrNullOrEmpty(S.rawValueDivisor)||S.rawValueDivisor===0||E===""||E===null||(E*=S.rawValueDivisor),E=this._roundFormattedValueShownOnFocus(E,S),E=this._modifyNegativeSignAndDecimalCharacterForFormattedValue(E,S),E=this._addGroupSeparators(E,S,!1,E))}},{key:"formatAndSet",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.format(e,t);return a.setElementValue(e,r),r}},{key:"unformat",value:function(e){if(a.isNumberStrict(e))return e;var t;if((t=a.isElement(e)?a.getElementValue(e):e)==="")return"";if(a.isUndefined(t)||t===null)return null;(a.isArray(t)||a.isObject(t))&&a.throwError("A number or a string representing a number is needed to be able to unformat it, [".concat(t,"] given."));for(var r=arguments.length,o=new Array(r>1?r-1:0),u=1;u<r;u++)o[u-1]=arguments[u];var g=this._generateOptionsObjectFromOptionsArray(o),S=re({},this.getDefaultConfig(),g);if(S.isNegativeSignAllowed=!1,S.isPositiveSignAllowed=!0,t=t.toString(),S.valuesToStrings&&this._checkStringsToValuesSettings(t,S))return a.objectKeyLookup(S.valuesToStrings,t);if(a.isNegative(t,S.negativeSignCharacter))S.isNegativeSignAllowed=!0,S.isPositiveSignAllowed=!1;else if(!a.isNull(S.negativeBracketsTypeOnBlur)){var E=X(S.negativeBracketsTypeOnBlur.split(","),2);S.firstBracket=E[0],S.lastBracket=E[1],t.charAt(0)===S.firstBracket&&t.charAt(t.length-1)===S.lastBracket&&(S.isNegativeSignAllowed=!0,S.isPositiveSignAllowed=!1,t=this._removeBrackets(t,S,!1))}return t=this._convertToNumericString(t,S),a.isNumber(Number(t))&&(t=a.scientificToDecimal(t)),new RegExp("[^+-0123456789.]","gi").test(t)?NaN:(this._correctNegativePositiveSignPlacementOption(S),S.decimalPlacesRawValue?S.originalDecimalPlacesRawValue=S.decimalPlacesRawValue:S.originalDecimalPlacesRawValue=S.decimalPlaces,this._calculateDecimalPlacesOnInit(S),a.isUndefinedOrNullOrEmpty(S.rawValueDivisor)||S.rawValueDivisor===0||t===""||t===null||(t/=S.rawValueDivisor),t=(t=this._roundRawValue(t,S)).replace(S.decimalCharacter,"."),t=this._toLocale(t,S.outputFormat,S))}},{key:"unformatAndSet",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.unformat(e,t);return a.setElementValue(e,r),r}},{key:"localize",value:function(e){var t,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return(t=a.isElement(e)?a.getElementValue(e):e)===""?"":(a.isNull(o)&&(o=s.defaultSettings),t=this.unformat(t,o),Number(t)===0&&o.leadingZero!==s.options.leadingZero.keep&&(t="0"),r=a.isNull(o)?o.outputFormat:s.defaultSettings.outputFormat,this._toLocale(t,r,o))}},{key:"localizeAndSet",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=this.localize(e,t);return a.setElementValue(e,r),r}},{key:"isManagedByAutoNumeric",value:function(e){return this._isInGlobalList(a.domElement(e))}},{key:"getAutoNumericElement",value:function(e){var t=a.domElement(e);return this.isManagedByAutoNumeric(t)?this._getFromGlobalList(t):null}},{key:"set",value:function(e,t){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],g=a.domElement(e);return this.isManagedByAutoNumeric(g)?this.getAutoNumericElement(g).set(t,o,u):(r=!(!a.isNull(o)&&Object.prototype.hasOwnProperty.call(o,"showWarnings"))||o.showWarnings,a.warning("Impossible to find an AutoNumeric object for the given DOM element or selector.",r),null)}},{key:"getNumericString",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getNumericString",t)}},{key:"getFormatted",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getFormatted",t)}},{key:"getNumber",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this._get(e,"getNumber",t)}},{key:"_get",value:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=a.domElement(e);return this.isManagedByAutoNumeric(o)||a.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(o)[t](r)}},{key:"getLocalized",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=a.domElement(e);return this.isManagedByAutoNumeric(o)||a.throwError("Impossible to find an AutoNumeric object for the given DOM element or selector."),this.getAutoNumericElement(o).getLocalized(t,r)}},{key:"_stripAllNonNumberCharacters",value:function(e,t,r,o){return this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,t,r,o).replace(t.decimalCharacter,".")}},{key:"_stripAllNonNumberCharactersExceptCustomDecimalChar",value:function(e,t,r,o){var u=(e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,t)).replace(t.allowedAutoStrip,"")).match(t.numRegAutoStrip);if(e=u?[u[1],u[2],u[3]].join(""):"",t.leadingZero===s.options.leadingZero.allow||t.leadingZero===s.options.leadingZero.keep){var g="",S=X(e.split(t.decimalCharacter),2),E=S[0],O=S[1],d=E;a.contains(d,t.negativeSignCharacter)&&(g=t.negativeSignCharacter,d=d.replace(t.negativeSignCharacter,"")),g===""&&d.length>t.mIntPos&&d.charAt(0)==="0"&&(d=d.slice(1)),g!==""&&d.length>t.mIntNeg&&d.charAt(0)==="0"&&(d=d.slice(1)),e="".concat(g).concat(d).concat(a.isUndefined(O)?"":t.decimalCharacter+O)}return(r&&t.leadingZero===s.options.leadingZero.deny||!o&&t.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(t.stripReg,"$1$2")),e}},{key:"_toggleNegativeBracket",value:function(e,t,r){return r?this._removeBrackets(e,t):this._addBrackets(e,t)}},{key:"_addBrackets",value:function(e,t){return a.isNull(t.negativeBracketsTypeOnBlur)?e:"".concat(t.firstBracket).concat(e.replace(t.negativeSignCharacter,"")).concat(t.lastBracket)}},{key:"_removeBrackets",value:function(e,t){var r,o=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return a.isNull(t.negativeBracketsTypeOnBlur)||e.charAt(0)!==t.firstBracket?r=e:(r=(r=e.replace(t.firstBracket,"")).replace(t.lastBracket,""),o?(r=r.replace(t.currencySymbol,""),r=this._mergeCurrencySignNegativePositiveSignAndValue(r,t,!0,!1)):r="".concat(t.negativeSignCharacter).concat(r)),r}},{key:"_setBrackets",value:function(e){if(a.isNull(e.negativeBracketsTypeOnBlur))e.firstBracket="",e.lastBracket="";else{var t=X(e.negativeBracketsTypeOnBlur.split(","),2),r=t[0],o=t[1];e.firstBracket=r,e.lastBracket=o}}},{key:"_convertToNumericString",value:function(e,t){e=this._removeBrackets(e,t,!1),e=(e=this._normalizeCurrencySuffixAndNegativeSignCharacters(e,t)).replace(new RegExp("[".concat(t.digitGroupSeparator,"]"),"g"),""),t.decimalCharacter!=="."&&(e=e.replace(t.decimalCharacter,".")),a.isNegative(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-".concat(e)),t.showPositiveSign&&(e=e.replace(t.positiveSignCharacter,""));var r=t.leadingZero!==s.options.leadingZero.keep,o=a.arabicToLatinNumbers(e,r,!1,!1);return isNaN(o)||(e=o.toString()),e}},{key:"_normalizeCurrencySuffixAndNegativeSignCharacters",value:function(e,t){return e=String(e),t.currencySymbol!==s.options.currencySymbol.none&&(e=e.replace(t.currencySymbol,"")),t.suffixText!==s.options.suffixText.none&&(e=e.replace(t.suffixText,"")),t.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen&&(e=e.replace(t.negativeSignCharacter,"-")),e}},{key:"_toLocale",value:function(e,t,r){if(a.isNull(t)||t===s.options.outputFormat.string)return e;var o;switch(t){case s.options.outputFormat.number:o=Number(e);break;case s.options.outputFormat.dotNegative:o=a.isNegative(e)?e.replace("-","")+"-":e;break;case s.options.outputFormat.comma:case s.options.outputFormat.negativeComma:o=e.replace(".",",");break;case s.options.outputFormat.commaNegative:o=e.replace(".",","),o=a.isNegative(o)?o.replace("-","")+"-":o;break;case s.options.outputFormat.dot:case s.options.outputFormat.negativeDot:o=e;break;default:a.throwError("The given outputFormat [".concat(t,"] option is not recognized."))}return t!==s.options.outputFormat.number&&r.negativeSignCharacter!=="-"&&(o=o.replace("-",r.negativeSignCharacter)),o}},{key:"_modifyNegativeSignAndDecimalCharacterForFormattedValue",value:function(e,t){return t.negativeSignCharacter!=="-"&&(e=e.replace("-",t.negativeSignCharacter)),t.decimalCharacter!=="."&&(e=e.replace(".",t.decimalCharacter)),e}},{key:"_isElementValueEmptyOrOnlyTheNegativeSign",value:function(e,t){return e===""||e===t.negativeSignCharacter}},{key:"_orderValueCurrencySymbolAndSuffixText",value:function(e,t,r){var o;if(t.emptyInputBehavior===s.options.emptyInputBehavior.always||r)switch(t.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.left:case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.none:o=e+t.currencySymbol+t.suffixText;break;default:o=t.currencySymbol+e+t.suffixText}else o=e;return o}},{key:"_addGroupSeparators",value:function(e,t,r,o){var u,g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;if(u=a.isNull(g)?a.isNegative(e,t.negativeSignCharacter)||a.isNegativeWithBrackets(e,t.firstBracket,t.lastBracket):g<0,e=this._stripAllNonNumberCharactersExceptCustomDecimalChar(e,t,!1,r),this._isElementValueEmptyOrOnlyTheNegativeSign(e,t))return this._orderValueCurrencySymbolAndSuffixText(e,t,!0);var S=a.isZeroOrHasNoValue(e);u&&(e=e.replace("-",""));var E,O=X(e.split(t.decimalCharacter),2),d=O[0],T=O[1];if(t.decimalCharacterAlternative&&a.isUndefined(T)){var D=X(e.split(t.decimalCharacterAlternative),2);d=D[0],T=D[1]}if(t.digitGroupSeparator!==""){var $;switch(t.digitalGroupSpacing=t.digitalGroupSpacing.toString(),t.digitalGroupSpacing){case s.options.digitalGroupSpacing.twoThree:$=/(\d)((\d)(\d{2}?)+)$/;break;case s.options.digitalGroupSpacing.twoScaled:$=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case s.options.digitalGroupSpacing.two:case s.options.digitalGroupSpacing.three:case s.options.digitalGroupSpacing.four:default:$=new RegExp("(\\d)((\\d{".concat(t.digitalGroupSpacing,"}?)+)$"))}for(;$.test(d);)d=d.replace($,"$1".concat(t.digitGroupSeparator,"$2"))}return(E=r?t.decimalPlacesShownOnFocus:t.decimalPlacesShownOnBlur)===0||a.isUndefined(T)?e=d:(T.length>E&&(T=T.substring(0,E)),e="".concat(d).concat(t.decimalCharacter).concat(T)),e=s._mergeCurrencySignNegativePositiveSignAndValue(e,t,u,S),a.isNull(g)&&(g=o),t.negativeBracketsTypeOnBlur!==null&&(g<0||a.isNegativeStrict(e,t.negativeSignCharacter))&&(e=this._toggleNegativeBracket(e,t,r)),t.suffixText?"".concat(e).concat(t.suffixText):e}},{key:"_mergeCurrencySignNegativePositiveSignAndValue",value:function(e,t,r,o){var u,g="";if(r?g=t.negativeSignCharacter:t.showPositiveSign&&!o&&(g=t.positiveSignCharacter),t.currencySymbolPlacement===s.options.currencySymbolPlacement.prefix)if(t.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(r||!r&&t.showPositiveSign&&!o))switch(t.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.prefix:case s.options.negativePositiveSignPlacement.left:u="".concat(g).concat(t.currencySymbol).concat(e);break;case s.options.negativePositiveSignPlacement.right:u="".concat(t.currencySymbol).concat(g).concat(e);break;case s.options.negativePositiveSignPlacement.suffix:u="".concat(t.currencySymbol).concat(e).concat(g)}else u=t.currencySymbol+e;else if(t.currencySymbolPlacement===s.options.currencySymbolPlacement.suffix)if(t.negativePositiveSignPlacement!==s.options.negativePositiveSignPlacement.none&&(r||!r&&t.showPositiveSign&&!o))switch(t.negativePositiveSignPlacement){case s.options.negativePositiveSignPlacement.suffix:case s.options.negativePositiveSignPlacement.right:u="".concat(e).concat(t.currencySymbol).concat(g);break;case s.options.negativePositiveSignPlacement.left:u="".concat(e).concat(g).concat(t.currencySymbol);break;case s.options.negativePositiveSignPlacement.prefix:u="".concat(g).concat(e).concat(t.currencySymbol)}else u=e+t.currencySymbol;return u}},{key:"_truncateZeros",value:function(e,t){var r;switch(t){case 0:r=/(\.(?:\d*[1-9])?)0*$/;break;case 1:r=/(\.\d(?:\d*[1-9])?)0*$/;break;default:r=new RegExp("(\\.\\d{".concat(t,"}(?:\\d*[1-9])?)0*"))}return e=e.replace(r,"$1"),t===0&&(e=e.replace(/\.$/,"")),e}},{key:"_roundRawValue",value:function(e,t){return this._roundValue(e,t,t.decimalPlacesRawValue)}},{key:"_roundFormattedValueShownOnFocus",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnFocus))}},{key:"_roundFormattedValueShownOnBlur",value:function(e,t){return this._roundValue(e,t,Number(t.decimalPlacesShownOnBlur))}},{key:"_roundFormattedValueShownOnFocusOrBlur",value:function(e,t,r){return r?this._roundFormattedValueShownOnFocus(e,t):this._roundFormattedValueShownOnBlur(e,t)}},{key:"_roundValue",value:function(e,t,r){if(a.isNull(e))return e;if(e=e===""?"0":e.toString(),t.roundingMethod===s.options.roundingMethod.toNearest05||t.roundingMethod===s.options.roundingMethod.toNearest05Alt||t.roundingMethod===s.options.roundingMethod.upToNext05||t.roundingMethod===s.options.roundingMethod.downToNext05)return this._roundCloseTo05(e,t);var o,u=X(s._prepareValueForRounding(e,t),2),g=u[0],S=(e=u[1]).lastIndexOf("."),E=S===-1,O=X(e.split("."),2),d=O[0];if(!(O[1]>0||t.allowDecimalPadding!==s.options.allowDecimalPadding.never&&t.allowDecimalPadding!==s.options.allowDecimalPadding.floats))return Number(e)===0?d:"".concat(g).concat(d);o=t.allowDecimalPadding===s.options.allowDecimalPadding.always||t.allowDecimalPadding===s.options.allowDecimalPadding.floats?r:t.allowDecimalPadding>0?t.allowDecimalPadding:0;var T,D=E?e.length-1:S,$=e.length-1-D,W="";if($<=r){if(W=e,$<o){E&&(W="".concat(W).concat(t.decimalCharacter));for(var ee="000000";$<o;)W+=ee=ee.substring(0,o-$),$+=ee.length}else $>o?W=this._truncateZeros(W,o):$===0&&o===0&&(W=W.replace(/\.$/,""));return Number(W)===0?W:"".concat(g).concat(W)}T=E?r-1:Number(r)+Number(S);var qe,rt=Number(e.charAt(T+1)),st=e.substring(0,T+1).split("");if(qe=e.charAt(T)==="."?e.charAt(T-1)%2:e.charAt(T)%2,this._shouldRoundUp(rt,t,g,qe)){for(var Ze=st.length-1;Ze>=0;Ze-=1)if(st[Ze]!=="."){if(st[Ze]=+st[Ze]+1,st[Ze]<10)break;Ze>0&&(st[Ze]="0")}}return st=st.slice(0,T+1),W=this._truncateZeros(st.join(""),o),Number(W)===0?W:"".concat(g).concat(W)}},{key:"_roundCloseTo05",value:function(e,t){switch(t.roundingMethod){case s.options.roundingMethod.toNearest05:case s.options.roundingMethod.toNearest05Alt:e=(Math.round(20*e)/20).toString();break;case s.options.roundingMethod.upToNext05:e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}return a.contains(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}},{key:"_prepareValueForRounding",value:function(e,t){var r="";return a.isNegativeStrict(e,"-")&&(r="-",e=e.replace("-","")),e.match(/^\d/)||(e="0".concat(e)),Number(e)===0&&(r=""),(Number(e)>0&&t.leadingZero!==s.options.leadingZero.keep||e.length>0&&t.leadingZero===s.options.leadingZero.allow)&&(e=e.replace(/^0*(\d)/,"$1")),[r,e]}},{key:"_shouldRoundUp",value:function(e,t,r,o){return e>4&&t.roundingMethod===s.options.roundingMethod.halfUpSymmetric||e>4&&t.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&r===""||e>5&&t.roundingMethod===s.options.roundingMethod.halfUpAsymmetric&&r==="-"||e>5&&t.roundingMethod===s.options.roundingMethod.halfDownSymmetric||e>5&&t.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&r===""||e>4&&t.roundingMethod===s.options.roundingMethod.halfDownAsymmetric&&r==="-"||e>5&&t.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding||e===5&&t.roundingMethod===s.options.roundingMethod.halfEvenBankersRounding&&o===1||e>0&&t.roundingMethod===s.options.roundingMethod.toCeilingTowardPositiveInfinity&&r===""||e>0&&t.roundingMethod===s.options.roundingMethod.toFloorTowardNegativeInfinity&&r==="-"||e>0&&t.roundingMethod===s.options.roundingMethod.upRoundAwayFromZero}},{key:"_truncateDecimalPlaces",value:function(e,t,r,o){r&&(e=this._roundFormattedValueShownOnFocus(e,t));var u=X(e.split(t.decimalCharacter),2),g=u[0],S=u[1];if(S&&S.length>o)if(o>0){var E=S.substring(0,o);e="".concat(g).concat(t.decimalCharacter).concat(E)}else e=g;return e}},{key:"_checkIfInRangeWithOverrideOption",value:function(e,t){if(a.isNull(e)&&t.emptyInputBehavior===s.options.emptyInputBehavior.null||t.overrideMinMaxLimits===s.options.overrideMinMaxLimits.ignore||t.overrideMinMaxLimits===s.options.overrideMinMaxLimits.invalid)return[!0,!0];e=(e=e.toString()).replace(",",".");var r,o=a.parseStr(t.minimumValue),u=a.parseStr(t.maximumValue),g=a.parseStr(e);switch(t.overrideMinMaxLimits){case s.options.overrideMinMaxLimits.floor:r=[a.testMinMax(o,g)>-1,!0];break;case s.options.overrideMinMaxLimits.ceiling:r=[!0,a.testMinMax(u,g)<1];break;default:r=[a.testMinMax(o,g)>-1,a.testMinMax(u,g)<1]}return r}},{key:"_isWithinRangeWithOverrideOption",value:function(e,t){var r=X(this._checkIfInRangeWithOverrideOption(e,t),2),o=r[0],u=r[1];return o&&u}},{key:"_cleanValueForRangeParse",value:function(e){return e=e.toString().replace(",","."),a.parseStr(e)}},{key:"_isMinimumRangeRespected",value:function(e,t){return a.testMinMax(a.parseStr(t.minimumValue),this._cleanValueForRangeParse(e))>-1}},{key:"_isMaximumRangeRespected",value:function(e,t){return a.testMinMax(a.parseStr(t.maximumValue),this._cleanValueForRangeParse(e))<1}},{key:"_correctNegativePositiveSignPlacementOption",value:function(e){if(a.isNull(e.negativePositiveSignPlacement))if(a.isUndefined(e)||!a.isUndefinedOrNullOrEmpty(e.negativePositiveSignPlacement)||a.isUndefinedOrNullOrEmpty(e.currencySymbol))e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left;else switch(e.currencySymbolPlacement){case s.options.currencySymbolPlacement.suffix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.prefix;break;case s.options.currencySymbolPlacement.prefix:e.negativePositiveSignPlacement=s.options.negativePositiveSignPlacement.left}}},{key:"_correctCaretPositionOnFocusAndSelectOnFocusOptions",value:function(e){return a.isNull(e)?null:(!a.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&a.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&(e.selectOnFocus=s.options.selectOnFocus.doNotSelect),a.isUndefinedOrNullOrEmpty(e.caretPositionOnFocus)&&!a.isUndefinedOrNullOrEmpty(e.selectOnFocus)&&e.selectOnFocus===s.options.selectOnFocus.select&&(e.caretPositionOnFocus=s.options.caretPositionOnFocus.doNoForceCaretPosition),e)}},{key:"_calculateDecimalPlacesOnInit",value:function(e){this._validateDecimalPlacesRawValue(e),e.decimalPlacesShownOnFocus===s.options.decimalPlacesShownOnFocus.useDefault&&(e.decimalPlacesShownOnFocus=e.decimalPlaces),e.decimalPlacesShownOnBlur===s.options.decimalPlacesShownOnBlur.useDefault&&(e.decimalPlacesShownOnBlur=e.decimalPlaces),e.decimalPlacesRawValue===s.options.decimalPlacesRawValue.useDefault&&(e.decimalPlacesRawValue=e.decimalPlaces);var t=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(t=String(e.rawValueDivisor).length-1)<0&&(t=0),e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+t,Number(e.originalDecimalPlacesRawValue)+t)}},{key:"_calculateDecimalPlacesOnUpdate",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this._validateDecimalPlacesRawValue(e),a.isNull(t)&&a.throwError("When updating the settings, the previous ones should be passed as an argument.");var r="decimalPlaces"in e;if(r||"decimalPlacesRawValue"in e||"decimalPlacesShownOnFocus"in e||"decimalPlacesShownOnBlur"in e||"rawValueDivisor"in e){r?("decimalPlacesShownOnFocus"in e&&e.decimalPlacesShownOnFocus!==s.options.decimalPlacesShownOnFocus.useDefault||(e.decimalPlacesShownOnFocus=e.decimalPlaces),"decimalPlacesShownOnBlur"in e&&e.decimalPlacesShownOnBlur!==s.options.decimalPlacesShownOnBlur.useDefault||(e.decimalPlacesShownOnBlur=e.decimalPlaces),"decimalPlacesRawValue"in e&&e.decimalPlacesRawValue!==s.options.decimalPlacesRawValue.useDefault||(e.decimalPlacesRawValue=e.decimalPlaces)):(a.isUndefined(e.decimalPlacesShownOnFocus)&&(e.decimalPlacesShownOnFocus=t.decimalPlacesShownOnFocus),a.isUndefined(e.decimalPlacesShownOnBlur)&&(e.decimalPlacesShownOnBlur=t.decimalPlacesShownOnBlur));var o=0;e.rawValueDivisor&&e.rawValueDivisor!==s.options.rawValueDivisor.none&&(o=String(e.rawValueDivisor).length-1)<0&&(o=0),e.decimalPlaces||e.decimalPlacesRawValue?e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+o,Number(e.decimalPlacesRawValue)+o):e.decimalPlacesRawValue=Math.max(Math.max(e.decimalPlacesShownOnBlur,e.decimalPlacesShownOnFocus)+o,Number(t.originalDecimalPlacesRawValue)+o)}}},{key:"_cachesUsualRegularExpressions",value:function(e,t){var r;r=e.negativeSignCharacter!==s.options.negativeSignCharacter.hyphen?"([-\\".concat(e.negativeSignCharacter,"]?)"):"(-?)",t.aNegRegAutoStrip=r,e.allowedAutoStrip=new RegExp("[^-0123456789\\".concat(e.decimalCharacter,"]"),"g"),e.numRegAutoStrip=new RegExp("".concat(r,"(?:\\").concat(e.decimalCharacter,"?([0-9]+\\").concat(e.decimalCharacter,"[0-9]+)|([0-9]*(?:\\").concat(e.decimalCharacter,"[0-9]*)?))")),e.stripReg=new RegExp("^".concat(t.aNegRegAutoStrip,"0*([0-9])")),e.formulaChars=new RegExp("[0-9".concat(e.decimalCharacter,"+\\-*/() ]"))}},{key:"_convertOldOptionsToNewOnes",value:function(e){var t={aSep:"digitGroupSeparator",nSep:"showOnlyNumbersOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"decimalPlacesShownOnBlur",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",allowDecimalPadding:!0,alwaysAllowDecimalCharacter:!0,caretPositionOnFocus:!0,createLocalList:!0,currencySymbol:!0,currencySymbolPlacement:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,decimalPlaces:!0,decimalPlacesRawValue:!0,decimalPlacesShownOnBlur:!0,decimalPlacesShownOnFocus:!0,defaultValueOverride:!0,digitalGroupSpacing:!0,digitGroupSeparator:!0,divisorWhenUnfocused:!0,emptyInputBehavior:!0,eventBubbles:!0,eventIsCancelable:!0,failOnUnknownOption:!0,formatOnPageLoad:!0,formulaMode:!0,historySize:!0,isCancellable:!0,leadingZero:!0,maximumValue:!0,minimumValue:!0,modifyValueOnUpDownArrow:!0,modifyValueOnWheel:!0,negativeBracketsTypeOnBlur:!0,negativePositiveSignPlacement:!0,negativeSignCharacter:!0,negativePositiveSignBehavior:!0,noEventListeners:!0,onInvalidPaste:!0,outputFormat:!0,overrideMinMaxLimits:!0,positiveSignCharacter:!0,rawValueDivisor:!0,readOnly:!0,roundingMethod:!0,saveValueToSessionStorage:!0,selectNumberOnly:!0,selectOnFocus:!0,serializeSpaces:!0,showOnlyNumbersOnFocus:!0,showPositiveSign:!0,showWarnings:!0,styleRules:!0,suffixText:!0,symbolWhenUnfocused:!0,upDownStep:!0,unformatOnHover:!0,unformatOnSubmit:!0,valuesToStrings:!0,watchExternalChanges:!0,wheelOn:!0,wheelStep:!0,allowedAutoStrip:!0,formulaChars:!0,isNegativeSignAllowed:!0,isPositiveSignAllowed:!0,mIntNeg:!0,mIntPos:!0,numRegAutoStrip:!0,originalDecimalPlaces:!0,originalDecimalPlacesRawValue:!0,stripReg:!0};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t[r]===!0)continue;Object.prototype.hasOwnProperty.call(t,r)?(a.warning("You are using the deprecated option name '".concat(r,"'. Please use '").concat(t[r],"' instead from now on. The old option name will be dropped very soon\u2122."),!0),e[t[r]]=e[r],delete e[r]):e.failOnUnknownOption&&a.throwError("Option name '".concat(r,"' is unknown. Please fix the options passed to autoNumeric"))}"mDec"in e&&a.warning("The old `mDec` option has been deprecated in favor of more accurate options ; `decimalPlaces`, `decimalPlacesRawValue`, `decimalPlacesShownOnFocus` and `decimalPlacesShownOnBlur`.",!0)}},{key:"_setNegativePositiveSignPermissions",value:function(e){e.isNegativeSignAllowed=e.minimumValue<0,e.isPositiveSignAllowed=e.maximumValue>=0}},{key:"_toNumericValue",value:function(e,t){var r;return a.isNumber(Number(e))?(a.isNumberStrict(e)||(e=String(e).trim()),r=a.scientificToDecimal(e)):(r=this._convertToNumericString(e.toString(),t),a.isNumber(Number(r))||(a.warning('The given value "'.concat(e,'" cannot be converted to a numeric one and therefore cannot be used appropriately.'),t.showWarnings),r=NaN)),r}},{key:"_checkIfInRange",value:function(e,t,r){var o=a.parseStr(e);return a.testMinMax(t,o)>-1&&a.testMinMax(r,o)<1}},{key:"_shouldSkipEventKey",value:function(e){var t=a.isInArray(e,l.keyName._allFnKeys),r=e===l.keyName.OSLeft||e===l.keyName.OSRight,o=e===l.keyName.ContextMenu,u=a.isInArray(e,l.keyName._someNonPrintableKeys),g=e===l.keyName.NumLock||e===l.keyName.ScrollLock||e===l.keyName.Insert||e===l.keyName.Command,S=e===l.keyName.Unidentified;return t||r||o||u||S||g}},{key:"_serialize",value:function(e){var t,r=this,o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unformatted",g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"+",S=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,E=[];return J(e)==="object"&&e.nodeName.toLowerCase()==="form"&&Array.prototype.slice.call(e.elements).forEach(function(O){if(O.name&&!O.disabled&&["file","reset","submit","button"].indexOf(O.type)===-1){if(O.type==="select-multiple")Array.prototype.slice.call(O.options).forEach(function($){$.selected&&(o?E.push({name:O.name,value:$.value}):E.push("".concat(encodeURIComponent(O.name),"=").concat(encodeURIComponent($.value))))});else if(["checkbox","radio"].indexOf(O.type)===-1||O.checked){var d,T;if(r.isManagedByAutoNumeric(O))switch(u){case"unformatted":T=r.getAutoNumericElement(O),a.isNull(T)||(d=r.unformat(O,T.getSettings()));break;case"localized":if(T=r.getAutoNumericElement(O),!a.isNull(T)){var D=a.cloneObject(T.getSettings());a.isNull(S)||(D.outputFormat=S),d=r.localize(O,D)}break;default:d=O.value}else d=O.value;a.isUndefined(d)&&a.throwError("This error should never be hit. If it has, something really wrong happened!"),o?E.push({name:O.name,value:d}):E.push("".concat(encodeURIComponent(O.name),"=").concat(encodeURIComponent(d)))}}}),o?t=E:(t=E.join("&"),g==="+"&&(t=t.replace(/%20/g,"+"))),t}},{key:"_serializeNumericString",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!1,"unformatted",t)}},{key:"_serializeFormatted",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!1,"formatted",t)}},{key:"_serializeLocalized",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this._serialize(e,!1,"localized",t,r)}},{key:"_serializeNumericStringArray",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!0,"unformatted",t)}},{key:"_serializeFormattedArray",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+";return this._serialize(e,!0,"formatted",t)}},{key:"_serializeLocalizedArray",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this._serialize(e,!0,"localized",t,r)}}],P&&ze(v.prototype,P),F&&ze(v,F),Object.defineProperty(v,"prototype",{writable:!1}),s}();H(b,"options",void 0),H(b,"events",void 0),H(b,"defaultSettings",void 0),H(b,"predefinedOptions",void 0),b.multiple=function(s){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,F=[];if(a.isObject(v)&&(P=v,v=null),a.isString(s))s=Ee(document.querySelectorAll(s));else if(a.isObject(s)){Object.prototype.hasOwnProperty.call(s,"rootElement")||a.throwError("The object passed to the 'multiple' function is invalid ; no 'rootElement' attribute found.");var e=Ee(s.rootElement.querySelectorAll("input"));Object.prototype.hasOwnProperty.call(s,"exclude")?(Array.isArray(s.exclude)||a.throwError("The 'exclude' array passed to the 'multiple' function is invalid."),s=a.filterOut(e,s.exclude)):s=e}else a.isArray(s)||a.throwError("The given parameters to the 'multiple' function are invalid.");if(s.length===0){var t=!0;return!a.isNull(P)&&a.isBoolean(P.showWarnings)&&(t=P.showWarnings),a.warning("No valid DOM elements were given hence no AutoNumeric objects were instantiated.",t),[]}var r=a.isArray(v)&&v.length>=1,o=!1,u=!1;if(r){var g=J(Number(v[0]));(o=g==="number"&&!isNaN(Number(v[0])))||(g==="string"||isNaN(g)||g==="object")&&(u=!0)}var S,E=!1;if(a.isArray(P)&&P.length>=1){var O=J(P[0]);O!=="string"&&O!=="object"||(E=!0)}S=u?b.mergeOptions(v):E?b.mergeOptions(P):P;var d,T=a.isNumber(v);return o&&(d=v.length),s.forEach(function(D,$){T?F.push(new b(D,v,S)):o&&$<=d?F.push(new b(D,v[$],S)):F.push(new b(D,null,S))}),F},b.events={correctedValue:"autoNumeric:correctedValue",initialized:"autoNumeric:initialized",invalidFormula:"autoNumeric:invalidFormula",invalidValue:"autoNumeric:invalidValue",formatted:"autoNumeric:formatted",rawValueModified:"autoNumeric:rawValueModified",minRangeExceeded:"autoNumeric:minExceeded",maxRangeExceeded:"autoNumeric:maxExceeded",native:{input:"input",change:"change"},validFormula:"autoNumeric:validFormula"},Object.freeze(b.events.native),Object.freeze(b.events),Object.defineProperty(b,"events",{configurable:!1,writable:!1}),b.options={allowDecimalPadding:{always:!0,never:!1,floats:"floats"},alwaysAllowDecimalCharacter:{alwaysAllow:!0,doNotAllow:!1},caretPositionOnFocus:{start:"start",end:"end",decimalLeft:"decimalLeft",decimalRight:"decimalRight",doNoForceCaretPosition:null},createLocalList:{createList:!0,doNotCreateList:!1},currencySymbol:{none:"",currencySign:"\xA4",austral:"\u20B3",australCentavo:"\xA2",baht:"\u0E3F",cedi:"\u20B5",cent:"\xA2",colon:"\u20A1",cruzeiro:"\u20A2",dollar:"$",dong:"\u20AB",drachma:"\u20AF",dram:"\u200B\u058F",european:"\u20A0",euro:"\u20AC",florin:"\u0192",franc:"\u20A3",guarani:"\u20B2",hryvnia:"\u20B4",kip:"\u20AD",att:"\u0EAD\u0EB1\u0E94",lepton:"\u039B.",lira:"\u20BA",liraOld:"\u20A4",lari:"\u20BE",mark:"\u2133",mill:"\u20A5",naira:"\u20A6",peseta:"\u20A7",peso:"\u20B1",pfennig:"\u20B0",pound:"\xA3",real:"R$ ",riel:"\u17DB",ruble:"\u20BD",rupee:"\u20B9",rupeeOld:"\u20A8",shekel:"\u20AA",shekelAlt:"\u05E9\u05F4\u05D7\u200E\u200E",taka:"\u09F3",tenge:"\u20B8",togrog:"\u20AE",won:"\u20A9",yen:"\xA5"},currencySymbolPlacement:{prefix:"p",suffix:"s"},decimalCharacter:{comma:",",dot:".",middleDot:"\xB7",arabicDecimalSeparator:"\u066B",decimalSeparatorKeySymbol:"\u2396"},decimalCharacterAlternative:{none:null,comma:",",dot:"."},decimalPlaces:{none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesRawValue:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnBlur:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},decimalPlacesShownOnFocus:{useDefault:null,none:0,one:1,two:2,three:3,four:4,five:5,six:6},defaultValueOverride:{doNotOverride:null},digitalGroupSpacing:{two:"2",twoThree:"2t",twoScaled:"2s",three:"3",four:"4"},digitGroupSeparator:{comma:",",dot:".",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202F",noBreakSpace:"\xA0",noSeparator:"",apostrophe:"'",arabicThousandsSeparator:"\u066C",dotAbove:"\u02D9",privateUseTwo:"\u2019"},divisorWhenUnfocused:{none:null,percentage:100,permille:1e3,basisPoint:1e4},emptyInputBehavior:{focus:"focus",press:"press",always:"always",zero:"zero",min:"min",max:"max",null:"null"},eventBubbles:{bubbles:!0,doesNotBubble:!1},eventIsCancelable:{isCancelable:!0,isNotCancelable:!1},failOnUnknownOption:{fail:!0,ignore:!1},formatOnPageLoad:{format:!0,doNotFormat:!1},formulaMode:{enabled:!0,disabled:!1},historySize:{verySmall:5,small:10,medium:20,large:50,veryLarge:100,insane:Number.MAX_SAFE_INTEGER},invalidClass:"an-invalid",isCancellable:{cancellable:!0,notCancellable:!1},leadingZero:{allow:"allow",deny:"deny",keep:"keep"},maximumValue:{tenTrillions:"10000000000000",oneBillion:"1000000000",zero:"0"},minimumValue:{tenTrillions:"-10000000000000",oneBillion:"-1000000000",zero:"0"},modifyValueOnUpDownArrow:{modifyValue:!0,doNothing:!1},modifyValueOnWheel:{modifyValue:!0,doNothing:!1},negativeBracketsTypeOnBlur:{parentheses:"(,)",brackets:"[,]",chevrons:"<,>",curlyBraces:"{,}",angleBrackets:"\u3008,\u3009",japaneseQuotationMarks:"\uFF62,\uFF63",halfBrackets:"\u2E24,\u2E25",whiteSquareBrackets:"\u27E6,\u27E7",quotationMarks:"\u2039,\u203A",guillemets:"\xAB,\xBB",none:null},negativePositiveSignPlacement:{prefix:"p",suffix:"s",left:"l",right:"r",none:null},negativeSignCharacter:{hyphen:"-",minus:"\u2212",heavyMinus:"\u2796",fullWidthHyphen:"\uFF0D",circledMinus:"\u2296",squaredMinus:"\u229F",triangleMinus:"\u2A3A",plusMinus:"\xB1",minusPlus:"\u2213",dotMinus:"\u2238",minusTilde:"\u2242",not:"\xAC"},negativePositiveSignBehavior:{toggle:!0,doNotToggle:!1},noEventListeners:{noEvents:!0,addEvents:!1},onInvalidPaste:{error:"error",ignore:"ignore",clamp:"clamp",truncate:"truncate",replace:"replace"},outputFormat:{string:"string",number:"number",dot:".",negativeDot:"-.",comma:",",negativeComma:"-,",dotNegative:".-",commaNegative:",-",none:null},overrideMinMaxLimits:{ceiling:"ceiling",floor:"floor",ignore:"ignore",invalid:"invalid",doNotOverride:null},positiveSignCharacter:{plus:"+",fullWidthPlus:"\uFF0B",heavyPlus:"\u2795",doublePlus:"\u29FA",triplePlus:"\u29FB",circledPlus:"\u2295",squaredPlus:"\u229E",trianglePlus:"\u2A39",plusMinus:"\xB1",minusPlus:"\u2213",dotPlus:"\u2214",altHebrewPlus:"\uFB29",normalSpace:" ",thinSpace:"\u2009",narrowNoBreakSpace:"\u202F",noBreakSpace:"\xA0"},rawValueDivisor:{none:null,percentage:100,permille:1e3,basisPoint:1e4},readOnly:{readOnly:!0,readWrite:!1},roundingMethod:{halfUpSymmetric:"S",halfUpAsymmetric:"A",halfDownSymmetric:"s",halfDownAsymmetric:"a",halfEvenBankersRounding:"B",upRoundAwayFromZero:"U",downRoundTowardZero:"D",toCeilingTowardPositiveInfinity:"C",toFloorTowardNegativeInfinity:"F",toNearest05:"N05",toNearest05Alt:"CHF",upToNext05:"U05",downToNext05:"D05"},saveValueToSessionStorage:{save:!0,doNotSave:!1},selectNumberOnly:{selectNumbersOnly:!0,selectAll:!1},selectOnFocus:{select:!0,doNotSelect:!1},serializeSpaces:{plus:"+",percent:"%20"},showOnlyNumbersOnFocus:{onlyNumbers:!0,showAll:!1},showPositiveSign:{show:!0,hide:!1},showWarnings:{show:!0,hide:!1},styleRules:{none:null,positiveNegative:{positive:"autoNumeric-positive",negative:"autoNumeric-negative"},range0To100With4Steps:{ranges:[{min:0,max:25,class:"autoNumeric-red"},{min:25,max:50,class:"autoNumeric-orange"},{min:50,max:75,class:"autoNumeric-yellow"},{min:75,max:100,class:"autoNumeric-green"}]},evenOdd:{userDefined:[{callback:function(s){return s%2==0},classes:["autoNumeric-even","autoNumeric-odd"]}]},rangeSmallAndZero:{userDefined:[{callback:function(s){return s>=-1&&s<0?0:Number(s)===0?1:s>0&&s<=1?2:null},classes:["autoNumeric-small-negative","autoNumeric-zero","autoNumeric-small-positive"]}]}},suffixText:{none:"",percentage:"%",permille:"\u2030",basisPoint:"\u2031"},symbolWhenUnfocused:{none:null,percentage:"%",permille:"\u2030",basisPoint:"\u2031"},unformatOnHover:{unformat:!0,doNotUnformat:!1},unformatOnSubmit:{unformat:!0,keepCurrentValue:!1},upDownStep:{progressive:"progressive"},valuesToStrings:{none:null,zeroDash:{0:"-"},oneAroundZero:{"-1":"Min",1:"Max"}},watchExternalChanges:{watch:!0,doNotWatch:!1},wheelOn:{focus:"focus",hover:"hover"},wheelStep:{progressive:"progressive"}},j=b.options,Object.getOwnPropertyNames(j).forEach(function(s){s==="valuesToStrings"?Object.getOwnPropertyNames(j.valuesToStrings).forEach(function(v){j.valuesToStrings[v]!==null&&Object.freeze(j.valuesToStrings[v])}):s!=="styleRules"&&j[s]!==null&&Object.freeze(j[s])}),Object.freeze(j),Object.defineProperty(b,"options",{configurable:!1,writable:!1}),b.defaultSettings={allowDecimalPadding:b.options.allowDecimalPadding.always,alwaysAllowDecimalCharacter:b.options.alwaysAllowDecimalCharacter.doNotAllow,caretPositionOnFocus:b.options.caretPositionOnFocus.doNoForceCaretPosition,createLocalList:b.options.createLocalList.createList,currencySymbol:b.options.currencySymbol.none,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,decimalCharacter:b.options.decimalCharacter.dot,decimalCharacterAlternative:b.options.decimalCharacterAlternative.none,decimalPlaces:b.options.decimalPlaces.two,decimalPlacesRawValue:b.options.decimalPlacesRawValue.useDefault,decimalPlacesShownOnBlur:b.options.decimalPlacesShownOnBlur.useDefault,decimalPlacesShownOnFocus:b.options.decimalPlacesShownOnFocus.useDefault,defaultValueOverride:b.options.defaultValueOverride.doNotOverride,digitalGroupSpacing:b.options.digitalGroupSpacing.three,digitGroupSeparator:b.options.digitGroupSeparator.comma,divisorWhenUnfocused:b.options.divisorWhenUnfocused.none,emptyInputBehavior:b.options.emptyInputBehavior.focus,eventBubbles:b.options.eventBubbles.bubbles,eventIsCancelable:b.options.eventIsCancelable.isCancelable,failOnUnknownOption:b.options.failOnUnknownOption.ignore,formatOnPageLoad:b.options.formatOnPageLoad.format,formulaMode:b.options.formulaMode.disabled,historySize:b.options.historySize.medium,invalidClass:b.options.invalidClass,isCancellable:b.options.isCancellable.cancellable,leadingZero:b.options.leadingZero.deny,maximumValue:b.options.maximumValue.tenTrillions,minimumValue:b.options.minimumValue.tenTrillions,modifyValueOnUpDownArrow:b.options.modifyValueOnUpDownArrow.modifyValue,modifyValueOnWheel:b.options.modifyValueOnWheel.modifyValue,negativeBracketsTypeOnBlur:b.options.negativeBracketsTypeOnBlur.none,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.none,negativeSignCharacter:b.options.negativeSignCharacter.hyphen,negativePositiveSignBehavior:b.options.negativePositiveSignBehavior.doNotToggle,noEventListeners:b.options.noEventListeners.addEvents,onInvalidPaste:b.options.onInvalidPaste.error,outputFormat:b.options.outputFormat.none,overrideMinMaxLimits:b.options.overrideMinMaxLimits.doNotOverride,positiveSignCharacter:b.options.positiveSignCharacter.plus,rawValueDivisor:b.options.rawValueDivisor.none,readOnly:b.options.readOnly.readWrite,roundingMethod:b.options.roundingMethod.halfUpSymmetric,saveValueToSessionStorage:b.options.saveValueToSessionStorage.doNotSave,selectNumberOnly:b.options.selectNumberOnly.selectNumbersOnly,selectOnFocus:b.options.selectOnFocus.select,serializeSpaces:b.options.serializeSpaces.plus,showOnlyNumbersOnFocus:b.options.showOnlyNumbersOnFocus.showAll,showPositiveSign:b.options.showPositiveSign.hide,showWarnings:b.options.showWarnings.show,styleRules:b.options.styleRules.none,suffixText:b.options.suffixText.none,symbolWhenUnfocused:b.options.symbolWhenUnfocused.none,unformatOnHover:b.options.unformatOnHover.unformat,unformatOnSubmit:b.options.unformatOnSubmit.keepCurrentValue,upDownStep:"1",valuesToStrings:b.options.valuesToStrings.none,watchExternalChanges:b.options.watchExternalChanges.doNotWatch,wheelOn:b.options.wheelOn.focus,wheelStep:b.options.wheelStep.progressive},Object.freeze(b.defaultSettings),Object.defineProperty(b,"defaultSettings",{configurable:!1,writable:!1});var he={digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,decimalCharacterAlternative:b.options.decimalCharacterAlternative.dot,currencySymbol:"\u202F\u20AC",currencySymbolPlacement:b.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.prefix},Ie={digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.dollar,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},nt={digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.yen,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right};a.cloneObject(he).formulaMode=b.options.formulaMode.enabled;var ne=a.cloneObject(he);ne.minimumValue=0;var ae=a.cloneObject(he);ae.maximumValue=0,ae.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var we=a.cloneObject(he);we.digitGroupSeparator=b.options.digitGroupSeparator.normalSpace;var Z=a.cloneObject(we);Z.minimumValue=0;var _e=a.cloneObject(we);_e.maximumValue=0,_e.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var Ce=a.cloneObject(he);Ce.currencySymbol=b.options.currencySymbol.none,Ce.suffixText="\u202F".concat(b.options.suffixText.percentage),Ce.wheelStep=1e-4,Ce.rawValueDivisor=b.options.rawValueDivisor.percentage;var be=a.cloneObject(Ce);be.minimumValue=0;var se=a.cloneObject(Ce);se.maximumValue=0,se.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var Q=a.cloneObject(Ce);Q.decimalPlaces=3;var Ue=a.cloneObject(be);Ue.decimalPlaces=3;var le=a.cloneObject(se);le.decimalPlaces=3,a.cloneObject(Ie).formulaMode=b.options.formulaMode.enabled;var xe=a.cloneObject(Ie);xe.minimumValue=0;var Ne=a.cloneObject(Ie);Ne.maximumValue=0,Ne.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var Mt=a.cloneObject(Ne);Mt.negativeBracketsTypeOnBlur=b.options.negativeBracketsTypeOnBlur.parentheses;var je=a.cloneObject(Ie);je.currencySymbol=b.options.currencySymbol.none,je.suffixText=b.options.suffixText.percentage,je.wheelStep=1e-4,je.rawValueDivisor=b.options.rawValueDivisor.percentage;var Rt=a.cloneObject(je);Rt.minimumValue=0;var Ae=a.cloneObject(je);Ae.maximumValue=0,Ae.negativePositiveSignPlacement=b.options.negativePositiveSignPlacement.prefix;var gt=a.cloneObject(je);gt.decimalPlaces=3;var Le=a.cloneObject(Rt);Le.decimalPlaces=3;var He=a.cloneObject(Ae);He.decimalPlaces=3;var St=a.cloneObject(he);St.currencySymbol=b.options.currencySymbol.lira,b.predefinedOptions={euro:he,euroPos:ne,euroNeg:ae,euroSpace:we,euroSpacePos:Z,euroSpaceNeg:_e,percentageEU2dec:Ce,percentageEU2decPos:be,percentageEU2decNeg:se,percentageEU3dec:Q,percentageEU3decPos:Ue,percentageEU3decNeg:le,dollar:Ie,dollarPos:xe,dollarNeg:Ne,dollarNegBrackets:Mt,percentageUS2dec:je,percentageUS2decPos:Rt,percentageUS2decNeg:Ae,percentageUS3dec:gt,percentageUS3decPos:Le,percentageUS3decNeg:He,French:he,Spanish:he,NorthAmerican:Ie,British:{digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.pound,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},Swiss:{digitGroupSeparator:b.options.digitGroupSeparator.apostrophe,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:"\u202FCHF",currencySymbolPlacement:b.options.currencySymbolPlacement.suffix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.prefix},Japanese:nt,Chinese:nt,Brazilian:{digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,currencySymbol:b.options.currencySymbol.real,currencySymbolPlacement:b.options.currencySymbolPlacement.prefix,negativePositiveSignPlacement:b.options.negativePositiveSignPlacement.right},Turkish:St,dotDecimalCharCommaSeparator:{digitGroupSeparator:b.options.digitGroupSeparator.comma,decimalCharacter:b.options.decimalCharacter.dot},commaDecimalCharDotSeparator:{digitGroupSeparator:b.options.digitGroupSeparator.dot,decimalCharacter:b.options.decimalCharacter.comma,decimalCharacterAlternative:b.options.decimalCharacterAlternative.dot},integer:{decimalPlaces:0},integerPos:{minimumValue:b.options.minimumValue.zero,decimalPlaces:0},integerNeg:{maximumValue:b.options.maximumValue.zero,decimalPlaces:0},float:{allowDecimalPadding:b.options.allowDecimalPadding.never},floatPos:{allowDecimalPadding:b.options.allowDecimalPadding.never,minimumValue:b.options.minimumValue.zero,maximumValue:b.options.maximumValue.tenTrillions},floatNeg:{allowDecimalPadding:b.options.allowDecimalPadding.never,minimumValue:b.options.minimumValue.tenTrillions,maximumValue:b.options.maximumValue.zero},numeric:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none},numericPos:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none,minimumValue:b.options.minimumValue.zero,maximumValue:b.options.maximumValue.tenTrillions},numericNeg:{digitGroupSeparator:b.options.digitGroupSeparator.noSeparator,decimalCharacter:b.options.decimalCharacter.dot,currencySymbol:b.options.currencySymbol.none,minimumValue:b.options.minimumValue.tenTrillions,maximumValue:b.options.maximumValue.zero}},Object.getOwnPropertyNames(b.predefinedOptions).forEach(function(s){Object.freeze(b.predefinedOptions[s])}),Object.freeze(b.predefinedOptions),Object.defineProperty(b,"predefinedOptions",{configurable:!1,writable:!1});let qi=b;return h=h.default})(),typeof en=="object"&&typeof Zn=="object"?Zn.exports=Xi():typeof define=="function"&&define.amd?define([],Xi):typeof en=="object"?en.AutoNumeric=Xi():va.AutoNumeric=Xi()});var so=yo((ao,ro)=>{((n,h)=>{typeof define=="function"&&define.amd?define([],h):typeof ro=="object"&&typeof ao<"u"?ro.exports=h():n.Papa=h()})(ao,function n(){var h=typeof self<"u"?self:typeof window<"u"?window:h!==void 0?h:{},i,l=!h.document&&!!h.postMessage,c=h.IS_PAPA_WORKER||!1,_={},V=0,L={};function ve(w){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(C){var I=pi(C);I.chunkSize=parseInt(I.chunkSize),C.step||C.chunk||(I.chunkSize=null),this._handle=new Ut(I),(this._handle.streamer=this)._config=I}.call(this,w),this.parseChunk=function(C,I){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let Y=this._config.newline;Y||(U=this._config.quoteChar||'"',Y=this._handle.guessLineEndings(C,U)),C=[...C.split(Y).slice(z)].join(Y)}this.isFirstChunk&&ye(this._config.beforeFirstChunk)&&(U=this._config.beforeFirstChunk(C))!==void 0&&(C=U),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+C,U=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(C=U.meta.cursor,z=(this._finished||(this._partialLine=z.substring(C-this._baseIndex),this._baseIndex=C),U&&U.data&&(this._rowCount+=U.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),c)h.postMessage({results:U,workerId:L.WORKER_ID,finished:z});else if(ye(this._config.chunk)&&!I){if(this._config.chunk(U,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=U=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(U.data),this._completeResults.errors=this._completeResults.errors.concat(U.errors),this._completeResults.meta=U.meta),this._completed||!z||!ye(this._config.complete)||U&&U.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||U&&U.meta.paused||this._nextChunk(),U}this._halted=!0},this._sendError=function(C){ye(this._config.error)?this._config.error(C):c&&this._config.error&&h.postMessage({workerId:L.WORKER_ID,error:C,finished:!1})}}function Se(w){var C;(w=w||{}).chunkSize||(w.chunkSize=L.RemoteChunkSize),ve.call(this,w),this._nextChunk=l?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(I){this._input=I,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(C=new XMLHttpRequest,this._config.withCredentials&&(C.withCredentials=this._config.withCredentials),l||(C.onload=kt(this._chunkLoaded,this),C.onerror=kt(this._chunkError,this)),C.open(this._config.downloadRequestBody?"POST":"GET",this._input,!l),this._config.downloadRequestHeaders){var I,z=this._config.downloadRequestHeaders;for(I in z)C.setRequestHeader(I,z[I])}var U;this._config.chunkSize&&(U=this._start+this._config.chunkSize-1,C.setRequestHeader("Range","bytes="+this._start+"-"+U));try{C.send(this._config.downloadRequestBody)}catch(Y){this._chunkError(Y.message)}l&&C.status===0&&this._chunkError()}},this._chunkLoaded=function(){C.readyState===4&&(C.status<200||400<=C.status?this._chunkError():(this._start+=this._config.chunkSize||C.responseText.length,this._finished=!this._config.chunkSize||this._start>=(I=>(I=I.getResponseHeader("Content-Range"))!==null?parseInt(I.substring(I.lastIndexOf("/")+1)):-1)(C),this.parseChunk(C.responseText)))},this._chunkError=function(I){I=C.statusText||I,this._sendError(new Error(I))}}function dt(w){(w=w||{}).chunkSize||(w.chunkSize=L.LocalChunkSize),ve.call(this,w);var C,I,z=typeof FileReader<"u";this.stream=function(U){this._input=U,I=U.slice||U.webkitSlice||U.mozSlice,z?((C=new FileReader).onload=kt(this._chunkLoaded,this),C.onerror=kt(this._chunkError,this)):C=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var U=this._input,Y=(this._config.chunkSize&&(Y=Math.min(this._start+this._config.chunkSize,this._input.size),U=I.call(U,this._start,Y)),C.readAsText(U,this._config.encoding));z||this._chunkLoaded({target:{result:Y}})},this._chunkLoaded=function(U){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(U.target.result)},this._chunkError=function(){this._sendError(C.error)}}function a(w){var C;ve.call(this,w=w||{}),this.stream=function(I){return C=I,this._nextChunk()},this._nextChunk=function(){var I,z;if(!this._finished)return I=this._config.chunkSize,C=I?(z=C.substring(0,I),C.substring(I)):(z=C,""),this._finished=!C,this.parseChunk(z)}}function pt(w){ve.call(this,w=w||{});var C=[],I=!0,z=!1;this.pause=function(){ve.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){ve.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(U){this._input=U,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&C.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),C.length?this.parseChunk(C.shift()):I=!0},this._streamData=kt(function(U){try{C.push(typeof U=="string"?U:U.toString(this._config.encoding)),I&&(I=!1,this._checkIsFinished(),this.parseChunk(C.shift()))}catch(Y){this._streamError(Y)}},this),this._streamError=kt(function(U){this._streamCleanUp(),this._sendError(U)},this),this._streamEnd=kt(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=kt(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function Ut(w){var C,I,z,U,Y=Math.pow(2,53),Ee=-Y,X=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,it=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,q=this,re=0,J=0,ze=!1,H=!1,ie=[],j={data:[],errors:[],meta:{}};function b(ne){return w.skipEmptyLines==="greedy"?ne.join("").trim()==="":ne.length===1&&ne[0].length===0}function he(){if(j&&z&&(nt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+L.DefaultDelimiter+"'"),z=!1),w.skipEmptyLines&&(j.data=j.data.filter(function(_e){return!b(_e)})),Ie()){let _e=function(Ce,be){ye(w.transformHeader)&&(Ce=w.transformHeader(Ce,be)),ie.push(Ce)};var Z=_e;if(j)if(Array.isArray(j.data[0])){for(var ne=0;Ie()&&ne<j.data.length;ne++)j.data[ne].forEach(_e);j.data.splice(0,1)}else j.data.forEach(_e)}function ae(_e,Ce){for(var be=w.header?{}:[],se=0;se<_e.length;se++){var Q=se,Ue=_e[se],Ue=((le,xe)=>(Ne=>(w.dynamicTypingFunction&&w.dynamicTyping[Ne]===void 0&&(w.dynamicTyping[Ne]=w.dynamicTypingFunction(Ne)),(w.dynamicTyping[Ne]||w.dynamicTyping)===!0))(le)?xe==="true"||xe==="TRUE"||xe!=="false"&&xe!=="FALSE"&&((Ne=>{if(X.test(Ne)&&(Ne=parseFloat(Ne),Ee<Ne&&Ne<Y))return 1})(xe)?parseFloat(xe):it.test(xe)?new Date(xe):xe===""?null:xe):xe)(Q=w.header?se>=ie.length?"__parsed_extra":ie[se]:Q,Ue=w.transform?w.transform(Ue,Q):Ue);Q==="__parsed_extra"?(be[Q]=be[Q]||[],be[Q].push(Ue)):be[Q]=Ue}return w.header&&(se>ie.length?nt("FieldMismatch","TooManyFields","Too many fields: expected "+ie.length+" fields but parsed "+se,J+Ce):se<ie.length&&nt("FieldMismatch","TooFewFields","Too few fields: expected "+ie.length+" fields but parsed "+se,J+Ce)),be}var we;j&&(w.header||w.dynamicTyping||w.transform)&&(we=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(ae),we=j.data.length):j.data=ae(j.data,0),w.header&&j.meta&&(j.meta.fields=ie),J+=we)}function Ie(){return w.header&&ie.length===0}function nt(ne,ae,we,Z){ne={type:ne,code:ae,message:we},Z!==void 0&&(ne.row=Z),j.errors.push(ne)}ye(w.step)&&(U=w.step,w.step=function(ne){j=ne,Ie()?he():(he(),j.data.length!==0&&(re+=ne.data.length,w.preview&&re>w.preview?I.abort():(j.data=j.data[0],U(j,q))))}),this.parse=function(ne,ae,we){var Z=w.quoteChar||'"',Z=(w.newline||(w.newline=this.guessLineEndings(ne,Z)),z=!1,w.delimiter?ye(w.delimiter)&&(w.delimiter=w.delimiter(ne),j.meta.delimiter=w.delimiter):((Z=((_e,Ce,be,se,Q)=>{var Ue,le,xe,Ne;Q=Q||[","," ","|",";",L.RECORD_SEP,L.UNIT_SEP];for(var Mt=0;Mt<Q.length;Mt++){for(var je,Rt=Q[Mt],Ae=0,gt=0,Le=0,He=(xe=void 0,new Lt({comments:se,delimiter:Rt,newline:Ce,preview:10}).parse(_e)),St=0;St<He.data.length;St++)be&&b(He.data[St])?Le++:(je=He.data[St].length,gt+=je,xe===void 0?xe=je:0<je&&(Ae+=Math.abs(je-xe),xe=je));0<He.data.length&&(gt/=He.data.length-Le),(le===void 0||Ae<=le)&&(Ne===void 0||Ne<gt)&&1.99<gt&&(le=Ae,Ue=Rt,Ne=gt)}return{successful:!!(w.delimiter=Ue),bestDelimiter:Ue}})(ne,w.newline,w.skipEmptyLines,w.comments,w.delimitersToGuess)).successful?w.delimiter=Z.bestDelimiter:(z=!0,w.delimiter=L.DefaultDelimiter),j.meta.delimiter=w.delimiter),pi(w));return w.preview&&w.header&&Z.preview++,C=ne,I=new Lt(Z),j=I.parse(C,ae,we),he(),ze?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return ze},this.pause=function(){ze=!0,I.abort(),C=ye(w.chunk)?"":C.substring(I.getCharIndex())},this.resume=function(){q.streamer._halted?(ze=!1,q.streamer.parseChunk(C,!0)):setTimeout(q.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,I.abort(),j.meta.aborted=!0,ye(w.complete)&&w.complete(j),C=""},this.guessLineEndings=function(_e,Z){_e=_e.substring(0,1048576);var Z=new RegExp(jt(Z)+"([^]*?)"+jt(Z),"gm"),we=(_e=_e.replace(Z,"")).split("\r"),Z=_e.split(`
|
|
6
|
-
`),_e=1<Z.length&&Z[0].length<we[0].length;if(we.length===1||_e)return`
|
|
7
|
-
`;for(var Ce=0,be=0;be<we.length;be++)we[be][0]===`
|
|
8
|
-
`&&Ce++;return Ce>=we.length/2?`\r
|
|
9
|
-
`:"\r"}}function jt(w){return w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(w){var C=(w=w||{}).delimiter,I=w.newline,z=w.comments,U=w.step,Y=w.preview,Ee=w.fastMode,X=null,it=!1,q=w.quoteChar==null?'"':w.quoteChar,re=q;if(w.escapeChar!==void 0&&(re=w.escapeChar),(typeof C!="string"||-1<L.BAD_DELIMITERS.indexOf(C))&&(C=","),z===C)throw new Error("Comment character same as delimiter");z===!0?z="#":(typeof z!="string"||-1<L.BAD_DELIMITERS.indexOf(z))&&(z=!1),I!==`
|
|
10
|
-
`&&I!=="\r"&&I!==`\r
|
|
11
|
-
`&&(I=`
|
|
12
|
-
`);var J=0,ze=!1;this.parse=function(H,ie,j){if(typeof H!="string")throw new Error("Input must be a string");var b=H.length,he=C.length,Ie=I.length,nt=z.length,ne=ye(U),ae=[],we=[],Z=[],_e=J=0;if(!H)return Ae();if(Ee||Ee!==!1&&H.indexOf(q)===-1){for(var Ce=H.split(I),be=0;be<Ce.length;be++){if(Z=Ce[be],J+=Z.length,be!==Ce.length-1)J+=I.length;else if(j)return Ae();if(!z||Z.substring(0,nt)!==z){if(ne){if(ae=[],Ne(Z.split(C)),gt(),ze)return Ae()}else Ne(Z.split(C));if(Y&&Y<=be)return ae=ae.slice(0,Y),Ae(!0)}}return Ae()}for(var se=H.indexOf(C,J),Q=H.indexOf(I,J),Ue=new RegExp(jt(re)+jt(q),"g"),le=H.indexOf(q,J);;)if(H[J]===q)for(le=J,J++;;){if((le=H.indexOf(q,le+1))===-1)return j||we.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ae.length,index:J}),je();if(le===b-1)return je(H.substring(J,le).replace(Ue,q));if(q===re&&H[le+1]===re)le++;else if(q===re||le===0||H[le-1]!==re){se!==-1&&se<le+1&&(se=H.indexOf(C,le+1));var xe=Mt((Q=Q!==-1&&Q<le+1?H.indexOf(I,le+1):Q)===-1?se:Math.min(se,Q));if(H.substr(le+1+xe,he)===C){Z.push(H.substring(J,le).replace(Ue,q)),H[J=le+1+xe+he]!==q&&(le=H.indexOf(q,J)),se=H.indexOf(C,J),Q=H.indexOf(I,J);break}if(xe=Mt(Q),H.substring(le+1+xe,le+1+xe+Ie)===I){if(Z.push(H.substring(J,le).replace(Ue,q)),Rt(le+1+xe+Ie),se=H.indexOf(C,J),le=H.indexOf(q,J),ne&&(gt(),ze))return Ae();if(Y&&ae.length>=Y)return Ae(!0);break}we.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ae.length,index:J}),le++}}else if(z&&Z.length===0&&H.substring(J,J+nt)===z){if(Q===-1)return Ae();J=Q+Ie,Q=H.indexOf(I,J),se=H.indexOf(C,J)}else if(se!==-1&&(se<Q||Q===-1))Z.push(H.substring(J,se)),J=se+he,se=H.indexOf(C,J);else{if(Q===-1)break;if(Z.push(H.substring(J,Q)),Rt(Q+Ie),ne&&(gt(),ze))return Ae();if(Y&&ae.length>=Y)return Ae(!0)}return je();function Ne(Le){ae.push(Le),_e=J}function Mt(Le){var He=0;return He=Le!==-1&&(Le=H.substring(le+1,Le))&&Le.trim()===""?Le.length:He}function je(Le){return j||(Le===void 0&&(Le=H.substring(J)),Z.push(Le),J=b,Ne(Z),ne&>()),Ae()}function Rt(Le){J=Le,Ne(Z),Z=[],Q=H.indexOf(I,J)}function Ae(Le){if(w.header&&!ie&&ae.length&&!it){var He=ae[0],St={},qi=new Set(He);let s=!1;for(let v=0;v<He.length;v++){let P=He[v];if(St[P=ye(w.transformHeader)?w.transformHeader(P,v):P]){let F,e=St[P];for(;F=P+"_"+e,e++,qi.has(F););qi.add(F),He[v]=F,St[P]++,s=!0,(X=X===null?{}:X)[F]=P}else St[P]=1,He[v]=P;qi.add(P)}s&&console.warn("Duplicate headers found and renamed."),it=!0}return{data:ae,errors:we,meta:{delimiter:C,linebreak:I,aborted:ze,truncated:!!Le,cursor:_e+(ie||0),renamedHeaders:X}}}function gt(){U(Ae()),ae=[],we=[]}},this.abort=function(){ze=!0},this.getCharIndex=function(){return J}}function on(w){var C=w.data,I=_[C.workerId],z=!1;if(C.error)I.userError(C.error,C.file);else if(C.results&&C.results.data){var U={abort:function(){z=!0,ht(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Jt,resume:Jt};if(ye(I.userStep)){for(var Y=0;Y<C.results.data.length&&(I.userStep({data:C.results.data[Y],errors:C.results.errors,meta:C.results.meta},U),!z);Y++);delete C.results}else ye(I.userChunk)&&(I.userChunk(C.results,U,C.file),delete C.results)}C.finished&&!z&&ht(C.workerId,C.results)}function ht(w,C){var I=_[w];ye(I.userComplete)&&I.userComplete(C),I.terminate(),delete _[w]}function Jt(){throw new Error("Not implemented.")}function pi(w){if(typeof w!="object"||w===null)return w;var C,I=Array.isArray(w)?[]:{};for(C in w)I[C]=pi(w[C]);return I}function kt(w,C){return function(){w.apply(C,arguments)}}function ye(w){return typeof w=="function"}return L.parse=function(w,C){var I=(C=C||{}).dynamicTyping||!1;if(ye(I)&&(C.dynamicTypingFunction=I,I={}),C.dynamicTyping=I,C.transform=!!ye(C.transform)&&C.transform,!C.worker||!L.WORKERS_SUPPORTED)return I=null,L.NODE_STREAM_INPUT,typeof w=="string"?(w=(z=>z.charCodeAt(0)!==65279?z:z.slice(1))(w),I=new(C.download?Se:a)(C)):w.readable===!0&&ye(w.read)&&ye(w.on)?I=new pt(C):(h.File&&w instanceof File||w instanceof Object)&&(I=new dt(C)),I.stream(w);(I=(()=>{var z;return!!L.WORKERS_SUPPORTED&&(z=(()=>{var U=h.URL||h.webkitURL||null,Y=n.toString();return L.BLOB_URL||(L.BLOB_URL=U.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",Y,")();"],{type:"text/javascript"})))})(),(z=new h.Worker(z)).onmessage=on,z.id=V++,_[z.id]=z)})()).userStep=C.step,I.userChunk=C.chunk,I.userComplete=C.complete,I.userError=C.error,C.step=ye(C.step),C.chunk=ye(C.chunk),C.complete=ye(C.complete),C.error=ye(C.error),delete C.worker,I.postMessage({input:w,config:C,workerId:I.id})},L.unparse=function(w,C){var I=!1,z=!0,U=",",Y=`\r
|
|
13
|
-
`,Ee='"',X=Ee+Ee,it=!1,q=null,re=!1,J=((()=>{if(typeof C=="object"){if(typeof C.delimiter!="string"||L.BAD_DELIMITERS.filter(function(ie){return C.delimiter.indexOf(ie)!==-1}).length||(U=C.delimiter),typeof C.quotes!="boolean"&&typeof C.quotes!="function"&&!Array.isArray(C.quotes)||(I=C.quotes),typeof C.skipEmptyLines!="boolean"&&typeof C.skipEmptyLines!="string"||(it=C.skipEmptyLines),typeof C.newline=="string"&&(Y=C.newline),typeof C.quoteChar=="string"&&(Ee=C.quoteChar),typeof C.header=="boolean"&&(z=C.header),Array.isArray(C.columns)){if(C.columns.length===0)throw new Error("Option columns is empty");q=C.columns}C.escapeChar!==void 0&&(X=C.escapeChar+Ee),C.escapeFormulae instanceof RegExp?re=C.escapeFormulae:typeof C.escapeFormulae=="boolean"&&C.escapeFormulae&&(re=/^[=+\-@\t\r].*$/)}})(),new RegExp(jt(Ee),"g"));if(typeof w=="string"&&(w=JSON.parse(w)),Array.isArray(w)){if(!w.length||Array.isArray(w[0]))return ze(null,w,it);if(typeof w[0]=="object")return ze(q||Object.keys(w[0]),w,it)}else if(typeof w=="object")return typeof w.data=="string"&&(w.data=JSON.parse(w.data)),Array.isArray(w.data)&&(w.fields||(w.fields=w.meta&&w.meta.fields||q),w.fields||(w.fields=Array.isArray(w.data[0])?w.fields:typeof w.data[0]=="object"?Object.keys(w.data[0]):[]),Array.isArray(w.data[0])||typeof w.data[0]=="object"||(w.data=[w.data])),ze(w.fields||[],w.data||[],it);throw new Error("Unable to serialize unrecognized input");function ze(ie,j,b){var he="",Ie=(typeof ie=="string"&&(ie=JSON.parse(ie)),typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(ie)&&0<ie.length),nt=!Array.isArray(j[0]);if(Ie&&z){for(var ne=0;ne<ie.length;ne++)0<ne&&(he+=U),he+=H(ie[ne],ne);0<j.length&&(he+=Y)}for(var ae=0;ae<j.length;ae++){var we=(Ie?ie:j[ae]).length,Z=!1,_e=Ie?Object.keys(j[ae]).length===0:j[ae].length===0;if(b&&!Ie&&(Z=b==="greedy"?j[ae].join("").trim()==="":j[ae].length===1&&j[ae][0].length===0),b==="greedy"&&Ie){for(var Ce=[],be=0;be<we;be++){var se=nt?ie[be]:be;Ce.push(j[ae][se])}Z=Ce.join("").trim()===""}if(!Z){for(var Q=0;Q<we;Q++){0<Q&&!_e&&(he+=U);var Ue=Ie&&nt?ie[Q]:Q;he+=H(j[ae][Ue],Q)}ae<j.length-1&&(!b||0<we&&!_e)&&(he+=Y)}}return he}function H(ie,j){var b,he;return ie==null?"":ie.constructor===Date?JSON.stringify(ie).slice(1,25):(he=!1,re&&typeof ie=="string"&&re.test(ie)&&(ie="'"+ie,he=!0),b=ie.toString().replace(J,X),(he=he||I===!0||typeof I=="function"&&I(ie,j)||Array.isArray(I)&&I[j]||((Ie,nt)=>{for(var ne=0;ne<nt.length;ne++)if(-1<Ie.indexOf(nt[ne]))return!0;return!1})(b,L.BAD_DELIMITERS)||-1<b.indexOf(U)||b.charAt(0)===" "||b.charAt(b.length-1)===" ")?Ee+b+Ee:b)}},L.RECORD_SEP="",L.UNIT_SEP="",L.BYTE_ORDER_MARK="\uFEFF",L.BAD_DELIMITERS=["\r",`
|
|
14
|
-
`,'"',L.BYTE_ORDER_MARK],L.WORKERS_SUPPORTED=!l&&!!h.Worker,L.NODE_STREAM_INPUT=1,L.LocalChunkSize=10485760,L.RemoteChunkSize=5242880,L.DefaultDelimiter=",",L.Parser=Lt,L.ParserHandle=Ut,L.NetworkStreamer=Se,L.FileStreamer=dt,L.StringStreamer=a,L.ReadableStreamStreamer=pt,h.jQuery&&((i=h.jQuery).fn.parse=function(w){var C=w.config||{},I=[];return this.each(function(Y){if(!(i(this).prop("tagName").toUpperCase()==="INPUT"&&i(this).attr("type").toLowerCase()==="file"&&h.FileReader)||!this.files||this.files.length===0)return!0;for(var Ee=0;Ee<this.files.length;Ee++)I.push({file:this.files[Ee],inputElem:this,instanceConfig:i.extend({},C)})}),z(),this;function z(){if(I.length===0)ye(w.complete)&&w.complete();else{var Y,Ee,X,it,q=I[0];if(ye(w.before)){var re=w.before(q.file,q.inputElem);if(typeof re=="object"){if(re.action==="abort")return Y="AbortError",Ee=q.file,X=q.inputElem,it=re.reason,void(ye(w.error)&&w.error({name:Y},Ee,X,it));if(re.action==="skip")return void U();typeof re.config=="object"&&(q.instanceConfig=i.extend(q.instanceConfig,re.config))}else if(re==="skip")return void U()}var J=q.instanceConfig.complete;q.instanceConfig.complete=function(ze){ye(J)&&J(ze,q.file,q.inputElem),U()},L.parse(q.file,q.instanceConfig)}}function U(){I.splice(0,1),z()}}),c&&(h.onmessage=function(w){w=w.data,L.WORKER_ID===void 0&&w&&(L.WORKER_ID=w.workerId),typeof w.input=="string"?h.postMessage({workerId:L.WORKER_ID,results:L.parse(w.input,w.config),finished:!0}):(h.File&&w.input instanceof File||w.input instanceof Object)&&(w=L.parse(w.input,w.config))&&h.postMessage({workerId:L.WORKER_ID,results:w,finished:!0})}),(Se.prototype=Object.create(ve.prototype)).constructor=Se,(dt.prototype=Object.create(ve.prototype)).constructor=dt,(a.prototype=Object.create(a.prototype)).constructor=a,(pt.prototype=Object.create(ve.prototype)).constructor=pt,L})});var ga=(()=>{class n extends qo{pathId;ngOnInit(){this.pathId="url(#"+Yi()+")"}static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275cmp=Pe({type:n,selectors:[["UploadIcon"]],features:[wt],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(l,c){l&1&&(wo(),p(0,"svg",0)(1,"g"),N(2,"path",1),m(),p(3,"defs")(4,"clipPath",2),N(5,"rect",3),m()()()),l&2&&(ct(c.getClassNames()),ge("aria-label",c.ariaLabel)("aria-hidden",c.ariaHidden)("role",c.role),f(),ge("clip-path",c.pathId),f(3),y("id",c.pathId))},encapsulation:2})}return n})();var We=(()=>{class n{constructor(){this.#e=K(Go),this.authService=K(Ko)}#e;getJournalEntryLoader(){return this.#e.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#e.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#e.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(i){return this.#e.post("","api/Journal/JournalEntry",i)}getJournalEntryInfo(i){let l={ID:i};return this.#e.get("","/api/Journal/Info",{params:l})}getJournalEntryForm(i){return this.#e.get("",`api/journalloader/form/${i}`).pipe()}getJournalEntryCount(){return this.#e.post("","api/Journal/JournalEntryCount",{})}getJournalEntryCustomerSuggestions(i){let l={Prefix:i,Count:100};return this.#e.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:l})}getJournalEntrySupplierSuggestions(i){let l={Prefix:i,Count:100};return this.#e.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:l})}submitJournalEntry(i){return this.#e.post(void 0,"api/journal/submit",i,{observe:"response"})}deleteJournalEntry(i){let l={params:{ID:i.join(",")}};return this.#e.delete(void 0,"/api/Journal/delete",l)}fetchCategoryOptions(){return this.#e.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(i,l={}){return this.#e.post("","api/ChartOfAccount/Submit",i,l)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275prov=ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Za={filter:{transID:"",bulkID:"",rowCount:10,pageNumber:1,orderBy:0,orderbyCreated:0,auditEditor:!1,listOutletID:[],searchAudit:!1},data:[],count:0},Hn=ea(oa(Za),aa("JournalEntryStore"),ta(n=>({first:at(()=>(n.filter().pageNumber-1)*n.filter().rowCount+1),end:at(()=>Math.min(n.filter().pageNumber*n.filter().rowCount,n.count())),selectedItems:at(()=>n.data().filter(h=>h.checked))})),na(n=>{let h=K(We);return{updateCount(i){Li(n,l=>Te(fe({},l),{count:i}))},updateFilter(i){Li(n,l=>Te(fe({},l),{filter:fe(fe({},l.filter),i)}))},loadJournalEntryLoader:Kn(Rn(Zi(()=>h.getJournalEntryLoader().pipe(Wn({next:i=>{console.log("response",i),Li(n,l=>Te(fe({},l),{filter:Te(fe({},i.filter),{pageNumber:1})})),console.log("store",n)},error(i){console.log("error",i)}}))))),loadJournalEntryData:Kn(Rn(cn(i=>!!i),Zi(i=>h.getJournalEntryData(i).pipe(Pt(l=>Te(fe({},l),{data:l.data.map(c=>Te(fe({},c),{checked:!1}))})),Wn({next(l){console.log("response",l),Li(n,c=>Te(fe({},c),{data:l.data}))},error(l){console.log("error",l)}}))))),updateData:i=>{Li(n,l=>Te(fe({},l),{data:i}))}}}),ia({onInit(n){n.loadJournalEntryLoader()}}));var Xa=["filterRef"],er=["class","page"],tr=n=>[n];function ir(n,h){if(n&1){let i=te();p(0,"button",13),G("click",function(){R(i);let c=k();return B(c.onDeleteJournalEntry())}),x(1," Delete "),m()}}function nr(n,h){n&1&&(p(0,"tr")(1,"th",14),N(2,"p-tableHeaderCheckbox"),m(),p(3,"th"),x(4,"Outlet"),m(),p(5,"th"),x(6,"Number"),m(),p(7,"th"),x(8,"Date/Name"),m(),p(9,"th"),x(10,"Description"),m(),p(11,"th"),x(12,"Code"),m(),p(13,"th"),x(14,"Account"),m(),p(15,"th"),x(16,"Debit"),m(),p(17,"th"),x(18,"Credit"),m()())}function or(n,h){if(n&1&&x(0),n&2){let i=h.$implicit;ot(" ",i.note," ")}}function ar(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let i=h.$implicit;f(),oe(i.accountCode)}}function rr(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let i=h.$implicit;f(),oe(i.accountName)}}function sr(n,h){if(n&1&&(p(0,"span"),x(1),Me(2,"number"),m()),n&2){let i=h.$implicit;f(),oe(Ke(2,1,i.debitAmount))}}function lr(n,h){if(n&1&&(p(0,"span"),x(1),Me(2,"number"),m()),n&2){let i=h.$implicit;f(),oe(Ke(2,1,i.creditAmount))}}function cr(n,h){if(n&1&&(p(0,"tr")(1,"td"),N(2,"p-tableCheckbox",15),m(),p(3,"td"),x(4),m(),p(5,"td")(6,"a",16),x(7),m()(),p(8,"td"),x(9),Me(10,"date"),m(),p(11,"td"),yt(12,or,1,1,null,null,Tt),m(),p(14,"td")(15,"div",17),yt(16,ar,2,1,"span",null,Tt),m()(),p(18,"td")(19,"div",17),yt(20,rr,2,1,"span",null,Tt),m()(),p(22,"td")(23,"div",17),yt(24,sr,3,3,"span",null,Tt),m()(),p(26,"td")(27,"div",17),yt(28,lr,3,3,"span",null,Tt),m()()()),n&2){let i=h.$implicit;f(2),y("value",i),f(2),oe(i.outletName),f(2),y("routerLink",ke(8,tr,i.id)),f(),oe(i.number),f(2),oe(Qi(10,5,i.date,"dd MMM y")),f(3),_t(i.items),f(4),_t(i.items),f(4),_t(i.items),f(4),_t(i.items),f(4),_t(i.items)}}function ur(n,h){if(n&1&&x(0),n&2){let i=k(2);ot(" ",i.JournalEntryStore.count()," ")}}function mr(n,h){if(n&1){let i=te();p(0,"p-button",19),G("onClick",function(){R(i);let c=k(2);return B(c.getJournalEntryCount())}),m()}n&2&&y("rounded",!0)("text",!0)}function dr(n,h){if(n&1&&(x(0),A(1,ur,1,1)(2,mr,1,2,"p-button",18),x(3," entries ")),n&2){let i=k();gn(" Showing ",i.JournalEntryStore.first()," to ",i.JournalEntryStore.end()," of "),f(),Re(i.JournalEntryStore.count()?1:2)}}function pr(n,h){n&1&&(p(0,"div",20)(1,"div",21)(2,"h5",22),x(3,"Card title"),m(),p(4,"h6",23),x(5,"Card subtitle"),m(),p(6,"p",24),x(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),m(),p(8,"a",25),x(9,"Card link"),m(),p(10,"a",25),x(11,"Another link"),m()()())}var fa=(()=>{class n{constructor(){this.JournalEntryStore=K(Hn),this.modalService=K(wn),this.journalEntryService=K(We)}ngOnInit(){console.log("Journal Entry Page");let i=this.JournalEntryStore.filter;this.JournalEntryStore.loadJournalEntryData(i)}onFilterChange(i){console.log("Filter Change",i),this.modalService.open(this.templateRef)}onRowSelect(i){this.updateRowSelection(i.data,!0)}onRowUnselect(i){this.updateRowSelection(i.data,!1)}updateRowSelection(i,l){this.JournalEntryStore.updateData(this.JournalEntryStore.data().map(c=>c.id===i.id?Te(fe({},c),{checked:l}):c))}onHeaderCheckboxToggle(i){let l=this.JournalEntryStore.data().map(c=>Te(fe({},c),{checked:i.checked}));this.JournalEntryStore.updateData(l)}onPageChange(i){let l=i.first/i.rows;this.JournalEntryStore.updateFilter({pageNumber:l+1})}next(){this.JournalEntryStore.updateFilter({pageNumber:this.JournalEntryStore.filter().pageNumber+1})}prev(){this.JournalEntryStore.filter().pageNumber<=1||this.JournalEntryStore.updateFilter({pageNumber:this.JournalEntryStore.filter().pageNumber-1})}getJournalEntryCount(){this.journalEntryService.getJournalEntryCount().pipe(Fe(i=>this.JournalEntryStore.updateCount(i.count))).subscribe()}onDeleteJournalEntry(){let l=this.JournalEntryStore.selectedItems().map(c=>c.id);this.journalEntryService.deleteJournalEntry(l).pipe(Fe(()=>{this.JournalEntryStore.loadJournalEntryData(this.JournalEntryStore.filter())})).subscribe()}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-entry",8,"page"]],viewQuery:function(l,c){if(l&1&&ut(Xa,7),l&2){let _;ue(_=me())&&(c.templateRef=_.first)}},features:[Ge([Hn])],attrs:er,decls:23,vars:9,consts:[["header",""],["body",""],["paginatorleft",""],["filterRef",""],["pageTitle","Manual Journal",3,"eventFilterChange","isSearchableInput"],["ngProjectAs","action-button",5,["action-button"]],["class","btn btn-danger rounded",3,"click",4,"ngIf"],["role","group","aria-label","Basic example",1,"btn-group"],["type","button",1,"btn","btn-light"],["type","button","routerLink","add",1,"btn","btn-primary","rounded","d-flex","gap-2","align-items-center"],[1,"fa-solid","fa-plus"],["ngProjectAs","content",5,["content"]],["stripedRows","","dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable","scrollHeight"],[1,"btn","btn-danger","rounded",3,"click"],[2,"width","4rem"],[3,"value"],[1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["icon","fa-light fa-question","severity","primary",3,"rounded","text"],["icon","fa-light fa-question","severity","primary",3,"onClick","rounded","text"],[1,"card",2,"width","18rem"],[1,"card-body"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(l,c){if(l&1){let _=te();p(0,"app-main-panel",4),G("eventFilterChange",function(L){return R(_),B(c.onFilterChange(L))}),de(1,5),A(2,ir,2,0,"button",6),p(3,"div",7)(4,"button",8),x(5,"Import"),m(),p(6,"button",8),x(7,"Export"),m()(),p(8,"a",9),N(9,"i",10),p(10,"span"),x(11,"Add"),m()(),pe(),de(12,11),p(13,"p-card")(14,"p-table",12),G("onPage",function(L){return R(_),B(c.onPageChange(L))})("onRowSelect",function(L){return R(_),B(c.onRowSelect(L))})("onRowUnselect",function(L){return R(_),B(c.onRowUnselect(L))})("onHeaderCheckboxToggle",function(L){return R(_),B(c.onHeaderCheckboxToggle(L))}),A(15,nr,19,0,"ng-template",null,0,ce)(17,cr,30,10,"ng-template",null,1,ce)(19,dr,4,3,"ng-template",null,2,ce),m()(),pe(),m(),A(21,pr,12,0,"ng-template",null,3,ce)}l&2&&(y("isSearchableInput",!0),f(2),y("ngIf",c.JournalEntryStore.selectedItems().length),f(12),y("value",c.JournalEntryStore.data())("paginator",!0)("totalRecords",c.JournalEntryStore.count())("lazy",!0)("rows",c.JournalEntryStore.filter().rowCount)("scrollable",!0)("scrollHeight","calc(100vh - 200px)"))},dependencies:[Et,Be,Xe,Ft,vn,ua,$o,Sn,bn,At,Vt,la,ca,ti,xt,Dt,kn],encapsulation:2,changeDetection:0})}}return n})();var eo=ui(On());var Qn=ui(ya());var Ki=(()=>{class n{constructor(i){this.el=i,this.options={},this.previousValue=null,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.options=Te(fe({},Qn.default.getPredefinedOptions()),{decimalPlaces:0}),this.initAutoNumeric()}ngOnChanges(i){i.options&&!i.options.firstChange&&this.reinitAutoNumeric()}ngOnDestroy(){this.anInstance?.remove()}initAutoNumeric(){this.anInstance=new Qn.default(this.el.nativeElement,this.options),this.previousValue!=null&&this.anInstance.set(this.previousValue)}reinitAutoNumeric(){this.anInstance?.remove(),this.initAutoNumeric()}writeValue(i){this.previousValue=i,this.anInstance&&this.anInstance.set(i??"")}registerOnChange(i){this.onChange=i}registerOnTouched(i){this.onTouched=i}setDisabledState(i){this.el.nativeElement.disabled=i}onInput(){let i=this.anInstance?.getNumber();i!=null&&!isNaN(i)&&(this.previousValue=i),this.onChange(i??null)}onBlur(){this.onTouched();let i=this.el.nativeElement.value.trim(),l=this.anInstance?.getNumber();(i===""||l===void 0||isNaN(l))&&(this.previousValue!=null?this.anInstance?.set(this.previousValue):this.anInstance?.clear())}static{this.\u0275fac=function(l){return new(l||n)(zt(xo))}}static{this.\u0275dir=dn({type:n,selectors:[["","autoNumeric",""]],hostBindings:function(l,c){l&1&&G("input",function(){return c.onInput()})("blur",function(){return c.onBlur()})},inputs:{options:[0,"autoNumeric","options"]},features:[Ge([{provide:jo,useExisting:bo(()=>n),multi:!0}]),So]})}}return n})();var hr=["container"],gr=["icon"],fr=["closeicon"],vr=["*"],yr=(n,h)=>({showTransitionParams:n,hideTransitionParams:h}),_r=n=>({value:"visible()",params:n}),br=n=>({closeCallback:n});function Sr(n,h){n&1&&Ye(0)}function wr(n,h){if(n&1&&A(0,Sr,1,0,"ng-container",7),n&2){let i=k(2);y("ngTemplateOutlet",i.iconTemplate||i.iconTemplate)}}function Cr(n,h){if(n&1&&N(0,"i",3),n&2){let i=k(2);y("ngClass",i.icon)}}function xr(n,h){if(n&1&&N(0,"span",9),n&2){let i=k(3);y("ngClass",i.cx("text"))("innerHTML",i.text,Eo)}}function Er(n,h){if(n&1&&(p(0,"div"),A(1,xr,1,2,"span",8),m()),n&2){let i=k(2);f(),y("ngIf",!i.escape)}}function Pr(n,h){if(n&1&&(p(0,"span",5),x(1),m()),n&2){let i=k(3);y("ngClass",i.cx("text")),f(),oe(i.text)}}function kr(n,h){if(n&1&&A(0,Pr,2,2,"span",10),n&2){let i=k(2);y("ngIf",i.escape&&i.text)}}function Tr(n,h){n&1&&Ye(0)}function Fr(n,h){if(n&1&&A(0,Tr,1,0,"ng-container",11),n&2){let i=k(2);y("ngTemplateOutlet",i.containerTemplate||i.containerTemplate)("ngTemplateOutletContext",ke(2,br,i.close.bind(i)))}}function Or(n,h){if(n&1&&(p(0,"span",5),hn(1),m()),n&2){let i=k(2);y("ngClass",i.cx("text"))}}function Ir(n,h){if(n&1&&N(0,"i",13),n&2){let i=k(3);y("ngClass",i.closeIcon)}}function Nr(n,h){n&1&&Ye(0)}function Dr(n,h){if(n&1&&A(0,Nr,1,0,"ng-container",7),n&2){let i=k(3);y("ngTemplateOutlet",i.closeIconTemplate||i._closeIconTemplate)}}function Vr(n,h){n&1&&N(0,"TimesIcon",14)}function Ar(n,h){if(n&1){let i=te();p(0,"button",12),G("click",function(c){R(i);let _=k(2);return B(_.close(c))}),A(1,Ir,1,1,"i",13)(2,Dr,1,1,"ng-container")(3,Vr,1,0,"TimesIcon",14),m()}if(n&2){let i=k(2);ge("aria-label",i.closeAriaLabel),f(),Re(i.closeIcon?1:-1),f(),Re(i.closeIconTemplate||i._closeIconTemplate?2:-1),f(),Re(!i.closeIconTemplate&&!i._closeIconTemplate&&!i.closeIcon?3:-1)}}function Lr(n,h){if(n&1&&(p(0,"div",1)(1,"div",2),A(2,wr,1,1,"ng-container")(3,Cr,1,1,"i",3)(4,Er,2,1,"div",4)(5,kr,1,1,"ng-template",null,0,ce)(7,Fr,1,4,"ng-container")(8,Or,2,1,"span",5)(9,Ar,4,4,"button",6),m()()),n&2){let i=Io(6),l=k();y("ngClass",l.containerClass)("@messageAnimation",ke(13,_r,yi(10,yr,l.showTransitionOptions,l.hideTransitionOptions))),ge("aria-live","polite")("role","alert"),f(2),Re(l.iconTemplate||l._iconTemplate?2:-1),f(),Re(l.icon?3:-1),f(),y("ngIf",!l.escape)("ngIfElse",i),f(3),Re(l.containerTemplate||l._containerTemplate?7:8),f(2),Re(l.closable?9:-1)}}var Mr=({dt:n})=>`
|
|
15
|
-
.p-message {
|
|
16
|
-
border-radius: ${n("message.border.radius")};
|
|
17
|
-
outline-width: ${n("message.border.width")};
|
|
18
|
-
outline-style: solid;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.p-message-content {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
padding: ${n("message.content.padding")};
|
|
25
|
-
gap: ${n("message.content.gap")};
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.p-message-icon {
|
|
30
|
-
flex-shrink: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.p-message-close-button {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
flex-shrink: 0;
|
|
38
|
-
margin-inline-start: auto;
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
position: relative;
|
|
41
|
-
width: ${n("message.close.button.width")};
|
|
42
|
-
height: ${n("message.close.button.height")};
|
|
43
|
-
border-radius: ${n("message.close.button.border.radius")};
|
|
44
|
-
background: transparent;
|
|
45
|
-
transition: background ${n("message.transition.duration")}, color ${n("message.transition.duration")}, outline-color ${n("message.transition.duration")}, box-shadow ${n("message.transition.duration")}, opacity 0.3s;
|
|
46
|
-
outline-color: transparent;
|
|
47
|
-
color: inherit;
|
|
48
|
-
padding: 0;
|
|
49
|
-
border: none;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
user-select: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.p-message-close-icon {
|
|
55
|
-
font-size: ${n("message.close.icon.size")};
|
|
56
|
-
width: ${n("message.close.icon.size")};
|
|
57
|
-
height: ${n("message.close.icon.size")};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.p-message-close-button:focus-visible {
|
|
61
|
-
outline-width: ${n("message.close.button.focus.ring.width")};
|
|
62
|
-
outline-style: ${n("message.close.button.focus.ring.style")};
|
|
63
|
-
outline-offset: ${n("message.close.button.focus.ring.offset")};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.p-message-info {
|
|
67
|
-
background: ${n("message.info.background")};
|
|
68
|
-
outline-color: ${n("message.info.border.color")};
|
|
69
|
-
color: ${n("message.info.color")};
|
|
70
|
-
box-shadow: ${n("message.info.shadow")};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.p-message-info .p-message-close-button:focus-visible {
|
|
74
|
-
outline-color: ${n("message.info.close.button.focus.ring.color")};
|
|
75
|
-
box-shadow: ${n("message.info.close.button.focus.ring.shadow")};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.p-message-info .p-message-close-button:hover {
|
|
79
|
-
background: ${n("message.info.close.button.hover.background")};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.p-message-info.p-message-outlined {
|
|
83
|
-
color: ${n("message.info.outlined.color")};
|
|
84
|
-
outline-color: ${n("message.info.outlined.border.color")};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.p-message-info.p-message-simple {
|
|
88
|
-
color: ${n("message.info.simple.color")};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.p-message-success {
|
|
92
|
-
background: ${n("message.success.background")};
|
|
93
|
-
outline-color: ${n("message.success.border.color")};
|
|
94
|
-
color: ${n("message.success.color")};
|
|
95
|
-
box-shadow: ${n("message.success.shadow")};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.p-message-success .p-message-close-button:focus-visible {
|
|
99
|
-
outline-color: ${n("message.success.close.button.focus.ring.color")};
|
|
100
|
-
box-shadow: ${n("message.success.close.button.focus.ring.shadow")};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.p-message-success .p-message-close-button:hover {
|
|
104
|
-
background: ${n("message.success.close.button.hover.background")};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.p-message-success.p-message-outlined {
|
|
108
|
-
color: ${n("message.success.outlined.color")};
|
|
109
|
-
outline-color: ${n("message.success.outlined.border.color")};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.p-message-success.p-message-simple {
|
|
113
|
-
color: ${n("message.success.simple.color")};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.p-message-warn {
|
|
117
|
-
background: ${n("message.warn.background")};
|
|
118
|
-
outline-color: ${n("message.warn.border.color")};
|
|
119
|
-
color: ${n("message.warn.color")};
|
|
120
|
-
box-shadow: ${n("message.warn.shadow")};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.p-message-warn .p-message-close-button:focus-visible {
|
|
124
|
-
outline-color: ${n("message.warn.close.button.focus.ring.color")};
|
|
125
|
-
box-shadow: ${n("message.warn.close.button.focus.ring.shadow")};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.p-message-warn .p-message-close-button:hover {
|
|
129
|
-
background: ${n("message.warn.close.button.hover.background")};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.p-message-warn.p-message-outlined {
|
|
133
|
-
color: ${n("message.warn.outlined.color")};
|
|
134
|
-
outline-color: ${n("message.warn.outlined.border.color")};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.p-message-warn.p-message-simple {
|
|
138
|
-
color: ${n("message.warn.simple.color")};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.p-message-error {
|
|
142
|
-
background: ${n("message.error.background")};
|
|
143
|
-
outline-color: ${n("message.error.border.color")};
|
|
144
|
-
color: ${n("message.error.color")};
|
|
145
|
-
box-shadow: ${n("message.error.shadow")};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.p-message-error .p-message-close-button:focus-visible {
|
|
149
|
-
outline-color: ${n("message.error.close.button.focus.ring.color")};
|
|
150
|
-
box-shadow: ${n("message.error.close.button.focus.ring.shadow")};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.p-message-error .p-message-close-button:hover {
|
|
154
|
-
background: ${n("message.error.close.button.hover.background")};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.p-message-error.p-message-outlined {
|
|
158
|
-
color: ${n("message.error.outlined.color")};
|
|
159
|
-
outline-color: ${n("message.error.outlined.border.color")};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.p-message-error.p-message-simple {
|
|
163
|
-
color: ${n("message.error.simple.color")};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.p-message-secondary {
|
|
167
|
-
background: ${n("message.secondary.background")};
|
|
168
|
-
outline-color: ${n("message.secondary.border.color")};
|
|
169
|
-
color: ${n("message.secondary.color")};
|
|
170
|
-
box-shadow: ${n("message.secondary.shadow")};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.p-message-secondary .p-message-close-button:focus-visible {
|
|
174
|
-
outline-color: ${n("message.secondary.close.button.focus.ring.color")};
|
|
175
|
-
box-shadow: ${n("message.secondary.close.button.focus.ring.shadow")};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.p-message-secondary .p-message-close-button:hover {
|
|
179
|
-
background: ${n("message.secondary.close.button.hover.background")};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.p-message-secondary.p-message-outlined {
|
|
183
|
-
color: ${n("message.secondary.outlined.color")};
|
|
184
|
-
outline-color: ${n("message.secondary.outlined.border.color")};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.p-message-secondary.p-message-simple {
|
|
188
|
-
color: ${n("message.secondary.simple.color")};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.p-message-contrast {
|
|
192
|
-
background: ${n("message.contrast.background")};
|
|
193
|
-
outline-color: ${n("message.contrast.border.color")};
|
|
194
|
-
color: ${n("message.contrast.color")};
|
|
195
|
-
box-shadow: ${n("message.contrast.shadow")};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.p-message-contrast .p-message-close-button:focus-visible {
|
|
199
|
-
outline-color: ${n("message.contrast.close.button.focus.ring.color")};
|
|
200
|
-
box-shadow: ${n("message.contrast.close.button.focus.ring.shadow")};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.p-message-contrast .p-message-close-button:hover {
|
|
204
|
-
background: ${n("message.contrast.close.button.hover.background")};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.p-message-contrast.p-message-outlined {
|
|
208
|
-
color: ${n("message.contrast.outlined.color")};
|
|
209
|
-
outline-color: ${n("message.contrast.outlined.border.color")};
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.p-message-contrast.p-message-simple {
|
|
213
|
-
color: ${n("message.contrast.simple.color")};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.p-message-text {
|
|
217
|
-
display: inline-flex;
|
|
218
|
-
align-items: center;
|
|
219
|
-
font-size: ${n("message.text.font.size")};
|
|
220
|
-
font-weight: ${n("message.text.font.weight")};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.p-message-icon {
|
|
224
|
-
font-size: ${n("message.icon.size")};
|
|
225
|
-
width: ${n("message.icon.size")};
|
|
226
|
-
height: ${n("message.icon.size")};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.p-message-enter-from {
|
|
230
|
-
opacity: 0;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.p-message-enter-active {
|
|
234
|
-
transition: opacity 0.3s;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.p-message.p-message-leave-from {
|
|
238
|
-
max-height: 1000px;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.p-message.p-message-leave-to {
|
|
242
|
-
max-height: 0;
|
|
243
|
-
opacity: 0;
|
|
244
|
-
margin: 0;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.p-message-leave-active {
|
|
248
|
-
overflow: hidden;
|
|
249
|
-
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin 0.3s;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.p-message-leave-active .p-message-close-button {
|
|
253
|
-
opacity: 0;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.p-message-sm .p-message-content {
|
|
257
|
-
padding: ${n("message.content.sm.padding")};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.p-message-sm .p-message-text {
|
|
261
|
-
font-size: ${n("message.text.sm.font.size")};
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.p-message-sm .p-message-icon {
|
|
265
|
-
font-size: ${n("message.icon.sm.size")};
|
|
266
|
-
width: ${n("message.icon.sm.size")};
|
|
267
|
-
height: ${n("message.icon.sm.size")};
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.p-message-sm .p-message-close-icon {
|
|
271
|
-
font-size: ${n("message.close.icon.sm.size")};
|
|
272
|
-
width: ${n("message.close.icon.sm.size")};
|
|
273
|
-
height: ${n("message.close.icon.sm.size")};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.p-message-lg .p-message-content {
|
|
277
|
-
padding: ${n("message.content.lg.padding")};
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.p-message-lg .p-message-text {
|
|
281
|
-
font-size: ${n("message.text.lg.font.size")};
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.p-message-lg .p-message-icon {
|
|
285
|
-
font-size: ${n("message.icon.lg.size")};
|
|
286
|
-
width: ${n("message.icon.lg.size")};
|
|
287
|
-
height: ${n("message.icon.lg.size")};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.p-message-lg .p-message-close-icon {
|
|
291
|
-
font-size: ${n("message.close.icon.lg.size")};
|
|
292
|
-
width: ${n("message.close.icon.lg.size")};
|
|
293
|
-
height: ${n("message.close.icon.lg.size")};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.p-message-outlined {
|
|
297
|
-
background: transparent;
|
|
298
|
-
outline-width: ${n("message.outlined.border.width")};
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.p-message-simple {
|
|
302
|
-
background: transparent;
|
|
303
|
-
outline-color: transparent;
|
|
304
|
-
box-shadow: none;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.p-message-simple .p-message-content {
|
|
308
|
-
padding: ${n("message.simple.content.padding")};
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.p-message-outlined .p-message-close-button:hover,
|
|
312
|
-
.p-message-simple .p-message-close-button:hover {
|
|
313
|
-
background: transparent;
|
|
314
|
-
}`,Rr={root:({props:n})=>["p-message p-component p-message-"+n.severity,{"p-message-simple":n.variant==="simple"}],content:"p-message-content",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close-button",closeIcon:"p-message-close-icon"},_a=(()=>{class n extends Yt{name="message";theme=Mr;classes=Rr;static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var ba=(()=>{class n extends Nt{severity="info";text;escape=!0;style;styleClass;closable=!1;icon;closeIcon;life;showTransitionOptions="300ms ease-out";hideTransitionOptions="200ms cubic-bezier(0.86, 0, 0.07, 1)";size;variant;onClose=new lt;get closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}get containerClass(){let i=this.variant==="outlined"?"p-message-outlined":this.variant==="simple"?"p-message-simple":"",l=this.size==="small"?"p-message-sm":this.size==="large"?"p-message-lg":"";return`p-message-${this.severity} ${i} ${l}`.trim()+(this.styleClass?" "+this.styleClass:"")}visible=Ve(!0);_componentStyle=K(_a);containerTemplate;iconTemplate;closeIconTemplate;templates;_containerTemplate;_iconTemplate;_closeIconTemplate;ngOnInit(){super.ngOnInit(),this.life&&setTimeout(()=>{this.visible.set(!1)},this.life)}ngAfterContentInit(){this.templates?.forEach(i=>{switch(i.getType()){case"container":this._containerTemplate=i.template;break;case"icon":this._iconTemplate=i.template;break;case"closeicon":this._closeIconTemplate=i.template;break}})}close(i){this.visible.set(!1),this.onClose.emit({originalEvent:i})}static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275cmp=Pe({type:n,selectors:[["p-message"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,hr,4),Je(_,gr,4),Je(_,fr,4),Je(_,Di,4)),l&2){let V;ue(V=me())&&(c.containerTemplate=V.first),ue(V=me())&&(c.iconTemplate=V.first),ue(V=me())&&(c.closeIconTemplate=V.first),ue(V=me())&&(c.templates=V)}},inputs:{severity:"severity",text:"text",escape:[2,"escape","escape",bt],style:"style",styleClass:"styleClass",closable:[2,"closable","closable",bt],icon:"icon",closeIcon:"closeIcon",life:"life",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",size:"size",variant:"variant"},outputs:{onClose:"onClose"},features:[Ge([_a]),vi,wt],ngContentSelectors:vr,decls:1,vars:1,consts:[["escapeOut",""],[1,"p-message","p-component",3,"ngClass"],[1,"p-message-content"],[1,"p-message-icon",3,"ngClass"],[4,"ngIf","ngIfElse"],[3,"ngClass"],["pRipple","","type","button",1,"p-message-close-button"],[4,"ngTemplateOutlet"],[3,"ngClass","innerHTML",4,"ngIf"],[3,"ngClass","innerHTML"],[3,"ngClass",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["pRipple","","type","button",1,"p-message-close-button",3,"click"],[1,"p-message-close-icon",3,"ngClass"],["styleClass","p-message-close-icon"]],template:function(l,c){l&1&&(pn(),A(0,Lr,10,15,"div",1)),l&2&&Re(c.visible()?0:-1)},dependencies:[Be,Ct,Xe,Wt,Ai,Xo,tt],encapsulation:2,data:{animation:[Cn("messageAnimation",[Oi(":enter",[mi({opacity:0,transform:"translateY(-25%)"}),Fi("{{showTransitionParams}}")]),Oi(":leave",[Fi("{{hideTransitionParams}}",mi({height:0,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,opacity:0}))])])]},changeDetection:0})}return n})();var Br=["content"],zr=(n,h)=>({"p-progressbar p-component":!0,"p-progressbar-determinate":n,"p-progressbar-indeterminate":h}),Ur=n=>({$implicit:n});function jr(n,h){if(n&1&&(p(0,"div"),x(1),m()),n&2){let i=k(2);Kt("display",i.value!=null&&i.value!==0?"flex":"none"),ge("data-pc-section","label"),f(),gn("",i.value,"",i.unit,"")}}function Jr(n,h){n&1&&Ye(0)}function $r(n,h){if(n&1&&(p(0,"div",3)(1,"div",4),A(2,jr,2,5,"div",5)(3,Jr,1,0,"ng-container",6),m()()),n&2){let i=k();ct(i.valueStyleClass),Kt("width",i.value+"%")("background",i.color),y("ngClass","p-progressbar-value p-progressbar-value-animate"),ge("data-pc-section","value"),f(2),y("ngIf",i.showValue&&!i.contentTemplate&&!i._contentTemplate),f(),y("ngTemplateOutlet",i.contentTemplate||i._contentTemplate)("ngTemplateOutletContext",ke(11,Ur,i.value))}}function Gr(n,h){if(n&1&&(p(0,"div",7),N(1,"div",8),m()),n&2){let i=k();ct(i.valueStyleClass),y("ngClass","p-progressbar-indeterminate-container"),ge("data-pc-section","container"),f(),Kt("background",i.color),ge("data-pc-section","value")}}var Kr=({dt:n})=>`
|
|
315
|
-
.p-progressbar {
|
|
316
|
-
position: relative;
|
|
317
|
-
overflow: hidden;
|
|
318
|
-
height: ${n("progressbar.height")};
|
|
319
|
-
background: ${n("progressbar.background")};
|
|
320
|
-
border-radius: ${n("progressbar.border.radius")};
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.p-progressbar-value {
|
|
324
|
-
margin: 0;
|
|
325
|
-
background: ${n("progressbar.value.background")};
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.p-progressbar-label {
|
|
329
|
-
color: ${n("progressbar.label.color")};
|
|
330
|
-
font-size: ${n("progressbar.label.font.size")};
|
|
331
|
-
font-weight: ${n("progressbar.label.font.weight")};
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.p-progressbar-determinate .p-progressbar-value {
|
|
335
|
-
height: 100%;
|
|
336
|
-
width: 0%;
|
|
337
|
-
position: absolute;
|
|
338
|
-
display: none;
|
|
339
|
-
display: flex;
|
|
340
|
-
align-items: center;
|
|
341
|
-
justify-content: center;
|
|
342
|
-
overflow: hidden;
|
|
343
|
-
transition: width 1s ease-in-out;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.p-progressbar-determinate .p-progressbar-label {
|
|
347
|
-
display: inline-flex;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.p-progressbar-indeterminate .p-progressbar-value::before {
|
|
351
|
-
content: "";
|
|
352
|
-
position: absolute;
|
|
353
|
-
background: inherit;
|
|
354
|
-
top: 0;
|
|
355
|
-
inset-inline-start: 0;
|
|
356
|
-
bottom: 0;
|
|
357
|
-
will-change: inset-inline-start, inset-inline-end;
|
|
358
|
-
animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.p-progressbar-indeterminate .p-progressbar-value::after {
|
|
362
|
-
content: "";
|
|
363
|
-
position: absolute;
|
|
364
|
-
background: inherit;
|
|
365
|
-
top: 0;
|
|
366
|
-
inset-inline-start: 0;
|
|
367
|
-
bottom: 0;
|
|
368
|
-
will-change: inset-inline-start, inset-inline-end;
|
|
369
|
-
animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
|
370
|
-
animation-delay: 1.15s;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
@-webkit-keyframes p-progressbar-indeterminate-anim {
|
|
374
|
-
0% {
|
|
375
|
-
inset-inline-start: -35%;
|
|
376
|
-
inset-inline-end: 100%;
|
|
377
|
-
}
|
|
378
|
-
60% {
|
|
379
|
-
inset-inline-start: 100%;
|
|
380
|
-
inset-inline-end: -90%;
|
|
381
|
-
}
|
|
382
|
-
100% {
|
|
383
|
-
inset-inline-start: 100%;
|
|
384
|
-
inset-inline-end: -90%;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
@keyframes p-progressbar-indeterminate-anim {
|
|
388
|
-
0% {
|
|
389
|
-
inset-inline-start: -35%;
|
|
390
|
-
inset-inline-end: 100%;
|
|
391
|
-
}
|
|
392
|
-
60% {
|
|
393
|
-
inset-inline-start: 100%;
|
|
394
|
-
inset-inline-end: -90%;
|
|
395
|
-
}
|
|
396
|
-
100% {
|
|
397
|
-
inset-inline-start: 100%;
|
|
398
|
-
inset-inline-end: -90%;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
@-webkit-keyframes p-progressbar-indeterminate-anim-short {
|
|
402
|
-
0% {
|
|
403
|
-
inset-inline-start: -200%;
|
|
404
|
-
inset-inline-end: 100%;
|
|
405
|
-
}
|
|
406
|
-
60% {
|
|
407
|
-
inset-inline-start: 107%;
|
|
408
|
-
inset-inline-end: -8%;
|
|
409
|
-
}
|
|
410
|
-
100% {
|
|
411
|
-
inset-inline-start: 107%;
|
|
412
|
-
inset-inline-end: -8%;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
@keyframes p-progressbar-indeterminate-anim-short {
|
|
416
|
-
0% {
|
|
417
|
-
inset-inline-start: -200%;
|
|
418
|
-
inset-inline-end: 100%;
|
|
419
|
-
}
|
|
420
|
-
60% {
|
|
421
|
-
inset-inline-start: 107%;
|
|
422
|
-
inset-inline-end: -8%;
|
|
423
|
-
}
|
|
424
|
-
100% {
|
|
425
|
-
inset-inline-start: 107%;
|
|
426
|
-
inset-inline-end: -8%;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
`,Wr={root:({instance:n})=>["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}],value:"p-progressbar-value",label:"p-progressbar-label"},Sa=(()=>{class n extends Yt{name="progressbar";theme=Kr;classes=Wr;static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var wa=(()=>{class n extends Nt{value;showValue=!0;styleClass;valueStyleClass;style;unit="%";mode="determinate";color;contentTemplate;_componentStyle=K(Sa);templates;_contentTemplate;ngAfterContentInit(){this.templates?.forEach(i=>{switch(i.getType()){case"content":this._contentTemplate=i.template;break;default:this._contentTemplate=i.template}})}static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275cmp=Pe({type:n,selectors:[["p-progressBar"],["p-progressbar"],["p-progress-bar"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,Br,4),Je(_,Di,4)),l&2){let V;ue(V=me())&&(c.contentTemplate=V.first),ue(V=me())&&(c.templates=V)}},inputs:{value:[2,"value","value",_i],showValue:[2,"showValue","showValue",bt],styleClass:"styleClass",valueStyleClass:"valueStyleClass",style:"style",unit:"unit",mode:"mode",color:"color"},features:[Ge([Sa]),vi,wt],decls:3,vars:15,consts:[["role","progressbar",3,"ngStyle","ngClass"],["style","display:flex",3,"ngClass","class","width","background",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[2,"display","flex",3,"ngClass"],[1,"p-progressbar-label"],[3,"display",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass"],[1,"p-progressbar-value","p-progressbar-value-animate"]],template:function(l,c){l&1&&(p(0,"div",0),A(1,$r,4,13,"div",1)(2,Gr,2,7,"div",2),m()),l&2&&(ct(c.styleClass),y("ngStyle",c.style)("ngClass",yi(12,zr,c.mode==="determinate",c.mode==="indeterminate")),ge("aria-valuemin",0)("aria-valuenow",c.value)("aria-valuemax",100)("data-pc-name","progressbar")("data-pc-section","root")("aria-label",c.value+c.unit),f(),y("ngIf",c.mode==="determinate"),f(),y("ngIf",c.mode==="indeterminate"))},dependencies:[Be,Ct,Xe,Wt,bi,tt],encapsulation:2,changeDetection:0})}return n})();var Hr=["file"],qr=["header"],Ca=["content"],Zr=["toolbar"],Qr=["chooseicon"],Yr=["filelabel"],Xr=["uploadicon"],es=["cancelicon"],ts=["empty"],is=["advancedfileinput"],ns=["basicfileinput"],os=(n,h,i,l,c)=>({$implicit:n,uploadedFiles:h,chooseCallback:i,clearCallback:l,uploadCallback:c}),as=(n,h,i,l,c,_,V,L)=>({$implicit:n,uploadedFiles:h,chooseCallback:i,clearCallback:l,removeUploadedFileCallback:c,removeFileCallback:_,progress:V,messages:L}),rs=n=>({$implicit:n});function ss(n,h){if(n&1&&N(0,"span"),n&2){let i=k(3);ct(i.chooseIcon),ge("aria-label",!0)("data-pc-section","chooseicon")}}function ls(n,h){n&1&&N(0,"PlusIcon"),n&2&&ge("aria-label",!0)("data-pc-section","chooseicon")}function cs(n,h){}function us(n,h){n&1&&A(0,cs,0,0,"ng-template")}function ms(n,h){if(n&1&&(p(0,"span"),A(1,us,1,0,null,11),m()),n&2){let i=k(4);ge("aria-label",!0)("data-pc-section","chooseicon"),f(),y("ngTemplateOutlet",i.chooseIconTemplate||i._chooseIconTemplate)}}function ds(n,h){if(n&1&&(de(0),A(1,ls,1,2,"PlusIcon",9)(2,ms,2,3,"span",9),pe()),n&2){let i=k(3);f(),y("ngIf",!i.chooseIconTemplate&&!i._chooseIconTemplate),f(),y("ngIf",i.chooseIconTemplate||i._chooseIconTemplate)}}function ps(n,h){if(n&1&&N(0,"span",21),n&2){let i=k(4);y("ngClass",i.uploadIcon),ge("aria-hidden",!0)}}function hs(n,h){n&1&&N(0,"UploadIcon")}function gs(n,h){}function fs(n,h){n&1&&A(0,gs,0,0,"ng-template")}function vs(n,h){if(n&1&&(p(0,"span"),A(1,fs,1,0,null,11),m()),n&2){let i=k(5);ge("aria-hidden",!0),f(),y("ngTemplateOutlet",i.uploadIconTemplate||i._uploadIconTemplate)}}function ys(n,h){if(n&1&&(de(0),A(1,hs,1,0,"UploadIcon",9)(2,vs,2,2,"span",9),pe()),n&2){let i=k(4);f(),y("ngIf",!i.uploadIconTemplate&&!i._uploadIconTemplate),f(),y("ngIf",i.uploadIconTemplate||i._uploadIconTemplate)}}function _s(n,h){if(n&1){let i=te();p(0,"p-button",19),G("onClick",function(){R(i);let c=k(3);return B(c.upload())}),A(1,ps,1,2,"span",20)(2,ys,3,2,"ng-container",9),m()}if(n&2){let i=k(3);y("label",i.uploadButtonLabel)("disabled",!i.hasFiles()||i.isFileLimitExceeded())("styleClass","p-fileupload-upload-button "+i.uploadStyleClass)("buttonProps",i.uploadButtonProps),f(),y("ngIf",i.uploadIcon),f(),y("ngIf",!i.uploadIcon)}}function bs(n,h){if(n&1&&N(0,"span",21),n&2){let i=k(4);y("ngClass",i.cancelIcon)}}function Ss(n,h){n&1&&N(0,"TimesIcon"),n&2&&ge("aria-hidden",!0)}function ws(n,h){}function Cs(n,h){n&1&&A(0,ws,0,0,"ng-template")}function xs(n,h){if(n&1&&(p(0,"span"),A(1,Cs,1,0,null,11),m()),n&2){let i=k(5);ge("aria-hidden",!0),f(),y("ngTemplateOutlet",i.cancelIconTemplate||i._cancelIconTemplate)}}function Es(n,h){if(n&1&&(de(0),A(1,Ss,1,1,"TimesIcon",9)(2,xs,2,2,"span",9),pe()),n&2){let i=k(4);f(),y("ngIf",!i.cancelIconTemplate&&!i._cancelIconTemplate),f(),y("ngIf",i.cancelIconTemplate||i._cancelIconTemplate)}}function Ps(n,h){if(n&1){let i=te();p(0,"p-button",19),G("onClick",function(){R(i);let c=k(3);return B(c.clear())}),A(1,bs,1,1,"span",20)(2,Es,3,2,"ng-container",9),m()}if(n&2){let i=k(3);y("label",i.cancelButtonLabel)("disabled",!i.hasFiles()||i.uploading)("styleClass","p-fileupload-cancel-button "+i.cancelStyleClass)("buttonProps",i.cancelButtonProps),f(),y("ngIf",i.cancelIcon),f(),y("ngIf",!i.cancelIcon)}}function ks(n,h){if(n&1){let i=te();de(0),p(1,"p-button",16),G("focus",function(){R(i);let c=k(2);return B(c.onFocus())})("blur",function(){R(i);let c=k(2);return B(c.onBlur())})("onClick",function(){R(i);let c=k(2);return B(c.choose())})("keydown.enter",function(){R(i);let c=k(2);return B(c.choose())}),p(2,"input",7,0),G("change",function(c){R(i);let _=k(2);return B(_.onFileSelect(c))}),m(),A(4,ss,1,4,"span",17)(5,ds,3,2,"ng-container",9),m(),A(6,_s,3,6,"p-button",18)(7,Ps,3,6,"p-button",18),pe()}if(n&2){let i=k(2);f(),y("styleClass","p-fileupload-choose-button "+i.chooseStyleClass)("disabled",i.disabled||i.isChooseDisabled())("label",i.chooseButtonLabel)("buttonProps",i.chooseButtonProps),ge("data-pc-section","choosebutton"),f(),y("multiple",i.multiple)("accept",i.accept)("disabled",i.disabled||i.isChooseDisabled()),ge("aria-label",i.browseFilesLabel)("title","")("data-pc-section","input"),f(2),y("ngIf",i.chooseIcon),f(),y("ngIf",!i.chooseIcon),f(),y("ngIf",!i.auto&&i.showUploadButton),f(),y("ngIf",!i.auto&&i.showCancelButton)}}function Ts(n,h){n&1&&Ye(0)}function Fs(n,h){n&1&&Ye(0)}function Os(n,h){if(n&1&&N(0,"p-progressbar",22),n&2){let i=k(2);y("value",i.progress)("showValue",!1)}}function Is(n,h){if(n&1&&N(0,"p-message",14),n&2){let i=h.$implicit;y("severity",i.severity)("text",i.text)}}function Ns(n,h){if(n&1){let i=te();p(0,"img",33),G("error",function(c){R(i);let _=k(5);return B(_.imageError(c))}),m()}if(n&2){let i=k().$implicit,l=k(4);y("src",i.objectURL,Po)("width",l.previewWidth)}}function Ds(n,h){n&1&&N(0,"TimesIcon")}function Vs(n,h){}function As(n,h){n&1&&A(0,Vs,0,0,"ng-template")}function Ls(n,h){if(n&1&&A(0,Ds,1,0,"TimesIcon",9)(1,As,1,0,null,11),n&2){let i=k(5);y("ngIf",!i.cancelIconTemplate&&!i._cancelIconTemplate),f(),y("ngTemplateOutlet",i.cancelIconTemplate||i._cancelIconTemplate)}}function Ms(n,h){if(n&1){let i=te();p(0,"div",24),A(1,Ns,1,2,"img",27),p(2,"div",28)(3,"div",29),x(4),m(),p(5,"span",30),x(6),m()(),p(7,"div",31)(8,"p-button",32),G("onClick",function(c){let _=R(i).index,V=k(4);return B(V.remove(c,_))}),A(9,Ls,2,2,"ng-template",null,2,ce),m()()()}if(n&2){let i=h.$implicit,l=k(4);f(),y("ngIf",l.isImage(i)),f(3),oe(i.name),f(2),oe(l.formatSize(i.size)),f(2),y("disabled",l.uploading)("styleClass","p-fileupload-file-remove-button "+l.removeStyleClass)}}function Rs(n,h){if(n&1&&A(0,Ms,11,5,"div",26),n&2){let i=k(3);y("ngForOf",i.files)}}function Bs(n,h){}function zs(n,h){if(n&1&&A(0,Bs,0,0,"ng-template",25),n&2){let i=k(3);y("ngForOf",i.files)("ngForTemplate",i.fileTemplate||i._fileTemplate)}}function Us(n,h){if(n&1&&(p(0,"div",23),A(1,Rs,1,1,"div",24)(2,zs,1,2,null,25),m()),n&2){let i=k(2);f(),Re(!i.fileTemplate&&!i._fileTemplate?1:-1),f(),Re(i.fileTemplate||i._fileTemplate?2:-1)}}function js(n,h){n&1&&Ye(0)}function Js(n,h){n&1&&Ye(0)}function $s(n,h){if(n&1&&A(0,Js,1,0,"ng-container",11),n&2){let i=k(2);y("ngTemplateOutlet",i.emptyTemplate||i._emptyTemplate)}}function Gs(n,h){if(n&1){let i=te();p(0,"div",6)(1,"input",7,0),G("change",function(c){R(i);let _=k();return B(_.onFileSelect(c))}),m(),p(3,"div",8),A(4,ks,8,15,"ng-container",9)(5,Ts,1,0,"ng-container",10)(6,Fs,1,0,"ng-container",11),m(),p(7,"div",12,1),G("dragenter",function(c){R(i);let _=k();return B(_.onDragEnter(c))})("dragleave",function(c){R(i);let _=k();return B(_.onDragLeave(c))})("drop",function(c){R(i);let _=k();return B(_.onDrop(c))}),A(9,Os,1,2,"p-progressbar",13),yt(10,Is,1,2,"p-message",14,Bn),A(12,Us,3,2,"div",15)(13,js,1,0,"ng-container",10)(14,$s,1,1,"ng-container"),m()()}if(n&2){let i=k();ct(i.styleClass),y("ngClass","p-fileupload p-fileupload-advanced p-component")("ngStyle",i.style),ge("data-pc-name","fileupload")("data-pc-section","root"),f(),Kt("display","none"),y("multiple",i.multiple)("accept",i.accept)("disabled",i.disabled||i.isChooseDisabled()),ge("aria-label",i.browseFilesLabel)("title","")("data-pc-section","input"),f(3),y("ngIf",!i.headerTemplate&&!i._headerTemplate),f(),y("ngTemplateOutlet",i.headerTemplate||i._headerTemplate)("ngTemplateOutletContext",Do(24,os,i.files,i.uploadedFiles,i.choose.bind(i),i.clear.bind(i),i.upload.bind(i))),f(),y("ngTemplateOutlet",i.toolbarTemplate||i._toolbarTemplate),f(),ge("data-pc-section","content"),f(2),y("ngIf",i.hasFiles()),f(),_t(i.msgs),f(2),y("ngIf",i.hasFiles()),f(),y("ngTemplateOutlet",i.contentTemplate||i._contentTemplate)("ngTemplateOutletContext",Vo(30,as,i.files,i.uploadedFiles,i.choose.bind(i),i.clear.bind(i),i.removeUploadedFile.bind(i),i.remove.bind(i),i.progress,i.msgs)),f(),Re((i.emptyTemplate||i._emptyTemplate)&&!i.hasFiles()&&!i.hasUploadedFiles()?14:-1)}}function Ks(n,h){if(n&1&&N(0,"p-message",14),n&2){let i=h.$implicit;y("severity",i.severity)("text",i.text)}}function Ws(n,h){if(n&1&&N(0,"span",37),n&2){let i=k(4);y("ngClass",i.uploadIcon)}}function Hs(n,h){n&1&&N(0,"UploadIcon",40),n&2&&y("styleClass","p-button-icon p-button-icon-left")}function qs(n,h){}function Zs(n,h){n&1&&A(0,qs,0,0,"ng-template")}function Qs(n,h){if(n&1&&(p(0,"span",41),A(1,Zs,1,0,null,11),m()),n&2){let i=k(5);f(),y("ngTemplateOutlet",i._uploadIconTemplate||i.uploadIconTemplate)}}function Ys(n,h){if(n&1&&(de(0),A(1,Hs,1,1,"UploadIcon",38)(2,Qs,2,1,"span",39),pe()),n&2){let i=k(4);f(),y("ngIf",!i.uploadIconTemplate&&!i._uploadIconTemplate),f(),y("ngIf",i._uploadIconTemplate||i.uploadIconTemplate)}}function Xs(n,h){if(n&1&&A(0,Ws,1,1,"span",36)(1,Ys,3,2,"ng-container",9),n&2){let i=k(3);y("ngIf",i.uploadIcon),f(),y("ngIf",!i.uploadIcon)}}function el(n,h){if(n&1&&N(0,"span",43),n&2){let i=k(4);y("ngClass",i.chooseIcon)}}function tl(n,h){n&1&&N(0,"PlusIcon"),n&2&&ge("data-pc-section","uploadicon")}function il(n,h){}function nl(n,h){n&1&&A(0,il,0,0,"ng-template")}function ol(n,h){if(n&1&&(de(0),A(1,tl,1,1,"PlusIcon",9)(2,nl,1,0,null,11),pe()),n&2){let i=k(4);f(),y("ngIf",!i.chooseIconTemplate&&!i._chooseIconTemplate),f(),y("ngTemplateOutlet",i.chooseIconTemplate||i._chooseIconTemplate)}}function al(n,h){if(n&1&&A(0,el,1,1,"span",42)(1,ol,3,2,"ng-container",9),n&2){let i=k(3);y("ngIf",i.chooseIcon),f(),y("ngIf",!i.chooseIcon)}}function rl(n,h){if(n&1&&A(0,Xs,2,2)(1,al,2,2),n&2){let i=k(2);Re(i.hasFiles()&&!i.auto?0:1)}}function sl(n,h){if(n&1&&(p(0,"span"),x(1),m()),n&2){let i=k(3);ct(i.cx("filelabel")),f(),ot(" ",i.basicFileChosenLabel()," ")}}function ll(n,h){n&1&&Ye(0)}function cl(n,h){if(n&1&&A(0,ll,1,0,"ng-container",10),n&2){let i=k(3);y("ngTemplateOutlet",i.fileLabelTemplate||i._fileLabelTemplate)("ngTemplateOutletContext",ke(2,rs,i.files))}}function ul(n,h){if(n&1&&A(0,sl,2,3,"span",44)(1,cl,1,4,"ng-container"),n&2){let i=k(2);Re(!i.fileLabelTemplate&&!i._fileLabelTemplate?0:1)}}function ml(n,h){if(n&1){let i=te();p(0,"div",21),yt(1,Ks,1,2,"p-message",14,Bn),p(3,"p-button",34),G("onClick",function(){R(i);let c=k();return B(c.onBasicUploaderClick())})("keydown",function(c){R(i);let _=k();return B(_.onBasicKeydown(c))}),A(4,rl,2,1,"ng-template",null,2,ce),p(6,"input",35,3),G("change",function(c){R(i);let _=k();return B(_.onFileSelect(c))})("focus",function(){R(i);let c=k();return B(c.onFocus())})("blur",function(){R(i);let c=k();return B(c.onBlur())}),m()(),A(8,ul,2,1),m()}if(n&2){let i=k();ct(i.styleClass),y("ngClass","p-fileupload p-fileupload-basic p-component"),ge("data-pc-name","fileupload"),f(),_t(i.msgs),f(2),vt(i.style),y("styleClass","p-fileupload-choose-button "+i.chooseStyleClass)("disabled",i.disabled)("label",i.chooseButtonLabel)("buttonProps",i.chooseButtonProps),f(3),y("accept",i.accept)("multiple",i.multiple)("disabled",i.disabled),ge("aria-label",i.browseFilesLabel)("data-pc-section","input"),f(2),Re(i.auto?-1:8)}}var dl=({dt:n})=>`
|
|
430
|
-
.p-fileupload input[type="file"] {
|
|
431
|
-
display: none;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
.p-fileupload-advanced {
|
|
435
|
-
border: 1px solid ${n("fileupload.border.color")};
|
|
436
|
-
border-radius: ${n("fileupload.border.radius")};
|
|
437
|
-
background: ${n("fileupload.background")};
|
|
438
|
-
color: ${n("fileupload.color")};
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.p-fileupload-header {
|
|
442
|
-
display: flex;
|
|
443
|
-
align-items: center;
|
|
444
|
-
padding: ${n("fileupload.header.padding")};
|
|
445
|
-
background: ${n("fileupload.header.background")};
|
|
446
|
-
color: ${n("fileupload.header.color")};
|
|
447
|
-
border-style: solid;
|
|
448
|
-
border-width: ${n("fileupload.header.border.width")};
|
|
449
|
-
border-color: ${n("fileupload.header.border.color")};
|
|
450
|
-
border-radius: ${n("fileupload.header.border.radius")};
|
|
451
|
-
gap: ${n("fileupload.header.gap")};
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.p-fileupload-content {
|
|
455
|
-
border: 1px solid transparent;
|
|
456
|
-
display: flex;
|
|
457
|
-
flex-direction: column;
|
|
458
|
-
gap: ${n("fileupload.content.gap")};
|
|
459
|
-
transition: border-color ${n("fileupload.transition.duration")};
|
|
460
|
-
padding: ${n("fileupload.content.padding")};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.p-fileupload-content .p-progressbar {
|
|
464
|
-
width: 100%;
|
|
465
|
-
height: ${n("fileupload.progressbar.height")};
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
.p-fileupload-file-list {
|
|
469
|
-
display: flex;
|
|
470
|
-
flex-direction: column;
|
|
471
|
-
gap: ${n("fileupload.filelist.gap")};
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.p-fileupload-file {
|
|
475
|
-
display: flex;
|
|
476
|
-
flex-wrap: wrap;
|
|
477
|
-
align-items: center;
|
|
478
|
-
padding: ${n("fileupload.file.padding")};
|
|
479
|
-
border-bottom: 1px solid ${n("fileupload.file.border.color")};
|
|
480
|
-
gap: ${n("fileupload.file.gap")};
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.p-fileupload-file:last-child {
|
|
484
|
-
border-bottom: 0;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.p-fileupload-file-info {
|
|
488
|
-
display: flex;
|
|
489
|
-
flex-direction: column;
|
|
490
|
-
gap: ${n("fileupload.file.info.gap")};
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.p-fileupload-file-thumbnail {
|
|
494
|
-
flex-shrink: 0;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.p-fileupload-file-actions {
|
|
498
|
-
margin-left: auto;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
.p-fileupload-highlight {
|
|
502
|
-
border: 1px dashed ${n("fileupload.content.highlight.border.color")};
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.p-fileupload-advanced .p-message {
|
|
506
|
-
margin-top: 0;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
.p-fileupload-basic {
|
|
510
|
-
display: flex;
|
|
511
|
-
flex-wrap: wrap;
|
|
512
|
-
align-items: center;
|
|
513
|
-
justify-content: center;
|
|
514
|
-
gap: ${n("fileupload.basic.gap")};
|
|
515
|
-
}
|
|
516
|
-
`,pl={root:({instance:n})=>`p-fileupload p-fileupload-${n.mode} p-component`,header:"p-fileupload-header",pcChooseButton:"p-fileupload-choose-button",pcUploadButton:"p-fileupload-upload-button",pcCancelButton:"p-fileupload-cancel-button",content:"p-fileupload-content",fileList:"p-fileupload-file-list",file:"p-fileupload-file",fileThumbnail:"p-fileupload-file-thumbnail",fileInfo:"p-fileupload-file-info",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",pcFileBadge:"p-fileupload-file-badge",fileActions:"p-fileupload-file-actions",pcFileRemoveButton:"p-fileupload-file-remove-button"},xa=(()=>{class n extends Yt{name="fileupload";theme=dl;classes=pl;static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var di=(()=>{class n extends Nt{name;url;method="post";multiple;accept;disabled;auto;withCredentials;maxFileSize;invalidFileSizeMessageSummary="{0}: Invalid file size, ";invalidFileSizeMessageDetail="maximum upload size is {0}.";invalidFileTypeMessageSummary="{0}: Invalid file type, ";invalidFileTypeMessageDetail="allowed file types: {0}.";invalidFileLimitMessageDetail="limit is {0} at most.";invalidFileLimitMessageSummary="Maximum number of files exceeded, ";style;styleClass;previewWidth=50;chooseLabel;uploadLabel;cancelLabel;chooseIcon;uploadIcon;cancelIcon;showUploadButton=!0;showCancelButton=!0;mode="advanced";headers;customUpload;fileLimit;uploadStyleClass;cancelStyleClass;removeStyleClass;chooseStyleClass;chooseButtonProps;uploadButtonProps={severity:"secondary"};cancelButtonProps={severity:"secondary"};onBeforeUpload=new lt;onSend=new lt;onUpload=new lt;onError=new lt;onClear=new lt;onRemove=new lt;onSelect=new lt;onProgress=new lt;uploadHandler=new lt;onImageError=new lt;onRemoveUploadedFile=new lt;fileTemplate;headerTemplate;contentTemplate;toolbarTemplate;chooseIconTemplate;fileLabelTemplate;uploadIconTemplate;cancelIconTemplate;emptyTemplate;advancedFileInput;basicFileInput;content;set files(i){this._files=[];for(let l=0;l<i.length;l++){let c=i[l];this.validate(c)&&(this.isImage(c)&&(c.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(i[l]))),this._files.push(i[l]))}}get files(){return this._files}get basicButtonLabel(){return this.auto||!this.hasFiles()?this.chooseLabel:this.uploadLabel??this.files[0].name}_files=[];progress=0;dragHighlight;msgs;uploadedFileCount=0;focus;uploading;duplicateIEEvent;translationSubscription;dragOverListener;uploadedFiles=[];sanitizer=K(Uo);zone=K(mn);http=K(zo);_componentStyle=K(xa);ngOnInit(){super.ngOnInit(),this.translationSubscription=this.config.translationObserver.subscribe(()=>{this.cd.markForCheck()})}ngAfterViewInit(){super.ngAfterViewInit(),Ht(this.platformId)&&this.mode==="advanced"&&this.zone.runOutsideAngular(()=>{this.content&&(this.dragOverListener=this.renderer.listen(this.content.nativeElement,"dragover",this.onDragOver.bind(this)))})}_headerTemplate;_contentTemplate;_toolbarTemplate;_chooseIconTemplate;_uploadIconTemplate;_cancelIconTemplate;_emptyTemplate;_fileTemplate;_fileLabelTemplate;templates;ngAfterContentInit(){this.templates?.forEach(i=>{switch(i.getType()){case"header":this._headerTemplate=i.template;break;case"file":this._fileTemplate=i.template;break;case"content":this._contentTemplate=i.template;break;case"toolbar":this._toolbarTemplate=i.template;break;case"chooseicon":this._chooseIconTemplate=i.template;break;case"uploadicon":this._uploadIconTemplate=i.template;break;case"cancelicon":this._cancelIconTemplate=i.template;break;case"empty":this._emptyTemplate=i.template;break;case"filelabel":this._fileLabelTemplate=i.template;break;default:this._fileTemplate=i.template;break}})}basicFileChosenLabel(){return this.auto?this.chooseButtonLabel:this.hasFiles()?this.files&&this.files.length===1?this.files[0].name:this.config.getTranslation("fileChosenMessage")?.replace("{0}",this.files.length):this.config.getTranslation("noFileChosenMessage")||""}getTranslation(i){return this.config.getTranslation(i)}choose(){this.advancedFileInput?.nativeElement.click()}onFileSelect(i){if(i.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.msgs=[],this.multiple||(this.files=[]);let l=i.dataTransfer?i.dataTransfer.files:i.target.files;for(let c=0;c<l.length;c++){let _=l[c];this.isFileSelected(_)||this.validate(_)&&(this.isImage(_)&&(_.objectURL=this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(l[c]))),this.files.push(l[c]))}this.onSelect.emit({originalEvent:i,files:l,currentFiles:this.files}),this.checkFileLimit(l),this.hasFiles()&&this.auto&&(this.mode!=="advanced"||!this.isFileLimitExceeded())&&this.upload(),i.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()}isFileSelected(i){for(let l of this.files)if(l.name+l.type+l.size===i.name+i.type+i.size)return!0;return!1}isIE11(){if(Ht(this.platformId))return!!this.document.defaultView.MSInputMethodContext&&!!this.document.documentMode}validate(i){if(this.msgs=this.msgs||[],this.accept&&!this.isFileTypeValid(i)){let l=`${this.invalidFileTypeMessageSummary.replace("{0}",i.name)} ${this.invalidFileTypeMessageDetail.replace("{0}",this.accept)}`;return this.msgs.push({severity:"error",text:l}),!1}if(this.maxFileSize&&i.size>this.maxFileSize){let l=`${this.invalidFileSizeMessageSummary.replace("{0}",i.name)} ${this.invalidFileSizeMessageDetail.replace("{0}",this.formatSize(this.maxFileSize))}`;return this.msgs.push({severity:"error",text:l}),!1}return!0}isFileTypeValid(i){let l=this.accept?.split(",").map(c=>c.trim());for(let c of l)if(this.isWildcard(c)?this.getTypeClass(i.type)===this.getTypeClass(c):i.type==c||this.getFileExtension(i).toLowerCase()===c.toLowerCase())return!0;return!1}getTypeClass(i){return i.substring(0,i.indexOf("/"))}isWildcard(i){return i.indexOf("*")!==-1}getFileExtension(i){return"."+i.name.split(".").pop()}isImage(i){return/^image\//.test(i.type)}onImageLoad(i){window.URL.revokeObjectURL(i.src)}uploader(){if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.uploadHandler.emit({files:this.files}),this.cd.markForCheck();else{this.uploading=!0,this.msgs=[];let i=new FormData;this.onBeforeUpload.emit({formData:i});for(let l=0;l<this.files.length;l++)i.append(this.name,this.files[l],this.files[l].name);this.http.request(this.method,this.url,{body:i,headers:this.headers,reportProgress:!0,observe:"events",withCredentials:this.withCredentials}).subscribe(l=>{switch(l.type){case yn.Sent:this.onSend.emit({originalEvent:l,formData:i});break;case yn.Response:this.uploading=!1,this.progress=0,l.status>=200&&l.status<300?(this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.onUpload.emit({originalEvent:l,files:this.files})):this.onError.emit({files:this.files}),this.uploadedFiles.push(...this.files),this.clear();break;case yn.UploadProgress:{l.loaded&&(this.progress=Math.round(l.loaded*100/l.total)),this.onProgress.emit({originalEvent:l,progress:this.progress});break}}this.cd.markForCheck()},l=>{this.uploading=!1,this.onError.emit({files:this.files,error:l})})}}clear(){this.files=[],this.uploadedFileCount=0,this.onClear.emit(),this.clearInputElement(),this.cd.markForCheck()}remove(i,l){this.clearInputElement(),this.onRemove.emit({originalEvent:i,file:this.files[l]}),this.files.splice(l,1),this.checkFileLimit(this.files)}removeUploadedFile(i){let l=this.uploadedFiles.splice(i,1)[0];this.uploadedFiles=[...this.uploadedFiles],this.onRemoveUploadedFile.emit({file:l,files:this.uploadedFiles})}isFileLimitExceeded(){let l=this.auto?this.files.length:this.files.length+this.uploadedFileCount;return this.fileLimit&&this.fileLimit<=l&&this.focus&&(this.focus=!1),this.fileLimit&&this.fileLimit<l}isChooseDisabled(){return this.auto?this.fileLimit&&this.fileLimit<=this.files.length:this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount}checkFileLimit(i){this.msgs??=[];let l=this.msgs.length>0&&this.fileLimit&&this.fileLimit<i.length;if(this.isFileLimitExceeded()||l){let c=`${this.invalidFileLimitMessageSummary.replace("{0}",this.fileLimit.toString())} ${this.invalidFileLimitMessageDetail.replace("{0}",this.fileLimit.toString())}`;this.msgs.push({severity:"error",text:c})}}clearInputElement(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.advancedFileInput.nativeElement.value=""),this.basicFileInput&&this.basicFileInput.nativeElement&&(this.basicFileInput.nativeElement.value="")}clearIEInput(){this.advancedFileInput&&this.advancedFileInput.nativeElement&&(this.duplicateIEEvent=!0,this.advancedFileInput.nativeElement.value="")}hasFiles(){return this.files&&this.files.length>0}hasUploadedFiles(){return this.uploadedFiles&&this.uploadedFiles.length>0}onDragEnter(i){this.disabled||(i.stopPropagation(),i.preventDefault())}onDragOver(i){this.disabled||(Zt(this.content?.nativeElement,"p-fileupload-highlight"),this.dragHighlight=!0,i.stopPropagation(),i.preventDefault())}onDragLeave(i){this.disabled||Qt(this.content?.nativeElement,"p-fileupload-highlight")}onDrop(i){if(!this.disabled){Qt(this.content?.nativeElement,"p-fileupload-highlight"),i.stopPropagation(),i.preventDefault();let l=i.dataTransfer?i.dataTransfer.files:i.target.files;(this.multiple||l&&l.length===1)&&this.onFileSelect(i)}}onFocus(){this.focus=!0}onBlur(){this.focus=!1}formatSize(i){let _=this.getTranslation(It.FILE_SIZE_TYPES);if(i===0)return`0 ${_[0]}`;let V=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,V)).toFixed(3)} ${_[V]}`}upload(){this.hasFiles()&&this.uploader()}onBasicUploaderClick(){this.basicFileInput?.nativeElement.click()}onBasicKeydown(i){switch(i.code){case"Space":case"Enter":this.onBasicUploaderClick(),i.preventDefault();break}}imageError(i){this.onImageError.emit(i)}getBlockableElement(){return this.el.nativeElement.children[0]}get chooseButtonLabel(){return this.chooseLabel||this.config.getTranslation(It.CHOOSE)}get uploadButtonLabel(){return this.uploadLabel||this.config.getTranslation(It.UPLOAD)}get cancelButtonLabel(){return this.cancelLabel||this.config.getTranslation(It.CANCEL)}get browseFilesLabel(){return this.config.getTranslation(It.ARIA)[It.BROWSE_FILES]}get pendingLabel(){return this.config.getTranslation(It.PENDING)}ngOnDestroy(){this.content&&this.content.nativeElement&&this.dragOverListener&&(this.dragOverListener(),this.dragOverListener=null),this.translationSubscription&&this.translationSubscription.unsubscribe(),super.ngOnDestroy()}static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275cmp=Pe({type:n,selectors:[["p-fileupload"],["p-fileUpload"]],contentQueries:function(l,c,_){if(l&1&&(Je(_,Hr,4),Je(_,qr,4),Je(_,Ca,4),Je(_,Zr,4),Je(_,Qr,4),Je(_,Yr,4),Je(_,Xr,4),Je(_,es,4),Je(_,ts,4),Je(_,Di,4)),l&2){let V;ue(V=me())&&(c.fileTemplate=V.first),ue(V=me())&&(c.headerTemplate=V.first),ue(V=me())&&(c.contentTemplate=V.first),ue(V=me())&&(c.toolbarTemplate=V.first),ue(V=me())&&(c.chooseIconTemplate=V.first),ue(V=me())&&(c.fileLabelTemplate=V.first),ue(V=me())&&(c.uploadIconTemplate=V.first),ue(V=me())&&(c.cancelIconTemplate=V.first),ue(V=me())&&(c.emptyTemplate=V.first),ue(V=me())&&(c.templates=V)}},viewQuery:function(l,c){if(l&1&&(ut(is,5),ut(ns,5),ut(Ca,5)),l&2){let _;ue(_=me())&&(c.advancedFileInput=_.first),ue(_=me())&&(c.basicFileInput=_.first),ue(_=me())&&(c.content=_.first)}},inputs:{name:"name",url:"url",method:"method",multiple:[2,"multiple","multiple",bt],accept:"accept",disabled:[2,"disabled","disabled",bt],auto:[2,"auto","auto",bt],withCredentials:[2,"withCredentials","withCredentials",bt],maxFileSize:[2,"maxFileSize","maxFileSize",_i],invalidFileSizeMessageSummary:"invalidFileSizeMessageSummary",invalidFileSizeMessageDetail:"invalidFileSizeMessageDetail",invalidFileTypeMessageSummary:"invalidFileTypeMessageSummary",invalidFileTypeMessageDetail:"invalidFileTypeMessageDetail",invalidFileLimitMessageDetail:"invalidFileLimitMessageDetail",invalidFileLimitMessageSummary:"invalidFileLimitMessageSummary",style:"style",styleClass:"styleClass",previewWidth:[2,"previewWidth","previewWidth",_i],chooseLabel:"chooseLabel",uploadLabel:"uploadLabel",cancelLabel:"cancelLabel",chooseIcon:"chooseIcon",uploadIcon:"uploadIcon",cancelIcon:"cancelIcon",showUploadButton:[2,"showUploadButton","showUploadButton",bt],showCancelButton:[2,"showCancelButton","showCancelButton",bt],mode:"mode",headers:"headers",customUpload:[2,"customUpload","customUpload",bt],fileLimit:[2,"fileLimit","fileLimit",i=>_i(i,null)],uploadStyleClass:"uploadStyleClass",cancelStyleClass:"cancelStyleClass",removeStyleClass:"removeStyleClass",chooseStyleClass:"chooseStyleClass",chooseButtonProps:"chooseButtonProps",uploadButtonProps:"uploadButtonProps",cancelButtonProps:"cancelButtonProps",files:"files"},outputs:{onBeforeUpload:"onBeforeUpload",onSend:"onSend",onUpload:"onUpload",onError:"onError",onClear:"onClear",onRemove:"onRemove",onSelect:"onSelect",onProgress:"onProgress",uploadHandler:"uploadHandler",onImageError:"onImageError",onRemoveUploadedFile:"onRemoveUploadedFile"},features:[Ge([xa]),vi,wt],decls:2,vars:2,consts:[["advancedfileinput",""],["content",""],["icon",""],["basicfileinput",""],[3,"ngClass","ngStyle","class",4,"ngIf"],[3,"ngClass","class",4,"ngIf"],[3,"ngClass","ngStyle"],["type","file",3,"change","multiple","accept","disabled"],[1,"p-fileupload-header"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],[1,"p-fileupload-content",3,"dragenter","dragleave","drop"],[3,"value","showValue",4,"ngIf"],[3,"severity","text"],["class","p-fileupload-file-list",4,"ngIf"],["tabindex","0",3,"focus","blur","onClick","keydown.enter","styleClass","disabled","label","buttonProps"],[3,"class",4,"ngIf"],[3,"label","disabled","styleClass","buttonProps","onClick",4,"ngIf"],[3,"onClick","label","disabled","styleClass","buttonProps"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[3,"value","showValue"],[1,"p-fileupload-file-list"],[1,"p-fileupload-file"],["ngFor","",3,"ngForOf","ngForTemplate"],["class","p-fileupload-file",4,"ngFor","ngForOf"],["class","p-fileupload-file-thumbnail",3,"src","width","error",4,"ngIf"],[1,"p-fileupload-file-info"],[1,"p-fileupload-file-name"],[1,"p-fileupload-file-size"],[1,"p-fileupload-file-actions"],["text","","rounded","","severity","danger",3,"onClick","disabled","styleClass"],[1,"p-fileupload-file-thumbnail",3,"error","src","width"],["tabindex","0",3,"onClick","keydown","styleClass","disabled","label","buttonProps"],["type","file",3,"change","focus","blur","accept","multiple","disabled"],["class","p-button-icon p-button-icon-left",3,"ngClass",4,"ngIf"],[1,"p-button-icon","p-button-icon-left",3,"ngClass"],[3,"styleClass",4,"ngIf"],["class","p-button-icon p-button-icon-left",4,"ngIf"],[3,"styleClass"],[1,"p-button-icon","p-button-icon-left"],["class","p-button-icon p-button-icon-left pi",3,"ngClass",4,"ngIf"],[1,"p-button-icon","p-button-icon-left","pi",3,"ngClass"],[3,"class"]],template:function(l,c){l&1&&A(0,Gs,15,39,"div",4)(1,ml,9,16,"div",5),l&2&&(y("ngIf",c.mode==="advanced"),f(),y("ngIf",c.mode==="basic"))},dependencies:[Be,Ct,Ro,Xe,Wt,bi,xt,wa,ba,Zo,ga,Ai,tt],encapsulation:2,changeDetection:0})}return n})(),Wi=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[di,tt,tt]})}return n})();var Xn=ui(On()),Ea=n=>(0,Xn.default)(n).isSame((0,Xn.default)("0001-01-01T00:00:00"));var hl=["class","page"],gl=()=>({width:"25rem"}),fl=()=>({width:"100%"}),vl=()=>({width:"50%"}),yl=()=>({});function _l(n,h){n&1&&(p(0,"tr")(1,"th"),x(2,"Account"),m(),p(3,"th",40),x(4,"Amount"),m(),p(5,"th",41),x(6,"Note"),m(),N(7,"th",42),m())}function bl(n,h){if(n&1&&(p(0,"div",50)(1,"div"),x(2),m()()),n&2){let i=k().$implicit;f(2),oe(i.value)}}function Sl(n,h){if(n&1&&A(0,bl,3,1,"div",49),n&2){let i=h.$implicit;y("ngIf",i)}}function wl(n,h){if(n&1&&(p(0,"div",50)(1,"div"),x(2),m()()),n&2){let i=h.$implicit;f(2),oe(i.value)}}function Cl(n,h){if(n&1){let i=te();p(0,"div",51)(1,"p-button",52),G("onClick",function(){R(i);let c=k(2);return B(c.addIitemVisible.set(!c.addIitemVisible()))}),m()()}}function xl(n,h){if(n&1){let i=te();p(0,"tr",43)(1,"td")(2,"p-select",44),A(3,Sl,1,1,"ng-template",null,4,ce)(5,wl,3,1,"ng-template",null,5,ce)(7,Cl,2,0,"ng-template",null,2,ce),m()(),p(9,"td"),N(10,"input",45),m(),p(11,"td"),N(12,"textarea",46),m(),p(13,"td")(14,"button",47),G("click",function(){let c=R(i).rowIndex,_=k();return B(_.removeItem(c))}),N(15,"i",48),m()()()}if(n&2){let i=h.rowIndex,l=k();y("formGroupName",i),f(2),vt(Oe(7,vl)),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.journalRecordExpense().options.accounts),f(8),y("autoNumeric",Oe(8,yl))}}function El(n,h){if(n&1){let i=te();p(0,"tr")(1,"td")(2,"div",53)(3,"button",54),G("click",function(){R(i);let c=k();return B(c.addItem())}),x(4," Add "),m(),p(5,"span"),x(6,"Total :"),m()()(),p(7,"td",55),x(8),Me(9,"async"),Me(10,"number"),m(),N(11,"td",56),m()}if(n&2){let i=k();f(8),oe(Ke(10,3,Ke(9,1,i.totalDebitAmount$)))}}var Ia=(()=>{class n{constructor(){this.fb=K(Jo),this.journalRecordExpense=Ve(null),this.activatedRoute=K(qt),this.journalService=K(We),this.toasr=K(Ii),this.file=Ve(null),this.addIitemVisible=Ve(!1)}ngOnInit(){this.initForm(),this.loadJournalForm(),this.initFormAddItemCOA(),this.totalDebitAmount$=this.form.controls.items.valueChanges.pipe(Pt(i=>i.reduce((l,c)=>l+c.debitAmount,0)),$e("response"))}loadCategories(){this.categories$||(this.categories$=this.journalService.fetchCategoryOptions().pipe(_o(1)))}initFormAddItemCOA(){this.formAddItemCOA=this.fb.group({ID:this.fb.control(De.toString()),Name:this.fb.control(""),Code:this.fb.control(""),Note:this.fb.control(""),CategoryID:this.fb.control(""),OutletID:this.fb.control(De.toString()),Balance:this.fb.control(0)})}onaddItemCOA(){if(this.formAddItemCOA.invalid){this.formAddItemCOA.markAllAsTouched();return}let i=Object.entries(this.formAddItemCOA.getRawValue()).reduce((l,[c,_])=>(c==="CategoryID"?l[c]=_.key||_:l[c]=_,l),{});this.journalService.submitChartAccount(i).pipe(Fe(()=>{this.toasr.success("Add COA Success","Success"),this.loadJournalForm(),this.formAddItemCOA.reset(),this.addIitemVisible.update(l=>!l)})).subscribe()}loadJournalForm(){this.activatedRoute.data.pipe(Pt(i=>i.form),Fe(i=>{this.patchForm(i.form),this.journalRecordExpense.set(i)})).subscribe()}initForm(){this.form=this.fb.group({order:this.buildOrderGroup(this.fb),items:this.fb.array([]),additionalAccountID:this.fb.control(""),file:this.fb.control("")}),this.form.controls.order.controls.date.disable()}buildOrderGroup(i){return i.group({id:i.control(""),number:i.control(""),date:i.control(new Date),note:i.control(""),entryTypeID:i.control(0),referenceID:i.control(""),referenceTypeID:i.control(0),referenceText:i.control(""),contactID:i.control(""),detailReferenceID:i.control(""),creatorID:i.control(""),created:i.control(""),modifierID:i.control(""),modified:i.control(""),entityID:i.control(""),statusID:i.control(""),contactName:i.control("")})}buildItemGroup(i){return i.group({id:i.control(De.toString()),journalID:i.control(De.toString()),accountID:i.control(""),debitAmount:i.control(0),creditAmount:i.control(0),index:i.control(0),note:i.control("")})}patchForm(i){if(!i)return;this.form.controls.order.patchValue({id:i.order.id,number:i.order.number,date:Ea(i.order.date)?(0,eo.default)().toDate():(0,eo.default)(i.order.date).toDate(),note:i.order.note,entryTypeID:i.order.entryTypeID,referenceID:i.order.referenceID,referenceTypeID:i.order.referenceTypeID,referenceText:i.order.referenceText,contactID:i.order.contactID,detailReferenceID:i.order.detailReferenceID,creatorID:i.order.creatorID,created:i.order.created,modifierID:i.order.modifierID,modified:i.order.modified,entityID:i.order.entityID,statusID:i.order.statusID,contactName:i.order.contactName});let l=this.form.controls.items;l.clear(),i.items.forEach(c=>{let _=this.buildItemGroup(this.fb);_.patchValue(c),l.push(_)}),this.form.patchValue({items:void 0,order:void 0,additionalAccountID:i.additionalAccountID??"",file:i.file??""})}openDialogAddItemCOA(){this.addIitemVisible.update(i=>!i)}addItem(){let i=this.form.controls.items,l=this.buildItemGroup(this.fb);i.push(l)}removeItem(i){this.form.controls.items.removeAt(i)}search(i){let l=i.query;this.supplierSuggestions$=this.journalService.getJournalEntrySupplierSuggestions(l).pipe($e("response"))}onUpload(i){this.file.set(i.currentFiles[0])}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let i=this.getCleanedFormValue();console.log("cleanedFormValue",i);let l=this.buildFormData(i);this.journalService.submitJournalEntry(l).pipe($e("response"),Fe(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let i=this.form.getRawValue(),l=Object.entries(i).reduce((c,[_,V])=>(_==="items"?c[_]=V.map(L=>Te(fe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=Te(fe({},V),{contactID:V.contactID||De}):_==="file"?c[_]=V.length>0?V:null:c[_]=V,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(i){let l=new FormData;return l.append("Data",JSON.stringify(i)),l.append("File",this.file()),l}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-record-expense",8,"page"]],attrs:hl,decls:81,vars:26,consts:[["header",""],["body",""],["footer",""],["fu",""],["selectedItem",""],["item",""],["pageTitle","Record Expense"],["ngProjectAs","action-button",5,["action-button"]],[1,"btn","btn-secondary","rounded"],["type","button",1,"btn","btn-primary","rounded",3,"click"],["ngProjectAs","content",5,["content"]],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],[1,"row"],["formGroupName","order",1,"col"],[1,"d-flex","flex-column"],["for","outlet"],["inputId","outlet","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an outlet","filterBy","name",3,"virtualScroll","virtualScrollItemSize","options","filter"],["styleClass","w-100","formControlName","date"],["formControlName","number","type","text","pInputText",""],[1,"col"],["inputId","outlet","formControlName","additionalAccountID","optionLabel","value","optionValue","key","placeholder","",3,"virtualScroll","virtualScrollItemSize","options"],["showGridlines","","formArrayName","items",3,"value"],["formGroupName","order",1,"row"],["for",""],["styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",3,"completeMethod","suggestions"],["rows","1","pTextarea","","formControlName","note","placeholder","e.g. Electricity & Phone Bill for Decemeber",3,"autoResize"],[1,"form-group","d-flex","flex-column"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],["header","Add New Account",3,"modal","visible","closable"],[1,"row","row-gap-3",3,"formGroup"],["for","username",1,"font-semibold","w-24"],["formControlName","Name","pInputText","","id","username","autocomplete","off",1,"flex-auto"],["for","email",1,"font-semibold","w-24"],["formControlName","Code","pInputText","","id","email","autocomplete","off",1,"flex-auto"],[1,"col-12"],["for","password",1,"font-semibold","w-24"],["formControlName","CategoryID","containerStyleClass","w-100","appendTo","body","placeholder","Select Item",3,"onFocus","options"],[1,"d-flex","justify-content-end","gap-2"],["label","Cancel","severity","secondary",3,"click"],["label","Save",3,"click"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[2,"width","5%"],[3,"formGroupName"],["filter","","filterBy","value","styleClass","w-50","appendTo","body","formControlName","accountID","optionLabel","value","optionValue","key","placeholder","Select an account",3,"virtualScroll","virtualScrollItemSize","options"],["type","text","pInputText","","formControlName","debitAmount",1,"text-end",3,"autoNumeric"],["autoResize","","rows","1","pTextarea","","formControlName","note"],[1,"btn","btn-link",3,"click"],[1,"fa-light","fa-trash","text-danger"],["class","flex items-center gap-2",4,"ngIf"],[1,"flex","items-center","gap-2"],[1,"p-3"],["label","Add New","fluid","","severity","secondary","text","","size","small","icon","pi pi-plus",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"btn","btn-primary","rounded",3,"click"],[1,"text-end"],["colspan","2"]],template:function(l,c){if(l&1){let _=te();p(0,"app-main-panel",6),de(1,7),p(2,"button",8),x(3,"Cancel"),m(),p(4,"button",9),G("click",function(){return R(_),B(c.onSubmitJournalEntry())}),x(5," Save "),m(),pe(),de(6,10),p(7,"div",11)(8,"p-panel")(9,"div",12)(10,"div",13)(11,"div",14)(12,"label",15),x(13,"Outlet"),m(),N(14,"p-select",16),m()(),p(15,"div",13)(16,"div",14)(17,"label",15),x(18,"Date"),m(),N(19,"p-datepicker",17),m()(),p(20,"div",13)(21,"div",14)(22,"label",15),x(23,"Number"),m(),N(24,"input",18),m()(),p(25,"div",19)(26,"div",14)(27,"label",15),x(28,"Account"),m(),N(29,"p-select",20),m()()(),N(30,"hr"),p(31,"p-table",21),A(32,_l,8,0,"ng-template",null,0,ce)(34,xl,16,9,"ng-template",null,1,ce)(36,El,12,5,"ng-template",null,2,ce),m(),N(38,"hr"),p(39,"div",22)(40,"div",19)(41,"div",12)(42,"div",19)(43,"div",14)(44,"label",23),x(45,"Supplier"),m(),p(46,"p-autocomplete",24),Me(47,"async"),G("completeMethod",function(L){return R(_),B(c.search(L))}),m()()(),p(48,"div",19)(49,"div",14)(50,"label",23),x(51,"Note"),m(),N(52,"textarea",25),m()(),p(53,"div",19)(54,"div",26)(55,"label",23),x(56,"Upload"),m(),p(57,"p-fileupload",27,3),G("onSelect",function(L){return R(_),B(c.onUpload(L))}),m()()()()()()()(),pe(),m(),p(59,"p-dialog",28)(60,"div",29)(61,"div",19)(62,"div",14)(63,"label",30),x(64,"Name"),m(),N(65,"input",31),m()(),p(66,"div",19)(67,"div",14)(68,"label",32),x(69,"Code"),m(),N(70,"input",33),m()(),p(71,"div",34)(72,"div",14)(73,"label",35),x(74,"Category"),m(),p(75,"p-treeselect",36),Me(76,"async"),G("onFocus",function(){return R(_),B(c.loadCategories())}),m()()(),p(77,"div",19)(78,"div",37)(79,"p-button",38),G("click",function(){return R(_),B(c.addIitemVisible.set(!c.addIitemVisible()))}),m(),p(80,"p-button",39),G("click",function(){return R(_),B(c.onaddItemCOA())}),m()()()()()}l&2&&(f(7),y("formGroup",c.form),f(7),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",c.journalRecordExpense().options.entities)("filter",!0),f(15),y("virtualScroll",!0)("virtualScrollItemSize",50)("options",c.journalRecordExpense().options.paymentAccounts),f(2),y("value",c.form.controls.items.controls),f(15),y("suggestions",Ke(47,20,c.supplierSuggestions$)),f(6),y("autoResize",!0),f(7),vt(Oe(24,gl)),y("modal",!0)("visible",c.addIitemVisible())("closable",!1),f(),y("formGroup",c.formAddItemCOA),f(15),vt(Oe(25,fl)),y("options",Ke(76,22,c.categories$)))},dependencies:[Et,Be,Xe,Bo,Ft,ji,Ui,ni,ii,zi,Bi,ei,Xt,Dt,At,Vt,Ti,Si,wi,Ci,xi,ki,Ei,Pi,Ki,ai,oi,$i,Ji,Wi,di,ti,xt,Ri,Mi,da,ma],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Pl=["filterRef"],kl=["class","page"];function Tl(n,h){n&1&&(p(0,"div",10)(1,"div",5)(2,"h5",11),x(3,"Card title"),m(),p(4,"h6",12),x(5,"Card subtitle"),m(),p(6,"p",13),x(7," Some quick example text to build on the card title and make up the bulk of the card's content. "),m(),p(8,"a",14),x(9,"Card link"),m(),p(10,"a",14),x(11,"Another link"),m()()())}var Na=(()=>{class n{constructor(){this.modalService=K(wn)}onFilterChange(i){console.log("Filter Change",i),this.modalService.open(this.templateRef)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-deposit",8,"page"]],viewQuery:function(l,c){if(l&1&&ut(Pl,7),l&2){let _;ue(_=me())&&(c.templateRef=_.first)}},attrs:kl,decls:44,vars:0,consts:[["filterRef",""],[3,"eventFilterChange"],["ngProjectAs","content",5,["content"]],[1,"container","my-4"],[1,"card"],[1,"card-body"],[1,"table"],["scope","col"],["scope","row"],["colspan","2"],[1,"card",2,"width","18rem"],[1,"card-title"],[1,"card-subtitle","mb-2","text-body-secondary"],[1,"card-text"],["href","#",1,"card-link"]],template:function(l,c){if(l&1){let _=te();p(0,"app-main-panel",1),G("eventFilterChange",function(L){return R(_),B(c.onFilterChange(L))}),de(1,2),p(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead")(7,"tr")(8,"th",7),x(9,"#"),m(),p(10,"th",7),x(11,"First"),m(),p(12,"th",7),x(13,"Last"),m(),p(14,"th",7),x(15,"Handle"),m()()(),p(16,"tbody")(17,"tr")(18,"th",8),x(19,"1"),m(),p(20,"td"),x(21,"Mark"),m(),p(22,"td"),x(23,"Otto"),m(),p(24,"td"),x(25,"mdo"),m()(),p(26,"tr")(27,"th",8),x(28,"2"),m(),p(29,"td"),x(30,"Jacob"),m(),p(31,"td"),x(32,"Thornton"),m(),p(33,"td"),x(34,"fat"),m()(),p(35,"tr")(36,"th",8),x(37,"3"),m(),p(38,"td",9),x(39,"Larry the Bird"),m(),p(40,"td"),x(41,"twitter"),m()()()()()()(),pe(),m(),A(42,Tl,12,0,"ng-template",null,0,ce)}},dependencies:[Et],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var lo=ui(On());var Fl=["mask"],Ol=["content"],Il=["footer"],Nl=["titlebar"],Dl=(n,h,i)=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex","justify-content":n,"align-items":h,"pointer-events":i}),Vl=n=>({"p-dialog p-component":!0,"p-dialog-maximized":n}),Al=()=>({display:"flex","flex-direction":"column","pointer-events":"auto"}),Ll=(n,h)=>({transform:n,transition:h}),Ml=n=>({value:"visible",params:n});function Rl(n,h){if(n&1){let i=te();p(0,"div",14),G("mousedown",function(c){R(i);let _=k(2);return B(_.initResize(c))}),m()}n&2&&y("ngClass","p-resizable-handle")}function Bl(n,h){n&1&&Ye(0)}function zl(n,h){n&1&&N(0,"WindowMaximizeIcon")}function Ul(n,h){n&1&&N(0,"WindowMinimizeIcon")}function jl(n,h){if(n&1&&(de(0),A(1,zl,1,0,"WindowMaximizeIcon",11)(2,Ul,1,0,"WindowMinimizeIcon",11),pe()),n&2){let i=k(5);f(),y("ngIf",!i.maximized&&!i.maximizeIconTemplate),f(),y("ngIf",i.maximized&&!i.minimizeIconTemplate)}}function Jl(n,h){}function $l(n,h){n&1&&A(0,Jl,0,0,"ng-template")}function Gl(n,h){if(n&1&&(de(0),A(1,$l,1,0,null,21),pe()),n&2){let i=k(5);f(),y("ngTemplateOutlet",i.maximizeIconTemplate)}}function Kl(n,h){}function Wl(n,h){n&1&&A(0,Kl,0,0,"ng-template")}function Hl(n,h){if(n&1&&(de(0),A(1,Wl,1,0,null,21),pe()),n&2){let i=k(5);f(),y("ngTemplateOutlet",i.minimizeIconTemplate)}}function ql(n,h){if(n&1){let i=te();p(0,"p-button",20),G("onClick",function(){R(i);let c=k(4);return B(c.maximize())})("keydown.enter",function(){R(i);let c=k(4);return B(c.maximize())}),A(1,jl,3,2,"ng-container",11)(2,Gl,2,1,"ng-container",11)(3,Hl,2,1,"ng-container",11),m()}if(n&2){let i=k(4);y("styleClass","p-dialog-maximize-button")("tabindex",i.maximizable?"0":"-1"),f(),y("ngIf",!i.maximizeIcon),f(),y("ngIf",!i.maximized),f(),y("ngIf",i.maximized)}}function Zl(n,h){n&1&&(de(0),N(1,"TimesIcon"),pe())}function Ql(n,h){}function Yl(n,h){n&1&&A(0,Ql,0,0,"ng-template")}function Xl(n,h){if(n&1&&(p(0,"span"),A(1,Yl,1,0,null,21),m()),n&2){let i=k(5);f(),y("ngTemplateOutlet",i.closeIconTemplate)}}function ec(n,h){if(n&1){let i=te();p(0,"p-button",22),G("onClick",function(){R(i);let c=k(4);return B(c.hide())})("keydown.enter",function(){R(i);let c=k(4);return B(c.hide())}),A(1,Zl,2,0,"ng-container",11)(2,Xl,2,1,"span",11),m()}if(n&2){let i=k(4);y("styleClass","p-dialog-close-button")("ariaLabel",i.ddconfig.closeAriaLabel||i.defaultCloseAriaLabel),f(),y("ngIf",!i.closeIconTemplate),f(),y("ngIf",i.closeIconTemplate)}}function tc(n,h){if(n&1&&(de(0),p(1,"span",16),x(2),m(),p(3,"div",17),A(4,ql,4,5,"p-button",18)(5,ec,3,4,"p-button",19),m(),pe()),n&2){let i=k(3);f(),y("ngClass","p-dialog-title")("id",i.ariaLabelledBy),f(),oe(i.ddconfig.header),f(),y("ngClass","p-dialog-header-actions"),f(),y("ngIf",i.ddconfig.maximizable),f(),y("ngIf",i.closable)}}function ic(n,h){if(n&1){let i=te();p(0,"div",15,3),G("mousedown",function(c){R(i);let _=k(2);return B(_.initDrag(c))}),A(2,Bl,1,0,"ng-container",12)(3,tc,6,6,"ng-container",11),m()}if(n&2){let i=k(2);y("ngClass","p-dialog-header"),f(2),y("ngComponentOutlet",i.headerTemplate),f(),y("ngIf",!i.headerTemplate)}}function nc(n,h){}function oc(n,h){n&1&&A(0,nc,0,0,"ng-template",23)}function ac(n,h){n&1&&Ye(0)}function rc(n,h){if(n&1&&(de(0),x(1),pe()),n&2){let i=k(3);f(),ot(" ",i.ddconfig.footer," ")}}function sc(n,h){n&1&&Ye(0)}function lc(n,h){if(n&1&&(p(0,"div",17,4),A(2,rc,2,1,"ng-container",11)(3,sc,1,0,"ng-container",12),m()),n&2){let i=k(2);y("ngClass","p-dialog-footer"),f(2),y("ngIf",!i.footerTemplate),f(),y("ngComponentOutlet",i.footerTemplate)}}function cc(n,h){if(n&1){let i=te();p(0,"div",7,1),G("@animation.start",function(c){R(i);let _=k();return B(_.onAnimationStart(c))})("@animation.done",function(c){R(i);let _=k();return B(_.onAnimationEnd(c))}),A(2,Rl,1,1,"div",8)(3,ic,4,3,"div",9),p(4,"div",10,2),A(6,oc,1,0,null,11)(7,ac,1,0,"ng-container",12),m(),A(8,lc,4,3,"div",13),m()}if(n&2){let i=k();vt(i.ddconfig.style),ct(i.ddconfig.styleClass),Kt("width",i.ddconfig.width)("height",i.ddconfig.height),y("ngClass",ke(22,Vl,i.maximizable&&i.maximized))("ngStyle",Oe(24,Al))("@animation",ke(28,Ml,yi(25,Ll,i.transformOptions,i.ddconfig.transitionOptions||"150ms cubic-bezier(0, 0, 0.2, 1)")))("pFocusTrapDisabled",i.ddconfig.focusTrap===!1),ge("aria-labelledby",i.ariaLabelledBy)("aria-modal",!0)("id",i.dialogId),f(2),y("ngIf",i.ddconfig.resizable),f(),y("ngIf",i.ddconfig.showHeader!==!1),f(),y("ngClass","p-dialog-content")("ngStyle",i.ddconfig.contentStyle),f(2),y("ngIf",!i.contentTemplate),f(),y("ngComponentOutlet",i.contentTemplate),f(),y("ngIf",i.ddconfig.footer||i.footerTemplate)}}var Da=(()=>{class n{viewContainerRef;constructor(i){this.viewContainerRef=i}static \u0275fac=function(l){return new(l||n)(zt(To))};static \u0275dir=dn({type:n,selectors:[["","pDynamicDialogContent",""]]})}return n})(),Va=(()=>{class n extends sa{name="dialog";static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var Dn=class{data;inputValues;header;ariaLabelledBy;footer;width;height;closeOnEscape=!1;focusOnShow=!0;focusTrap=!0;baseZIndex;autoZIndex=!1;dismissableMask=!1;rtl=!1;style;contentStyle;styleClass;transitionOptions;closable=!1;showHeader=!1;modal=!1;maskStyleClass;resizable=!1;draggable=!1;keepInViewport=!1;minX;minY;maximizable=!1;maximizeIcon;minimizeIcon;position;closeAriaLabel;appendTo;duplicate=!1;breakpoints;templates},tn=class{constructor(){}close(h){this._onClose.next(h),setTimeout(()=>{this._onClose.complete()},1e3)}destroy(){this._onDestroy.next(null)}dragStart(h){this._onDragStart.next(h)}dragEnd(h){this._onDragEnd.next(h)}resizeInit(h){this._onResizeInit.next(h)}resizeEnd(h){this._onResizeEnd.next(h)}maximize(h){this._onMaximize.next(h)}_onClose=new Bt;onClose=this._onClose.asObservable();_onDestroy=new Bt;onDestroy=this._onDestroy.asObservable();_onDragStart=new Bt;onDragStart=this._onDragStart.asObservable();_onDragEnd=new Bt;onDragEnd=this._onDragEnd.asObservable();_onResizeInit=new Bt;onResizeInit=this._onResizeInit.asObservable();_onResizeEnd=new Bt;onResizeEnd=this._onResizeEnd.asObservable();_onMaximize=new Bt;onMaximize=this._onMaximize.asObservable();onChildComponentLoaded=new Bt},uc=zn([mi({transform:"{{transform}}",opacity:0}),Fi("{{transition}}",mi({transform:"none",opacity:1}))]),mc=zn([Fi("{{transition}}",mi({transform:"{{transform}}",opacity:0}))]),Aa=(()=>{class n extends Nt{renderer;ddconfig;dialogRef;zone;parentDialog;visible=!0;componentRef;mask;resizing;dragging;maximized;_style={};originalStyle;lastPageX;lastPageY;ariaLabelledBy;id=Yi("pn_id_");styleElement;insertionPoint;maskViewChild;contentViewChild;footerViewChild;headerViewChild;childComponentType;inputValues;container;wrapper;documentKeydownListener;documentEscapeListener;maskClickListener;transformOptions="scale(0.7)";documentResizeListener;documentResizeEndListener;documentDragListener;documentDragEndListener;_componentStyle=K(Va);get minX(){return this.ddconfig.minX?this.ddconfig.minX:0}get minY(){return this.ddconfig.minY?this.ddconfig.minY:0}get keepInViewport(){return this.ddconfig.keepInViewport}get maximizable(){return this.ddconfig.maximizable}get maximizeIcon(){return this.ddconfig.maximizeIcon}get minimizeIcon(){return this.ddconfig.minimizeIcon}get closable(){return this.ddconfig.closable}get style(){return this._style}get position(){return this.ddconfig.position}get defaultCloseAriaLabel(){return this.config.getTranslation(It.ARIA).close}set style(i){i&&(this._style=fe({},i),this.originalStyle=i)}get parent(){let i=Array.from(this.document.getElementsByClassName("p-dialog"));if(i.length>1)return i.pop()}get parentContent(){let i=Array.from(this.document.getElementsByClassName("p-dialog"));if(i.length>0){let l=i[i.length-1].querySelector(".p-dialog-content");if(l)return Array.isArray(l)?l[0]:l}}get header(){return this.ddconfig.header}get data(){return this.ddconfig.data}get breakpoints(){return this.ddconfig.breakpoints}get footerTemplate(){return this.ddconfig?.templates?.footer}get headerTemplate(){return this.ddconfig?.templates?.header}get contentTemplate(){return this.ddconfig?.templates?.content}get minimizeIconTemplate(){return this.ddconfig?.templates?.minimizeicon}get maximizeIconTemplate(){return this.ddconfig?.templates?.maximizeicon}get closeIconTemplate(){return this.ddconfig?.templates?.closeicon}get maskClass(){let l=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(c=>c===this.position);return{"p-dialog-mask":!0,"p-overlay-mask p-overlay-mask-enter":this.ddconfig.modal||this.ddconfig.dismissableMask,[`p-dialog-${l}`]:l}}get dialogId(){return this.attrSelector}zIndexForLayering;constructor(i,l,c,_,V){super(),this.renderer=i,this.ddconfig=l,this.dialogRef=c,this.zone=_,this.parentDialog=V}ngOnInit(){super.ngOnInit(),this.breakpoints&&this.createStyle()}createStyle(){if(Ht(this.platformId)&&!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let i="";for(let l in this.breakpoints)i+=`
|
|
517
|
-
@media screen and (max-width: ${l}) {
|
|
518
|
-
.p-dialog[id=${this.dialogId}]:not(.p-dialog-maximized) {
|
|
519
|
-
width: ${this.breakpoints[l]} !important;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
`;this.renderer.setProperty(this.styleElement,"innerHTML",i),Ho(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngAfterViewInit(){super.ngAfterViewInit(),this.loadChildComponent(this.childComponentType),this.ariaLabelledBy=this.getAriaLabelledBy(),this.cd.detectChanges()}getAriaLabelledBy(){return this.header!==null?Yi("pn_id_")+"_header":null}loadChildComponent(i){let l=this.insertionPoint?.viewContainerRef;l?.clear(),this.componentRef=l?.createComponent(i),this.inputValues&&Object.entries(this.inputValues).forEach(([c,_])=>{this.componentRef.setInput(c,_)}),this.dialogRef.onChildComponentLoaded.next(this.componentRef.instance)}moveOnTop(){this.ddconfig.autoZIndex!==!1?(Vi.set("modal",this.container,(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal),this.wrapper.style.zIndex=String(parseInt(this.container.style.zIndex,10)-1)):this.zIndexForLayering=Vi.generateZIndex("modal",(this.ddconfig.baseZIndex||0)+this.config.zIndex.modal)}onAnimationStart(i){switch(i.toState){case"visible":this.container=i.element,this.wrapper=this.container.parentElement,this.moveOnTop(),this.parent&&this.unbindGlobalListeners(),this.bindGlobalListeners(),this.container?.setAttribute(this.id,""),this.ddconfig.modal!==!1&&this.enableModality(),this.ddconfig.focusOnShow!==!1&&this.focus();break;case"void":this.wrapper&&this.ddconfig.modal!==!1&&Zt(this.wrapper,"p-overlay-mask-leave");break}}onAnimationEnd(i){i.toState==="void"&&(this.parentContent&&this.focus(this.parentContent),this.onContainerDestroy(),this.dialogRef.destroy())}onContainerDestroy(){this.unbindGlobalListeners(),this.container&&this.ddconfig.autoZIndex!==!1&&Vi.clear(this.container),this.zIndexForLayering&&Vi.revertZIndex(this.zIndexForLayering),this.ddconfig.modal!==!1&&this.disableModality(),this.container=null}close(){this.visible=!1,this.cd.markForCheck()}hide(){this.dialogRef&&this.dialogRef.close()}enableModality(){this.ddconfig.dismissableMask&&(this.maskClickListener=this.renderer.listen(this.wrapper,"mousedown",i=>{this.wrapper&&this.wrapper.isSameNode(i.target)&&this.hide()})),this.ddconfig.modal!==!1&&Zt(this.document.body,"p-overflow-hidden")}disableModality(){this.wrapper&&(this.ddconfig.dismissableMask&&this.unbindMaskClickListener(),this.ddconfig.modal!==!1&&Qt(this.document.body,"p-overflow-hidden"),this.cd.destroyed||this.cd.detectChanges())}focus(i=this.contentViewChild.nativeElement){let l=Gn.getFocusableElement(i,"[autofocus]");if(l){this.zone.runOutsideAngular(()=>{setTimeout(()=>l.focus(),5)});return}let c=Gn.getFocusableElement(i);c?this.zone.runOutsideAngular(()=>{setTimeout(()=>c.focus(),5)}):this.footerViewChild?this.focus(this.footerViewChild.nativeElement):!c&&this.headerViewChild&&this.focus(this.headerViewChild.nativeElement)}maximize(){this.maximized=!this.maximized,this.maximized?Zt(this.document.body,"p-overflow-hidden"):Qt(this.document.body,"p-overflow-hidden"),this.dialogRef.maximize({maximized:this.maximized})}initResize(i){this.ddconfig.resizable&&(this.documentResizeListener||this.bindDocumentResizeListeners(),this.resizing=!0,this.lastPageX=i.pageX,this.lastPageY=i.pageY,Zt(this.document.body,"p-unselectable-text"),this.dialogRef.resizeInit(i))}onResize(i){if(this.resizing){let l=i.pageX-this.lastPageX,c=i.pageY-this.lastPageY,_=$n(this.container),V=xn(this.container),L=xn(this.contentViewChild.nativeElement),ve=_+l,Se=V+c,dt=this.container.style.minWidth,a=this.container.style.minHeight,pt=this.container.getBoundingClientRect(),Ut=Jn();(!parseInt(this.container.style.top)||!parseInt(this.container.style.left))&&(ve+=l,Se+=c),(!dt||ve>parseInt(dt))&&pt.left+ve<Ut.width&&(this._style.width=ve+"px",this.container.style.width=this._style.width),(!a||Se>parseInt(a))&&pt.top+Se<Ut.height&&(this.contentViewChild.nativeElement.style.height=L+Se-V+"px",this._style.height&&(this._style.height=Se+"px",this.container.style.height=this._style.height)),this.lastPageX=i.pageX,this.lastPageY=i.pageY}}resizeEnd(i){this.resizing&&(this.resizing=!1,Qt(this.document.body,"p-unselectable-text"),this.dialogRef.resizeEnd(i))}initDrag(i){jn(i.target,"p-dialog-header-icon")||jn(i.target.parentElement,"p-dialog-header-icon")||this.ddconfig.draggable&&(this.dragging=!0,this.lastPageX=i.pageX,this.lastPageY=i.pageY,this.container.style.margin="0",Zt(this.document.body,"p-unselectable-text"),this.dialogRef.dragStart(i))}onDrag(i){if(this.dragging){let l=$n(this.container),c=xn(this.container),_=i.pageX-this.lastPageX,V=i.pageY-this.lastPageY,L=this.container.getBoundingClientRect(),ve=L.left+_,Se=L.top+V,dt=Jn();this.container.style.position="fixed",this.keepInViewport?(ve>=this.minX&&ve+l<dt.width&&(this._style.left=ve+"px",this.lastPageX=i.pageX,this.container.style.left=ve+"px"),Se>=this.minY&&Se+c<dt.height&&(this._style.top=Se+"px",this.lastPageY=i.pageY,this.container.style.top=Se+"px")):(this.lastPageX=i.pageX,this.container.style.left=ve+"px",this.lastPageY=i.pageY,this.container.style.top=Se+"px")}}endDrag(i){this.dragging&&(this.dragging=!1,Qt(this.document.body,"p-unselectable-text"),this.dialogRef.dragEnd(i),this.cd.detectChanges())}resetPosition(){this.container.style.position="",this.container.style.left="",this.container.style.top="",this.container.style.margin=""}bindDocumentDragListener(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragListener=this.renderer.listen(this.document,"mousemove",this.onDrag.bind(this))})}bindDocumentDragEndListener(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentDragEndListener=this.renderer.listen(this.document,"mouseup",this.endDrag.bind(this))})}unbindDocumentDragEndListener(){this.documentDragEndListener&&(this.documentDragEndListener(),this.documentDragListener=null)}unbindDocumentDragListener(){this.documentDragListener&&(this.documentDragListener(),this.documentDragListener=null)}bindDocumentResizeListeners(){Ht(this.platformId)&&this.zone.runOutsideAngular(()=>{this.documentResizeListener=this.renderer.listen(this.document,"mousemove",this.onResize.bind(this)),this.documentResizeEndListener=this.renderer.listen(this.document,"mouseup",this.resizeEnd.bind(this))})}unbindDocumentResizeListeners(){this.documentResizeListener&&this.documentResizeEndListener&&(this.documentResizeListener(),this.documentResizeEndListener(),this.documentResizeListener=null,this.documentResizeEndListener=null)}bindGlobalListeners(){this.ddconfig.closeOnEscape!==!1&&this.bindDocumentEscapeListener(),this.ddconfig.resizable&&this.bindDocumentResizeListeners(),this.ddconfig.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener())}unbindGlobalListeners(){this.unbindDocumentEscapeListener(),this.unbindDocumentResizeListeners(),this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener()}bindDocumentEscapeListener(){let i=this.maskViewChild?this.maskViewChild.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(i,"keydown",l=>{if(l.which==27){let c=Vi.getCurrent();(parseInt(this.container.style.zIndex)==c||this.zIndexForLayering==c)&&this.hide()}})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}ngOnDestroy(){this.onContainerDestroy(),this.componentRef&&this.componentRef.destroy(),this.destroyStyle(),super.ngOnDestroy()}static \u0275fac=function(l){return new(l||n)(zt(ko),zt(Dn),zt(tn),zt(mn),zt(n,12))};static \u0275cmp=Pe({type:n,selectors:[["p-dynamicDialog"],["p-dynamicdialog"],["p-dynamic-dialog"]],viewQuery:function(l,c){if(l&1&&(ut(Da,5),ut(Fl,5),ut(Ol,5),ut(Il,5),ut(Nl,5)),l&2){let _;ue(_=me())&&(c.insertionPoint=_.first),ue(_=me())&&(c.maskViewChild=_.first),ue(_=me())&&(c.contentViewChild=_.first),ue(_=me())&&(c.footerViewChild=_.first),ue(_=me())&&(c.headerViewChild=_.first)}},features:[Ge([Va]),wt],decls:3,vars:9,consts:[["mask",""],["container",""],["content",""],["titlebar",""],["footer",""],[3,"ngStyle","ngClass"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","style","class","pFocusTrapDisabled","width","height",4,"ngIf"],["role","dialog","pFocusTrap","",3,"ngClass","ngStyle","pFocusTrapDisabled"],["style","z-index: 90;",3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","mousedown",4,"ngIf"],[3,"ngClass","ngStyle"],[4,"ngIf"],[4,"ngComponentOutlet"],[3,"ngClass",4,"ngIf"],[2,"z-index","90",3,"mousedown","ngClass"],[3,"mousedown","ngClass"],[3,"ngClass","id"],[3,"ngClass"],["rounded","","text","",3,"styleClass","tabindex","onClick","keydown.enter",4,"ngIf"],["rounded","","text","","severity","secondary",3,"styleClass","ariaLabel","onClick","keydown.enter",4,"ngIf"],["rounded","","text","",3,"onClick","keydown.enter","styleClass","tabindex"],[4,"ngTemplateOutlet"],["rounded","","text","","severity","secondary",3,"onClick","keydown.enter","styleClass","ariaLabel"],["pDynamicDialogContent",""]],template:function(l,c){l&1&&(p(0,"div",5,0),A(2,cc,9,30,"div",6),m()),l&2&&(ct(c.ddconfig.maskStyleClass),y("ngStyle",No(5,Dl,c.position==="left"||c.position==="topleft"||c.position==="bottomleft"?"flex-start":c.position==="right"||c.position==="topright"||c.position==="bottomright"?"flex-end":"center",c.position==="top"||c.position==="topleft"||c.position==="topright"?"flex-start":c.position==="bottom"||c.position==="bottomleft"||c.position==="bottomright"?"flex-end":"center",c.ddconfig.modal?"auto":"none"))("ngClass",c.maskClass),f(2),y("ngIf",c.visible))},dependencies:[Be,Ct,Mo,Xe,Wt,bi,tt,Da,Qo,Yo,Ai,xt,ra],encapsulation:2,data:{animation:[Cn("animation",[Oi("void => visible",[Un(uc)]),Oi("visible => void",[Un(mc)])])]}})}return n})(),Vn=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[Aa,tt,tt]})}return n})(),oo=class{_parentInjector;_additionalTokens;constructor(h,i){this._parentInjector=h,this._additionalTokens=i}get(h,i,l){let c=this._additionalTokens.get(h);return c||this._parentInjector.get(h,i)}},Hi=(()=>{class n{appRef;injector;document;dialogComponentRefMap=new Map;constructor(i,l,c){this.appRef=i,this.injector=l,this.document=c}open(i,l){if(!this.duplicationPermission(i,l))return null;let c=this.appendDialogComponentToBody(l,i);return this.dialogComponentRefMap.get(c).instance.childComponentType=i,this.dialogComponentRefMap.get(c).instance.inputValues=l.inputValues,c}getInstance(i){return this.dialogComponentRefMap.get(i).instance}appendDialogComponentToBody(i,l){let c=new WeakMap;c.set(Dn,i);let _=new tn;c.set(tn,_);let V=_.onClose.subscribe(()=>{this.dialogComponentRefMap.get(_).instance.close()}),L=_.onDestroy.subscribe(()=>{this.removeDialogComponentFromBody(_),L.unsubscribe(),V.unsubscribe()}),ve=Ao(Aa,{environmentInjector:this.appRef.injector,elementInjector:new oo(this.injector,c)});this.appRef.attachView(ve.hostView);let Se=ve.hostView.rootNodes[0];return!i.appendTo||i.appendTo==="body"?this.document.body.appendChild(Se):Wo(i.appendTo,Se),this.dialogComponentRefMap.set(_,ve),_}removeDialogComponentFromBody(i){if(!i||!this.dialogComponentRefMap.has(i))return;let l=this.dialogComponentRefMap.get(i);this.appRef.detachView(l.hostView),l.destroy(),l.changeDetectorRef.detectChanges(),this.dialogComponentRefMap.delete(i)}duplicationPermission(i,l){if(l.duplicate)return!0;let c=!0;for(let[_,V]of this.dialogComponentRefMap)if(V.instance.childComponentType===i){c=!1;break}return c}static \u0275fac=function(l){return new(l||n)(un(Fo),un(Co),un(Lo))};static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var dc=["*"],pc=({dt:n})=>`
|
|
523
|
-
.p-floatlabel {
|
|
524
|
-
display: block;
|
|
525
|
-
position: relative;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.p-floatlabel label {
|
|
529
|
-
position: absolute;
|
|
530
|
-
pointer-events: none;
|
|
531
|
-
top: 50%;
|
|
532
|
-
transform: translateY(-50%);
|
|
533
|
-
transition-property: all;
|
|
534
|
-
transition-timing-function: ease;
|
|
535
|
-
line-height: 1;
|
|
536
|
-
font-weight: ${n("floatlabel.font.weight")};
|
|
537
|
-
inset-inline-start: ${n("floatlabel.position.x")};
|
|
538
|
-
color: ${n("floatlabel.color")};
|
|
539
|
-
transition-duration: ${n("floatlabel.transition.duration")};
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.p-floatlabel:has(.p-textarea) label {
|
|
543
|
-
top: ${n("floatlabel.position.y")};
|
|
544
|
-
transform: translateY(0);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
.p-floatlabel:has(.p-inputicon:first-child) label {
|
|
548
|
-
inset-inline-start: calc((${n("form.field.padding.x")} * 2) + ${n("icon.size")});
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.p-floatlabel:has(.ng-invalid.ng-dirty) label {
|
|
552
|
-
color: ${n("floatlabel.invalid.color")};
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.p-floatlabel:has(input:focus) label,
|
|
556
|
-
.p-floatlabel:has(input.p-filled) label,
|
|
557
|
-
.p-floatlabel:has(input:-webkit-autofill) label,
|
|
558
|
-
.p-floatlabel:has(textarea:focus) label,
|
|
559
|
-
.p-floatlabel:has(textarea.p-filled) label,
|
|
560
|
-
.p-floatlabel:has(.p-inputwrapper-focus) label,
|
|
561
|
-
.p-floatlabel:has(.p-inputwrapper-filled) label {
|
|
562
|
-
top: ${n("floatlabel.over.active.top")};
|
|
563
|
-
transform: translateY(0);
|
|
564
|
-
font-size: ${n("floatlabel.active.font.size")};
|
|
565
|
-
font-weight: ${n("floatlabel.label.active.font.weight")};
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
.p-floatlabel:has(input.p-filled) label,
|
|
569
|
-
.p-floatlabel:has(textarea.p-filled) label,
|
|
570
|
-
.p-floatlabel:has(.p-inputwrapper-filled) label {
|
|
571
|
-
color: ${n("floatlabel.active.color")};
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.p-floatlabel:has(input:focus) label,
|
|
575
|
-
.p-floatlabel:has(input:-webkit-autofill) label,
|
|
576
|
-
.p-floatlabel:has(textarea:focus) label,
|
|
577
|
-
.p-floatlabel:has(.p-inputwrapper-focus) label {
|
|
578
|
-
color: ${n("floatlabel.focus.color")};
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.p-floatlabel-in .p-inputtext,
|
|
582
|
-
.p-floatlabel-in .p-textarea,
|
|
583
|
-
.p-floatlabel-in .p-select-label,
|
|
584
|
-
.p-floatlabel-in .p-multiselect-label-container,
|
|
585
|
-
.p-floatlabel-in .p-autocomplete-input-multiple,
|
|
586
|
-
.p-floatlabel-in .p-cascadeselect-label,
|
|
587
|
-
.p-floatlabel-in .p-treeselect-label {
|
|
588
|
-
padding-top: ${n("floatlabel.in.input.padding.top")};
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
.p-floatlabel-in:has(input:focus) label,
|
|
592
|
-
.p-floatlabel-in:has(input.p-filled) label,
|
|
593
|
-
.p-floatlabel-in:has(input:-webkit-autofill) label,
|
|
594
|
-
.p-floatlabel-in:has(textarea:focus) label,
|
|
595
|
-
.p-floatlabel-in:has(textarea.p-filled) label,
|
|
596
|
-
.p-floatlabel-in:has(.p-inputwrapper-focus) label,
|
|
597
|
-
.p-floatlabel-in:has(.p-inputwrapper-filled) label {
|
|
598
|
-
top: ${n("floatlabel.in.active.top")};
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.p-floatlabel-on:has(input:focus) label,
|
|
602
|
-
.p-floatlabel-on:has(input.p-filled) label,
|
|
603
|
-
.p-floatlabel-on:has(input:-webkit-autofill) label,
|
|
604
|
-
.p-floatlabel-on:has(textarea:focus) label,
|
|
605
|
-
.p-floatlabel-on:has(textarea.p-filled) label,
|
|
606
|
-
.p-floatlabel-on:has(.p-inputwrapper-focus) label,
|
|
607
|
-
.p-floatlabel-on:has(.p-inputwrapper-filled) label {
|
|
608
|
-
top: 0;
|
|
609
|
-
transform: translateY(-50%);
|
|
610
|
-
border-radius: ${n("floatlabel.on.border.radius")};
|
|
611
|
-
background: ${n("floatlabel.on.active.background")};
|
|
612
|
-
padding: ${n("floatlabel.on.active.padding")};
|
|
613
|
-
}
|
|
614
|
-
`,hc={root:({instance:n,props:h})=>["p-floatlabel",{"p-floatlabel-over":h.variant==="over","p-floatlabel-on":h.variant==="on","p-floatlabel-in":h.variant==="in"}]},La=(()=>{class n extends Yt{name="floatlabel";theme=pc;classes=hc;static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275prov=ft({token:n,factory:n.\u0275fac})}return n})();var gc=(()=>{class n extends Nt{_componentStyle=K(La);variant="over";static \u0275fac=(()=>{let i;return function(c){return(i||(i=Qe(n)))(c||n)}})();static \u0275cmp=Pe({type:n,selectors:[["p-floatlabel"],["p-floatLabel"],["p-float-label"]],hostVars:8,hostBindings:function(l,c){l&2&&Oo("p-floatlabel",!0)("p-floatlabel-over",c.variant==="over")("p-floatlabel-on",c.variant==="on")("p-floatlabel-in",c.variant==="in")},inputs:{variant:"variant"},features:[Ge([La]),wt],ngContentSelectors:dc,decls:1,vars:0,template:function(l,c){l&1&&(pn(),hn(0))},dependencies:[Be,tt],encapsulation:2,changeDetection:0})}return n})(),Ma=(()=>{class n{static \u0275fac=function(l){return new(l||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[gc,tt,tt]})}return n})();var An=()=>[],Ln=(()=>{class n{static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-dialog-create-customer-supplier"]],decls:66,vars:8,consts:[[1,"row","row-gap-2"],[1,"col-12"],[1,"form-group","d-flex","flex-column"],["for",""],["appendTo","body","optionLabel","name","placeholder","Select a City",1,"w-full","md:w-56",3,"options"],[1,"col-12","col-lg-4"],["pInputText","","autocomplete","off",1,"w-100"],["rows","1","cols","30","pTextarea",""],[1,"col-12","col-lg-6"]],template:function(l,c){l&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),x(4,"Customer / Supplier"),m(),N(5,"p-select",4),m()(),p(6,"div",5)(7,"div",2)(8,"label",3),x(9,"Title"),m(),N(10,"input",6),m()(),p(11,"div",5)(12,"div",2)(13,"label",3),x(14,"First Name"),m(),N(15,"input",6),m()(),p(16,"div",5)(17,"div",2)(18,"label",3),x(19,"Last Name"),m(),N(20,"input",6),m()(),p(21,"div",5)(22,"div",2)(23,"label",3),x(24,"Mobile"),m(),N(25,"input",6),m()(),p(26,"div",5)(27,"div",2)(28,"label",3),x(29,"Email"),m(),N(30,"input",6),m()(),p(31,"div",5)(32,"div",2)(33,"label",3),x(34,"Identification"),m(),N(35,"input",6),m()(),p(36,"div",1)(37,"div",2)(38,"label",3),x(39,"Birthday"),m(),N(40,"input",6),m()(),p(41,"div",1)(42,"div",2)(43,"label",3),x(44,"Title"),m(),N(45,"textarea",7),m()(),p(46,"div",8)(47,"div",2)(48,"label",3),x(49,"City"),m(),N(50,"p-select",4),m()(),p(51,"div",8)(52,"div",2)(53,"label",3),x(54,"Nationality"),m(),N(55,"p-select",4),m()(),p(56,"div",8)(57,"div",2)(58,"label",3),x(59,"Gender"),m(),N(60,"p-select",4),m()(),p(61,"div",8)(62,"div",2)(63,"label",3),x(64,"Member Code"),m(),N(65,"textarea",7),m()()()),l&2&&(f(5),y("options",Oe(4,An)),f(45),y("options",Oe(5,An)),f(5),y("options",Oe(6,An)),f(5),y("options",Oe(7,An)))},dependencies:[ai,oi,ei,Xt,Ma,ni,ii],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var za=ui(so());var vc=["class","page"],yc=()=>({height:"calc(100vh - 100px)"}),_c=()=>({width:"25rem"}),nn=n=>({"ng-invalid ng-dirty":n}),bc=()=>({"min-width":"50rem"}),Ra=()=>({}),Ba=n=>({"text-danger":n});function Sc(n,h){if(n&1&&(p(0,"div",23),N(1,"p-radiobutton",35),p(2,"label",36),x(3),m()()),n&2){let i=h.$implicit;f(),y("value",i.key),f(2),oe(i.value)}}function wc(n,h){n&1&&(p(0,"tr")(1,"th",37),x(2,"Account"),m(),p(3,"th",38),x(4,"Debit"),m(),p(5,"th",38),x(6,"Credit"),m(),p(7,"th",37),x(8,"Note"),m(),N(9,"th"),m())}function Cc(n,h){if(n&1){let i=te();p(0,"tr",39)(1,"td"),N(2,"p-select",40),m(),p(3,"td"),N(4,"input",41),m(),p(5,"td"),N(6,"input",42),m(),p(7,"td"),N(8,"textarea",43),m(),p(9,"td")(10,"p-button",44),G("onClick",function(){let c=R(i).rowIndex,_=k(2);return B(_.removeItems(c))}),m()()()}if(n&2){let i=h.rowIndex,l=k(2);y("formGroupName",i),f(2),y("options",l.journalEntryForm().options.accounts)("virtualScrollItemSize",50),f(2),y("autoNumeric",Oe(5,Ra)),f(2),y("autoNumeric",Oe(6,Ra))}}function xc(n,h){if(n&1){let i=te();p(0,"tr")(1,"td")(2,"div",45)(3,"div",46)(4,"p-button",47),G("onClick",function(){R(i);let c=k(2);return B(c.addItems())}),m()(),p(5,"span",48),x(6,"Total"),m()()(),p(7,"td",49),x(8),Me(9,"number"),m(),p(10,"td",49),x(11),Me(12,"number"),m(),N(13,"td",50),m()}if(n&2){let i=k(2);f(7),y("ngClass",ke(8,Ba,i.subTotalCredit()!==i.subTotalDebit())),f(),ot(" ",Ke(9,4,i.subTotalDebit())," "),f(2),y("ngClass",ke(10,Ba,i.subTotalCredit()!==i.subTotalDebit())),f(),ot(" ",Ke(12,6,i.subTotalCredit())," ")}}function Ec(n,h){if(n&1){let i=te();p(0,"div",11)(1,"p-panel")(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"label",16),x(7,"Outlets"),m(),N(8,"p-select",17),m(),p(9,"div",15)(10,"label",16),x(11,"Date"),m(),N(12,"p-datepicker",18),m(),p(13,"div",15)(14,"label",16),x(15,"Number"),m(),N(16,"input",19),m(),p(17,"div",15)(18,"label",16),x(19),m(),p(20,"div",20)(21,"p-autocomplete",21),G("completeMethod",function(c){R(i);let _=k();return B(_.searchCustomer(c))}),m()()(),p(22,"div",15)(23,"label",16),x(24,"Contact"),m(),p(25,"div",22),yt(26,Sc,4,2,"div",23,Tt),m()()()()(),N(28,"hr"),p(29,"div",24)(30,"div",13)(31,"p-table",25),A(32,wc,10,0,"ng-template",null,1,ce)(34,Cc,11,7,"ng-template",null,2,ce)(36,xc,14,12,"ng-template",null,0,ce),m()()(),N(38,"hr"),p(39,"div",12)(40,"div",13)(41,"div",26)(42,"div",27)(43,"div",28)(44,"label",16),x(45,"Document"),m(),N(46,"p-select",29),m()(),p(47,"div",27)(48,"div",28)(49,"label",16),x(50,"Type"),m(),N(51,"p-select",30),m()(),p(52,"div",27)(53,"div",28)(54,"label",16),x(55,"Number"),m(),N(56,"input",31),m()(),p(57,"div",27)(58,"div",28)(59,"label",16),x(60,"ID"),m(),N(61,"input",32),m()(),p(62,"div",27)(63,"div",28)(64,"label",16),x(65,"Note"),m(),N(66,"textarea",33),m()(),p(67,"div",27)(68,"div",28)(69,"label",16),x(70,"Upload"),m(),p(71,"p-fileupload",34,3),G("onSelect",function(c){R(i);let _=k();return B(_.onUpload(c))}),m()()()()()()()()}if(n&2){let i=k();y("formGroup",i.form),f(8),y("options",i.outlets()),f(4),y("showIcon",!0)("ngClass",ke(15,nn,i.form.controls.order.controls.date.invalid&&(i.form.controls.order.controls.date.dirty||i.form.controls.order.controls.date.touched))),f(4),y("ngClass",ke(17,nn,i.form.controls.order.controls.number.invalid&&(i.form.controls.order.controls.number.dirty||i.form.controls.order.controls.number.touched))),f(3),oe(+i.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),f(2),y("suggestions",i.customerSuggestions())("placeholder",+i.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),f(5),_t(i.contactType()),f(5),y("value",i.form.controls.items.controls)("tableStyle",Oe(19,bc)),f(15),y("ngClass",ke(20,nn,i.form.controls.order.controls.entryTypeID.invalid&&(i.form.controls.order.controls.entryTypeID.dirty||i.form.controls.order.controls.entryTypeID.touched)))("options",i.journalEntryForm().options.entryTypes),f(5),y("ngClass",ke(22,nn,i.form.controls.order.controls.referenceTypeID.invalid&&(i.form.controls.order.controls.referenceTypeID.dirty||i.form.controls.order.controls.referenceTypeID.touched)))("options",i.journalEntryForm().options.referenceTypes),f(15),y("ngClass",ke(24,nn,i.form.controls.order.controls.note.invalid&&(i.form.controls.order.controls.note.dirty||i.form.controls.order.controls.note.touched)))}}function Pc(n,h){if(n&1){let i=te();p(0,"p-button",51),G("click",function(){R(i);let c=k();return B(c.uploadDialogVisible.set(!1))}),m(),p(1,"p-button",52),G("click",function(){R(i);let c=k();return B(c.uploadDialogVisible.set(!1))}),m()}n&2&&y("text",!0)}var co=(()=>{class n{constructor(){this.fileAttachment=Ve(new File([],"")),this.activatedRoute=K(qt),this.journalEntryService=K(We),this.journalEntryForm=Ve(null),this.customerSuggestions=Ve([]),this.itemsForm=Ve([]),this.subTotalDebit=at(()=>this.itemsForm().reduce((i,l)=>i+ +l.debitAmount,0)),this.subTotalCredit=at(()=>this.itemsForm().reduce((i,l)=>i+ +l.creditAmount,0)),this.contactType=Ve([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=K(Hi),this.uploadDialogVisible=Ve(!1),this.messageService=K(Ni),this.outlets=at(()=>this.journalEntryForm()?.options?.outlets||[]),this.toasr=K(Ii),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Ln,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalEntryForm(),setInterval(()=>{this.subTotalCredit()!==this.subTotalDebit()&&this.messageService.add({severity:"warn",summary:"Mismatch Detected",detail:`The total Debit and Credit amounts are not balanced. Difference: ${this.subTotalCredit()-this.subTotalDebit()}`})},1e3)}onToggleUploadDialog(){this.uploadDialogVisible.update(i=>!i)}onUploadDialog(i){console.log(i),za.default.parse(i.currentFiles[0],{complete:l=>{console.log("Parsed result:",l)},error:l=>{console.error("Parsing error:",l)}})}initializeForm(){this.form=new Ot({order:new Ot({id:new M("",[et.required]),number:new M("",[et.required]),date:new M({value:new Date,disabled:!0},[et.required]),note:new M(""),entryTypeID:new M(1,[et.required]),referenceID:new M(""),referenceTypeID:new M(0,[et.required]),referenceText:new M(""),contactID:new M(""),detailReferenceID:new M(""),creatorID:new M("",[et.required]),created:new M("",[et.required]),modifierID:new M(""),modified:new M(""),entityID:new M(""),statusID:new M(0),contactName:new M(""),contactType:new M(0)}),items:new _n([]),additionalAccountID:new M(""),file:new M(null)})}initializeFormEffect(){fn(()=>{let i=this.journalEntryForm();i&&(this.form.patchValue({order:Te(fe({},i.form.order),{entryTypeID:Number(i.form.order.entryTypeID===0&&1),referenceID:String(i.form.order.referenceID||De),contactID:String(i.form.order.contactID||""),detailReferenceID:String(i.form.order.detailReferenceID||De),contactName:String(i.form.order.contactName),date:lo.default.isDayjs(i.form.order.date)?i.form.order.date.toDate():(0,lo.default)().toDate(),modifierID:String(i.form.order.modifierID||De),statusID:i.form.order.statusID,modified:String(i.form.order.modified),entityID:String(i.form.order.entityID||De)}),additionalAccountID:i.form.additionalAccountID}),this.updateFormItems(i.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(l=>{this.itemsForm.set(l)}))})}updateFormItems(i){let l=this.form.controls.items;l.clear(),i.forEach(c=>{l.push(new Ot({id:new M(c.id),journalID:new M(c.journalID),accountID:new M(c.accountID),debitAmount:new M(c.debitAmount),creditAmount:new M(c.creditAmount),index:new M(c.index),note:new M(c.note)}))})}loadJournalEntryForm(){this.activatedRoute.data.pipe(Pt(i=>i.form),Fe(i=>this.journalEntryForm.set(i))).subscribe()}searchCustomer(i){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(i.query).pipe(Fe(l=>this.customerSuggestions.set(l))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(i.query).pipe(Fe(l=>this.customerSuggestions.set(l))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ot({id:new M(De.toString()),journalID:new M(De.toString()),accountID:new M(De.toString()),debitAmount:new M(0),creditAmount:new M(0),index:new M(this.form.controls.items.length??0),note:new M("")}))}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let i=this.getCleanedFormValue();console.log("cleanedFormValue",i);let l=this.buildFormData(i);this.journalEntryService.submitJournalEntry(l).pipe($e("response"),Fe(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let i=this.form.getRawValue(),l=Object.entries(i).reduce((c,[_,V])=>(_==="items"?c[_]=V.map(L=>Te(fe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=Te(fe({},V),{contactID:V.contactID||De}):c[_]=V,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(i){let l=new FormData;return l.append("Data",JSON.stringify(i)),l.append("File",this.fileAttachment()),l}onUpload(i){console.log(i),this.fileAttachment.set(i.currentFiles[0])}removeItems(i){this.form.controls.items.removeAt(i)}onSwap(){let i=this.form.controls.items.value.map(l=>({id:l.id??"",journalID:l.journalID??"",accountID:l.accountID??"",debitAmount:l.creditAmount,creditAmount:l.debitAmount,index:l.index??0,note:l.note??""}));this.form.controls.items.setValue(i)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-entry-form",8,"page"]],features:[Ge([Hi,Ni])],attrs:vc,decls:12,vars:9,consts:[["footer",""],["header",""],["body",""],["fu",""],["pageTitle",`Manual Journal Form
|
|
615
|
-
`],["ngProjectAs","action-button",5,["action-button"]],["type","button",1,"btn","btn-primary","rounded",3,"click"],["ngProjectAs","content",5,["content"]],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],["formGroupName","order",1,"row"],[1,"col"],[1,"row"],[1,"col","d-flex","flex-column"],["for",""],["size","small","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"w-full",3,"options"],["styleClass","w-100","dataType","string","dateFormat","mm-dd-yy","size","small","formControlName","date",3,"showIcon","ngClass"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",3,"ngClass"],[1,"d-flex","align-items-center","gap-2"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"w-100",3,"completeMethod","suggestions","placeholder"],[1,"d-flex","align-items-center","gap-2",2,"height","100%","min-height","43px"],[1,"d-flex","items-center","gap-2"],["formArrayName","items",1,"row"],["showGridlines","",3,"value","tableStyle"],[1,"row","gap-3"],[1,"col","col-lg-4"],[1,"form-group","d-flex","flex-column"],["formControlName","selectedCity","formControlName","entryTypeID","optionLabel","value","optionValue","key",3,"ngClass","options"],["formControlName","referenceTypeID","optionLabel","value","optionValue","key",3,"ngClass","options"],["pSize","small","type","text","formControlName","referenceText","pInputText","","placeholder","Enter Number"],["pSize","small","type","text","pInputText","","formControlName","referenceID"],["rows","1","cols","30","pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"ngClass"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[2,"width","25%"],[1,"text-end",2,"width","25%"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","virtualScroll","","optionLabel","name","optionValue","id","placeholder","Select an account","styleClass","w-100","showClear","",3,"options","virtualScrollItemSize"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","formControlName","creditAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"d-flex","gap-2"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end",3,"ngClass"],["colspan","2"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(l,c){if(l&1){let _=te();p(0,"app-main-panel",4),de(1,5),p(2,"button",6),G("click",function(){return R(_),B(c.onSubmitJournalEntry())}),x(3," Submit "),m(),pe(),de(4,7),p(5,"p-scroll-panel"),A(6,Ec,73,26,"div",8),m(),pe(),m(),p(7,"p-dialog",9)(8,"p-fileupload",10),G("onSelect",function(L){return R(_),B(c.onUploadDialog(L))}),m(),A(9,Pc,2,1,"ng-template",null,0,ce),m(),N(11,"p-toast")}l&2&&(f(5),vt(Oe(7,yc)),f(),y("ngIf",c.journalEntryForm()),f(),vt(Oe(8,_c)),y("modal",!0)("visible",c.uploadDialogVisible()))},dependencies:[Ti,Si,wi,Ci,xi,ki,Ei,Pi,Et,Be,Ct,Xe,Ft,ni,ii,zi,Bi,ei,Xt,$i,Ji,Fn,Tn,At,Vt,ti,xt,Dt,En,Pn,ai,oi,Vn,Wi,di,Ri,Mi,Ki,In,ha,pa,ji,Ui],encapsulation:2})}}return n})();var uo=n=>{let h=K(We),i=K(Gi);return i.show(),console.log("journalEntryResolver",n),h.getJournalEntryForm(n.paramMap.get("id")??"").pipe($e("response"),Fe(()=>i.hide()))};var kc=()=>["edit"],Tc=()=>["/report/general-ledger"],Fc=n=>({id:n});function Oc(n,h){n&1&&(p(0,"tr")(1,"th",15),x(2,"Code"),m(),p(3,"th"),x(4,"Account"),m(),p(5,"th",15),x(6,"Debit"),m(),p(7,"th",15),x(8,"Credit"),m()())}function Ic(n,h){if(n&1&&(p(0,"tr")(1,"td")(2,"a",16),x(3),m()(),p(4,"td"),x(5),m(),p(6,"td"),x(7),Me(8,"number"),m(),p(9,"td"),x(10),Me(11,"number"),m()()),n&2){let i=h.$implicit;f(2),y("routerLink",Oe(10,Tc))("queryParams",ke(11,Fc,i.accountID)),f(),oe(i.accountCode),f(2),oe(i.accountName),f(2),oe(Ke(8,6,i.debitAmount)),f(3),oe(Ke(11,8,i.creditAmount))}}function Nc(n,h){if(n&1&&(p(0,"tr")(1,"td",17),x(2,"Total"),m(),p(3,"td"),x(4),Me(5,"number"),m(),p(6,"td"),x(7),Me(8,"number"),m()()),n&2){let i=k(2);f(4),oe(Ke(5,2,i.totalDebitAmount())),f(3),oe(Ke(8,4,i.totalCreditAmount()))}}function Dc(n,h){if(n&1&&(p(0,"app-main-panel",3),de(1,4),p(2,"a",5),x(3," Edit "),m(),p(4,"button",6),x(5,"Delete"),m(),pe(),de(6,7),p(7,"div",8)(8,"div",9)(9,"p-card",10)(10,"div",11)(11,"div",12)(12,"div",11)(13,"div",13),x(14,"Date"),m(),p(15,"div",12),x(16),Me(17,"date"),m()(),N(18,"hr"),p(19,"div",11)(20,"div",13),x(21,"Number"),m(),p(22,"div",12),x(23),m()(),N(24,"hr"),p(25,"div",11)(26,"div",13),x(27,"Outlet"),m(),p(28,"div",12),x(29),m()()(),p(30,"div",12)(31,"div",11)(32,"div",13),x(33,"Date"),m(),p(34,"div",12),x(35),Me(36,"date"),m()(),N(37,"hr"),p(38,"div",11)(39,"div",13),x(40,"Number"),m(),p(41,"div",12),x(42),m()(),N(43,"hr"),p(44,"div",11)(45,"div",13),x(46,"Outlet"),m(),p(47,"div",12),x(48),m()()()()()(),p(49,"div",12)(50,"p-card")(51,"p-table",14),A(52,Oc,9,0,"ng-template",null,0,ce)(54,Ic,12,13,"ng-template",null,1,ce)(56,Nc,9,6,"ng-template",null,2,ce),m()()()(),pe(),m()),n&2){let i=k();y("pageTitle","Journal #"+i.journalEntryInfo().order.number),f(2),y("routerLink",Oe(15,kc)),f(14),ot(" ",Qi(17,9,i.journalEntryInfo().order.date,"dd mmm yy")," "),f(7),oe(i.journalEntryInfo().order.number),f(6),oe(i.journalEntryInfo().order.outletID),f(6),ot(" ",Qi(36,12,i.journalEntryInfo().order.date,"dd mmm yy")," "),f(7),oe(i.journalEntryInfo().order.number),f(6),oe(i.journalEntryInfo().order.outletID),f(3),y("value",i.journalEntryInfo().items)}}var Ua=(()=>{class n{constructor(){this.journalEntryService=K(We),this.route=K(qt),this.journalEntryInfo=Ve(null),this.totalDebitAmount=at(()=>this.journalEntryInfo()?.items?.reduce((l,c)=>l+c.debitAmount,0)||0),this.totalCreditAmount=at(()=>this.journalEntryInfo()?.items?.reduce((l,c)=>l+c.creditAmount,0)||0)}ngOnInit(){this.route.paramMap.pipe(cn(i=>i.has("id")),Pt(i=>i.get("id")),Zi(i=>this.journalEntryService.getJournalEntryInfo(i)),Fe(i=>this.journalEntryInfo.set(i)),$e("response")).subscribe()}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-entry-info"]],decls:1,vars:1,consts:[["header",""],["body",""],["footer",""],[3,"pageTitle"],["ngProjectAs","action-button",5,["action-button"]],[1,"btn","btn-secondary","rounded",3,"routerLink"],[1,"btn","btn-danger","rounded"],["ngProjectAs","content",5,["content"]],[1,"row","row-gap-4"],[1,"col-12"],["header","Details"],[1,"row"],[1,"col"],[1,"col-2"],[3,"value"],[2,"width","10%"],[1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"text-end"]],template:function(l,c){l&1&&A(0,Dc,58,16,"app-main-panel",3),l&2&&Re(c.journalEntryInfo()?0:-1)},dependencies:[Et,Be,Ft,vn,Dt,kn,At,Vt,Sn,bn],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var ja=n=>{let h=K(We),i=K(Gi);return i.show(),console.log("journalEntryResolver",n),h.getJournalRecordExpenseLoader().pipe($e("response"),Fe(()=>i.hide()))};var po=ui(On());var Ja=ui(so());var Vc=()=>({width:"25rem"}),mo=n=>({"ng-invalid ng-dirty":n}),Ac=()=>({"min-width":"50rem"}),Lc=()=>({});function Mc(n,h){if(n&1&&(p(0,"div",23),N(1,"p-radiobutton",32),p(2,"label",33),x(3),m()()),n&2){let i=h.$implicit;f(),y("value",i.key),f(2),oe(i.value)}}function Rc(n,h){n&1&&(p(0,"tr")(1,"th",34),x(2,"Account"),m(),p(3,"th",35),x(4,"Amount"),m(),p(5,"th"),x(6,"Note"),m(),N(7,"th",36),m())}function Bc(n,h){if(n&1){let i=te();p(0,"tr",37)(1,"td"),N(2,"p-select",38),m(),p(3,"td"),N(4,"input",39),m(),p(5,"td"),N(6,"textarea",40),m(),p(7,"td")(8,"div",41)(9,"p-button",42),G("onClick",function(){let c=R(i).rowIndex,_=k(2);return B(_.removeItems(c))}),m()()()()}if(n&2){let i=h.rowIndex,l=k(2);y("formGroupName",i),f(2),y("options",l.JournalExpenseRecord().options.accounts)("virtualScrollItemSize",50),f(2),y("autoNumeric",Oe(5,Lc)),f(2),y("autoResize",!0)}}function zc(n,h){if(n&1){let i=te();p(0,"tr")(1,"td")(2,"div",43)(3,"div",44)(4,"p-button",45),G("onClick",function(){R(i);let c=k(2);return B(c.addItems())}),m()(),p(5,"span",46),x(6,"Total"),m()()(),p(7,"td",47),x(8),Me(9,"number"),m(),N(10,"td",48),m()}if(n&2){let i=k(2);f(8),ot(" ",Ke(9,1,i.subTotalDebit())," ")}}function Uc(n,h){if(n&1){let i=te();p(0,"div",11)(1,"p-panel")(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"label",16),x(7,"Outlets"),m(),N(8,"p-select",17),m(),p(9,"div",15)(10,"label",16),x(11,"Date"),m(),N(12,"p-datepicker",18),m(),p(13,"div",15)(14,"label",16),x(15,"Number"),m(),N(16,"input",19),m(),p(17,"div",15)(18,"label",16),x(19),m(),p(20,"div",20)(21,"p-autocomplete",21),G("completeMethod",function(c){R(i);let _=k();return B(_.searchCustomer(c))}),m()()(),p(22,"div",15)(23,"label",16),x(24,"Contact"),m(),p(25,"div",22),yt(26,Mc,4,2,"div",23,Tt),m()(),p(28,"div",15)(29,"label",16),x(30,"Payments"),m(),N(31,"p-select",24),m()()()(),N(32,"hr"),p(33,"div",25)(34,"div",13)(35,"p-table",26),A(36,Rc,8,0,"ng-template",null,1,ce)(38,Bc,10,6,"ng-template",null,2,ce)(40,zc,11,3,"ng-template",null,0,ce),m()()(),N(42,"hr"),p(43,"div",12)(44,"div",13)(45,"div",27)(46,"div",28)(47,"div",29)(48,"label",16),x(49,"Note"),m(),N(50,"textarea",30),m()(),p(51,"div",28)(52,"div",29)(53,"label",16),x(54,"Upload"),m(),p(55,"p-fileupload",31,3),G("onSelect",function(c){R(i);let _=k();return B(_.onUpload(c))}),m()()()()()()()()}if(n&2){let i=k();y("formGroup",i.form),f(8),y("options",i.outlets()),f(4),y("showIcon",!0)("ngClass",ke(13,mo,i.form.controls.order.controls.date.invalid&&(i.form.controls.order.controls.date.dirty||i.form.controls.order.controls.date.touched))),f(4),y("ngClass",ke(15,mo,i.form.controls.order.controls.number.invalid&&(i.form.controls.order.controls.number.dirty||i.form.controls.order.controls.number.touched))),f(3),oe(+i.form.controls.order.controls.contactType.value==0?"Customer":"Supplier"),f(2),y("suggestions",i.customerSuggestions())("placeholder",+i.form.controls.order.controls.contactType.value==0?"Search Customer":"Search Supplier"),f(5),_t(i.contactType()),f(5),y("options",i.JournalExpenseRecord().options.paymentAccounts),f(4),y("value",i.form.controls.items.controls)("tableStyle",Oe(17,Ac)),f(15),y("autoResize",!0)("ngClass",ke(18,mo,i.form.controls.order.controls.note.invalid&&(i.form.controls.order.controls.note.dirty||i.form.controls.order.controls.note.touched)))}}function jc(n,h){if(n&1){let i=te();p(0,"p-button",49),G("click",function(){R(i);let c=k();return B(c.uploadDialogVisible.set(!1))}),m(),p(1,"p-button",50),G("click",function(){R(i);let c=k();return B(c.uploadDialogVisible.set(!1))}),m()}n&2&&y("text",!0)}var $a=(()=>{class n{constructor(){this.fileAttachment=Ve(new File([],"")),this.activatedRoute=K(qt),this.journalEntryService=K(We),this.JournalExpenseRecord=Ve(null),this.customerSuggestions=Ve([]),this.itemsForm=Ve([]),this.subTotalDebit=at(()=>this.itemsForm().reduce((i,l)=>i+ +l.debitAmount,0)),this.subTotalCredit=at(()=>this.itemsForm().reduce((i,l)=>i+ +l.creditAmount,0)),this.contactType=Ve([{key:0,value:"Customer"},{key:1,value:"Supplier"}]),this.dialogService=K(Hi),this.uploadDialogVisible=Ve(!1),this.messageService=K(Ni),this.outlets=at(()=>this.JournalExpenseRecord()?.options?.entities||[]),this.toasr=K(Ii),this.initializeFormEffect()}toggleDialog(){this.dialogService.open(Ln,{header:"Create Customer/Supplier",width:"40vw",footer:"submit",closable:!0,dismissableMask:!0,modal:!0,showHeader:!0})}ngOnInit(){this.initializeForm(),this.loadJournalExpenseRecord()}onToggleUploadDialog(){this.uploadDialogVisible.update(i=>!i)}onUploadDialog(i){console.log(i),Ja.default.parse(i.currentFiles[0],{complete:l=>{console.log("Parsed result:",l)},error:l=>{console.error("Parsing error:",l)}})}initializeForm(){this.form=new Ot({order:new Ot({id:new M("",[et.required]),number:new M("",[et.required]),date:new M({value:new Date,disabled:!0},[et.required]),note:new M(""),entryTypeID:new M(1,[et.required]),referenceID:new M(""),referenceTypeID:new M(0,[et.required]),referenceText:new M(""),contactID:new M(""),detailReferenceID:new M(""),creatorID:new M("",[et.required]),created:new M("",[et.required]),modifierID:new M(""),modified:new M(""),entityID:new M(""),statusID:new M(0),contactName:new M(""),contactType:new M(0)}),items:new _n([]),additionalAccountID:new M(""),file:new M(null)})}initializeFormEffect(){fn(()=>{let i=this.JournalExpenseRecord();i&&(this.form.patchValue({order:Te(fe({},i.form.order),{entryTypeID:Number(i.form.order.entryTypeID===0&&1),referenceID:String(i.form.order.referenceID||De),contactID:String(i.form.order.contactID||""),detailReferenceID:String(i.form.order.detailReferenceID||De),contactName:String(i.form.order.contactName),date:po.default.isDayjs(i.form.order.date)?i.form.order.date.toDate():(0,po.default)().toDate(),modifierID:String(i.form.order.modifierID||De),statusID:+i.form.order.statusID,modified:String(i.form.order.modified),entityID:String(i.form.order.entityID||De)}),additionalAccountID:i.form.additionalAccountID}),this.updateFormItems(i.form.items),this.form.controls.items.touched||this.itemsForm.set(this.form.controls.items.value),this.form.controls.items.valueChanges.subscribe(l=>{this.itemsForm.set(l)}))})}updateFormItems(i){let l=this.form.controls.items;l.clear(),i.forEach(c=>{l.push(new Ot({id:new M(c.id),journalID:new M(c.journalID),accountID:new M(c.accountID),debitAmount:new M(c.debitAmount),creditAmount:new M(c.creditAmount),index:new M(c.index),note:new M(c.note)}))})}loadJournalExpenseRecord(){this.activatedRoute.data.pipe(Pt(i=>i.form),Fe(i=>this.JournalExpenseRecord.set(i))).subscribe()}searchCustomer(i){switch(+this.form.controls.order.value.contactType){case 0:this.journalEntryService.getJournalEntryCustomerSuggestions(i.query).pipe(Fe(l=>this.customerSuggestions.set(l))).subscribe();break;case 1:this.journalEntryService.getJournalEntrySupplierSuggestions(i.query).pipe(Fe(l=>this.customerSuggestions.set(l))).subscribe();break;default:console.error("Invalid contact type");break}}addItems(){this.form.controls.items.push(new Ot({id:new M(De.toString()),journalID:new M(De.toString()),accountID:new M(De.toString()),debitAmount:new M(0),creditAmount:new M(0),index:new M(this.form.controls.items.length??0),note:new M("")}))}onSubmitJournalEntry(){if(console.log(this.form.value),this.form.invalid){this.markFormInvalidAndNotify();return}this.form.controls.order.controls.date.enable();let i=this.getCleanedFormValue();console.log("cleanedFormValue",i);let l=this.buildFormData(i);this.journalEntryService.submitJournalEntry(l).pipe($e("response"),Fe(()=>this.form.controls.order.controls.date.disable()),fi(c=>gi(()=>c)),$e("error")).subscribe()}markFormInvalidAndNotify(){this.form.markAllAsTouched(),this.toasr.warning("Please fill in all required fields","Warning")}getCleanedFormValue(){let i=this.form.getRawValue(),l=Object.entries(i).reduce((c,[_,V])=>(_==="items"?c[_]=V.map(L=>Te(fe({},L),{debitAmount:+L.debitAmount,creditAmount:+L.creditAmount})):_==="order"?c[_]=Te(fe({},V),{contactID:V.contactID||De}):c[_]=V,c),{});return JSON.parse(JSON.stringify(l,(c,_)=>_==="null"?null:_))}buildFormData(i){let l=new FormData;return l.append("Data",JSON.stringify(i)),l.append("File",this.fileAttachment()),l}onUpload(i){console.log(i),this.fileAttachment.set(i.currentFiles[0])}removeItems(i){this.form.controls.items.removeAt(i)}onSwap(){let i=this.form.controls.items.value.map(l=>({id:l.id??"",journalID:l.journalID??"",accountID:l.accountID??"",debitAmount:l.creditAmount,creditAmount:l.debitAmount,index:l.index??0,note:l.note??""}));this.form.controls.items.setValue(i)}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=Pe({type:n,selectors:[["app-journal-receive-money"]],features:[Ge([Hi,Ni])],decls:11,vars:6,consts:[["footer",""],["header",""],["body",""],["fu",""],["pageTitle",`Receive Money
|
|
616
|
-
`],["ngProjectAs","action-button",5,["action-button"]],["type","button",1,"btn","btn-primary","rounded",3,"click"],["ngProjectAs","content",5,["content"]],["class","d-flex flex-column row-gap-4",3,"formGroup",4,"ngIf"],["header","Upload",3,"modal","visible"],["mode","basic","chooseLabel","Choose","chooseIcon","pi pi-upload",3,"onSelect"],[1,"d-flex","flex-column","row-gap-4",3,"formGroup"],["formGroupName","order",1,"row"],[1,"col"],[1,"row"],[1,"col","d-flex","flex-column"],["for",""],["size","small","formControlName","entityID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",1,"w-full",3,"options"],["styleClass","w-100","dataType","string","dateFormat","mm-dd-yy","size","small","formControlName","date",3,"showIcon","ngClass"],["pSize","small","type","text","pInputText","","formControlName","number","placeholder","Enter Number",3,"ngClass"],[1,"d-flex","align-items-center","gap-2"],["size","small","styleClass","w-100","inputStyleClass","w-100","formControlName","contactID","optionLabel","Value","optionValue","Key",1,"w-100",3,"completeMethod","suggestions","placeholder"],[1,"d-flex","align-items-center","gap-2",2,"height","100%","min-height","43px"],[1,"d-flex","items-center","gap-2"],["size","small","formControlName","entityID","optionLabel","value","optionValue","key","placeholder","Select an Outlet",1,"w-full",3,"options"],["formArrayName","items",1,"row"],["showGridlines","",3,"value","tableStyle"],[1,"row","gap-3"],[1,"col","col-lg-4"],[1,"form-group","d-flex","flex-column"],["pTextarea","","formControlName","note","placeholder","Enter Note",1,"w-100",3,"autoResize","ngClass"],["styleClass","justify-content-start","mode","basic","chooseLabel","Choose","chooseIcon","fa-solid fa-upload","maxFileSize","1000000",3,"onSelect"],["formControlName","contactType","name","contactType","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[2,"width","25%"],[1,"text-end",2,"width","25%"],[2,"width","5%"],[3,"formGroupName"],["appendTo","body","size","small","formControlName","accountID","virtualScroll","","optionLabel","value","optionValue","key","placeholder","Select an account","styleClass","w-100","showClear","",3,"options","virtualScrollItemSize"],["pSize","small","formControlName","debitAmount","type","text","pInputText","",1,"w-100","text-end",3,"autoNumeric"],["pSize","small","rows","1","cols","30","pTextarea","","formControlName","note",1,"w-100",3,"autoResize"],[1,"d-flex","justify-content-center","align-items-center"],["size","small","icon","fa-solid fa-xmark","aria-label","Save","severity","danger",3,"onClick"],[1,"d-flex","justify-content-between","align-items-center"],[1,"d-flex","gap-2"],["icon","fa-light fa-plus","size","small","label","Add",3,"onClick"],[2,"vertical-align","middle"],[1,"text-end"],["colspan","2"],["label","Cancel","severity","secondary",3,"click","text"],["label","OK(F2)","severity","primary",3,"click"]],template:function(l,c){if(l&1){let _=te();p(0,"app-main-panel",4),de(1,5),p(2,"button",6),G("click",function(){return R(_),B(c.onSubmitJournalEntry())}),x(3," Submit "),m(),pe(),de(4,7),A(5,Uc,57,20,"div",8),pe(),m(),p(6,"p-dialog",9)(7,"p-fileupload",10),G("onSelect",function(L){return R(_),B(c.onUploadDialog(L))}),m(),A(8,jc,2,1,"ng-template",null,0,ce),m(),N(10,"p-toast")}l&2&&(f(5),y("ngIf",c.JournalExpenseRecord()),f(),vt(Oe(5,Vc)),y("modal",!0)("visible",c.uploadDialogVisible()))},dependencies:[Ti,Si,wi,Ci,xi,ki,Ei,Pi,Et,Be,Ct,Xe,Ft,ni,ii,zi,Bi,ei,Xt,$i,Ji,Fn,Tn,At,Vt,ti,xt,Dt,En,Pn,ai,oi,Vn,Wi,di,Ri,Mi,Ki,In,ji,Ui],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Ga=n=>{let h=K(We),i=K(Gi);return i.show(),console.log("journalEntryResolver",n),h.getJournalReceiveMoney().pipe($e("response"),Fe(()=>i.hide()))};var tg=[{path:"",redirectTo:"journal-entry",pathMatch:"full"},{path:"journal-entry",children:[{path:"",component:fa},{path:"add",component:co,resolve:{form:uo}},{path:":id",component:Ua},{path:":id/edit",component:co,resolve:{form:uo}}]},{path:"record-expense",component:Ia,resolve:{form:ja}},{path:"receive-money",component:$a,resolve:{form:Ga}},{path:"journal-deposit",component:Na}];export{tg as JOURNAL_ROUTES};
|