├── LICENSE ├── README.md ├── css ├── bootstrap.min.css └── index.css ├── index.html └── js ├── bootstrap.min.js ├── index.js └── iota.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Dominik Schiener 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IOTA Address Generator 2 | 3 | This is a simple website which lets you generate a new address with a variety of options. This is mainly for educational purposes and should not be used for anything sensitive. Open up index.html, the rest is self-explanatory. If you want to see what's happening, open up the developer console for extra logging. 4 | 5 | Using Bootstrap 4. 6 | -------------------------------------------------------------------------------- /css/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 2rem; 3 | } 4 | 5 | 6 | .seedSubmitButton { 7 | 8 | margin-top: 15px; 9 | 10 | } 11 | 12 | .stepSection { 13 | 14 | 15 | 16 | } 17 | 18 | .stepTitle { 19 | 20 | margin: 50px 0; 21 | 22 | } 23 | 24 | .generateAddress { 25 | 26 | margin-bottom: 50px; 27 | } 28 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | IOTA Address Generator Example 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 40 | 41 | 42 |
43 |
44 |

IOTA Address Generator

45 |

This is an educational website for people to learn more about address generation in IOTA and the kind of steps that are involved in going from a seed to an address. Everything is done client-side, so you don't have to worry about your seed leaving your seed at any point in time. This website is best used in conjunction with the IOTA Learn Tutorial with Code Snippets on how to generate addresses in Javascript and Python.

46 |
47 |
48 | 49 | 50 |
51 |
52 |
53 |

1. Your Seed

54 |
55 |
56 | 57 |
58 |
59 | 60 |
61 | 62 | 63 | Before proceeding you need to enter your seed. Your seed can only contain upper case latin characters and the number 9. 64 | 65 |
66 | 67 |
68 |
69 |
70 |
71 |
72 |
73 | 74 | 75 |
76 |
77 |
78 |

2. Read about the Options

79 |
80 |
81 | 82 |
83 |

Key Index

84 |

The key index is probably the most important option, as it determines which private key will be used for the address. The key index starts at 0 and can be incremented. Needless to say, a different key index gives you a completely different address

85 |
86 | 87 |
88 |

Security

89 |

In IOTA there are 3 security levels to choose from. Low tier (81-trit security), Mid tier (162-trit security) and High tier (243-trit security). It basically determines how much effort is put up in generating (i.e. hashing) your address.

90 |
91 | 92 |
93 |

Checksum

94 |

A checksum is an extra security check which ensures that the generated address is correct and was not altered in any form. A checksum in IOTA is an extra 9-characters (or trytes) which are added to the address

95 |
96 | 97 |
98 |

Deterministic

99 |

Generating addresses deterministically simplifies the key index management for users. It automatically increments the key index during the generation process in case your address was used in a transaction. In order to use this feature you need to have a connected node

100 |
101 |
102 |
103 | 104 | 105 |
106 |
107 |
108 |

3. Select your Options

109 |
110 |
111 | 112 |
113 | 114 |

Key Index

115 | 116 |
117 | 118 |
119 | 120 |
121 | 122 | 123 |
124 |
125 |

Select Security Level

126 | 131 |
132 |
133 | 134 | 135 |
136 |
137 | 142 |
143 |
144 | 145 | 146 |
147 | 148 | 149 |
150 | 151 | 156 | 157 |
158 | 159 |
160 | 161 |
162 | 163 |
164 | 165 | 166 |
167 | 168 |
169 | 170 |
171 |

4. Generate Address

172 |
173 |
174 | 175 |
176 |
177 | 178 | 179 | 180 | 181 |
182 |
183 |
184 | 185 |
186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) 3 | * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");+function(t){var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(jQuery),+function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;nthis._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(m.SLID,function(){return n.to(e)});if(i===e)return this.pause(),void this.cycle();var o=e>i?p.NEXT:p.PREVIOUS;this._slide(o,this._items[e])}},h.prototype.dispose=function(){t(this._element).off(l),t.removeData(this._element,a),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},h.prototype._getConfig=function(n){return n=t.extend({},_,n),r.typeCheckConfig(e,n,g),n},h.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(m.KEYDOWN,function(t){return e._keydown(t)}),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||t(this._element).on(m.MOUSEENTER,function(t){return e.pause(t)}).on(m.MOUSELEAVE,function(t){return e.cycle(t)})},h.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case d:t.preventDefault(),this.prev();break;case f:t.preventDefault(),this.next();break;default:return}},h.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(v.ITEM)),this._items.indexOf(e)},h.prototype._getItemByDirection=function(t,e){var n=t===p.NEXT,i=t===p.PREVIOUS,o=this._getItemIndex(e),r=this._items.length-1,s=i&&0===o||n&&o===r;if(s&&!this._config.wrap)return e;var a=t===p.PREVIOUS?-1:1,l=(o+a)%this._items.length;return l===-1?this._items[this._items.length-1]:this._items[l]},h.prototype._triggerSlideEvent=function(e,n){var i=t.Event(m.SLIDE,{relatedTarget:e,direction:n});return t(this._element).trigger(i),i},h.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(v.ACTIVE).removeClass(E.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(E.ACTIVE)}},h.prototype._slide=function(e,n){var i=this,o=t(this._element).find(v.ACTIVE_ITEM)[0],s=n||o&&this._getItemByDirection(e,o),a=Boolean(this._interval),l=void 0,h=void 0,c=void 0;if(e===p.NEXT?(l=E.LEFT,h=E.NEXT,c=p.LEFT):(l=E.RIGHT,h=E.PREV,c=p.RIGHT),s&&t(s).hasClass(E.ACTIVE))return void(this._isSliding=!1);var d=this._triggerSlideEvent(s,c);if(!d.isDefaultPrevented()&&o&&s){this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s);var f=t.Event(m.SLID,{relatedTarget:s,direction:c});r.supportsTransitionEnd()&&t(this._element).hasClass(E.SLIDE)?(t(s).addClass(h),r.reflow(s),t(o).addClass(l),t(s).addClass(l),t(o).one(r.TRANSITION_END,function(){t(s).removeClass(l+" "+h).addClass(E.ACTIVE),t(o).removeClass(E.ACTIVE+" "+h+" "+l),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(f)},0)}).emulateTransitionEnd(u)):(t(o).removeClass(E.ACTIVE),t(s).addClass(E.ACTIVE),this._isSliding=!1,t(this._element).trigger(f)),a&&this.cycle()}},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o=t.extend({},_,t(this).data());"object"===("undefined"==typeof e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new h(this,o),t(this).data(a,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},h._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(E.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),s=this.getAttribute("data-slide-to");s&&(o.interval=!1),h._jQueryInterface.call(t(i),o),s&&t(i).data(a).to(s),e.preventDefault()}}},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return _}}]),h}();return t(document).on(m.CLICK_DATA_API,v.DATA_SLIDE,T._dataApiClickHandler),t(window).on(m.LOAD_DATA_API,function(){t(v.DATA_RIDE).each(function(){var e=t(this);T._jQueryInterface.call(e,e.data())})}),t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=c,T._jQueryInterface},T}(jQuery),function(t){var e="collapse",s="4.0.0-alpha.6",a="bs.collapse",l="."+a,h=".data-api",c=t.fn[e],u=600,d={toggle:!0,parent:""},f={toggle:"boolean",parent:"string"},_={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+h},g={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},p={WIDTH:"width",HEIGHT:"height"},m={ACTIVES:".card > .show, .card > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},E=function(){function l(e,i){n(this,l),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],'+('[data-toggle="collapse"][data-target="#'+e.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return l.prototype.toggle=function(){t(this._element).hasClass(g.SHOW)?this.hide():this.show()},l.prototype.show=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(!t(this._element).hasClass(g.SHOW)){var n=void 0,i=void 0;if(this._parent&&(n=t.makeArray(t(this._parent).find(m.ACTIVES)),n.length||(n=null)),!(n&&(i=t(n).data(a),i&&i._isTransitioning))){var o=t.Event(_.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(l._jQueryInterface.call(t(n),"hide"),i||t(n).data(a,null));var s=this._getDimension();t(this._element).removeClass(g.COLLAPSE).addClass(g.COLLAPSING),this._element.style[s]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&t(this._triggerArray).removeClass(g.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).addClass(g.SHOW),e._element.style[s]="",e.setTransitioning(!1),t(e._element).trigger(_.SHOWN)};if(!r.supportsTransitionEnd())return void h();var c=s[0].toUpperCase()+s.slice(1),d="scroll"+c;t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(u),this._element.style[s]=this._element[d]+"px"}}}},l.prototype.hide=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(t(this._element).hasClass(g.SHOW)){var n=t.Event(_.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),o=i===p.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[o]+"px",r.reflow(this._element),t(this._element).addClass(g.COLLAPSING).removeClass(g.COLLAPSE).removeClass(g.SHOW),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&t(this._triggerArray).addClass(g.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var s=function(){e.setTransitioning(!1),t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).trigger(_.HIDDEN)};return this._element.style[i]="",r.supportsTransitionEnd()?void t(this._element).one(r.TRANSITION_END,s).emulateTransitionEnd(u):void s()}}},l.prototype.setTransitioning=function(t){this._isTransitioning=t},l.prototype.dispose=function(){t.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},l.prototype._getConfig=function(n){return n=t.extend({},d,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,f),n},l.prototype._getDimension=function(){var e=t(this._element).hasClass(p.WIDTH);return e?p.WIDTH:p.HEIGHT},l.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(l._getTargetFromElement(n),[n])}),n},l.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(g.SHOW);e.setAttribute("aria-expanded",i),n.length&&t(n).toggleClass(g.COLLAPSED,!i).attr("aria-expanded",i)}},l._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},l._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(a),r=t.extend({},d,n.data(),"object"===("undefined"==typeof e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new l(this,r),n.data(a,o)),"string"==typeof e){if(void 0===o[e])throw new Error('No method named "'+e+'"');o[e]()}})},o(l,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}}]),l}();return t(document).on(_.CLICK_DATA_API,m.DATA_TOGGLE,function(e){e.preventDefault();var n=E._getTargetFromElement(this),i=t(n).data(a),o=i?"toggle":t(this).data();E._jQueryInterface.call(t(n),o)}),t.fn[e]=E._jQueryInterface,t.fn[e].Constructor=E,t.fn[e].noConflict=function(){return t.fn[e]=c,E._jQueryInterface},E}(jQuery),function(t){var e="dropdown",i="4.0.0-alpha.6",s="bs.dropdown",a="."+s,l=".data-api",h=t.fn[e],c=27,u=38,d=40,f=3,_={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click"+a+l,FOCUSIN_DATA_API:"focusin"+a+l,KEYDOWN_DATA_API:"keydown"+a+l},g={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",SHOW:"show"},p={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},m=function(){function e(t){n(this,e),this._element=t,this._addEventListeners()}return e.prototype.toggle=function(){if(this.disabled||t(this).hasClass(g.DISABLED))return!1;var n=e._getParentFromElement(this),i=t(n).hasClass(g.SHOW);if(e._clearMenus(),i)return!1;if("ontouchstart"in document.documentElement&&!t(n).closest(p.NAVBAR_NAV).length){var o=document.createElement("div");o.className=g.BACKDROP,t(o).insertBefore(this),t(o).on("click",e._clearMenus)}var r={relatedTarget:this},s=t.Event(_.SHOW,r);return t(n).trigger(s),!s.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded",!0),t(n).toggleClass(g.SHOW),t(n).trigger(t.Event(_.SHOWN,r)),!1)},e.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null},e.prototype._addEventListeners=function(){t(this._element).on(_.CLICK,this.toggle)},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(s);if(i||(i=new e(this),t(this).data(s,i)),"string"==typeof n){if(void 0===i[n])throw new Error('No method named "'+n+'"');i[n].call(this)}})},e._clearMenus=function(n){if(!n||n.which!==f){var i=t(p.BACKDROP)[0];i&&i.parentNode.removeChild(i);for(var o=t.makeArray(t(p.DATA_TOGGLE)),r=0;r0&&a--,n.which===d&&adocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth=n){var i=this._targets[this._targets.length-1];return void(this._activeTarget!==i&&this._activate(i))}if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){var r=this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t "+g.NAV_LINKS).addClass(_.ACTIVE),t(this._scrollElement).trigger(f.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(_.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e; 7 | if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}}]),h}();return t(window).on(f.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);m._jQueryInterface.call(i,i.data())}}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=c,m._jQueryInterface},m}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],c=150,u={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},d={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},f={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},_=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(d.ACTIVE)||t(this._element).hasClass(d.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(f.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(f.ACTIVE)),i=i[i.length-1]);var a=t.Event(u.HIDE,{relatedTarget:this._element}),l=t.Event(u.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(u.HIDDEN,{relatedTarget:e._element}),o=t.Event(u.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(f.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(d.FADE)||Boolean(t(n).find(f.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(c):l(),s&&t(s).removeClass(d.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(d.ACTIVE);var s=t(n.parentNode).find(f.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(d.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(d.SHOW)):t(e).removeClass(d.FADE),e.parentNode&&t(e.parentNode).hasClass(d.DROPDOWN_MENU)){var a=t(e).closest(f.DROPDOWN)[0];a&&t(a).find(f.DROPDOWN_TOGGLE).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();return t(document).on(u.CLICK_DATA_API,f.DATA_TOGGLE,function(e){e.preventDefault(),_._jQueryInterface.call(t(this),"show")}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface},_}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],c=150,u="bs-tether",d={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},f={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},_={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},p={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},m={FADE:"fade",SHOW:"show"},E={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},v={element:!1,enabled:!1},T={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},I=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(m.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(m.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),c=this.config.container===!1?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:v,classPrefix:u,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(m.SHOW);var d=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,d).emulateTransitionEnd(h._TRANSITION_DURATION);d()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(m.SHOW),this._activeTrigger[T.CLICK]=!1,this._activeTrigger[T.FOCUS]=!1,this._activeTrigger[T.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(c)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(E.TOOLTIP_INNER),this.getTitle()),e.removeClass(m.FADE+" "+m.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===("undefined"==typeof n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return _[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this,n=this.config.trigger.split(" ");n.forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==T.MANUAL){var i=n===T.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===T.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T.FOCUS:T.HOVER]=!0),t(n.getTipElement()).hasClass(m.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T.FOCUS:T.HOVER]=!1),!n._isWithActiveTrigger())return clearTimeout(n._timeout),n._hoverState=g.OUT,n.config.delay&&n.config.delay.hide?void(n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)):void n.hide()},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return f}}]),h}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=h,I._jQueryInterface},I}(jQuery));(function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",c="."+h,u=r.fn[a],d=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),f=r.extend({},s.DefaultType,{content:"(string|element|function)"}),_={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},p={HIDE:"hide"+c,HIDDEN:"hidden"+c,SHOW:"show"+c,SHOWN:"shown"+c,INSERTED:"inserted"+c,CLICK:"click"+c,FOCUSIN:"focusin"+c,FOCUSOUT:"focusout"+c,MOUSEENTER:"mouseenter"+c,MOUSELEAVE:"mouseleave"+c},m=function(s){function u(){return n(this,u),t(this,s.apply(this,arguments))}return e(u,s),u.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},u.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},u.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},u.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},u._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===("undefined"==typeof t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new u(this,n),r(this).data(h,e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(u,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return c}},{key:"DefaultType",get:function(){return f}}]),u}(s);return r.fn[a]=m._jQueryInterface,r.fn[a].Constructor=m,r.fn[a].noConflict=function(){return r.fn[a]=u,m._jQueryInterface},m})(jQuery)}(); -------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | var iota = new IOTA({ 4 | // Host and provider are only needed if the user intends to generate the address deterministically 5 | 'host': 'http://localhost', 6 | 'port': 14265 7 | }) 8 | 9 | var seed; 10 | 11 | // 12 | // Properly formats the seed, replacing all non-latin chars with 9's 13 | // And extending it to length 81 14 | // 15 | function setSeed(value) { 16 | 17 | seed = ""; 18 | var value = value.toUpperCase(); 19 | 20 | for (var i = 0; i < value.length; i++) { 21 | if (("9ABCDEFGHIJKLMNOPQRSTUVWXYZ").indexOf(value.charAt(i)) < 0) { 22 | seed += "9"; 23 | } else { 24 | seed += value.charAt(i); 25 | } 26 | } 27 | } 28 | 29 | 30 | // 31 | // Save Seed 32 | // 33 | $("#saveSeed").on("click", function() { 34 | 35 | // We modify the entered seed to fit the criteria of all uppercase and only latin letters 36 | setSeed($("#userSeed").val()); 37 | 38 | // Set the modified seed value as placeholder 39 | $('#userSeed').prop('value', seed); 40 | 41 | // Disable the seed input 42 | $('#userSeed').prop('disabled', true); 43 | 44 | // Then we remove the warning 45 | $("#seedInputForm").removeClass('has-warning').addClass('has-success'); 46 | 47 | }) 48 | 49 | // 50 | // Save Seed 51 | // 52 | $("#generateAddress").on("click", function() { 53 | 54 | var options = {} 55 | 56 | // Get all the respective values from the user 57 | options.index = parseInt($("#keyIndex").val()); 58 | options.security = parseInt($("#security :selected").text()); 59 | options.checksum = $("#checksum:checked").val() === 'on'; 60 | var deterministic = $("#deterministic:checked").val() === 'on'; 61 | 62 | // If the user does not want to generate the address deterministically 63 | // generate a total of 1 addresses 64 | if (!deterministic) { 65 | options.total = 1; 66 | } 67 | 68 | // if no seed, negative key index, return 69 | if ( !seed || options.index < 0 ) 70 | return 71 | 72 | console.log("YOUR CHOSEN OPTIONS: ", options) 73 | 74 | // Generate a new address according to the user inputs 75 | iota.api.getNewAddress( seed, options, function( e, address ) { 76 | 77 | if (e) { 78 | throw e; 79 | } 80 | 81 | // Set the address as placeholder 82 | $('#finalAddress').prop( 'value', address ); 83 | 84 | }) 85 | }) 86 | 87 | }) 88 | -------------------------------------------------------------------------------- /js/iota.js: -------------------------------------------------------------------------------- 1 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0),g+=1,c.length>0},function(a,d){if(a)return c(a);var e=b.returnAll?k:d;return c(null,e)})},m.prototype.getInputs=function(a,b,c){function n(a){d.getBalances(a,100,function(b,d){if(b)return c(b);for(var e={inputs:[],totalBalance:0},f=!i,h=0;h0){var l={address:a[h],balance:k,keyIndex:g+h,security:j};if(e.inputs.push(l),e.totalBalance+=k,i&&e.totalBalance>=i){f=!0;break}}}return f?c(null,e):c(new Error("Not enough balance"))})}var d=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(b)&&(c=b,b={}),!f.isTrytes(a))return c(e.invalidSeed());var g=b.start||0,h=b.end||null,i=b.threshold||null,j=b.security||2;if(g>h||h>g+500)return c(new Error("Invalid inputs provided"));if(h){for(var k=[],l=g;l=c){var i=e-c;i>0&&l?(o.addEntry(1,l,i,r,h),B(b)):i>0?g.getNewAddress(a,{security:n},function(a,c){var d=Math.floor(Date.now()/1e3);o.addEntry(1,c,i,r,d),B(b)}):B(b)}else c-=e}}function B(b){o.finalize(),o.addTrytes(q);for(var c=0;c2187){t+=Math.floor(b[s].message.length/2187);for(var u=b[s].message;u;){var v=u.slice(0,2187);u=u.slice(2187,u.length);for(var w=0;v.length<2187;w++)v+="9";q.push(v)}}else{var v="";b[s].message&&(v=b[s].message.slice(0,2187));for(var w=0;v.length<2187;w++)v+="9";q.push(v)}var x=Math.floor(Date.now()/1e3);r=b[s].tag?b[s].tag:"999999999999999999999999999";for(var w=0;r.length<27;w++)r+="9";o.addEntry(t,b[s].address,b[s].value,r,x),p+=parseInt(b[s].value)}if(!p){o.finalize(),o.addTrytes(q);var z=[];return o.bundle.forEach(function(a){z.push(k.transactionTrytes(a))}),d(null,z.reverse())}if(c.inputs){var y=[];c.inputs.forEach(function(a){y.push(a.address)}),g.getBalances(y,100,function(a,b){for(var e=[],f=0,g=0;g0){f+=h;var i=c.inputs[g];if(i.balance=h,e.push(i),f>=p)break}}return p>f?d(new Error("Not enough balance")):void A(e)})}else g.getInputs(a,{threshold:p,security:n},function(a,b){return a?d(a):void A(b.inputs)})},m.prototype.traverseBundle=function(a,b,c,d){var e=this;e.getTrytes(Array(a),function(a,f){if(a)return d(a);var g=f[0];if(!g)return d(new Error("Bundle transactions not visible"));var h=k.transactionObject(g);if(!h)return d(new Error("Invalid trytes, could not create object"));if(!b&&0!==h.currentIndex)return d(new Error("Invalid tail transaction supplied."));if(b||(b=h.bundle),b!==h.bundle)return d(null,c);if(0===h.lastIndex&&0===h.currentIndex)return d(null,Array(h));var i=h.trunkTransaction;return c.push(h),e.traverseBundle(i,b,c,d)})},m.prototype.getBundle=function(a,b){var c=this;return f.isHash(a)?void c.traverseBundle(a,null,Array(),function(a,c){return a?b(a):k.isBundle(c)?b(null,c):b(new Error("Invalid Bundle provided"))}):b(e.invalidInputs(a))},m.prototype._bundlesFromAddresses=function(a,b,c){var d=this;d.findTransactionObjects({addresses:a},function(a,e){if(a)return c(a);var f=new Set,g=new Set;e.forEach(function(a){0===a.currentIndex?f.add(a.hash):g.add(a.bundle)}),d.findTransactionObjects({bundles:Array.from(g)},function(a,e){if(a)return c(a);e.forEach(function(a){0===a.currentIndex&&f.add(a.hash)});var g=[],h=Array.from(f);l.waterfall([function(a){b?d.getLatestInclusion(h,function(b,d){return b?c(b):void a(null,d)}):a(null,[])},function(a,e){l.mapSeries(h,function(c,e){d.getBundle(c,function(d,f){if(!d){if(b){var i=a[h.indexOf(c)];f.forEach(function(a){a.persistence=i})}g.push(f)}e(null,!0)})},function(a,b){return g.sort(function(a,b){var c=parseInt(a[0].timestamp),d=parseInt(b[0].timestamp);return cd?1:0}),c(a,g)})}])})})},m.prototype.getTransfers=function(a,b,c){var d=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(b)&&(c=b,b={}),!f.isTrytes(a))return c(e.invalidSeed(a));var g=b.start||0,h=b.end||null,i=b.inclusionStates||null,j=b.security||2;if(g>h||h>g+500)return c(new Error("Invalid inputs provided"));var k={index:g,total:h?h-g:null,returnAll:!0,security:j};d.getNewAddress(a,k,function(a,b){return a?c(a):d._bundlesFromAddresses(b,i,c)})},m.prototype.getAccountData=function(a,b,c){var d=this;if(2===arguments.length&&"[object Function]"===Object.prototype.toString.call(b)&&(c=b,b={}),!f.isTrytes(a))return c(e.invalidSeed(a));var g=b.start||0,h=b.end||null,i=b.security||2;if(g>h||h>g+500)return c(new Error("Invalid inputs provided"));var j={addresses:[],transfers:[],balance:0},k={index:g,total:h?h-g:null,returnAll:!0,security:i};d.getNewAddress(a,k,function(a,b){return a?c(a):(j.addresses=b.slice(0,-1),void d._bundlesFromAddresses(b,!0,function(a,b){return a?c(a):(j.transfers=b,void d.getBalances(j.addresses,100,function(a,b){return b.balances.forEach(function(a){j.balance+=parseInt(a)}),c(null,j)}))}))})},m.prototype.shouldYouReplay=function(a){var b=this,a=k.noChecksum(a);b.findTransactions({address:a},function(a,c){b.getTrytes(c,function(a,c){var d=[];return c.forEach(function(a){var b=k.transactionObject(c);b.value<0&&d.push(b.hash)}),!(d.length>0)||void b.getLatestInclusion(d,function(a,b){return b.indexOf(!0)===-1})})})},b.exports=m},{"../crypto/bundle":4,"../crypto/converter":5,"../crypto/curl":6,"../crypto/signing":7,"../errors/inputErrors":8,"../utils/inputValidator":14,"../utils/utils":16,"./apiCommands":3,async:17}],3:[function(a,b,c){var d=function(a,b,c,d){var e={command:"attachToTangle",trunkTransaction:a,branchTransaction:b,minWeightMagnitude:c,trytes:d};return e},e=function(a){var b={command:"findTransactions"},c=Object.keys(a);return c.forEach(function(c){b[c]=a[c]}),b},f=function(a,b){var c={command:"getBalances",addresses:a,threshold:b};return c},g=function(a,b){var c={command:"getInclusionStates",transactions:a,tips:b};return c},h=function(){var a={command:"getNodeInfo"};return a},i=function(){var a={command:"getNeighbors"};return a},j=function(a){var b={command:"addNeighbors",uris:a};return b},k=function(a){var b={command:"removeNeighbors",uris:a};return b},l=function(){var a={command:"getTips"};return a},m=function(a){var b={command:"getTransactionsToApprove",depth:a};return b},n=function(a){var b={command:"getTrytes",hashes:a};return b},o=function(){var a={command:"interruptAttachingToTangle"};return a},p=function(a){var b={command:"broadcastTransactions",trytes:a};return b},q=function(a){var b={command:"storeTransactions",trytes:a};return b};b.exports={attachToTangle:d,findTransactions:e,getBalances:f,getInclusionStates:g,getNodeInfo:h,getNeighbors:i,addNeighbors:j,removeNeighbors:k,getTips:l,getTransactionsToApprove:m,getTrytes:n,interruptAttachingToTangle:o,broadcastTransactions:p,storeTransactions:q}},{}],4:[function(a,b,c){function f(){this.bundle=[]}var d=a("./curl"),e=a("./converter");f.prototype.addEntry=function(a,b,c,d,e,f){for(var g=0;g=0){for(;d-- >0;)for(var f=0;f<27;f++)if(b[27*c+f]>-13){b[27*c+f]--;break}}else for(;d++<0;)for(var f=0;f<27;f++)if(b[27*c+f]<13){b[27*c+f]++;break}}return b},b.exports=f},{"./converter":5,"./curl":6}],5:[function(a,b,c){var d="9ABCDEFGHIJKLMNOPQRSTUVWXYZ",e=[[0,0,0],[1,0,0],[-1,1,0],[0,1,0],[1,1,0],[-1,-1,1],[0,-1,1],[1,-1,1],[-1,0,1],[0,0,1],[1,0,1],[-1,1,1],[0,1,1],[1,1,1],[-1,-1,-1],[0,-1,-1],[1,-1,-1],[-1,0,-1],[0,0,-1],[1,0,-1],[-1,1,-1],[0,1,-1],[1,1,-1],[-1,-1,0],[0,-1,0],[1,-1,0],[-1,0,0]],f=function(a,b){var c=b||[];if(Number.isInteger(a)){for(var f=a<0?-a:a;f>0;){var g=f%3;f=Math.floor(f/3),g>1&&(g=-1,f++),c[c.length]=g}if(a<0)for(var h=0;h0;)b=3*b+a[c];return b};b.exports={trits:f,trytes:g,value:h}},{}],6:[function(a,b,c){function e(){this.truthTable=[1,0,-1,1,-1,0,-1,1,0]}a("./converter");e.prototype.initialize=function(a){if(a)this.state=a;else{this.state=[];for(var b=0;b<729;b++)this.state[b]=0}},e.prototype.absorb=function(a){for(var b=0;b1;g++)e[g]=-1;var h=new d;h.initialize(),h.absorb(e),h.squeeze(e),h.initialize(),h.absorb(e);for(var i=[],j=0,k=[];c-- >0;)for(var f=0;f<27;f++){h.squeeze(k);for(var g=0;g<243;g++)i[j++]=k[g]}return i},h=function(a){for(var b=[],c=[],e=0;e0;){var h=new d;h.initialize(),h.absorb(c),h.squeeze(c)}e.absorb(c)}return e.squeeze(c),c},k=function(a,b){for(var c=b.slice(),e=[],f=new d,g=0;g<27;g++){e=c.slice(243*g,243*(g+1));for(var h=0;h<13-a[g];h++)f.initialize(),f.absorb(e),f.squeeze(e);for(var h=0;h<243;h++)c[243*g+h]=e[h]}return c},l=function(a,b,c){for(var d=this,g=new f,h=[],i=g.normalizedBundle(c),k=0;k<3;k++)h[k]=i.slice(27*k,27*(k+1));for(var l=[],k=0;k2187){p+=Math.floor(d[o].message.length/2187);for(var q=d[o].message;q;){var r=q.slice(0,2187);q=q.slice(2187,q.length);for(var s=0;r.length<2187;s++)r+="9";m.push(r)}}else{var r="";d[o].message&&(r=d[o].message.slice(0,2187));for(var s=0;r.length<2187;s++)r+="9";m.push(r)}var t=Math.floor(Date.now()/1e3);n=d[o].tag?d[o].tag:"999999999999999999999999999";for(var s=0;n.length<27;s++)n+="9";k.addEntry(p,d[o].address.slice(0,81),d[o].value,n,t),l+=parseInt(d[o].value)}if(!l)return e(new Error("Invalid value transfer: the transfer does not require a signature."));var u={command:"getBalances",addresses:new Array(b),threshold:100};f._makeRequest.send(u,function(d,f){var g=parseInt(f.balances[0]);if(g>0){var h=0-g,i=Math.floor(Date.now()/1e3);k.addEntry(a,b,h,n,i)}if(l>g)return e(new Error("Not enough balance."));if(g>l){var j=g-l;if(!c)return e(new Error("No remainder address defined"));k.addEntry(1,c,j,n,i)}return k.finalize(),k.addTrytes(m),e(null,k.bundle)})},k.prototype.addSignature=function(a,b,c,f){var h=new g;h.bundle=a;for(var j=c.length/2187,c=e.trits(c),k=0,l=0;l255)return null;var g=f%27,h=(f-g)/27,i=b[g]+b[h];c+=i}return c}function e(a){if("string"!=typeof a)return null;for(var b="9ABCDEFGHIJKLMNOPQRSTUVWXYZ",c="",d=0;d-1){var g=e.currentIndex===e.lastIndex&&0!==e.lastIndex;e.value<0&&!d&&!g?(c.sent.push(a),d=!0):e.value>=0&&!d&&!g&&c.received.push(a)}})}),c},s=function(a,b){for(var c,e=[],f=0;f-1&&a%1==0&&a<=H}function J(a){return null!=a&&I(a.length)&&!G(a)}function L(){}function M(a){return function(){if(null!==a){var b=a;a=null,b.apply(this,arguments)}}}function P(a,b){for(var c=-1,d=Array(a);++c-1&&a%1==0&&ae?0:e+b),c=c>e?e:c,c<0&&(c+=e),e=b>c?0:c-b>>>0,b>>>=0;for(var f=Array(e);++d=d?a:Ib(a,b,c)}function Kb(a,b){for(var c=a.length;c--&&zb(b,a[c],0)>-1;);return c}function Lb(a,b){for(var c=-1,d=a.length;++c-1;);return c}function Mb(a){return a.split("")}function Vb(a){return Ub.test(a)}function oc(a){return a.match(nc)||[]}function pc(a){return Vb(a)?oc(a):Mb(a)}function qc(a){return null==a?"":Hb(a)}function sc(a,b,c){if(a=qc(a),a&&(c||void 0===b))return a.replace(rc,"");if(!a||!(b=Hb(b)))return a;var d=pc(a),e=pc(b),f=Lb(d,e),g=Kb(d,e)+1;return Jb(d,f,g).join("")}function xc(a){return a=a.toString().replace(wc,""),a=a.match(tc)[2].replace(" ",""),a=a?a.split(uc):[],a=a.map(function(a){return sc(a.replace(vc,""))})}function yc(a,b){var c={};vb(a,function(a,b){function e(b,c){var e=Bb(d,function(a){return b[a]});e.push(c),a.apply(null,e)}var d;if(X(a))d=a.slice(0,-1),a=a[a.length-1],c[b]=d.concat(d.length>0?e:a);else if(1===a.length)c[b]=a;else{if(d=xc(a),0===a.length&&0===d.length)throw new Error("autoInject task functions require explicit parameters.");d.pop(),c[b]=d.concat(e)}}),Ab(c,b)}function Bc(a){setTimeout(a,0)}function Cc(a){return i(function(b,c){a(function(){b.apply(null,c)})})}function Fc(){this.head=this.tail=null,this.length=0}function Gc(a,b){a.length=1,a.head=a.tail=b}function Hc(a,b,c){function d(a,b,c){if(null!=c&&"function"!=typeof c)throw new Error("task callback must be a function");if(j.started=!0,X(a)||(a=[a]),0===a.length&&j.idle())return Ec(function(){j.drain()});for(var d=0,e=a.length;d=0&&g.splice(h),e.callback.apply(e,b),null!=b[0]&&j.error(b[0],e.data)}f<=j.concurrency-j.buffer&&j.unsaturated(),j.idle()&&j.drain(),j.process()})}if(null==b)b=1;else if(0===b)throw new Error("Concurrency must not be zero");var f=0,g=[],h=!1,j={_tasks:new Fc,concurrency:b,payload:c,saturated:L,unsaturated:L,buffer:b/4,empty:L,drain:L,error:L,started:!1,paused:!1,push:function(a,b){d(a,!1,b)},kill:function(){j.drain=L,j._tasks.empty()},unshift:function(a,b){d(a,!0,b)},process:function(){if(!h){for(h=!0;!j.paused&&f1&&(e=c),d(null,{value:e})}})),a.apply(this,c)})}function Jd(a,b,c,d){nd(a,b,function(a,b){c(a,function(a,c){b(a,!c)})},d)}function Ld(a){var b;return X(a)?b=Bb(a,Id):(b={},vb(a,function(a,c){b[c]=Id.call(this,a)})),b}function Od(a){return function(){return a}}function Pd(a,b,c){function g(a,b){if("object"==typeof b)a.times=+b.times||d,a.intervalFunc="function"==typeof b.interval?b.interval:Od(+b.interval||e),a.errorFilter=b.errorFilter;else{if("number"!=typeof b&&"string"!=typeof b)throw new Error("Invalid arguments for async.retry");a.times=+b||d}}function i(){b(function(a){a&&h++d?1:0}kb(a,function(a,c){b(a,function(b,d){return b?c(b):void c(null,{value:a,criteria:d})})},function(a,b){return a?c(a):void c(null,Bb(b.sort(d),kd("value")))})}function Wd(a,b,c){function g(){f||(d.apply(null,arguments),clearTimeout(e))}function h(){var b=a.name||"anonymous",e=new Error('Callback function "'+b+'" timed out.');e.code="ETIMEDOUT",c&&(e.info=c),f=!0,d(e)}var d,e,f=!1;return j(function(c,f){d=f,e=setTimeout(h,b),a.apply(null,c.concat(g))})}function Zd(a,b,c,d){for(var e=-1,f=Yd(Xd((b-a)/(c||1)),0),g=Array(f);f--;)g[d?f:++e]=a,a+=c;return g}function $d(a,b,c,d){nb(Zd(0,a,1),b,c,d)}function be(a,b,c,d){3===arguments.length&&(d=c,c=b,b=X(a)?[]:{}),d=M(d||L),hb(a,function(a,d,e){c(b,a,d,e)},function(a){d(a,b)})}function ce(a){return function(){return(a.unmemoized||a).apply(null,arguments)}}function de(a,b,c){if(c=bb(c||L),!a())return c(null);var d=i(function(e,f){return e?c(e):a()?b(d):void c.apply(null,[null].concat(f))});b(d)}function ee(a,b,c){de(function(){return!a.apply(this,arguments)},b,c)}var f=Math.max,j=function(a){return i(function(b){var c=b.pop();a.call(this,b,c)})},l="object"==typeof d&&d&&d.Object===Object&&d,m="object"==typeof self&&self&&self.Object===Object&&self,n=l||m||Function("return this")(),o=n.Symbol,p=Object.prototype,q=p.hasOwnProperty,r=p.toString,s=o?o.toStringTag:void 0,u=Object.prototype,v=u.toString,x="[object Null]",y="[object Undefined]",z=o?o.toStringTag:void 0,C="[object AsyncFunction]",D="[object Function]",E="[object GeneratorFunction]",F="[object Proxy]",H=9007199254740991,K={},N="function"==typeof Symbol&&Symbol.iterator,O=function(a){return N&&a[N]&&a[N]()},R="[object Arguments]",T=Object.prototype,U=T.hasOwnProperty,V=T.propertyIsEnumerable,W=S(function(){return arguments}())?S:function(a){return Q(a)&&U.call(a,"callee")&&!V.call(a,"callee")},X=Array.isArray,Z="object"==typeof c&&c&&!c.nodeType&&c,$=Z&&"object"==typeof b&&b&&!b.nodeType&&b,_=$&&$.exports===Z,aa=_?n.Buffer:void 0,ba=aa?aa.isBuffer:void 0,ca=ba||Y,da=9007199254740991,ea=/^(?:0|[1-9]\d*)$/,ga="[object Arguments]",ha="[object Array]",ia="[object Boolean]",ja="[object Date]",ka="[object Error]",la="[object Function]",ma="[object Map]",na="[object Number]",oa="[object Object]",pa="[object RegExp]",qa="[object Set]",ra="[object String]",sa="[object WeakMap]",ta="[object ArrayBuffer]",ua="[object DataView]",va="[object Float32Array]",wa="[object Float64Array]",xa="[object Int8Array]",ya="[object Int16Array]",za="[object Int32Array]",Aa="[object Uint8Array]",Ba="[object Uint8ClampedArray]",Ca="[object Uint16Array]",Da="[object Uint32Array]",Ea={};Ea[va]=Ea[wa]=Ea[xa]=Ea[ya]=Ea[za]=Ea[Aa]=Ea[Ba]=Ea[Ca]=Ea[Da]=!0,Ea[ga]=Ea[ha]=Ea[ta]=Ea[ia]=Ea[ua]=Ea[ja]=Ea[ka]=Ea[la]=Ea[ma]=Ea[na]=Ea[oa]=Ea[pa]=Ea[qa]=Ea[ra]=Ea[sa]=!1;var Dc,Ha="object"==typeof c&&c&&!c.nodeType&&c,Ia=Ha&&"object"==typeof b&&b&&!b.nodeType&&b,Ja=Ia&&Ia.exports===Ha,Ka=Ja&&l.process,La=function(){try{return Ka&&Ka.binding&&Ka.binding("util")}catch(a){}}(),Ma=La&&La.isTypedArray,Na=Ma?Ga(Ma):Fa,Oa=Object.prototype,Pa=Oa.hasOwnProperty,Ra=Object.prototype,Ua=Ta(Object.keys,Object),Va=Object.prototype,Wa=Va.hasOwnProperty,gb=eb(db,1/0),hb=function(a,b,c){var d=J(a)?fb:gb;d(a,b,c)},kb=ib(jb),lb=k(kb),nb=mb(jb),ob=eb(nb,1),pb=k(ob),qb=i(function(a,b){return i(function(c){return a.apply(null,b.concat(c))})}),ub=tb(),Ab=function(a,b,c){function n(a,b){k.push(function(){r(a,b)})}function o(){if(0===k.length&&0===g)return c(null,f);for(;k.length&&g1?e(f,d):e(d)}}function s(){for(var a,b=0;l.length;)a=l.pop(),b++,sb(t(a),function(a){0===--m[a]&&l.push(a)});if(b!==e)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function t(b){var c=[];return vb(a,function(a,d){X(a)&&zb(a,b,0)>=0&&c.push(d)}),c}"function"==typeof b&&(c=b,b=null),c=M(c||L);var d=Ya(a),e=d.length;if(!e)return c(null);b||(b=e);var f={},g=0,h=!1,j=Object.create(null),k=[],l=[],m={};vb(a,function(b,c){if(!X(b))return n(c,[b]),void l.push(c);var d=b.slice(0,b.length-1),e=d.length;return 0===e?(n(c,b),void l.push(c)):(m[c]=e,void sb(d,function(f){if(!a[f])throw new Error("async.auto task `"+c+"` has a non-existent dependency `"+f+"` in "+d.join(", "));p(f,function(){e--,0===e&&n(c,b)})}))}),s(),o()},Cb="[object Symbol]",Eb=1/0,Fb=o?o.prototype:void 0,Gb=Fb?Fb.toString:void 0,Nb="\\ud800-\\udfff",Ob="\\u0300-\\u036f",Pb="\\ufe20-\\ufe2f",Qb="\\u20d0-\\u20ff",Rb=Ob+Pb+Qb,Sb="\\ufe0e\\ufe0f",Tb="\\u200d",Ub=RegExp("["+Tb+Nb+Rb+Sb+"]"),Wb="\\ud800-\\udfff",Xb="\\u0300-\\u036f",Yb="\\ufe20-\\ufe2f",Zb="\\u20d0-\\u20ff",$b=Xb+Yb+Zb,_b="\\ufe0e\\ufe0f",ac="["+Wb+"]",bc="["+$b+"]",cc="\\ud83c[\\udffb-\\udfff]",dc="(?:"+bc+"|"+cc+")",ec="[^"+Wb+"]",fc="(?:\\ud83c[\\udde6-\\uddff]){2}",gc="[\\ud800-\\udbff][\\udc00-\\udfff]",hc="\\u200d",ic=dc+"?",jc="["+_b+"]?",kc="(?:"+hc+"(?:"+[ec,fc,gc].join("|")+")"+jc+ic+")*",lc=jc+ic+kc,mc="(?:"+[ec+bc+"?",bc,fc,gc,ac].join("|")+")",nc=RegExp(cc+"(?="+cc+")|"+mc+lc,"g"),rc=/^\s+|\s+$/g,tc=/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,uc=/,/,vc=/(=.+)?(\s*)$/,wc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,zc="function"==typeof setImmediate&&setImmediate,Ac="object"==typeof a&&"function"==typeof a.nextTick;Dc=zc?setImmediate:Ac?a.nextTick:Bc;var Ec=Cc(Dc);Fc.prototype.removeLink=function(a){return a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev,a.prev=a.next=null,this.length-=1,a},Fc.prototype.empty=Fc,Fc.prototype.insertAfter=function(a,b){b.prev=a,b.next=a.next,a.next?a.next.prev=b:this.tail=b,a.next=b,this.length+=1},Fc.prototype.insertBefore=function(a,b){b.prev=a.prev,b.next=a,a.prev?a.prev.next=b:this.head=b,a.prev=b,this.length+=1},Fc.prototype.unshift=function(a){this.head?this.insertBefore(this.head,a):Gc(this,a)},Fc.prototype.push=function(a){this.tail?this.insertAfter(this.tail,a):Gc(this,a)},Fc.prototype.shift=function(){return this.head&&this.removeLink(this.head)},Fc.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)};var yd,Jc=eb(db,1),Lc=i(function(b){return i(function(a){var c=this,d=a[a.length-1];"function"==typeof d?a.pop():d=L,Kc(b,a,function(a,b,d){b.apply(c,a.concat(i(function(a,b){d(a,b)})))},function(a,b){d.apply(c,[a].concat(b))})})}),Mc=i(function(a){return Lc.apply(null,a.reverse())}),Oc=ib(Nc),Qc=Pc(Nc),Rc=i(function(a){var b=[null].concat(a);return j(function(a,c){return c.apply(this,b)})}),Uc=ib(Sc(h,Tc)),Vc=mb(Sc(h,Tc)),Wc=eb(Vc,1),Yc=Xc("dir"),ed=eb(dd,1),hd=ib(Sc(gd,gd)),id=mb(Sc(gd,gd)),jd=eb(id,1),od=ib(nd),pd=mb(nd),qd=eb(pd,1),sd=Xc("log"),ud=eb(td,1/0),vd=eb(td,1);yd=Ac?a.nextTick:zc?setImmediate:Bc;var zd=Cc(yd),Dd=function(a,b){return Hc(function(b,c){a(b[0],c)},b,1)},Ed=function(a,b){var c=Dd(a,b);return c.push=function(a,b,d){if(null==d&&(d=L),"function"!=typeof d)throw new Error("task callback must be a function");if(c.started=!0,X(a)||(a=[a]),0===a.length)return Ec(function(){c.drain()});b=b||0;for(var e=c._tasks.head;e&&b>=e.priority;)e=e.next;for(var f=0,g=a.length;f0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===a[b-2]?2:"="===a[b-1]?1:0}function k(a){return 3*a.length/4-j(a)}function l(a){var b,c,d,g,h,i,k=a.length;h=j(a),i=new f(3*k/4-h),d=h>0?k-4:k;var l=0;for(b=0,c=0;b>16&255,i[l++]=g>>8&255,i[l++]=255&g;return 2===h?(g=e[a.charCodeAt(b)]<<2|e[a.charCodeAt(b+1)]>>4,i[l++]=255&g):1===h&&(g=e[a.charCodeAt(b)]<<10|e[a.charCodeAt(b+1)]<<4|e[a.charCodeAt(b+2)]>>2,i[l++]=g>>8&255,i[l++]=255&g),i}function m(a){return d[a>>18&63]+d[a>>12&63]+d[a>>6&63]+d[63&a]}function n(a,b,c){for(var d,e=[],f=b;fj?j:i+h));return 1===e?(b=a[c-1],f+=d[b>>2],f+=d[b<<4&63],f+="=="):2===e&&(b=(a[c-2]<<8)+a[c-1],f+=d[b>>10],f+=d[b>>4&63],f+=d[b<<2&63],f+="="),g.push(f),g.join("")}c.byteLength=k,c.toByteArray=l,c.fromByteArray=o;for(var d=[],e=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,i=g.length;hg)throw new RangeError("size is too large");var f=d,h=c;void 0===h&&(f=void 0,h=0);var i=new e(b);if("string"==typeof h)for(var j=new e(h,f),k=j.length,l=-1;++lg)throw new RangeError("size is too large");return new e(b)},c.from=function(c,d,f){if("function"==typeof e.from&&(!b.Uint8Array||Uint8Array.from!==e.from))return e.from(c,d,f);if("number"==typeof c)throw new TypeError('"value" argument must not be a number');if("string"==typeof c)return new e(c,d);if("undefined"!=typeof ArrayBuffer&&c instanceof ArrayBuffer){var g=d;if(1===arguments.length)return new e(c);"undefined"==typeof g&&(g=0);var h=f;if("undefined"==typeof h&&(h=c.byteLength-g),g>=c.byteLength)throw new RangeError("'offset' is out of bounds");if(h>c.byteLength-g)throw new RangeError("'length' is out of bounds");return new e(c.slice(g,g+h))}if(e.isBuffer(c)){var i=new e(c.length);return c.copy(i,0,0,c.length),i}if(c){if(Array.isArray(c)||"undefined"!=typeof ArrayBuffer&&c.buffer instanceof ArrayBuffer||"length"in c)return new e(c);if("Buffer"===c.type&&Array.isArray(c.data))return new e(c.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},c.allocUnsafeSlow=function(b){if("function"==typeof e.allocUnsafeSlow)return e.allocUnsafeSlow(b);if("number"!=typeof b)throw new TypeError("size must be a number");if(b>=g)throw new RangeError("size is too large");return new f(b)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:22}],22:[function(a,b,c){"use strict";function g(){try{var a=new Uint8Array(1);return a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===a.foo()}catch(a){return!1}}function h(a){if(a>f)throw new RangeError("Invalid typed array length");var b=new Uint8Array(a);return b.__proto__=i.prototype,b}function i(a,b,c){if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return m(a)}return j(a,b,c)}function j(a,b,c){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return a instanceof ArrayBuffer?p(a,b,c):"string"==typeof a?n(a,b):q(a)}function k(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number');if(a<0)throw new RangeError('"size" argument must not be negative')}function l(a,b,c){return k(a),a<=0?h(a):void 0!==b?"string"==typeof c?h(a).fill(b,c):h(a).fill(b):h(a)}function m(a){return k(a),h(a<0?0:0|r(a))}function n(a,b){if("string"==typeof b&&""!==b||(b="utf8"),!i.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var c=0|t(a,b),d=h(c),e=d.write(a,b);return e!==c&&(d=d.slice(0,e)),d}function o(a){for(var b=a.length<0?0:0|r(a.length),c=h(b),d=0;d=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|a}function s(a){return+a!=a&&(a=0),i.alloc(+a)}function t(a,b){if(i.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||a instanceof ArrayBuffer)return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return V(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return Y(a).length;default:if(d)return V(a).length;b=(""+b).toLowerCase(),d=!0}}function u(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return K(this,b,c);case"utf8":case"utf-8":return F(this,b,c);case"ascii":return I(this,b,c);case"latin1":case"binary":return J(this,b,c);case"base64":return E(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function v(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function w(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648), 3 | c=+c,isNaN(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=i.from(b,d)),i.isBuffer(b))return 0===b.length?-1:x(a,b,c,d,e);if("number"==typeof b)return b&=255,"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):x(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function x(a,b,c,d,e){function i(a,b){return 1===f?a[b]:a.readUInt16BE(b*f)}var f=1,g=a.length,h=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;f=2,g/=2,h/=2,c/=2}var j;if(e){var k=-1;for(j=c;jg&&(c=g-h),j=c;j>=0;j--){for(var l=!0,m=0;me&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return H(d)}function H(a){var b=a.length;if(b<=G)return String.fromCharCode.apply(String,a);for(var c="",d=0;dd)&&(c=d);for(var e="",f=b;fc)throw new RangeError("Trying to access beyond buffer length")}function N(a,b,c,d,e,f){if(!i.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||ba.length)throw new RangeError("Index out of range")}function O(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function P(a,b,c,d,f){return b=+b,c>>>=0,f||O(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(a,b,c,d,23,4),c+4}function Q(a,b,c,d,f){return b=+b,c>>>=0,f||O(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(a,b,c,d,52,8),c+8}function S(a){if(a=T(a).replace(R,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function T(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function U(a){return a<16?"0"+a.toString(16):a.toString(16)}function V(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function W(a){for(var b=[],c=0;c>8,e=c%256,f.push(e),f.push(d);return f}function Y(a){return d.toByteArray(S(a))}function Z(a,b,c,d){for(var e=0;e=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function $(a){return a!==a}var d=a("base64-js"),e=a("ieee754");c.Buffer=i,c.SlowBuffer=s,c.INSPECT_MAX_BYTES=50;var f=2147483647;c.kMaxLength=f,i.TYPED_ARRAY_SUPPORT=g(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(a,b,c){return j(a,b,c)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(a,b,c){return l(a,b,c)},i.allocUnsafe=function(a){return m(a)},i.allocUnsafeSlow=function(a){return m(a)},i.isBuffer=function(b){return null!=b&&b._isBuffer===!0},i.compare=function(b,c){if(!i.isBuffer(b)||!i.isBuffer(c))throw new TypeError("Arguments must be Buffers");if(b===c)return 0;for(var d=b.length,e=c.length,f=0,g=Math.min(d,e);f0&&(b=this.toString("hex",0,d).match(/.{2}/g).join(" "),this.length>d&&(b+=" ... ")),""},i.prototype.compare=function(b,c,d,e,f){if(!i.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(void 0===c&&(c=0),void 0===d&&(d=b?b.length:0),void 0===e&&(e=0),void 0===f&&(f=this.length),c<0||d>b.length||e<0||f>this.length)throw new RangeError("out of range index");if(e>=f&&c>=d)return 0;if(e>=f)return-1;if(c>=d)return 1;if(c>>>=0,d>>>=0,e>>>=0,f>>>=0,this===b)return 0;for(var g=f-e,h=d-c,j=Math.min(g,h),k=this.slice(e,f),l=b.slice(c,d),m=0;m>>=0,isFinite(d)?(d>>>=0,void 0===e&&(e="utf8")):(e=d,d=void 0)}var f=this.length-c;if((void 0===d||d>f)&&(d=f),b.length>0&&(d<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var g=!1;;)switch(e){case"hex":return y(this,b,c,d);case"utf8":case"utf-8":return z(this,b,c,d);case"ascii":return A(this,b,c,d);case"latin1":case"binary":return B(this,b,c,d);case"base64":return C(this,b,c,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,b,c,d);default:if(g)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),g=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var G=4096;i.prototype.slice=function(b,c){var d=this.length;b=~~b,c=void 0===c?d:~~c,b<0?(b+=d,b<0&&(b=0)):b>d&&(b=d),c<0?(c+=d,c<0&&(c=0)):c>d&&(c=d),c>>=0,c>>>=0,d||M(b,c,this.length);for(var e=this[b],f=1,g=0;++g>>=0,c>>>=0,d||M(b,c,this.length);for(var e=this[b+--c],f=1;c>0&&(f*=256);)e+=this[b+--c]*f;return e},i.prototype.readUInt8=function(b,c){return b>>>=0,c||M(b,1,this.length),this[b]},i.prototype.readUInt16LE=function(b,c){return b>>>=0,c||M(b,2,this.length),this[b]|this[b+1]<<8},i.prototype.readUInt16BE=function(b,c){return b>>>=0,c||M(b,2,this.length),this[b]<<8|this[b+1]},i.prototype.readUInt32LE=function(b,c){return b>>>=0,c||M(b,4,this.length),(this[b]|this[b+1]<<8|this[b+2]<<16)+16777216*this[b+3]},i.prototype.readUInt32BE=function(b,c){return b>>>=0,c||M(b,4,this.length),16777216*this[b]+(this[b+1]<<16|this[b+2]<<8|this[b+3])},i.prototype.readIntLE=function(b,c,d){b>>>=0,c>>>=0,d||M(b,c,this.length);for(var e=this[b],f=1,g=0;++g=f&&(e-=Math.pow(2,8*c)),e},i.prototype.readIntBE=function(b,c,d){b>>>=0,c>>>=0,d||M(b,c,this.length);for(var e=c,f=1,g=this[b+--e];e>0&&(f*=256);)g+=this[b+--e]*f;return f*=128,g>=f&&(g-=Math.pow(2,8*c)),g},i.prototype.readInt8=function(b,c){return b>>>=0,c||M(b,1,this.length),128&this[b]?(255-this[b]+1)*-1:this[b]},i.prototype.readInt16LE=function(b,c){b>>>=0,c||M(b,2,this.length);var d=this[b]|this[b+1]<<8;return 32768&d?4294901760|d:d},i.prototype.readInt16BE=function(b,c){b>>>=0,c||M(b,2,this.length);var d=this[b+1]|this[b]<<8;return 32768&d?4294901760|d:d},i.prototype.readInt32LE=function(b,c){return b>>>=0,c||M(b,4,this.length),this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24},i.prototype.readInt32BE=function(b,c){return b>>>=0,c||M(b,4,this.length),this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]},i.prototype.readFloatLE=function(b,c){return b>>>=0,c||M(b,4,this.length),e.read(this,b,!0,23,4)},i.prototype.readFloatBE=function(b,c){return b>>>=0,c||M(b,4,this.length),e.read(this,b,!1,23,4)},i.prototype.readDoubleLE=function(b,c){return b>>>=0,c||M(b,8,this.length),e.read(this,b,!0,52,8)},i.prototype.readDoubleBE=function(b,c){return b>>>=0,c||M(b,8,this.length),e.read(this,b,!1,52,8)},i.prototype.writeUIntLE=function(b,c,d,e){if(b=+b,c>>>=0,d>>>=0,!e){var f=Math.pow(2,8*d)-1;N(this,b,c,d,f,0)}var g=1,h=0;for(this[c]=255&b;++h>>=0,d>>>=0,!e){var f=Math.pow(2,8*d)-1;N(this,b,c,d,f,0)}var g=d-1,h=1;for(this[c+g]=255&b;--g>=0&&(h*=256);)this[c+g]=b/h&255;return c+d},i.prototype.writeUInt8=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,1,255,0),this[c]=255&b,c+1},i.prototype.writeUInt16LE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,2,65535,0),this[c]=255&b,this[c+1]=b>>>8,c+2},i.prototype.writeUInt16BE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,2,65535,0),this[c]=b>>>8,this[c+1]=255&b,c+2},i.prototype.writeUInt32LE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,4,4294967295,0),this[c+3]=b>>>24,this[c+2]=b>>>16,this[c+1]=b>>>8,this[c]=255&b,c+4},i.prototype.writeUInt32BE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,4,4294967295,0),this[c]=b>>>24,this[c+1]=b>>>16,this[c+2]=b>>>8,this[c+3]=255&b,c+4},i.prototype.writeIntLE=function(b,c,d,e){if(b=+b,c>>>=0,!e){var f=Math.pow(2,8*d-1);N(this,b,c,d,f-1,-f)}var g=0,h=1,i=0;for(this[c]=255&b;++g>0)-i&255;return c+d},i.prototype.writeIntBE=function(b,c,d,e){if(b=+b,c>>>=0,!e){var f=Math.pow(2,8*d-1);N(this,b,c,d,f-1,-f)}var g=d-1,h=1,i=0;for(this[c+g]=255&b;--g>=0&&(h*=256);)b<0&&0===i&&0!==this[c+g+1]&&(i=1),this[c+g]=(b/h>>0)-i&255;return c+d},i.prototype.writeInt8=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,1,127,-128),b<0&&(b=255+b+1),this[c]=255&b,c+1},i.prototype.writeInt16LE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,2,32767,-32768),this[c]=255&b,this[c+1]=b>>>8,c+2},i.prototype.writeInt16BE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,2,32767,-32768),this[c]=b>>>8,this[c+1]=255&b,c+2},i.prototype.writeInt32LE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,4,2147483647,-2147483648),this[c]=255&b,this[c+1]=b>>>8,this[c+2]=b>>>16,this[c+3]=b>>>24,c+4},i.prototype.writeInt32BE=function(b,c,d){return b=+b,c>>>=0,d||N(this,b,c,4,2147483647,-2147483648),b<0&&(b=4294967295+b+1),this[c]=b>>>24,this[c+1]=b>>>16,this[c+2]=b>>>8,this[c+3]=255&b,c+4},i.prototype.writeFloatLE=function(b,c,d){return P(this,b,c,!0,d)},i.prototype.writeFloatBE=function(b,c,d){return P(this,b,c,!1,d)},i.prototype.writeDoubleLE=function(b,c,d){return Q(this,b,c,!0,d)},i.prototype.writeDoubleBE=function(b,c,d){return Q(this,b,c,!1,d)},i.prototype.copy=function(b,c,d,e){if(d||(d=0),e||0===e||(e=this.length),c>=b.length&&(c=b.length),c||(c=0),e>0&&e=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),b.length-c=0;--g)b[g+c]=this[g+d];else if(f<1e3)for(g=0;g>>=0,d=void 0===d?this.length:d>>>0,b||(b=0);var g;if("number"==typeof b)for(g=c;g0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())),this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function d(){this.removeListener(a,d),c||(c=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var c=!1;return d.listener=b,this.on(a,d),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(d<0)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.prototype.listenerCount=function(a){if(this._events){var b=this._events[a];if(e(b))return 1;if(b)return b.length}return 0},d.listenerCount=function(a,b){return a.listenerCount(b)}},{}],26:[function(a,b,c){var d=a("http"),e=b.exports;for(var f in d)d.hasOwnProperty(f)&&(e[f]=d[f]);e.request=function(a,b){return a||(a={}),a.scheme="https",a.protocol="https:",d.request.call(this,a,b)}},{http:44}],27:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],28:[function(a,b,c){"function"==typeof Object.create?b.exports=function(b,c){b.super_=c,b.prototype=Object.create(c.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}})}:b.exports=function(b,c){b.super_=c;var d=function(){};d.prototype=c.prototype,b.prototype=new d,b.prototype.constructor=b}},{}],29:[function(a,b,c){function d(a){return!!a.constructor&&"function"==typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)}function e(a){return"function"==typeof a.readFloatLE&&"function"==typeof a.slice&&d(a.slice(0,0))}b.exports=function(a){return null!=a&&(d(a)||e(a)||!!a._isBuffer)}},{}],30:[function(a,b,c){var d={}.toString;b.exports=Array.isArray||function(a){return"[object Array]"==d.call(a)}},{}],31:[function(a,b,c){(function(a){"use strict";function c(b,c,d,e){if("function"!=typeof b)throw new TypeError('"callback" argument must be a function');var g,h,f=arguments.length;switch(f){case 0:case 1:return a.nextTick(b);case 2:return a.nextTick(function(){b.call(null,c)});case 3:return a.nextTick(function(){b.call(null,c,d)});case 4:return a.nextTick(function(){b.call(null,c,d,e)});default:for(g=new Array(f-1),h=0;h1)for(var c=1;c1&&(d=c[0]+"@",a=c[1]),a=a.replace(t,".");var e=a.split("."),f=A(e,b).join(".");return d+f}function C(a){for(var e,f,b=[],c=0,d=a.length;c=55296&&e<=56319&&c65535&&(a-=65536,b+=x(a>>>10&1023|55296),a=56320|1023&a),b+=x(a)}).join("")}function E(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:j}function F(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function G(a,b,c){var d=0;for(a=c?w(a/n):a>>1,a+=w(a/b);a>v*l>>1;d+=j)a=w(a/v);return w(d+(v+1)*a/(a+m))}function H(a){var d,h,m,n,r,s,t,u,v,x,b=[],c=a.length,e=0,f=p,g=o;for(h=a.lastIndexOf(q),h<0&&(h=0),m=0;m=128&&z("not-basic"),b.push(a.charCodeAt(m));for(n=h>0?h+1:0;n=c&&z("invalid-input"),u=E(a.charCodeAt(n++)),(u>=j||u>w((i-e)/s))&&z("overflow"),e+=u*s,v=t<=g?k:t>=g+l?l:t-g,!(uw(i/x)&&z("overflow"),s*=x;d=b.length+1,g=G(e-r,d,0==r),w(e/d)>i-f&&z("overflow"),f+=w(e/d),e%=d,b.splice(e++,0,f)}return D(b)}function I(a){var b,c,d,e,f,g,h,m,n,r,s,u,v,y,A,t=[];for(a=C(a),u=a.length,b=p,c=0,f=o,g=0;g=b&&sw((i-c)/v)&&z("overflow"),c+=(h-b)*v,b=h,g=0;gi&&z("overflow"),s==b){for(m=c,n=j;r=n<=f?k:n>=f+l?l:n-f,!(m= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=j-k,w=Math.floor,x=String.fromCharCode;if(h={version:"1.4.1",ucs2:{decode:C,encode:D},decode:H,encode:I,toASCII:K,toUnicode:J},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return h});else if(e&&f)if(b.exports==e)f.exports=h;else for(y in h)h.hasOwnProperty(y)&&(e[y]=h[y]);else d.punycode=h}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(a,b,c){"use strict";function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=function(a,b,c,f){b=b||"&",c=c||"=";var g={};if("string"!=typeof a||0===a.length)return g;var h=/\+/g;a=a.split(b);var i=1e3;f&&"number"==typeof f.maxKeys&&(i=f.maxKeys);var j=a.length;i>0&&j>i&&(j=i);for(var k=0;k=0?(n=l.substr(0,m),o=l.substr(m+1)):(n=l,o=""),p=decodeURIComponent(n),q=decodeURIComponent(o),d(g,p)?e(g[p])?g[p].push(q):g[p]=[g[p],q]:g[p]=q}return g};var e=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}},{}],35:[function(a,b,c){"use strict";function f(a,b){if(a.map)return a.map(b);for(var c=[],d=0;d0)if(b.ended&&!e){var g=new Error("stream.push() after EOF");a.emit("error",g)}else if(b.endEmitted&&e){var h=new Error("stream.unshift() after end event");a.emit("error",h)}else{var i;!b.decoder||e||d||(c=b.decoder.write(c),i=!b.objectMode&&0===c.length),e||(b.reading=!1),i||(b.flowing&&0===b.length&&!b.sync?(a.emit("data",c),a.read(0)):(b.length+=b.objectMode?1:c.length,e?b.buffer.unshift(c):b.buffer.push(c),b.needReadable&&A(a))),C(a,b)}else e||(b.reading=!1);return u(b)}function u(a){return!a.ended&&(a.needReadable||a.length=v?a=v:(a--,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a++),a}function x(a,b){return a<=0||0===b.length&&b.ended?0:b.objectMode?1:a!==a?b.flowing&&b.length?b.buffer.head.data.length:b.length:(a>b.highWaterMark&&(b.highWaterMark=w(a)),a<=b.length?a:b.ended?b.length:(b.needReadable=!0,0))}function y(a,b){var c=null;return j.isBuffer(b)||"string"==typeof b||null===b||void 0===b||a.objectMode||(c=new TypeError("Invalid non-string/buffer chunk")),c}function z(a,b){if(!b.ended){if(b.decoder){var c=b.decoder.end();c&&c.length&&(b.buffer.push(c),b.length+=b.objectMode?1:c.length)}b.ended=!0,A(a)}}function A(a){var b=a._readableState;b.needReadable=!1,b.emittedReadable||(n("emitReadable",b.flowing),b.emittedReadable=!0,b.sync?d(B,a):B(a))}function B(a){n("emit readable"),a.emit("readable"),I(a)}function C(a,b){b.readingMore||(b.readingMore=!0,d(D,a,b))}function D(a,b){for(var c=b.length;!b.reading&&!b.flowing&&!b.ended&&b.length=b.length?(c=b.decoder?b.buffer.join(""):1===b.buffer.length?b.buffer.head.data:b.buffer.concat(b.length),b.buffer.clear()):c=K(a,b.buffer,b.decoder),c}function K(a,b,c){var d;return af.length?f.length:a;if(e+=g===f.length?f:f.slice(0,a),a-=g,0===a){g===f.length?(++d,c.next?b.head=c.next:b.head=b.tail=null):(b.head=c,c.data=f.slice(g));break}++d}return b.length-=d,e}function M(a,b){var c=k.allocUnsafe(a),d=b.head,e=1;for(d.data.copy(c),a-=d.data.length;d=d.next;){var f=d.data,g=a>f.length?f.length:a;if(f.copy(c,c.length-a,0,g),a-=g,0===a){g===f.length?(++e,d.next?b.head=d.next:b.head=b.tail=null):(b.head=d,d.data=f.slice(g));break}++e}return b.length-=e,c}function N(a){var b=a._readableState;if(b.length>0)throw new Error('"endReadable()" called on non-empty stream');b.endEmitted||(b.ended=!0,d(O,b,a))}function O(a,b){a.endEmitted||0!==a.length||(a.endEmitted=!0,b.readable=!1,b.emit("end"))}function P(a,b){for(var c=0,d=a.length;c=b.highWaterMark||b.ended))return n("read: emitReadable",b.length,b.ended),0===b.length&&b.ended?N(this):A(this),null;if(a=x(a,b),0===a&&b.ended)return 0===b.length&&N(this),null;var d=b.needReadable;n("need readable",d),(0===b.length||b.length-a0?J(a,b):null,null===e?(b.needReadable=!0,a=0):b.length-=a,0===b.length&&(b.ended||(b.needReadable=!0),c!==a&&b.ended&&N(this)),null!==e&&this.emit("data",e),e},s.prototype._read=function(a){this.emit("error",new Error("_read() is not implemented"))},s.prototype.pipe=function(a,b){function j(a){n("onunpipe"),a===e&&o()}function k(){n("onend"),a.end()}function o(){n("cleanup"),a.removeListener("close",t),a.removeListener("finish",u),a.removeListener("drain",l),a.removeListener("error",s),a.removeListener("unpipe",j),e.removeListener("end",k),e.removeListener("end",o),e.removeListener("data",r),m=!0,!f.awaitDrain||a._writableState&&!a._writableState.needDrain||l()}function r(b){n("ondata"),p=!1;var c=a.write(b);!1!==c||p||((1===f.pipesCount&&f.pipes===a||f.pipesCount>1&&Q(f.pipes,a)!==-1)&&!m&&(n("false write response, pause",e._readableState.awaitDrain),e._readableState.awaitDrain++,p=!0),e.pause())}function s(b){n("onerror",b),v(),a.removeListener("error",s),0===h(a,"error")&&a.emit("error",b)}function t(){a.removeListener("finish",u),v()}function u(){n("onfinish"),a.removeListener("close",t),v()}function v(){n("unpipe"),e.unpipe(a)}var e=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=a;break;case 1:f.pipes=[f.pipes,a];break;default:f.pipes.push(a)}f.pipesCount+=1,n("pipe count=%d opts=%j",f.pipesCount,b);var g=(!b||b.end!==!1)&&a!==c.stdout&&a!==c.stderr,i=g?k:o;f.endEmitted?d(i):e.once("end",i),a.on("unpipe",j);var l=E(e);a.on("drain",l);var m=!1,p=!1;return e.on("data",r),q(a,"error",s),a.once("close",t),a.once("finish",u),a.emit("pipe",e),f.flowing||(n("pipe resume"),e.resume()),a},s.prototype.unpipe=function(a){var b=this._readableState;if(0===b.pipesCount)return this;if(1===b.pipesCount)return a&&a!==b.pipes?this:(a||(a=b.pipes),b.pipes=null,b.pipesCount=0,b.flowing=!1,a&&a.emit("unpipe",this),this);if(!a){var c=b.pipes,d=b.pipesCount;b.pipes=null,b.pipesCount=0,b.flowing=!1;for(var e=0;e-1?setImmediate:d;p.WritableState=n;var g=a("core-util-is");g.inherits=a("inherits");var i,h={deprecate:a("util-deprecate")};!function(){try{i=a("stream")}catch(a){}finally{i||(i=a("events").EventEmitter)}}();var j=a("buffer").Buffer,k=a("buffer-shims");g.inherits(p,i),n.prototype.getBuffer=function(){for(var b=this.bufferedRequest,c=[];b;)c.push(b),b=b.next;return c},function(){try{Object.defineProperty(n.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(a){}}();var o;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(a){return!!o.call(this,a)||a&&a._writableState instanceof n}})):o=function(a){return a instanceof this},p.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},p.prototype.write=function(a,b,c){var d=this._writableState,e=!1,f=j.isBuffer(a);return"function"==typeof b&&(c=b,b=null),f?b="buffer":b||(b=d.defaultEncoding),"function"!=typeof c&&(c=l),d.ended?q(this,c):(f||r(this,d,a,c))&&(d.pendingcb++,e=t(this,d,f,a,b,c)),e},p.prototype.cork=function(){var a=this._writableState;a.corked++},p.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,a.writing||a.corked||a.finished||a.bufferProcessing||!a.bufferedRequest||A(this,a))},p.prototype.setDefaultEncoding=function(b){if("string"==typeof b&&(b=b.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((b+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+b);return this._writableState.defaultEncoding=b,this},p.prototype._write=function(a,b,c){c(new Error("_write() is not implemented"))},p.prototype._writev=null,p.prototype.end=function(a,b,c){var d=this._writableState;"function"==typeof a?(c=a,a=null,b=null):"function"==typeof b&&(c=b,b=null),null!==a&&void 0!==a&&this.write(a,b),d.corked&&(d.corked=1,this.uncork()),d.ending||d.finished||E(this,d,c)}}).call(this,a("_process"))},{"./_stream_duplex":37,_process:32,buffer:22,"buffer-shims":21,"core-util-is":24,events:25,inherits:28,"process-nextick-args":31,"util-deprecate":52}],42:[function(a,b,c){"use strict";function f(){this.head=null,this.tail=null,this.length=0}var e=(a("buffer").Buffer,a("buffer-shims"));b.exports=f,f.prototype.push=function(a){var b={data:a,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length},f.prototype.unshift=function(a){var b={data:a,next:this.head};0===this.length&&(this.tail=b),this.head=b,++this.length},f.prototype.shift=function(){if(0!==this.length){var a=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(a){if(0===this.length)return"";for(var b=this.head,c=""+b.data;b=b.next;)c+=a+b.data;return c},f.prototype.concat=function(a){if(0===this.length)return e.alloc(0);if(1===this.length)return this.head.data;for(var b=e.allocUnsafe(a>>>0),c=this.head,d=0;c;)c.data.copy(b,d),d+=c.data.length,c=c.next;return b}},{buffer:22,"buffer-shims":21}],43:[function(a,b,c){(function(d){var e=function(){try{return a("stream")}catch(a){}}();c=b.exports=a("./lib/_stream_readable.js"),c.Stream=e||c,c.Readable=c,c.Writable=a("./lib/_stream_writable.js"),c.Duplex=a("./lib/_stream_duplex.js"),c.Transform=a("./lib/_stream_transform.js"),c.PassThrough=a("./lib/_stream_passthrough.js"),!d.browser&&"disable"===d.env.READABLE_STREAM&&e&&(b.exports=e)}).call(this,a("_process"))},{"./lib/_stream_duplex.js":37,"./lib/_stream_passthrough.js":38,"./lib/_stream_readable.js":39,"./lib/_stream_transform.js":40,"./lib/_stream_writable.js":41,_process:32}],44:[function(a,b,c){(function(b){var d=a("./lib/request"),e=a("xtend"),f=a("builtin-status-codes"),g=a("url"),h=c;h.request=function(a,c){a="string"==typeof a?g.parse(a):e(a);var f=b.location.protocol.search(/^https?:$/)===-1?"http:":"",h=a.protocol||f,i=a.hostname||a.host,j=a.port,k=a.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),a.url=(i?h+"//"+i:"")+(j?":"+j:"")+k,a.method=(a.method||"GET").toUpperCase(),a.headers=a.headers||{};var l=new d(a);return c&&l.on("response",c),l},h.get=function(b,c){var d=h.request(b,c);return d.end(),d},h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.STATUS_CODES=f,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":46,"builtin-status-codes":23,url:50,xtend:54}],45:[function(a,b,c){(function(a){function d(){if(void 0!==b)return b;if(a.XMLHttpRequest){b=new a.XMLHttpRequest;try{b.open("GET",a.XDomainRequest?"/":"https://example.com")}catch(a){b=null}}else b=null;return b}function e(a){var b=d();if(!b)return!1;try{return b.responseType=a,b.responseType===a}catch(a){}return!1}function h(a){return"function"==typeof a}c.fetch=h(a.fetch)&&h(a.ReadableStream),c.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),c.blobConstructor=!0}catch(a){}var b,f="undefined"!=typeof a.ArrayBuffer,g=f&&h(a.ArrayBuffer.prototype.slice);c.arraybuffer=c.fetch||f&&e("arraybuffer"),c.msstream=!c.fetch&&g&&e("ms-stream"),c.mozchunkedarraybuffer=!c.fetch&&f&&e("moz-chunked-arraybuffer"),c.overrideMimeType=c.fetch||!!d()&&h(d().overrideMimeType),c.vbArray=h(a.VBArray),b=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(a,b,c){(function(c,d,e){function m(a,b){return f.fetch&&b?"fetch":f.mozchunkedarraybuffer?"moz-chunked-arraybuffer":f.msstream?"ms-stream":f.arraybuffer&&a?"arraybuffer":f.vbArray&&a?"text:vbarray":"text"}function o(a){try{var b=a.status;return null!==b&&0!==b}catch(a){return!1}}var f=a("./capability"),g=a("inherits"),h=a("./response"),i=a("readable-stream"),j=a("to-arraybuffer"),k=h.IncomingMessage,l=h.readyStates,n=b.exports=function(a){var b=this;i.Writable.call(b),b._opts=a,b._body=[],b._headers={},a.auth&&b.setHeader("Authorization","Basic "+new e(a.auth).toString("base64")),Object.keys(a.headers).forEach(function(c){b.setHeader(c,a.headers[c])});var c,d=!0;if("disable-fetch"===a.mode||"timeout"in a)d=!1,c=!0;else if("prefer-streaming"===a.mode)c=!1;else if("allow-wrong-content-type"===a.mode)c=!f.overrideMimeType;else{if(a.mode&&"default"!==a.mode&&"prefer-fast"!==a.mode)throw new Error("Invalid value for opts.mode");c=!0}b._mode=m(c,d),b.on("finish",function(){b._onFinish()})};g(n,i.Writable),n.prototype.setHeader=function(a,b){var c=this,d=a.toLowerCase();p.indexOf(d)===-1&&(c._headers[d]={name:a,value:b})},n.prototype.getHeader=function(a){var b=this;return b._headers[a.toLowerCase()].value},n.prototype.removeHeader=function(a){var b=this;delete b._headers[a.toLowerCase()]},n.prototype._onFinish=function(){var a=this;if(!a._destroyed){var b=a._opts,g=a._headers,h=null;if("POST"!==b.method&&"PUT"!==b.method&&"PATCH"!==b.method&&"MERGE"!==b.method||(h=f.blobConstructor?new d.Blob(a._body.map(function(a){return j(a)}),{type:(g["content-type"]||{}).value||""}):e.concat(a._body).toString()),"fetch"===a._mode){var i=Object.keys(g).map(function(a){return[g[a].name,g[a].value]});d.fetch(a._opts.url,{method:a._opts.method,headers:i,body:h||void 0,mode:"cors",credentials:b.withCredentials?"include":"same-origin"}).then(function(b){a._fetchResponse=b,a._connect()},function(b){a.emit("error",b)})}else{var k=a._xhr=new d.XMLHttpRequest;try{k.open(a._opts.method,a._opts.url,!0)}catch(b){return void c.nextTick(function(){a.emit("error",b)})}"responseType"in k&&(k.responseType=a._mode.split(":")[0]),"withCredentials"in k&&(k.withCredentials=!!b.withCredentials),"text"===a._mode&&"overrideMimeType"in k&&k.overrideMimeType("text/plain; charset=x-user-defined"),"timeout"in b&&(k.timeout=b.timeout,k.ontimeout=function(){a.emit("timeout")}),Object.keys(g).forEach(function(a){k.setRequestHeader(g[a].name,g[a].value)}),a._response=null,k.onreadystatechange=function(){switch(k.readyState){case l.LOADING:case l.DONE:a._onXHRProgress()}},"moz-chunked-arraybuffer"===a._mode&&(k.onprogress=function(){a._onXHRProgress()}),k.onerror=function(){a._destroyed||a.emit("error",new Error("XHR error"))};try{k.send(h)}catch(b){return void c.nextTick(function(){a.emit("error",b)})}}}},n.prototype._onXHRProgress=function(){var a=this;o(a._xhr)&&!a._destroyed&&(a._response||a._connect(),a._response._onXHRProgress())},n.prototype._connect=function(){var a=this;a._destroyed||(a._response=new k(a._xhr,a._fetchResponse,a._mode),a._response.on("error",function(b){a.emit("error",b)}),a.emit("response",a._response))},n.prototype._write=function(a,b,c){var d=this;d._body.push(a),c()},n.prototype.abort=n.prototype.destroy=function(){var a=this;a._destroyed=!0,a._response&&(a._response._destroyed=!0),a._xhr&&a._xhr.abort()},n.prototype.end=function(a,b,c){var d=this;"function"==typeof a&&(c=a,a=void 0),i.Writable.prototype.end.call(d,a,b,c)},n.prototype.flushHeaders=function(){},n.prototype.setTimeout=function(){},n.prototype.setNoDelay=function(){},n.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./capability":45,"./response":47,_process:32,buffer:22,inherits:28,"readable-stream":43,"to-arraybuffer":49}],47:[function(a,b,c){(function(b,d,e){var f=a("./capability"),g=a("inherits"),h=a("readable-stream"),i=c.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},j=c.IncomingMessage=function(a,c,d){function j(){i.read().then(function(a){if(!g._destroyed){if(a.done)return void g.push(null);g.push(new e(a.value)),j()}}).catch(function(a){g.emit("error",a)})}var g=this;if(h.Readable.call(g),g._mode=d,g.headers={},g.rawHeaders=[],g.trailers={},g.rawTrailers=[],g.on("end",function(){b.nextTick(function(){g.emit("close")})}),"fetch"===d){g._fetchResponse=c,g.url=c.url,g.statusCode=c.status,g.statusMessage=c.statusText,c.headers.forEach(function(a,b){g.headers[b.toLowerCase()]=a,g.rawHeaders.push(b,a)});var i=c.body.getReader();j()}else{g._xhr=a,g._pos=0,g.url=a.responseURL,g.statusCode=a.status,g.statusMessage=a.statusText;var k=a.getAllResponseHeaders().split(/\r?\n/);if(k.forEach(function(a){var b=a.match(/^([^:]+):\s*(.*)/);if(b){var c=b[1].toLowerCase();"set-cookie"===c?(void 0===g.headers[c]&&(g.headers[c]=[]),g.headers[c].push(b[2])):void 0!==g.headers[c]?g.headers[c]+=", "+b[2]:g.headers[c]=b[2],g.rawHeaders.push(b[1],b[2])}}),g._charset="x-user-defined",!f.overrideMimeType){var l=g.rawHeaders["mime-type"];if(l){var m=l.match(/;\s*charset=([^;])(;|$)/);m&&(g._charset=m[1].toLowerCase())}g._charset||(g._charset="utf-8")}}};g(j,h.Readable),j.prototype._read=function(){},j.prototype._onXHRProgress=function(){var a=this,b=a._xhr,c=null;switch(a._mode){case"text:vbarray":if(b.readyState!==i.DONE)break;try{c=new d.VBArray(b.responseBody).toArray()}catch(a){}if(null!==c){a.push(new e(c));break}case"text":try{c=b.responseText}catch(b){a._mode="text:vbarray";break}if(c.length>a._pos){var f=c.substr(a._pos);if("x-user-defined"===a._charset){for(var g=new e(f.length),h=0;ha._pos&&(a.push(new e(new Uint8Array(j.result.slice(a._pos)))),a._pos=j.result.byteLength)},j.onload=function(){a.push(null)},j.readAsArrayBuffer(c)}a._xhr.readyState===i.DONE&&"ms-stream"!==a._mode&&a.push(null)}}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./capability":45,_process:32,buffer:22,inherits:28,"readable-stream":43}],48:[function(a,b,c){function f(a){if(a&&!e(a))throw new Error("Unknown encoding: "+a)}function h(a){return a.toString(this.encoding)}function i(a){this.charReceived=a.length%2,this.charLength=this.charReceived?2:0}function j(a){this.charReceived=a.length%3,this.charLength=this.charReceived?3:0}var d=a("buffer").Buffer,e=d.isEncoding||function(a){switch(a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},g=c.StringDecoder=function(a){switch(this.encoding=(a||"utf8").toLowerCase().replace(/[-_]/,""),f(a),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=j;break;default:return void(this.write=h)}this.charBuffer=new d(6),this.charReceived=0,this.charLength=0};g.prototype.write=function(a){for(var b="";this.charLength;){var c=a.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:a.length;if(a.copy(this.charBuffer,this.charReceived,0,c),this.charReceived+=c,this.charReceived=55296&&d<=56319)){if(this.charReceived=this.charLength=0,0===a.length)return b;break}this.charLength+=this.surrogateSize,b=""}this.detectIncompleteChar(a);var e=a.length;this.charLength&&(a.copy(this.charBuffer,0,a.length-this.charReceived,e),e-=this.charReceived),b+=a.toString(this.encoding,0,e);var e=b.length-1,d=b.charCodeAt(e);if(d>=55296&&d<=56319){var f=this.surrogateSize;return this.charLength+=f,this.charReceived+=f,this.charBuffer.copy(this.charBuffer,f,0,f),a.copy(this.charBuffer,0,0,f),b.substring(0,e)}return b},g.prototype.detectIncompleteChar=function(a){for(var b=a.length>=3?3:a.length;b>0;b--){var c=a[a.length-b];if(1==b&&c>>5==6){this.charLength=2;break}if(b<=2&&c>>4==14){this.charLength=3;break}if(b<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=b},g.prototype.end=function(a){var b="";if(a&&a.length&&(b=this.write(a)),this.charReceived){var c=this.charReceived,d=this.charBuffer,e=this.encoding;b+=d.slice(0,c).toString(e)}return b}},{buffer:22}],49:[function(a,b,c){var d=a("buffer").Buffer;b.exports=function(a){if(a instanceof Uint8Array){if(0===a.byteOffset&&a.byteLength===a.buffer.byteLength)return a.buffer;if("function"==typeof a.buffer.slice)return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}if(d.isBuffer(a)){for(var b=new Uint8Array(a.length),c=a.length,e=0;e",'"',"`"," ","\r","\n","\t"],k=["{","}","|","\\","^","`"].concat(j),l=["'"].concat(k),m=["%","/","?",";","#"].concat(l),n=["/","?","#"],o=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,q=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,r={javascript:!0,"javascript:":!0},s={javascript:!0,"javascript:":!0},t={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0, 5 | "https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},u=a("querystring");f.prototype.parse=function(a,b,c){if(!e.isString(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var f=a.indexOf("?"),h=f!==-1&&f127?"x":I[K];if(!J.match(p)){var M=G.slice(0,B),N=G.slice(B+1),O=I.match(q);O&&(M.push(O[1]),N.unshift(O[2])),N.length&&(v="/"+N.join(".")+v),this.hostname=M.join(".");break}}}this.hostname.length>o?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=d.toASCII(this.hostname));var P=this.port?":"+this.port:"",Q=this.hostname||"";this.host=Q+P,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!r[y])for(var B=0,H=l.length;B0)&&c.host.split("@");z&&(c.auth=z.shift(),c.host=c.hostname=z.shift())}return c.search=a.search,c.query=a.query,e.isNull(c.pathname)&&e.isNull(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!x.length)return c.pathname=null,c.search?c.path="/"+c.search:c.path=null,c.href=c.format(),c;for(var A=x.slice(-1)[0],B=(c.host||a.host||x.length>1)&&("."===A||".."===A)||""===A,C=0,D=x.length;D>=0;D--)A=x[D],"."===A?x.splice(D,1):".."===A?(x.splice(D,1),C++):C&&(x.splice(D,1),C--);if(!v&&!w)for(;C--;C)x.unshift("..");!v||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),B&&"/"!==x.join("/").substr(-1)&&x.push("");var E=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(y){c.hostname=c.host=E?"":x.length?x.shift():"";var z=!!(c.host&&c.host.indexOf("@")>0)&&c.host.split("@");z&&(c.auth=z.shift(),c.host=c.hostname=z.shift())}return v=v||c.host&&x.length,v&&!E&&x.unshift(""),x.length?c.pathname=x.join("/"):(c.pathname=null,c.path=null),e.isNull(c.pathname)&&e.isNull(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},f.prototype.parseHost=function(){var a=this.host,b=h.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{"./util":51,punycode:33,querystring:36}],51:[function(a,b,c){"use strict";b.exports={isString:function(a){return"string"==typeof a},isObject:function(a){return"object"==typeof a&&null!==a},isNull:function(a){return null===a},isNullOrUndefined:function(a){return null==a}}},{}],52:[function(a,b,c){(function(a){function c(a,b){function e(){if(!c){if(d("throwDeprecation"))throw new Error(b);d("traceDeprecation")?console.trace(b):console.warn(b),c=!0}return a.apply(this,arguments)}if(d("noDeprecation"))return a;var c=!1;return e}function d(b){try{if(!a.localStorage)return!1}catch(a){return!1}var c=a.localStorage[b];return null!=c&&"true"===String(c).toLowerCase()}b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],53:[function(a,b,c){(function(b,d){var e=a("url"),f=a("child_process").spawn,g=a("fs");c.XMLHttpRequest=function(){"use strict";var j,k,c=this,h=a("http"),i=a("https"),l={},m=!1,n={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},o={},p={},q=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],r=["TRACE","TRACK","CONNECT"],s=!1,t=!1,u={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1;var v=function(a){return m||a&&q.indexOf(a.toLowerCase())===-1},w=function(a){return a&&r.indexOf(a)===-1};this.open=function(a,b,c,d,e){if(this.abort(),t=!1,!w(a))throw new Error("SecurityError: Request method not allowed");l={method:a,url:b.toString(),async:"boolean"!=typeof c||c,user:d||null,password:e||null},x(this.OPENED)},this.setDisableHeaderCheck=function(a){m=a},this.setRequestHeader=function(a,b){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!v(a))return void console.warn('Refused to set unsafe header "'+a+'"');if(s)throw new Error("INVALID_STATE_ERR: send flag is true");a=p[a.toLowerCase()]||a,p[a.toLowerCase()]=a,o[a]=o[a]?o[a]+", "+b:b},this.getResponseHeader=function(a){return"string"==typeof a&&this.readyState>this.OPENED&&k&&k.headers&&k.headers[a.toLowerCase()]&&!t?k.headers[a.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState