UNPKG

@andreekeberg/imagedata

Version:

Unified method of retrieving an ImageData instance from an image, in both the browser and Node.js, asynchronously or synchronously

1 lines 34.9 kB
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=52)}([function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){(function(e){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")()}).call(this,r(58))},function(t,e,r){var n=r(1),o=r(33),i=r(0),u=r(34),a=r(42),c=r(65),s=o("wks"),f=n.Symbol,l=c?f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(a&&i(f,t)?s[t]=f[t]:s[t]=l("Symbol."+t)),s[t]}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(5),o=r(11),i=r(8);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(3);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,r){var n=r(7);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e,r){var n,o,i,u=r(57),a=r(1),c=r(7),s=r(4),f=r(0),l=r(19),p=r(20),h=a.WeakMap;if(u){var v=new h,g=v.get,y=v.has,d=v.set;n=function(t,e){return d.call(v,t,e),e},o=function(t){return g.call(v,t)||{}},i=function(t){return y.call(v,t)}}else{var m=l("state");p[m]=!0,n=function(t,e){return s(t,m,e),e},o=function(t){return f(t,m)?t[m]:{}},i=function(t){return f(t,m)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!c(e)||(r=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,e,r){var n=r(5),o=r(31),i=r(6),u=r(18),a=Object.defineProperty;e.f=n?a:function(t,e,r){if(i(t),e=u(e,!0),i(r),o)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},function(t,e){t.exports=!0},function(t,e,r){var n=r(37),o=r(17);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(25),o=r(11).f,i=r(4),u=r(0),a=r(70),c=r(2)("toStringTag");t.exports=function(t,e,r,s){if(t){var f=r?t:t.prototype;u(f,c)||o(f,c,{configurable:!0,value:e}),s&&!n&&i(f,"toString",a)}}},function(t,e,r){var n=r(4);t.exports=function(t,e,r,o){o&&o.enumerable?t[e]=r:n(t,e,r)}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(7);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(33),o=r(34),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e){t.exports={}},function(t,e,r){"use strict";var n=r(1),o=r(61).f,i=r(62),u=r(22),a=r(23),c=r(4),s=r(0),f=function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var r,l,p,h,v,g,y,d,m=t.target,b=t.global,w=t.stat,x=t.proto,S=b?n:w?n[m]:(n[m]||{}).prototype,j=b?u:u[m]||(u[m]={}),A=j.prototype;for(p in e)r=!i(b?p:m+(w?".":"#")+p,t.forced)&&S&&s(S,p),v=j[p],r&&(g=t.noTargetGet?(d=o(S,p))&&d.value:S[p]),h=r&&g?g:e[p],r&&typeof v==typeof h||(y=t.bind&&r?a(h,n):t.wrap&&r?f(h):x&&"function"==typeof h?a(Function.call,h):h,(t.sham||h&&h.sham||v&&v.sham)&&c(y,"sham",!0),j[p]=y,x&&(s(u,l=m+"Prototype")||c(u,l,{}),u[l][p]=h,t.real&&A&&!A[p]&&c(A,p,h)))}},function(t,e){t.exports={}},function(t,e,r){var n=r(63);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var n=r(17);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n={};n[r(2)("toStringTag")]="z",t.exports="[object z]"===String(n)},function(t,e,r){var n=r(25),o=r(38),i=r(2)("toStringTag"),u="Arguments"==o(function(){return arguments}());t.exports=n?o:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?r:u?o(e):"Object"==(n=o(e))&&"function"==typeof e.callee?"Arguments":n}},function(t,e,r){var n=r(26),o=r(9),i=r(2)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[n(t)]}},function(t,e,r){t.exports=r(53)},function(t,e,r){var n=r(16),o=r(17),i=function(t){return function(e,r){var i,u,a=String(o(e)),c=n(r),s=a.length;return c<0||c>=s?t?"":void 0:(i=a.charCodeAt(c))<55296||i>56319||c+1===s||(u=a.charCodeAt(c+1))<56320||u>57343?t?a.charAt(c):i:t?a.slice(c,c+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,e,r){var n=r(1),o=r(60),i=n["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,r){var n=r(5),o=r(3),i=r(32);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,r){var n=r(1),o=r(7),i=n.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,e,r){var n=r(12),o=r(30);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+n).toString(36)}},function(t,e,r){"use strict";var n=r(21),o=r(39),i=r(41),u=r(71),a=r(14),c=r(4),s=r(15),f=r(2),l=r(12),p=r(9),h=r(40),v=h.IteratorPrototype,g=h.BUGGY_SAFARI_ITERATORS,y=f("iterator"),d=function(){return this};t.exports=function(t,e,r,f,h,m,b){o(r,e,f);var w,x,S,j=function(t){if(t===h&&R)return R;if(!g&&t in k)return k[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},A=e+" Iterator",O=!1,k=t.prototype,L=k[y]||k["@@iterator"]||h&&k[h],R=!g&&L||j(h),U="Array"==e&&k.entries||L;if(U&&(w=i(U.call(new t)),v!==Object.prototype&&w.next&&(l||i(w)===v||(u?u(w,v):"function"!=typeof w[y]&&c(w,y,d)),a(w,A,!0,!0),l&&(p[A]=d))),"values"==h&&L&&"values"!==L.name&&(O=!0,R=function(){return L.call(this)}),l&&!b||k[y]===R||c(k,y,R),p[e]=R,h)if(x={values:j("values"),keys:m?R:j("keys"),entries:j("entries")},b)for(S in x)(g||O||!(S in k))&&s(k,S,x[S]);else n({target:e,proto:!0,forced:g||O},x);return x}},function(t,e,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},function(t,e,r){var n=r(3),o=r(38),i="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){"use strict";var n=r(40).IteratorPrototype,o=r(43),i=r(8),u=r(14),a=r(9),c=function(){return this};t.exports=function(t,e,r){var s=e+" Iterator";return t.prototype=o(n,{next:i(1,r)}),u(t,s,!1,!0),a[s]=c,t}},function(t,e,r){"use strict";var n,o,i,u=r(41),a=r(4),c=r(0),s=r(2),f=r(12),l=s("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(n=o):p=!0),null==n&&(n={}),f||c(n,l)||a(n,l,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},function(t,e,r){var n=r(0),o=r(24),i=r(19),u=r(64),a=i("IE_PROTO"),c=Object.prototype;t.exports=u?Object.getPrototypeOf:function(t){return t=o(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},function(t,e,r){var n=r(3);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(t,e,r){var n,o=r(6),i=r(44),u=r(47),a=r(20),c=r(69),s=r(32),f=r(19),l=f("IE_PROTO"),p=function(){},h=function(t){return"<script>"+t+"<\/script>"},v=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;v=n?function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e}(n):((e=s("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F);for(var r=u.length;r--;)delete v.prototype[u[r]];return v()};a[l]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(p.prototype=o(t),r=new p,p.prototype=null,r[l]=t):r=v(),void 0===e?r:i(r,e)}},function(t,e,r){var n=r(5),o=r(11),i=r(6),u=r(45);t.exports=n?Object.defineProperties:function(t,e){i(t);for(var r,n=u(e),a=n.length,c=0;a>c;)o.f(t,r=n[c++],e[r]);return t}},function(t,e,r){var n=r(66),o=r(47);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(16),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,r){var n=r(22),o=r(1),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t])||i(o[t]):n[t]&&n[t][e]||o[t]&&o[t][e]}},function(t,e,r){var n=r(3),o=r(2),i=r(12),u=o("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),i&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},function(t,e){t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},function(t,e,r){"use strict";r(80);var n=r(21),o=r(48),i=r(49),u=r(15),a=r(82),c=r(14),s=r(39),f=r(10),l=r(50),p=r(0),h=r(23),v=r(26),g=r(6),y=r(7),d=r(43),m=r(8),b=r(83),w=r(27),x=r(2),S=o("fetch"),j=o("Headers"),A=x("iterator"),O=f.set,k=f.getterFor("URLSearchParams"),L=f.getterFor("URLSearchParamsIterator"),R=/\+/g,U=Array(4),I=function(t){return U[t-1]||(U[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},P=function(t){try{return decodeURIComponent(t)}catch(e){return t}},E=function(t){var e=t.replace(R," "),r=4;try{return decodeURIComponent(e)}catch(t){for(;r;)e=e.replace(I(r--),P);return e}},T=/[!'()~]|%20/g,_={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},q=function(t){return _[t]},B=function(t){return encodeURIComponent(t).replace(T,q)},F=function(t,e){if(e)for(var r,n,o=e.split("&"),i=0;i<o.length;)(r=o[i++]).length&&(n=r.split("="),t.push({key:E(n.shift()),value:E(n.join("="))}))},M=function(t){this.entries.length=0,F(this.entries,t)},C=function(t,e){if(t<e)throw TypeError("Not enough arguments")},D=s((function(t,e){O(this,{type:"URLSearchParamsIterator",iterator:b(k(t).entries),kind:e})}),"Iterator",(function(){var t=L(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r})),H=function(){l(this,H,"URLSearchParams");var t,e,r,n,o,i,u,a,c,s=arguments.length>0?arguments[0]:void 0,f=this,h=[];if(O(f,{type:"URLSearchParams",entries:h,updateURL:function(){},updateSearchParams:M}),void 0!==s)if(y(s))if("function"==typeof(t=w(s)))for(r=(e=t.call(s)).next;!(n=r.call(e)).done;){if((u=(i=(o=b(g(n.value))).next).call(o)).done||(a=i.call(o)).done||!i.call(o).done)throw TypeError("Expected sequence with length 2");h.push({key:u.value+"",value:a.value+""})}else for(c in s)p(s,c)&&h.push({key:c,value:s[c]+""});else F(h,"string"==typeof s?"?"===s.charAt(0)?s.slice(1):s:s+"")},N=H.prototype;a(N,{append:function(t,e){C(arguments.length,2);var r=k(this);r.entries.push({key:t+"",value:e+""}),r.updateURL()},delete:function(t){C(arguments.length,1);for(var e=k(this),r=e.entries,n=t+"",o=0;o<r.length;)r[o].key===n?r.splice(o,1):o++;e.updateURL()},get:function(t){C(arguments.length,1);for(var e=k(this).entries,r=t+"",n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){C(arguments.length,1);for(var e=k(this).entries,r=t+"",n=[],o=0;o<e.length;o++)e[o].key===r&&n.push(e[o].value);return n},has:function(t){C(arguments.length,1);for(var e=k(this).entries,r=t+"",n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function(t,e){C(arguments.length,1);for(var r,n=k(this),o=n.entries,i=!1,u=t+"",a=e+"",c=0;c<o.length;c++)(r=o[c]).key===u&&(i?o.splice(c--,1):(i=!0,r.value=a));i||o.push({key:u,value:a}),n.updateURL()},sort:function(){var t,e,r,n=k(this),o=n.entries,i=o.slice();for(o.length=0,r=0;r<i.length;r++){for(t=i[r],e=0;e<r;e++)if(o[e].key>t.key){o.splice(e,0,t);break}e===r&&o.push(t)}n.updateURL()},forEach:function(t){for(var e,r=k(this).entries,n=h(t,arguments.length>1?arguments[1]:void 0,3),o=0;o<r.length;)n((e=r[o++]).value,e.key,this)},keys:function(){return new D(this,"keys")},values:function(){return new D(this,"values")},entries:function(){return new D(this,"entries")}},{enumerable:!0}),u(N,A,N.entries),u(N,"toString",(function(){for(var t,e=k(this).entries,r=[],n=0;n<e.length;)t=e[n++],r.push(B(t.key)+"="+B(t.value));return r.join("&")}),{enumerable:!0}),c(H,"URLSearchParams"),n({global:!0,forced:!i},{URLSearchParams:H}),i||"function"!=typeof S||"function"!=typeof j||n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){var e,r,n,o=[t];return arguments.length>1&&(y(e=arguments[1])&&(r=e.body,"URLSearchParams"===v(r)&&((n=e.headers?new j(e.headers):new j).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=d(e,{body:m(0,String(r)),headers:m(0,n)}))),o.push(e)),S.apply(this,o)}}),t.exports={URLSearchParams:H,getState:k}},function(t,e,r){"use strict";r.r(e),r.d(e,"get",(function(){return a})),r.d(e,"getSync",(function(){return c}));var n=r(28),o=r.n(n),i=function(t,e){if("string"!=typeof t)throw new Error("Argument src must be a string");if("function"!=typeof e)throw new Error("Argument callback must be a function");var r=new Image;r.onerror=function(t){return e(t,null)},r.onload=function(){e(null,u(this))},r.src=t},u=function(t){if(!(t instanceof HTMLImageElement))throw new Error("Argument image must be a HTMLImageElement");var e=document.createElement("canvas"),r=e.getContext("2d");return e.width=t.naturalWidth,e.height=t.naturalHeight,r.drawImage(t,0,0),r.getImageData(0,0,t.naturalWidth,t.naturalHeight)},a=function(t,e){if("function"!=typeof e)throw new Error("Argument callback must be a function");if("string"==typeof t)i(t,e);else if(t instanceof HTMLImageElement)t.complete?e(null,u(t)):t.onload=function(){e(null,u(t))};else{if(!(t instanceof File||t instanceof Blob))throw new Error("Argument data must be a string, HTMLImageElement, File or Blob");var r=o.a.createObjectURL(t);i(r,(function(t,n){t?e(t,null):(o.a.revokeObjectURL(r),e(null,n))}))}},c=function(t){if(!(t instanceof HTMLImageElement))throw new Error("Argument image must be an HTMLImageElement");if(t.complete)return u(t);throw new Error("Image has not completed loading")}},function(t,e,r){var n=r(54);t.exports=n},function(t,e,r){r(55),r(84),r(51);var n=r(22);t.exports=n.URL},function(t,e,r){"use strict";r(56);var n,o=r(21),i=r(5),u=r(49),a=r(1),c=r(44),s=r(15),f=r(50),l=r(0),p=r(73),h=r(75),v=r(29).codeAt,g=r(79),y=r(14),d=r(51),m=r(10),b=a.URL,w=d.URLSearchParams,x=d.getState,S=m.set,j=m.getterFor("URL"),A=Math.floor,O=Math.pow,k=/[A-Za-z]/,L=/[\d+-.A-Za-z]/,R=/\d/,U=/^(0x|0X)/,I=/^[0-7]+$/,P=/^\d+$/,E=/^[\dA-Fa-f]+$/,T=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,_=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,q=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,B=/[\u0009\u000A\u000D]/g,F=function(t,e){var r,n,o;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return"Invalid host";if(!(r=C(e.slice(1,-1))))return"Invalid host";t.host=r}else if(Y(t)){if(e=g(e),T.test(e))return"Invalid host";if(null===(r=M(e)))return"Invalid host";t.host=r}else{if(_.test(e))return"Invalid host";for(r="",n=h(e),o=0;o<n.length;o++)r+=G(n[o],H);t.host=r}},M=function(t){var e,r,n,o,i,u,a,c=t.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(e=c.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(o=c[n]))return t;if(i=10,o.length>1&&"0"==o.charAt(0)&&(i=U.test(o)?16:8,o=o.slice(8==i?1:2)),""===o)u=0;else{if(!(10==i?P:8==i?I:E).test(o))return t;u=parseInt(o,i)}r.push(u)}for(n=0;n<e;n++)if(u=r[n],n==e-1){if(u>=O(256,5-e))return null}else if(u>255)return null;for(a=r.pop(),n=0;n<r.length;n++)a+=r[n]*O(256,3-n);return a},C=function(t){var e,r,n,o,i,u,a,c=[0,0,0,0,0,0,0,0],s=0,f=null,l=0,p=function(){return t.charAt(l)};if(":"==p()){if(":"!=t.charAt(1))return;l+=2,f=++s}for(;p();){if(8==s)return;if(":"!=p()){for(e=r=0;r<4&&E.test(p());)e=16*e+parseInt(p(),16),l++,r++;if("."==p()){if(0==r)return;if(l-=r,s>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;l++}if(!R.test(p()))return;for(;R.test(p());){if(i=parseInt(p(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;l++}c[s]=256*c[s]+o,2!=++n&&4!=n||s++}if(4!=n)return;break}if(":"==p()){if(l++,!p())return}else if(p())return;c[s++]=e}else{if(null!==f)return;l++,f=++s}}if(null!==f)for(u=s-f,s=7;0!=s&&u>0;)a=c[s],c[s--]=c[f+u-1],c[f+--u]=a;else if(8!=s)return;return c},D=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)e.unshift(t%256),t=A(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=t[r].toString(16),r<7&&(e+=":")));return"["+e+"]"}return t},H={},N=p({},H,{" ":1,'"':1,"<":1,">":1,"`":1}),z=p({},N,{"#":1,"?":1,"{":1,"}":1}),W=p({},z,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),G=function(t,e){var r=v(t,0);return r>32&&r<127&&!l(e,t)?t:encodeURIComponent(t)},$={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Y=function(t){return l($,t.scheme)},J=function(t){return""!=t.username||""!=t.password},X=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},Z=function(t,e){var r;return 2==t.length&&k.test(t.charAt(0))&&(":"==(r=t.charAt(1))||!e&&"|"==r)},V=function(t){var e;return t.length>1&&Z(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},K=function(t){var e=t.path,r=e.length;!r||"file"==t.scheme&&1==r&&Z(e[0],!0)||e.pop()},Q=function(t){return"."===t||"%2e"===t.toLowerCase()},tt={},et={},rt={},nt={},ot={},it={},ut={},at={},ct={},st={},ft={},lt={},pt={},ht={},vt={},gt={},yt={},dt={},mt={},bt={},wt={},xt=function(t,e,r,o){var i,u,a,c,s,f=r||tt,p=0,v="",g=!1,y=!1,d=!1;for(r||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(q,"")),e=e.replace(B,""),i=h(e);p<=i.length;){switch(u=i[p],f){case tt:if(!u||!k.test(u)){if(r)return"Invalid scheme";f=rt;continue}v+=u.toLowerCase(),f=et;break;case et:if(u&&(L.test(u)||"+"==u||"-"==u||"."==u))v+=u.toLowerCase();else{if(":"!=u){if(r)return"Invalid scheme";v="",f=rt,p=0;continue}if(r&&(Y(t)!=l($,v)||"file"==v&&(J(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=v,r)return void(Y(t)&&$[t.scheme]==t.port&&(t.port=null));v="","file"==t.scheme?f=ht:Y(t)&&o&&o.scheme==t.scheme?f=nt:Y(t)?f=at:"/"==i[p+1]?(f=ot,p++):(t.cannotBeABaseURL=!0,t.path.push(""),f=mt)}break;case rt:if(!o||o.cannotBeABaseURL&&"#"!=u)return"Invalid scheme";if(o.cannotBeABaseURL&&"#"==u){t.scheme=o.scheme,t.path=o.path.slice(),t.query=o.query,t.fragment="",t.cannotBeABaseURL=!0,f=wt;break}f="file"==o.scheme?ht:it;continue;case nt:if("/"!=u||"/"!=i[p+1]){f=it;continue}f=ct,p++;break;case ot:if("/"==u){f=st;break}f=dt;continue;case it:if(t.scheme=o.scheme,u==n)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query;else if("/"==u||"\\"==u&&Y(t))f=ut;else if("?"==u)t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query="",f=bt;else{if("#"!=u){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.path.pop(),f=dt;continue}t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,t.path=o.path.slice(),t.query=o.query,t.fragment="",f=wt}break;case ut:if(!Y(t)||"/"!=u&&"\\"!=u){if("/"!=u){t.username=o.username,t.password=o.password,t.host=o.host,t.port=o.port,f=dt;continue}f=st}else f=ct;break;case at:if(f=ct,"/"!=u||"/"!=v.charAt(p+1))continue;p++;break;case ct:if("/"!=u&&"\\"!=u){f=st;continue}break;case st:if("@"==u){g&&(v="%40"+v),g=!0,a=h(v);for(var m=0;m<a.length;m++){var b=a[m];if(":"!=b||d){var w=G(b,W);d?t.password+=w:t.username+=w}else d=!0}v=""}else if(u==n||"/"==u||"?"==u||"#"==u||"\\"==u&&Y(t)){if(g&&""==v)return"Invalid authority";p-=h(v).length+1,v="",f=ft}else v+=u;break;case ft:case lt:if(r&&"file"==t.scheme){f=gt;continue}if(":"!=u||y){if(u==n||"/"==u||"?"==u||"#"==u||"\\"==u&&Y(t)){if(Y(t)&&""==v)return"Invalid host";if(r&&""==v&&(J(t)||null!==t.port))return;if(c=F(t,v))return c;if(v="",f=yt,r)return;continue}"["==u?y=!0:"]"==u&&(y=!1),v+=u}else{if(""==v)return"Invalid host";if(c=F(t,v))return c;if(v="",f=pt,r==lt)return}break;case pt:if(!R.test(u)){if(u==n||"/"==u||"?"==u||"#"==u||"\\"==u&&Y(t)||r){if(""!=v){var x=parseInt(v,10);if(x>65535)return"Invalid port";t.port=Y(t)&&x===$[t.scheme]?null:x,v=""}if(r)return;f=yt;continue}return"Invalid port"}v+=u;break;case ht:if(t.scheme="file","/"==u||"\\"==u)f=vt;else{if(!o||"file"!=o.scheme){f=dt;continue}if(u==n)t.host=o.host,t.path=o.path.slice(),t.query=o.query;else if("?"==u)t.host=o.host,t.path=o.path.slice(),t.query="",f=bt;else{if("#"!=u){V(i.slice(p).join(""))||(t.host=o.host,t.path=o.path.slice(),K(t)),f=dt;continue}t.host=o.host,t.path=o.path.slice(),t.query=o.query,t.fragment="",f=wt}}break;case vt:if("/"==u||"\\"==u){f=gt;break}o&&"file"==o.scheme&&!V(i.slice(p).join(""))&&(Z(o.path[0],!0)?t.path.push(o.path[0]):t.host=o.host),f=dt;continue;case gt:if(u==n||"/"==u||"\\"==u||"?"==u||"#"==u){if(!r&&Z(v))f=dt;else if(""==v){if(t.host="",r)return;f=yt}else{if(c=F(t,v))return c;if("localhost"==t.host&&(t.host=""),r)return;v="",f=yt}continue}v+=u;break;case yt:if(Y(t)){if(f=dt,"/"!=u&&"\\"!=u)continue}else if(r||"?"!=u)if(r||"#"!=u){if(u!=n&&(f=dt,"/"!=u))continue}else t.fragment="",f=wt;else t.query="",f=bt;break;case dt:if(u==n||"/"==u||"\\"==u&&Y(t)||!r&&("?"==u||"#"==u)){if(".."===(s=(s=v).toLowerCase())||"%2e."===s||".%2e"===s||"%2e%2e"===s?(K(t),"/"==u||"\\"==u&&Y(t)||t.path.push("")):Q(v)?"/"==u||"\\"==u&&Y(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&Z(v)&&(t.host&&(t.host=""),v=v.charAt(0)+":"),t.path.push(v)),v="","file"==t.scheme&&(u==n||"?"==u||"#"==u))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==u?(t.query="",f=bt):"#"==u&&(t.fragment="",f=wt)}else v+=G(u,z);break;case mt:"?"==u?(t.query="",f=bt):"#"==u?(t.fragment="",f=wt):u!=n&&(t.path[0]+=G(u,H));break;case bt:r||"#"!=u?u!=n&&("'"==u&&Y(t)?t.query+="%27":t.query+="#"==u?"%23":G(u,H)):(t.fragment="",f=wt);break;case wt:u!=n&&(t.fragment+=G(u,N))}p++}},St=function(t){var e,r,n=f(this,St,"URL"),o=arguments.length>1?arguments[1]:void 0,u=String(t),a=S(n,{type:"URL"});if(void 0!==o)if(o instanceof St)e=j(o);else if(r=xt(e={},String(o)))throw TypeError(r);if(r=xt(a,u,null,e))throw TypeError(r);var c=a.searchParams=new w,s=x(c);s.updateSearchParams(a.query),s.updateURL=function(){a.query=String(c)||null},i||(n.href=At.call(n),n.origin=Ot.call(n),n.protocol=kt.call(n),n.username=Lt.call(n),n.password=Rt.call(n),n.host=Ut.call(n),n.hostname=It.call(n),n.port=Pt.call(n),n.pathname=Et.call(n),n.search=Tt.call(n),n.searchParams=_t.call(n),n.hash=qt.call(n))},jt=St.prototype,At=function(){var t=j(this),e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,u=t.path,a=t.query,c=t.fragment,s=e+":";return null!==o?(s+="//",J(t)&&(s+=r+(n?":"+n:"")+"@"),s+=D(o),null!==i&&(s+=":"+i)):"file"==e&&(s+="//"),s+=t.cannotBeABaseURL?u[0]:u.length?"/"+u.join("/"):"",null!==a&&(s+="?"+a),null!==c&&(s+="#"+c),s},Ot=function(){var t=j(this),e=t.scheme,r=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&Y(t)?e+"://"+D(t.host)+(null!==r?":"+r:""):"null"},kt=function(){return j(this).scheme+":"},Lt=function(){return j(this).username},Rt=function(){return j(this).password},Ut=function(){var t=j(this),e=t.host,r=t.port;return null===e?"":null===r?D(e):D(e)+":"+r},It=function(){var t=j(this).host;return null===t?"":D(t)},Pt=function(){var t=j(this).port;return null===t?"":String(t)},Et=function(){var t=j(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Tt=function(){var t=j(this).query;return t?"?"+t:""},_t=function(){return j(this).searchParams},qt=function(){var t=j(this).fragment;return t?"#"+t:""},Bt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(i&&c(jt,{href:Bt(At,(function(t){var e=j(this),r=String(t),n=xt(e,r);if(n)throw TypeError(n);x(e.searchParams).updateSearchParams(e.query)})),origin:Bt(Ot),protocol:Bt(kt,(function(t){var e=j(this);xt(e,String(t)+":",tt)})),username:Bt(Lt,(function(t){var e=j(this),r=h(String(t));if(!X(e)){e.username="";for(var n=0;n<r.length;n++)e.username+=G(r[n],W)}})),password:Bt(Rt,(function(t){var e=j(this),r=h(String(t));if(!X(e)){e.password="";for(var n=0;n<r.length;n++)e.password+=G(r[n],W)}})),host:Bt(Ut,(function(t){var e=j(this);e.cannotBeABaseURL||xt(e,String(t),ft)})),hostname:Bt(It,(function(t){var e=j(this);e.cannotBeABaseURL||xt(e,String(t),lt)})),port:Bt(Pt,(function(t){var e=j(this);X(e)||(""==(t=String(t))?e.port=null:xt(e,t,pt))})),pathname:Bt(Et,(function(t){var e=j(this);e.cannotBeABaseURL||(e.path=[],xt(e,t+"",yt))})),search:Bt(Tt,(function(t){var e=j(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",xt(e,t,bt)),x(e.searchParams).updateSearchParams(e.query)})),searchParams:Bt(_t),hash:Bt(qt,(function(t){var e=j(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",xt(e,t,wt)):e.fragment=null}))}),s(jt,"toJSON",(function(){return At.call(this)}),{enumerable:!0}),s(jt,"toString",(function(){return At.call(this)}),{enumerable:!0}),b){var Ft=b.createObjectURL,Mt=b.revokeObjectURL;Ft&&s(St,"createObjectURL",(function(t){return Ft.apply(b,arguments)})),Mt&&s(St,"revokeObjectURL",(function(t){return Mt.apply(b,arguments)}))}y(St,"URL"),o({global:!0,forced:!u,sham:!i},{URL:St})},function(t,e,r){"use strict";var n=r(29).charAt,o=r(10),i=r(35),u=o.set,a=o.getterFor("String Iterator");i(String,"String",(function(t){u(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=a(this),r=e.string,o=e.index;return o>=r.length?{value:void 0,done:!0}:(t=n(r,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,r){var n=r(1),o=r(59),i=n.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(30),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return o.call(t)}),t.exports=n.inspectSource},function(t,e,r){var n=r(1),o=r(4);t.exports=function(t,e){try{o(n,t,e)}catch(r){n[t]=e}return e}},function(t,e,r){var n=r(5),o=r(36),i=r(8),u=r(13),a=r(18),c=r(0),s=r(31),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=u(t),e=a(e,!0),s)try{return f(t,e)}catch(t){}if(c(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,r){var n=r(3),o=/#|\.prototype\./,i=function(t,e){var r=a[u(t)];return r==s||r!=c&&("function"==typeof e?n(e):!!e)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=i.data={},c=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,r){var n=r(3);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,r){var n=r(42);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,r){var n=r(0),o=r(13),i=r(67).indexOf,u=r(20);t.exports=function(t,e){var r,a=o(t),c=0,s=[];for(r in a)!n(u,r)&&n(a,r)&&s.push(r);for(;e.length>c;)n(a,r=e[c++])&&(~i(s,r)||s.push(r));return s}},function(t,e,r){var n=r(13),o=r(46),i=r(68),u=function(t){return function(e,r,u){var a,c=n(e),s=o(c.length),f=i(u,s);if(t&&r!=r){for(;s>f;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,e,r){var n=r(16),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},function(t,e,r){var n=r(48);t.exports=n("document","documentElement")},function(t,e,r){"use strict";var n=r(25),o=r(26);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},function(t,e,r){var n=r(6),o=r(72);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),o(i),e?t.call(r,i):r.__proto__=i,r}}():void 0)},function(t,e,r){var n=r(7);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,r){"use strict";var n=r(5),o=r(3),i=r(45),u=r(74),a=r(36),c=r(24),s=r(37),f=Object.assign,l=Object.defineProperty;t.exports=!f||o((function(){if(n&&1!==f({b:1},f(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol();return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=f({},t)[r]||"abcdefghijklmnopqrst"!=i(f({},e)).join("")}))?function(t,e){for(var r=c(t),o=arguments.length,f=1,l=u.f,p=a.f;o>f;)for(var h,v=s(arguments[f++]),g=l?i(v).concat(l(v)):i(v),y=g.length,d=0;y>d;)h=g[d++],n&&!p.call(v,h)||(r[h]=v[h]);return r}:f},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){"use strict";var n=r(23),o=r(24),i=r(76),u=r(77),a=r(46),c=r(78),s=r(27);t.exports=function(t){var e,r,f,l,p,h,v=o(t),g="function"==typeof this?this:Array,y=arguments.length,d=y>1?arguments[1]:void 0,m=void 0!==d,b=s(v),w=0;if(m&&(d=n(d,y>2?arguments[2]:void 0,2)),null==b||g==Array&&u(b))for(r=new g(e=a(v.length));e>w;w++)h=m?d(v[w],w):v[w],c(r,w,h);else for(p=(l=b.call(v)).next,r=new g;!(f=p.call(l)).done;w++)h=m?i(l,d,[f.value,w],!0):f.value,c(r,w,h);return r.length=w,r}},function(t,e,r){var n=r(6);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&n(i.call(t)),e}}},function(t,e,r){var n=r(2),o=r(9),i=n("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||u[i]===t)}},function(t,e,r){"use strict";var n=r(18),o=r(11),i=r(8);t.exports=function(t,e,r){var u=n(e);u in t?o.f(t,u,i(0,r)):t[u]=r}},function(t,e,r){"use strict";var n=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",u=Math.floor,a=String.fromCharCode,c=function(t){return t+22+75*(t<26)},s=function(t,e,r){var n=0;for(t=r?u(t/700):t>>1,t+=u(t/e);t>455;n+=36)t=u(t/35);return u(n+36*t/(t+38))},f=function(t){var e,r,n=[],o=(t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=t.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var i=t.charCodeAt(r++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),r--)}else e.push(o)}return e}(t)).length,f=128,l=0,p=72;for(e=0;e<t.length;e++)(r=t[e])<128&&n.push(a(r));var h=n.length,v=h;for(h&&n.push("-");v<o;){var g=2147483647;for(e=0;e<t.length;e++)(r=t[e])>=f&&r<g&&(g=r);var y=v+1;if(g-f>u((2147483647-l)/y))throw RangeError(i);for(l+=(g-f)*y,f=g,e=0;e<t.length;e++){if((r=t[e])<f&&++l>2147483647)throw RangeError(i);if(r==f){for(var d=l,m=36;;m+=36){var b=m<=p?1:m>=p+26?26:m-p;if(d<b)break;var w=d-b,x=36-b;n.push(a(c(b+w%x))),d=u(w/x)}n.push(a(c(d))),p=s(l,y,v==h),l=0,++v}}++l,++f}return n.join("")};t.exports=function(t){var e,r,i=[],u=t.toLowerCase().replace(o,".").split(".");for(e=0;e<u.length;e++)r=u[e],i.push(n.test(r)?"xn--"+f(r):r);return i.join(".")}},function(t,e,r){"use strict";var n=r(13),o=r(81),i=r(9),u=r(10),a=r(35),c=u.set,s=u.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,e){c(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e,r){var n=r(15);t.exports=function(t,e,r){for(var o in e)r&&r.unsafe&&t[o]?t[o]=e[o]:n(t,o,e[o],r);return t}},function(t,e,r){var n=r(6),o=r(27);t.exports=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return n(e.call(t))}},function(t,e){}])}));