Build 533169stable
Module 589841
2,800 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";var r=n(404312),i=Object.prototype.hasOwnProperty,s=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(s(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}},l=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},u=function e(t,n,r){if(!n)return t;if("object"!=typeof n&&"function"!=typeof n){if(s(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return(s(t)&&!s(n)&&(a=l(t,r)),s(t)&&s(n))?(n.forEach(function(n,s){if(i.call(t,s)){var a=t[s];a&&"object"==typeof a&&n&&"object"==typeof n?t[s]=e(a,n,r):t.push(n)}else t[s]=n}),t):Object.keys(n).reduce(function(t,s){var a=n[s];return i.call(t,s)?t[s]=e(t[s],a,r):t[s]=a,t},a)},c=1024;e.exports={arrayToObject:l,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],s=i.obj[i.prop],a=Object.keys(s),l=0;l<a.length;++l){var u=a[l],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:s,prop:u}),n.push(c))}return o(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,i,s){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===n)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var l="",u=0;u<o.length;u+=c){for(var d=o.length>=c?o.slice(u,u+c):o,_=[],f=0;f<d.length;++f){var p=d.charCodeAt(f);if(45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===r.RFC1738&&(40===p||41===p)){_[_.length]=d.charAt(f);continue}if(p<128){_[_.length]=a[p];continue}if(p<2048){_[_.length]=a[192|p>>6]+a[128|63&p];continue}if(p<55296||p>=57344){_[_.length]=a[224|p>>12]+a[128|p>>6&63]+a[128|63&p];continue}f+=1,p=65536+((1023&p)<<10|1023&d.charCodeAt(f)),_[_.length]=a[240|p>>18]+a[128|p>>12&63]+a[128|p>>6&63]+a[128|63&p]}l+=_.join("")}return l},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(s(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:u}}