6 lines
31 KiB
JavaScript
6 lines
31 KiB
JavaScript
|
/**
|
||
|
* xe-utils.js v3.5.14
|
||
|
* MIT License.
|
||
|
* @preserve
|
||
|
*/
|
||
|
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.XEUtils=t()}(this,function(){"use strict";var D={cookies:{path:"/"},treeOptions:{parentKey:"parentId",key:"id",children:"children"},parseDateFormat:"yyyy-MM-dd HH:mm:ss",firstDayOfWeek:1},r=function(){};function n(a){return function(n,t){var r=Rn(t)?t:D.firstDayOfWeek,e=lr(n,0,r,r);if($t(e)){var u=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=a(e),o=i.getDay();return r<o&&i.setDate(7-o+r+1),o<r&&i.setDate(r-o+1),Math.floor((m(u)-m(i))/H+1)}return NaN}}function t(n,e){var u=Object[n];return function(t){var r=[];if(t){if(u)return u(t);ht(t,1<e?function(n){r.push([""+n,t[n]])}:function(){r.push(arguments[e])})}return r}}function e(e,u){return function(n,t){if(n){if(n[e])return n[e](t);if(zn(n)||Fn(n))return u(n,t);for(var r in n)if(jn(n,r)&&t===n[r])return r}return-1}}function u(t){return function(n){return"[object "+t+"]"===U.call(n)}}function i(t){return function(n){return typeof n===t}}function o(o,a,f,c,l){return function(n,t,r){if(n&&t){if(o&&n[o])return n[o](t,r);if(a&&Fn(n)){for(var e=0,u=n.length;e<u;e++)if(!!t.call(r,n[e],e,n)===c)return[!0,!1,e,n[e]][f]}else for(var i in n)if(jn(n,i)&&!!t.call(r,n[i],i,n)===c)return[!0,!1,i,n[i]][f]}return l}}function a(u){return function(n,t,r){if(n&&Tn(t)){if(Fn(n)||zn(n))return u(n,t,r);for(var e in n)if(jn(n,e)&&t.call(r,n[e],e,n))return e}return-1}}function f(l){return function(n,t){var r=Ft(n),e=r;if(r){t>>=0;var u=It(r).split("."),i=u[0],o=u[1]||"",a=o.substring(0,t+1),f=i+(a?"."+a:"");if(t>=o.length)return Ft(f);if(f=r,0<t){var c=Math.pow(10,t);e=Math[l](N(f,c))/c}else e=Math[l](f)}return e}}function c(o){return function(r,e){var u,i;return r&&r.length?(On(r,function(n,t){e&&(n=Tn(e)?e(n,t,r):gt(n,e)),An(n)||!An(u)&&!o(u,n)||(i=t,u=n)}),r[i]):u}}function l(c,l){return function(r,e){var n,t,u={},i=[],o=this,a=arguments,f=a.length;if(!Tn(e)){for(t=1;t<f;t++)n=a[t],i.push.apply(i,Fn(n)?n:[n]);e=0}return ht(r,function(n,t){((e?e.call(o,n,t,r):-1<it(i,function(n){return n===t}))?c:l)&&(u[t]=n)}),u}}function s(r){return function(n){if(n){var t=r(n&&n.replace?n.replace(/,/g,""):n);if(!isNaN(t))return t}return 0}}function h(o){return function(n,t,r,e){var u=r||{},i=u.children||"children";return o(null,n,t,e,[],[],i,u)}}function p(n,t){return n===t}function g(t,r){try{delete t[r]}catch(n){t[r]=void 0}}function v(r,e,u,i,n,t,o){if(r===e)return!0;if(r&&e&&!Rn(r)&&!Rn(e)&&!zn(r)&&!zn(e)){if($n(r))return u(""+r,""+e,n,t,o);if(Cn(r)||_n(r))return u(+r,+e,n,t,o);var a,f,c,l=Fn(r),s=Fn(e);if(l||s?l&&s:r.constructor===e.constructor)return f=at(r),c=at(e),i&&(a=i(r,e,n)),f.length===c.length&&(Wn(a)?sn(f,function(n,t){return n===c[t]&&v(r[n],e[c[t]],u,i,l||s?t:n,r,e)}):!!a)}return u(r,e,n,t,o)}function d(t){var r=new RegExp("(?:"+at(t).join("|")+")","g");return function(n){return xr(n).replace(r,function(n){return t[n]})}}function b(n){return n.getFullYear()}function M(n){return n.getMonth()}function m(n){return n.getTime()}function y(n){return n?n.splice&&n.join?n:(""+n).replace(/(\[\d+\])\.?/g,"$1.").replace(/\.$/,"").split("."):[]}function S(){return Z?Z.origin||Z.protocol+"//"+Z.host:""}function O(n){return Date.UTC(n.y,n.M||0,n.d||1,n.H||0,n.m||0,n.s||0,n.S||0)}function w(n){return m((t=n,new Date(b(t),M(t),t.getDate())));var t}function N(n,t){var r=It(n),e=It(t);return parseInt(r.replace(".",""))*parseInt(e.replace(".",""))/Math.pow(10,k(r)+k(e))}function x(){return new Date}function E(n,t){var r=It(n),e=It(t),u=Math.pow(10,Math.max(k(r),k(e)));return(_t(n,u)+_t(t,u))/u}function k(n){return(n.split(".")[1]||"").length}function j(n,t){var r=It(n),e=It(t),u=k(r),i=k(e)-u,o=i<0,a=Math.pow(10,o?Math.abs(i):i);return _t(r.replace(".","")/e.replace(".",""),o?1/a:a)}function A(n,t){return n.substring(0,t)+"."+n.substring(t,n.length)}function W(n){return n.toLowerCase()}function F(n,t){if(n.repeat)return n.repeat(t);var r=isNaN(t)?[]:new Array(q(t));return r.join(n)+(0<r.length?n:"")}function I(n,t,r){return n.substring(t,r)}function T(n){return n.toU
|