WordPress/wp-includes/js/dist/url.min.js
desrosj cf023b82bd Build/Test Tools: Support NodeJS 14.x in the 5.2 branch.
This updates the 5.2 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy.

In addition to backporting the package updates that happened after branching 5.2, dependencies that were removed in future releases have also been updated to their latest versions.

Props desrosj, dd32, netweb, jorbin, whyisjake.
Merges [45321,45765,45826,45875,46403-46404,46408-46409,47404,47867,47872-47873,48213,48705,49636,49933,49937,49939-49940,49983,49989,50017,50126,50176,50185] to the 5.2 branch.
See #52341.
Built from https://develop.svn.wordpress.org/branches/5.2@50191


git-svn-id: http://core.svn.wordpress.org/branches/5.2@49869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-05 03:20:06 +00:00

1 line
12 KiB
JavaScript

this.wp=this.wp||{},this.wp.url=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=354)}({201:function(e,r,t){"use strict";var n=Object.prototype.hasOwnProperty,o=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),i=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(t[n]=e[n]);return t};e.exports={arrayToObject:i,assign:function(e,r){return Object.keys(r).reduce((function(e,t){return e[t]=r[t],e}),e)},combine:function(e,r){return[].concat(e,r)},compact:function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;n<r.length;++n)for(var o=r[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var u=a[c],s=i[u];"object"==typeof s&&null!==s&&-1===t.indexOf(s)&&(r.push({obj:i,prop:u}),t.push(s))}return function(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}}(r),e},decode:function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,r,t){if(0===e.length)return e;var n="string"==typeof e?e:String(e);if("iso-8859-1"===t)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var i="",a=0;a<n.length;++a){var c=n.charCodeAt(a);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?i+=n.charAt(a):c<128?i+=o[c]:c<2048?i+=o[192|c>>6]+o[128|63&c]:c<55296||c>=57344?i+=o[224|c>>12]+o[128|c>>6&63]+o[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&n.charCodeAt(a)),i+=o[240|c>>18]+o[128|c>>12&63]+o[128|c>>6&63]+o[128|63&c])}return i},isBuffer:function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(r,t,o){if(!t)return r;if("object"!=typeof t){if(Array.isArray(r))r.push(t);else{if("object"!=typeof r)return[r,t];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,t))&&(r[t]=!0)}return r}if("object"!=typeof r)return[r].concat(t);var a=r;return Array.isArray(r)&&!Array.isArray(t)&&(a=i(r,o)),Array.isArray(r)&&Array.isArray(t)?(t.forEach((function(t,i){n.call(r,i)?r[i]&&"object"==typeof r[i]?r[i]=e(r[i],t,o):r.push(t):r[i]=t})),r):Object.keys(t).reduce((function(r,i){var a=t[i];return n.call(r,i)?r[i]=e(r[i],a,o):r[i]=a,r}),a)}}},202:function(e,r,t){"use strict";var n=String.prototype.replace,o=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},354:function(e,r,t){"use strict";t.r(r),t.d(r,"isURL",(function(){return c})),t.d(r,"getProtocol",(function(){return u})),t.d(r,"isValidProtocol",(function(){return s})),t.d(r,"getAuthority",(function(){return l})),t.d(r,"isValidAuthority",(function(){return f})),t.d(r,"getPath",(function(){return p})),t.d(r,"isValidPath",(function(){return d})),t.d(r,"getQueryString",(function(){return y})),t.d(r,"isValidQueryString",(function(){return h})),t.d(r,"getFragment",(function(){return b})),t.d(r,"isValidFragment",(function(){return g})),t.d(r,"addQueryArgs",(function(){return v})),t.d(r,"getQueryArg",(function(){return m})),t.d(r,"hasQueryArg",(function(){return O})),t.d(r,"removeQueryArgs",(function(){return j})),t.d(r,"prependHTTP",(function(){return w})),t.d(r,"safeDecodeURI",(function(){return A})),t.d(r,"filterURLForDisplay",(function(){return x})),t.d(r,"safeDecodeURIComponent",(function(){return P}));var n=t(86),o=/^(?:https?:)?\/\/\S+$/i,i=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i,a=/^(?:[a-z]+:|#|\?|\.|\/)/i;function c(e){return o.test(e)}function u(e){var r=/^([^\s:]+:)/.exec(e);if(r)return r[1]}function s(e){return!!e&&/^[a-z\-.\+]+[0-9]*:$/i.test(e)}function l(e){var r=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(r)return r[1]}function f(e){return!!e&&/^[^\s#?]+$/.test(e)}function p(e){var r=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(r)return r[1]}function d(e){return!!e&&/^[^\s#?]+$/.test(e)}function y(e){var r=/^\S+?\?([^\s#]+)/.exec(e);if(r)return r[1]}function h(e){return!!e&&/^[^\s#?\/]+$/.test(e)}function b(e){var r=/^\S+?(#[^\s\?]*)/.exec(e);if(r)return r[1]}function g(e){return!!e&&/^#[^\s#?\/]*$/.test(e)}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0;if(!r||!Object.keys(r).length)return e;var t=e,o=e.indexOf("?");return-1!==o&&(r=Object.assign(Object(n.parse)(e.substr(o+1)),r),t=t.substr(0,o)),t+"?"+Object(n.stringify)(r)}function m(e,r){var t=e.indexOf("?");return(-1!==t?Object(n.parse)(e.substr(t+1)):{})[r]}function O(e,r){return void 0!==m(e,r)}function j(e){for(var r=e.indexOf("?"),t=-1!==r?Object(n.parse)(e.substr(r+1)):{},o=-1!==r?e.substr(0,r):e,i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];return a.forEach((function(e){return delete t[e]})),o+"?"+Object(n.stringify)(t)}function w(e){return a.test(e)||i.test(e)?e:"http://"+e}function A(e){try{return decodeURI(e)}catch(r){return e}}function x(e){var r=e.replace(/^(?:https?:)\/\/(?:www\.)?/,"");return r.match(/^[^\/]+\/$/)?r.replace("/",""):r}function P(e){try{return decodeURIComponent(e)}catch(r){return e}}},355:function(e,r,t){"use strict";var n=t(201),o=t(202),i={brackets:function(e){return e+"[]"},indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},a=Array.isArray,c=Array.prototype.push,u=function(e,r){c.apply(e,a(r)?r:[r])},s=Date.prototype.toISOString,l={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,indices:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(r,t,o,i,a,c,s,f,p,d,y,h,b){var g=r;if("function"==typeof s?g=s(t,g):g instanceof Date&&(g=d(g)),null===g){if(i)return c&&!h?c(t,l.encoder,b):t;g=""}if("string"==typeof g||"number"==typeof g||"boolean"==typeof g||n.isBuffer(g))return c?[y(h?t:c(t,l.encoder,b))+"="+y(c(g,l.encoder,b))]:[y(t)+"="+y(String(g))];var v,m=[];if(void 0===g)return m;if(Array.isArray(s))v=s;else{var O=Object.keys(g);v=f?O.sort(f):O}for(var j=0;j<v.length;++j){var w=v[j];a&&null===g[w]||(Array.isArray(g)?u(m,e(g[w],o(t,w),o,i,a,c,s,f,p,d,y,h,b)):u(m,e(g[w],t+(p?"."+w:"["+w+"]"),o,i,a,c,s,f,p,d,y,h,b)))}return m};e.exports=function(e,r){var t=e,a=r?n.assign({},r):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var c=void 0===a.delimiter?l.delimiter:a.delimiter,s="boolean"==typeof a.strictNullHandling?a.strictNullHandling:l.strictNullHandling,p="boolean"==typeof a.skipNulls?a.skipNulls:l.skipNulls,d="boolean"==typeof a.encode?a.encode:l.encode,y="function"==typeof a.encoder?a.encoder:l.encoder,h="function"==typeof a.sort?a.sort:null,b=void 0===a.allowDots?l.allowDots:!!a.allowDots,g="function"==typeof a.serializeDate?a.serializeDate:l.serializeDate,v="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:l.encodeValuesOnly,m=a.charset||l.charset;if(void 0!==a.charset&&"utf-8"!==a.charset&&"iso-8859-1"!==a.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0===a.format)a.format=o.default;else if(!Object.prototype.hasOwnProperty.call(o.formatters,a.format))throw new TypeError("Unknown format option provided.");var O,j,w=o.formatters[a.format];"function"==typeof a.filter?t=(j=a.filter)("",t):Array.isArray(a.filter)&&(O=j=a.filter);var A,x=[];if("object"!=typeof t||null===t)return"";A=a.arrayFormat in i?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var P=i[A];O||(O=Object.keys(t)),h&&O.sort(h);for(var S=0;S<O.length;++S){var D=O[S];p&&null===t[D]||u(x,f(t[D],D,P,s,p,d?y:null,j,h,b,g,w,v,m))}var N=x.join(c),C=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&(C+="iso-8859-1"===m?"utf8=%26%2310003%3B&":"utf8=%E2%9C%93&"),N.length>0?C+N:""}},356:function(e,r,t){"use strict";var n=t(201),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,r){return String.fromCharCode(parseInt(r,10))}))},c=function(e,r,t){if(e){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,u=[];if(c){if(!t.plainObjects&&o.call(Object.prototype,c)&&!t.allowPrototypes)return;u.push(c)}for(var s=0;null!==(a=i.exec(n))&&s<t.depth;){if(s+=1,!t.plainObjects&&o.call(Object.prototype,a[1].slice(1,-1))&&!t.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+n.slice(a.index)+"]"),function(e,r,t){for(var n=r,o=e.length-1;o>=0;--o){var i,a=e[o];if("[]"===a&&t.parseArrays)i=[].concat(n);else{i=t.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(c,10);t.parseArrays||""!==c?!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&t.parseArrays&&u<=t.arrayLimit?(i=[])[u]=n:i[c]=n:i={0:n}}n=i}return n}(u,r,t)}};e.exports=function(e,r){var t=r?n.assign({},r):{};if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(t.ignoreQueryPrefix=!0===t.ignoreQueryPrefix,t.delimiter="string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:i.delimiter,t.depth="number"==typeof t.depth?t.depth:i.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:i.arrayLimit,t.parseArrays=!1!==t.parseArrays,t.decoder="function"==typeof t.decoder?t.decoder:i.decoder,t.allowDots=void 0===t.allowDots?i.allowDots:!!t.allowDots,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:i.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:i.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:i.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:i.strictNullHandling,void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0===t.charset&&(t.charset=i.charset),""===e||null==e)return t.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,r){var t,c={},u=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,l=u.split(r.delimiter,s),f=-1,p=r.charset;if(r.charsetSentinel)for(t=0;t<l.length;++t)0===l[t].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[t]?p="utf-8":"utf8=%26%2310003%3B"===l[t]&&(p="iso-8859-1"),f=t,t=l.length);for(t=0;t<l.length;++t)if(t!==f){var d,y,h=l[t],b=h.indexOf("]="),g=-1===b?h.indexOf("="):b+1;-1===g?(d=r.decoder(h,i.decoder,p),y=r.strictNullHandling?null:""):(d=r.decoder(h.slice(0,g),i.decoder,p),y=r.decoder(h.slice(g+1),i.decoder,p)),y&&r.interpretNumericEntities&&"iso-8859-1"===p&&(y=a(y)),o.call(c,d)?c[d]=n.combine(c[d],y):c[d]=y}return c}(e,t):e,s=t.plainObjects?Object.create(null):{},l=Object.keys(u),f=0;f<l.length;++f){var p=l[f],d=c(p,u[p],t);s=n.merge(s,d,t)}return n.compact(s)}},86:function(e,r,t){"use strict";var n=t(355),o=t(356),i=t(202);e.exports={formats:i,parse:o,stringify:n}}});