@microbit/microbit-universal-hex
Version:
Create micro:bit Universal Hexes.
3 lines (2 loc) • 37.7 kB
JavaScript
(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"==typeof globalThis?e||self:globalThis,t(e.microbitUh={}))})(this,function(e){'use strict';var N=String.prototype,k=Math.max,v=Math.floor,C=Math.ceil,B=Math.min;function t(e){var t={exports:{}};return e(t,t.exports),t.exports}function n(e){if(0!=e.length%2)throw new Error("Hex string \""+e+"\" is not divisible by 2.");var t=e.match(/.{1,2}/g);return t?new Uint8Array(t.map(function(t){var n=Number.isNaN,r=parseInt(t,16);if(n(r))throw new Error("There were some non-hex characters in \""+e+"\".");else return r})):new Uint8Array}function r(e){return e.toString(16).toUpperCase().padStart(2,"0")}function a(e){return e.reduce(function(e,t){return e+t.toString(16).toUpperCase().padStart(2,"0")},"")}function o(e){var t=e.reduce(function(e,t){return e+t.length},0),n=new Uint8Array(t);return e.reduce(function(e,t){return n.set(t,e),e+t.length},0),n}function l(e){return!!(e>=Er.Data&&e<=Er.StartLinearAddress||e>=Er.BlockStart&&e<=Er.OtherData)}function d(e){var t=e.reduce(function(e,t){return e+t},0);return 255&-t}function s(e,t,n){if(0>e||65535<e)throw new Error("Record ("+t+") address out of range: "+e);var i=n.length;if(i>32)throw new Error("Record ("+t+") data has too many bytes ("+i+").");if(!l(t))throw new Error("Record type '"+t+"' is not valid.");var s=o([new Uint8Array([i,e>>8,255&e,t]),n]),c=a(s),g=r(d(s));return":"+c+g}function c(e){if(e.length<mr)throw new Error("Record length too small: "+e);if(e.length>Or)throw new Error("Record length is too large: "+e);if(":"!==e[0])throw new Error("Record does not start with a \":\": "+e);return!0}function g(e){c(e);var t=yr+2+4,n=e.slice(t,t+2),r=parseInt(n,16);if(!l(r))throw new Error("Record type '"+n+"' from record '"+e+"' is not valid.");return r}function u(t){try{return n(t.slice(xr,-2))}catch(n){throw new Error("Could not parse Intel Hex record \""+t+"\": "+n.message)}}function h(t){c(t);var r;try{r=n(t.substring(1))}catch(n){throw new Error("Could not parse Intel Hex record \""+t+"\": "+n.message)}var a=r[0],o=1,l=(r[o]<<8)+r[o+1],i=o+2,d=r[i],s=i+1,g=s+a,u=r.slice(s,g),h=r[g],p=g+1;if(r.length>p)throw new Error("Parsed record \""+t+"\" is larger than indicated by the byte count."+("\n\tExpected: "+p+"; Length: "+r.length+"."));return{byteCount:a,address:l,recordType:d,data:u,checksum:h}}function p(){return":00000001FF"}function E(e){if(0>e||4294967295<e)throw new Error("Address '"+e+"' for Extended Linear Address record is out of range.");return s(0,Er.ExtendedLinearAddress,new Uint8Array([255&e>>24,255&e>>16]))}function y(e){if(0>e||65535<e)throw new Error("Board ID out of range when creating Block Start record.");return s(0,Er.BlockStart,new Uint8Array([255&e>>8,255&e,192,222]))}function T(e){switch(e){case 4:return":0400000BFFFFFFFFF5";case 12:return":0C00000BFFFFFFFFFFFFFFFFFFFFFFFFF5";default:var t=new Uint8Array(e).fill(255);return s(0,Er.BlockEnd,t);}}function S(e){var t=new Uint8Array(e).fill(255);return s(0,Er.PaddedData,t)}function A(e,t){var n=h(e),o=new Uint8Array(n.data.length+4);o[0]=n.data.length,o[1]=n.address>>8,o[2]=255&n.address,o[3]=t,o.set(n.data,4);var l=a(o),i=r(d(o));return":"+l+i}function x(e){var t=u(e);if(2!==t.length||15&t[0]||0!==t[1])throw new Error("Invalid Extended Segment Address record "+e);var n=t[0]<<12;return E(n)}function I(e){var t=e.replace(/\r/g,"").split("\n");return t.filter(Boolean)}function m(e){for(var t=16,n=0,r=0,a=e;r<a.length;r++){var o=a[r],l=(o.length-mr)/2;if(l>t?(t=l,n=0):l===t&&n++,12<n)break}if(t>32)throw new Error("Intel Hex record data size is too large: "+t);return t}function O(e,t){var n=!Pr.includes(t),r=y(t),a=E(0),o=a.length,l=r.length,i=T(0).length,d=S(0).length,s=I(e),c=m(s);if(!s.length)return"";if(R(s))throw new Error("Board ID "+t+" Hex is already a Universal Hex.");for(var u=0,h=[];u<s.length;){var f=0,O=g(s[u]);O===Er.ExtendedLinearAddress?(a=s[u],u++):O===Er.ExtendedSegmentAddress&&(a=x(s[u]),u++),h.push(a),f+=o+1,h.push(r),f+=l+1,f+=i+1;for(var P=!1;s[u]&&512>=f+s[u].length+1;){var F=s[u++],L=g(F);if(n&&L===Er.Data)F=A(F,Er.CustomData);else if(L===Er.ExtendedLinearAddress)a=F;else if(L===Er.ExtendedSegmentAddress)F=x(F),a=F;else if(L===Er.EndOfFile){P=!0;break}h.push(F),f+=F.length+1}if(P){if(u!==s.length)if(b(s))throw new Error("Board ID "+t+" Hex is from MakeCode, import this hex into the MakeCode editor to create a Universal Hex.");else throw new Error("EoF record found at record "+u+" of "+s.length+" in Board ID "+t+" hex");h.push(T(0)),h.push(p())}else{for(;512-f>2*c;){var F=S(B((512-f-(d+1))/2,c));h.push(F),f+=F.length+1}h.push(T((512-f)/2))}}return h.push(""),h.join("\n")}function P(e,t){var n=[],r=0,a=0,o=function(e){r+=e.length+1},l=function(e){n.push(e),o(e)},i=I(e);if(!i.length)return"";if(R(i))throw new Error("Board ID "+t+" Hex is already a Universal Hex.");var d=g(i[0]);d===Er.ExtendedLinearAddress?(l(i[0]),a++):d===Er.ExtendedSegmentAddress?(l(x(i[0])),a++):l(E(0)),l(y(t));for(var s=!Pr.includes(t),c=!1;a<i.length;){var u=i[a++],h=g(u);if(h===Er.Data)l(s?A(u,Er.CustomData):u);else if(h===Er.ExtendedSegmentAddress)l(x(u));else if(h===Er.ExtendedLinearAddress)l(u);else if(h===Er.EndOfFile){c=!0;break}}if(a!==i.length)if(b(i))throw new Error("Board ID "+t+" Hex is from MakeCode, import this hex into the MakeCode editor to create a Universal Hex.");else throw new Error("EoF record found at record "+a+" of "+i.length+" in Board ID "+t+" hex ");o(T(0));for(var f=S(0).length+1,O=m(i),P=(512-r%512)%512;P>2*O;){var F=P-f>>1,u=S(B(F,O));l(u),P=(512-r%512)%512}return n.push(T(P>>1)),c&&n.push(p()),n.push(""),n.join("\n")}function F(e,t){if(void 0===t&&(t=!1),!e.length)return"";for(var n,r=t?O:P,a=p()+"\n",o=[],l=0;l<e.length-1;l++)n=r(e[l].hex,e[l].boardId),n.endsWith(a)&&(n=n.slice(0,n.length-a.length)),o.push(n);var d=r(e[e.length-1].hex,e[e.length-1].boardId);return o.push(d),d.endsWith(a)||o.push(a),o.join("")}function L(e){if(e.slice(0,":02000004".length)!==":02000004")return!1;for(var t=9;":"!==e[++t]&&t<Or+3;);return!(":0400000A"!==e.slice(t,t+9))}function R(e){return g(e[0])===Er.ExtendedLinearAddress&&g(e[1])===Er.BlockStart&&g(e[e.length-1])===Er.EndOfFile}function b(e){var t=e.indexOf(p());if(t===e.length-1)for(;0<--t;)if(e[t]===E(536870912))return!0;for(;++t<e.length;){if(g(e[t])===Er.OtherData)return!0;if(e[t]===E(536870912))return!0}return!1}function _(e){var t=I(e);if(!t.length)throw new Error("Empty Universal Hex.");if(!R(t))throw new Error("Universal Hex format invalid.");for(var n=[Er.Data,Er.EndOfFile,Er.ExtendedSegmentAddress,Er.StartSegmentAddress],r={},a=0,o=0;o<t.length;o++){var l=t[o],d=g(l);if(n.includes(d))r[a].hex.push(l);else if(d===Er.CustomData)r[a].hex.push(A(l,Er.Data));else if(d===Er.ExtendedLinearAddress){var s=t[o+1];if(g(s)===Er.BlockStart){var c=u(s);if(4!==c.length)throw new Error("Block Start record invalid: "+s);a=(c[0]<<8)+c[1],r[a]=r[a]||{boardId:a,lastExtAdd:l,hex:[l]},o++}r[a].lastExtAdd!==l&&(r[a].lastExtAdd=l,r[a].hex.push(l))}}var h=[];return Object.keys(r).forEach(function(e){var t=r[e].hex;t[t.length-1]!==p()&&(t[t.length]=p()),h.push({boardId:r[e].boardId,hex:t.join("\n")+"\n"})}),h}var D=t(function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)}),H=t(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),Y=t(function(e){var t=H["__core-js_shared__"]||(H["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=n===void 0?{}:n)})("versions",[]).push({version:D.version,mode:"global",copyright:"\xA9 2020 Denis Pushkarev (zloirock.ru)"})}),M=0,U=Math.random(),$=function(e){return"Symbol(".concat(e===void 0?"":e,")_",(++M+U).toString(36))},G=t(function(e){var t=Y("wks"),n=H.Symbol,r="function"==typeof n,a=e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:$)("Symbol."+e))};a.store=t}),V=function(e){return"object"==typeof e?null!==e:"function"==typeof e},W=function(e){if(!V(e))throw TypeError(e+" is not an object!");return e},w=function(e){try{return!!e()}catch(t){return!0}},K=!w(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),X=H.document,z=V(X)&&V(X.createElement),q=function(e){return z?X.createElement(e):{}},J=!K&&!w(function(){return 7!=Object.defineProperty(q("div"),"a",{get:function(){return 7}}).a}),Q=function(e,t){if(!V(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!V(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!V(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!V(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Z=Object.defineProperty,ee=K?Object.defineProperty:function(e,t,n){if(W(e),t=Q(t,!0),W(n),J)try{return Z(e,t,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e},f={f:ee},te=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ne=K?function(e,t,n){return f.f(e,t,te(1,n))}:function(e,t,n){return e[t]=n,e},re=G("unscopables"),ae=Array.prototype;ae[re]==null&&ne(ae,re,{});var oe=function(e){ae[re][e]=!0},le=function(e,t){return{value:t,done:!!e}},ie={},de={}.toString,se=function(e){return de.call(e).slice(8,-1)},ce=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==se(e)?e.split(""):Object(e)},ge=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e},ue=function(e){return ce(ge(e))},he={}.hasOwnProperty,pe=function(e,t){return he.call(e,t)},fe=Y("native-function-to-string",Function.toString),Ee=t(function(e){var t=$("src"),n="toString",r=(""+fe).split(n);D.inspectSource=function(e){return fe.call(e)},(e.exports=function(e,n,a,o){var l="function"==typeof a;l&&(pe(a,"name")||ne(a,"name",n));e[n]===a||(l&&(pe(a,t)||ne(a,t,e[n]?""+e[n]:r.join(n+""))),e===H?e[n]=a:o?e[n]?e[n]=a:ne(e,n,a):(delete e[n],ne(e,n,a)))})(Function.prototype,n,function(){return"function"==typeof this&&this[t]||fe.call(this)})}),ye=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},Te=function(e,t,n){return(ye(e),void 0===t)?e:1===n?function(n){return e.call(t,n)}:2===n?function(n,r){return e.call(t,n,r)}:3===n?function(n,r,a){return e.call(t,n,r,a)}:function(){return e.apply(t,arguments)}},Se="prototype",Ae=function(e,t,n){var r,a,o,l,i=e&Ae.F,d=e&Ae.G,s=e&Ae.S,c=e&Ae.P,g=e&Ae.B,u=d?H:s?H[t]||(H[t]={}):(H[t]||{})[Se],h=d?D:D[t]||(D[t]={}),p=h[Se]||(h[Se]={});for(r in d&&(n=t),n)a=!i&&u&&void 0!==u[r],o=(a?u:n)[r],l=g&&a?Te(o,H):c&&"function"==typeof o?Te(Function.call,o):o,u&&Ee(u,r,o,e&Ae.U),h[r]!=o&&ne(h,r,l),c&&p[r]!=o&&(p[r]=o)};H.core=D,Ae.F=1,Ae.G=2,Ae.S=4,Ae.P=8,Ae.B=16,Ae.W=32,Ae.U=64,Ae.R=128;var xe=Ae,Ie=function(e){return isNaN(e=+e)?0:(0<e?v:C)(e)},me=function(e){return 0<e?B(Ie(e),9007199254740991):0},Oe=function(e,t){return e=Ie(e),0>e?k(e+t,0):B(e,t)},Pe=function(e){return function(t,n,r){var a,o=ue(t),l=me(o.length),i=Oe(r,l);if(e&&n!=n){for(;l>i;)if(a=o[i++],a!=a)return!0;}else for(;l>i;i++)if((e||i in o)&&o[i]===n)return e||i||0;return!e&&-1}},Fe=Y("keys"),Le=function(e){return Fe[e]||(Fe[e]=$(e))},Re=Pe(!1),be=Le("IE_PROTO"),_e=function(e,t){var n,r=ue(e),a=0,o=[];for(n in r)n!=be&&pe(r,n)&&o.push(n);for(;t.length>a;)pe(r,n=t[a++])&&(~Re(o,n)||o.push(n));return o},Ne=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ke=Object.keys||function(e){return _e(e,Ne)},ve=K?Object.defineProperties:function(e,t){W(e);for(var n,r=ke(t),a=r.length,o=0;a>o;)f.f(e,n=r[o++],t[n]);return e},Ce=H.document,Be=Ce&&Ce.documentElement,De=Le("IE_PROTO"),He=function(){},Ye="prototype",Me=function(){var e,t=q("iframe"),n=Ne.length,r="<",a=">";for(t.style.display="none",Be.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(r+"script"+a+"document.F=Object"+r+"/script"+a),e.close(),Me=e.F;n--;)delete Me[Ye][Ne[n]];return Me()},Ue=Object.create||function(e,t){var n;return null===e?n=Me():(He[Ye]=W(e),n=new He,He[Ye]=null,n[De]=e),void 0===t?n:ve(n,t)},$e=f.f,Ge=G("toStringTag"),Ve=function(e,t,n){e&&!pe(e=n?e:e.prototype,Ge)&&$e(e,Ge,{configurable:!0,value:t})},je={};ne(je,G("iterator"),function(){return this});var We=function(e,t,n){e.prototype=Ue(je,{next:te(1,n)}),Ve(e,t+" Iterator")},we=function(e){return Object(ge(e))},Ke=Le("IE_PROTO"),Xe=Object.prototype,ze=Object.getPrototypeOf||function(e){return e=we(e),pe(e,Ke)?e[Ke]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Xe:null},qe=G("iterator"),Je=!([].keys&&"next"in[].keys()),Qe="keys",Ze="values",et=function(){return this},tt=function(e,t,n,r,a,o,l){We(n,t,r);var i,d,s,c=function(e){return!Je&&e in p?p[e]:e===Qe?function(){return new n(this,e)}:e===Ze?function(){return new n(this,e)}:function(){return new n(this,e)}},g=t+" Iterator",u=a==Ze,h=!1,p=e.prototype,f=p[qe]||p["@@iterator"]||a&&p[a],E=f||c(a),y=a?u?c("entries"):E:void 0,T="Array"==t?p.entries||f:f;if(T&&(s=ze(T.call(new e)),s!==Object.prototype&&s.next&&(Ve(s,g,!0),"function"!=typeof s[qe]&&ne(s,qe,et))),u&&f&&f.name!==Ze&&(h=!0,E=function(){return f.call(this)}),(Je||h||!p[qe])&&ne(p,qe,E),ie[t]=E,ie[g]=et,a)if(i={values:u?E:c(Ze),keys:o?E:c(Qe),entries:y},l)for(d in i)d in p||Ee(p,d,i[d]);else xe(xe.P+xe.F*(Je||h),t,i);return i},nt=tt(Array,"Array",function(e,t){this._t=ue(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,le(1)):"keys"==t?le(0,n):"values"==t?le(0,e[n]):le(0,[n,e[n]])},"values");ie.Arguments=ie.Array,oe("keys"),oe("values"),oe("entries");for(var rt=G("iterator"),ot=G("toStringTag"),lt=ie.Array,it={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},dt=ke(it),st=0;st<dt.length;st++){var ct,gt=dt[st],ut=it[gt],ht=H[gt],pt=ht&&ht.prototype;if(pt&&(pt[rt]||ne(pt,rt,lt),pt[ot]||ne(pt,ot,gt),ie[gt]=lt,ut))for(ct in nt)pt[ct]||Ee(pt,ct,nt[ct],!0)}var ft=G("toStringTag"),Et="Arguments"==se(function(){return arguments}()),yt=function(e,t){try{return e[t]}catch(t){}},Tt=function(e){var t,n,r;return e===void 0?"Undefined":null===e?"Null":"string"==typeof(n=yt(t=Object(e),ft))?n:Et?se(t):"Object"==(r=se(t))&&"function"==typeof t.callee?"Arguments":r},St={};St[G("toStringTag")]="z","[object z]"!=St+""&&Ee(Object.prototype,"toString",function(){return"[object "+Tt(this)+"]"},!0);(function(e,t){var n=(D.Object||{})[e]||Object[e],r={};r[e]=t(n),xe(xe.S+xe.F*w(function(){n(1)}),"Object",r)})("keys",function(){return function(e){return ke(we(e))}});var At=G("match"),xt=function(e){var t;return V(e)&&((t=e[At])===void 0?"RegExp"==se(e):!!t)},It=function(e,t,n){if(xt(t))throw TypeError("String#"+n+" doesn't accept regex!");return ge(e)+""},mt=G("match"),Ot=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[mt]=!1,!"/./"[e](t)}catch(e){}}return!0},Pt="includes";xe(xe.P+xe.F*Ot(Pt),"String",{includes:function(e){return!!~It(this,e,Pt).indexOf(e,1<arguments.length?arguments[1]:void 0)}});var Ft="".endsWith;xe(xe.P+xe.F*Ot("endsWith"),"String",{endsWith:function(e){var t=It(this,e,"endsWith"),n=1<arguments.length?arguments[1]:void 0,r=me(t.length),a=n===void 0?r:B(me(n),r),o=e+"";return Ft.call(t,o,a)}});var Lt=Pe(!0);xe(xe.P,"Array",{includes:function(e){return Lt(this,e,1<arguments.length?arguments[1]:void 0)}}),oe("includes");var Rt=function(e){return function(t,n){var r,o,d=ge(t)+"",s=Ie(n),i=d.length;return 0>s||s>=i?e?"":void 0:(r=d.charCodeAt(s),55296>r||56319<r||s+1===i||56320>(o=d.charCodeAt(s+1))||57343<o?e?d.charAt(s):r:e?d.slice(s,s+2):(r-55296<<10)+(o-56320)+65536)}}(!0),at=function(e,t,n){return t+(n?Rt(e,t).length:1)},bt=RegExp.prototype.exec,_t=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Tt(e))throw new TypeError("RegExp#exec called on incompatible receiver");return bt.call(e,t)},Nt=function(){var e=W(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},kt=RegExp.prototype.exec,vt=N.replace,Ct=kt,Bt="lastIndex",Dt=function(){var e=/a/,t=/b*/g;return kt.call(e,"a"),kt.call(t,"a"),0!==e[Bt]||0!==t[Bt]}(),Ht=/()??/.exec("")[1]!==void 0;(Dt||Ht)&&(Ct=function(e){var t,n,r,a,o=this;return Ht&&(n=new RegExp("^"+o.source+"$(?!\\s)",Nt.call(o))),Dt&&(t=o[Bt]),r=kt.call(o,e),Dt&&r&&(o[Bt]=o.global?r.index+r[0].length:t),Ht&&r&&1<r.length&&vt.call(r[0],n,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)}),r});var Yt=Ct;xe({target:"RegExp",proto:!0,forced:Yt!==/./.exec},{exec:Yt});var Mt=G("species"),Ut=!w(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),$t=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),Gt=function(e,t,n){var r=G(e),a=!w(function(){var t={};return t[r]=function(){return 7},7!=""[e](t)}),o=a?!w(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[Mt]=function(){return n}),n[r](""),!t}):void 0;if(!a||!o||"replace"===e&&!Ut||"split"===e&&!$t){var l=/./[r],i=n(ge,r,""[e],function(e,t,n,r,o){return t.exec===Yt?a&&!o?{done:!0,value:l.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),d=i[0],s=i[1];Ee(String.prototype,e,d),ne(RegExp.prototype,r,2==t?function(e,t){return s.call(e,this,t)}:function(e){return s.call(e,this)})}},Vt=function(e){return e===void 0?e:e+""};Gt("replace",2,function(e,t,n,r){function a(e,t,r,a,o,l){var i=r+e.length,d=a.length,s=/\$([$&`']|\d\d?)/g;return void 0!==o&&(o=we(o),s=/\$([$&`']|\d\d?|<[^>]*>)/g),n.call(l,s,function(l,s){var c;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(i);case"<":c=o[s.slice(1,-1)];break;default:var g=+s;if(0==g)return l;if(g>d){var n=v(g/10);return 0===n?l:n<=d?void 0===a[n-1]?s.charAt(1):a[n-1]+s.charAt(1):l}c=a[g-1];}return void 0===c?"":c})}return[function(r,a){var o=e(this),l=r==null?void 0:r[t];return l===void 0?n.call(o+"",r,a):l.call(r,o,a)},function(e,t){var o=r(n,e,this,t);if(o.done)return o.value;var l=W(e),d=this+"",s="function"==typeof t;s||(t=t+"");var c=l.global;if(c){var g=l.unicode;l.lastIndex=0}for(var u,h=[];(u=_t(l,d),null!==u)&&!(h.push(u),!c);){var p=u[0]+"";""==p&&(l.lastIndex=at(d,me(l.lastIndex),g))}for(var f="",E=0,y=0;y<h.length;y++){u=h[y];for(var T=u[0]+"",S=k(B(Ie(u.index),d.length),0),A=[],x=1;x<u.length;x++)A.push(Vt(u[x]));var I=u.groups;if(s){var m=[T].concat(A,S,d);I!==void 0&&m.push(I);var O=t.apply(void 0,m)+""}else O=a(T,d,S,A,I,t);S>=E&&(f+=d.slice(E,S)+O,E=S+T.length)}return f+d.slice(E)}]});var jt=G("species"),Wt=function(e,t){var n,r=W(e).constructor;return r===void 0||(n=W(r)[jt])==null?t:ye(n)},wt=[].push,Kt="split",Xt="length",zt="lastIndex",qt=4294967295,Jt=!w(function(){RegExp(qt,"y")});Gt("split",2,function(e,t,n,r){var a;return a="c"=="abbc"[Kt](/(b)*/)[1]||4!="test"[Kt](/(?:)/,-1)[Xt]||2!="ab"[Kt](/(?:ab)*/)[Xt]||4!="."[Kt](/(.?)(.?)/)[Xt]||1<"."[Kt](/()()/)[Xt]||""[Kt](/.?/)[Xt]?function(e,t){var r=this+"";if(void 0===e&&0===t)return[];if(!xt(e))return n.call(r,e,t);for(var a,o,l,i=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),s=0,c=void 0===t?qt:t>>>0,g=new RegExp(e.source,d+"g");(a=Yt.call(g,r))&&(o=g[zt],!(o>s&&(i.push(r.slice(s,a.index)),1<a[Xt]&&a.index<r[Xt]&&wt.apply(i,a.slice(1)),l=a[0][Xt],s=o,i[Xt]>=c)));)g[zt]===a.index&&g[zt]++;return s===r[Xt]?(l||!g.test(""))&&i.push(""):i.push(r.slice(s)),i[Xt]>c?i.slice(0,c):i}:"0"[Kt](void 0,0)[Xt]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),l=null==n?void 0:n[t];return void 0===l?a.call(o+"",n,r):l.call(n,o,r)},function(t,o){var l=r(a,t,this,o,a!==n);if(l.done)return l.value;var d=W(t),s=this+"",c=Wt(d,RegExp),g=d.unicode,u=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(Jt?"y":"g"),h=new c(Jt?d:"^(?:"+d.source+")",u),f=void 0===o?qt:o>>>0;if(0===f)return[];if(0===s.length)return null===_t(h,s)?[s]:[];for(var E=0,y=0,T=[];y<s.length;){h.lastIndex=Jt?y:0;var S,A=_t(h,Jt?s:s.slice(y));if(null===A||(S=B(me(h.lastIndex+(Jt?0:y)),s.length))===E)y=at(s,y,g);else{if(T.push(s.slice(E,y)),T.length===f)return T;for(var x=1;x<=A.length-1;x++)if(T.push(A[x]),T.length===f)return T;y=E=S}}return T.push(s.slice(E)),T}]});var Qt=function(e){for(var t=we(this),n=me(t.length),r=arguments.length,a=Oe(1<r?arguments[1]:void 0,n),o=2<r?arguments[2]:void 0,l=void 0===o?n:Oe(o,n);l>a;)t[a++]=e;return t};xe(xe.P,"Array",{fill:Qt}),oe("fill");for(var Zt,en=$("typed_array"),tn=$("view"),nn=!!(H.ArrayBuffer&&H.DataView),rn=nn,an=0,on=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"];an<9;)(Zt=H[on[an++]])?(ne(Zt.prototype,en,!0),ne(Zt.prototype,tn,!0)):rn=!1;var ln={ABV:nn,CONSTR:rn,TYPED:en,VIEW:tn},dn=function(e,t,n){for(var r in t)Ee(e,r,t[r],n);return e},sn=function(e,t,n,r){if(!(e instanceof t)||r!==void 0&&r in e)throw TypeError(n+": incorrect invocation!");return e},cn=function(e){if(e===void 0)return 0;var t=Ie(e),n=me(t);if(t!==n)throw RangeError("Wrong length!");return n},gn=Ne.concat("length","prototype"),un=Object.getOwnPropertyNames||function(e){return _e(e,gn)},hn={f:un},pn=t(function(e,t){function n(t,n,r){var a,o,l,d=Array(r),g=8*r-n-1,u=(1<<g)-1,h=u>>1,p=23===n?L(2,-24)-L(2,-77):0,f=0,E=0>t||0===t&&0>1/t?1:0;for(t=F(t),t!=t||t===O?(o=t==t?0:1,a=u):(a=R(b(t)/_),1>t*(l=L(2,-a))&&(a--,l*=2),t+=1<=a+h?p/l:p*L(2,1-h),2<=t*l&&(a++,l/=2),a+h>=u?(o=0,a=u):1<=a+h?(o=(t*l-1)*L(2,n),a+=h):(o=t*L(2,h-1)*L(2,n),a=0));8<=n;d[f++]=255&o,o/=256,n-=8);for(a=a<<n|o,g+=n;0<g;d[f++]=255&a,a/=256,g-=8);return d[--f]|=128*E,d}function r(t,n,r){var a,o=8*r-n-1,l=(1<<o)-1,d=l>>1,c=o-7,g=r-1,u=t[g--],h=127&u;for(u>>=7;0<c;h=256*h+t[g],g--,c-=8);for(a=h&(1<<-c)-1,h>>=-c,c+=n;0<c;a=256*a+t[g],g--,c-=8);if(0===h)h=1-d;else{if(h===l)return a?NaN:u?-O:O;a+=L(2,n),h-=d}return(u?-1:1)*a*L(2,h-n)}function a(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function o(e){return[255&e]}function l(e){return[255&e,255&e>>8]}function i(e){return[255&e,255&e>>8,255&e>>16,255&e>>24]}function d(e){return n(e,52,8)}function s(e){return n(e,23,4)}function c(e,t,n){p(e.prototype,t,{get:function(){return this[n]}})}function g(e,t,n,r){var a=cn(+n);if(a+t>e[D])throw I("Wrong index!");var o=e[B]._b,l=a+e[Y],i=o.slice(l,l+t);return r?i:i.reverse()}function u(e,t,n,r,a,o){var l=cn(+n);if(l+t>e[D])throw I("Wrong index!");for(var d=e[B]._b,s=l+e[Y],c=r(+a),g=0;g<t;g++)d[s+g]=c[o?g:t-g-1]}var h=hn.f,p=f.f,E="ArrayBuffer",y="DataView",T="prototype",S=H[E],A=H[y],x=H.Math,I=H.RangeError,O=H.Infinity,P=S,F=x.abs,L=x.pow,R=v,b=x.log,_=x.LN2,N="buffer",k="byteLength",C="byteOffset",B=K?"_b":N,D=K?"_l":k,Y=K?"_o":C;if(!ln.ABV)S=function(e){sn(this,S,E);var t=cn(e);this._b=Qt.call(Array(t),0),this[D]=t},A=function(e,t,n){sn(this,A,y),sn(e,S,y);var r=e[D],a=Ie(t);if(0>a||a>r)throw I("Wrong offset!");if(n=void 0===n?r-a:me(n),a+n>r)throw I("Wrong length!");this[B]=e,this[Y]=a,this[D]=n},K&&(c(S,k,"_l"),c(A,N,"_b"),c(A,k,"_l"),c(A,C,"_o")),dn(A[T],{getInt8:function(e){return g(this,1,e)[0]<<24>>24},getUint8:function(e){return g(this,1,e)[0]},getInt16:function(e){var t=g(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=g(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return a(g(this,4,e,arguments[1]))},getUint32:function(e){return a(g(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return r(g(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return r(g(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){u(this,1,e,o,t)},setUint8:function(e,t){u(this,1,e,o,t)},setInt16:function(e,t){u(this,2,e,l,t,arguments[2])},setUint16:function(e,t){u(this,2,e,l,t,arguments[2])},setInt32:function(e,t){u(this,4,e,i,t,arguments[2])},setUint32:function(e,t){u(this,4,e,i,t,arguments[2])},setFloat32:function(e,t){u(this,4,e,s,t,arguments[2])},setFloat64:function(e,t){u(this,8,e,d,t,arguments[2])}});else{if(!w(function(){S(1)})||!w(function(){new S(-1)})||w(function(){return new S,new S(1.5),new S(NaN),S.name!=E})){S=function(e){return sn(this,S),new P(cn(e))};for(var M,U=S[T]=P[T],$=h(P),G=0;$.length>G;)(M=$[G++])in S||ne(S,M,P[M]);U.constructor=S}var m=new A(new S(2)),V=A[T].setInt8;m.setInt8(0,2147483648),m.setInt8(1,2147483649),(m.getInt8(0)||!m.getInt8(1))&&dn(A[T],{setInt8:function(e,t){V.call(this,e,t<<24>>24)},setUint8:function(e,t){V.call(this,e,t<<24>>24)}},!0)}Ve(S,E),Ve(A,y),ne(A[T],ln.VIEW,!0),t[E]=S,t[y]=A}),fn=G("iterator"),En=Array.prototype,yn=function(e){return e!==void 0&&(ie.Array===e||En[fn]===e)},Tn=G("iterator"),Sn=D.getIteratorMethod=function(e){if(e!=null)return e[Tn]||e["@@iterator"]||ie[Tt(e)]},An=Array.isArray||function(e){return"Array"==se(e)},xn=G("species"),In=function(e){var t;return An(e)&&(t=e.constructor,"function"==typeof t&&(t===Array||An(t.prototype))&&(t=void 0),V(t)&&(t=t[xn],null===t&&(t=void 0))),void 0===t?Array:t},mn=function(e,t){return new(In(e))(t)},On=function(e,t){var n=1==e,r=4==e,a=6==e,o=t||mn;return function(t,l,i){for(var d,s,c=we(t),g=ce(c),u=Te(l,i,3),h=me(g.length),p=0,f=n?o(t,h):2==e?o(t,0):void 0;h>p;p++)if((5==e||a||p in g)&&(d=g[p],s=u(d,p,c),e))if(n)f[p]=s;else if(s)switch(e){case 3:return!0;case 5:return d;case 6:return p;case 2:f.push(d);}else if(r)return!1;return a?-1:3==e||r?r:f}},Pn=G("iterator"),Fn=!1;try{var Ln=[7][Pn]();Ln["return"]=function(){Fn=!0},Array.from(Ln,function(){throw 2})}catch(t){}var Rn=function(e,t){if(!t&&!Fn)return!1;var n=!1;try{var r=[7],a=r[Pn]();a.next=function(){return{done:n=!0}},r[Pn]=function(){return a},e(r)}catch(t){}return n},bn=G("species"),_n=function(e){var t=H[e];K&&t&&!t[bn]&&f.f(t,bn,{configurable:!0,get:function(){return this}})},Nn=[].copyWithin||function(e,t){var n=we(this),r=me(n.length),a=Oe(e,r),o=Oe(t,r),l=2<arguments.length?arguments[2]:void 0,i=B((l===void 0?r:Oe(l,r))-o,r-a),d=1;for(o<a&&a<o+i&&(d=-1,o+=i-1,a+=i-1);0<i--;)o in n?n[a]=n[o]:delete n[a],a+=d,o+=d;return n},kn={}.propertyIsEnumerable,vn={f:kn},Cn=Object.getOwnPropertyDescriptor,Bn=K?Cn:function(e,t){if(e=ue(e),t=Q(t,!0),J)try{return Cn(e,t)}catch(t){}return pe(e,t)?te(!vn.f.call(e,t),e[t]):void 0},Dn={f:Bn},Hn=t(function(e){if(K){var t=!1,n=H,r=w,a=xe,o=ln,l=pn,i=sn,d=ne,s=dn,c=me,g=cn,u=Oe,h=Q,p=pe,E=Tt,y=V,T=we,S=hn.f,A=$,x=G,I=On,m=Pe,P=Wt,F=nt,L=f,R=Dn,b=L.f,O=R.f,_=n.RangeError,N=n.TypeError,k=n.Uint8Array,C="ArrayBuffer",B="Shared"+C,D="BYTES_PER_ELEMENT",Y="prototype",M=Array[Y],U=l.ArrayBuffer,j=l.DataView,W=I(0),X=I(2),z=I(3),q=I(4),J=I(5),Z=I(6),ee=m(!0),re=m(!1),ae=F.values,oe=F.keys,le=F.entries,de=M.lastIndexOf,se=M.reduce,ce=M.reduceRight,ge=M.join,ue=M.sort,he=M.slice,fe=M.toString,Ee=M.toLocaleString,ye=x("iterator"),Se=x("toStringTag"),Ae=A("typed_constructor"),Fe=A("def_constructor"),Le=o.CONSTR,Re=o.TYPED,be=o.VIEW,_e="Wrong length!",Ne=I(1,function(e,t){return De(P(e,e[Fe]),t)}),ke=r(function(){return 1===new k(new Uint16Array([1]).buffer)[0]}),ve=!!k&&!!k[Y].set&&r(function(){new k(1).set({})}),Ce=function(e,t){var n=Ie(e);if(0>n||n%t)throw _("Wrong offset!");return n},Be=function(e){if(y(e)&&Re in e)return e;throw N(e+" is not a typed array!")},De=function(e,t){if(!(y(e)&&Ae in e))throw N("It is not a typed array constructor!");return new e(t)},He=function(e,t){return Ye(P(e,e[Fe]),t)},Ye=function(e,t){for(var n=0,r=t.length,a=De(e,r);r>n;)a[n]=t[n++];return a},Me=function(e,t,n){b(e,t,{get:function(){return this._d[n]}})},$e=function(e){var t,n,r,a,o,l,d=T(e),s=arguments.length,g=1<s?arguments[1]:void 0,u=g!==void 0,h=Sn(d);if(h!=null&&!yn(h)){for(l=h.call(d),r=[],t=0;!(o=l.next()).done;t++)r.push(o.value);d=r}for(u&&2<s&&(g=Te(g,arguments[2],2)),t=0,n=c(d.length),a=De(this,n);n>t;t++)a[t]=u?g(d[t],t):d[t];return a},Ge=function(){for(var e=0,t=arguments.length,n=De(this,t);t>e;)n[e]=arguments[e++];return n},Ve=!!k&&r(function(){Ee.call(new k(1))}),je=function(){return Ee.apply(Ve?he.call(Be(this)):Be(this),arguments)},We={copyWithin:function(e,t){return Nn.call(Be(this),e,t,2<arguments.length?arguments[2]:void 0)},every:function(e){return q(Be(this),e,1<arguments.length?arguments[1]:void 0)},fill:function(){return Qt.apply(Be(this),arguments)},filter:function(e){return He(this,X(Be(this),e,1<arguments.length?arguments[1]:void 0))},find:function(e){return J(Be(this),e,1<arguments.length?arguments[1]:void 0)},findIndex:function(e){return Z(Be(this),e,1<arguments.length?arguments[1]:void 0)},forEach:function(e){W(Be(this),e,1<arguments.length?arguments[1]:void 0)},indexOf:function(e){return re(Be(this),e,1<arguments.length?arguments[1]:void 0)},includes:function(e){return ee(Be(this),e,1<arguments.length?arguments[1]:void 0)},join:function(){return ge.apply(Be(this),arguments)},lastIndexOf:function(){return de.apply(Be(this),arguments)},map:function(e){return Ne(Be(this),e,1<arguments.length?arguments[1]:void 0)},reduce:function(){return se.apply(Be(this),arguments)},reduceRight:function(){return ce.apply(Be(this),arguments)},reverse:function(){for(var e,t=this,n=Be(t).length,r=v(n/2),a=0;a<r;)e=t[a],t[a++]=t[--n],t[n]=e;return t},some:function(e){return z(Be(this),e,1<arguments.length?arguments[1]:void 0)},sort:function(e){return ue.call(Be(this),e)},subarray:function(e,t){var n=Be(this),r=n.length,a=u(e,r);return new(P(n,n[Fe]))(n.buffer,n.byteOffset+a*n.BYTES_PER_ELEMENT,c((t===void 0?r:u(t,r))-a))}},Ke=function(e,t){return He(this,he.call(Be(this),e,t))},Xe=function(e){Be(this);var t=Ce(arguments[1],1),n=this.length,r=T(e),a=c(r.length),o=0;if(a+t>n)throw _(_e);for(;o<a;)this[t+o]=r[o++]},qe={entries:function(){return le.call(Be(this))},keys:function(){return oe.call(Be(this))},values:function(){return ae.call(Be(this))}},Je=function(e,t){return y(e)&&e[Re]&&"symbol"!=typeof t&&t in e&&+t+""==t+""},Qe=function(e,t){return Je(e,t=h(t,!0))?te(2,e[t]):O(e,t)},Ze=function(e,t,n){return Je(e,t=h(t,!0))&&y(n)&&p(n,"value")&&!p(n,"get")&&!p(n,"set")&&!n.configurable&&(!p(n,"writable")||n.writable)&&(!p(n,"enumerable")||n.enumerable)?(e[t]=n.value,e):b(e,t,n)};Le||(R.f=Qe,L.f=Ze),a(a.S+a.F*!Le,"Object",{getOwnPropertyDescriptor:Qe,defineProperty:Ze}),r(function(){fe.call({})})&&(fe=Ee=function(){return ge.call(this)});var et=s({},We);s(et,qe),d(et,ye,qe.values),s(et,{slice:Ke,set:Xe,constructor:function(){},toString:fe,toLocaleString:je}),Me(et,"buffer","b"),Me(et,"byteOffset","o"),Me(et,"byteLength","l"),Me(et,"length","e"),b(et,Se,{get:function(){return this[Re]}}),e.exports=function(e,l,s,u){u=!!u;var h=e+(u?"Clamped":"")+"Array",p=n[h],f=p||{},T=p&&ze(p),A=!p||!o.ABV,x={},I=p&&p[Y],m=function(t,n){var r=t._d;return r.v["get"+e](n*l+r.o,ke)},O=function(t,n,r){var a=t._d;u&&(r=0>(r=Math.round(r))?0:255<r?255:255&r),a.v["set"+e](n*l+a.o,r,ke)},P=function(e,t){b(e,t,{get:function(){return m(this,t)},set:function(e){return O(this,t,e)},enumerable:!0})};A?(p=s(function(e,t,n,r){i(e,p,h,"_d");var a,o,s,u,f=0,T=0;if(!y(t))s=g(t),o=s*l,a=new U(o);else if(t instanceof U||(u=E(t))==C||u==B){a=t,T=Ce(n,l);var S=t.byteLength;if(void 0===r){if(S%l)throw _(_e);if(o=S-T,0>o)throw _(_e)}else if(o=c(r)*l,o+T>S)throw _(_e);s=o/l}else return Re in t?Ye(p,t):$e.call(p,t);for(d(e,"_d",{b:a,o:T,l:o,e:s,v:new j(a)});f<s;)P(e,f++)}),I=p[Y]=Ue(et),d(I,"constructor",p)):(!r(function(){p(1)})||!r(function(){new p(-1)})||!Rn(function(e){new p,new p(null),new p(1.5),new p(e)},!0))&&(p=s(function(e,t,n,r){i(e,p,h);var a;return y(t)?t instanceof U||(a=E(t))==C||a==B?void 0===r?void 0===n?new f(t):new f(t,Ce(n,l)):new f(t,Ce(n,l),r):Re in t?Ye(p,t):$e.call(p,t):new f(g(t))}),W(T===Function.prototype?S(f):S(f).concat(S(T)),function(e){e in p||d(p,e,f[e])}),p[Y]=I,!t&&(I.constructor=p));var F=I[ye],L=!!F&&("values"==F.name||F.name==null),R=qe.values;d(p,Ae,!0),d(I,Re,h),d(I,be,!0),d(I,Fe,p),(u?new p(1)[Se]!=h:!(Se in I))&&b(I,Se,{get:function(){return h}}),x[h]=p,a(a.G+a.W+a.F*(p!=f),x),a(a.S,h,{BYTES_PER_ELEMENT:l}),a(a.S+a.F*r(function(){f.of.call(p,1)}),h,{from:$e,of:Ge}),D in I||d(I,D,l),a(a.P,h,We),_n(h),a(a.P+a.F*ve,h,{set:Xe}),a(a.P+a.F*!L,h,qe),t||I.toString==fe||(I.toString=fe),a(a.P+a.F*r(function(){new p(1).slice()}),h,{slice:Ke}),a(a.P+a.F*(r(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!r(function(){I.toLocaleString.call([1,2])})),h,{toLocaleString:je}),ie[h]=L?F:R,t||L||d(I,ye,R)}}else e.exports=function(){}});Hn("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}}),K&&"g"!=/./g.flags&&f.f(RegExp.prototype,"flags",{configurable:!0,get:Nt});var Yn=/./.toString,Mn=function(e){Ee(RegExp.prototype,"toString",e,!0)};w(function(){return"/a/b"!=Yn.call({source:"a",flags:"b"})})?Mn(function(){var e=W(this);return"/".concat(e.source,"/","flags"in e?e.flags:!K&&e instanceof RegExp?Nt.call(e):void 0)}):Yn.name!="toString"&&Mn(function(){return Yn.call(this)});var Un=function(e){var t=ge(this)+"",r="",a=Ie(e);if(0>a||a==1/0)throw RangeError("Count can't be negative");for(;0<a;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r},$n=function(e,t,n,r){var a=ge(e)+"",o=a.length,l=void 0===n?" ":n+"",i=me(t);if(i<=o||""==l)return a;var d=i-o,s=Un.call(l,C(d/l.length));return s.length>d&&(s=s.slice(0,d)),r?s+a:a+s},Gn=H.navigator,Vn=Gn&&Gn.userAgent||"",jn=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(Vn);xe(xe.P+xe.F*jn,"String",{padStart:function(e){return $n(this,e,1<arguments.length?arguments[1]:void 0,!0)}});xe(xe.S,"Number",{isInteger:function(e){return!V(e)&&isFinite(e)&&v(e)===e}});var Wn=function(e,t){if(W(e),!V(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},wn={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=Te(Function.call,Dn.f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(n){t=!0}return function(e,r){return Wn(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:Wn},Kn=wn.set,Xn=function(e,t,n){var r,a=t.constructor;return a!==n&&"function"==typeof a&&(r=a.prototype)!==n.prototype&&V(r)&&Kn&&Kn(e,r),e},zn="\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF",qn="["+zn+"]",Jn="\u200B\x85",Qn=RegExp("^"+qn+qn+"*"),Zn=RegExp(qn+qn+"*$"),er=function(e,t,n){var r={},a=w(function(){return!!zn[e]()||Jn[e]()!=Jn}),o=r[e]=a?t(tr):zn[e];n&&(r[n]=o),xe(xe.P+xe.F*a,"String",r)},tr=er.trim=function(e,t){return e=ge(e)+"",1&t&&(e=e.replace(Qn,"")),2&t&&(e=e.replace(Zn,"")),e},nr=hn.f,rr=Dn.f,ar=f.f,or=er.trim,lr="Number",ir=H[lr],dr=ir,sr=ir.prototype,cr=se(Ue(sr))==lr,gr=("trim"in N),ur=function(e){var t=Q(e,!1);if("string"==typeof t&&2<t.length){t=gr?t.trim():or(t,3);var n,r,a,o=t.charCodeAt(0);if(43===o||45===o){if(n=t.charCodeAt(2),88===n||120===n)return NaN;}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+t;}for(var d,s=t.slice(2),c=0,g=s.length;c<g;c++)if(d=s.charCodeAt(c),48>d||d>a)return NaN;return parseInt(s,r)}}return+t};if(!ir(" 0o1")||!ir("0b1")||ir("+0x1")){ir=function(e){var t=1>arguments.length?0:e,n=this;return n instanceof ir&&(cr?w(function(){sr.valueOf.call(n)}):se(n)!=lr)?Xn(new dr(ur(t)),n,ir):ur(t)};for(var hr,pr=K?nr(dr):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),fr=0;pr.length>fr;fr++)pe(dr,hr=pr[fr])&&!pe(ir,hr)&&ar(ir,hr,rr(dr,hr));ir.prototype=sr,sr.constructor=ir,Ee(H,lr,ir)}xe(xe.S,"Number",{isNaN:function(e){return e!=e}}),Gt("match",1,function(e,t,r,a){return[function(n){var r=e(this),a=n==null?void 0:n[t];return a===void 0?new RegExp(n)[t](r+""):a.call(n,r)},function(e){var t=a(r,e,this);if(t.done)return t.value;var o=W(e),l=this+"";if(!o.global)return _t(o,l);var i=o.unicode;o.lastIndex=0;for(var d,s=[],c=0;null!==(d=_t(o,l));){var g=d[0]+"";s[c]=g,""==g&&(o.lastIndex=at(l,me(o.lastIndex),i)),c++}return 0===c?null:s}]});var Er;(function(e){e[e.Data=0]="Data",e[e.EndOfFile=1]="EndOfFile",e[e.ExtendedSegmentAddress=2]="ExtendedSegmentAddress",e[e.StartSegmentAddress=3]="StartSegmentAddress",e[e.ExtendedLinearAddress=4]="ExtendedLinearAddress",e[e.StartLinearAddress=5]="StartLinearAddress",e[e.BlockStart=10]="BlockStart",e[e.BlockEnd=11]="BlockEnd",e[e.PaddedData=12]="PaddedData",e[e.CustomData=13]="CustomData",e[e.OtherData=14]="OtherData"})(Er||(Er={}));var yr=":".length,Tr=2,Sr=4,Ar=2,xr=0+yr+Tr+Sr+Ar,Ir=0,mr=yr+Tr+Sr+Ar+Ir+2,Or=mr-Ir+64,Pr=[39168,39169];(function(e){e[e.V1=39168]="V1",e[e.V2=39171]="V2"})(e.microbitBoardId||(e.microbitBoardId={})),e.createUniversalHex=F,e.iHexToCustomFormatBlocks=O,e.iHexToCustomFormatSection=P,e.isMakeCodeForV1Hex=function(e){return b(I(e))},e.isUniversalHex=L,e.separateUniversalHex=_,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=microbit-uh.umd.min.js.map