unexpected
Version:
Extensible BDD assertion toolkit
105 lines • 262 kB
JavaScript
/*!
* Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the 'Software'), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.weknowhow=t.weknowhow||{},t.weknowhow.expect=e())}(this,function(){"use strict";var s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=Math.ceil,r=Math.floor,u=function(t){return isNaN(t=+t)?0:(0<t?r:n)(t)},c=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},i=function(a){return function(t,e){var n,r,i=String(c(t)),o=u(e),s=i.length;return o<0||s<=o?a?"":void 0:(n=i.charCodeAt(o))<55296||56319<n||o+1===s||(r=i.charCodeAt(o+1))<56320||57343<r?a?i.charAt(o):n:a?i.slice(o,o+2):r-56320+(n-55296<<10)+65536}},b=!0,y=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),g=e(function(t){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)}),o=g.version,a=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},v=function(r,i,t){if(a(r),void 0===i)return r;switch(t){case 1:return function(t){return r.call(i,t)};case 2:return function(t,e){return r.call(i,t,e)};case 3:return function(t,e,n){return r.call(i,t,e,n)}}return function(){return r.apply(i,arguments)}},f=function(t){return"object"==typeof t?null!==t:"function"==typeof t},l=function(t){if(!f(t))throw TypeError(t+" is not an object!");return t},h=function(t){try{return!!t()}catch(t){return!0}},p=!h(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),d=y.document,m=f(d)&&f(d.createElement),_=function(t){return m?d.createElement(t):{}},w=!p&&!h(function(){return 7!=Object.defineProperty(_("div"),"a",{get:function(){return 7}}).a}),E=function(t,e){if(!f(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!f(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!f(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!f(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},x=Object.defineProperty,A=p?Object.defineProperty:function(t,e,n){if(l(t),e=E(e,!0),l(n),w)try{return x(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},F={f:A},j=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=p?function(t,e,n){return F.f(t,e,j(1,n))}:function(t,e,n){return t[e]=n,t},C={}.hasOwnProperty,S=function(t,e){return C.call(t,e)},T="prototype",O=function(t,e,n){var r,i,o,s=t&O.F,a=t&O.G,u=t&O.S,c=t&O.P,f=t&O.B,l=t&O.W,h=a?g:g[e]||(g[e]={}),p=h[T],d=a?y:u?y[e]:(y[e]||{})[T];for(r in a&&(n=e),n)(i=!s&&d&&void 0!==d[r])&&S(h,r)||(o=i?d[r]:n[r],h[r]=a&&"function"!=typeof d[r]?n[r]:f&&i?v(o,y):l&&d[r]==o?function(r){var t=function(t,e,n){if(this instanceof r){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,e)}return new r(t,e,n)}return r.apply(this,arguments)};return t[T]=r[T],t}(o):c&&"function"==typeof o?v(Function.call,o):o,c&&((h.virtual||(h.virtual={}))[r]=o,t&O.R&&p&&!p[r]&&k(p,r,o)))};O.F=1,O.G=2,O.S=4,O.P=8,O.B=16,O.W=32,O.U=64,O.R=128;var P=O,M=k,D={},R={}.toString,B=function(t){return R.call(t).slice(8,-1)},I=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==B(t)?t.split(""):Object(t)},L=function(t){return I(c(t))},N=Math.min,U=function(t){return 0<t?N(u(t),9007199254740991):0},z=Math.max,q=Math.min,K=function(t,e){return(t=u(t))<0?z(t+e,0):q(t,e)},H=function(a){return function(t,e,n){var r,i=L(t),o=U(i.length),s=K(n,o);if(a&&e!=e){for(;s<o;)if((r=i[s++])!=r)return!0}else for(;s<o;s++)if((a||s in i)&&i[s]===e)return a||s||0;return!a&&-1}},Y=e(function(t){var e="__core-js_shared__",n=y[e]||(y[e]={});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:g.version,mode:b?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),W=0,$=Math.random(),V=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++W+$).toString(36))},J=Y("keys"),Q=function(t){return J[t]||(J[t]=V(t))},G=H(!1),X=Q("IE_PROTO"),Z=function(t,e){var n,r=L(t),i=0,o=[];for(n in r)n!=X&&S(r,n)&&o.push(n);for(;e.length>i;)S(r,n=e[i++])&&(~G(o,n)||o.push(n));return o},tt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),et=Object.keys||function(t){return Z(t,tt)},nt=p?Object.defineProperties:function(t,e){l(t);for(var n,r=et(e),i=r.length,o=0;o<i;)F.f(t,n=r[o++],e[n]);return t},rt=y.document,it=rt&&rt.documentElement,ot=Q("IE_PROTO"),st=function(){},at="prototype",ut=function(){var t,e=_("iframe"),n=tt.length;for(e.style.display="none",it.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ut=t.F;n--;)delete ut[at][tt[n]];return ut()},ct=Object.create||function(t,e){var n;return null!==t?(st[at]=l(t),n=new st,st[at]=null,n[ot]=t):n=ut(),void 0===e?n:nt(n,e)},ft=e(function(t){var e=Y("wks"),n=y.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:V)("Symbol."+t))}).store=e}),lt=F.f,ht=ft("toStringTag"),pt=function(t,e,n){t&&!S(t=n?t:t.prototype,ht)&<(t,ht,{configurable:!0,value:e})},dt={};k(dt,ft("iterator"),function(){return this});var yt=function(t,e,n){t.prototype=ct(dt,{next:j(1,n)}),pt(t,e+" Iterator")},gt=function(t){return Object(c(t))},vt=Q("IE_PROTO"),mt=Object.prototype,bt=Object.getPrototypeOf||function(t){return t=gt(t),S(t,vt)?t[vt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?mt:null},_t=ft("iterator"),wt=!([].keys&&"next"in[].keys()),Et="@@iterator",xt="keys",At="values",Ft=function(){return this},jt=function(t,e,n,r,i,o,s){yt(n,e,r);var a,u,c,f=function(t){if(!wt&&t in d)return d[t];switch(t){case xt:case At:return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",h=i==At,p=!1,d=t.prototype,y=d[_t]||d[Et]||i&&d[i],g=y||f(i),v=i?h?f("entries"):g:void 0,m="Array"==e&&d.entries||y;if(m&&(c=bt(m.call(new t)))!==Object.prototype&&c.next&&(pt(c,l,!0),b||"function"==typeof c[_t]||k(c,_t,Ft)),h&&y&&y.name!==At&&(p=!0,g=function(){return y.call(this)}),b&&!s||!wt&&!p&&d[_t]||k(d,_t,g),D[e]=g,D[l]=Ft,i)if(a={values:h?g:f(At),keys:o?g:f(xt),entries:v},s)for(u in a)u in d||M(d,u,a[u]);else P(P.P+P.F*(wt||p),e,a);return a},kt=i(!0);jt(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=kt(e,n),this._i+=t.length,{value:t,done:!1})});var Ct=function(e,t,n,r){try{return r?t(l(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&l(i.call(e)),t}},St=ft("iterator"),Tt=Array.prototype,Ot=function(t){return void 0!==t&&(D.Array===t||Tt[St]===t)},Pt=function(t,e,n){e in t?F.f(t,e,j(0,n)):t[e]=n},Mt=ft("toStringTag"),Dt="Arguments"==B(function(){return arguments}()),Rt=function(t,e){try{return t[e]}catch(t){}},Bt=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=Rt(e=Object(t),Mt))?n:Dt?B(e):"Object"==(r=B(e))&&"function"==typeof e.callee?"Arguments":r},It=ft("iterator"),Lt=g.getIteratorMethod=function(t){if(null!=t)return t[It]||t["@@iterator"]||D[Bt(t)]},Nt=ft("iterator"),Ut=!1;try{var zt=[7][Nt]();zt.return=function(){Ut=!0}}catch(t){}var qt=function(t,e){if(!e&&!Ut)return!1;var n=!1;try{var r=[7],i=r[Nt]();i.next=function(){return{done:n=!0}},r[Nt]=function(){return i},t(r)}catch(t){}return n};P(P.S+P.F*!qt(function(t){}),"Array",{from:function(t){var e,n,r,i,o=gt(t),s="function"==typeof this?this:Array,a=arguments.length,u=1<a?arguments[1]:void 0,c=void 0!==u,f=0,l=Lt(o);if(c&&(u=v(u,2<a?arguments[2]:void 0,2)),null==l||s==Array&&Ot(l))for(n=new s(e=U(o.length));f<e;f++)Pt(n,f,c?u(o[f],f):o[f]);else for(i=l.call(o),n=new s;!(r=i.next()).done;f++)Pt(n,f,c?Ct(i,u,[r.value,f],!0):r.value);return n.length=f,n}});var Kt=g.Array.from,Ht=e(function(t){t.exports={default:Kt,__esModule:!0}});t(Ht);var Yt=e(function(t,e){e.__esModule=!0;var n,r=(n=Ht)&&n.__esModule?n:{default:n};e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,r.default)(t)}});t(Yt);var Wt=function(t,e){return{value:e,done:!!t}},$t=jt(Array,"Array",function(t,e){this._t=L(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,Wt(1)):Wt(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");D.Arguments=D.Array;for(var Vt=ft("toStringTag"),Jt="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Qt=0;Qt<Jt.length;Qt++){var Gt=Jt[Qt],Xt=y[Gt],Zt=Xt&&Xt.prototype;Zt&&!Zt[Vt]&&k(Zt,Vt,Gt),D[Gt]=D.Array}var te=ft,ee={f:te},ne=ee.f("iterator"),re=e(function(t){t.exports={default:ne,__esModule:!0}});t(re);var ie=e(function(t){var n=V("meta"),e=F.f,r=0,i=Object.isExtensible||function(){return!0},o=!h(function(){return i(Object.preventExtensions({}))}),s=function(t){e(t,n,{value:{i:"O"+ ++r,w:{}}})},a=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!f(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!S(t,n)){if(!i(t))return"F";if(!e)return"E";s(t)}return t[n].i},getWeak:function(t,e){if(!S(t,n)){if(!i(t))return!0;if(!e)return!1;s(t)}return t[n].w},onFreeze:function(t){return o&&a.NEED&&i(t)&&!S(t,n)&&s(t),t}}}),oe=ie.KEY,se=ie.NEED,ae=ie.fastKey,ue=ie.getWeak,ce=ie.onFreeze,fe=F.f,le=function(t){var e=g.Symbol||(g.Symbol={});"_"==t.charAt(0)||t in e||fe(e,t,{value:ee.f(t)})},he=Object.getOwnPropertySymbols,pe={f:he},de={}.propertyIsEnumerable,ye={f:de},ge=function(t){var e=et(t),n=pe.f;if(n)for(var r,i=n(t),o=ye.f,s=0;i.length>s;)o.call(t,r=i[s++])&&e.push(r);return e},ve=Array.isArray||function(t){return"Array"==B(t)},me=tt.concat("length","prototype"),be=Object.getOwnPropertyNames||function(t){return Z(t,me)},_e={f:be},we=_e.f,Ee={}.toString,xe="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ae=function(t){try{return we(t)}catch(t){return xe.slice()}},Fe=function(t){return xe&&"[object Window]"==Ee.call(t)?Ae(t):we(L(t))},je={f:Fe},ke=Object.getOwnPropertyDescriptor,Ce=p?ke:function(t,e){if(t=L(t),e=E(e,!0),w)try{return ke(t,e)}catch(t){}if(S(t,e))return j(!ye.f.call(t,e),t[e])},Se={f:Ce},Te=ie.KEY,Oe=Se.f,Pe=F.f,Me=je.f,De=y.Symbol,Re=y.JSON,Be=Re&&Re.stringify,Ie="prototype",Le=ft("_hidden"),Ne=ft("toPrimitive"),Ue={}.propertyIsEnumerable,ze=Y("symbol-registry"),qe=Y("symbols"),Ke=Y("op-symbols"),He=Object[Ie],Ye="function"==typeof De,We=y.QObject,$e=!We||!We[Ie]||!We[Ie].findChild,Ve=p&&h(function(){return 7!=ct(Pe({},"a",{get:function(){return Pe(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=Oe(He,e);r&&delete He[e],Pe(t,e,n),r&&t!==He&&Pe(He,e,r)}:Pe,Je=function(t){var e=qe[t]=ct(De[Ie]);return e._k=t,e},Qe=Ye&&"symbol"==typeof De.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof De},Ge=function(t,e,n){return t===He&&Ge(Ke,e,n),l(t),e=E(e,!0),l(n),S(qe,e)?(n.enumerable?(S(t,Le)&&t[Le][e]&&(t[Le][e]=!1),n=ct(n,{enumerable:j(0,!1)})):(S(t,Le)||Pe(t,Le,j(1,{})),t[Le][e]=!0),Ve(t,e,n)):Pe(t,e,n)},Xe=function(t,e){l(t);for(var n,r=ge(e=L(e)),i=0,o=r.length;i<o;)Ge(t,n=r[i++],e[n]);return t},Ze=function(t,e){return void 0===e?ct(t):Xe(ct(t),e)},tn=function(t){var e=Ue.call(this,t=E(t,!0));return!(this===He&&S(qe,t)&&!S(Ke,t))&&(!(e||!S(this,t)||!S(qe,t)||S(this,Le)&&this[Le][t])||e)},en=function(t,e){if(t=L(t),e=E(e,!0),t!==He||!S(qe,e)||S(Ke,e)){var n=Oe(t,e);return!n||!S(qe,e)||S(t,Le)&&t[Le][e]||(n.enumerable=!0),n}},nn=function(t){for(var e,n=Me(L(t)),r=[],i=0;n.length>i;)S(qe,e=n[i++])||e==Le||e==Te||r.push(e);return r},rn=function(t){for(var e,n=t===He,r=Me(n?Ke:L(t)),i=[],o=0;r.length>o;)!S(qe,e=r[o++])||n&&!S(He,e)||i.push(qe[e]);return i};Ye||(De=function(){if(this instanceof De)throw TypeError("Symbol is not a constructor!");var e=V(0<arguments.length?arguments[0]:void 0),n=function(t){this===He&&n.call(Ke,t),S(this,Le)&&S(this[Le],e)&&(this[Le][e]=!1),Ve(this,e,j(1,t))};return p&&$e&&Ve(He,e,{configurable:!0,set:n}),Je(e)},M(De[Ie],"toString",function(){return this._k}),Se.f=en,F.f=Ge,_e.f=je.f=nn,ye.f=tn,pe.f=rn,p&&!b&&M(He,"propertyIsEnumerable",tn,!0),ee.f=function(t){return Je(ft(t))}),P(P.G+P.W+P.F*!Ye,{Symbol:De});for(var on="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),sn=0;on.length>sn;)ft(on[sn++]);for(var an=et(ft.store),un=0;an.length>un;)le(an[un++]);P(P.S+P.F*!Ye,"Symbol",{for:function(t){return S(ze,t+="")?ze[t]:ze[t]=De(t)},keyFor:function(t){if(!Qe(t))throw TypeError(t+" is not a symbol!");for(var e in ze)if(ze[e]===t)return e},useSetter:function(){$e=!0},useSimple:function(){$e=!1}}),P(P.S+P.F*!Ye,"Object",{create:Ze,defineProperty:Ge,defineProperties:Xe,getOwnPropertyDescriptor:en,getOwnPropertyNames:nn,getOwnPropertySymbols:rn}),Re&&P(P.S+P.F*(!Ye||h(function(){var t=De();return"[null]"!=Be([t])||"{}"!=Be({a:t})||"{}"!=Be(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(f(e)||void 0!==t)&&!Qe(t))return ve(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Qe(e))return e}),r[1]=e,Be.apply(Re,r)}}),De[Ie][Ne]||k(De[Ie],Ne,De[Ie].valueOf),pt(De,"Symbol"),pt(Math,"Math",!0),pt(y.JSON,"JSON",!0),le("asyncIterator"),le("observable");var cn=g.Symbol,fn=e(function(t){t.exports={default:cn,__esModule:!0}});t(fn);var ln=e(function(t,e){e.__esModule=!0;var n=o(re),r=o(fn),i="function"==typeof r.default&&"symbol"==typeof n.default?function(t){return typeof t}:function(t){return t&&"function"==typeof r.default&&t.constructor===r.default&&t!==r.default.prototype?"symbol":typeof t};function o(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof r.default&&"symbol"===i(n.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof r.default&&t.constructor===r.default&&t!==r.default.prototype?"symbol":void 0===t?"undefined":i(t)}});t(ln);var hn=function(t){this.text=t},pn=e(function(t){var e,d=(e=ln)&&e.__esModule?e:{default:e};t.exports=function(t,e,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o="expected",s=t.clone();e&&e.call(s,s);var a=t.clone();if("function"==typeof r)r.call(a,a);else if(0<r.length){var u=!1;r.forEach(function(t,e){var n=t&&"object"===(void 0===t?"undefined":(0,d.default)(t))&&t instanceof hn;0<e&&(n||u||a.text(","),a.sp()),n?a.error(t.text):t.call(a,a),u=n})}var c=s.size(),f=a.size(),l=o.length+c.width+f.width+n.length,h=Math.max(c.height,f.height);if("omitSubject"in t&&t.omitSubject===i.subject){var p=/^(not )?to (.*)/.exec(n);p?(t.error("should "),p[1]&&t.error("not "),n=p[2]):n="expected: "+n}else i.compact&&i.compactSubject&&(1<c.height||c.width>(i.compactWidth||35))?(t.error("expected").sp(),i.compactSubject.call(t,t),t.sp()):(t.error(o),1<c.height?t.nl():t.sp(),t.append(s),1<c.height||1===h&&l>t.preferredWidth?t.nl():t.sp());return t.error(n),1<f.height?t.nl():0<f.width&&t.sp(),t.append(a),t}});t(pn);var dn={intersects:function(t,e){return t.start<e.end&&e.start<t.end||t.start===e.start},intersectsWithSome:function(t,e){return t.some(function(t){return dn.intersects(e,t)})}},yn=dn,gn=function(t,e){var n=e.start-t.start;return 0!==n?n:t.end-t.start-(e.end-e.start)},vn=yn.intersectsWithSome,mn=function(t,e){if(e=e||{},!Array.isArray(t))throw new Error("The interval packer requires an array of objects with start and end properties.");if(0===t.length)return[];var n;t.forEach(function(t){if("object"!=typeof t||"number"!=typeof t.start||"number"!=typeof t.end||t.end<=t.start)throw new Error("Intervals must be objects with integer properties start and end where start < end.")}),t=[].concat(t).sort(gn);for(var r=[],i=-1/0;0<t.length;){var o=t.pop();i<=o.start&&(n=[[]],r.push(n));for(var s=0;s<n.length&&vn(n[s],o);)s+=1;(n[s]=n[s]||[]).push(o),i=Math.max(i,o.end)}return e.groupPartitions?r:r.reduce(function(n,t){return t.forEach(function(t,e){return n[e]=n[e]||[],Array.prototype.push.apply(n[e],t),n}),n},[])},bn=e(function(t){var e,u=(e=ln)&&e.__esModule?e:{default:e};var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array,r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c=t.exports={objectIs:Object.is||function(t,e){return 0===t&&0===e?1/t==1/e:t!=t?e!=e:t===e},duplicateArrayLikeUsingType:function(n,r){var t=r.getKeys(n),i=t.length;if(!r.numericalPropertiesOnly){for(var e=0,o=t.length-1;-1<o;o-=1){var s=t[o];if("symbol"!==(void 0===s?"undefined":(0,u.default)(s))&&c.numericalRegExp.test(s))break;e+=1}i-=e}var a=new Array(i);return t.forEach(function(t,e){i<=e&&!r.hasKey(n,t)||(a[t]=r.hasKey(n,t)?r.valueForKey(n,t):void 0)}),a},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isPromise:function(t){return t&&"function"==typeof t.then},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},isError:function(t){return"object"===(void 0===t?"undefined":(0,u.default)(t))&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)},extend:function(n){for(var r=arguments,t=function(t){var e=r[t];e&&Object.keys(e).forEach(function(t){n[t]=e[t]})},e=1;e<arguments.length;e+=1)t(e);return n},findFirst:function(t,e){for(var n=0;n<t.length;n+=1)if(e(t[n]))return t[n];return null},leftPad:function(t,e){for(var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:" ";t.length<e;)t=n+t;return t},escapeRegExpMetaChars:function(t){return t.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&")},escapeChar:function(t){if("\t"===t)return"\\t";if("\r"===t)return"\\r";var e=t.charCodeAt(0),n=e.toString(16).toUpperCase();return e<256?"\\x"+c.leftPad(n,2,"0"):"\\u"+c.leftPad(n,4,"0")},getFunctionName:function(t){if("string"==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^(]+)/);return e?e[1]:t===Object?"Object":t===Function?"Function":""},wrapConstructorNameAroundOutput:function(t,e){var n=e.constructor,r=n&&n!==Object&&c.getFunctionName(n);return r&&"Object"!==r?t.clone().text(r+"(").append(t).text(")"):t},setPrototypeOfOrExtend:n?r:function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},uniqueStringsAndSymbols:function(){var e=void 0;"function"==typeof(arguments.length<=0?void 0:arguments[0])&&(e=arguments.length<=0?void 0:arguments[0]);var n={},r=[];function i(t){Array.isArray(t)?t.forEach(i):Object.prototype.hasOwnProperty.call(n,t)||e&&!e(t)||(n[t]=!0,r.push(t))}for(var t=e?1:0;t<arguments.length;t+=1)i(arguments.length<=t?void 0:arguments[t]);return r},uniqueNonNumericalStringsAndSymbols:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return c.uniqueStringsAndSymbols(function(t){return"symbol"===(void 0===t?"undefined":(0,u.default)(t))||!c.numericalRegExp.test(t)},Array.prototype.slice.call(e))},forwardFlags:function(t,r){return t.replace(/\[(!?)([^\]]+)\] ?/g,function(t,e,n){return Boolean(r[n])!==Boolean(e)?n+" ":""}).trim()},numericalRegExp:/^(?:0|[1-9][0-9]*)$/,packArrows:function(i){var s={};i.forEach(function(t,e){"moveSource"===t.type?(t.changeIndex=e,(s[t.actualIndex]=s[t.actualIndex]||{}).source=t):"moveTarget"===t.type&&(t.changeIndex=e,(s[t.actualIndex]=s[t.actualIndex]||{}).target=t)});var t=Object.keys(s);if(0<t.length){var a=[];t.sort(function(t,e){return Math.abs(s[e].source.changeIndex-s[e].target.changeIndex)-Math.abs(s[t].source.changeIndex-s[t].target.changeIndex)}).forEach(function(t,e,n){var r=s[t],i=Math.min(r.source.changeIndex,r.target.changeIndex),o=Math.max(r.source.changeIndex,r.target.changeIndex);a.push({start:i,end:o,direction:r.source.changeIndex<r.target.changeIndex?"down":"up"})});for(var e=mn(a);3<e.length;)e.shift().forEach(function(t){var e=t.direction,n=t.start,r=t.end;i["up"===e?n:r].type="insert",i["up"===e?r:n].type="remove"});return e}},truncateSubjectStringForBegin:function(t,e){var n=e.length+25;if(t.length<=n)return null;var r=t.indexOf(" ",e.length+1);return-1<r&&r<n?t.substring(0,r):t.substring(0,n)},truncateSubjectStringForEnd:function(t,e){var n=t.length-e.length-25;if(n<=0)return null;var r=t.lastIndexOf(" ",e.length+1);return-1<r&&n<=r?t.substring(r+1,t.length):t.substring(n,t.length)}}});t(bn);var _n=bn.objectIs,wn=bn.duplicateArrayLikeUsingType,En=bn.isArray,xn=bn.isPromise,An=bn.isRegExp,Fn=bn.isError,jn=bn.extend,kn=bn.findFirst,Cn=bn.leftPad,Sn=bn.escapeRegExpMetaChars,Tn=bn.escapeChar,On=bn.getFunctionName,Pn=bn.wrapConstructorNameAroundOutput,Mn=bn.setPrototypeOfOrExtend,Dn=bn.uniqueStringsAndSymbols,Rn=bn.uniqueNonNumericalStringsAndSymbols,Bn=bn.forwardFlags,In=bn.numericalRegExp,Ln=bn.packArrows,Nn=bn.truncateSubjectStringForBegin,Un=bn.truncateSubjectStringForEnd,zn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function qn(){throw new Error("setTimeout has not been defined")}function Kn(){throw new Error("clearTimeout has not been defined")}var Hn=qn,Yn=Kn;function Wn(e){if(Hn===setTimeout)return setTimeout(e,0);if((Hn===qn||!Hn)&&setTimeout)return Hn=setTimeout,setTimeout(e,0);try{return Hn(e,0)}catch(t){try{return Hn.call(null,e,0)}catch(t){return Hn.call(this,e,0)}}}function $n(e){if(Yn===clearTimeout)return clearTimeout(e);if((Yn===Kn||!Yn)&&clearTimeout)return Yn=clearTimeout,clearTimeout(e);try{return Yn(e)}catch(t){try{return Yn.call(null,e)}catch(t){return Yn.call(this,e)}}}"function"==typeof zn.setTimeout&&(Hn=setTimeout),"function"==typeof zn.clearTimeout&&(Yn=clearTimeout);var Vn=[],Jn=!1,Qn,Gn=-1;function Xn(){Jn&&Qn&&(Jn=!1,Qn.length?Vn=Qn.concat(Vn):Gn=-1,Vn.length&&Zn())}function Zn(){if(!Jn){var t=Wn(Xn);Jn=!0;for(var e=Vn.length;e;){for(Qn=Vn,Vn=[];++Gn<e;)Qn&&Qn[Gn].run();Gn=-1,e=Vn.length}Qn=null,Jn=!1,$n(t)}}function tr(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Vn.push(new er(t,e)),1!==Vn.length||Jn||Wn(Zn)}function er(t,e){this.fun=t,this.array=e}er.prototype.run=function(){this.fun.apply(null,this.array)};var nr="browser",rr="browser",ir=!0,or={},sr=[],ar="",ur={},cr={},fr={};function lr(){}var hr=lr,pr=lr,dr=lr,yr=lr,gr=lr,vr=lr,mr=lr;function br(t){throw new Error("process.binding is not supported")}function _r(){return"/"}function wr(t){throw new Error("process.chdir is not supported")}function Er(){return 0}var xr=zn.performance||{},Ar=xr.now||xr.mozNow||xr.msNow||xr.oNow||xr.webkitNow||function(){return(new Date).getTime()};function Fr(t){var e=.001*Ar.call(xr),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&&(n-=t[0],(r-=t[1])<0&&(n--,r+=1e9)),[n,r]}var jr=new Date;function kr(){return(new Date-jr)/1e3}for(var Cr={nextTick:tr,title:nr,browser:ir,env:or,argv:sr,version:ar,versions:ur,on:hr,addListener:pr,once:dr,off:yr,removeListener:gr,removeAllListeners:vr,emit:mr,binding:br,cwd:_r,chdir:wr,umask:Er,hrtime:Fr,platform:rr,release:cr,config:fr,uptime:kr},Sr={extend:function(e){for(var t=1;t<arguments.length;t+=1){var n=arguments[t];Object.keys(n).forEach(function(t){e[t]=n[t]})}return e},calculateOutputEntrySize:function(t){if(t.size)return t.size;var e;switch(t.style){case"text":e={width:String(t.args.content).length,height:1};break;case"block":e=Sr.calculateSize(t.args);break;case"raw":var n=t.args;e={width:n.width,height:n.height};break;default:e={width:0,height:0}}return t.size=e},calculateLineSize:function(t){var n={height:1,width:0};return t.forEach(function(t){var e=Sr.calculateOutputEntrySize(t);n.width+=e.width,n.height=Math.max(e.height,n.height)}),n},calculateSize:function(t){var n={height:0,width:0};return t.forEach(function(t){var e=Sr.calculateLineSize(t);n.height+=e.height,n.width=Math.max(n.width,e.width)}),n},arrayEquals:function(t,e){if(t===e)return!0;if(!t||t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},escapeRegExp:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},findFirst:function(t,e,n){for(var r=n||null,i=0;i<t.length;i+=1)if(e.call(r,t[i],i,t))return t[i];return null},getFunctionName:function(t){if("string"==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^\(]+)/);return e?e[1]:t===Object?"Object":t===Function?"Function":void 0}},Tr=Sr,Or=256,Pr=[""],Mr=1;Mr<=Or;Mr+=1)Pr[Mr]=Pr[Mr-1]+" ";function Dr(t,e){if(e<0)return"";var n="";if(" "===t){if(e<=Or)return Pr[e];for(var r=Pr[Or],i=Math.floor(e/Or),o=0;o<i;o+=1)n+=r;n+=Pr[e%Or]}else for(var s=0;s<e;s+=1)n+=t;return n}var Rr=Dr,Br=/^(?:bg)?#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Ir={bold:"font-weight: bold",dim:"opacity: 0.7",italic:"font-style: italic",underline:"text-decoration: underline",inverse:"-webkit-filter: invert(%100); filter: invert(100%)",hidden:"visibility: hidden",strikeThrough:"text-decoration: line-through",black:"color: black",red:"color: red",green:"color: green",yellow:"color: yellow",blue:"color: blue",magenta:"color: magenta",cyan:"color: cyan",white:"color: white",gray:"color: gray",bgBlack:"background-color: black",bgRed:"background-color: red",bgGreen:"background-color: green",bgYellow:"background-color: yellow",bgBlue:"background-color: blue",bgMagenta:"background-color: magenta",bgCyan:"background-color: cyan",bgWhite:"background-color: white"};Object.keys(Ir).forEach(function(t){Ir[t.toLowerCase()]=Ir[t]});var Lr=Ir,Nr=Cr.argv,Ur=!(-1!==Nr.indexOf("--no-color")||-1!==Nr.indexOf("--no-colors")||-1!==Nr.indexOf("--color=false")||-1===Nr.indexOf("--color")&&-1===Nr.indexOf("--colors")&&-1===Nr.indexOf("--color=true")&&-1===Nr.indexOf("--color=always")&&(Cr.stdout&&!Cr.stdout.isTTY||"win32"!==Cr.platform&&!("COLORTERM"in Cr.env||"dumb"!==Cr.env.TERM&&/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(Cr.env.TERM))));function zr(t){return{style:"text",args:{content:Rr(" ",t),styles:[]}}}function qr(t){return t.some(function(t){return"block"===t.style||"text"===t.style&&-1!==String(t.args.content).indexOf("\n")})}function Kr(e){switch(e.style){case"text":return String(e.args.content).split("\n").map(function(t){return""===t?[]:[{style:"text",args:{content:t,styles:e.args.styles}}]});case"block":return Yr(e.args);default:return[]}}function Hr(t){if(0===t.length)return[[]];if(!qr(t))return[t];var o=[],s=[],a=0;return t.forEach(function(t,e){var n=Kr(t),i=n.map(function(t){return Tr.calculateLineSize(t).width}),r=Math.max.apply(null,i);n.forEach(function(t,e){var n=o[e];if(n||(o[e]=n=[],s[e]=0),t.length){var r=a-s[e];n.push(zr(r)),Array.prototype.push.apply(n,t),s[e]=a+i[e]}}),a+=r},this),o}function Yr(t){var e=[];return t.forEach(function(t){Hr(t).forEach(function(t){e.push(t)})}),e}var Wr=Yr;function $r(){}$r.prototype.format="text",$r.prototype.serialize=function(t){return(t=Wr(t)).map(this.serializeLine,this).join("\n")},$r.prototype.serializeLine=function(t){return t.map(function(t){return this[t.style]?String(this[t.style](t.args)):""},this).join("")},$r.prototype.text=function(t){return String(t.content)},$r.prototype.block=function(t){return this.serialize(t)},$r.prototype.raw=function(t){return String(t.content(this))};var Vr=$r,Jr=function(t,e){if(1!==e.length)return e;for(var n=0,r=[],i=e[0],o=t.styles||{};"string"==typeof i&&o[i];)if(i=o[i],100<(n+=1)){var s=r.indexOf(i);if(r.push(i),-1!==s)throw new Error("Your theme contains a loop: "+r.slice(s).join(" -> "))}return Array.isArray(i)?i:[i]};function Qr(t){this.theme=t}Qr.prototype.format="html",Qr.prototype.serialize=function(t){return'<div style="font-family: monospace; white-space: nowrap">'+this.serializeLines(t)+"</div>"},Qr.prototype.serializeLines=function(t){return t.map(function(t){return"<div>"+(this.serializeLine(t).join("")||" ")+"</div>"},this).join("")},Qr.prototype.serializeLine=function(t){return t.map(function(t){return this[t.style]?this[t.style](t.args):""},this)},Qr.prototype.block=function(t){return'<div style="display: inline-block; vertical-align: top">'+this.serializeLines(t)+"</div>"},Qr.prototype.text=function(t){var e=String(t.content);if(""===e)return"";e=e.replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");var n=Jr(this.theme,t.styles);if(0<n.length){for(var r=[],i=0;i<n.length;i+=1){var o=n[i];Br.test(o)?"bg"===o.substring(0,2)?r.push("background-color: "+o.substring(2)):r.push("color: "+o):Lr[o]&&r.push(Lr[o])}0<r.length&&(e='<span style="'+r.join("; ")+'">'+e+"</span>")}return e},Qr.prototype.raw=function(t){return String(t.content(this))};var Gr=Qr,Xr=ai,Zr=Math.sqrt,ti=Math.pow,ei=Math.cos,ni=Math.atan2,ri=Math.sin,ii=Math.abs,oi=Math.exp,si=Math.PI;
/**
* @author Markus Ekholm
* @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
* @license Copyright (c) 2012-2015, Markus Ekholm
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function ai(t,e){var n=t.L,r=t.a,i=t.b,o=e.L,s=e.a,a=e.b,u=Zr(ti(r,2)+ti(i,2)),c=Zr(ti(s,2)+ti(a,2)),f=(u+c)/2,l=.5*(1-Zr(ti(f,7)/(ti(f,7)+ti(25,7)))),h=(1+l)*r,p=(1+l)*s,d=Zr(ti(h,2)+ti(i,2)),y=Zr(ti(p,2)+ti(a,2)),g=function(t,e){if(0==t&&0==e)return 0;var n=ui(ni(t,e));return 0<=n?n:n+360},v=g(i,h),m=g(a,p),b=o-n,_=y-d,w=function(t,e,n,r){if(t*e==0)return 0;if(ii(r-n)<=180)return r-n;if(180<r-n)return r-n-360;if(r-n<-180)return r-n+360;throw new Error}(u,c,v,m),E=2*Zr(d*y)*ri(ci(w)/2),x=(n+o)/2,A=(d+y)/2,F=function(t,e,n,r){if(t*e==0)return n+r;if(ii(n-r)<=180)return(n+r)/2;if(180<ii(n-r)&&n+r<360)return(n+r+360)/2;if(180<ii(n-r)&&360<=n+r)return(n+r-360)/2;throw new Error}(u,c,v,m),j=1-.17*ei(ci(F-30))+.24*ei(ci(2*F))+.32*ei(ci(3*F+6))-.2*ei(ci(4*F-63)),k=30*oi(-ti((F-275)/25,2)),C=Zr(ti(A,7)/(ti(A,7)+ti(25,7))),S=1+.015*ti(x-50,2)/Zr(20+ti(x-50,2)),T=1+.045*A,O=1+.015*A*j,P=-2*C*ri(ci(2*k));return Zr(ti(b/(1*S),2)+ti(_/(1*T),2)+ti(E/(1*O),2)+P*(_/(1*T))*(E/(1*O)))}function ui(t){return t*(180/si)}function ci(t){return t*(si/180)}var fi={ciede2000:Xr},li=pi,hi=Math.pow;
/**
* @author Markus Ekholm
* @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
* @license Copyright (c) 2012-2015, Markus Ekholm
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function pi(t){return yi(di(t))}function di(t){var e=t.R/255,n=t.G/255,r=t.B/255;return.04045<e?e=hi((e+.055)/1.055,2.4):e/=12.92,.04045<n?n=hi((n+.055)/1.055,2.4):n/=12.92,.04045<r?r=hi((r+.055)/1.055,2.4):r/=12.92,{X:.4124*(e*=100)+.3576*(n*=100)+.1805*(r*=100),Y:.2126*e+.7152*n+.0722*r,Z:.0193*e+.1192*n+.9505*r}}function yi(t){var e=t.Y/100,n=t.Z/108.883,r=t.X/95.047;return r=.008856<r?hi(r,1/3):7.787*r+16/116,{L:116*(e=.008856<e?hi(e,1/3):7.787*e+16/116)-16,a:500*(r-e),b:200*(e-(n=.008856<n?hi(n,1/3):7.787*n+16/116))}}var gi={rgb_to_lab:li},vi=_i,mi=bi;
/**
* @author Markus Ekholm
* @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org >
* @license Copyright (c) 2012-2015, Markus Ekholm
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function bi(t){return"R"+t.R+"B"+t.B+"G"+t.G}function _i(t,e,n){var r={};n=n||"closest";for(var i=0;i<t.length;i+=1){for(var o=t[i],s=void 0,a=void 0,u=0;u<e.length;u+=1){var c=e[u],f=wi(o,c);null==s||"closest"===n&&f<a?(s=c,a=f):"furthest"===n&&a<f&&(s=c,a=f)}r[bi(o)]=s}return r}function wi(t,e){return t=gi.rgb_to_lab(t),e=gi.rgb_to_lab(e),fi.ciede2000(t,e)}var Ei={map_palette:vi,palette_map_key:mi},xi=e(function(t){var r=t.exports={};r.diff=fi.ciede2000,r.rgb_to_lab=gi.rgb_to_lab,r.map_palette=Ei.map_palette,r.palette_map_key=Ei.palette_map_key,r.closest=function(t,e){var n=r.palette_map_key(t);return r.map_palette([t],e,"closest")[n]},r.furthest=function(t,e){var n=r.palette_map_key(t);return r.map_palette([t],e,"furthest")[n]}}),Ai=e(function(t){var r=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};r.colors.grey=r.colors.gray,Object.keys(r).forEach(function(t){var n=r[t];Object.keys(n).forEach(function(t){var e=n[t];r[t]=n[t]={open:"["+e[0]+"m",close:"["+e[1]+"m"}}),Object.defineProperty(r,t,{value:n,enumerable:!1})})}),Fi=Ai.modifiers,ji=Ai.colors,ki=Ai.bgColors,Ci=0,Si=1024,Ti=Tr.extend({},Ai);function Oi(t){this.theme=t}Object.keys(Ti).forEach(function(t){Ti[t.toLowerCase()]=Ti[t]}),Oi.prototype=new Vr,Oi.prototype.format="ansi";var Pi={16:{"#000000":"black","#ff0000":"red","#00ff00":"green","#ffff00":"yellow","#0000ff":"blue","#ff00ff":"magenta","#00ffff":"cyan","#ffffff":"white","#808080":"gray"},256:{}},Mi={};function Di(t){t.length<6&&(t=t.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,"$1$1$2$2$3$3"));var e=t.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(e)return{R:parseInt(e[1],16),G:parseInt(e[2],16),B:parseInt(e[3],16)}}function Ri(t){var e=(65536*Math.round(t.R)+256*Math.round(t.G)+Math.round(t.B)).toString(16);return"#"+"00000".substr(0,6-e.length)+e}function Bi(t){return t.substring(0,1).toUpperCase()+t.substring(1)}Mi[16]=Object.keys(Pi[16]).map(Di),Mi.bg16=Object.keys(Pi[16]).filter(function(t){return"#808080"!==t}).map(Di),Mi[256]=[].concat(Mi[16]);var Ii=16;function Li(t){Mi[256].push(t),Pi[256][Ri(t)]=Ii,Ii+=1}for(var Ni=0;Ni<6;Ni+=1)for(var Ui=0;Ui<6;Ui+=1)for(var zi=0;zi<6;zi+=1)Li({R:Math.round(256*Ni/6),G:Math.round(256*Ui/6),B:Math.round(256*zi/6)});[8,18,28,38,48,58,68,78,88,96,102,118,128,138,148,158,168,178,188,198,208,218,228,238].forEach(function(t){Li({R:t,G:t,B:t})}),Oi.prototype.text=function(t){var e=String(t.content);if(""===e)return"";var n=Jr(this.theme,t.styles);if(0<n.length)for(var r=n.length-1;0<=r;r-=1){var i=n[r];if(Ti[i])e=Ti[i].open+e+Ti[i].close;else if(Br.test(i)){var o=i,s="bg"===i.substring(0,2),a=s?i.substring(2):i,u=Ri(xi.closest(Di(a),Mi[s?"bg16":16])),c=Pi[16][u],f=Ri(xi.closest(Di(a),Mi[256])),l=Pi[256][f];i=s?"bg"+Bi(c):c;var h=Ti[i].open,p=Ti[i].close;u!==f&&(h+="["+(s?48:38)+";5;"+l+"m"),Ci<Si&&(Ti[o]={open:h,close:p},Ci+=1),e=h+e+p}}return e};var qi=Oi;function Ki(t){this.theme=t}Ki.prototype.format="coloredConsole",Ki.prototype.serialize=function(t){var e="",n=[];return this.serializeLines(Wr(t)).forEach(function(t){t&&(e+=t[0],1<t.length&&n.push(t[1]))}),[e].concat(n)},Ki.prototype.serializeLines=function(t){var n=[];return t.forEach(function(t,e){0<e&&n.push(["%c\n ",""]),Array.prototype.push.apply(n,this.serializeLine(t))},this),n},Ki.prototype.serializeLine=function(t){var e=[];return t.forEach(function(t){this[t.style]&&e.push(this[t.style](t.args))},this),e},Ki.prototype.block=function(t){return this.serializeLines(t)},Ki.prototype.text=function(t){var e=String(t.content);if(""===e)return"";var n=Jr(this.theme,t.styles),r=["%c"+e.replace(/%/g,"%%")],i=[];if(0<n.length)for(var o=0;o<n.length;o+=1){var s=n[o];Br.test(s)?"bg"===s.substring(0,2)?i.push("background-color: "+s.substring(2)):i.push("color: "+s):Lr[s]&&i.push(Lr[s])}return r.push(i.join("; ")),r},Ki.prototype.raw=function(t){return String(t.content(this))};var Hi=Ki,Yi=e(function(t,e){var o=Tr.extend,r=["bold","dim","italic","underline","inverse","hidden","strikeThrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite"];function s(t){if(!(this instanceof s))return new s(t);"string"==typeof(t=t||{})&&(t={format:t});var e="indentationWidth"in t?t.indentationWidth:2;this.indentationWidth=Math.max(e,0),this.indentationLevel=0,this.output=[[]],this.styles=Object.create(null),this.installedPlugins=[],this._themes={},Object.keys(s.serializers).forEach(function(t){this._themes[t]={styles:{}}},this),this.preferredWidth=80,t.format&&(this.format=t.format)}function a(t,e){return!(!t||!e||"text"!==t.style||"text"!==e.style)&&Tr.arrayEquals(t.args.styles,e.args.styles)}function h(t){if(0===t.length)return t;for(var e=[t[0]],n=1;n<t.length;n+=1){var r=e[e.length-1],i=t[n];"text"===i.style&&""===i.args.content||(a(r,i)?e[e.length-1]={style:r.style,args:{content:r.args.content+i.args.content,styles:r.args.styles}}:e.push(i))}return e}function i(t){return t&&"object"==typeof t&&"number"==typeof t.width&&"number"==typeof t.height&&("function"==typeof t.content||"string"==typeof t.content)}s.defaultFormat="string"!=typeof e.nodeName&&Ur?"ansi":"undefined"!=typeof window&&void 0!==window.navigator?window._phantom||window.mochaPhantomJS||window.__karma__&&window.__karma__.config.captureConsole?"ansi":"html":"text",s.prototype.newline=s.prototype.nl=function(t){if(void 0===t&&(t=1),0===t)return this;for(var e=0;e<t;e+=1)this.output.push([]);return this},s.serializers={},[Vr,Gr,qi,Hi].forEach(function(t){s.serializers[t.prototype.format]=t}),s.prototype.write=function(t){if(this.styles[t.style])return this.styles[t.style].apply(this,t.args),this;var e=this.output[this.output.length-1],n=e[e.length-1];return a(n,t)?e[e.length-1]={style:n.style,args:{content:n.args.content+t.args.content,styles:n.args.styles}}:e.push(t),this},s.prototype.indentLines=function(){return this.indentationLevel+=1,this},s.prototype.indent=s.prototype.i=function(){for(var t=0;t<this.indentationLevel;t+=1)this.space(this.indentationWidth);return this},s.prototype.outdentLines=function(){return this.indentationLevel=Math.max(0,this.indentationLevel-1),this},s.prototype.addStyle=function(t,e,n){if(!1===this[t]||(this.hasOwnProperty(t)||s.prototype[t])&&!Object.prototype.hasOwnProperty.call(this.styles,t)&&-1===r.indexOf(t))throw new Error('"'+t+'" style cannot be defined, it clashes with a built-in attribute');if((this.hasOwnProperty(t)||-1!==r.indexOf(t))&&("function"===typeof this[t]&&!n))throw new Error('"'+t+'" style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway');return this._stylesHaveNotBeenClonedYet&&(this.styles=Object.create(this.styles),this._stylesHaveNotBeenClonedYet=!1),this.styles[t]=e,this[t]=function(){return e.apply(this,arguments),this},this},s.prototype.toString=function(t){if(t&&this.format&&t!==this.format)throw new Error("A pen with format: "+this.format+" cannot be serialized to: "+t);"auto"===(t=this.format||t||"text")&&(t=s.defaultFormat);var e=this._themes[t]||{};return new s.serializers[t](e).serialize(this.output)},s.prototype.text=function(){var t=arguments[0];if(""===t)return this;for(var n=new Array(arguments.length-1),e=1;e<arguments.length;e+=1)n[e-1]=arguments[e];if(-1===(t=String(t)).indexOf("\n"))return this.write({style:"text",args:{content:t,styles:n}});var r=t.split(/\n/);return r.forEach(function(t,e){t.length&&this.write({style:"text",args:{content:t,styles:n}}),e<r.length-1&&this.nl()},this),this},s.prototype.removeFormatting=function(){var n=this.clone();return this.output.forEach(function(t,e){n.output[e]=h(t.map(function(t){return"text"===t.style?{style:"text",args:{content:t.args.content,styles:[]}}:t}))}),n.indentationLevel=this.indentationLevel,n},s.prototype.getContentFromArguments=function(t){var e;if(t[0].isMagicPen)return this.ensureCompatibleFormat(t[0].format),t[0];if("function"==typeof t[0])return e=this.clone(),t[0].call(e,e),e;if("string"==typeof t[0]&&1===t.length)return(e=this.clone()).text(t[0]),e;if("string"==typeof t[0])return(e=this.clone())[t[0]].apply(e,Array.prototype.slice.call(t,1)),e;throw new Error("Requires the arguments to be:\na pen or\na callback appending content to a pen or\na style and arguments for that style or\njust a string.")},s.prototype.isMultiline=function(){return 1<this.output.length||1<this.size().height},s.prototype.isAtStartOfLine=function(){return 0===this.output.length||0===this.output[this.output.length-1].length},s.prototype.isBlock=function(){return 1===this.output.length&&1===this.output[0].length&&"block"===this.output[0][0].style},s.prototype.ensureCompatibleFormat=function(t){if(t&&this.format&&t!==this.format)throw new Error("This pen is only compatible with the format: "+this.format)},s.prototype.block=function(){var t=this.getContentFromArguments(arguments).output.map(function(t){return[].concat(t)});return this.write({style:"block",args:t})},s.prototype.alt=function(t){var e=this.format;if(!e)throw new Error("The alt method is only supported on pen where the format has already been set");var n=t[e];return void 0===n?t.fallback?this.append(t.fallback):this:"string"==typeof n||i(n)?this.raw(n):this.append(n)},s.prototype.raw=function(t){if(!this.format)throw new Error("The alt method is only supported on pen where the format has already been set");if("string"==typeof t)return this.write({style:"raw",args:{height:0,width:0,content:function(){return t}}});if(i(t)){if("string"==typeof t.content){var e=(t=o({},t)).content;t.content=function(){return e}}return this.write({style:"raw",args:t})}throw new Error("Raw "+this.format+" content needs to adhere to one of the following forms:\na string of raw content\na function returning a string of raw content or\nan object with the following form { width: <number>, height: <number>, content: <string function() {}|string> }")},s.prototype.amend=function(){var t=this.getContentFromArguments(arguments);return t.isEmpty()||(this.output=function t(e,n){var r=e[e.length-1].slice(),i=e.slice(0,-1),o=r[r.length-1];return o&&"block"===o.style?(r[r.length-1]={style:"block",args:t(o.args,n)},i[e.length-1]=r):(Array.prototype.push.apply(r,n.output[0]),i[e.length-1]=h(r),i.push.apply(i,n.output.slice(1))),i}(this.output,t)),this},s.prototype.append=function(){var t=this.getContentFromArguments(arguments);if(t.isEmpty())return this;var e=this.output[this.output.length-1];return Array.prototype.push.apply(e,t.output[0]),this.output[this.output.length-1]=h(e),this.output.push.apply(this.output,t.output.slice(1)),this},s.prototype.prependLinesWith=function(){var e=this.getContentFromArguments(arguments);if(e.isEmpty())return this;if(1<e.output.length)throw new Error("PrependLinesWith only supports a pen with single line content");var n=this.size().height,t=this.clone();return t.block(function(){for(var t=0;t<n;t+=1)0<t&&this.nl(),this.append(e)}),t.block(this),this.output=t.output,this},s.prototype.space=s.prototype.sp=function(t){return 0===t?this:(void 0===t&&(t=1),this.text(Rr(" ",t)))},r.forEach(function(e){s.prototype[e]=s.prototype[e.toLowerCase()]=function(t){return this.text(t,e)}}),s.prototype.clone=function(t){function e(){}this.isEmpty()||this.ensureCompatibleFormat(t),e.prototype=this;var n=new e;return n.styles=this.styles,n._stylesHaveNotBeenClonedYet=!0,n.indentationLevel=0,n.output=[[]],n.installedPlugins=[],n._themes=this._themes,n._themesHaveNotBeenClonedYet=!0,n.format=t||this.format,n.parent=this,n},s.prototype.isMagicPen=!0,s.prototype.size=function(){return Tr.calculateSize(this.output)},s.prototype.installPlugin=s.prototype.use=function(n){var t=Tr.findFirst(this.installedPlugins,function(t){if(t===n)return!0;if("function"!=typeof n||"function"!=typeof t)return t.name===n.name;var e=Tr.getFunctionName(n);return""!==e&&e===Tr.getFunctionName(t)});if(t){if(t===n||void 0!==n.version&&n.version===t.version)return this;throw new Error("Another instance of the plugin '"+n.name+"' is already installed"+(void 0!==t.version?" (version "+t.version+(void 0!==n.version?", trying to install "+n.version:"")+")":"")+". Please check your node_modules folder for unmet peerDependencies.")}if("function"!=typeof n&&("object"!=typeof n||"function"!=typeof n.installInto)||void 0!==n.name&&"string"!=typeof n.name||void 0!==n.dependencies&&!Array.isArray(n.dependencies))throw new Error("Plugins must be functions or adhere to the following interface\n{\n name: <an optional plugin name