123456 |
- /**
- * xe-utils.js v3.1.13
- * 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 n="yyyy-MM-dd HH:mm:ss",b={treeOptions:{parentKey:"parentId",key:"id",children:"children"},formatDate:n+".SSSZ",formatString:n,dateDiffRules:[["yyyy",31536e6],["MM",2592e6],["dd",864e5],["HH",36e5],["mm",6e4],["ss",1e3],["S",0]]},r=function(){};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)||Wn(n))return u(n,t);for(var r in n)if(An(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&&Wn(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(An(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&&Fn(t)){if(Wn(n)||Zn(n))return u(n,t,r);for(var e in n)if(An(n,e)&&t.call(r,n[e],e,n))return e}return-1}}function f(l){return function(n,t){var r=Tt(n),e=r;if(r){t>>=0;var u=Wt(r).split("."),i=u[0],o=u[1]||"",a=o.substring(0,t+1),f=i+(a?"."+a:"");if(t>=o.length)return Tt(f);if(f=r,0<t){var c=Math.pow(10,t);e=Math[l](f*c)/c}else e=Math[l](f)}return e}}function c(o){return function(r,e){var u,i;return r&&r.length?(Nn(r,function(n,t){e&&(n=Fn(e)?e(n,t,r):gt(n,e)),In(n)||!In(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(!Fn(e)){for(t=1;t<f;t++)n=a[t],i.push.apply(i,Wn(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);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(Cn(r))return u(""+r,""+e,n,t,o);if(Ln(r)||zn(r))return u(+r,+e,n,t,o);var a,f,c,l=Wn(r),s=Wn(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&&(Tn(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 ir(n).replace(r,function(n){return t[n]})}}function D(n){return n.getFullYear()}function S(n){return n.getMonth()}function m(n){return n.getTime()}function y(n){return n?n.splice&&n.join?n:(""+n).split("."):[]}function M(){return H?H.origin||H.protocol+"//"+H.host:""}function N(n){return Date.UTC(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}function O(n){return m((t=n,new Date(D(t),S(t),t.getDate())));var t}function w(){return new Date}function x(n,t){var r=Wt(n),e=Wt(t),u=Math.pow(10,Math.max(E(r),E(e)));return(Ft(n,u)+Ft(t,u))/u}function E(n){return(n.split(".")[1]||"").length}function k(n,t){var r=Wt(n),e=Wt(t),u=E(r),i=E(e)-u,o=i<0,a=Math.pow(10,o?Math.abs(i):i);return Ft(r.replace(".","")/e.replace(".",""),o?1/a:a)}function A(n,t){return n.substring(0,t)+"."+n.substring(t,n.length)}function I(n){return n.toLowerCase()}function T(n,t){if(n.repeat)return n.repeat(t);var r=isNaN(t)?[]:new Array(Y(t));return r.join(n)+(0<r.length?n:"")}function W(n,t,r){return n.substring(t,r)}function j(n){return n.toUpperCase()}r.VERSION="3.1.13",r.mixin=function(){Nn(arguments,function(n){ht(n,function(t,n){r[n]=Fn(t)?function(){var n=t.apply(r.$context,arguments);return r.$context=null,n}:t})})},r.setup=function(n){return V(b,n)};var F="undefined",z="last",Z="first",R=864e5,C=7*R,H=typeof location===F?0:location,$=typeof window===F?0:window,L=typeof document===F?0:document,P=encodeURIComponent,_=decodeURIComponent,U=Object.prototype.toString,Y=parseInt,q={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},B=/(.+)?\[(\d+)\]$/,J=Object.assign;function K(t,n,r){for(var e,u=n.length,i=1;i<u;i++)e=n[i],Nn(at(n[i]),r?function(n){t[n]=St(e[n],r)}:function(n){t[n]=e[n]});return t}var V=function(n){if(n){var t=arguments;if(!0!==n)return J?J.apply(Object,t):K(n,t);if(1<t.length)return K(n=Wn(n[1])?[]:{},t,!0)}return n};function Q(r,e,u){var i={};if(r){if(!e)return r;Fn(e)||(e=or(e)),ht(r,function(n,t){i[t]=e.call(u,n,t,r)})}return i}function X(n,t,r){if(n)for(var e in n)An(n,e)&&t.call(r,n[e],e,n)}function G(t,r,e){On(at(t),function(n){r.call(e,t[n],n,t)})}function nn(r,n){return $n(r)&&$n(n)||Wn(r)&&Wn(n)?(ht(n,function(n,t){r[t]=nn(r[t],n)}),r):n}function tn(n){var t=[];return ht(n,function(n){vn(t,n)||t.push(n)}),t}var rn=fn,en="asc",un="desc";function on(n,t){return Tn(n)?1:Un(n)?Tn(t)?-1:1:n&&n.localeCompare?n.localeCompare(t):t<n?1:-1}function an(u,i,o){return function(n,t){var r=n[u],e=t[u];return r===e?o?o(n,t):0:i.order===un?on(e,r):on(r,e)}}function fn(n,t,r){if(n){if(In(t))return Dn(n).sort(on);for(var e,u=yn(n,function(n){return{data:n}}),i=(a=n,f=u,l=r,s=[],Nn(c=Wn(c=t)?c:[c],function(n,r){if(n){var t,e=n;Wn(n)?(e=n[0],t=n[1]):$n(n)&&(e=n.field,t=n.order),s.push({field:e,order:t||en}),Nn(f,Fn(e)?function(n,t){n[r]=e.call(l,n.data,t,a)}:function(n){n[r]=e?gt(n.data,e):n.data})}}),s),o=i.length-1;0<=o;)e=an(o,i[o],e),o--;return e&&(u=u.sort(e)),yn(u,or("data"))}var a,f,c,l,s;return[]}function cn(n){for(var t,r=[],e=ft(n),u=e.length-1;0<=u;u--)t=0<u?Ot(0,u):0,r.push(e[t]),e.splice(t,1);return r}var ln=o("some",1,0,!0,!1),sn=o("every",1,1,!1,!0);function hn(n,t,r){var e=[],u=arguments.length;if(n){if(t=2<=u?Tt(t):0,r=3<=u?Tt(r):n.length,n.slice)return n.slice(t,r);for(;t<r;t++)e.push(n[t])}return e}var pn=o("find",1,3,!0);var gn=o("",0,2,!0);function vn(n,t){if(n){if(n.includes)return n.includes(t);for(var r in n)if(An(n,r)&&t===n[r])return!0}return!1}function dn(n,t){if(n.indexOf)return n.indexOf(t);for(var r=0,e=n.length;r<e;r++)if(t===n[r])return r}function mn(n,t){if(n.lastIndexOf)return n.lastIndexOf(t);for(var r=n.length-1;0<=r;r--)if(t===n[r])return r;return-1}function yn(n,t,r){var e=[];if(n&&1<arguments.length){if(n.map)return n.map(t,r);ht(n,function(){e.push(t.apply(r,arguments))})}return e}function bn(n){var t,r,e,u=[];if(n&&n.length)for(t=0,e=(r=xt(n,function(n){return n?n.length:0}))?r.length:0;t<e;t++)u.push(Mn(n,t));return u}function Dn(n){return yn(n,function(n){return n})}function Sn(n,t){var r,e=0;if(Wn(n)&&Wn(t)){for(r=t.length;e<r;e++)if(!vn(n,t[e]))return!1;return!0}return vn(n,t)}function Mn(n,t){return yn(n,or(t))}function Nn(n,t,r){if(n)if(n.forEach)n.forEach(t,r);else for(var e=0,u=n.length;e<u;e++)t.call(r,n[e],e,n)}function On(n,t,r){for(var e=n.length-1;0<=e;e--)t.call(r,n[e],e,n)}var wn=h(function n(t,r,e,u,i,o,a,f){var c,l,s,h,p,g;if(r)for(l=0,s=r.length;l<s;l++){if(c=r[l],h=i.concat([""+l]),p=o.concat([c]),e.call(u,c,l,r,h,t,p))return{index:l,item:c,path:h,items:r,parent:t,nodes:p};if(a&&c&&(g=n(c,c[a],e,u,h.concat([a]),p,a,f)))return g}});var xn=h(function r(e,u,i,o,a,f,c,l){var s,h;ht(u,function(n,t){s=a.concat([""+t]),h=f.concat([n]),i.call(o,n,t,u,s,e,h),n&&c&&(s.push(c),r(n,n[c],i,o,s,h,c,l))})});var En=h(function r(e,u,i,o,a,f,c,l){var s,h,p,g=l.mapChildren||c;return yn(u,function(n,t){return s=a.concat([""+t]),h=f.concat([n]),(p=i.call(o,n,t,u,s,e,h))&&n&&c&&n[c]&&(p[g]=r(n,n[c],i,o,s,h,c,l)),p})});var kn=h(function(n,t,r,e,u,i,o,a){return function r(e,u,i,o,a,f,c,l,s){var h,p,g,v,d,m=[],y=s.original,b=s.data,D=s.mapChildren||l;return Nn(i,function(n,t){h=f.concat([""+t]),p=c.concat([n]),v=e||o.call(a,n,t,i,h,u,p),d=l&&n[l],v||d?(y?g=n:(g=V({},n),b&&(g[b]=n)),g[D]=r(v,n,n[l],o,a,h,p,l,s),(v||g[D].length)&&m.push(g)):v&&m.push(g)}),m}(0,n,t,r,e,u,i,o,a)});function An(n,t){return!(!n||!n.hasOwnProperty)&&n.hasOwnProperty(t)}function In(n){return Un(n)||Tn(n)}var Tn=i(F),Wn=Array.isArray||u("Array");var jn=function(n){return!Un(n)&&!isNaN(n)&&!Wn(n)&&n%1==0},Fn=i("function"),zn=i("boolean"),Zn=i("string"),Rn=i("number"),Cn=u("RegExp"),Hn=i("object");function $n(n){return!!n&&n.constructor===Object}var Ln=u("Date"),Pn=u("Error");function _n(n){for(var t in n)return!1;return!0}function Un(n){return null===n}var Yn=typeof Symbol!==F;function qn(n){return Yn&&Symbol.isSymbol?Symbol.isSymbol(n):"symbol"==typeof n}var Bn=u("Arguments");var Jn=typeof FormData!==F;var Kn=typeof Map!==F;var Vn=typeof WeakMap!==F;var Qn=typeof Set!==F;var Xn=typeof WeakSet!==F;function Gn(n){var t,r=n?Ht(n):w();return!!Ln(r)&&((t=r.getFullYear())%4==0&&(t%100!=0||t%400==0))}function nt(n,t){return v(n,t,p)}var tt=0;function rt(n){var t=0;return Zn(n)||Wn(n)?n.length:(ht(n,function(){t++}),t)}var et=e("indexOf",dn),ut=e("lastIndexOf",mn),it=a(function(n,t,r){for(var e=0,u=n.length;e<u;e++)if(t.call(r,n[e],e,n))return e;return-1}),ot=a(function(n,t,r){for(var e=n.length-1;0<=e;e--)if(t.call(r,n[e],e,n))return e;return-1});var at=t("keys",1),ft=t("values",0),ct=t("entries",2),lt=l(1,0),st=l(0,1);function ht(n,t,r){return n?(Wn(n)?Nn:X)(n,t,r):n}function pt(n,t,r){return n?(Wn(n)?On:G)(n,t,r):n}function gt(n,t,r){if(In(n))return r;var e=function(n,t){if(n){var r,e,u,i=0;if(n[t]||An(n,t))return n[t];if(e=y(t),u=e.length)for(r=n;i<u;i++)if(o=r,a=e[i],void 0,f=a?a.match(B):"",In(r=f?f[1]?o[f[1]]?o[f[1]][f[2]]:void 0:o[f[2]]:o[a]))return i===u-1?r:void 0;return r}var o,a,f}(n,t);return Tn(e)?r:e}var vt=/(.+)\[(\d+)\]$/;function dt(n,t,r,e){if(n[t])return r&&(n[t]=e),n[t];var u,i=t?t.match(vt):null,o=r?e:{};return i?(u=Y(i[2]),n[i[1]]||(n[i[1]]=new Array(u+1)),n[i[1]][u]=o):n[t]=o,o}function mt(n){return"__proto__"===n||"constructor"===n||"prototype"===n}function yt(r,e,u){var i,n,o={};return r&&(e&&Hn(e)?(n=e,e=function(){return _n(n)}):Fn(e)||(e=or(e)),ht(r,function(n,t){i=e?e.call(u,n,t,r):n,o[i]?o[i].push(n):o[i]=[n]})),o}function bt(n,t,r){return n(t,r?function(n){return Dt(n,r)}:function(n){return n})}function Dt(n,t){return $n(n)?bt(Q,n,t):Wn(n)?bt(yn,n,t):function(n,t){if(t&&n){var r=n.constructor;switch(U.call(n)){case"[object Date]":case"[object RegExp]":return new r(n.valueOf());case"[object Set]":var e=new r;return n.forEach(function(n){e.add(n)}),e;case"[object Map]":var u=new r;return n.forEach(function(n,t){u.set(t,n)}),u}}return n}(n,t)}function St(n,t){return n?Dt(n,t):n}function Mt(r,e,n){if(r){var t,u=1<arguments.length&&(Un(e)||!Hn(e)),i=u?n:e;if($n(r))X(r,u?function(n,t){r[t]=e}:function(n,t){g(r,t)}),i&&V(r,i);else if(Wn(r)){if(u)for(t=r.length;0<t;)r[--t]=e;else r.length=0;i&&r.push.apply(r,i)}}return r}function Nt(r,e,u){if(r){if(In(e))return Mt(r);var i=[],o=[];return Fn(e)||(a=e,e=function(n,t){return t===a}),ht(r,function(n,t,r){e.call(u,n,t,r)&&i.push(t)}),Wn(r)?pt(i,function(n,t){o.push(r[n]),r.splice(n,1)}):(o={},Nn(i,function(n){o[n]=r[n],g(r,n)})),o}var a;return r}function Ot(n,t){return t<=n?n:(n>>=0)+Math.round(Math.random()*((t||9)-n))}var wt=c(function(n,t){return t<n}),xt=c(function(n,t){return n<t});var Et=f("round"),kt=f("ceil"),At=f("floor");function It(n,t){var r=ir(Et(n,t>>=0)).split("."),e=r[0],u=r[1]||"",i=t-u.length;return t?0<i?e+"."+u+T("0",i):e+A(u,Math.abs(i)):e}var Tt=s(parseFloat);function Wt(n){var t=""+n,r=t.match(/^([-+]?)((\d+)|((\d+)?[.](\d+)?))e([-+]{1})([0-9]+)$/);if(r){var e=n<0?"-":"",u=r[3]||"",i=r[5]||"",o=r[6]||"",a=r[7],f=r[8],c=f-o.length,l=f-u.length,s=f-i.length;return"+"===a?u?e+u+T("0",f):0<c?e+i+o+T("0",c):e+i+A(o,f):u?0<l?e+"0."+T("0",Math.abs(l))+u:e+A(u,l):0<s?e+"0."+T("0",Math.abs(s))+i+o:e+A(i,s)+o}return t}var jt=s(Y);function Ft(n,t){var r=Tt(n),e=Tt(t),u=Wt(r),i=Wt(e);return parseInt(u.replace(".",""))*parseInt(i.replace(".",""))/Math.pow(10,E(u)+E(i))}function zt(n,t,r){var e=0;return ht(n,t?Fn(t)?function(){e=x(e,t.apply(r,arguments))}:function(n){e=x(e,gt(n,t))}:function(n){e=x(e,n)}),e}var Zt=Date.now||function(){return m(w())};function Rt(n){return Ln(n)&&!isNaN(m(n))}var Ct=[{rules:[["yyyy",4]]},{rules:[["MM",2],["M",1]],offset:-1},{rules:[["dd",2],["d",1]]},{rules:[["HH",2],["H",1]]},{rules:[["mm",2],["m",1]]},{rules:[["ss",2],["s",1]]},{rules:[["SSS",3],["S",1]]},{rules:[["ZZ",5],["Z",6],["Z",5],["Z",1]]}];function Ht(n,t){var r,e;if(n)if((e=Ln(n))||!t&&/^[0-9]{11,15}$/.test(n))r=new Date(e?m(n):Y(n));else if(Zn(n)){var u,i=function(n,t){var r,e,u,i,o,a,f,c,l,s=[0,0,1,0,0,0,0];for(u=0,i=Ct.length;u<i;u++)for(f=0,c=(a=(o=Ct[u]).rules).length;f<c;f++){if(r=a[f],-1<(e=t.indexOf(r[0]))&&(l=n.substring(e,e+r[1]))&&l.length===r[1]){o.offset&&(l=Y(l)+o.offset),s[u]=l;break}if(f===c-1)return s}return s}(n,t||b.formatDate),o=i[7];i[0]&&(o?"z"===o[0]||"Z"===o[0]?r=new Date(N(i)):(u=o.match(/([-+]{1})(\d{2}):?(\d{2})/))&&(r=new Date(N(i)-("-"===u[1]?-1:1)*Y(u[2])*36e5+6e4*Y(u[3]))):r=new Date(i[0],i[1],i[2],i[3],i[4],i[5],i[6]))}return r||new Date("")}function $t(n,t,r,e){var u=t[r];return u?Fn(u)?u(e,r,n):u[e]:e}var Lt=/\[([^\]]+)]|y{2,4}|M{1,2}|d{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|S{1,3}|Z{1,2}|W{1,2}|D{1,3}|[aAeEq]/g;function Pt(e,n,t){if(e){if(Rt(e=Ht(e))){var r=n||b.formatString,u=e.getHours(),i=u<12?"am":"pm",o=V({},b.formatStringMatchs,t?t.formats:null),a=function(n,t){return(""+D(e)).substr(4-t)},f=function(n,t){return er(S(e)+1,t,"0")},c=function(n,t){return er(e.getDate(),t,"0")},l=function(n,t){return er(u,t,"0")},s=function(n,t){return er(u<=12?u:u-12,t,"0")},h=function(n,t){return er(e.getMinutes(),t,"0")},p=function(n,t){return er(e.getSeconds(),t,"0")},g=function(n,t){return er(e.getMilliseconds(),t,"0")},v=function(n,t){var r=e.getTimezoneOffset()/60*-1;return $t(e,o,n,(0<=r?"+":"-")+er(r,2,"0")+(1===t?":":"")+"00")},d=function(n,t){return er($t(e,o,n,Jt(e)),t,"0")},m=function(n,t){return er($t(e,o,n,Bt(e)),t,"0")},y={yyyy:a,yy:a,MM:f,M:f,dd:c,d:c,HH:l,H:l,hh:s,h:s,mm:h,m:h,ss:p,s:p,SSS:g,S:g,ZZ:v,Z:v,WW:d,W:d,DDD:m,D:m,a:function(n){return $t(e,o,n,i)},A:function(n){return $t(e,o,n,j(i))},e:function(n){return $t(e,o,n,e.getDay())},E:function(n){return $t(e,o,n,0===(t=e.getDay())?7:t);var t},q:function(n){return $t(e,o,n,Math.floor((S(e)+3)/3))}};return r.replace(Lt,function(n,t){return t||(y[n]?y[n](n,n.length):n)})}return"Invalid Date"}return""}function _t(n,t,r){var e;if(Rt(n=Ht(n))&&(t&&(e=t&&!isNaN(t)?t:0,n.setFullYear(D(n)+e)),r||!isNaN(r))){if(r===Z)return new Date(D(n),0,1);if(r===z)return n.setMonth(11),Ut(n,0,z);n.setMonth(r)}return n}function Ut(n,t,r){var e=t&&!isNaN(t)?t:0;if(Rt(n=Ht(n))){if(r===Z)return new Date(D(n),S(n)+e,1);if(r===z)return new Date(m(Ut(n,e+1,Z))-1);if(Rn(r)&&n.setDate(r),e){var u=n.getDate();if(n.setMonth(S(n)+e),u!==n.getDate())return n.setDate(1),new Date(m(n)-R)}}return n}function Yt(n,t,r){var e,u,i;return Rt(n=Ht(n))?(i=Y(/^[0-7]$/.test(r)?r:n.getDay()),u=n.getDay(),e=m(n)+((0===i?7:i)-(0===u?7:u))*R,t&&!isNaN(t)&&(e+=t*C),new Date(e)):n}function qt(n,t,r){if(Rt(n=Ht(n))&&!isNaN(t)){if(n.setDate(n.getDate()+Y(t)),r===Z)return new Date(D(n),S(n),n.getDate());if(r===z)return new Date(m(qt(n,1,Z))-1)}return n}function Bt(n){return Rt(n=Ht(n))?Math.floor((O(n)-O(_t(n,0,Z)))/R)+1:NaN}function Jt(n){if(Rt(n=Ht(n))){n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return Math.round(((n.getTime()-t.getTime())/R+(t.getDay()+6)%7-3)/7)+1}return NaN}function Kt(n){return n&&n.trim?n.trim():Qt(Vt(n))}function Vt(n){return n&&n.trimLeft?n.trimLeft():ir(n).replace(/^[\s\uFEFF\xA0]+/g,"")}function Qt(n){return n&&n.trimRight?n.trimRight():ir(n).replace(/[\s\uFEFF\xA0]+$/g,"")}var Xt=d(q),Gt={};ht(q,function(n,t){Gt[q[t]]=t});var nr=d(Gt),tr={};var rr={};function er(n,t,r){var e=ir(n);return t>>=0,r=Tn(r)?" ":""+r,e.padStart?e.padStart(t,r):t>e.length?((t-=e.length)>r.length&&(r+=T(r,t/r.length)),r.slice(0,t)+e):e}function ur(n,r,t){return ir(n).replace((t||b).tmplRE||/\{{2}([.\w[\]\s]+)\}{2}/g,function(n,t){return gt(r,Kt(t))})}function ir(n){return Rn(n)?Wt(n):""+(In(n)?"":n)}function or(t,r){return function(n){return Un(n)?r:n[t]}}function ar(n){return cr(n.split("?")[1]||"")}function fr(n){var t,e,r,u,i=""+n;return 0===i.indexOf("//")?i=(H?H.protocol:"")+i:0===i.indexOf("/")&&(i=M()+i),r=i.replace(/#.*/,"").match(/(\?.*)/),(u={href:i,hash:"",host:"",hostname:"",protocol:"",port:"",search:r&&r[1]&&1<r[1].length?r[1]:""}).path=i.replace(/^([a-z0-9.+-]*:)\/\//,function(n,t){return u.protocol=t,""}).replace(/^([a-z0-9.+-]*)(:\d+)?\/?/,function(n,t,r){return e=r||"",u.port=e.replace(":",""),u.hostname=t,u.host=t+e,"/"}).replace(/(#.*)/,function(n,t){return u.hash=1<t.length?t:"",""}),t=u.hash.match(/#((.*)\?|(.*))/),u.pathname=u.path.replace(/(\?|#.*).*/,""),u.origin=u.protocol+"//"+u.host,u.hashKey=t&&(t[2]||t[1])||"",u.hashQuery=ar(u.hash),u.searchQuery=ar(u.search),u}function cr(n){var t,r={};return n&&Zn(n)&&Nn(n.split("&"),function(n){t=n.split("="),r[_(t[0])]=_(t[1]||"")}),r}function lr(n){try{return n.setItem("__xe_t",1),n.removeItem("__xe_t"),!0}catch(n){return!1}}function sr(n){return-1<navigator.userAgent.indexOf(n)}function hr(n,t){var r=parseFloat(t),e=w(),u=m(e);switch(n){case"y":return m(_t(e,r));case"M":return m(Ut(e,r));case"d":return m(qt(e,r));case"h":case"H":return u+60*r*60*1e3;case"m":return u+60*r*1e3;case"s":return u+1e3*r}return u}function pr(n){return(Ln(n)?n:new Date(n)).toUTCString()}function gr(n,t,r){if(L){var e,u,i,o,a,f,c=[],l=arguments;return Wn(n)?c=n:1<l.length?c=[V({name:n,value:t},r)]:Hn(n)&&(c=[n]),0<c.length?(Nn(c,function(n){e=V({},b.cookies,n),i=[],e.name&&(u=e.expires,i.push(P(e.name)+"="+P(Hn(e.value)?JSON.stringify(e.value):e.value)),u&&(u=isNaN(u)?u.replace(/^([0-9]+)(y|M|d|H|h|m|s)$/,function(n,t,r){return pr(hr(r,t))}):/^[0-9]{11,13}$/.test(u)||Ln(u)?pr(u):pr(hr("d",u)),e.expires=u),Nn(["expires","path","domain","secure"],function(n){Tn(e[n])||i.push(e[n]&&"secure"===n?n:n+"="+e[n])})),L.cookie=i.join("; ")}),!0):(o={},(a=L.cookie)&&Nn(a.split("; "),function(n){f=n.indexOf("="),o[_(n.substring(0,f))]=_(n.substring(f+1)||"")}),1===l.length?o[n]:o)}return!1}function vr(n,t,r){return gr(n,t,r),gr}function dr(n,t){gr(n,0,V({expires:-1},b.cookies,t))}function mr(){return at(gr())}return V(gr,{has:function(n){return vn(mr(),n)},set:vr,setItem:vr,get:function(n,t){return gr(n,t)},getItem:gr,remove:dr,removeItem:dr,keys:mr,getJSON:gr}),V(r,{assign:V,objectEach:X,lastObjectEach:G,objectMap:Q,merge:function(n){n||(n={});for(var t,r=arguments,e=r.length,u=1;u<e;u++)(t=r[u])&&nn(n,t);return n},uniq:tn,union:function(){for(var n=arguments,t=[],r=0,e=n.length;r<e;r++)t=t.concat(Dn(n[r]));return tn(t)},sortBy:rn,orderBy:fn,shuffle:cn,sample:function(n,t){var r=cn(n);return arguments.length<=1?r[0]:(t<r.length&&(r.length=t||0),r)},some:ln,every:sn,slice:hn,filter:function(r,e,u){var i=[];if(r&&e){if(r.filter)return r.filter(e,u);ht(r,function(n,t){e.call(u,n,t,r)&&i.push(n)})}return i},find:pn,findLast:function(n,t,r){if(n){Wn(n)||(n=ft(n));for(var e=n.length-1;0<=e;e--)if(t.call(r,n[e],e,n))return n[e]}},findKey:gn,includes:vn,arrayIndexOf:dn,arrayLastIndexOf:mn,map:yn,reduce:function(n,t,r){if(n){var e,u,i=0,o=r,a=2<arguments.length,f=at(n);if(n.length&&n.reduce)return u=function(){return t.apply(null,arguments)},a?n.reduce(u,o):n.reduce(u);for(a&&(i=1,o=n[f[0]]),e=f.length;i<e;i++)o=t.call(null,o,n[f[i]],i,n);return o}},copyWithin:function(n,t,r,e){if(Wn(n)&&n.copyWithin)return n.copyWithin(t,r,e);var u,i,o=t>>0,a=r>>0,f=n.length,c=3<arguments.length?e>>0:f;if(o<f&&0<=(o=0<=o?o:f+o)&&(a=0<=a?a:f+a)<(c=0<=c?c:f+c))for(u=0,i=n.slice(a,c);o<f&&!(i.length<=u);o++)n[o]=i[u++];return n},chunk:function(n,t){var r,e=[],u=t>>0||1;if(Wn(n))if(0<=u&&n.length>u)for(r=0;r<n.length;)e.push(n.slice(r,r+u)),r+=u;else e=n.length?[n]:n;return e},zip:function(){return bn(arguments)},unzip:bn,zipObject:function(n,r){var e={};return r=r||[],ht(ft(n),function(n,t){e[n]=r[t]}),e},flatten:function(n,t){return Wn(n)?function t(n,r){var e=[];return Nn(n,function(n){e=e.concat(Wn(n)?r?t(n,r):n:[n])}),e}(n,t):[]},toArray:Dn,includeArrays:Sn,pluck:Mn,invoke:function(n,t){for(var r,e=arguments,u=[],i=[],o=2,a=e.length;o<a;o++)u.push(e[o]);if(Wn(t)){for(a=t.length-1,o=0;o<a;o++)i.push(t[o]);t=t[a]}return yn(n,function(n){if(i.length&&(n=function(n,t){for(var r=0,e=t.length;n&&r<e;)n=n[t[r++]];return e&&n?n:0}(n,i)),(r=n[t]||t)&&r.apply)return r.apply(n,u)})},arrayEach:Nn,lastArrayEach:On,toArrayTree:function(n,t){var r,e,u,i,o,a=V({},b.treeOptions,t),f=a.strict,c=a.key,l=a.parentKey,s=a.children,h=a.sortKey,p=a.reverse,g=a.data,v=[],d={};return h&&(n=fn(St(n),h),p&&(n=n.reverse())),r=yn(n,function(n){return n[c]}),ht(n,function(n){e=n[c],g?(u={})[g]=n:u=n,i=n[l],d[e]=d[e]||[],d[i]=d[i]||[],d[i].push(u),u[c]=e,u[l]=i,u[s]=d[e],(!f||f&&!i)&&(vn(r,i)||v.push(u))}),f&&(o=s,ht(n,function(n){n.children&&!n.children.length&&Nt(n,o)})),v},toTreeArray:function(n,t){return function r(e,n,u){var i=u.children,o=u.data,a=u.clear;return ht(n,function(n){var t=n[i];o&&(n=n[o]),e.push(n),t&&t.length&&r(e,t,u),a&&delete n[i]}),e}([],n,V({},b.treeOptions,t))},findTree:wn,eachTree:xn,mapTree:En,filterTree:function(n,o,t,a){var f=[];return n&&o&&xn(n,function(n,t,r,e,u,i){o.call(a,n,t,r,e,u,i)&&f.push(n)},t),f},searchTree:kn,hasOwnProp:An,eqNull:In,isNaN:function(n){return Rn(n)&&isNaN(n)},isFinite:function(n){return Rn(n)&&isFinite(n)},isUndefined:Tn,isArray:Wn,isFloat:function(n){return!(Un(n)||isNaN(n)||Wn(n)||jn(n))},isInteger:jn,isFunction:Fn,isBoolean:zn,isString:Zn,isNumber:Rn,isRegExp:Cn,isObject:Hn,isPlainObject:$n,isDate:Ln,isError:Pn,isTypeError:function(n){return!!n&&n.constructor===TypeError},isEmpty:_n,isNull:Un,isSymbol:qn,isArguments:Bn,isElement:function(n){return!!(n&&Zn(n.nodeName)&&Rn(n.nodeType))},isDocument:function(n){return!(!n||!L||9!==n.nodeType)},isWindow:function(n){return $&&!(!n||n!==n.window)},isFormData:function(n){return Jn&&n instanceof FormData},isMap:function(n){return Kn&&n instanceof Map},isWeakMap:function(n){return Vn&&n instanceof WeakMap},isSet:function(n){return Qn&&n instanceof Set},isWeakSet:function(n){return Xn&&n instanceof WeakSet},isLeapYear:Gn,isMatch:function(r,e){var n=at(r),t=at(e);return!t.length||(Sn(n,t)?ln(t,function(t){return-1<it(n,function(n){return n===t&&nt(r[n],e[t])})}):nt(r,e))},isEqual:nt,isEqualWith:function(n,t,o){return Fn(o)?v(n,t,function(n,t,r,e,u){var i=o(n,t,r,e,u);return Tn(i)?p(n,t):!!i},o):v(n,t,p)},getType:function(n){return Un(n)?"null":qn(n)?"symbol":Ln(n)?"date":Wn(n)?"array":Cn(n)?"regexp":Pn(n)?"error":typeof n},uniqueId:function(n){return[n,++tt].join("")},getSize:rt,indexOf:et,lastIndexOf:ut,findIndexOf:it,findLastIndexOf:ot,toStringJSON:function(n){if($n(n))return n;if(Zn(n))try{return JSON.parse(n)}catch(n){}return{}},toJSONString:function(n){return In(n)?"":JSON.stringify(n)},keys:at,values:ft,entries:ct,pick:lt,omit:st,first:function(n){return ft(n)[0]},last:function(n){var t=ft(n);return t[t.length-1]},each:ht,forOf:function(n,t,r){if(n)if(Wn(n))for(var e=0,u=n.length;e<u&&!1!==t.call(r,n[e],e,n);e++);else for(var i in n)if(An(n,i)&&!1===t.call(r,n[i],i,n))break},lastForOf:function(n,t,r){var e,u;if(n)if(Wn(n))for(e=n.length-1;0<=e&&!1!==t.call(r,n[e],e,n);e--);else for(e=(u=at(n)).length-1;0<=e&&!1!==t.call(r,n[u[e]],u[e],n);e--);},lastEach:pt,has:function(n,t){if(n){if(An(n,t))return!0;var r,e,u,i,o,a,f=y(t),c=0,l=f.length;for(o=n;c<l&&(a=!1,(i=(r=f[c])?r.match(B):"")?(e=i[1],u=i[2],e?o[e]&&An(o[e],u)&&(a=!0,o=o[e][u]):An(o,u)&&(a=!0,o=o[u])):An(o,r)&&(a=!0,o=o[r]),a);c++)if(c===l-1)return!0}return!1},get:gt,set:function(n,t,r){if(n)if(!n[t]&&!An(n,t)||mt(t))for(var e=n,u=y(t),i=u.length,o=0;o<i;o++)mt(u[o])||(e=dt(e,u[o],o===i-1,r));else n[t]=r;return n},groupBy:yt,countBy:function(n,t,r){var e=yt(n,t,r||this);return X(e,function(n,t){e[t]=n.length}),e},clone:St,clear:Mt,remove:Nt,range:function(n,t,r){var e,u,i=[],o=arguments;if(o.length<2&&(t=o[0],n=0),u=t>>0,(e=n>>0)<t)for(r=r>>0||1;e<u;e+=r)i.push(e);return i},destructuring:function(t,n){if(t&&n){var r=V.apply(this,[{}].concat(hn(arguments,1))),e=at(r);Nn(at(t),function(n){vn(e,n)&&(t[n]=r[n])})}return t},random:Ot,min:wt,max:xt,commafy:function(n,t){var r,e,u,i,o,a=t||{},f=a.digits;return Rn(n)?(r=(a.ceil?kt:a.floor?At:Et)(n,f),i=(e=Wt(f?It(r,f):r).split("."))[0],o=e[1],(u=i&&r<0)&&(i=i.substring(1,i.length))):i=(e=(r=ir(n).replace(/,/g,""))?[r]:[])[0],e.length?(u?"-":"")+i.replace(new RegExp("(?=(?!(\\b))(.{"+(a.spaceNumber||3)+"})+$)","g"),a.separator||",")+(o?"."+o:""):r},round:Et,ceil:kt,floor:At,toFixed:It,toNumber:Tt,toNumberString:Wt,toInteger:jt,add:function(n,t){return x(Tt(n),Tt(t))},subtract:function(n,t){var r=Tt(n),e=Tt(t),u=Wt(r),i=Wt(e),o=E(u),a=E(i),f=Math.pow(10,Math.max(o,a));return parseFloat(It((r*f-e*f)/f,a<=o?o:a))},multiply:Ft,divide:function(n,t){return k(Tt(n),Tt(t))},sum:zt,mean:function(n,t,r){return k(zt(n,t,r),rt(n))},now:Zt,timestamp:function(n,t){if(n){var r=Ht(n,t);return Ln(r)?m(r):r}return Zt()},isValidDate:Rt,isDateSame:function(n,t,r){return!(!n||!t)&&"Invalid Date"!==(n=Pt(n,r))&&n===Pt(t,r)},toStringDate:Ht,toDateString:Pt,getWhatYear:_t,getWhatMonth:Ut,getWhatWeek:Yt,getWhatDay:qt,getYearDay:Bt,getYearWeek:Jt,getMonthWeek:function n(t){var r,e,u=Ht(t);return Rt(u)?((e=Yt(r=Ut(u,0,Z),0,1))<r&&(e=Yt(r,1,1)),e<=u?Math.floor((O(u)-O(e))/C)+1:n(Yt(u,0,1))):NaN},getDayOfYear:function(n,t){return Rt(n=Ht(n))?Gn(_t(n,t))?366:365:NaN},getDayOfMonth:function(n,t){return Rt(n=Ht(n))?Math.floor((m(Ut(n,t,z))-m(Ut(n,t,Z)))/R)+1:NaN},getDateDiff:function(n,t,r){var e,u,i,o,a,f,c,l={done:!1,time:0};if(n=Ht(n),t=t?Ht(t):w(),Rt(n)&&Rt(t)&&(e=m(n))<(u=m(t)))for(o=l.time=u-e,a=r&&0<r.length?r:b.dateDiffRules,l.done=!0,c=0,f=a.length;c<f;c++)o>=(i=a[c])[1]?c===f-1?l[i[0]]=o||0:(l[i[0]]=Math.floor(o/i[1]),o-=l[i[0]]*i[1]):l[i[0]]=0;return l},trim:Kt,trimLeft:Vt,trimRight:Qt,escape:Xt,unescape:nr,camelCase:function(n){if(n=ir(n),tr[n])return tr[n];var u=n.length,t=n.replace(/([-]+)/g,function(n,t,r){return r&&r+t.length<u?"-":""});return u=t.length,t=t.replace(/([A-Z]+)/g,function(n,t,r){var e=t.length;return t=I(t),r?2<e&&r+e<u?j(W(t,0,1))+W(t,1,e-1)+j(W(t,e-1,e)):j(W(t,0,1))+W(t,1,e):1<e&&r+e<u?W(t,0,e-1)+j(W(t,e-1,e)):t}).replace(/(-[a-zA-Z])/g,function(n,t){return j(W(t,1,t.length))}),tr[n]=t},kebabCase:function(n){if(n=ir(n),rr[n])return rr[n];if(/^[A-Z]+$/.test(n))return I(n);var e=n.replace(/^([a-z])([A-Z]+)([a-z]+)$/,function(n,t,r,e){var u=r.length;return 1<u?t+"-"+I(W(r,0,u-1))+"-"+I(W(r,u-1,u))+e:I(t+"-"+r+e)}).replace(/^([A-Z]+)([a-z]+)?$/,function(n,t,r){var e=t.length;return I(W(t,0,e-1)+"-"+W(t,e-1,e)+(r||""))}).replace(/([a-z]?)([A-Z]+)([a-z]?)/g,function(n,t,r,e,u){var i=r.length;return 1<i&&(t&&(t+="-"),e)?(t||"")+I(W(r,0,i-1))+"-"+I(W(r,i-1,i))+e:(t||"")+(u?"-":"")+I(r)+(e||"")});return e=e.replace(/([-]+)/g,function(n,t,r){return r&&r+t.length<e.length?"-":""}),rr[n]=e},repeat:function(n,t){return T(ir(n),t)},padStart:er,padEnd:function(n,t,r){var e=ir(n);return t>>=0,r=Tn(r)?" ":""+r,e.padEnd?e.padEnd(t,r):t>e.length?((t-=e.length)>r.length&&(r+=T(r,t/r.length)),e+r.slice(0,t)):e},startsWith:function(n,t,r){var e=ir(n);return 0===(1===arguments.length?e:e.substring(r)).indexOf(t)},endsWith:function(n,t,r){var e=ir(n),u=arguments.length;return 1<u&&(2<u?e.substring(0,r).indexOf(t)===r-1:e.indexOf(t)===e.length-1)},template:ur,toFormatString:function(n,t){return ur(n,t,{tmplRE:/\{([.\w[\]\s]+)\}/g})},toString:ir,toValueString:ir,noop:function(){},property:or,bind:function(n,t){var r=hn(arguments,2);return function(){return n.apply(t,hn(arguments).concat(r))}},once:function(n,t){var r=!1,e=null,u=hn(arguments,2);return function(){return r||(e=n.apply(t,hn(arguments).concat(u)),r=!0),e}},after:function(t,r,e){var u=0,i=[];return function(){var n=arguments;++u<=t&&i.push(n[0]),t<=u&&r.apply(e,[i].concat(hn(n)))}},before:function(t,r,e){var u=0,i=[];return e=e||this,function(){var n=arguments;++u<t&&(i.push(n[0]),r.apply(e,[i].concat(hn(n))))}},throttle:function(n,t,r){var e,u,i=r||{},o=!1,a=0,f=!("leading"in i)||i.leading,c="trailing"in i&&i.trailing,l=function(){o=!0,n.apply(u,e),a=setTimeout(s,t)},s=function(){a=0,o||!0!==c||l()},h=function(){e=arguments,u=this,o=!1,0===a&&(!0===f?l():!0===c&&(a=setTimeout(s,t)))};return h.cancel=function(){var n=0!==a;return clearTimeout(a),o=!1,a=0,n},h},debounce:function(n,t,r){var e,u,i=r||{},o=!1,a=0,f="boolean"==typeof r,c="leading"in i?i.leading:f,l="trailing"in i?i.trailing:!f,s=function(){o=!0,a=0,n.apply(u,e)},h=function(){!0===c&&(a=0),o||!0!==l||s()},p=function(){o=!1,e=arguments,u=this,0===a?!0===c&&s():clearTimeout(a),a=setTimeout(h,t)};return p.cancel=function(){var n=0!==a;return clearTimeout(a),a=0,n},p},delay:function(n,t){var r=hn(arguments,2),e=this;return setTimeout(function(){n.apply(e,r)},t)},unserialize:cr,serialize:function(n){var r,e=[];return ht(n,function(n,t){Tn(n)||(r=Wn(n),$n(n)||r?e=e.concat(function r(n,e,u){var i,o=[];return ht(n,function(n,t){i=Wn(n),$n(n)||i?o=o.concat(r(n,e+"["+t+"]",i)):o.push(P(e+"["+(u?"":t)+"]")+"="+P(Un(n)?"":n))}),o}(n,t,r)):e.push(P(t)+"="+P(Un(n)?"":n)))}),e.join("&").replace(/%20/g,"+")},parseUrl:fr,getBaseURL:function(){if(H){var n=H.pathname,t=ut(n,"/")+1;return M()+(t===n.length?n:n.substring(0,t))}return""},locat:function(){return H?fr(H.href):{}},browse:function(){var t,n,r,e=!1,u={isNode:!1,isMobile:e,isPC:!1,isDoc:!!L};return $||typeof process===F?(r=sr("Edge"),n=sr("Chrome"),e=/(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent),u.isDoc&&(t=L.body||L.documentElement,Nn(["webkit","khtml","moz","ms","o"],function(n){u["-"+n]=!!t[n+"MatchesSelector"]})),V(u,{edge:r,firefox:sr("Firefox"),msie:!r&&u["-ms"],safari:!n&&!r&&sr("Safari"),isMobile:e,isPC:!e,isLocalStorage:lr($.localStorage),isSessionStorage:lr($.sessionStorage)})):u.isNode=!0,u},cookie:gr}),r});
|