helper-js
Advanced tools
Comparing version 1.4.13 to 1.4.14
/*! | ||
* helper-js v1.4.13 | ||
* helper-js v1.4.14 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* Released under the MIT License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).helperJs={})}(this,(function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var v=regeneratorRuntime.mark(R),h={};function p(){if(h.glb)return h.glb;var e;try{e=global}catch(t){e=window}return h.glb=e,e}function y(e){return void 0!==e}function g(e){return"[object Array]"===Object.prototype.toString.call(e)}function m(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function b(e){return"[object Number]"===Object.prototype.toString.call(e)}function w(e){return isFinite(e)&&!isNaN(parseFloat(e))}function x(e){return"[object String]"===Object.prototype.toString.call(e)}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function j(e){return"function"==typeof e}function S(e,t){return 1===arguments.length&&(t=e,e=0),Math.floor(Math.random()*(t-e+1)+e)}function k(e,t){return e<t?e:t}function P(e){return e&&e[0].toUpperCase()+e.substr(1)}function E(e){return e.replace(/ /g,"-").replace(/_/g,"-").replace(/([A-Z])/g,"-$1").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function A(e){for(var t=e.toString().split(/[-_]/),n=1;n<t.length;n++)t[n]=P(t[n]);return t.join("")}function T(e){return e.toString().trim().split(/(?=[A-Z])/)}function C(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=r[S(r.length-1)];return t+n}function _(e,t){for(var n,r=0;(n=e.indexOf(t))>-1;)e.splice(n,1),r++;return r}function I(e){return e[e.length-1]}function N(e){return g(e)?e:[e]}function L(e,t){var n=[];if(j(t))for(var r=t,o=1,i=0;i<e.length;){var a=i+r(o);n.push(e.slice(i,a)),i=a,o++}else for(var u=0;u<e.length;){var c=u+t;n.push(e.slice(u,c)),u=c}return n}function R(e){var t,n,r,o,i,a,u,c,l,f,s,d,h,p,y=arguments;return regeneratorRuntime.wrap((function(v){for(;;)switch(v.prev=v.next){case 0:if((t=y.length>1&&void 0!==y[1]?y[1]:{}).reverse){v.next=30;break}if(null==e.length){v.next=14;break}n=0;case 4:if(!(n<e.length)){v.next=12;break}if(r={value:e[n],index:n},t.exclude&&t.exclude(r)){v.next=9;break}return v.next=9,r;case 9:n++,v.next=4;break;case 12:v.next=28;break;case 14:if(!O(e)){v.next=27;break}o=0,i=Object.keys(e);case 16:if(!(o<i.length)){v.next=25;break}if(a=i[o],u={value:e[a],key:a},t.exclude&&t.exclude(u)){v.next=22;break}return v.next=22,u;case 22:o++,v.next=16;break;case 25:v.next=28;break;case 27:throw"Unsupported type";case 28:v.next=58;break;case 30:if(null==e.length){v.next=42;break}c=e.length-1;case 32:if(!(c>=0)){v.next=40;break}if(l={value:e[c],index:c},t.exclude&&t.exclude(l)){v.next=37;break}return v.next=37,l;case 37:c--,v.next=32;break;case 40:v.next=58;break;case 42:if(!O(e)){v.next=57;break}(f=Object.keys(e)).reverse(),s=0,d=f;case 46:if(!(s<d.length)){v.next=55;break}if(h=d[s],p={value:e[h],key:h},t.exclude&&t.exclude(p)){v.next=52;break}return v.next=52,p;case 52:s++,v.next=46;break;case 55:v.next=58;break;case 57:throw"Unsupported type";case 58:case"end":return v.stop()}}),v)}function B(e,t,n){var r=g(t)?t:t.split("."),o=e;try{var i=!0,a=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){o=o[c.value]}}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}}catch(e){if(n)throw"Path does not exist"}return o}function M(e,t){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];n[j(t)?t(i,o):i[t]]=i}return n}function F(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],a=[],u=function(){for(var u=this,c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return new Promise((function(c,f){i.push(c),a.push(f),r=l,n||(n=!0,t=setTimeout((function(){var o=e.call.apply(e,[u].concat(d(r)));t=null,n=!1,i.forEach((function(e){return e(o)})),i=[],a=[]}),o))}))};return u.stop=function(){t&&(clearTimeout(t),t=null),n=!1,i=[],a.forEach((function(e){return e()})),a=[]},u}function D(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=function(){var i=this;return new Promise((function(a,u){n?a(r):(n=!0,a(r=e.call.apply(e,[i].concat(d(lastArgs)))),t=setTimeout((function(){t=null,n=!1,r=null}),o))}))};return i.stop=function(){t&&(clearTimeout(t),t=null),n=!1},i}function U(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}function W(e){var t=z(e),n=U();return{x:t.left+n.left,y:t.top+n.top}}function H(e){var t=e.offsetParent;return(!t||t===document.body&&"static"===getComputedStyle(document.body).position)&&(t=document.body.parentElement),t}function z(e){var t=e.getBoundingClientRect(),n=t.top-document.documentElement.clientTop,r=t.bottom,o=t.left-document.documentElement.clientLeft,i=t.right;return{top:n,right:i,bottom:r,left:o,width:t.width||i-o,height:t.height||r-n,x:o,y:n}}var q=z;function G(e,t,n){for(var r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function J(e,t){e["original_".concat(t)]=e.getAttribute(t)}function V(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])}function $(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function Q(e){J(e,"style"),e.style.display="block";var t=z(e),n={width:t.width,height:t.height};return V(e,"style"),n}var Y=Q;function Z(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function K(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function X(e,t){var n=R(e,{reverse:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).reverse}),r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,l=c.value;if(t(l,c.index))return l}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}function ee(e,t,n,r,o){var i,a,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e3;null==n&&(n=0,r=e.length-1);for(var c,l=0;n>=0&&n<=r;){if(l>=u)throw Error("binarySearch: loop times is over ".concat(u,", you can increase the limit."));if((c=t(a=e[i=Math.floor((r-n)/2+n)],l))>0)r=i-1;else{if(!(c<0))return{index:i,value:a,count:l+1,hit:!0};n=i+1}l++}return o?{index:i,value:a,count:l+1,hit:!1,bigger:c>0}:null}function te(e,t){return new Promise((function(n,r){setTimeout((function(){t&&t(),n()}),e)}))}function ne(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p().open(e,t,Object.keys(n).map((function(e){return"".concat(e,"=").concat(n[e])})).join(","))}var re=function(){function e(t){var r=this;n(this,e),this.baseUrl="",this.search={};var o=decodeURI(t).split("?");this.baseUrl=o[0],o[1]&&o[1].split("&").forEach((function(e){var t=e.split("=");r.search[t[0]]=null==t[1]?"":decodeURIComponent(t[1])}))}return o(e,[{key:"getHref",value:function(){var e=this,t=[this.baseUrl],n=Object.keys(this.search).map((function(t){return"".concat(t,"=").concat(encodeURIComponent(e.search[t]))})).join("&");return n&&t.push(n),t.join("?")}}]),e}();function oe(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n?(new Date).getTime()+60*n*1e3:null}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}var ie=function(){function e(){n(this,e),this.eventStore=[]}return o(e,[{key:"on",value:function(e,t){this.eventStore.push({name:e,handler:t})}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,o)},o=function(){t.apply(void 0,arguments),r()};return this.on(e,o),r}},{key:"onceTimeout",value:function(e,t,n){var r,o=this;return{off:function(){r&&r()},promise:new Promise((function(i,a){r=o.once(e,(function(){t.apply(void 0,arguments),i()})),te(n).then((function(){r(),a()}))}))}}},{key:"off",value:function(e,t){for(var n=[],r=this.eventStore.length,o=0;o<r;o++){var i=this.eventStore[o];i.name===e&&i.handler===t&&n.unshift(o)}for(var a=0,u=n;a<u.length;a++){var c=u[a];this.eventStore.splice(c,1)}}},{key:"emit",value:function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=this.eventStore[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value;u.name===e&&t.push(u)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}for(var c=arguments.length,l=new Array(c>1?c-1:0),f=1;f<c;f++)l[f-1]=arguments[f];for(var s=0,d=t;s<d.length;s++){var v=d[s];v.handler.apply(v,l)}}}]),e}(),ae=function(e){function t(e){var r;return n(this,t),(r=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?f(e):t}(this,c(t).call(this))).storageName="_crossWindow",r.windows=[],r.timeout=200,r.BROADCAST="__BROADCAST__",e&&Object.assign(f(r),e),Z(window,"storage",(function(e){if(e.key===r.storageName){var t,n=JSON.parse(e.newValue);if(!n.targets||n.targets.includes(r.id))(t=r).emitLocal.apply(t,[n.name].concat(d(n.args)))}})),r.id=C(),r.windows=[r.id],r.ready=new Promise((function(e,t){r.onceTimeout("_windows_updated",(function(e){var t=e.windows;r.windows=t}),r.timeout).promise.then((function(){e()}),(function(){e()})),r.broadcast("_join",r.id)})),r.ready.then((function(){r.on("_join",(function(e){r.windows.push(e),r.isMain()&&r.broadcast("_windows_updated",{windows:r.windows,type:"join",id:e})})),r.on("_windows_updated",(function(e){var t=e.windows;r.windows=t})),r.on("_exit",(function(e){var t=r.windows[0];_(r.windows,e),r.isMain()&&(r.emit("_windows_updated",{windows:r.windows,type:"exit",id:e}),t!=r.id&&(console.log("_main_updated"),r.emit("_main_updated",{windows:r.windows,old:t,new:r.id})))})),Z(window,"beforeunload",(function(){r.exitGroup()}))})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),o(t,[{key:"isMain",value:function(){return this.id===this.windows[0]}},{key:"emitTo",value:function(e,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var a;n===this.BROADCAST?n=null:(n&&!g(n)&&(n=[n]),n.includes(this.id)&&(a=s(c(t.prototype),"emit",this)).call.apply(a,[this,e].concat(o)));p().localStorage.setItem(this.storageName,JSON.stringify({name:e,targets:n,args:o,random:Math.random()}))}},{key:"emitLocal",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.id].concat(n))}},{key:"broadcast",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.BROADCAST].concat(n))}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.windows].concat(n))}},{key:"exitGroup",value:function(){this.broadcast("_exit",this.id)}}]),t}(ie),ue=ae;var ce=function(){function e(){n(this,e),this.store={}}return o(e,[{key:"has",value:function(e){return this.store.hasOwnProperty(e)}},{key:"remember",value:function(e,t){return this.has(e)||(this.store[e]={value:t()}),this.store[e].value}},{key:"forget",value:function(e){e?this.has(e)&&delete this.store[e]:this.store={}}}]),e}();e.CrossWindow=ue,e.CrossWindowEventProcessor=ae,e.EventProcessor=ie,e.URLHelper=re,e.addClass=function(e,t){$(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)},e.appendTo=function(e,t){t.appendChild(e)},e.arrayAt=function(e,t){return e[t>=0?t:e.length+t]},e.arrayDiff=function(e,t){for(var n=e.length,r=[];n--;)t.indexOf(e[n])<0&&r.push(e[n]);return r},e.arrayDistinct=function(e){return p().Set?d(new Set(e)):e.filter((function(e,t,n){return n.indexOf(e)===t}))},e.arrayFirst=function(e){return e[0]},e.arrayGet=function(e,t,n){return t<0&&(t+=e.length),null==n?e[t]:(n<0&&(n+=e.length),e.slice(t,n-t+1))},e.arrayLast=I,e.arrayRemove=_,e.arrayRemoveBySortedIndexes=function(e,t){for(var n=t.length-1;n>=0;n--){var r=t[n];e.splice(r,1)}},e.arraySibling=function(e,t,n){var r=e.indexOf(t);if(-1===r)throw"item is not in array";return g(n)?n.map((function(t){return e[r+t]})):e[r+n]},e.arrayWithoutEnd=function(e,t){return e.slice(0,e.length-t)},e.assignIfDifferent=function(e,t,n){e[t]!==n&&(e[t]=n)},e.attachCache=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ce,r=function(r){var o=t[r];Object.defineProperty(e,r,{get:function(){var e=this;return n.remember(r,(function(){return o.call(e)}))}})};for(var o in t)r(o)},e.backupAttr=J,e.binarySearch=ee,e.camelCase=A,e.camelToWords=T,e.cloneObj=function e(n,r){switch(t(n)){case"undefined":case"boolean":case"nuber":case"string":case"function":return n;case"object":if(null===n)return n;var o;if(g(n)){o=[];var i=!0,a=!1,u=void 0;try{for(var c,l=n[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value;o.push(e(f,r))}}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}}else{o={};for(var s=0,d=Object.keys(n);s<d.length;s++){var v=d[s];r&&(!g(r)||r.includes(v))&&r(v,n[v],n)||(o[v]=e(n[v],r))}}return o;default:return n}},e.copyTextToClipboard=function(e){try{return void navigator.clipboard.writeText(e)}catch(e){}var t=document.createElement("textarea");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="2em",t.style.height="2em",t.style.padding=0,t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Copying text command was "+n)}catch(e){console.log("Oops, unable to copy")}document.body.removeChild(t)},e.debounce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).immediate?D(e,t):F(e,t)},e.debounceImmediate=D,e.debounceTrailing=F,e.default=ce,e.elementsFromPoint=function(){for(var e=document.elementsFromPoint||document.msElementsFromPoint||function(e,t){var n=[],r=void 0;do{r!==document.elementFromPoint(e,t)?(r=document.elementFromPoint(e,t),n.push(r),r.style.pointerEvents="none"):r=!1}while(r);return n.forEach((function(e){return e.style.pointerEvents="all"})),n},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(document,n)},e.empty=function(e){return null==e||(null!=e.length?0===e.length:!m(e)&&(b(e)?isNaN(e):O(e)?0===Object.keys(e).length:void 0))},e.executeOnceInScopeByName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:scope_executeOnceInScopeByName,r=arguments.length>3?arguments[3]:void 0;if(e="executeOnceInScopeByName_".concat(e),!n[e]){var o=t();n[e]={destroy:function(){delete n[e]}},r&&(n[e].value=o)}return n[e]},e.executePromiseGetters=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{promise:new Promise((function(r,o){var i=[],a=L(e,n),u=Promise.resolve();a.forEach((function(e){u=u.then((function(n){if(n&&i.push.apply(i,d(n)),!t)return Promise.all(e.map((function(e){return e()})));o("stopped")}))})),u.then((function(e){i.push.apply(i,d(e)),r(i)}))})),destroy:function(){t=!0}}},e.executeWithCount=function(e){var t=0;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.call.apply(e,[this,t++].concat(r))}},e.findNodeList=X,e.findNodeListReverse=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.reverse=!0,X(e,t,n)},e.findParent=G,e.forAll=function(e,t,n){if(n){if(g(e)||x(e)||e.hasOwnProperty("length"))for(var r=e.length-1;r>=0&&!1!==t(e[r],r);r--);else if(O(e)){var o=Object.keys(e);o.reverse();for(var i=0,a=o;i<a.length;i++){var u=a[i];if(!1===t(e[u],u))break}}else if(Number.isInteger(e))for(var c=e-1;c>=0&&!1!==t(c,c);c--);}else if(g(e)||x(e)||e.hasOwnProperty("length"))for(var l=0;l<e.length&&!1!==t(e[l],l);l++);else if(O(e))for(var f=0,s=Object.keys(e);f<s.length;f++){var d=s[f];if(!1===t(e[d],d))break}else if(Number.isInteger(e))for(var v=0;v<e&&!1!==t(v,v);v++);},e.getBorder=function(e){var t=document.body,n=G(e,(function(e){return $(e,"work-area")})),r=W(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:t.offsetHeight<p().innerHeight?p().innerHeight:t.offsetHeight}},e.getBoundingClientRect=z,e.getCss3Prefix=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).noCache||null==h.css3Prefix)&&(h.css3Prefix=function(){var e=document.createElement("div");e.style.cssText="-webkit-transition:all .1s; -moz-transition:all .1s; -o-transition:all .1s; -ms-transition:all .1s; transition:all .1s;";var t=e.style;if(t.webkitTransition)return"-webkit-";if(t.MozTransition)return"-moz-";if(t.oTransition)return"-o-";if(t.msTransition)return"-ms-";return""}()),h.css3Prefix},e.getElSize=Q,e.getElSizeEvenInvisible=Y,e.getImageSizeByUrl=function(e){var t=document.createElement("img");return new Promise((function(n,r){Z(t,"load",(function(){n({width:t.width,height:t.height})})),Z(t,"error",(function(e){r(e)})),t.src=e}))},e.getLocalStorage2=function(){return h.localStorage2||(h.localStorage2=oe(p().localStorage)),h.localStorage2},e.getOffset=W,e.getOffsetParent=H,e.getOuterAttachedHeight=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({margin:!0,border:!0},t);var n=getComputedStyle(e),r=0,o=[];return t.margin&&o.push("margin-top","margin-bottom"),t.border&&o.push("border-top-width","border-bottom-width"),o.forEach((function(e){r+=parseFloat(n[e])})),r},e.getOuterAttachedWidth=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({margin:!0,border:!0},t);var n=getComputedStyle(e),r=0,o=[];return t.margin&&o.push("margin-left","margin-right"),t.border&&o.push("border-left-width","border-right-width"),o.forEach((function(e){r+=parseFloat(n[e])})),r},e.getPosition=function(e){for(var t=H(e),n={x:e.offsetLeft,y:e.offsetTop},r=e;(r=r.parentElement)!==t&&r;)n.x-=r.scrollLeft,n.y-=r.scrollTop;return n},e.getPositionFromOffset=function(e,t){var n=W(H(e));return{x:t.x-n.x,y:t.y-n.y}},e.getScroll=U,e.getSessionStorage2=function(){return h.sessionStorage2||(h.sessionStorage2=oe(p().sessionStorage)),h.sessionStorage2},e.getUrlParam=function(e){var t=document.location.href,n=t.indexOf(e+"=");if(-1==n)return!1;var r=t.slice(e.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r},e.getUserLanguage=function(){return navigator.language||navigator.userLanguage},e.getViewportPosition=q,e.glb=p,e.groupArray=function(e,t){var n=new Map;e.forEach((function(e){var r=t(e);n.has(r)||n.set(r,[]),n.get(r).push(e)}));var r=[];return n.forEach((function(e,t){r.push([t,e])})),r},e.hasClass=$,e.insertAfter=function(e,t){t.parentElement.insertBefore(e,t.nextSibling)},e.insertBefore=function(e,t){t.parentElement.insertBefore(e,t)},e.isArray=g,e.isBool=m,e.isDescendantOf=function(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}},e.isFunction=j,e.isNumber=b,e.isNumeric=w,e.isObject=O,e.isOffsetInEl=function(e,t,n){var r=W(n);return r.x<=e&&r.x+n.offsetWidth>=e&&r.y<=t&&r.y+n.offsetHeight>=t},e.isPromise=function(e){return"[object Promise]"===Object.prototype.toString.call(e)},e.isString=x,e.isset=y,e.iterateALL=R,e.joinFunctionsByNext=function(e){var t=function(){},n=!0,r=!1,o=void 0;try{for(var i,a=R(e,{reverse:!0})[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){t=u(i.value.value,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t;function u(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.apply(void 0,[t].concat(r))}}},e.joinFunctionsByResult=function(e){for(var t=e[0],n=1;n<e.length;n++)t=r(t,e[n]);return t;function r(e,t){return function(n){args;var r=e(n);return t(r)}}},e.joinMethods=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value",r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=t;t=r?function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e.call.apply(e,[this,"value"===n?r.call.apply(r,[this].concat(o)):r].concat(o))}:e},c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return t},e.jqFixedSize=function(e){var t=p().jQuery;t(e).each((function(){var e=t(this);e.css({width:e.width()+"px",height:e.height()+"px"})}))},e.jqMakeCarousel=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"left",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;o.toString().match(/^\d+$/)&&(o+="px");var u=parseFloat(o),c=p().jQuery,l=c(e),f=l.find(t);l.css({position:"relative",height:l.height()+"px"});var s=f.find(n);s.css({margin:"0",marginRight:o});var d=(Math.ceil(s.width())+u)*s.length;f.css({position:"absolute",margin:"0",width:d+"px"});var v=f.height(),h=f.clone(),y=f.clone();f.css({left:0}),h.css({left:d+"px"}),y.css({left:2*d+"px"});var g=c("<div></div>");g.css({position:"absolute",width:3*d+"px",height:v+"px",left:0,top:a}),g.append(f).append(h).append(y),l.append(g);var m=0;!function e(){"left"===i?m-=100:m+=100,g.animate({left:"".concat(m,"px")},r,"linear",(function(){Math.abs(m)>d&&("left"===i?m+=d:m-=d,g.css({left:m+"px"})),e()}))}()},e.kebabCase=E,e.makeStorageHelper=oe,e.mapObjectTree=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,o=0,i=[{value:e}],a=function(){if(o>=r)throw"mapObjectTree: limit(".concat(r,") reached, object may has circular reference");o++;var e=i.shift(),a=e.value,u=e.key,c=e.parent,l=e.newParent,f=t(a,u,c,l),s=function(e,t,r){return g(e)?e=[]:O(e)&&(e={}),c?g(l)&&r?l.push(e):l[t]=e:n=e,e},d=void 0,v=void 0,h=void 0,p=void 0,y=void 0;if(f){var m=f.key,b=f.value;v=b,f.delete||!1===m?h=!0:null==m?d=s(b,u,!0):f.hasOwnProperty("value")&&(d=s(b,m)),p=f.stop,y=f.skip}else v=a,d=s(a,u);if(h)return"continue";if(y)return"continue";if(p)return"break";if(g(v))for(var w=v.length,x=0;x<w;x++)i.push({value:v[x],key:x,parent:v,newParent:d});else O(v)&&Object.keys(v).forEach((function(e){i.push({value:v[e],key:e,parent:v,newParent:d})}))};e:for(;i.length>0;){switch(a()){case"continue":continue;case"break":break e}}return n},e.mapObjects=M,e.max=k,e.min=function(e,t){return e<t?t:e},e.newArrayRemoveAt=function(e,t){t=N(t);var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){n[a.value]=!0}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}for(var c=[],l=e.length,f=0;f<l;f++)n[f]||c.push(e[f]);return c},e.numPad=function(e,t){for(var n=e.toString().length;n<t;)e="0"+e,n++;return e},e.numRand=S,e.objectExcept=function(e,t){var n={};for(var r in e)-1===t.indexOf(r)&&(n[r]=e[r]);return n},e.objectGet=B,e.objectMap=function(e,t){var n={};for(var r in e)n[r]=t(e[r],r,e);return n},e.objectMerge=function(e,t){for(var n in t)e.hasOwnProperty(n)&&O(e[n])&&O(t[n])?Object.assign(e[n],t[n]):e[n]=t[n];return e},e.objectOnly=function(e,t){var n={};for(var r in e)t.indexOf(r)>-1&&(n[r]=e[r]);return n},e.objectSet=function(e,t,n){var r=g(t)?t:t.split("."),o=I(r),i=B(e,r.slice(0,r.length-1));if(!i)throw"Path does not exist";i[o]=n},e.offDOM=K,e.offsetToViewportPosition=function(e){var t=document.body,n=W(t),r=q(t);return{x:e.x+r.x-n.x,y:e.y+r.y-n.y}},e.onDOM=Z,e.onDOMMany=function(e,t,n){e=N(e),t=N(t);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];var a=!0,u=!1,c=void 0;try{for(var l,f=e[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var s=l.value,d=!0,v=!1,h=void 0;try{for(var p,y=t[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var g=p.value;Z.apply(void 0,[s,g,n].concat(o))}}catch(e){v=!0,h=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw h}}}}catch(e){u=!0,c=e}finally{try{a||null==f.return||f.return()}finally{if(u)throw c}}return function(){var r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,l=!0,f=!1,s=void 0;try{for(var d,v=t[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){K(c,d.value,n)}}catch(e){f=!0,s=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw s}}}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}},e.onQuickKeydown=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({timeout:1e3},t);var n,r="",o=function(o){o.key&&1===o.key.length&&(r="".concat(r).concat(o.key),e(r),n&&(clearTimeout(n),n=null),setTimeout((function(){r=""}),t.timeout))};return Z(document,"keydown",o),function(){K(document,"keydown",o)}},e.openCenterWindow=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={width:n,height:r,top:(p().screen.availHeight-30-r)/2,left:(p().screen.availWidth-30-n)/2};Object.assign(i,o),ne(e,t,i)},e.openWindow=ne,e.pairRows=function(e,t,n,r){r||(r=n);var o=M(t,r);return e.map((function(e){return[e,o[e[n]]]}))},e.prependTo=function(e,t){t.insertBefore(e,t.firstChild)},e.promiseTimeout=function(e,t){return new Promise((function(n,r){var o,i;e.then((function(){clearTimeout(o),n.apply(void 0,arguments)}),(function(){i||(clearTimeout(o),r.apply(void 0,arguments))})),o=setTimeout((function(){i=!0;var e=new Error("Promise timeout!");e.name="timeout",r(e)}),t)}))},e.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},e.removeEl=function(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)},e.replaceMultiple=function(e,t){var n=new RegExp(Object.keys(e).join("|"),"g");return t.replace(n,(function(t){return e[t]}))},e.resolveArgsByType=function(e,t){var n=0;return t.map((function(t){var r,o;if(g(t)?(r=t[0],o=t[1]):(r=t,o=void 0),!j(r))if(null==r)r=function(){return!0};else{var i=r;r=function(e){return Object.prototype.toString.call(e)==="[object ".concat(i,"]")}}var a=e[n];return r(a)?(n++,a):o}))},e.resolveValueOrGettter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return j(e)?e.apply(void 0,d(t)):e},e.restoreAttr=V,e.retry=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;h.retry||(h.retry={});var r=e,o=function e(){var t=Math.random()+"";return r[t]?e():t}();return r[o]=0,function e(i,a,u){return t(i,a,u).then((function(e){return delete r[o],e})).catch((function(t){return r[o]++,r[o]>=n?(delete r[o],Promise.reject(t)):e(i,a,u)}))}},e.setElChildByIndex=function(e,t,n){n.childComponentIndex=t;var r=e.childNodes.length;if(0===r)e.appendChild(n);else if(0===t)e.insertBefore(n,e.childNodes[0]);else{var o=ee(e.childNodes,(function(e){return e.childComponentIndex-t}),0,k(t,r-1),!0),i=o.index,a=o.value;if(o.bigger)e.insertBefore(n,a);else{var u=e.childNodes[i+1];u?e.insertBefore(n,u):e.appendChild(n)}}},e.snakeCase=function(e){return E(e).replace(/-/g,"_")},e.splitArray=L,e.store=h,e.store_executeOnceInScopeByName={},e.strRand=C,e.studlyCase=P,e.titleCase=function(e){return T(P(A(e))).join(" ").replace(/\bid\b/gi,"ID")},e.toArrayIfNot=N,e.uniqueId=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",n=t+C();h.uniqueId||(h.uniqueId={});var r=h.uniqueId;return document.getElementById(n)||r[n]?e(t):(r[n]=!0,n)},e.unset=function(e,t){e[t]=void 0;try{delete e[t]}catch(e){}},e.viewportPositionToOffset=function(e){var t=document.body,n=W(t),r=q(t);return{x:e.x+n.x-r.x,y:e.y+n.y-r.y}},e.waitFor=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;j(e)&&(r=n,n=w(t)?t:100,t=e,e=null),h.waitFor||(h.waitFor={});var o=h.waitFor;return e&&y(o[e])&&(p().clearInterval(o[e]),delete o[e]),new Promise((function(i,a){var u=0;function c(n){u<=r?t()&&(l(n,e),i()):(l(n,e),a(new Error("waitFor: Limit is reached"))),u++}function l(e,t){e&&(t&&y(o[t])?(p().clearInterval(o[t]),delete o[t]):p().clearInterval(e))}var f=p().setInterval((function(){c(f)}),n);e&&(o[e]=f),c()}))},e.waitTime=te,e.watchChange=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=e.apply(void 0,o);n!==a&&t.apply(void 0,[a].concat(o)),n=a}},e.windowLoaded=function(){return new Promise((function(e,t){document&&"complete"===document.readyState?e():p().addEventListener("load",(function t(){e(),p().removeEventListener("load",t)}))}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).helperJs={})}(this,(function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function d(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var v=regeneratorRuntime.mark(R),h={};function p(){if(h.glb)return h.glb;var e;try{e=global}catch(t){e=window}return h.glb=e,e}function y(e){return void 0!==e}function g(e){return"[object Array]"===Object.prototype.toString.call(e)}function m(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function b(e){return"[object Number]"===Object.prototype.toString.call(e)}function w(e){return isFinite(e)&&!isNaN(parseFloat(e))}function x(e){return"[object String]"===Object.prototype.toString.call(e)}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function j(e){return"function"==typeof e}function S(e,t){return 1===arguments.length&&(t=e,e=0),Math.floor(Math.random()*(t-e+1)+e)}function k(e,t){return e<t?e:t}function P(e){return e&&e[0].toUpperCase()+e.substr(1)}function E(e){return e.replace(/ /g,"-").replace(/_/g,"-").replace(/([A-Z])/g,"-$1").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function A(e){for(var t=e.toString().split(/[-_]/),n=1;n<t.length;n++)t[n]=P(t[n]);return t.join("")}function T(e){return e.toString().trim().split(/(?=[A-Z])/)}function C(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=r[S(r.length-1)];return t+n}function _(e,t){for(var n,r=0;(n=e.indexOf(t))>-1;)e.splice(n,1),r++;return r}function I(e){return e[e.length-1]}function N(e){return g(e)?e:[e]}function L(e,t){var n=[];if(j(t))for(var r=t,o=1,i=0;i<e.length;){var a=i+r(o);n.push(e.slice(i,a)),i=a,o++}else for(var u=0;u<e.length;){var c=u+t;n.push(e.slice(u,c)),u=c}return n}function R(e){var t,n,r,o,i,a,u,c,l,s,f,d,h,p,y=arguments;return regeneratorRuntime.wrap((function(v){for(;;)switch(v.prev=v.next){case 0:if((t=y.length>1&&void 0!==y[1]?y[1]:{}).reverse){v.next=30;break}if(null==e.length){v.next=14;break}n=0;case 4:if(!(n<e.length)){v.next=12;break}if(r={value:e[n],index:n},t.exclude&&t.exclude(r)){v.next=9;break}return v.next=9,r;case 9:n++,v.next=4;break;case 12:v.next=28;break;case 14:if(!O(e)){v.next=27;break}o=0,i=Object.keys(e);case 16:if(!(o<i.length)){v.next=25;break}if(a=i[o],u={value:e[a],key:a},t.exclude&&t.exclude(u)){v.next=22;break}return v.next=22,u;case 22:o++,v.next=16;break;case 25:v.next=28;break;case 27:throw"Unsupported type";case 28:v.next=58;break;case 30:if(null==e.length){v.next=42;break}c=e.length-1;case 32:if(!(c>=0)){v.next=40;break}if(l={value:e[c],index:c},t.exclude&&t.exclude(l)){v.next=37;break}return v.next=37,l;case 37:c--,v.next=32;break;case 40:v.next=58;break;case 42:if(!O(e)){v.next=57;break}(s=Object.keys(e)).reverse(),f=0,d=s;case 46:if(!(f<d.length)){v.next=55;break}if(h=d[f],p={value:e[h],key:h},t.exclude&&t.exclude(p)){v.next=52;break}return v.next=52,p;case 52:f++,v.next=46;break;case 55:v.next=58;break;case 57:throw"Unsupported type";case 58:case"end":return v.stop()}}),v)}function B(e,t,n){var r=g(t)?t:t.split("."),o=e;try{var i=!0,a=!1,u=void 0;try{for(var c,l=r[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){o=o[c.value]}}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}}catch(e){if(n)throw"Path does not exist"}return o}function M(e,t){for(var n={},r=e.length,o=0;o<r;o++){var i=e[o];n[j(t)?t(i,o):i[t]]=i}return n}function F(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[],a=[],u=function(){for(var u=this,c=arguments.length,l=new Array(c),s=0;s<c;s++)l[s]=arguments[s];return new Promise((function(c,s){i.push(c),a.push(s),r=l,n||(n=!0,t=setTimeout((function(){var o=e.call.apply(e,[u].concat(d(r)));t=null,n=!1,i.forEach((function(e){return e(o)})),i=[],a=[]}),o))}))};return u.stop=function(){t&&(clearTimeout(t),t=null),n=!1,i=[],a.forEach((function(e){return e()})),a=[]},u}function D(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=function(){var i=this;return new Promise((function(a,u){n?a(r):(n=!0,a(r=e.call.apply(e,[i].concat(d(lastArgs)))),t=setTimeout((function(){t=null,n=!1,r=null}),o))}))};return i.stop=function(){t&&(clearTimeout(t),t=null),n=!1},i}function U(){if("undefined"!=typeof pageYOffset)return{top:pageYOffset,left:pageXOffset};var e=document.body,t=document.documentElement;return{top:(t=t.clientHeight?t:e).scrollTop,left:t.scrollLeft}}function W(e){var t=z(e),n=U();return{x:t.left+n.left,y:t.top+n.top}}function H(e){var t=e.offsetParent;return(!t||t===document.body&&"static"===getComputedStyle(document.body).position)&&(t=document.body.parentElement),t}function z(e){var t=e.getBoundingClientRect(),n=t.top-document.documentElement.clientTop,r=t.bottom,o=t.left-document.documentElement.clientLeft,i=t.right;return{top:n,right:i,bottom:r,left:o,width:t.width||i-o,height:t.height||r-n,x:o,y:n}}var q=z;function G(e,t,n){for(var r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function J(e,t){e["original_".concat(t)]=e.getAttribute(t)}function V(e,t){var n="original_".concat(t);e.setAttribute(t,e[n])}function $(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function Q(e){J(e,"style"),e.style.display="block";var t=z(e),n={width:t.width,height:t.height};return V(e,"style"),n}var Y=Q;function Z(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function K(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function X(e,t){var n=R(e,{reverse:(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).reverse}),r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,l=c.value;if(t(l,c.index))return l}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}function ee(e,t,n,r,o){var i,a,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e3;null==n&&(n=0,r=e.length-1);for(var c,l=0;n>=0&&n<=r;){if(l>=u)throw Error("binarySearch: loop times is over ".concat(u,", you can increase the limit."));if((c=t(a=e[i=Math.floor((r-n)/2+n)],l))>0)r=i-1;else{if(!(c<0))return{index:i,value:a,count:l+1,hit:!0};n=i+1}l++}return o?{index:i,value:a,count:l+1,hit:!1,bigger:c>0}:null}function te(e,t){return new Promise((function(n,r){setTimeout((function(){t&&t(),n()}),e)}))}function ne(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p().open(e,t,Object.keys(n).map((function(e){return"".concat(e,"=").concat(n[e])})).join(","))}var re=function(){function e(t){var r=this;n(this,e),this.baseUrl="",this.search={};var o=decodeURI(t).split("?");this.baseUrl=o[0],o[1]&&o[1].split("&").forEach((function(e){var t=e.split("=");r.search[t[0]]=null==t[1]?"":decodeURIComponent(t[1])}))}return o(e,[{key:"getHref",value:function(){var e=this,t=[this.baseUrl],n=Object.keys(this.search).map((function(t){return"".concat(t,"=").concat(encodeURIComponent(e.search[t]))})).join("&");return n&&t.push(n),t.join("?")}}]),e}();function oe(e){return{storage:e,set:function(e,t,n){null==t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify({value:t,expired_at:n?(new Date).getTime()+60*n*1e3:null}))},get:function(e){var t=this.storage.getItem(e);if(t){if(!(t=JSON.parse(t)).expired_at||t.expired_at>(new Date).getTime())return t.value;this.storage.removeItem(e)}return null},clear:function(){this.storage.clear()}}}var ie=function(){function e(){n(this,e),this.eventStore=[]}return o(e,[{key:"on",value:function(e,t){this.eventStore.push({name:e,handler:t})}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,o)},o=function(){t.apply(void 0,arguments),r()};return this.on(e,o),r}},{key:"onceTimeout",value:function(e,t,n){var r,o=this;return{off:function(){r&&r()},promise:new Promise((function(i,a){r=o.once(e,(function(){t.apply(void 0,arguments),i()})),te(n).then((function(){r(),a()}))}))}}},{key:"off",value:function(e,t){for(var n=[],r=this.eventStore.length,o=0;o<r;o++){var i=this.eventStore[o];i.name===e&&i.handler===t&&n.unshift(o)}for(var a=0,u=n;a<u.length;a++){var c=u[a];this.eventStore.splice(c,1)}}},{key:"emit",value:function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=this.eventStore[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value;u.name===e&&t.push(u)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}for(var c=arguments.length,l=new Array(c>1?c-1:0),s=1;s<c;s++)l[s-1]=arguments[s];for(var f=0,d=t;f<d.length;f++){var v=d[f];v.handler.apply(v,l)}}}]),e}(),ae=function(e){function t(e){var r;return n(this,t),(r=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?s(e):t}(this,c(t).call(this))).storageName="_crossWindow",r.windows=[],r.timeout=200,r.BROADCAST="__BROADCAST__",e&&Object.assign(s(r),e),Z(window,"storage",(function(e){if(e.key===r.storageName){var t,n=JSON.parse(e.newValue);if(!n.targets||n.targets.includes(r.id))(t=r).emitLocal.apply(t,[n.name].concat(d(n.args)))}})),r.id=C(),r.windows=[r.id],r.ready=new Promise((function(e,t){r.onceTimeout("_windows_updated",(function(e){var t=e.windows;r.windows=t}),r.timeout).promise.then((function(){e()}),(function(){e()})),r.broadcast("_join",r.id)})),r.ready.then((function(){r.on("_join",(function(e){r.windows.push(e),r.isMain()&&r.broadcast("_windows_updated",{windows:r.windows,type:"join",id:e})})),r.on("_windows_updated",(function(e){var t=e.windows;r.windows=t})),r.on("_exit",(function(e){var t=r.windows[0];_(r.windows,e),r.isMain()&&(r.emit("_windows_updated",{windows:r.windows,type:"exit",id:e}),t!=r.id&&(console.log("_main_updated"),r.emit("_main_updated",{windows:r.windows,old:t,new:r.id})))})),Z(window,"beforeunload",(function(){r.exitGroup()}))})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),o(t,[{key:"isMain",value:function(){return this.id===this.windows[0]}},{key:"emitTo",value:function(e,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var a;n===this.BROADCAST?n=null:(n&&!g(n)&&(n=[n]),n.includes(this.id)&&(a=f(c(t.prototype),"emit",this)).call.apply(a,[this,e].concat(o)));p().localStorage.setItem(this.storageName,JSON.stringify({name:e,targets:n,args:o,random:Math.random()}))}},{key:"emitLocal",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.id].concat(n))}},{key:"broadcast",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.BROADCAST].concat(n))}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.emitTo.apply(this,[e,this.windows].concat(n))}},{key:"exitGroup",value:function(){this.broadcast("_exit",this.id)}}]),t}(ie),ue=ae;var ce=function(){function e(){n(this,e),this.store={}}return o(e,[{key:"has",value:function(e){return this.store.hasOwnProperty(e)}},{key:"remember",value:function(e,t){return this.has(e)||(this.store[e]={value:t()}),this.store[e].value}},{key:"forget",value:function(e){e?this.has(e)&&delete this.store[e]:this.store={}}}]),e}();e.Cache=ce,e.CrossWindow=ue,e.CrossWindowEventProcessor=ae,e.EventProcessor=ie,e.URLHelper=re,e.addClass=function(e,t){$(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)},e.appendTo=function(e,t){t.appendChild(e)},e.arrayAt=function(e,t){return e[t>=0?t:e.length+t]},e.arrayDiff=function(e,t){for(var n=e.length,r=[];n--;)t.indexOf(e[n])<0&&r.push(e[n]);return r},e.arrayDistinct=function(e){return p().Set?d(new Set(e)):e.filter((function(e,t,n){return n.indexOf(e)===t}))},e.arrayFirst=function(e){return e[0]},e.arrayGet=function(e,t,n){return t<0&&(t+=e.length),null==n?e[t]:(n<0&&(n+=e.length),e.slice(t,n-t+1))},e.arrayLast=I,e.arrayRemove=_,e.arrayRemoveBySortedIndexes=function(e,t){for(var n=t.length-1;n>=0;n--){var r=t[n];e.splice(r,1)}},e.arraySibling=function(e,t,n){var r=e.indexOf(t);if(-1===r)throw"item is not in array";return g(n)?n.map((function(t){return e[r+t]})):e[r+n]},e.arrayWithoutEnd=function(e,t){return e.slice(0,e.length-t)},e.assignIfDifferent=function(e,t,n){e[t]!==n&&(e[t]=n)},e.attachCache=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ce,r=function(r){var o=t[r];Object.defineProperty(e,r,{get:function(){var e=this;return n.remember(r,(function(){return o.call(e)}))}})};for(var o in t)r(o)},e.backupAttr=J,e.binarySearch=ee,e.camelCase=A,e.camelToWords=T,e.cloneObj=function e(n,r){switch(t(n)){case"undefined":case"boolean":case"nuber":case"string":case"function":return n;case"object":if(null===n)return n;var o;if(g(n)){o=[];var i=!0,a=!1,u=void 0;try{for(var c,l=n[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var s=c.value;o.push(e(s,r))}}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}}else{o={};for(var f=0,d=Object.keys(n);f<d.length;f++){var v=d[f];r&&(!g(r)||r.includes(v))&&r(v,n[v],n)||(o[v]=e(n[v],r))}}return o;default:return n}},e.copyTextToClipboard=function(e){try{return void navigator.clipboard.writeText(e)}catch(e){}var t=document.createElement("textarea");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="2em",t.style.height="2em",t.style.padding=0,t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Copying text command was "+n)}catch(e){console.log("Oops, unable to copy")}document.body.removeChild(t)},e.debounce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).immediate?D(e,t):F(e,t)},e.debounceImmediate=D,e.debounceTrailing=F,e.elementsFromPoint=function(){for(var e=document.elementsFromPoint||document.msElementsFromPoint||function(e,t){var n=[],r=void 0;do{r!==document.elementFromPoint(e,t)?(r=document.elementFromPoint(e,t),n.push(r),r.style.pointerEvents="none"):r=!1}while(r);return n.forEach((function(e){return e.style.pointerEvents="all"})),n},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(document,n)},e.empty=function(e){return null==e||(null!=e.length?0===e.length:!m(e)&&(b(e)?isNaN(e):O(e)?0===Object.keys(e).length:void 0))},e.executeOnceInScopeByName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:scope_executeOnceInScopeByName,r=arguments.length>3?arguments[3]:void 0;if(e="executeOnceInScopeByName_".concat(e),!n[e]){var o=t();n[e]={destroy:function(){delete n[e]}},r&&(n[e].value=o)}return n[e]},e.executePromiseGetters=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{promise:new Promise((function(r,o){var i=[],a=L(e,n),u=Promise.resolve();a.forEach((function(e){u=u.then((function(n){if(n&&i.push.apply(i,d(n)),!t)return Promise.all(e.map((function(e){return e()})));o("stopped")}))})),u.then((function(e){i.push.apply(i,d(e)),r(i)}))})),destroy:function(){t=!0}}},e.executeWithCount=function(e){var t=0;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.call.apply(e,[this,t++].concat(r))}},e.findNodeList=X,e.findNodeListReverse=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.reverse=!0,X(e,t,n)},e.findParent=G,e.forAll=function(e,t,n){if(n){if(g(e)||x(e)||e.hasOwnProperty("length"))for(var r=e.length-1;r>=0&&!1!==t(e[r],r);r--);else if(O(e)){var o=Object.keys(e);o.reverse();for(var i=0,a=o;i<a.length;i++){var u=a[i];if(!1===t(e[u],u))break}}else if(Number.isInteger(e))for(var c=e-1;c>=0&&!1!==t(c,c);c--);}else if(g(e)||x(e)||e.hasOwnProperty("length"))for(var l=0;l<e.length&&!1!==t(e[l],l);l++);else if(O(e))for(var s=0,f=Object.keys(e);s<f.length;s++){var d=f[s];if(!1===t(e[d],d))break}else if(Number.isInteger(e))for(var v=0;v<e&&!1!==t(v,v);v++);},e.getBorder=function(e){var t=document.body,n=G(e,(function(e){return $(e,"work-area")})),r=W(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:t.offsetHeight<p().innerHeight?p().innerHeight:t.offsetHeight}},e.getBoundingClientRect=z,e.getCss3Prefix=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).noCache||null==h.css3Prefix)&&(h.css3Prefix=function(){var e=document.createElement("div");e.style.cssText="-webkit-transition:all .1s; -moz-transition:all .1s; -o-transition:all .1s; -ms-transition:all .1s; transition:all .1s;";var t=e.style;if(t.webkitTransition)return"-webkit-";if(t.MozTransition)return"-moz-";if(t.oTransition)return"-o-";if(t.msTransition)return"-ms-";return""}()),h.css3Prefix},e.getElSize=Q,e.getElSizeEvenInvisible=Y,e.getImageSizeByUrl=function(e){var t=document.createElement("img");return new Promise((function(n,r){Z(t,"load",(function(){n({width:t.width,height:t.height})})),Z(t,"error",(function(e){r(e)})),t.src=e}))},e.getLocalStorage2=function(){return h.localStorage2||(h.localStorage2=oe(p().localStorage)),h.localStorage2},e.getOffset=W,e.getOffsetParent=H,e.getOuterAttachedHeight=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({margin:!0,border:!0},t);var n=getComputedStyle(e),r=0,o=[];return t.margin&&o.push("margin-top","margin-bottom"),t.border&&o.push("border-top-width","border-bottom-width"),o.forEach((function(e){r+=parseFloat(n[e])})),r},e.getOuterAttachedWidth=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({margin:!0,border:!0},t);var n=getComputedStyle(e),r=0,o=[];return t.margin&&o.push("margin-left","margin-right"),t.border&&o.push("border-left-width","border-right-width"),o.forEach((function(e){r+=parseFloat(n[e])})),r},e.getPosition=function(e){for(var t=H(e),n={x:e.offsetLeft,y:e.offsetTop},r=e;(r=r.parentElement)!==t&&r;)n.x-=r.scrollLeft,n.y-=r.scrollTop;return n},e.getPositionFromOffset=function(e,t){var n=W(H(e));return{x:t.x-n.x,y:t.y-n.y}},e.getScroll=U,e.getSessionStorage2=function(){return h.sessionStorage2||(h.sessionStorage2=oe(p().sessionStorage)),h.sessionStorage2},e.getUrlParam=function(e){var t=document.location.href,n=t.indexOf(e+"=");if(-1==n)return!1;var r=t.slice(e.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r},e.getUserLanguage=function(){return navigator.language||navigator.userLanguage},e.getViewportPosition=q,e.glb=p,e.groupArray=function(e,t){var n=new Map;e.forEach((function(e){var r=t(e);n.has(r)||n.set(r,[]),n.get(r).push(e)}));var r=[];return n.forEach((function(e,t){r.push([t,e])})),r},e.hasClass=$,e.insertAfter=function(e,t){t.parentElement.insertBefore(e,t.nextSibling)},e.insertBefore=function(e,t){t.parentElement.insertBefore(e,t)},e.isArray=g,e.isBool=m,e.isDescendantOf=function(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}},e.isFunction=j,e.isNumber=b,e.isNumeric=w,e.isObject=O,e.isOffsetInEl=function(e,t,n){var r=W(n);return r.x<=e&&r.x+n.offsetWidth>=e&&r.y<=t&&r.y+n.offsetHeight>=t},e.isPromise=function(e){return"[object Promise]"===Object.prototype.toString.call(e)},e.isString=x,e.isset=y,e.iterateALL=R,e.joinFunctionsByNext=function(e){var t=function(){},n=!0,r=!1,o=void 0;try{for(var i,a=R(e,{reverse:!0})[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){t=u(i.value.value,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t;function u(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.apply(void 0,[t].concat(r))}}},e.joinFunctionsByResult=function(e){for(var t=e[0],n=1;n<e.length;n++)t=r(t,e[n]);return t;function r(e,t){return function(n){args;var r=e(n);return t(r)}}},e.joinMethods=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value",r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=t;t=r?function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e.call.apply(e,[this,"value"===n?r.call.apply(r,[this].concat(o)):r].concat(o))}:e},c=e[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return t},e.jqFixedSize=function(e){var t=p().jQuery;t(e).each((function(){var e=t(this);e.css({width:e.width()+"px",height:e.height()+"px"})}))},e.jqMakeCarousel=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"left",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;o.toString().match(/^\d+$/)&&(o+="px");var u=parseFloat(o),c=p().jQuery,l=c(e),s=l.find(t);l.css({position:"relative",height:l.height()+"px"});var f=s.find(n);f.css({margin:"0",marginRight:o});var d=(Math.ceil(f.width())+u)*f.length;s.css({position:"absolute",margin:"0",width:d+"px"});var v=s.height(),h=s.clone(),y=s.clone();s.css({left:0}),h.css({left:d+"px"}),y.css({left:2*d+"px"});var g=c("<div></div>");g.css({position:"absolute",width:3*d+"px",height:v+"px",left:0,top:a}),g.append(s).append(h).append(y),l.append(g);var m=0;!function e(){"left"===i?m-=100:m+=100,g.animate({left:"".concat(m,"px")},r,"linear",(function(){Math.abs(m)>d&&("left"===i?m+=d:m-=d,g.css({left:m+"px"})),e()}))}()},e.kebabCase=E,e.makeStorageHelper=oe,e.mapObjectTree=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4,o=0,i=[{value:e}],a=function(){if(o>=r)throw"mapObjectTree: limit(".concat(r,") reached, object may has circular reference");o++;var e=i.shift(),a=e.value,u=e.key,c=e.parent,l=e.newParent,s=t(a,u,c,l),f=function(e,t,r){return g(e)?e=[]:O(e)&&(e={}),c?g(l)&&r?l.push(e):l[t]=e:n=e,e},d=void 0,v=void 0,h=void 0,p=void 0,y=void 0;if(s){var m=s.key,b=s.value;v=b,s.delete||!1===m?h=!0:null==m?d=f(b,u,!0):s.hasOwnProperty("value")&&(d=f(b,m)),p=s.stop,y=s.skip}else v=a,d=f(a,u);if(h)return"continue";if(y)return"continue";if(p)return"break";if(g(v))for(var w=v.length,x=0;x<w;x++)i.push({value:v[x],key:x,parent:v,newParent:d});else O(v)&&Object.keys(v).forEach((function(e){i.push({value:v[e],key:e,parent:v,newParent:d})}))};e:for(;i.length>0;){switch(a()){case"continue":continue;case"break":break e}}return n},e.mapObjects=M,e.max=k,e.min=function(e,t){return e<t?t:e},e.newArrayRemoveAt=function(e,t){t=N(t);var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){n[a.value]=!0}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}for(var c=[],l=e.length,s=0;s<l;s++)n[s]||c.push(e[s]);return c},e.numPad=function(e,t){for(var n=e.toString().length;n<t;)e="0"+e,n++;return e},e.numRand=S,e.objectExcept=function(e,t){var n={};for(var r in e)-1===t.indexOf(r)&&(n[r]=e[r]);return n},e.objectGet=B,e.objectMap=function(e,t){var n={};for(var r in e)n[r]=t(e[r],r,e);return n},e.objectMerge=function(e,t){for(var n in t)e.hasOwnProperty(n)&&O(e[n])&&O(t[n])?Object.assign(e[n],t[n]):e[n]=t[n];return e},e.objectOnly=function(e,t){var n={};for(var r in e)t.indexOf(r)>-1&&(n[r]=e[r]);return n},e.objectSet=function(e,t,n){var r=g(t)?t:t.split("."),o=I(r),i=B(e,r.slice(0,r.length-1));if(!i)throw"Path does not exist";i[o]=n},e.offDOM=K,e.offsetToViewportPosition=function(e){var t=document.body,n=W(t),r=q(t);return{x:e.x+r.x-n.x,y:e.y+r.y-n.y}},e.onDOM=Z,e.onDOMMany=function(e,t,n){e=N(e),t=N(t);for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];var a=!0,u=!1,c=void 0;try{for(var l,s=e[Symbol.iterator]();!(a=(l=s.next()).done);a=!0){var f=l.value,d=!0,v=!1,h=void 0;try{for(var p,y=t[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var g=p.value;Z.apply(void 0,[f,g,n].concat(o))}}catch(e){v=!0,h=e}finally{try{d||null==y.return||y.return()}finally{if(v)throw h}}}}catch(e){u=!0,c=e}finally{try{a||null==s.return||s.return()}finally{if(u)throw c}}return function(){var r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,l=!0,s=!1,f=void 0;try{for(var d,v=t[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){K(c,d.value,n)}}catch(e){s=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(s)throw f}}}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}},e.onQuickKeydown=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=u({timeout:1e3},t);var n,r="",o=function(o){o.key&&1===o.key.length&&(r="".concat(r).concat(o.key),e(r),n&&(clearTimeout(n),n=null),setTimeout((function(){r=""}),t.timeout))};return Z(document,"keydown",o),function(){K(document,"keydown",o)}},e.openCenterWindow=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i={width:n,height:r,top:(p().screen.availHeight-30-r)/2,left:(p().screen.availWidth-30-n)/2};Object.assign(i,o),ne(e,t,i)},e.openWindow=ne,e.pairRows=function(e,t,n,r){r||(r=n);var o=M(t,r);return e.map((function(e){return[e,o[e[n]]]}))},e.prependTo=function(e,t){t.insertBefore(e,t.firstChild)},e.promiseTimeout=function(e,t){return new Promise((function(n,r){var o,i;e.then((function(){clearTimeout(o),n.apply(void 0,arguments)}),(function(){i||(clearTimeout(o),r.apply(void 0,arguments))})),o=setTimeout((function(){i=!0;var e=new Error("Promise timeout!");e.name="timeout",r(e)}),t)}))},e.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},e.removeEl=function(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)},e.replaceMultiple=function(e,t){var n=new RegExp(Object.keys(e).join("|"),"g");return t.replace(n,(function(t){return e[t]}))},e.resolveArgsByType=function(e,t){var n=0;return t.map((function(t){var r,o;if(g(t)?(r=t[0],o=t[1]):(r=t,o=void 0),!j(r))if(null==r)r=function(){return!0};else{var i=r;r=function(e){return Object.prototype.toString.call(e)==="[object ".concat(i,"]")}}var a=e[n];return r(a)?(n++,a):o}))},e.resolveValueOrGettter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return j(e)?e.apply(void 0,d(t)):e},e.restoreAttr=V,e.retry=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;h.retry||(h.retry={});var r=e,o=function e(){var t=Math.random()+"";return r[t]?e():t}();return r[o]=0,function e(i,a,u){return t(i,a,u).then((function(e){return delete r[o],e})).catch((function(t){return r[o]++,r[o]>=n?(delete r[o],Promise.reject(t)):e(i,a,u)}))}},e.setElChildByIndex=function(e,t,n){n.childComponentIndex=t;var r=e.childNodes.length;if(0===r)e.appendChild(n);else if(0===t)e.insertBefore(n,e.childNodes[0]);else{var o=ee(e.childNodes,(function(e){return e.childComponentIndex-t}),0,k(t,r-1),!0),i=o.index,a=o.value;if(o.bigger)e.insertBefore(n,a);else{var u=e.childNodes[i+1];u?e.insertBefore(n,u):e.appendChild(n)}}},e.snakeCase=function(e){return E(e).replace(/-/g,"_")},e.splitArray=L,e.store=h,e.store_executeOnceInScopeByName={},e.strRand=C,e.studlyCase=P,e.titleCase=function(e){return T(P(A(e))).join(" ").replace(/\bid\b/gi,"ID")},e.toArrayIfNot=N,e.uniqueId=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",n=t+C();h.uniqueId||(h.uniqueId={});var r=h.uniqueId;return document.getElementById(n)||r[n]?e(t):(r[n]=!0,n)},e.unset=function(e,t){e[t]=void 0;try{delete e[t]}catch(e){}},e.viewportPositionToOffset=function(e){var t=document.body,n=W(t),r=q(t);return{x:e.x+n.x-r.x,y:e.y+n.y-r.y}},e.waitFor=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;j(e)&&(r=n,n=w(t)?t:100,t=e,e=null),h.waitFor||(h.waitFor={});var o=h.waitFor;return e&&y(o[e])&&(p().clearInterval(o[e]),delete o[e]),new Promise((function(i,a){var u=0;function c(n){u<=r?t()&&(l(n,e),i()):(l(n,e),a(new Error("waitFor: Limit is reached"))),u++}function l(e,t){e&&(t&&y(o[t])?(p().clearInterval(o[t]),delete o[t]):p().clearInterval(e))}var s=p().setInterval((function(){c(s)}),n);e&&(o[e]=s),c()}))},e.waitTime=te,e.watchChange=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=e.apply(void 0,o);n!==a&&t.apply(void 0,[a].concat(o)),n=a}},e.windowLoaded=function(){return new Promise((function(e,t){document&&"complete"===document.readyState?e():p().addEventListener("load",(function t(){e(),p().removeEventListener("load",t)}))}))},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=helper-js.min.js.map |
{ | ||
"name": "helper-js", | ||
"version": "1.4.13", | ||
"version": "1.4.14", | ||
"description": "", | ||
@@ -11,4 +11,4 @@ "main": "dist/helper-js.cjs.js", | ||
"scripts": { | ||
"build": "node build/build.js", | ||
"dev": "node build/build.js --watch" | ||
"build": "node scripts/build.js", | ||
"dev": "node scripts/build.js --watch" | ||
}, | ||
@@ -25,15 +25,3 @@ "author": "phphe <phphe@outlook.com> (https://github.com/phphe)", | ||
"devDependencies": { | ||
"@babel/core": "^7.7.7", | ||
"@babel/plugin-proposal-class-properties": "^7.7.4", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.7.4", | ||
"@babel/plugin-proposal-json-strings": "^7.7.4", | ||
"@babel/plugin-syntax-dynamic-import": "^7.7.4", | ||
"@babel/plugin-syntax-import-meta": "^7.7.4", | ||
"@babel/preset-env": "^7.7.7", | ||
"@rollup/plugin-json": "^4.0.1", | ||
"@rollup/plugin-node-resolve": "^6.0.0", | ||
"commander": "^4.0.1", | ||
"rollup": "^1.27.14", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-terser": "^5.1.3" | ||
"rollup-helper": "^2.0.1" | ||
}, | ||
@@ -40,0 +28,0 @@ "dependencies": {}, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
351387
7736