(self.webpackChunkalvanon_analytics_platform_frontend=self.webpackChunkalvanon_analytics_platform_frontend||[]).push([[8197],{8610(e){var t;e.exports=(function(){var e={195:function(e){e.exports=function(e){function t(e,t){this.highOrder=e,this.lowOrder=t}var n,i,o,a,s,r,l,d,c,u,p=[new t(1779033703,4089235720),new t(3144134277,2227873595),new t(1013904242,4271175723),new t(2773480762,1595750129),new t(1359893119,2917565137),new t(2600822924,725511199),new t(528734635,4215389547),new t(1541459225,327033209)],f=[new t(1116352408,3609767458),new t(1899447441,602891725),new t(3049323471,3964484399),new t(3921009573,2173295548),new t(961987163,4081628472),new t(1508970993,3053834265),new t(2453635748,2937671579),new t(2870763221,3664609560),new t(3624381080,2734883394),new t(310598401,1164996542),new t(607225278,1323610764),new t(1426881987,3590304994),new t(1925078388,4068182383),new t(2162078206,991336113),new t(2614888103,633803317),new t(3248222580,3479774868),new t(3835390401,2666613458),new t(4022224774,944711139),new t(264347078,2341262773),new t(604807628,2007800933),new t(770255983,1495990901),new t(1249150122,1856431235),new t(1555081692,3175218132),new t(1996064986,2198950837),new t(2554220882,3999719339),new t(2821834349,766784016),new t(2952996808,2566594879),new t(3210313671,3203337956),new t(3336571891,1034457026),new t(3584528711,2466948901),new t(113926993,3758326383),new t(338241895,168717936),new t(666307205,1188179964),new t(773529912,1546045734),new t(1294757372,1522805485),new t(1396182291,2643833823),new t(1695183700,2343527390),new t(1986661051,1014477480),new t(2177026350,1206759142),new t(2456956037,344077627),new t(2730485921,1290863460),new t(2820302411,3158454273),new t(3259730800,3505952657),new t(3345764771,106217008),new t(3516065817,3606008344),new t(3600352804,1432725776),new t(4094571909,1467031594),new t(275423344,851169720),new t(430227734,3100823752),new t(506948616,1363258195),new t(659060556,3750685593),new t(883997877,3785050280),new t(958139571,3318307427),new t(1322822218,3812723403),new t(1537002063,2003034995),new t(1747873779,3602036899),new t(1955562222,1575990012),new t(2024104815,1125592928),new t(2227730452,2716904306),new t(2361852424,442776044),new t(2428436474,593698344),new t(2756734187,3733110249),new t(3204031479,2999351573),new t(3329325298,3815920427),new t(3391569614,3928383900),new t(3515267271,566280711),new t(3940187606,3454069534),new t(4118630271,4000239992),new t(116418474,1914138554),new t(174292421,2731055270),new t(289380356,3203993006),new t(460393269,320620315),new t(685471733,587496836),new t(852142971,1086792851),new t(1017036298,365543100),new t(1126000580,2618297676),new t(1288033470,3409855158),new t(1501505948,4234509866),new t(1607167915,987167468),new t(1816402316,1246189591)],h=new Array(64),m=8;function v(e){return unescape(encodeURIComponent(e))}function g(e){for(var t=[],n=(1<>5]|=(e.charCodeAt(o/m)&n)<<32-m-o%32;return t}function y(e){for(var t,n="0123456789abcdef",i="",o=4*e.length,a=0;a>2]>>8*(3-a%4),i+=n.charAt(t>>4&15)+n.charAt(15&t);return i}function b(e,n){var i,o,a;return i=(65535&e.lowOrder)+(65535&n.lowOrder),a=(65535&(o=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.highOrder)+(65535&n.highOrder)+(o>>>16),new t((65535&(o=(e.highOrder>>>16)+(n.highOrder>>>16)+(i>>>16)))<<16|65535&i,a)}function x(e,n,i,o){var a,s,r;return a=(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&i.lowOrder)+(65535&o.lowOrder),r=(65535&(s=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i.lowOrder>>>16)+(o.lowOrder>>>16)+(a>>>16)))<<16|65535&a,a=(65535&e.highOrder)+(65535&n.highOrder)+(65535&i.highOrder)+(65535&o.highOrder)+(s>>>16),new t((65535&(s=(e.highOrder>>>16)+(n.highOrder>>>16)+(i.highOrder>>>16)+(o.highOrder>>>16)+(a>>>16)))<<16|65535&a,r)}function w(e,n,i,o,a){var s,r,l;return s=(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&i.lowOrder)+(65535&o.lowOrder)+(65535&a.lowOrder),l=(65535&(r=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i.lowOrder>>>16)+(o.lowOrder>>>16)+(a.lowOrder>>>16)+(s>>>16)))<<16|65535&s,s=(65535&e.highOrder)+(65535&n.highOrder)+(65535&i.highOrder)+(65535&o.highOrder)+(65535&a.highOrder)+(r>>>16),new t((65535&(r=(e.highOrder>>>16)+(n.highOrder>>>16)+(i.highOrder>>>16)+(o.highOrder>>>16)+(a.highOrder>>>16)+(s>>>16)))<<16|65535&s,l)}function L(e,n,i){return new t(e.highOrder&n.highOrder^e.highOrder&i.highOrder^n.highOrder&i.highOrder,e.lowOrder&n.lowOrder^e.lowOrder&i.lowOrder^n.lowOrder&i.lowOrder)}function j(e,n,i){return new t(e.highOrder&n.highOrder^~e.highOrder&i.highOrder,e.lowOrder&n.lowOrder^~e.lowOrder&i.lowOrder)}function E(e,n){return n<=32?new t(e.highOrder>>>n|e.lowOrder<<32-n,e.lowOrder>>>n|e.highOrder<<32-n):new t(e.lowOrder>>>n|e.highOrder<<32-n,e.highOrder>>>n|e.lowOrder<<32-n)}function C(e){var n=E(e,28),i=E(e,34),o=E(e,39);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function T(e){var n=E(e,14),i=E(e,18),o=E(e,41);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function k(e){var n=E(e,1),i=E(e,8),o=O(e,7);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function A(e){var n=E(e,19),i=E(e,61),o=O(e,6);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function O(e,n){return n<=32?new t(e.highOrder>>>n,e.lowOrder>>>n|e.highOrder<<32-n):new t(0,e.highOrder<<32-n)}var N=(e=v(e)).length*m;(e=g(e))[N>>5]|=128<<24-N%32,e[31+(N+128>>10<<5)]=N;for(var D=0;D=0&&window.jSuitesStateControl.splice(n,1)}},a={two:function(e){return 1==(e=""+e).length&&(e="0"+e),e},focus:function(e){if(e.textContent.length){const t=document.createRange(),n=window.getSelection();let i=e;for(;i.lastChild;)i=i.lastChild;i.nodeType===Node.TEXT_NODE?t.setStart(i,i.length):t.setStart(i,i.childNodes.length),t.collapse(!0),n.removeAllRanges(),n.addRange(t),e.scrollLeft=e.scrollWidth}},isNumeric:function(e){return"string"==typeof e&&(e=e.trim()),!isNaN(e)&&null!==e&&""!==e},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},getNode:function(){var e=document.getSelection().anchorNode;return e?3==e.nodeType?e.parentNode:e:null},hash:function(e){var t,n,i=0;if(0===e.length)return i;for(t=0;t32&&(i=(i<<5)-i+n,i|=0);return i},randomColor:function(e){var t=String("#"+Math.random().toString(16).slice(2,8).toUpperCase()).replace(/[^0-9a-f]/gi,"");t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var n,i,o=[];for(i=0;i<3;i++)n=parseInt(t.substr(2*i,2),16),n=Math.round(Math.min(Math.max(0,n+-.25*n),255)).toString(16),o.push(("00"+n).substr(n.length));return 1==e?"#"+a.two(o[0].toString(16))+a.two(o[1].toString(16))+a.two(o[2].toString(16)):o},getWindowWidth:function(){var e=window,t=document,n=t.documentElement,i=t.getElementsByTagName("body")[0];return e.innerWidth||n.clientWidth||i.clientWidth},getWindowHeight:function(){var e=window,t=document,n=t.documentElement,i=t.getElementsByTagName("body")[0];return e.innerHeight||n.clientHeight||i.clientHeight},getPosition:function(e){if(e.changedTouches&&e.changedTouches[0])var t=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY;else t=window.Event?e.pageX:e.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft),n=window.Event?e.pageY:e.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);return[t,n]},click:function(e){if(e.click)e.click();else{var t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)}},findElement:function(e,t){var n=!1;return function e(i){i&&!n&&("function"==typeof t?n=t(i):"string"==typeof t&&i.classList&&i.classList.contains(t)&&(n=i)),i.parentNode&&!n&&e(i.parentNode)}(e),n}},s=a;const r=function(e){return"object"==typeof e||"function"==typeof e};function l(e,t,n){if("string"!=typeof e||0===e.length)return;const i=e.split(".");if(0===i.length)return;let o=this;if(void 0===t&&void 0===n){for(let e=0;ee.offsetX;else var t=e.target.clientHeight/2>e.offsetY;t?e.target.parentNode.insertBefore(o.element,e.target):e.target.parentNode.insertBefore(o.element,e.target.nextSibling),o.d=Array.prototype.indexOf.call(e.target.parentNode.children,o.element)}}),e.addEventListener("dragleave",function(e){e.preventDefault()}),e.addEventListener("dragend",function(t){t.preventDefault(),o&&("function"==typeof n.options.ondragend&&n.options.ondragend(e,o.element,t),o.o=e.scrollHeight?t.loadDown()&&(a==e.scrollTop&&(e.scrollTop=e.scrollTop-e.clientHeight),o=!0):e.scrollTop<=e.clientHeight&&t.loadUp()&&(a==e.scrollTop&&(e.scrollTop=e.scrollTop+e.clientHeight),o=!0),n=setTimeout(function(){n=null},t.timer),o&&"function"==typeof t.onupdate&&t.onupdate()}};return e.onscroll=function(e){i()},e.onwheel=function(e){i()},{}}var u,p=((u=function(e,t){if(Array.isArray(e)){var n={instance:[],complete:t};if(e.length>0)for(var i=0;i=200&&d.status<300)if("json"===e.dataType)try{var t=JSON.parse(d.responseText);e.success&&"function"==typeof e.success&&e.success(t)}catch(n){e.error&&"function"==typeof e.error&&e.error(n,t)}else t="blob"===e.dataType?d.response:d.responseText,e.success&&"function"==typeof e.success&&e.success(t);else e.error&&"function"==typeof e.error&&e.error(d.responseText,d.status);if(u.queue&&u.queue.length>0&&u.send(u.queue.shift()),u.requests&&u.requests.length){var n=u.requests.indexOf(d);u.requests.splice(n,1),u.requests.length||e.complete&&"function"==typeof e.complete&&e.complete(t),e.group&&u.oncomplete&&"function"==typeof u.oncomplete[e.group]&&(u.pending(e.group)||(u.oncomplete[e.group](),u.oncomplete[e.group]=null)),e.multiple&&e.multiple.instance&&(n=e.multiple.instance.indexOf(d),e.multiple.instance.splice(n,1),e.multiple.instance.length||e.multiple.complete&&"function"==typeof e.multiple.complete&&e.multiple.complete(t))}},d.options=e,d.data=r,!0===e.queue&&u.requests.length>0?u.queue.push(d):u.send(d),d}).send=function(e){e.data?Array.isArray(e.data)?e.send(e.data.join("&")):e.send(e.data):e.send(),u.requests.push(e)},u.exists=function(e,t){var n=new XMLHttpRequest;n.open("HEAD",e,!1),n.send(),n.status&&t(n.status)},u.pending=function(e){var t=0,n=u.requests;if(n&&n.length)for(var i=0;i0&&setTimeout(function(){e.loading.hide()},1e3*t)},e.loading.hide=function(){e.loading.element&&e.loading.element.parentNode&&document.body.removeChild(e.loading.element)},e.slideLeft=function(e,t,n){1==t?(e.classList.add("jslide-left-in"),setTimeout(function(){e.classList.remove("jslide-left-in"),"function"==typeof n&&n()},400)):(e.classList.add("jslide-left-out"),setTimeout(function(){e.classList.remove("jslide-left-out"),"function"==typeof n&&n()},400))},e.slideRight=function(e,t,n){!0===t?(e.classList.add("jslide-right-in"),setTimeout(function(){e.classList.remove("jslide-right-in"),"function"==typeof n&&n()},400)):(e.classList.add("jslide-right-out"),setTimeout(function(){e.classList.remove("jslide-right-out"),"function"==typeof n&&n()},400))},e.slideTop=function(e,t,n){!0===t?(e.classList.add("jslide-top-in"),setTimeout(function(){e.classList.remove("jslide-top-in"),"function"==typeof n&&n()},400)):(e.classList.add("jslide-top-out"),setTimeout(function(){e.classList.remove("jslide-top-out"),"function"==typeof n&&n()},400))},e.slideBottom=function(e,t,n){!0===t?(e.classList.add("jslide-bottom-in"),setTimeout(function(){e.classList.remove("jslide-bottom-in"),"function"==typeof n&&n()},400)):(e.classList.add("jslide-bottom-out"),setTimeout(function(){e.classList.remove("jslide-bottom-out"),"function"==typeof n&&n()},100))},e.fadeIn=function(e,t){e.style.display="",e.classList.add("jfade-in"),setTimeout(function(){e.classList.remove("jfade-in"),"function"==typeof t&&t()},2e3)},e.fadeOut=function(e,t){e.classList.add("jfade-out"),setTimeout(function(){e.style.display="none",e.classList.remove("jfade-out"),"function"==typeof t&&t()},1e3)},e}();var h=function(){var t={now:function(e,t){var n=null,i=null,o=null,a=null,r=null,l=null;return Array.isArray(e)?(n=e[0],i=e[1],o=e[2],a=e[3],r=e[4],l=e[5]):(e||(e=new Date),n=e.getFullYear(),i=e.getMonth()+1,o=e.getDate(),a=e.getHours(),r=e.getMinutes(),l=e.getSeconds()),1==t?s.two(n)+"-"+s.two(i)+"-"+s.two(o):s.two(n)+"-"+s.two(i)+"-"+s.two(o)+" "+s.two(a)+":"+s.two(r)+":"+s.two(l)},toArray:function(e){var t=(n=e.split(-1!==e.indexOf("T")?"T":" "))[1],n=n[0].split("-"),i=parseInt(n[0]),o=parseInt(n[1]),a=parseInt(n[2]),s=0,r=0;return t&&(t=t.split(":"),s=parseInt(t[0]),r=parseInt(t[1])),[i,o,a,s,r,0]}},n=Date.UTC(1900,0,0),i=Date.UTC(1900,1,29),o=864e5;t.dateToNum=function(e){"string"==typeof e&&(e=new Date(e+" GMT+0"));var t=e.getTime();return t>=i&&(t+=o),(t-=n)/o},t.numToDate=function(e){var a=n+e*o;a>=i&&(a-=o);const s=new Date(a);var r=[s.getUTCFullYear(),s.getUTCMonth()+1,s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds()];return t.now(r)};let a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=["January","February","March","April","May","June","July","August","September","October","November","December"];return Object.defineProperty(t,"weekdays",{get:function(){return a.map(function(t){return e.translate(t)})}}),Object.defineProperty(t,"weekdaysShort",{get:function(){return a.map(function(t){return e.translate(t).substring(0,3)})}}),Object.defineProperty(t,"months",{get:function(){return r.map(function(t){return e.translate(t)})}}),Object.defineProperty(t,"monthsShort",{get:function(){return r.map(function(t){return e.translate(t).substring(0,3)})}}),t}();var m=function(){var e={text:["@"],currency:["#(.{1})##0?(.{1}0+)?( ?;(.*)?)?","#"],scientific:["0{1}(.{1}0+)?E{1}\\+0+"],percentage:["0{1}(.{1}0+)?%"],numeric:["0{1}(.{1}0+)?"],datetime:["YYYY","YYY","YY","MMMMM","MMMM","MMM","MM","DDDDD","DDDD","DDD","DD","DY","DAY","WD","D","Q","MONTH","MON","HH24","HH12","HH","\\[H\\]","H","AM/PM","MI","SS","MS","Y","M"],general:["A","0","[0-9a-zA-Z$]+","."]},n=function(){if(-1!==this.mask.toLowerCase().indexOf("[h]")){var e=0;this.date[4]&&(e=parseFloat(this.date[4]/60));var t=parseInt(this.date[3])+e;t/=24}else this.date[0]&&this.date[1]&&this.date[2]||!this.date[3]&&!this.date[4]?(this.date[0]&&this.date[1]&&!this.date[2]&&(this.date[2]=1),t=s.two(this.date[0])+"-"+s.two(this.date[1])+"-"+s.two(this.date[2]),(this.date[3]||this.date[4]||this.date[5])&&(t+=" "+s.two(this.date[3])+":"+s.two(this.date[4])+":"+s.two(this.date[5]))):t=s.two(this.date[3])+":"+s.two(this.date[4])+":"+s.two(this.date[5]);return t},i=function(){var e="";if(this.date[0]&&this.date[1]&&this.date[2]||!this.date[3]&&!this.date[4]){if(this.date[0]||this.date[1]||this.date[2]||this.date[3]||this.date[4]||this.date[5]){this.date[0]&&this.date[1]&&!this.date[2]&&(this.date[2]=1);var t=h.now(this.date);e=h.dateToNum(t)}}else{if(-1!==this.mask.toLowerCase().indexOf("[h]"))e=parseInt(this.date[3]);else{let t=parseInt(this.date[3]);e=t<13&&-1!==this.values.indexOf("PM")?(t+12)%24:t%24}this.date[4]&&(e+=parseFloat(this.date[4]/60)),this.date[5]&&(e+=parseFloat(this.date[5]/3600)),e/=24}return isNaN(e)&&(e=""),e},o=function(e){return null===e||""===e||void 0===e},a=function(e){return"currency"===e||"percentage"===e||"scientific"===e||"numeric"===e},r=function(e){if(e&&Number(e)==e)return".";if(this.options.decimal)return this.options.decimal;if(this.locale){var t=Intl.NumberFormat(this.locale).format(1.1);return this.options.decimal=t[1]}return e||(e=this.mask),(t=new RegExp("0{1}(.{1})0+","ig").exec(e))&&t[1]&&1==t[1].length?(this.options.decimal=t[1],t[1]):((t=new RegExp("#{1}(.{1})#+","ig").exec(e))&&t[1]&&1==t[1].length?","===t[1]?this.options.decimal=".":this.options.decimal=",":this.options.decimal="1.1".toLocaleString().substring(1,2),this.options.decimal?this.options.decimal:null)},l=function(e,t){if(""==e)return"";t||(t=r.call(this));var n=(e=(""+e).split(t))[0].match(/[-]+/g);return n=!(!n||!n.length),e[0]=e[0].match(/[0-9]+/g),e[0]?(n&&e[0].unshift("-"),e[0]=e[0].join("")):n&&(e[0]="-"),e[0]||e[1]?(void 0!==e[1]&&(e[1]=e[1].match(/[0-9]+/g),e[1]?e[1]=e[1].join(""):e[1]=""),e):""},d=function(e,t){if(""===e)return"";var n=r.call(this),i=this.options;if(""===(e=l.call(this,e)))return"";var o=null;if(e[0]&&(o="percent"===i.style?parseFloat(e[0])/100:parseFloat(e[0]+".1")),("-"===e[0]||"-00"===e[0])&&!e[1]&&t&&"deleteContentBackward"==t.inputType)return"";var a=new Intl.NumberFormat(this.locale,i).format(o);if(a=a.split(n),"percent"===i.style&&-1!==a[0].indexOf("%")&&(a[0]=a[0].replace("%",""),a[2]="%"),void 0!==a[1]){var s=a[1].replace(/[0-9]*/g,"");s&&(a[2]=s)}return void 0!==e[1]?a[1]=n+e[1]:a[1]="",a.join("")},c=function(e,t){var n=f.call(e);if(n){var i=d.call(this,n,t),o=i.length-n.length,a=p.call(e)+o;f.call(e,i,a,!0)}},u=function(e){var t=l.call(this,e);return t?("-"===t[0]&&(t[0]="-0"),parseFloat(t.join("."))):null},p=function(e,t){if(void 0===e){if("DIV"==this.tagName){var n=0;return(s=window.getSelection())&&0!==s.rangeCount&&((o=(r=s.getRangeAt(0)).cloneRange()).selectNodeContents(this),o.setEnd(r.endContainer,r.endOffset),n=o.toString().length),n}return this.selectionStart}var i=f.call(this);if(t){for(var o=null,a=0;a=o&&(e=o+1)}if(e>i.length&&(e=i.length),e)if("DIV"==this.tagName){var s=window.getSelection(),r=document.createRange();this.childNodes[0]&&(r.setStart(this.childNodes[0],e),s.removeAllRanges(),s.addRange(r))}else this.selectionStart=e,this.selectionEnd=e},f=function(e,t,n){if("DIV"==this.tagName){if(void 0===e)return e=this.innerText,this.value&&this.value.length>e.length&&(e=this.value),e;this.innerText!==e&&(this.innerText=e,t&&p.call(this,t,n))}else{if(void 0===e)return this.value;this.value!==e&&(this.value=e,t&&p.call(this,t,n))}},m=h.weekdays,v=h.weekdaysShort,g=h.months,y=h.monthsShort,b={YEAR:function(e,t){var n=""+(new Date).getFullYear();void 0===this.values[this.index]&&(this.values[this.index]=""),parseInt(e)>=0&&parseInt(e)<=10&&this.values[this.index].length-1)this.values[this.index]+=e;else{for(var n=0,i=0,a=(this.values[this.index]+e).toLowerCase(),s=0;s1)this.values[this.index]+=e;else if(1==i){var r=t[n].length-this.values[this.index].length-1;return this.position+=r,this.values[this.index]=t[n],this.index++,n}}},MMM:function(e){var t=b.FIND.call(this,e,y);void 0!==t&&(this.date[1]=t+1)},MON:function(e){b.MMM.call(this,e)},MMMM:function(e){var t=b.FIND.call(this,e,g);void 0!==t&&(this.date[1]=t+1)},MONTH:function(e){b.MMMM.call(this,e)},MMMMM:function(e){o(this.values[this.index])&&(this.values[this.index]="");for(var t=(this.values[this.index]+e).toLowerCase(),n=0;n1&&parseInt(e)<10?(this.date[1]=this.values[this.index]="0"+e,this.index++):parseInt(e)<2&&(this.values[this.index]=e):(1==this.values[this.index]&&parseInt(e)<3||0==this.values[this.index]&&parseInt(e)>0&&parseInt(e)<10)&&(this.date[1]=this.values[this.index]+=e,this.index++)},M:function(e){var t=!1;if(parseInt(e)>=0&&parseInt(e)<10?o(this.values[this.index])?(this.values[this.index]=e,e>1&&(this.date[1]=this.values[this.index],this.index++)):1==this.values[this.index]&&parseInt(e)<3||0==this.values[this.index]&&parseInt(e)>0?(this.date[1]=this.values[this.index]+=e,this.index++):t=!0:t=!0,1==t){var n=parseInt(this.values[this.index]);n>0&&n<12&&(this.date[1]=this.values[this.index],this.index++,this.position--)}},D:function(e){var t=!1;if(parseInt(e)>=0&&parseInt(e)<10?o(this.values[this.index])?(this.values[this.index]=e,parseInt(e)>3&&(this.date[2]=this.values[this.index],this.index++)):3==this.values[this.index]&&parseInt(e)<2||1==this.values[this.index]||2==this.values[this.index]||0==this.values[this.index]&&parseInt(e)>0?(this.date[2]=this.values[this.index]+=e,this.index++):t=!0:t=!0,1==t){var n=parseInt(this.values[this.index]);n>0&&n<32&&(this.date[2]=this.values[this.index],this.index++,this.position--)}},DD:function(e){o(this.values[this.index])?parseInt(e)>3&&parseInt(e)<10?(this.date[2]=this.values[this.index]="0"+e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):(3==this.values[this.index]&&parseInt(e)<2||(1==this.values[this.index]||2==this.values[this.index])&&parseInt(e)<10||0==this.values[this.index]&&parseInt(e)>0&&parseInt(e)<10)&&(this.date[2]=this.values[this.index]+=e,this.index++)},DDD:function(e){b.FIND.call(this,e,v)},DY:function(e){b.DDD.call(this,e)},DDDD:function(e){b.FIND.call(this,e,m)},DAY:function(e){b.DDDD.call(this,e)},HH12:function(e,t){var n=!1;if(parseInt(e)>=0&&parseInt(e)<10?o(this.values[this.index])?parseInt(e)>1&&parseInt(e)<10?(t&&(e=0+e),this.date[3]=this.values[this.index]=e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):1==this.values[this.index]&&parseInt(e)<3||this.values[this.index]<1&&parseInt(e)<10?(this.date[3]=this.values[this.index]+=e,this.index++):n=!0:n=!0,1==n){var i=parseInt(this.values[this.index]);i>=0&&i<=12&&(this.date[3]=this.values[this.index],this.index++,this.position--)}},HH24:function(e,t){var n=!1;if(parseInt(e)>=0&&parseInt(e)<10?null==this.values[this.index]||""==this.values[this.index]?parseInt(e)>2&&parseInt(e)<10?(t&&(e=0+e),this.date[3]=this.values[this.index]=e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):2==this.values[this.index]&&parseInt(e)<4||this.values[this.index]<2&&parseInt(e)<10?(t||"0"!==this.values[this.index]||(this.values[this.index]=""),this.date[3]=this.values[this.index]+=e,this.index++):n=!0:n=!0,1==n){var i=parseInt(this.values[this.index]);i>=0&&i<24&&(this.date[3]=this.values[this.index],this.index++,this.position--)}},HH:function(e){b.HH24.call(this,e,1)},H:function(e){b.HH24.call(this,e,0)},"\\[H\\]":function(e){null==this.values[this.index]&&(this.values[this.index]=""),e.match(/[0-9]/g)?this.date[3]=this.values[this.index]+=e:this.values[this.index].match(/[0-9]/g)&&(this.date[3]=this.values[this.index],this.index++,this.position--)},N60:function(e,t){null==this.values[this.index]||""==this.values[this.index]?parseInt(e)>5&&parseInt(e)<10?(this.date[t]=this.values[this.index]="0"+e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):parseInt(e)<10&&(this.date[t]=this.values[this.index]+=e,this.index++)},MI:function(e){b.N60.call(this,e,4)},SS:function(e){b.N60.call(this,e,5)},"AM/PM":function(e){void 0===this.values[this.index]&&(this.values[this.index]=""),""===this.values[this.index]?e.match(/a/i)&&this.date[3]<13?this.values[this.index]+="A":e.match(/p/i)&&(this.values[this.index]+="P"):"A"!==this.values[this.index]&&"P"!==this.values[this.index]||(this.values[this.index]+="M",this.index++)},WD:function(e){void 0===this.values[this.index]&&(this.values[this.index]=""),parseInt(e)>=0&&parseInt(e)<7&&(this.values[this.index]=e),1==this.values[this.index].length&&this.index++},"0{1}(.{1}0+)?":function(e){var t=r.call(this),n=!1;o(this.values[this.index])?this.values[this.index]="":"-"==this.values[this.index]&&(n=!0);var i=l.call(this,this.values[this.index],t);i&&(this.values[this.index]=i.join(t)),parseInt(e)>=0&&parseInt(e)<10?("0"==this.values[this.index]&&e>0?this.values[this.index]="":"-0"==this.values[this.index]&&e>0&&(this.values[this.index]="-"),("0"!=this.values[this.index]&&"-0"!=this.values[this.index]||e==t)&&(this.values[this.index]+=e)):t&&e==t?-1==this.values[this.index].indexOf(t)&&(this.values[this.index]||(this.values[this.index]="0"),this.values[this.index]+=e):"-"==e&&(n=!0),!0===n&&"-"!==this.values[this.index][0]&&(this.values[this.index]="-"+this.values[this.index])},"0{1}(.{1}0+)?E{1}\\+0+":function(e){b["0{1}(.{1}0+)?"].call(this,e)},"0{1}(.{1}0+)?%":function(e){b["0{1}(.{1}0+)?"].call(this,e),this.values[this.index].match(/[\-0-9]/g)?this.values[this.index]&&-1==this.values[this.index].indexOf("%")&&(this.values[this.index]+="%"):this.values[this.index]=""},"#(.{1})##0?(.{1}0+)?( ?;(.*)?)?":function(e){b["0{1}(.{1}0+)?"].call(this,e);var t=r.call(this),n=this.tokens[this.index].substr(1,1),i="-"===this.values[this.index][0],o=l.call(this,this.values[this.index],t);if(""!==o){var a=o[0].match(/[0-9]/g);if(a){for(var s=[],d=0,c=(a=a.join("")).length-1;c>=0;c--)s.push(a[c]),++d%3||s.push(n);s=s.reverse(),o[0]=s.join(""),o[0].substr(0,1)==n&&(o[0]=o[0].substr(1))}else o[0]="";this.values[this.index]=o.join(t),i&&(this.values[this.index]="-"+this.values[this.index])}},0:function(e){e.match(/[0-9]/g)&&(this.values[this.index]=e,this.index++)},"[0-9a-zA-Z$]+":function(e){o(this.values[this.index])&&(this.values[this.index]="");var t=this.tokens[this.index];t[this.values[this.index].length]==e?(this.values[this.index]+=e,this.values[this.index]==t&&this.index++):(this.values[this.index]=t,this.index++,e.match(/[\-0-9]/g)&&this.position--)},A:function(e){e.match(/[a-zA-Z]/gi)&&(this.values[this.index]=e,this.index++)},".":function(e){b["[0-9a-zA-Z$]+"].call(this,e)},"@":function(e){o(this.values[this.index])&&(this.values[this.index]=""),this.values[this.index]+=e}},x=function(t){if("general"==this.type)var n=[].concat(e.general);else n=[].concat(e.currency,e.datetime,e.percentage,e.scientific,e.numeric,e.text,e.general);var i=new RegExp(n.join("|"),"gi");return t.match(i)},w=function(t){if(this.type)n="text"==this.type?["text"]:"general"==this.type?["general"]:"datetime"==this.type?["numeric","datetime","general"]:["currency","percentage","scientific","numeric","general"];else var n=Object.keys(e);for(var i=0;i=0||t[n-2]&&t[n-2].indexOf("H")>=0||t[n+1]&&t[n+1].indexOf("S")>=0||t[n+2]&&t[n+2].indexOf("S")>=0)&&(t[n]="MI");return t},j=function(e){var t=w.call(this,e);if(t)var n=t.type;if(n){for(var i=0,o=x.call(this,e),s=0;s1&&(n="general")}return n},E=function(){"function"==typeof b[this.methods[this.index]]?(b[this.methods[this.index]].call(this,this.value[this.position]),this.position++):(this.values[this.index]=this.tokens[this.index],this.index++)},C=function(e){return(""+ +e).replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(e,t,n,i,o){return o<0?t+"0."+Array(1-o-n.length).join(0)+n+i:t+n+i+Array(o-i.length+1).join(0)})},T=function(e,t,i){var o=null,l={input:null,value:null,options:{},values:[],index:0,position:0,date:[0,0,0,0,0,0],number:0};if("object"==typeof e){if(l.input=e.target,l.value=f.call(e.target),l.caret=p.call(e.target),(o=e.target.getAttribute("data-mask"))&&(l.mask=o),(o=e.target.getAttribute("data-type"))&&(l.type=o),e.target.mask?(e.target.mask.options&&(l.options=e.target.mask.options),e.target.mask.locale&&(l.locale=e.target.mask.locale)):(o=e.target.getAttribute("data-locale"))&&(l.locale=o,l.mask&&(l.options.style=l.mask)),e.target.attributes&&e.target.attributes.length)for(var h=0;h0)var C=l.caret+o;else C=l.caret;f.call(l.input,y,C,b)}}if(l.input){var k=null;if(a(l.type)){let e=f.call(l.input);l.number=u.call(l,e),k="percentage"==l.type&&-1!==(""+e).indexOf("%")?T.adjustPrecision(l.number/100):l.number}else"datetime"==l.type&&(k=n.call(l),l.date[0]&&l.date[1]&&l.date[2]&&l.input.setAttribute("data-completed",!0));k&&l.input.setAttribute("data-value",k)}if(void 0!==y)return i?l:y}};return T.adjustPrecision=function(e){if("number"==typeof e&&!Number.isInteger(e)){const t=e.toString().split(".");if(t[1]&&t[1].length>10){let n=0;const i=t[1][t[1].length-2];if(0==i||9==i){for(let e=t[1].length-2;e>0;e--){if(!(n>=0&&t[1][e]==i)){n=0;break}if(n++,n>6)break}if(n)return parseFloat(parseFloat(e).toFixed(t[1].length-1))}}}return e},T.getType=j,T.prepare=function(e,t){return t||(t={}),x.call(t,e)},T.apply=function(e){var t=f.call(e.target);1==e.key.length&&(t+=e.key),f.call(e.target,T(t,e.target.getAttribute("data-mask")))},T.run=function(e,t,n){return T(e,{mask:t,decimal:n})},T.extract=function(e,t,n){if(o(e))return e;if("object"!=typeof t)return e;if((t=Object.assign({},t)).options||(t.options={}),!t.mask&&t.format&&(t.mask=t.format),t.mask){if(-1!==t.mask.indexOf(";")){var a=t.mask.split(";");t.mask=a[0]}t.mask=t.mask.replace(new RegExp(/\[h]/),"|h|"),t.mask=t.mask.replace(new RegExp(/\[.*?\]/),""),t.mask=t.mask.replace(new RegExp(/\|h\|/),"[h]")}r.call(t,t.mask);var l=null,d=null;if("percent"==t.type||"percent"==t.options.style?l="percentage":t.mask&&(l=j.call(t,t.mask)),"text"===l){var c={};d=e}else"general"===l?(c=T(e,t,!0),d=e):"datetime"===l?(e instanceof Date&&(e=T.getDateString(e,t.mask)),c=T(e,t,!0),d=s.isNumeric(e)?e:i.call(c)):"scientific"===l?(d=e,"string"==typeof e&&(d=Number(d)),c=t):(d=u.call(t,e),"percentage"===l&&-1!==(""+e).indexOf("%")&&(d/=100),c=t);return c.value=d,!c.type&&l&&(c.type=l),n?c:d},T.render=function(e,n,i,a){if(o(e))return e;if("object"!=typeof n)return e;if((n=Object.assign({},n)).options||(n.options={}),!n.mask&&n.format&&(n.mask=n.format),n.mask){if(-1!==n.mask.indexOf(";")){var s=n.mask.split(";");i||(s[0]=s[0].replace(new RegExp(/_\)/g),""),s[0]=s[0].replace(new RegExp(/_\(/g),"")),n.mask=s[0]}n.mask=n.mask.replace(new RegExp(/\[h]/),"|h|"),n.mask=n.mask.replace(new RegExp(/\[.*?\]/),""),n.mask=n.mask.replace(new RegExp(/\|h\|/),"[h]")}var l=null;"percent"==n.type||"percent"==n.options.style?l="percentage":n.mask?l=j.call(n,n.mask):e instanceof Date&&(l="datetime");var d=!1;if("datetime"==l||"calendar"==n.type)(s=T.getDateString(e,n.mask))&&(e=s),n.mask&&i&&(d=!0);else if("text"===l)"number"==typeof e&&(e=e.toString());else if("string"==typeof e&&t.isNumeric(e)&&(e=Number(e)),"percentage"===l&&(e=T.adjustPrecision(100*e)),"number"==typeof e){if(s=null,n.mask&&i){var c=r.call(n,n.mask);if("scientific"===l)if(-1!==n.mask.indexOf(c)){let t=n.mask.split("E");t=t[0].split(c),t=""+t[1].match(/[0-9]+/g),t=t.length,s=e.toExponential(t)}else s=e.toExponential(0);else{if(-1!==n.mask.indexOf(c)){c=(c=""+(c=n.mask.split(c))[1].match(/[0-9]+/g)).length,s=e.toFixed(c);let t=e.toString().split("."),i=t[1];i&&i.length>c&&"5"===i[i.length-1]&&(s=parseFloat(t[0]+"."+i+"1").toFixed(c))}else s=e.toFixed(0);-1!==(""+s).indexOf("e")&&(s=C(s))}}else if(n.locale&&i){if(c=(""+e).split("."),n.options){void 0===c[1]&&(c[1]="");var u=c[1].length;if(n.options.minimumFractionDigits>u)for(var p=0;p0)for(p=0;p3)for(e=""+e;e.length0&&Number(e)==e&&(n.values.join("")!==n.value||"numeric"==n.type)){var i=new Date(Math.round(86400*(e-25569)*1e3));return i.getFullYear()+"-"+s.two(i.getMonth())+"-"+s.two(i.getDate())+" 00:00:00"}var o=!1;return n.values&&n.values.length===n.tokens.length&&n.values[n.values.length-1].length>=n.tokens[n.tokens.length-1].length&&(o=!0),n.date[0]&&n.date[1]&&(n.date[2]||o)?(n.date[2]||(n.date[2]=1),n.date[0]+"-"+s.two(n.date[1])+"-"+s.two(n.date[2])+" "+s.two(n.date[3])+":"+s.two(n.date[4])+":"+s.two(n.date[5])):""},T.getDateString=function(e,t){if(t||(t={}),t&&"object"==typeof t)if(t.format)var n=t.format;else t.mask&&(n=t.mask);else n=t;if(n||(n="YYYY-MM-DD"),n.indexOf("[h]")>=0){var i=0;if(e&&s.isNumeric(e)&&(i=parseFloat(24*Number(e)),n.indexOf("mm")>=0)){if((u=(""+i).split("."))[1]){var o=60*parseFloat("0."+u[1]);o=parseFloat(o.toFixed(2))}else o=0;i=parseInt(u[0])+":"+s.two(o)}return i}e instanceof Date?e=h.now(e):e&&s.isNumeric(e)&&(e=h.numToDate(e));for(var a=new RegExp(["DAY","WD","DDDD","DDD","DD","D","Q","HH24","HH12","HH","H","AM/PM","MI","SS","MS","YYYY","YYY","YY","Y","MONTH","MON","MMMMM","MMMM","MMM","MM","M","."].join("|"),"gi"),r=n.match(a),l=0;l=0||r[l-2]&&r[l-2].toUpperCase().indexOf("H")>=0||r[l+1]&&r[l+1].toUpperCase().indexOf("S")>=0||r[l+2]&&r[l+2].toUpperCase().indexOf("S")>=0)&&(r[l]="mi");var d={tokens:r};if(e){var c=-1!==(o=""+e).indexOf("T")?"T":" ",u=0,p=0,f=0;(o=o.split(c))[1]&&(p=(u=o[1].split(":"))[1]?u[1]:0,f=u[2]?u[2]:0,u=u[0]?u[0]:0),o=o[0].split("-");let t=new Date(o[0],o[1],0).getDate();if(o[0]&&o[1]&&o[2]&&o[0]>0&&o[1]>0&&o[1]<13&&o[2]>0&&o[2]<=t){d.data=[o[0],o[1],o[2],u,p,f],d.value=[];var m=new Date(d.data[0],d.data[1]-1,d.data[2],d.data[3],d.data[4],d.data[5]),v=function(e){var t=this.tokens[e],n=t.toUpperCase(),i=null;"YYYY"===n?i=this.data[0]:"YYY"===n?i=this.data[0].substring(1,4):"YY"===n?i=this.data[0].substring(2,4):"Y"===n?i=this.data[0].substring(3,4):"MON"===t?i=h.months[m.getMonth()].substr(0,3).toUpperCase():"mon"===t?i=h.months[m.getMonth()].substr(0,3).toLowerCase():"MONTH"===t?i=h.months[m.getMonth()].toUpperCase():"month"===t?i=h.months[m.getMonth()].toLowerCase():"MMMMM"===n?i=h.months[m.getMonth()].substr(0,1):"MMMM"===n||"Month"===t?i=h.months[m.getMonth()]:"MMM"===n||"Mon"==t?i=h.months[m.getMonth()].substr(0,3):"MM"===n?i=s.two(this.data[1]):"M"===n?i=m.getMonth()+1:"DAY"===t?i=h.weekdays[m.getDay()].toUpperCase():"day"===t?i=h.weekdays[m.getDay()].toLowerCase():"DDDD"===n||"Day"==t?i=h.weekdays[m.getDay()]:"DDD"===n?i=h.weekdays[m.getDay()].substr(0,3):"DD"===n?i=s.two(this.data[2]):"D"===n?i=parseInt(this.data[2]):"Q"===n?i=Math.floor((m.getMonth()+3)/3):"HH24"===n||"HH"===n?((i=this.data[3])>12&&-1!==this.tokens.indexOf("am/pm")&&(i-=12),i=s.two(i)):"HH12"===n?i=this.data[3]>12?s.two(this.data[3]-12):s.two(this.data[3]):"H"===n?(i=this.data[3])>12&&-1!==this.tokens.indexOf("am/pm")&&(i-=12,i=s.two(i)):"MI"===n?i=s.two(this.data[4]):"SS"===n?i=s.two(this.data[5]):"MS"===n?i=m.getMilliseconds():"AM/PM"===n?i=this.data[3]>=12?"PM":"AM":"WD"===n&&(i=h.weekdays[m.getDay()]),this.value[e]=null===i?this.tokens[e]:i};for(l=0;l0&&(a.options.value=t.numToDate(a.options.value),a.options.dataType="numeric"),u.innerHTML=a.options.textReset,p.innerHTML=a.options.textDone,E.innerHTML=a.options.textUpdate,a.options.format&&i.setAttribute("data-mask",a.options.format.toLowerCase()),!a.options.value&&a.options.today)var d=t.now();else d=a.options.value;return d&&(a.options.value=null,a.setValue(d)),a},open:function(e){if(!c.classList.contains("jcalendar-focus")&&!c.classList.contains("jcalendar-inline")){if(t.current=a,n(a,!0),a.getDays(),"year-month-picker"==a.options.type&&a.getMonths(),a.options.time&&(C.value=a.date[3],T.value=a.date[4]),c.classList.add("jcalendar-focus"),s.getWindowWidth()<800||a.options.fullscreen)c.classList.add("jcalendar-fullsize"),f.slideBottom(v,1);else{c.classList.remove("jcalendar-fullsize");var o=i.getBoundingClientRect(),r=v.getBoundingClientRect();if(a.options.position)m.style.position="fixed",window.innerHeight11?(a.date[0]=parseInt(a.date[0])+1,a.date[1]=1):a.date[1]=parseInt(a.date[1])+1,a.getDays())},setToday:function(){var e=(new Date).toISOString().substr(0,10);return a.setValue(e),e},setValue:function(n){n||(n=""+n);var o=n,s=a.options.value;if(s!=o){if(o){a.setLabel(o,a.options),(l=o.split(" "))[1]||(l[1]="00:00:00");var r=l[1].split(":"),l=l[0].split("-"),d=parseInt(l[0]),c=parseInt(l[1]),u=parseInt(l[2]),p=parseInt(r[0]),f=parseInt(r[1]);a.date=[d,c,u,p,f,0],n=a.setLabel(o,a.options);var h=t.now(new Date(d,c-1,u),!0);if(a.options.validRange){if(!a.options.validRange[0]||h>=a.options.validRange[0])var m=!0;else m=!1;if(!a.options.validRange[1]||h<=a.options.validRange[1])var v=!0;else v=!1;m&&v?(i.classList.remove("jcalendar_warning"),i.title=""):(i.classList.add("jcalendar_warning"),i.title=e.translate("Date outside the valid range"))}else i.classList.remove("jcalendar_warning"),i.title=""}else{a.date=null;n="";i.classList.remove("jcalendar_warning"),i.title=""}a.options.value=o,"function"==typeof a.options.onchange&&a.options.onchange(i,o,s),i.value!=n&&(i.value=n,"function"==typeof i.oninput&&i.oninput({type:"input",target:i,value:i.value}))}a.date&&(a.getDays(),"year-month-picker"==a.options.type&&a.getMonths())},getValue:function(){return a.date?a.options.time?s.two(a.date[0])+"-"+s.two(a.date[1])+"-"+s.two(a.date[2])+" "+s.two(a.date[3])+":"+s.two(a.date[4])+":"+s.two(0):s.two(a.date[0])+"-"+s.two(a.date[1])+"-"+s.two(a.date[2])+" "+s.two(0)+":"+s.two(0)+":"+s.two(0):""},update:function(e,t){if(e.classList.contains("jcalendar-disabled"));else{var n=c.querySelector(".jcalendar-selected");n&&n.classList.remove("jcalendar-selected"),e.classList.add("jcalendar-selected"),e.classList.contains("jcalendar-set-month")?(a.date[1]=t,a.date[2]=1):a.date[2]=e.innerText,a.options.time?(a.date[3]=C.value,a.date[4]=T.value):a.close(null,!0)}d()},reset:function(){a.setValue(""),a.date=null,a.close(!1,!1)},getDays:function(){a.options.mode="days";var e=new Date,n=a.date&&s.isNumeric(a.date[0])?a.date[0]:parseInt(e.getFullYear()),i=a.date&&s.isNumeric(a.date[1])?a.date[1]:parseInt(e.getMonth())+1,o=a.date&&s.isNumeric(a.date[2])?a.date[2]:parseInt(e.getDate()),r=a.date&&s.isNumeric(a.date[3])?a.date[3]:parseInt(e.getHours()),l=a.date&&s.isNumeric(a.date[4])?a.date[4]:parseInt(e.getMinutes());a.date=[n,i,o,r,l,0],g.innerHTML=n,y.innerHTML=a.options.months[i-1];var c=e.getMonth()==i-1&&e.getFullYear()==n,u=e.getDate(),p=(e=new Date(n,i,0,0,0)).getDate(),f=(e=new Date(n,i-1,0,0,0)).getDay()+1;f-=m=a.options.startingDay||0,x.innerHTML="",(w=document.createElement("tr")).setAttribute("align","center"),x.appendChild(w);for(var h=0;h<7;h++)(j=document.createElement("td")).classList.add("jcalendar-weekday"),j.innerHTML=a.options.weekdays[m].substr(0,1),w.appendChild(j),++m>6&&(m=0);for(var m=0,v=0,b=0;b<6;b++){var w;for((w=document.createElement("tr")).setAttribute("align","center"),w.style.height="34px",h=0;h<7;h++){var j;if((j=document.createElement("td")).classList.add("jcalendar-set-day"),m>=f&&m=a.options.validRange[0])var C=!0;else C=!1;if(!a.options.validRange[1]||E<=a.options.validRange[1])var T=!0;else T=!1;C&&T||j.classList.add("jcalendar-disabled")}}w.appendChild(j),m++}x.appendChild(w)}a.options.time?L.style.display="":L.style.display="none",d()},getMonths:function(){a.options.mode="months";var e=a.options.months,t=(a.options.value,new Date),n=parseInt(t.getFullYear()),i=parseInt(t.getMonth())+1,o=a.date&&s.isNumeric(a.date[0])?a.date[0]:n,r=a.date&&s.isNumeric(a.date[1])?a.date[1]:i;g.innerHTML=a.date[0],y.innerHTML=e[r-1];var l=document.createElement("table");l.setAttribute("width","100%");for(var c=null,u=0;u<12;u++){u%4||((c=document.createElement("tr")).setAttribute("align","center"),l.appendChild(c));var p=document.createElement("td");if(p.classList.add("jcalendar-set-month"),p.setAttribute("data-value",u+1),p.innerText=e[u],a.options.validRange){var f=o+"-"+s.two(u+1);if(!a.options.validRange[0]||f>=a.options.validRange[0].substr(0,7))var h=!0;else h=!1;if(!a.options.validRange[1]||f<=a.options.validRange[1].substr(0,7))var m=!0;else m=!1;h&&m||p.classList.add("jcalendar-disabled")}u+1==r&&p.classList.add("jcalendar-selected"),n==o&&u+1==i&&(p.style.fontWeight="bold"),c.appendChild(p)}x.innerHTML='',x.children[0].children[0].appendChild(l),d()},getYears:function(){a.options.mode="years";for(var e=new Date,t=e.getFullYear(),n=a.date&&s.isNumeric(a.date[0])?a.date[0]:parseInt(e.getFullYear()),i=[],o=0;o<25;o++)i[o]=parseInt(a.date[0])+(o-12);var r=document.createElement("table");for(r.setAttribute("width","100%"),o=0;o<25;o++){if(!(o%5)){var l=document.createElement("tr");l.setAttribute("align","center"),r.appendChild(l)}var c=document.createElement("td");c.classList.add("jcalendar-set-year"),c.innerText=i[o],n==i[o]&&c.classList.add("jcalendar-selected"),t==i[o]&&(c.style.fontWeight="bold"),l.appendChild(c)}x.innerHTML='',x.firstChild.firstChild.appendChild(r),d()},setLabel:function(e,n){return t.getDateString(e,n)},fromFormatted:function(e,n){return t.extractDateFromString(e,n)}},r=function(e){if(s.findElement(e.target,"jcalendar-container")){var t=e.target.className;if("jcalendar-prev"==t)a.prev();else if("jcalendar-next"==t)a.next();else if("jcalendar-month"==t)a.getMonths();else if("jcalendar-year"==t)a.getYears();else if("jcalendar-set-year"==t)a.date[0]=e.target.innerText,"year-month-picker"==a.options.type?a.getMonths():a.getDays();else if(e.target.classList.contains("jcalendar-set-month")){var n=parseInt(e.target.getAttribute("data-value"));"year-month-picker"==a.options.type?a.update(e.target,n):(a.date[1]=n,a.getDays())}else"jcalendar-confirm"==t||"jcalendar-update"==t||"jcalendar-close"==t?a.close(null,!0):"jcalendar-backdrop"==t?a.close(!1,!1):"jcalendar-reset"==t?a.reset():e.target.classList.contains("jcalendar-set-day")&&e.target.innerText&&a.update(e.target)}else a.close(!1,!1)},l=function(e){if(e.target.value&&e.target.value.length>3){var n=t.extractDateFromString(e.target.value,a.options.format);n&&a.setValue(n)}},d=function(){var e=c.querySelector(".jcalendar-selected");e&&e.classList.contains("jcalendar-disabled")?(E.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled")):(E.removeAttribute("disabled"),C.removeAttribute("disabled"),T.removeAttribute("disabled")),"function"==typeof a.options.onupdate&&a.options.onupdate(i,a.getValue())},c=null,u=null,p=null,m=null,v=null,g=null,y=null,b=null,x=null,w=null,L=null,j=null,E=null,C=null,T=null;return function(){"INPUT"==i.tagName&&i.value&&(o.value=i.value),(u=document.createElement("div")).className="jcalendar-reset",(p=document.createElement("div")).className="jcalendar-confirm",(w=document.createElement("div")).className="jcalendar-controls",w.style.borderBottom="1px solid #ddd",w.appendChild(u),w.appendChild(p),(m=document.createElement("div")).className="jcalendar-container",(v=document.createElement("div")).className="jcalendar-content",m.appendChild(v),"DIV"==i.tagName?(c=i).classList.add("jcalendar-inline"):(v.appendChild(w),(c=document.createElement("div")).className="jcalendar"),c.classList.add("jcalendar-container"),c.appendChild(m);var e=document.createElement("div");e.className="jcalendar-table",v.appendChild(e);var n=document.createElement("td");n.setAttribute("colspan","2"),n.className="jcalendar-prev",(g=document.createElement("span")).className="jcalendar-year",(y=document.createElement("span")).className="jcalendar-month";var d=document.createElement("td");d.className="jcalendar-header",d.setAttribute("colspan","3"),d.appendChild(y),d.appendChild(g);var h=document.createElement("td");h.setAttribute("colspan","2"),h.className="jcalendar-next";var k=document.createElement("thead"),A=document.createElement("tr");A.appendChild(n),A.appendChild(d),A.appendChild(h),k.appendChild(A),b=document.createElement("table"),x=document.createElement("tbody"),b.setAttribute("cellpadding","0"),b.setAttribute("cellspacing","0"),b.appendChild(k),b.appendChild(x),e.appendChild(b),(C=document.createElement("select")).className="jcalendar-select",C.onchange=function(){a.date[3]=this.value,"function"==typeof a.options.onupdate&&a.options.onupdate(i,a.getValue())};for(var O=0;O<24;O++)(N=document.createElement("option")).value=O,N.innerHTML=s.two(O),C.appendChild(N);for((T=document.createElement("select")).className="jcalendar-select",T.onchange=function(){a.date[4]=this.value,"function"==typeof a.options.onupdate&&a.options.onupdate(i,a.getValue())},O=0;O<60;O++){var N;(N=document.createElement("option")).value=O,N.innerHTML=s.two(O),T.appendChild(N)}var D=document.createElement("div");D.className="jcalendar-controls",(L=document.createElement("div")).className="jcalendar-time",L.style.maxWidth="140px",L.appendChild(C),L.appendChild(T),(E=document.createElement("button")).setAttribute("type","button"),E.className="jcalendar-update",(j=document.createElement("div")).style.flexGrow="10",j.appendChild(E),D.appendChild(L),"INPUT"==i.tagName&&D.appendChild(j),v.appendChild(D);var M=document.createElement("div");M.className="jcalendar-backdrop",c.appendChild(M),i.addEventListener("keyup",l),c.addEventListener("swipeleft",function(e){f.slideLeft(b,0,function(){a.next(),f.slideRight(b,1)}),e.preventDefault(),e.stopPropagation()}),c.addEventListener("swiperight",function(e){f.slideRight(b,0,function(){a.prev(),f.slideLeft(b,1)}),e.preventDefault(),e.stopPropagation()}),"ontouchend"in document.documentElement==1?(c.addEventListener("touchend",r),i.addEventListener("touchend",a.open)):(c.addEventListener("mouseup",r),i.addEventListener("mouseup",a.open)),t.hasEvents||(t.hasEvents=!0,document.addEventListener("keydown",t.keydown)),a.setOptions(o),"INPUT"==i.tagName?(i.parentNode.insertBefore(c,i.nextSibling),i.setAttribute("autocomplete","off"),i.classList.add("jcalendar-input"),i.value=a.setLabel(a.getValue(),a.options)):(a.getDays(),a.options.time&&(C.value=a.date[3],T.value=a.date[4])),1==a.options.opened&&a.open(),0==a.options.controls&&m.classList.add("jcalendar-hide-controls"),i.change=a.setValue,i.val=function(e){if(void 0===e)return a.getValue();a.setValue(e)},i.calendar=c.calendar=a}(),a};return t.keydown=function(e){var n=null;(n=t.current)&&(13==e.which?n.close(!1,!0):27==e.which&&n.close(!1,!1))},t.prettify=function(e,t){t||(t={justNow:"Just now",xMinutesAgo:"{0}m ago",xHoursAgo:"{0}h ago",xDaysAgo:"{0}d ago",xWeeksAgo:"{0}w ago",xMonthsAgo:"{0} mon ago",xYearsAgo:"{0}y ago"}),-1===e.indexOf("GMT")&&-1===e.indexOf("Z")&&(e+=" GMT");var n=new Date,i=new Date(e),o=parseInt((n-i)/1e3/60);if(String.prototype.format=function(e){return this.replace("{0}",e)},0==o)var a=t.justNow;else a=o<90?t.xMinutesAgo.format(o):o<1440?t.xHoursAgo.format(Math.round(o/60)):o<20160?t.xDaysAgo.format(Math.round(o/1440)):o<43200?t.xWeeksAgo.format(Math.round(o/10080)):o<1036800?t.xMonthsAgo.format(Math.round(o/43200)):t.xYearsAgo.format(Math.round(o/525600));return a},t.prettifyAll=function(){for(var e=document.querySelectorAll(".prettydate"),n=0;n=n.headers.scrollWidth-n.headers.offsetWidth?r.classList.add("disabled"):r.classList.remove("disabled"),n.headers.scrollWidth<=n.headers.offsetWidth?(a.style.display="none",r.style.display="none"):(a.style.display="",r.style.display="")};if(n.setBorder=c,n.open=function(t){if(Array.from(n.content.children),n.content.children[t]){for(var i=null,o=0;o=s||u(a-1),c(t)}}},n.selectIndex=function(e){var t=Array.prototype.indexOf.call(n.headers.children,e);return t>=0&&n.open(t),t},n.rename=function(e,t){t||(t=prompt("New title",n.headers.children[e].innerText)),n.headers.children[e].innerText=t,c(n.getActive())},n.create=function(t,i){if("function"==typeof n.options.onbeforecreate){var o=n.options.onbeforecreate(e,t);if(!1===o)return!1;t=o}var a=n.appendElement(t);return"function"==typeof n.options.oncreate&&n.options.oncreate(e,a),c(n.getActive()),a},n.remove=function(e){return n.deleteElement(e)},n.nextNumber=function(){for(var e=0,t=0;te&&(e=parseInt(i))}return e?e++:e=1,e},n.deleteElement=function(t){let i=n.getActive();if(!n.headers.children[t])return!1;if(n.headers.removeChild(n.headers.children[t]),n.content.removeChild(n.content.children[t]),i===t)n.open(0);else{let e=n.getActive()||0;c(e)}"function"==typeof n.options.ondelete&&n.options.ondelete(e,t)},n.appendElement=function(e,t,i,o){if(e||(e=prompt("Title?","")),e){let l=s.guid(),d=s.guid();var a=document.createElement("div");a.setAttribute("id",d),a.setAttribute("role","tabpanel"),a.setAttribute("aria-labelledby",l);var r=document.createElement("div");if(r.setAttribute("id",l),r.setAttribute("role","tab"),r.setAttribute("aria-controls",d),r.textContent=e,r.content=a,void 0===o)n.content.appendChild(a),n.headers.insertBefore(r,n.headers.lastChild);else{let e=n.content.children[o];e?n.content.insertBefore(a,e):n.content.appendChild(a),e=n.headers.children[o]||n.headers.lastChild,n.headers.insertBefore(r,e)}return n.options.allowChangePosition&&r.setAttribute("draggable","true"),!1!==i&&n.selectIndex(r),"function"==typeof t&&t(a,r),a}},n.getActive=function(){for(var e=0;et?n.content.insertBefore(n.content.children[e],n.content.children[t]):n.content.insertBefore(n.content.children[e],n.content.children[t].nextSibling),!1!==o)n.open(t);else{const e=n.getActive();tt?n.headers.insertBefore(n.headers.children[e],n.headers.children[t]):n.headers.insertBefore(n.headers.children[e],n.headers.children[t].nextSibling),n.updatePosition(e,t,i,o)},n.setBorder=c,n.init=function(){e.textContent="",n.headers=document.createElement("div"),n.content=document.createElement("div"),n.headers.classList.add("jtabs-headers"),n.headers.setAttribute("role","tablist"),n.content.classList.add("jtabs-content"),n.content.setAttribute("role","region"),n.content.setAttribute("aria-label","Tab Panels"),n.options.palette?e.classList.add("jtabs-modern"):e.classList.remove("jtabs-modern"),n.options.padding&&(n.content.style.padding=parseInt(n.options.padding)+"px");var t=document.createElement("div");t.className="jtabs-headers-container",t.appendChild(n.headers),n.options.maxWidth&&(t.style.maxWidth=parseInt(n.options.maxWidth)+"px");var i=document.createElement("div");if(i.className="jtabs-controls",i.setAttribute("draggable","false"),t.appendChild(i),"bottom"==n.options.position?(e.appendChild(n.content),e.appendChild(t)):(e.appendChild(t),e.appendChild(n.content)),1==n.options.allowCreate){var o=document.createElement("div");o.className="jtabs-add",o.onclick=function(){n.create()},i.appendChild(o)}(a=document.createElement("div")).className="jtabs-prev",a.onclick=function(){u(n.headers.scrollLeft-n.headers.offsetWidth)},i.appendChild(a),(r=document.createElement("div")).className="jtabs-next",r.onclick=function(){u(n.headers.scrollLeft+n.headers.offsetWidth)},i.appendChild(r);for(var s=0;sl&&(r.style.marginLeft=-1*(t.left+t.width-(l-20))+"px"),t.top+t.height>d&&(r.style.marginTop=-1*(t.top+t.height-(d-20))+"px")),"function"==typeof i.options.onopen&&i.options.onopen(e,i),u.setBorder(u.getActive()),i.options.value){var c=v(i.options.value);T.forEach(function(e,t){e.value=c[t],e.dispatchEvent(new Event("input"))})}}},i.close=function(t){return o.classList.contains("jcolor-focus")&&(o.classList.remove("jcolor-focus"),a.style.display="",t||"function"!=typeof i.options.onclose||i.options.onclose(e,i),n(i,!1)),i.options.value},i.setValue=function(t){t||(t=""),t!=i.options.value&&(i.options.value=t,C=t,i.select(t),"function"==typeof i.options.onchange&&i.options.onchange(e,t,i),e.value!=i.options.value&&(e.value=i.options.value,"INPUT"===e.tagName&&(e.style.color=e.value,e.style.backgroundColor=e.value),"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value})),1==i.options.closeOnChange&&i.close())},i.getValue=function(){return i.options.value};var p=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},h=function(e,t,n){return"#"+p(e)+p(t)+p(n)},m=function(e){return parseInt("0x"+e)},v=function(e){return[m(e.substr(1,2)),m(e.substr(3,2)),m(e.substr(5,2))]},y=function(){var e=document.createElement("div");e.className="jcolor-grid",i.values=[];var t=document.createElement("table");t.setAttribute("cellpadding","7"),t.setAttribute("cellspacing","0");for(var n=0;na.width&&(s=a.width),r>a.height&&(r=a.height),t.style.left=s+"px",t.style.top=r+"px";var l=w.getImageData(s,r,1,1).data;C=h(l[0],l[1],l[2])}};return e.addEventListener("mousedown",function(e){i(e.buttons,e.clientX,e.clientY)}),e.addEventListener("mousemove",function(e){i(e.buttons,e.clientX,e.clientY)}),e.addEventListener("touchmove",function(e){i(1,e.changedTouches[0].clientX,e.changedTouches[0].clientY)}),e},C="",T=[],k=function(){var e=document.createElement("div");e.className="jcolor-sliders";var t=document.createElement("div"),n=function(e){var n=document.createElement("div");n.className="jcolor-sliders-input-container";var i=document.createElement("label");i.innerText=e;var o=document.createElement("div");o.className="jcolor-sliders-input-subcontainer";var a=document.createElement("input");a.type="range",a.min=0,a.max=255,a.value=0,a.setAttribute("aria-label","Color value"),a.setAttribute("aria-valuemin","0"),a.setAttribute("aria-valuemax","255"),a.setAttribute("aria-valuenow","0"),n.appendChild(i),o.appendChild(a);var s=document.createElement("div");return s.innerText=a.value,a.addEventListener("input",function(){s.innerText=a.value}),o.appendChild(s),n.appendChild(o),t.appendChild(n),a};T=[n("Red"),n("Green"),n("Blue")],e.appendChild(t);var i=document.createElement("div");i.className="jcolor-sliders-final-color";var o=document.createElement("div");o.style.visibility="hidden",o.innerText="a",i.appendChild(o);return T.forEach(function(e){e.addEventListener("input",function(){var e;e=h(parseInt(T[0].value),parseInt(T[1].value),parseInt(T[2].value)),o.innerText=e,o.style.color=e,o.style.removeProperty("visibility"),C=e,function(){if(""!==C)for(var e=0;e0&&i.setValue(C),i.close()):e.target.classList.contains("jcolor-backdrop")?i.close():i.open()}),e.addEventListener("mouseup",function(e){i.open()}),window.addEventListener("resize",function(){o.classList.contains("jcolor-focus")&&1==u.getActive()&&L()}),1==i.options.opened&&i.open(),e.change=i.setValue,e.val=function(e){if(void 0===e)return i.getValue();i.setValue(e)},e.color=i,o.color=i}(),i}var L=function(){var t=function(i,o){var a={type:"contextmenu",options:{}},s={items:null,onclick:null};for(var r in s)o&&o.hasOwnProperty(r)?a.options[r]=o[r]:a.options[r]=s[r];function l(e){if(!e.type||"line"!=e.type&&"divisor"!=e.type){d=document.createElement("div");var t=document.createElement("a");if(t.innerHTML=e.title,e.tooltip&&d.setAttribute("title",e.tooltip),e.icon&&d.setAttribute("data-icon",e.icon),e.id&&(d.id=e.id),e.disabled)d.className="jcontextmenu-disabled";else if(e.onclick){let t=e.onclick;d.addEventListener("mousedown",function(e){e.preventDefault()}),d.addEventListener("mouseup",function(e){t(this,e)})}if(d.appendChild(t),e.submenu){var n=document.createElement("span");n.innerHTML="►",d.appendChild(n),d.classList.add("jcontexthassubmenu");var i=document.createElement("div");i.classList.add("jcontextmenu"),i.setAttribute("tabindex","900");for(var o=e.submenu,a=0;an&&a>=0?(i.style.left="auto",i.style.right="99%"):o>n&&a<0?(i.style.left="32px",i.style.right="auto",i.style.top="100%"):(i.style.left="99%",i.style.right="auto"),i.style.opacity="",i.style.pointerEvents="",i.style.display=""}),d.addEventListener("mouseleave",function(){i.style.left="",i.style.right="",i.style.minWidth=""})}else if(e.shortcut){var r=document.createElement("span");r.innerHTML=e.shortcut,d.appendChild(r)}}else var d=document.createElement("hr");return d}return i.classList.add("jcontextmenu"),a.open=function(e,o){if(o&&(a.options.items=o,a.create(o)),t.current&&t.current.close(),n(a,!0),i.classList.add("jcontextmenu-focus"),t.current=a,a.options.items&&a.options.items.length>0||i.children.length){if(e.target)if(e.changedTouches&&e.changedTouches[0])s=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY;else var s=e.clientX,r=e.clientY;else s=e.x,r=e.y;var l=i.getBoundingClientRect();if(window.innerHeight0?i.style.left=s-l.width+"px":i.style.left="10px":i.style.left=s+"px"}},a.isOpened=function(){return!!i.classList.contains("jcontextmenu-focus")},a.close=function(){i.classList.contains("jcontextmenu-focus")&&i.classList.remove("jcontextmenu-focus"),n(a,!1)},a.create=function(t){i.innerHTML="";var n=function(){var t=document.createElement("div");t.classList.add("header"),t.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation()});var n=document.createElement("a");n.classList.add("title"),n.innerHTML=e.translate("Menu"),t.appendChild(n);var i=document.createElement("a");return i.classList.add("close"),i.innerHTML=e.translate("close"),i.addEventListener("click",function(e){a.close()}),t.appendChild(i),t}();i.appendChild(n);for(var o=0;o0)for(i=0;i0&&x.appendChild(r)}if(t.length)for(i=0;i200&&(l=200),t=0;tn&&(i=a.items[s[r].indexValue])&&(o=i.element.innerText[0])&&e==(o=o.toLowerCase())){t=s[r].indexValue;break}a.setCursor(t)}}}else if(null==a.currentIndex||null==a.currentIndex)a.first();else{var l=a.items[a.currentIndex].element,d=l.nextElementSibling;d?(d.classList.contains("jdropdown-group")&&(d=d.lastChild.firstChild),t=d.indexValue):l.parentNode.classList.contains("jdropdown-group-items")&&((d=l.parentNode.parentNode.nextElementSibling)&&(d.classList.contains("jdropdown-group")?d=d.lastChild.firstChild:d.classList.contains("jdropdown-item")?t=d.indexValue:d=null),d&&(t=d.indexValue)),null!==t&&a.setCursor(t)}},a.prev=function(){var e=null;if(null===a.currentIndex)a.first();else{var t=a.items[a.currentIndex].element,n=t.previousElementSibling;n?(n.classList.contains("jdropdown-group")&&(n=n.lastChild.lastChild),e=n.indexValue):t.parentNode.classList.contains("jdropdown-group-items")&&((n=t.parentNode.parentNode.previousElementSibling)&&(n.classList.contains("jdropdown-group")?n=n.lastChild.lastChild:n.classList.contains("jdropdown-item")?e=n.indexValue:n=null),n&&(e=n.indexValue))}null!==e&&a.setCursor(e)},a.loadFirst=function(){if(a.results)var e=a.results;else e=a.items;var t=e.length||0;1==a.options.lazyLoading&&t>200&&(t=200),x.textContent="";for(var n=0;n200){t-=200,x.textContent="";for(var n=t;n0){for(var o=0;i>0&&t[i]&&o<200;)t[i].group?(t[i].group.parentNode||x.insertBefore(t[i].group,x.firstChild),t[i].group.lastChild.insertBefore(t[i].element,t[i].group.lastChild.firstChild)):x.insertBefore(t[i].element,x.firstChild),i--,o++;e=!0}return e},a.loadDown=function(){var e=!1;if(a.results)var t=a.results;else t=a.items;var n=x.querySelectorAll(".jdropdown-item"),i=n[n.length-1].indexValue;i=a.items[i];var o=t.indexOf(i)+1;if(o0&&n.prev(),e.preventDefault();else if(40==e.which)null==n.currentIndex?n.first():n.currentIndex+10)for(var i=0;i<7;i++)n.prev();e.preventDefault()}else if(34==e.which){if(null==n.currentIndex)n.first();else if(n.currentIndex+10&&(i.options.grid?(a.classList.add("jpicker-grid"),a.style.gridTemplateColumns="repeat("+i.options.grid+", 1fr)"):(a.classList.add("jpicker-columns"),a.style.width=i.options.width?i.options.width:36*i.options.columns+"px")),isNaN(parseInt(i.options.value))&&(i.options.value=0),function(){a.innerHTML="";for(var e=Object.keys(i.options.data),t=0;twindow.innerWidth&&(s=-1*(10+l.left+l.width-window.innerWidth)),a.style.marginTop=parseInt(t)+"px",a.style.marginLeft=parseInt(s)+"px","function"==typeof i.options.onopen&&i.options.onopen(e,i)}},i.close=function(){e.classList.contains("jpicker-focus")&&(e.classList.remove("jpicker-focus"),n(i,!1),"function"==typeof i.options.onclose&&i.options.onclose(e,i))},function(){let n=s.guid();e.classList.add("jpicker"),e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",n),e.setAttribute("tabindex","0"),e.onmousedown=function(t){e.classList.contains("jpicker-focus")||i.open()},(o=document.createElement("div")).classList.add("jpicker-header"),(a=document.createElement("div")).setAttribute("id",n),a.setAttribute("role","listbox"),a.classList.add("jpicker-content"),a.onclick=function(e){var t=s.findElement(e.target,"jpicker-item");t&&t.parentNode===a&&i.setValue(t.k,e)},e.appendChild(o),e.appendChild(a),e.value=t.value||0,i.setOptions(t),"function"==typeof i.options.onload&&i.options.onload(e,i),e.change=i.setValue,e.val=function(e){if(void 0===e)return i.getValue();i.setValue(e)},e.picker=i}(),i}function C(e,t){var i={type:"toolbar",options:{}},o={app:null,container:!1,badge:!1,title:!1,responsive:!1,maxWidth:null,bottom:!0,items:[]};for(var a in o)t&&t.hasOwnProperty(a)?i.options[a]=t[a]:i.options[a]=o[a];!e&&t.app&&t.app.el&&(e=document.createElement("div"),t.app.el.appendChild(e));var r=document.createElement("div");r.classList.add("jtoolbar-item"),r.classList.add("jtoolbar-arrow");var l=document.createElement("div");l.classList.add("jtoolbar-floating"),r.appendChild(l),i.selectItem=function(e){for(var t=d.children,n=0;nwindow.innerHeight||i.options.bottom?l.style.bottom="0":l.style.removeProperty("bottom"),l.style.right="0",r.children[0].focus(),n(i,!0)},i.close=function(){r.classList.remove("jtoolbar-arrow-selected"),n(i,!1)},i.refresh=function(){if(1==i.options.responsive){var t=e.parentNode.getBoundingClientRect();i.options.maxWidth||(i.options.maxWidth=t.width);var n=parseInt(i.options.maxWidth);for(r.parentNode&&r.parentNode.removeChild(r);l.firstChild;)d.appendChild(l.firstChild);if(n0&&d.appendChild(r)}},i.setReadonly=function(t){t=t?"add":"remove",e.classList[t]("jtoolbar-disabled")},e.onclick=function(e){var t=s.findElement(e.target,"jtoolbar-item");t&&i.selectItem(t),e.target.classList.contains("jtoolbar-arrow")&&i.open()},window.addEventListener("resize",function(){i.refresh()}),e.classList.add("jtoolbar"),e.innerHTML="",1==i.options.container&&e.classList.add("jtoolbar-container");var d=document.createElement("div");return e.appendChild(d),i.options.app&&e.classList.add("jtoolbar-mobile"),i.create(i.options.items),e.toolbar=i,i}const T=["html","body","address","span","div","h1","h2","h3","h4","h5","h6","p","b","i","blockquote","strong","em","ul","ol","li","a","code","pre","hr","br","img","figure","picture","figcaption","iframe","table","thead","tbody","tfoot","tr","th","td","caption","u","del","ins","sub","sup","small","mark","input","textarea","select","option","button","label","fieldset","legend","audio","video","abbr","cite","kbd","section","article","nav","aside","header","footer","main","details","summary","svg","line","source"],k=["width","height","align","border","src","tabindex"],A=["color","font-weight","font-size","background","background-color","margin"],O=function(e,t){if(e.tagName&&-1===T.indexOf(e.tagName.toLowerCase())&&e.innerText&&(e.innerHTML=e.innerText),e.attributes&&e.attributes.length){let n=null,i=e.getAttribute("style");if(i){n=[];let e=i.split(";");for(let t=0;t=0){let e=i.shift();i=i.join(":"),n.push(e+":"+i)}}}"IMG"===e.tagName.toUpperCase()&&(e.src?(e.setAttribute("tabindex","900"),t.push(e.src)):e.parentNode.removeChild(e));let o=[];for(let t=0;t0;n--)O(e.children[n-1],t)};var N=function(e,t){e&&(e=e.replace(new RegExp("\x3c!--(.*?)--\x3e","gsi"),""));let n=(new DOMParser).parseFromString(e,"text/html");O(n,t);let i=document.createElement("div");return i.innerHTML=n.firstChild.innerHTML,i};var D=function(){var e=function(t,n){var i={type:"editor",options:{}},o={url:null,value:"",snippet:null,toolbar:!0,toolbarOnTop:!1,remoteParser:null,placeholder:null,filterPaste:!0,dropZone:!0,dropAsSnippet:!1,acceptImages:!0,acceptFiles:!1,maxFileSize:5e6,allowImageResize:!0,maxHeight:null,height:null,focus:!1,onclick:null,onfocus:null,onblur:null,onload:null,onkeyup:null,onkeydown:null,onchange:null,extensions:null,type:null};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];var r=null,l=null,d=[];i.el=t,"function"==typeof i.options.onclick&&(t.onclick=function(e){i.options.onclick(t,i,e)}),t.classList.add("jeditor-container");var c=document.createElement("div");c.className="jsnippet",c.setAttribute("contenteditable",!1);var u=document.createElement("div");if(u.className="jeditor-toolbar",i.editor=document.createElement("div"),i.editor.setAttribute("contenteditable",!0),i.editor.setAttribute("spellcheck",!1),i.editor.classList.add("jeditor"),i.options.placeholder&&i.editor.setAttribute("data-placeholder",i.options.placeholder),(i.options.maxHeight||i.options.height)&&(i.editor.style.overflowY="auto",i.options.maxHeight&&(i.editor.style.maxHeight=i.options.maxHeight),i.options.height&&(i.editor.style.height=i.options.height)),i.options.url)p({url:i.options.url,dataType:"html",success:function(t){i.editor.innerHTML=t,e.setCursor(i.editor,"initial"==i.options.focus)}});else if(i.options.value)i.editor.innerHTML=i.options.value;else for(var f=0;f4?4:t),t>4?e.setAttribute("data-total",t-4):e.removeAttribute("data-total")}};i.appendSnippet=function(e){c.innerHTML="";for(var t=["image","title","description","host","url"],n=0;n/g,"\n")).replace(/<\/div>/g,"\n")).replace(/<(?:.|\n)*?>/gm,""),u.content=l.trim(),D("getData",u)}else var u=i.editor.innerHTML;return u},i.reset=function(){i.editor.innerHTML="",c.innerHTML="",d=[]},i.addPdf=function(e){if("data"!=e.result.substr(0,4))console.error("Invalid source");else{var t=document.createElement("canvas");t.width=60,t.height=60;var n=new Image;t.getContext("2d").drawImage(n,0,0,t.width,t.height),t.toBlob(function(t){var n=document.createElement("img");n.src=window.URL.createObjectURL(t),n.title=e.name,n.className="jfile pdf",d[n.src]={file:n.src,extension:"pdf",content:e.result},document.execCommand("insertHtml",!1,n.outerHTML)})}},i.addImage=function(e,t){if(i.options.acceptImages)if(e||(e=""),"data"==e.substr(0,4)||i.options.remoteParser){if("data"==e.substr(0,4))n=(n=(n=e.split(";"))[0].split("/"))[1];else{var n=e.substr(e.lastIndexOf(".")+1);e=i.options.remoteParser+e}var o=new Image;o.onload=function(){var e=document.createElement("canvas");e.width=o.width,e.height=o.height,e.getContext("2d").drawImage(o,0,0,e.width,e.height),e.toBlob(function(a){var s,r=document.createElement("img");r.src=window.URL.createObjectURL(a),r.classList.add("jfile"),r.setAttribute("tabindex","900"),r.setAttribute("width",o.width),r.setAttribute("height",o.height),d[r.src]={file:r.src,extension:n,content:e.toDataURL()},i.options.dropAsSnippet||t?(s=r,c.innerHTML||i.appendSnippet({}),c.children[0].appendChild(s),m(),d[r.src].snippet=!0):document.execCommand("insertHtml",!1,r.outerHTML),h()})},o.src=e}else console.error("remoteParser not defined in your initialization")},i.addFile=function(e){for(var t=[],n=0;ni.options.maxFileSize)alert("The file is too big");else{var o=e[n].type.split("/");(o="image"==o[0]?1:"pdf"==o[1]?2:0)?(t[n]=new FileReader,t[n].index=n,t[n].type=o,t[n].name=e[n].name,t[n].date=e[n].lastModified,t[n].size=e[n].size,t[n].addEventListener("load",function(e){2==e.target.type?1==i.options.acceptFiles&&i.addPdf(e.target):i.addImage(e.target.result)},!1),t[n].readAsDataURL(e[n])):alert("The extension is not allowed")}},i.destroy=function(){i.editor.removeEventListener("mouseup",k),i.editor.removeEventListener("mousedown",A),i.editor.removeEventListener("mousemove",O),i.editor.removeEventListener("keyup",E),i.editor.removeEventListener("keydown",T),i.editor.removeEventListener("dragstart",y),i.editor.removeEventListener("dragenter",b),i.editor.removeEventListener("dragover",x),i.editor.removeEventListener("drop",w),i.editor.removeEventListener("paste",g),i.editor.removeEventListener("blur",L),i.editor.removeEventListener("focus",j),t.editor=null,t.classList.remove("jeditor-container"),u.remove(),c.remove(),i.editor.remove()},i.upload=function(){s.click(i.file)};var v=function(e){var t=window.getSelection(),n=document.createRange();n.selectNode(e),t.addRange(n)},g=function(e){if(1==i.options.filterPaste){if(e.clipboardData||e.originalEvent.clipboardData)var t=(e.originalEvent||e).clipboardData.getData("text/html"),n=(e.originalEvent||e).clipboardData.getData("text/plain"),o=(e.originalEvent||e).clipboardData.files;else window.clipboardData&&(t=window.clipboardData.getData("Html"),n=window.clipboardData.getData("Text"),o=window.clipboardData.files);if(o.length)i.addFile(o);else if(t){let e=[];var a=N(t,e);if(e.length)for(var s=0;s"+e+""}),document.execCommand("insertText",!1,t.join(""))):t.map(function(e){var t=document.createElement("div");t.innerText=e,i.editor.appendChild(t)});e.preventDefault()}},y=function(e){l&&l.e&&e.preventDefault()},b=function(e){l||0==i.options.dropZone||(t.classList.add("jeditor-dragging"),e.preventDefault())},x=function(e){l||0==i.options.dropZone||(r&&clearTimeout(r),r=setTimeout(function(){t.classList.remove("jeditor-dragging")},100),e.preventDefault())},w=function(e){if(l||!1===i.options.dropZone);else{let n=null;document.caretRangeFromPoint?n=document.caretRangeFromPoint(e.clientX,e.clientY):e.rangeParent&&(n=document.createRange(),n.setStart(e.rangeParent,e.rangeOffset));let o=window.getSelection();o.removeAllRanges(),o.addRange(n),o.anchorNode.parentNode.focus();let a=(e.originalEvent||e).dataTransfer.getData("text/html"),s=(e.originalEvent||e).dataTransfer.getData("text/plain"),r=(e.originalEvent||e).dataTransfer.files;r.length?i.addFile(r):s&&function(e){let t=[];if(document.createElement("div"),N(e,t),t.length)for(var n=0;n
"),"function"==typeof i.options.onkeyup&&i.options.onkeyup(t,i,e)},T=function(e){if(D("onevent",e),"Delete"==e.key&&"IMG"==e.target.tagName){var n=e.target.parentNode;v(e.target),n.classList.contains("jsnippet-image")&&m()}"function"==typeof i.options.onkeydown&&i.options.onkeydown(t,i,e)},k=function(e){if(l&&l.e&&(l.e.classList.remove("resizing"),1==l.e.changed)){var t=l.e.cloneNode();t.width=parseInt(l.e.style.width)||l.e.getAttribute("width"),t.height=parseInt(l.e.style.height)||l.e.getAttribute("height"),l.e.style.width="",l.e.style.height="",v(l.e),document.execCommand("insertHtml",!1,t.outerHTML)}l=!1},A=function(e){var t=function(t){var n=t.getBoundingClientRect();n.width-(e.clientX-n.left)<40&&e.clientY-n.top<40&&(t.innerHTML="",t.remove())};if("IMG"==e.target.tagName)if(e.target.style.cursor){var n=e.target.getBoundingClientRect();l={e:e.target,x:e.clientX,y:e.clientY,w:n.width,h:n.height,d:e.target.style.cursor},e.target.getAttribute("width")||e.target.setAttribute("width",n.width),e.target.getAttribute("height")||e.target.setAttribute("height",n.height);var i=window.getSelection();if(i.rangeCount)for(var o=0;o'+e+""},onchange:function(e,t,n,i,o){document.execCommand("fontName",!1,i)}}),n.push({type:"select",content:"format_size",options:["x-small","small","medium","large","x-large"],render:function(e){return''+e+""},onchange:function(e,t,n,i,o){document.execCommand("fontSize",!1,parseInt(o)+1)}}),n.push({type:"select",options:["format_align_left","format_align_center","format_align_right","format_align_justify"],render:function(e){return''+e+""},onchange:function(e,t,n,i,o){document.execCommand(["JustifyLeft","justifyCenter","justifyRight","justifyFull"][o])}}),n.push({type:"divisor"}),n.push({content:"format_color_text",k:"color",onclick:t}),n.push({content:"format_color_fill",k:"background-color",onclick:t})),n.push({content:"format_bold",onclick:function(e,t,n){document.execCommand("bold"),document.queryCommandState("bold")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_italic",onclick:function(e,t,n){document.execCommand("italic"),document.queryCommandState("italic")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_underline",onclick:function(e,t,n){document.execCommand("underline"),document.queryCommandState("underline")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({type:"divisor"}),n.push({content:"format_list_bulleted",onclick:function(e,t,n){document.execCommand("insertUnorderedList"),document.queryCommandState("insertUnorderedList")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_list_numbered",onclick:function(e,t,n){document.execCommand("insertOrderedList"),document.queryCommandState("insertOrderedList")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_indent_increase",onclick:function(e,t,n){document.execCommand("indent",!0,null),document.queryCommandState("indent")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_indent_decrease",onclick:function(e,t,n){document.execCommand("outdent"),document.queryCommandState("outdent")?n.classList.add("selected"):n.classList.remove("selected")}}),e.options.toolbarOnTop&&(n.push({type:"divisor"}),n.push({content:"photo",onclick:function(){e.upload()}}),n.push({type:"select",content:"table_view",columns:8,grid:8,right:!0,options:["0x0","1x0","2x0","3x0","4x0","5x0","6x0","7x0","0x1","1x1","2x1","3x1","4x1","5x1","6x1","7x1","0x2","1x2","2x2","3x2","4x2","5x2","6x2","7x2","0x3","1x3","2x3","3x3","4x3","5x3","6x3","7x3","0x4","1x4","2x4","3x4","4x4","5x4","6x4","7x4","0x5","1x5","2x5","3x5","4x5","5x5","6x5","7x5","0x6","1x6","2x6","3x6","4x6","5x6","6x6","7x6","0x7","1x7","2x7","3x7","4x7","5x7","6x7","7x7"],render:function(e,t){t&&(t.onmouseover=this.onmouseover,e=e.split("x"),t.setAttribute("data-x",e[0]),t.setAttribute("data-y",e[1]));var n=document.createElement("div");return t.style.margin="1px",t.style.border="1px solid #ddd",n},onmouseover:function(e){for(var t=parseInt(e.target.getAttribute("data-x")),n=parseInt(e.target.getAttribute("data-y")),i=0;i=t[0]&&e<=t[1]},"not between":function(e,t){return et[1]},"<":function(e,t){return e":function(e,t){return e>t[0]},">=":function(e,t){return e>=t[0]},"=":function(e,t){return e==t[0]},"!=":function(e,t){return e!=t[0]}},n={"valid date":function(){return!0},"=":function(e,t){return e===t[0]},"!=":function(e,t){return e!==t[0]},"<":function(e,t){return e":function(e,t){return e>t[0]},">=":function(e,t){return e>=t[0]},between:function(e,t){return e>=t[0]&&e<=t[1]},"not between":function(e,t){return et[1]}},i={contains:function(e,t){return e.includes(t[0])},"not contains":function(e,t){return!e.includes(t[0])},"begins with":function(e,t){return e.startsWith(t[0])},"ends with":function(e,t){return e.endsWith(t[0])},"=":function(e,t){return e===t[0]},"!=":function(e,t){return e!==t[0]},"valid email":function(e){return new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/).test(e)},"valid url":function(e){return new RegExp(/(((https?:\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]+)/gi).test(e)}},o=function(e,t){return"function"==typeof o[t.type]?!(!t.allowBlank||void 0!==e&&""!==e&&null!==e)||o[t.type].call(this,e,t):null};o.url=function(e){return!!new RegExp(/(((https?:\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]+)/gi).test(e)},o.email=function(e){var t=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);return!(!e||!t.test(e))},o.required=function(e){return!(!e||!e.trim())},o.empty=function(e){return null==e||"string"==typeof e&&!e.toString().trim()},o["not exist"]=o.empty,o.notEmpty=function(e){return!o.empty(e)},o.exist=o.notEmpty,o.number=function(n,i){if(!e(n))return!1;if(!i||!i.criteria)return!0;if(!t[i.criteria])return!1;let o=i.value.map(function(e){return parseFloat(e)});return t[i.criteria](n,o)},o.login=function(e){let t=new RegExp(/^[a-zA-Z0-9._-]+$/);return!(!e||!t.test(e))},o.list=function(e,t){let n,i=typeof e;return("string"===i||"number"===i)&&(n="string"==typeof t.value[0]?t.source?t.source:t.value[0].split(","):t.value[0],!!Array.isArray(n)&&n.findIndex(function(t){return t==e})>-1)};const a=function(){let e=new Date;return e.setHours(0,0,0,0),e},s={"one year ago":function(){let e=a();return e.setFullYear(e.getFullYear()-1),e},"one month ago":function(){let e=a();return e.setMonth(e.getMonth()-1),e},"one week ago":function(){let e=a();return e.setDate(e.getDate()-7),e},yesterday:function(){let e=a();return e.setDate(e.getDate()-1),e},today:a,tomorrow:function(){let e=a();return e.setDate(e.getDate()+1),e}};return o.date=function(t,i){if(e(t)&&t>0&&t<1e6&&(t=h.numToDate(t)),"Invalid Date"==new Date(t))return!1;if(!i||!i.criteria)return!0;if(!n[i.criteria])return!1;let o=i.value.map(function(e){return"string"==typeof e&&s[e]?s[e]().getTime():new Date(e).getTime()});return n[i.criteria](new Date(t).getTime(),o)},o.text=function(e,t){if(null==e)e="";else if("string"!=typeof e)return!1;return!t||!t.criteria||!!i[t.criteria]&&i[t.criteria](e,t.value)},o.textLength=function(e,t){let n;return n="string"==typeof e?e.length:null!=e&&"function"==typeof e.toString?e.toString().length:0,o.number(n,t)},o.time=function(n,i){if(!e(n))return!1;if(!i||!i.criteria)return!0;if(!t[i.criteria])return!1;let o=i.value.map(function(e){return parseInt(parseFloat(e)*10**17)/10**17});return t[i.criteria](parseInt(parseFloat(n)*10**17)/10**17,o)},o}();var S=function(){var e=function(t,n){var i={options:{}},o={url:null,message:"Are you sure? There are unsaved information in your form",ignore:!1,currentHash:null,submitButton:null,validations:null,onbeforeload:null,onload:null,onbeforesave:null,onsave:null,onbeforeremove:null,onremove:null,onerror:function(e,t){alert(t)}};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];i.options.validations||(i.options.validations={}),i.options.submitButton||(i.options.submitButton=t.querySelector("input[type=submit]")),i.options.submitButton&&i.options.url&&(i.options.submitButton.onclick=function(){i.save()}),i.options.validations.email||(i.options.validations.email=I.email),i.options.validations.length||(i.options.validations.length=I.length),i.options.validations.required||(i.options.validations.required=I.required),i.setUrl=function(e){i.options.url=e},i.load=function(){p({url:i.options.url,method:"GET",dataType:"json",queue:!0,success:function(n){if("function"==typeof i.options.onbeforeload){var o=i.options.onbeforeload(t,n);o&&(n=o)}e.setElements(t,n),"function"==typeof i.options.onload&&i.options.onload(t,n)}})},i.save=function(){var n=i.validate();if(n)i.options.onerror(t,n);else{var o=e.getElements(t,!0);if("function"==typeof i.options.onbeforesave&&!1===(o=i.options.onbeforesave(t,o)))return;p({url:i.options.url,method:"POST",dataType:"json",data:o,success:function(e){"function"==typeof i.options.onsave&&i.options.onsave(t,o,e)}})}},i.remove=function(){if("function"==typeof i.options.onbeforeremove&&!1===i.options.onbeforeremove(t,i))return!1;p({url:i.options.url,method:"DELETE",dataType:"json",success:function(e){"function"==typeof i.options.onremove&&i.options.onremove(t,i,e),i.reset()}})};return i.validateElement=function(n){var o=!1,a=e.getValue(n),s=n.getAttribute("data-validation");return"function"!=typeof i.options.validations[s]||i.options.validations[s](a,n)?n.classList.contains("error")&&function(e){var n=!1;e.classList.remove("error"),e.removeAttribute("title");for(var o=t.querySelectorAll("input, select, textarea, div[name]"),a=0;a0&&e.join("
")},i.getError=function(){return!!i.validation()},i.setHash=function(){return i.getHash(e.getElements(t))},i.getHash=function(e){var t,n=0;if(0===e.length)return n;for(t=0;t800?f.fadeIn(o):f.slideTop(o,1)},t.hide=function(){s.getWindowWidth()>800?f.fadeOut(o,function(){o.parentNode&&(o.parentNode.removeChild(o),g&&clearTimeout(g))}):f.slideTop(o,0,function(){o.parentNode&&(o.parentNode.removeChild(o),g&&clearTimeout(g))})},t.show(),1==t.options.autoHide)var g=setTimeout(function(){t.hide()},t.options.timeout);return s.getWindowWidth()<800&&o.addEventListener("swipeup",function(e){t.hide(),e.preventDefault(),e.stopPropagation()}),t};return e.isVisible=function(){var e=document.querySelector(".jnotification");return!(!e||!e.parentNode)},e}();function Y(e,t){if(e.search)return e.search;var n=null,i=function(t){if("function"==typeof r.options.onsearch){var n=r.options.onsearch(r,t);n&&(t=n)}if(l.innerHTML="",t.length){e.style.display="block";for(var i=t.length<11?t.length:10,o=0;o=0)return!0}else for(var n in t)if((""+t[n]).toLowerCase().search(e.toLowerCase())>=0)return!0;return!1}(t)});i(t)}else p({url:r.options.data+e,method:"GET",dataType:"json",success:function(e){i(e)}})},a=null,r=function(e){a&&clearTimeout(a),a=setTimeout(function(){o(e)},500)};null===t.forceSelect&&(t.forceSelect=!0),r.options={data:t.data||null,input:t.input||null,searchByNode:t.searchByNode||null,onselect:t.onselect||null,forceSelect:t.forceSelect,onsearch:t.onsearch||null,onbeforesearch:t.onbeforesearch||null},r.selectIndex=function(e){var t=e.getAttribute("id"),n=e.getAttribute("data-text"),i=e.getAttribute("data-value"),o=e.children[0].src||"";"function"==typeof r.options.onselect&&r.options.onselect(r,n,i,t,o),r.close()},r.open=function(){e.style.display="block"},r.close=function(){a&&clearTimeout(a),r.terms="",l.innerHTML="",e.style.display=""},r.isOpened=function(){return!!e.style.display},r.keydown=function(e){r.isOpened()&&("Enter"==e.key?null!==n&&l.children[n]?(r.selectIndex(l.children[n]),e.preventDefault()):r.close():"ArrowUp"===e.key?(null!==n&&l.children[0]&&(l.children[n].classList.remove("selected"),r.options.forceSelect||0!==n?(n=Math.max(0,n-1),l.children[n].classList.add("selected")):n=null),e.preventDefault()):"ArrowDown"===e.key&&(null==n?n=-1:l.children[n].classList.remove("selected"),n<9&&l.children[n+1]&&n++,l.children[n].classList.add("selected"),e.preventDefault()))},r.keyup=function(e){if(!r.options.searchByNode&&r.options.input)if("DIV"===r.options.input.tagName)var t=r.options.input.innerText;else t=r.options.input.value;else{var n=s.getNode();n&&(t=n.innerText)}if("function"==typeof r.options.onbeforesearch){var i=r.options.onbeforesearch(r,t);if(i)t=i;else if(!1===i)return}r(t)},r.blur=function(e){r.close()},r.options.input&&(r.options.input.addEventListener("keyup",r.keyup),r.options.input.addEventListener("keydown",r.keydown),r.options.input.addEventListener("blur",r.blur));var l=document.createElement("div");return l.classList.add("jsearch_container"),l.onmousedown=function(e){if(e.target.classList.contains("jsearch_item"))var t=e.target;else t=e.target.parentNode;r.selectIndex(t),e.preventDefault()},e.appendChild(l),e.classList.add("jsearch"),e.search=r,r}function P(t,n){var i={options:{}},o={type:"image",extension:"*",input:!1,minWidth:!1,maxWidth:null,maxHeight:null,maxJpegSizeBytes:null,onchange:null,multiple:!1,remoteParser:null};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];1==i.options.multiple&&t.setAttribute("data-multiple",!0),t.content=[],t.classList.add("jupload"),1==i.options.input&&t.classList.add("input"),i.add=function(e){if(0==i.options.multiple&&(t.content=[],t.innerText=""),"image"==i.options.type){var n=document.createElement("img");n.setAttribute("src",e.file),n.setAttribute("tabindex",-1),t.getAttribute("name")||(n.className="jfile",n.content=e),t.appendChild(n)}else{if(e.name)var o=e.name;else o=e.file;var a=document.createElement("div");a.innerText=o||i.options.type,a.classList.add("jupload-item"),a.setAttribute("tabindex",-1),t.appendChild(a)}e.content&&(e.file=s.guid()),t.content.push(e),"function"==typeof i.options.onchange&&i.options.onchange(t,e)},i.addFromFile=function(t){if(t.type.split("/")[0]==i.options.type){var n=new FileReader;n.addEventListener("load",function(e){var n={file:e.srcElement.result,extension:t.name.substr(t.name.lastIndexOf(".")+1),name:t.name,size:t.size,lastmodified:t.lastModified,content:e.srcElement.result};i.add(n)}),n.readAsDataURL(t)}else alert(e.translate("This extension is not allowed"))},i.addFromUrl=function(e){if("data"==e.substr(0,4)||i.options.remoteParser)if("data"==e.substr(0,4))if((n=(n=e.split(";"))[0].split("/"))[0].replace("data:","")==i.options.type){var t={file:e,name:"",extension:n[1],content:e};i.add(t)}else alert(i.options.text.extensionNotAllowed);else{var n=e.substr(e.lastIndexOf(".")+1);e=i.options.remoteParser+e,p({url:e,type:"GET",dataType:"blob",success:function(e){}})}else console.error("remoteParser not defined in your initialization")};var r=i.options.type+"/"+i.options.extension,l=document.createElement("input");l.type="file",l.setAttribute("accept",r),l.onchange=function(){for(var e=0;e=0&&(t.content.splice(n,1),d.remove(),d=null)}}),t.addEventListener("drop",function(e){e.preventDefault(),e.stopPropagation();var n=(e.originalEvent||e).dataTransfer.getData("text/html");if((e.originalEvent||e).dataTransfer.files.length)for(var o=0;o4&&e.setAttribute("data-total",i-4),e.setAttribute("data-number",i>4?4:i)}var o=document.createElement("div");if(o.classList.add("jslider-counter"),e.children.length>0)for(var a=0;an.currentImage.offsetWidth&&n.currentImage.classList.add("jslider-vertical"),l.children[0].innerText=n.currentImage.getAttribute("title")},n.open=function(){n.show(),"function"==typeof n.options.onopen&&n.options.onopen(e)},n.close=function(){e.classList.remove("jslider-focus"),e.classList.remove("jslider-left"),e.classList.remove("jslider-right"),n.options.grid&&e.classList.add("jslider-grid");for(var t=0;t=i.options.limit)},a=null,r=null;i.setOptions=function(e,n){var o={value:"",limit:null,search:null,placeholder:null,validation:null,onbeforepaste:null,onbeforechange:null,onremoveitem:null,onlimit:null,onchange:null,onfocus:null,onblur:null,onload:null};for(var s in o)e&&e.hasOwnProperty(s)?i.options[s]=e[s]:void 0!==i.options[s]&&!0!==n||(i.options[s]=o[s]);return i.options.placeholder?t.setAttribute("data-placeholder",i.options.placeholder):t.removeAttribute("data-placeholder"),t.placeholder=i.options.placeholder,i.setValue(i.options.value),u(),i.options.search?r||(r=document.createElement("div"),t.parentNode.insertBefore(r,t.nextSibling),a=Y(r,{data:i.options.search,onselect:function(e,t,n){i.selectIndex(t,n)}})):r&&(a=null,r.remove(),r=null),i},i.add=function(n,r){if("function"==typeof i.options.onbeforechange){var u=i.options.onbeforechange(t,i,i.options.value,n);if(!1===u)return!1;null!=u&&(n=u)}if(a&&a.close(),o())"function"==typeof i.options.onlimit?i.options.onlimit(i,i.options.limit):alert(e.translate("You reach the limit number of entries")+" "+i.options.limit);else{var p=s.getNode();if(!(p&&p.parentNode&&p.parentNode.classList.contains("jtags")&&p.nextSibling)||p.nextSibling.innerText&&p.nextSibling.innerText.trim()){if(t.lastChild&&(t.lastChild.innerText.trim()||t.removeChild(t.lastChild)),n&&"string"!=typeof n){for(var f=0;f<=n.length;f++)if(!o()){if(n[f]&&"string"!=typeof n[f])h=n[f].text,m=n[f].value;else var h=n[f]||"",m=null;v=d(h,m)}}else var v=d(n,n,p);c()}else v=p.nextSibling;r&&l(v)}},i.setLimit=function(e){for(i.options.limit=e,t.children.length;t.children.length>e;)t.removeChild(t.lastChild)},i.remove=function(e){e.parentNode.removeChild(e),t.children.length?c():i.add("",!0),"function"==typeof i.options.onremoveitem&&i.options.onremoveitem(t,i,e)},i.getData=function(){for(var e=[],n=0;n",c()},i.isValid=function(){for(var e=0,n=0;n1&&(o()?"function"==typeof i.options.onlimit&&i.options.onlimit(i,i.options.limit):i.add("",!0)),e.preventDefault()):"Enter"==e.key?a&&a.isOpened()||(window.getSelection().anchorOffset>1&&(o()||i.add("",!0)),e.preventDefault()):"Backspace"==e.key&&1==t.children.length&&window.getSelection().anchorOffset<1&&e.preventDefault(),a&&a.keydown(e),p()},v=function(e){if(39==e.which){var t=window.getSelection().anchorOffset;t>1&&t==h&&i.add("",!0)}else 13==e.which||38==e.which||40==e.which?e.preventDefault():a&&a.keyup(e);u()},g=function(e){if(e.clipboardData||e.originalEvent.clipboardData)var n=(e.originalEvent||e).clipboardData.getData("text/plain");else window.clipboardData&&(n=window.clipboardData.getData("Text"));var o=f(n);if("function"==typeof i.options.onbeforepaste){var a=i.options.onbeforepaste(t,i,o);if(!1===a)return e.preventDefault(),!1;a&&(o=a)}o.length>1?(i.add(o,!0),e.preventDefault()):o[0]&&(document.execCommand("insertText",!1,o[0]),e.preventDefault())},y=function(e){if(e.target.parentNode&&e.target.parentNode.classList.contains("jtags")&&(e.target.classList.contains("jtags_label")||e.target.classList.contains("jtags_error"))){var n=e.target.getBoundingClientRect();n.width-(e.clientX-n.left)<16&&i.remove(e.target)}e.target==t&&l()},b=function(){t.classList.contains("jtags-focus")||(t.children.length&&!i.getValue(t.children.length-1)||o()||d(""),"function"==typeof i.options.onfocus&&i.options.onfocus(t,i,i.getValue()),t.classList.add("jtags-focus"))},x=function(){if(t.classList.contains("jtags-focus")){a&&a.close();for(var e=0;e0)for(let i=0;i0&&(t=n[n.length-1],t&&"Escape"===e.key&&"function"==typeof t.isOpened&&"function"==typeof t.close&&t.isOpened()&&(t.close(),e.preventDefault(),e.stopImmediatePropagation()))}),document.addEventListener("contextmenu",function(e){var t=document.activeElement;if(t&&"function"==typeof t.contextmenu)t.contextmenu(e),e.preventDefault(),e.stopImmediatePropagation();else if(t=B.findElement(e.target,function(e){return e.tagName&&e.getAttribute("aria-contextmenu-id")}),t){var n=document.querySelector("#"+t);n?(n.contextmenu.open(e),e.preventDefault(),e.stopImmediatePropagation()):console.error("JSUITES: contextmenu id not found: "+t)}}),document.addEventListener("input",function(e){(e.target.getAttribute("data-mask")||e.target.mask)&&B.mask(e)})}();var W=B}(),t=o.default}(),t)}}]);