From 06269f8c1542fd2869c35bd0a7aabafad1691bde Mon Sep 17 00:00:00 2001 From: Constantine Yurevich Date: Mon, 6 Jun 2016 17:21:00 +0300 Subject: [PATCH] - DOM components product list name tracking - Retail Rocket recommendation clicks tracking --- README.md | 4 +- dist/dd-manager.js | 108 ++++++++++++++++------ dist/dd-manager.min.js | 6 +- package.json | 2 +- src/DDHelper.js | 8 +- src/DOMComponentsTracking.js | 53 +++++++---- src/EventDataEnricher.js | 2 +- src/ddManager.js | 2 +- src/integrations/RetailRocket.js | 26 ++++++ test/DDHelperSpec.js | 11 ++- test/integrations/RetailRocketSpec.js | 123 ++++++++++++++++++++++++++ 11 files changed, 290 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 0cbf16b..d4c7d5a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/driveback/digital-data-manager.svg?branch=master)](https://travis-ci.org/driveback/digital-data-manager) -Digital Data Manager is an open source library which provides the hassle-free way to integrate Digital Data Layer on your website, collect customer data with one API and send it to hundreds of tools for analytics, marketing, and data warehousing. More info at [http://www.data-layer.net](http://www.data-layer.net). +Digital Data Manager is an open source library which provides the hassle-free way to integrate Digital Data Layer on your website, collect customer data with one API and send it to hundreds of tools for analytics, marketing, and data warehousing. More info at [http://digitaldata.readme.io](http://digitaldata.readme.io). ##Defining Digital Data Layer ```html @@ -236,7 +236,7 @@ ddManager.once('ready', function() { ``` ## Learn more at these links (in Russian) -- [Digital Data Layer Website](https://www.data-layer.net) +- [DigitalData Documentation](https://digitaldata.readme.io) - [Driveback Blog](http://blog.driveback.ru) ## License diff --git a/dist/dd-manager.js b/dist/dd-manager.js index dc00cc8..e2ebe7b 100644 --- a/dist/dd-manager.js +++ b/dist/dd-manager.js @@ -4821,7 +4821,9 @@ var DDHelper = (function () { }; DDHelper.getProduct = function getProduct(id, digitalData) { - if (digitalData.product && String(digitalData.product.id) === String(id)) { + var listName = arguments.length <= 2 || arguments[2] === undefined ? undefined : arguments[2]; + + if (!listName && digitalData.product && String(digitalData.product.id) === String(id)) { return (0, _componentClone2['default'])(digitalData.product); } // search in listings @@ -4847,7 +4849,7 @@ var DDHelper = (function () { var listing = _ref2; - if (listing.items && listing.items.length) { + if (listing.items && listing.items.length && (!listName || listName === listing.listName)) { for (var i = 0, length = listing.items.length; i < length; i++) { if (listing.items[i].id && String(listing.items[i].id) === String(id)) { var product = (0, _componentClone2['default'])(listing.items[i]); @@ -4861,7 +4863,7 @@ var DDHelper = (function () { } } // search in cart - if (digitalData.cart && digitalData.cart.lineItems && digitalData.cart.lineItems.length) { + if (!listName && digitalData.cart && digitalData.cart.lineItems && digitalData.cart.lineItems.length) { for (var _iterator = digitalData.cart.lineItems, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; @@ -4925,10 +4927,11 @@ function _classCallCheck(instance, Constructor) { /** * Automatically tracks DOM components with proper data-attributes * - * - data-ddl-viewed-product="" - * - data-ddl-viewed-campaign="" - * - data-ddl-clicked-product="" - * - data-ddl-clicked-campaign="" + * - data-ddl-viewed-product="" + * - data-ddl-viewed-campaign="" + * - data-ddl-clicked-product="" + * - data-ddl-clicked-campaign="" + * - data-ddl-product-list-name="" * * If any DOM components are added to the page dynamically * corresponding digitalData variable should be updated: @@ -5019,7 +5022,8 @@ var DOMComponentsTracking = (function () { var $el = window.jQuery(this); var id = $el.data('ddl-clicked-' + type); if (type === 'product') { - self.fireClickedProduct(id); + var listName = self.findParentByDataAttr('ddl-product-list-name', $el).data('ddl-product-list-name'); + self.fireClickedProduct(id, listName); } else if (type === 'campaign') { self.fireClickedCampaign(id); } @@ -5039,7 +5043,7 @@ var DOMComponentsTracking = (function () { var _this4 = this; var _loop = function _loop(type) { - var newViewedComponentIds = []; + var newViewedComponents = []; var $components = _this4.$digitalDataComponents[type]; $components.each(function (index, el) { // eslint-disable-line no-loop-func @@ -5047,15 +5051,22 @@ var DOMComponentsTracking = (function () { var id = $el.data('ddl-viewed-' + type); if (_this4.viewedComponentIds[type].indexOf(id) < 0 && _this4.isVisible($el)) { _this4.viewedComponentIds[type].push(id); - newViewedComponentIds.push(id); + if (type === 'product') { + var product = { id: id }; + var listName = _this4.findParentByDataAttr('ddl-product-list-name', $el).data('ddl-product-list-name'); + if (listName) product.listName = listName; + newViewedComponents.push(product); + } else { + newViewedComponents.push(id); + } } }); - if (newViewedComponentIds.length > 0) { + if (newViewedComponents.length > 0) { if (type === 'product') { - _this4.fireViewedProduct(newViewedComponentIds); + _this4.fireViewedProduct(newViewedComponents); } else if (type === 'campaign') { - _this4.fireViewedCampaign(newViewedComponentIds); + _this4.fireViewedCampaign(newViewedComponents); } } }; @@ -5082,11 +5093,11 @@ var DOMComponentsTracking = (function () { }, 500); }; - DOMComponentsTracking.prototype.fireViewedProduct = function fireViewedProduct(productIds) { + DOMComponentsTracking.prototype.fireViewedProduct = function fireViewedProduct(products) { window.digitalData.events.push({ name: 'Viewed Product', category: 'Ecommerce', - product: productIds + product: products }); }; @@ -5098,11 +5109,14 @@ var DOMComponentsTracking = (function () { }); }; - DOMComponentsTracking.prototype.fireClickedProduct = function fireClickedProduct(productId) { + DOMComponentsTracking.prototype.fireClickedProduct = function fireClickedProduct(productId, listName) { window.digitalData.events.push({ name: 'Clicked Product', category: 'Ecommerce', - product: productId + product: { + id: productId, + listName: listName + } }); }; @@ -5166,7 +5180,19 @@ var DOMComponentsTracking = (function () { DOMComponentsTracking.prototype.findByDataAttr = function findByDataAttr(name, obj) { if (!obj) obj = window.jQuery(document.body); - return obj.find('[data-' + name + ']'); + return obj.find(this.getDataAttrSelector(name)); + }; + + /** + * Find parent element by data attribute name + * + * @param name + * @param obj + * @returns jQuery object + */ + + DOMComponentsTracking.prototype.findParentByDataAttr = function findParentByDataAttr(name, obj) { + return obj.closest(this.getDataAttrSelector(name)); }; DOMComponentsTracking.prototype.getDataAttrSelector = function getDataAttrSelector(name) { @@ -5305,7 +5331,7 @@ var EventDataEnricher = (function () { } if (productId) { - var ddlProduct = _DDHelper2['default'].getProduct(productId, digitalData) || {}; + var ddlProduct = _DDHelper2['default'].getProduct(productId, digitalData, _product.listName) || {}; if (ddlProduct) { _product = Object.assign(ddlProduct, _product); } @@ -6224,7 +6250,7 @@ function _initializeIntegrations(settings, onReady) { ddManager = { - VERSION: '1.0.15', + VERSION: '1.0.16', setAvailableIntegrations: function setAvailableIntegrations(availableIntegrations) { _availableIntegrations = availableIntegrations; @@ -8548,7 +8574,8 @@ var RetailRocket = (function (_Integration) { userIdProperty: 'user.userId', trackProducts: true, // legacy setting, use noConflict instead noConflict: false, - trackAllEmails: false + trackAllEmails: false, + listMethods: {} }, options); // legacy setting mapper @@ -8614,6 +8641,8 @@ var RetailRocket = (function (_Integration) { this.onAddedProduct(event.product); } else if (event.name === 'Viewed Product Detail') { this.onViewedProductDetail(event.product); + } else if (event.name === 'Clicked Product') { + this.onClickedProduct(event.product); } else if (event.name === 'Completed Transaction') { this.onCompletedTransaction(event.transaction); } else if (event.name === 'Subscribed') { @@ -8702,9 +8731,34 @@ var RetailRocket = (function (_Integration) { }); }; - RetailRocket.prototype.onCompletedTransaction = function onCompletedTransaction(transaction) { + RetailRocket.prototype.onClickedProduct = function onClickedProduct(product) { var _this6 = this; + var productId = this.getProductId(product); + if (!productId) { + this.onValidationError('product.id'); + return; + } + var listName = product.listName; + if (!listName) { + return; + } + var methodName = this.getOption('listMethods')[listName]; + if (!methodName) { + return; + } + window.rrApiOnReady.push(function () { + try { + window.rrApi.recomMouseDown(productId, methodName); + } catch (e) { + _this6.onError(e); + } + }); + }; + + RetailRocket.prototype.onCompletedTransaction = function onCompletedTransaction(transaction) { + var _this7 = this; + transaction = transaction || {}; if (!this.validateTransaction(transaction)) { return; @@ -8731,13 +8785,13 @@ var RetailRocket = (function (_Integration) { items: items }); } catch (e) { - _this6.onError(e); + _this7.onError(e); } }); }; RetailRocket.prototype.onSubscribed = function onSubscribed(user) { - var _this7 = this; + var _this8 = this; user = user || {}; if (!user.email) { @@ -8748,13 +8802,13 @@ var RetailRocket = (function (_Integration) { try { window.rrApi.setEmail(user.email); } catch (e) { - _this7.onError(e); + _this8.onError(e); } }); }; RetailRocket.prototype.onSearched = function onSearched(query) { - var _this8 = this; + var _this9 = this; if (!query) { this.onValidationError('query'); @@ -8764,7 +8818,7 @@ var RetailRocket = (function (_Integration) { try { window.rrApi.search(query); } catch (e) { - _this8.onError(e); + _this9.onError(e); } }); }; diff --git a/dist/dd-manager.min.js b/dist/dd-manager.min.js index dc50561..30f58cb 100644 --- a/dist/dd-manager.min.js +++ b/dist/dd-manager.min.js @@ -1,4 +1,4 @@ !function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!c&&u)return u(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0&&t.length%1===0}function f(t,e){for(var n=-1,r=t.length;++nr?r:null}):(n=q(t),e=n.length,function(){return r++,e>r?n[r]:null})}function m(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),o=0;n>o;o++)r[o]=arguments[o+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r)}}}function w(t){return function(e,n,r){return t(e,r)}}function v(t){return function(e,n,o){o=u(o||r),e=e||[];var i=g(e);if(0>=t)return o(null);var a=!1,s=0,f=!1;!function d(){if(a&&0>=s)return o(null);for(;t>s&&!f;){var r=i();if(null===r)return a=!0,void(0>=s&&o(null));s+=1,n(e[r],r,c(function(t){s-=1,t?(o(t),f=!0):d()}))}}()}}function b(t){return function(e,n,r){return t($.eachOf,e,n,r)}}function E(t){return function(e,n,r,o){return t(v(n),e,r,o)}}function P(t){return function(e,n,r){return t($.eachOfSeries,e,n,r)}}function j(t,e,n,o){o=u(o||r),e=e||[];var i=s(e)?[]:{};t(e,function(t,e,r){n(t,function(t,n){i[e]=n,r(t)})},function(t){o(t,i)})}function k(t,e,n,r){var o=[];t(e,function(t,e,r){n(t,function(n){n&&o.push({index:e,value:t}),r()})},function(){r(d(o.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function _(t,e,n,r){k(t,e,function(t,e){n(t,function(t){e(!t)})},r)}function A(t,e,n){return function(r,o,i,a){function c(){a&&a(n(!1,void 0))}function u(t,r,o){return a?void i(t,function(r){a&&e(r)&&(a(n(!0,t)),a=i=!1),o()}):o()}arguments.length>3?t(r,o,u,c):(a=i,i=o,t(r,u,c))}}function O(t,e){return e}function S(t,e,n){n=n||r;var o=s(e)?[]:{};t(e,function(t,e,n){t(m(function(t,r){r.length<=1&&(r=r[0]),o[e]=r,n(t)}))},function(t){n(t,o)})}function I(t,e,n,r){var o=[];t(e,function(t,e,r){n(t,function(t,e){o=o.concat(e||[]),r(t)})},function(t){r(t,o)})}function C(t,e,n){function o(t,e,n,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,B(e)||(e=[e]),0===e.length&&t.idle()?$.setImmediate(function(){t.drain()}):(f(e,function(e){var i={data:e,callback:o||r};n?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void $.setImmediate(t.process))}function i(t,e){return function(){a-=1;var n=!1,r=arguments;f(e,function(t){f(u,function(e,r){e!==t||n||(u.splice(r,1),n=!0)}),t.callback.apply(t,r)}),t.tasks.length+a===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var a=0,u=[],s={tasks:[],concurrency:e,payload:n,saturated:r,empty:r,drain:r,started:!1,paused:!1,push:function(t,e){o(s,t,!1,e)},kill:function(){s.drain=r,s.tasks=[]},unshift:function(t,e){o(s,t,!0,e)},process:function(){if(!s.paused&&a=e;e++)$.setImmediate(s.process)}}};return s}function D(t){return m(function(e,n){e.apply(null,n.concat([m(function(e,n){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&f(n,function(e){console[t](e)}))})]))})}function T(t){return function(e,n,r){t(l(e),n,r)}}function x(t){return m(function(e,n){var r=m(function(n){var r=this,o=n.pop();return t(e,function(t,e,o){t.apply(r,n.concat([o]))},o)});return n.length?r.apply(this,n):r})}function L(t){return m(function(e){var n=e.pop();e.push(function(){var t=arguments;r?$.setImmediate(function(){n.apply(null,t)}):n.apply(null,t)});var r=!0;t.apply(this,e),r=!1})}var R,$={},M="object"==typeof self&&self.self===self&&self||"object"==typeof n&&n.global===n&&n||this;null!=M&&(R=M.async),$.noConflict=function(){return M.async=R,$};var V=Object.prototype.toString,B=Array.isArray||function(t){return"[object Array]"===V.call(t)},U=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},q=Object.keys||function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},N="function"==typeof setImmediate&&setImmediate,z=N?function(t){N(t)}:function(t){setTimeout(t,0)};"object"==typeof t&&"function"==typeof t.nextTick?$.nextTick=t.nextTick:$.nextTick=z,$.setImmediate=N?z:$.nextTick,$.forEach=$.each=function(t,e,n){return $.eachOf(t,w(e),n)},$.forEachSeries=$.eachSeries=function(t,e,n){return $.eachOfSeries(t,w(e),n)},$.forEachLimit=$.eachLimit=function(t,e,n,r){return v(e)(t,w(n),r)},$.forEachOf=$.eachOf=function(t,e,n){function o(t){s--,t?n(t):null===i&&0>=s&&n(null)}n=u(n||r),t=t||[];for(var i,a=g(t),s=0;null!=(i=a());)s+=1,e(t[i],i,c(o));0===s&&n(null)},$.forEachOfSeries=$.eachOfSeries=function(t,e,n){function o(){var r=!0;return null===a?n(null):(e(t[a],a,c(function(t){if(t)n(t);else{if(a=i(),null===a)return n(null);r?$.setImmediate(o):o()}})),void(r=!1))}n=u(n||r),t=t||[];var i=g(t),a=i();o()},$.forEachOfLimit=$.eachOfLimit=function(t,e,n,r){v(e)(t,n,r)},$.map=b(j),$.mapSeries=P(j),$.mapLimit=E(j),$.inject=$.foldl=$.reduce=function(t,e,n,r){$.eachOfSeries(t,function(t,r,o){n(e,t,function(t,n){e=n,o(t)})},function(t){r(t,e)})},$.foldr=$.reduceRight=function(t,e,n,r){var i=d(t,o).reverse();$.reduce(i,e,n,r)},$.transform=function(t,e,n,r){3===arguments.length&&(r=n,n=e,e=B(t)?[]:{}),$.eachOf(t,function(t,r,o){n(e,t,r,o)},function(t){r(t,e)})},$.select=$.filter=b(k),$.selectLimit=$.filterLimit=E(k),$.selectSeries=$.filterSeries=P(k),$.reject=b(_),$.rejectLimit=E(_),$.rejectSeries=P(_),$.any=$.some=A($.eachOf,i,o),$.someLimit=A($.eachOfLimit,i,o),$.all=$.every=A($.eachOf,a,a),$.everyLimit=A($.eachOfLimit,a,a),$.detect=A($.eachOf,o,O),$.detectSeries=A($.eachOfSeries,o,O),$.detectLimit=A($.eachOfLimit,o,O),$.sortBy=function(t,e,n){function r(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0}$.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){return t?n(t):void n(null,d(e.sort(r),function(t){return t.value}))})},$.auto=function(t,e,n){function o(t){g.unshift(t)}function i(t){var e=y(g,t);e>=0&&g.splice(e,1)}function a(){s--,f(g.slice(0),function(t){t()})}n||(n=e,e=null),n=u(n||r);var c=q(t),s=c.length;if(!s)return n(null);e||(e=s);var d={},l=0,g=[];o(function(){s||n(null,d)}),f(c,function(r){function c(){return e>l&&p(w,function(t,e){return t&&d.hasOwnProperty(e)},!0)&&!d.hasOwnProperty(r)}function u(){c()&&(l++,i(u),f[f.length-1](g,d))}for(var s,f=B(t[r])?t[r]:[t[r]],g=m(function(t,e){if(l--,e.length<=1&&(e=e[0]),t){var o={};h(d,function(t,e){o[e]=t}),o[r]=e,n(t,o)}else d[r]=e,$.setImmediate(a)}),w=f.slice(0,f.length-1),v=w.length;v--;){if(!(s=t[w[v]]))throw new Error("Has inexistant dependency");if(B(s)&&y(s,r)>=0)throw new Error("Has cyclic dependencies")}c()?(l++,f[f.length-1](g,d)):o(u)})},$.retry=function(t,e,n){function r(t,e){if("number"==typeof e)t.times=parseInt(e,10)||i;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||i,t.interval=parseInt(e.interval,10)||a}}function o(t,e){function n(t,n){return function(r){t(function(t,e){r(!t||n,{err:t,result:e})},e)}}function r(t){return function(e){setTimeout(function(){e(null)},t)}}for(;u.times;){var o=!(u.times-=1);c.push(n(u.task,o)),!o&&u.interval>0&&c.push(r(u.interval))}$.series(c,function(e,n){n=n[n.length-1],(t||u.callback)(n.err,n.result)})}var i=5,a=0,c=[],u={times:i,interval:a},s=arguments.length;if(1>s||s>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=s&&"function"==typeof t&&(n=e,e=t),"function"!=typeof t&&r(u,t),u.callback=n,u.task=e,u.callback?o():o},$.waterfall=function(t,e){function n(t){return m(function(r,o){if(r)e.apply(null,[r].concat(o));else{var i=t.next();i?o.push(n(i)):o.push(e),L(t).apply(null,o)}})}if(e=u(e||r),!B(t)){var o=new Error("First argument to waterfall must be an array of functions");return e(o)}return t.length?void n($.iterator(t))():e()},$.parallel=function(t,e){S($.eachOf,t,e)},$.parallelLimit=function(t,e,n){S(v(e),t,n)},$.series=function(t,e){S($.eachOfSeries,t,e)},$.iterator=function(t){function e(n){function r(){return t.length&&t[n].apply(null,arguments),r.next()}return r.next=function(){return nr;){var i=r+(o-r+1>>>1);n(e,t[i])>=0?r=i:o=i-1}return r}function i(t,e,i,a){if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");return t.started=!0,B(e)||(e=[e]),0===e.length?$.setImmediate(function(){t.drain()}):void f(e,function(e){var c={data:e,priority:i,callback:"function"==typeof a?a:r};t.tasks.splice(o(t.tasks,c,n)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),$.setImmediate(t.process)})}var a=$.queue(t,e);return a.push=function(t,e,n){i(a,t,e,n)},delete a.unshift,a},$.cargo=function(t,e){return C(t,1,e)},$.log=D("log"),$.dir=D("dir"),$.memoize=function(t,e){var n={},r={};e=e||o;var i=m(function(o){var i=o.pop(),a=e.apply(null,o);a in n?$.setImmediate(function(){i.apply(null,n[a])}):a in r?r[a].push(i):(r[a]=[i],t.apply(null,o.concat([m(function(t){n[a]=t;var e=r[a];delete r[a];for(var o=0,i=e.length;i>o;o++)e[o].apply(null,t)})])))});return i.memo=n,i.unmemoized=t,i},$.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},$.times=T($.map),$.timesSeries=T($.mapSeries),$.timesLimit=function(t,e,n,r){return $.mapLimit(l(t),e,n,r)},$.seq=function(){var t=arguments;return m(function(e){var n=this,o=e[e.length-1];"function"==typeof o?e.pop():o=r,$.reduce(t,e,function(t,e,r){e.apply(n,t.concat([m(function(t,e){r(t,e)})]))},function(t,e){o.apply(n,[t].concat(e))})})},$.compose=function(){return $.seq.apply(null,Array.prototype.reverse.call(arguments))},$.applyEach=x($.eachOf),$.applyEachSeries=x($.eachOfSeries),$.forever=function(t,e){function n(t){return t?o(t):void i(n)}var o=c(e||r),i=L(t);n()},$.ensureAsync=L,$.constant=m(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),$.wrapSync=$.asyncify=function(t){return m(function(e){var n,r=e.pop();try{n=t.apply(this,e)}catch(o){return r(o)}U(n)&&"function"==typeof n.then?n.then(function(t){r(null,t)})["catch"](function(t){r(t.message?t:new Error(t))}):r(null,n)})},"object"==typeof e&&e.exports?e.exports=$:"function"==typeof define&&define.amd?define([],function(){return $}):M.async=$}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:49}],2:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a||e===d?62:e===c||e===l?63:u>e?-1:u+10>e?e-u+26+26:f+26>e?e-f:s+26>e?e-s+26:void 0}function n(t){function n(t){s[d++]=t}var r,o,a,c,u,s;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=t.length;u="="===t.charAt(f-2)?2:"="===t.charAt(f-1)?1:0,s=new i(3*t.length/4-u),a=u>0?t.length-4:t.length;var d=0;for(r=0,o=0;a>r;r+=4,o+=3)c=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&c)>>16),n((65280&c)>>8),n(255&c);return 2===u?(c=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&c)):1===u&&(c=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(c>>8&255),n(255&c)),s}function o(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var o,i,a,c=t.length%3,u="";for(o=0,a=t.length-c;a>o;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],u+=n(i);switch(c){case 1:i=t[t.length-1],u+=e(i>>2),u+=e(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=e(i>>10),u+=e(i>>4&63),u+=e(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),c="/".charCodeAt(0),u="0".charCodeAt(0),s="a".charCodeAt(0),f="A".charCodeAt(0),d="-".charCodeAt(0),l="_".charCodeAt(0);t.toByteArray=n,t.fromByteArray=o}("undefined"==typeof n?this.base64js={}:n)},{}],3:[function(t,e,n){(function(e){function r(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(n){return!1}}function o(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t){return this instanceof i?(this.length=0,this.parent=void 0,"number"==typeof t?a(this,t):"string"==typeof t?c(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new i(t,arguments[1]):new i(t)}function a(t,e){if(t=y(t,0>e?0:0|g(e)),!i.TYPED_ARRAY_SUPPORT)for(var n=0;e>n;n++)t[n]=0;return t}function c(t,e,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|w(e,n);return t=y(t,r),t.write(e,n),t}function u(t,e){if(i.isBuffer(e))return s(t,e);if(X(e))return f(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return d(t,e);if(e instanceof ArrayBuffer)return l(t,e)}return e.length?p(t,e):h(t,e)}function s(t,e){var n=0|g(e.length);return t=y(t,n),e.copy(t,0,0,n),t}function f(t,e){var n=0|g(e.length);t=y(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function d(t,e){var n=0|g(e.length);t=y(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function l(t,e){return i.TYPED_ARRAY_SUPPORT?(e.byteLength,t=i._augment(new Uint8Array(e))):t=d(t,new Uint8Array(e)),t}function p(t,e){var n=0|g(e.length);t=y(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function h(t,e){var n,r=0;"Buffer"===e.type&&X(e.data)&&(n=e.data,r=0|g(n.length)),t=y(t,r);for(var o=0;r>o;o+=1)t[o]=255&n[o];return t}function y(t,e){i.TYPED_ARRAY_SUPPORT?(t=i._augment(new Uint8Array(e)),t.__proto__=i.prototype):(t.length=e,t._isBuffer=!0);var n=0!==e&&e<=i.poolSize>>>1;return n&&(t.parent=J),t}function g(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var n=new i(t,e);return delete n.parent,n}function w(t,e){"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(r)return z(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if(e=0|e,n=void 0===n||n===1/0?this.length:0|n,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return D(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return I(this,e,n);case"binary":return C(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var i=e.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;r>a;a++){var c=parseInt(e.substr(2*a,2),16);if(isNaN(c))throw new Error("Invalid hex string");t[n+a]=c}return a}function E(t,e,n,r){return G(z(e,t.length-n),t,n,r)}function P(t,e,n,r){return G(F(e),t,n,r)}function j(t,e,n,r){return P(t,e,n,r)}function k(t,e,n,r){return G(H(e),t,n,r)}function _(t,e,n,r){return G(Y(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;n>o;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(n>=o+c){var u,s,f,d;switch(c){case 1:128>i&&(a=i);break;case 2:u=t[o+1],128===(192&u)&&(d=(31&i)<<6|63&u,d>127&&(a=d));break;case 3:u=t[o+1],s=t[o+2],128===(192&u)&&128===(192&s)&&(d=(15&i)<<12|(63&u)<<6|63&s,d>2047&&(55296>d||d>57343)&&(a=d));break;case 4:u=t[o+1],s=t[o+2],f=t[o+3],128===(192&u)&&128===(192&s)&&128===(192&f)&&(d=(15&i)<<18|(63&u)<<12|(63&s)<<6|63&f,d>65535&&1114112>d&&(a=d))}}null===a?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=c}return S(r)}function S(t){var e=t.length;if(K>=e)return String.fromCharCode.apply(String,t);for(var n="",r=0;e>r;)n+=String.fromCharCode.apply(String,t.slice(r,r+=K));return n}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;n>o;o++)r+=String.fromCharCode(127&t[o]);return r}function C(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;n>o;o++)r+=String.fromCharCode(t[o]);return r}function D(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=e;n>i;i++)o+=N(t[i]);return o}function T(t,e,n){for(var r=t.slice(e,n),o="",i=0;it)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range")}function R(t,e,n,r){0>e&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);i>o;o++)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function $(t,e,n,r){0>e&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);i>o;o++)t[n+o]=e>>>8*(r?o:3-o)&255}function M(t,e,n,r,o,i){if(e>o||i>e)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function V(t,e,n,r,o){return o||M(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,o){return o||M(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,n,r,52,8),n+8}function U(t){if(t=q(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function N(t){return 16>t?"0"+t.toString(16):t.toString(16)}function z(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;r>a;a++){if(n=t.charCodeAt(a),n>55295&&57344>n){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(56320>n){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,128>n){if((e-=1)<0)break;i.push(n)}else if(2048>n){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(65536>n){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function H(t){return W.toByteArray(U(t))}function G(t,e,n,r){for(var o=0;r>o&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}var W=t("base64-js"),Q=t("ieee754"),X=t("is-array");n.Buffer=i,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,i.poolSize=8192;var J={};i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:r(),i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array),i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);a>o&&t[o]===e[o];)++o;return o!==a&&(n=t[o],r=e[o]),r>n?-1:n>r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!X(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new i(0);var n;if(void 0===e)for(e=0,n=0;n0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:i.compare(this,t)},i.prototype.indexOf=function(t,e){function n(t,e,n){for(var r=-1,o=0;n+o2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(i.isBuffer(t))return n(this,t,e);if("number"==typeof t)return i.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):n(this,[t],e);throw new TypeError("val must be string, number or Buffer")},i.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},i.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var o=r;r=e,e=0|n,n=o}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(0>n||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return P(this,t,e,n);case"binary":return j(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),t>e&&(e=t);var r;if(i.TYPED_ARRAY_SUPPORT)r=i._augment(this.subarray(t,e));else{var o=e-t;r=new i(o,void 0);for(var a=0;o>a;a++)r[a]=this[a+t]}return r.length&&(r.parent=this.parent||this),r},i.prototype.readUIntLE=function(t,e,n){t=0|t,e=0|e,n||x(t,e,this.length);for(var r=this[t],o=1,i=0;++i0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||x(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||x(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),Q.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),Q.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),Q.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),Q.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e=0|e,n=0|n,r||L(this,t,e,n,Math.pow(2,8*n),0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):$(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=0|e,!r){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var i=0,a=1,c=0>t?1:0;for(this[e]=255&t;++i>0)-c&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=0|e,!r){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var i=n-1,a=1,c=0>t?1:0;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=(t/a>>0)-c&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):$(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e=0|e,n||L(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):$(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-en&&r>e)for(o=a-1;o>=0;o--)t[o+e]=this[o+n];else if(1e3>a||!i.TYPED_ARRAY_SUPPORT)for(o=0;a>o;o++)t[o+e]=this[o+n];else t._set(this.subarray(n,n+a),e);return a},i.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new RangeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var o=z(t.toString()),i=o.length;for(r=e;n>r;r++)this[r]=o[r%i]}return this}},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i.TYPED_ARRAY_SUPPORT)return new i(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Z=i.prototype;i._augment=function(t){return t.constructor=i,t._isBuffer=!0,t._set=t.set,t.get=Z.get,t.set=Z.set,t.write=Z.write,t.toString=Z.toString,t.toLocaleString=Z.toString,t.toJSON=Z.toJSON,t.equals=Z.equals,t.compare=Z.compare,t.indexOf=Z.indexOf,t.copy=Z.copy,t.slice=Z.slice,t.readUIntLE=Z.readUIntLE,t.readUIntBE=Z.readUIntBE,t.readUInt8=Z.readUInt8,t.readUInt16LE=Z.readUInt16LE,t.readUInt16BE=Z.readUInt16BE,t.readUInt32LE=Z.readUInt32LE,t.readUInt32BE=Z.readUInt32BE,t.readIntLE=Z.readIntLE,t.readIntBE=Z.readIntBE, -t.readInt8=Z.readInt8,t.readInt16LE=Z.readInt16LE,t.readInt16BE=Z.readInt16BE,t.readInt32LE=Z.readInt32LE,t.readInt32BE=Z.readInt32BE,t.readFloatLE=Z.readFloatLE,t.readFloatBE=Z.readFloatBE,t.readDoubleLE=Z.readDoubleLE,t.readDoubleBE=Z.readDoubleBE,t.writeUInt8=Z.writeUInt8,t.writeUIntLE=Z.writeUIntLE,t.writeUIntBE=Z.writeUIntBE,t.writeUInt16LE=Z.writeUInt16LE,t.writeUInt16BE=Z.writeUInt16BE,t.writeUInt32LE=Z.writeUInt32LE,t.writeUInt32BE=Z.writeUInt32BE,t.writeIntLE=Z.writeIntLE,t.writeIntBE=Z.writeIntBE,t.writeInt8=Z.writeInt8,t.writeInt16LE=Z.writeInt16LE,t.writeInt16BE=Z.writeInt16BE,t.writeInt32LE=Z.writeInt32LE,t.writeInt32BE=Z.writeInt32BE,t.writeFloatLE=Z.writeFloatLE,t.writeFloatBE=Z.writeFloatBE,t.writeDoubleLE=Z.writeDoubleLE,t.writeDoubleBE=Z.writeDoubleBE,t.fill=Z.fill,t.inspect=Z.inspect,t.toArrayBuffer=Z.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":2,ieee754:46,"is-array":47}],4:[function(t,e,n){function r(t){switch(o(t)){case"object":var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=r(t[n]));return e;case"array":for(var e=new Array(t.length),i=0,a=t.length;a>i;i++)e[i]=r(t[i]);return e;case"regexp":var c="";return c+=t.multiline?"m":"",c+=t.global?"g":"",c+=t.ignoreCase?"i":"",new RegExp(t.source,c);case"date":return new Date(t.getTime());default:return t}}var o;try{o=t("component-type")}catch(i){o=t("type")}e.exports=r},{"component-type":6,type:6}],5:[function(t,e,n){function r(t){return t?o(t):void 0}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,o=0;or;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],6:[function(t,e,n){(function(t){var n=Object.prototype.toString;e.exports=function(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!==e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof t&&t.isBuffer(e)?"buffer":(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e),typeof e)}}).call(this,t("buffer").Buffer)},{buffer:3}],7:[function(t,e,n){e.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],8:[function(t,e,n){var r=t("./$.is-object");e.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},{"./$.is-object":27}],9:[function(t,e,n){var r=t("./$.to-iobject"),o=t("./$.to-length"),i=t("./$.to-index");e.exports=function(t){return function(e,n,a){var c,u=r(e),s=o(u.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if(c=u[f++],c!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===n)return t||f;return!t&&-1}}},{"./$.to-index":34,"./$.to-iobject":36,"./$.to-length":37}],10:[function(t,e,n){var r=t("./$.ctx"),o=t("./$.iobject"),i=t("./$.to-object"),a=t("./$.to-length"),c=t("./$.array-species-create");e.exports=function(t){var e=1==t,n=2==t,u=3==t,s=4==t,f=6==t,d=5==t||f;return function(l,p,h){for(var y,g,m=i(l),w=o(m),v=r(p,h,3),b=a(w.length),E=0,P=e?c(l,b):n?c(l,0):void 0;b>E;E++)if((d||E in w)&&(y=w[E],g=v(y,E,m),t))if(e)P[E]=g;else if(g)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:P.push(y)}else if(s)return!1;return f?-1:u||s?s:P}}},{"./$.array-species-create":11,"./$.ctx":14,"./$.iobject":25,"./$.to-length":37,"./$.to-object":38}],11:[function(t,e,n){var r=t("./$.is-object"),o=t("./$.is-array"),i=t("./$.wks")("species");e.exports=function(t,e){var n;return o(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!o(n.prototype)||(n=void 0),r(n)&&(n=n[i],null===n&&(n=void 0))),new(void 0===n?Array:n)(e)}},{"./$.is-array":26,"./$.is-object":27,"./$.wks":40}],12:[function(t,e,n){var r={}.toString;e.exports=function(t){return r.call(t).slice(8,-1)}},{}],13:[function(t,e,n){var r=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},{}],14:[function(t,e,n){var r=t("./$.a-function");e.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},{"./$.a-function":7}],15:[function(t,e,n){e.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],16:[function(t,e,n){e.exports=!t("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":19}],17:[function(t,e,n){var r=t("./$.is-object"),o=t("./$.global").document,i=r(o)&&r(o.createElement);e.exports=function(t){return i?o.createElement(t):{}}},{"./$.global":20,"./$.is-object":27}],18:[function(t,e,n){var r=t("./$.global"),o=t("./$.core"),i=t("./$.hide"),a=t("./$.redefine"),c=t("./$.ctx"),u="prototype",s=function(t,e,n){var f,d,l,p,h=t&s.F,y=t&s.G,g=t&s.S,m=t&s.P,w=t&s.B,v=y?r:g?r[e]||(r[e]={}):(r[e]||{})[u],b=y?o:o[e]||(o[e]={}),E=b[u]||(b[u]={});y&&(n=e);for(f in n)d=!h&&v&&f in v,l=(d?v:n)[f],p=w&&d?c(l,r):m&&"function"==typeof l?c(Function.call,l):l,v&&!d&&a(v,f,l),b[f]!=l&&i(b,f,p),m&&E[f]!=l&&(E[f]=l)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,e.exports=s},{"./$.core":13,"./$.ctx":14,"./$.global":20,"./$.hide":22,"./$.redefine":31}],19:[function(t,e,n){e.exports=function(t){try{return!!t()}catch(e){return!0}}},{}],20:[function(t,e,n){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],21:[function(t,e,n){var r={}.hasOwnProperty;e.exports=function(t,e){return r.call(t,e)}},{}],22:[function(t,e,n){var r=t("./$"),o=t("./$.property-desc");e.exports=t("./$.descriptors")?function(t,e,n){return r.setDesc(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},{"./$":28,"./$.descriptors":16,"./$.property-desc":30}],23:[function(t,e,n){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":20}],24:[function(t,e,n){e.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},{}],25:[function(t,e,n){var r=t("./$.cof");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},{"./$.cof":12}],26:[function(t,e,n){var r=t("./$.cof");e.exports=Array.isArray||function(t){return"Array"==r(t)}},{"./$.cof":12}],27:[function(t,e,n){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],28:[function(t,e,n){var r=Object;e.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},{}],29:[function(t,e,n){var r=t("./$"),o=t("./$.to-object"),i=t("./$.iobject");e.exports=t("./$.fails")(function(){var t=Object.assign,e={},n={},r=Symbol(),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach(function(t){n[t]=t}),7!=t({},e)[r]||Object.keys(t({},n)).join("")!=o})?function(t,e){for(var n=o(t),a=arguments,c=a.length,u=1,s=r.getKeys,f=r.getSymbols,d=r.isEnum;c>u;)for(var l,p=i(a[u++]),h=f?s(p).concat(f(p)):s(p),y=h.length,g=0;y>g;)d.call(p,l=h[g++])&&(n[l]=p[l]);return n}:Object.assign},{"./$":28,"./$.fails":19,"./$.iobject":25,"./$.to-object":38}],30:[function(t,e,n){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],31:[function(t,e,n){var r=t("./$.global"),o=t("./$.hide"),i=t("./$.uid")("src"),a="toString",c=Function[a],u=(""+c).split(a);t("./$.core").inspectSource=function(t){return c.call(t)},(e.exports=function(t,e,n,a){"function"==typeof n&&(n.hasOwnProperty(i)||o(n,i,t[e]?""+t[e]:u.join(String(e))),n.hasOwnProperty("name")||o(n,"name",e)),t===r?t[e]=n:(a||delete t[e],o(t,e,n))})(Function.prototype,a,function(){return"function"==typeof this&&this[i]||c.call(this)})},{"./$.core":13,"./$.global":20,"./$.hide":22,"./$.uid":39}],32:[function(t,e,n){var r=t("./$.global"),o="__core-js_shared__",i=r[o]||(r[o]={});e.exports=function(t){return i[t]||(i[t]={})}},{"./$.global":20}],33:[function(t,e,n){var r=t("./$.export"),o=t("./$.defined"),i=t("./$.fails"),a=" \n\x0B\f\r   ᠎              \u2028\u2029\ufeff",c="["+a+"]",u="​…",s=RegExp("^"+c+c+"*"),f=RegExp(c+c+"*$"),d=function(t,e){var n={};n[t]=e(l),r(r.P+r.F*i(function(){return!!a[t]()||u[t]()!=u}),"String",n)},l=d.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(f,"")),t};e.exports=d},{"./$.defined":15,"./$.export":18,"./$.fails":19}],34:[function(t,e,n){var r=t("./$.to-integer"),o=Math.max,i=Math.min;e.exports=function(t,e){return t=r(t),0>t?o(t+e,0):i(t,e)}},{"./$.to-integer":35}],35:[function(t,e,n){var r=Math.ceil,o=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?o:r)(t)}},{}],36:[function(t,e,n){var r=t("./$.iobject"),o=t("./$.defined");e.exports=function(t){return r(o(t))}},{"./$.defined":15,"./$.iobject":25}],37:[function(t,e,n){var r=t("./$.to-integer"),o=Math.min;e.exports=function(t){return t>0?o(r(t),9007199254740991):0}},{"./$.to-integer":35}],38:[function(t,e,n){var r=t("./$.defined");e.exports=function(t){return Object(r(t))}},{"./$.defined":15}],39:[function(t,e,n){var r=0,o=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+o).toString(36))}},{}],40:[function(t,e,n){var r=t("./$.shared")("wks"),o=t("./$.uid"),i=t("./$.global").Symbol;e.exports=function(t){return r[t]||(r[t]=i&&i[t]||(i||o)("Symbol."+t))}},{"./$.global":20,"./$.shared":32,"./$.uid":39}],41:[function(t,e,n){"use strict";var r,o=t("./$"),i=t("./$.export"),a=t("./$.descriptors"),c=t("./$.property-desc"),u=t("./$.html"),s=t("./$.dom-create"),f=t("./$.has"),d=t("./$.cof"),l=t("./$.invoke"),p=t("./$.fails"),h=t("./$.an-object"),y=t("./$.a-function"),g=t("./$.is-object"),m=t("./$.to-object"),w=t("./$.to-iobject"),v=t("./$.to-integer"),b=t("./$.to-index"),E=t("./$.to-length"),P=t("./$.iobject"),j=t("./$.uid")("__proto__"),k=t("./$.array-methods"),_=t("./$.array-includes")(!1),A=Object.prototype,O=Array.prototype,S=O.slice,I=O.join,C=o.setDesc,D=o.getDesc,T=o.setDescs,x={};a||(r=!p(function(){return 7!=C(s("div"),"a",{get:function(){return 7}}).a}),o.setDesc=function(t,e,n){if(r)try{return C(t,e,n)}catch(o){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(h(t)[e]=n.value),t},o.getDesc=function(t,e){if(r)try{return D(t,e)}catch(n){}return f(t,e)?c(!A.propertyIsEnumerable.call(t,e),t[e]):void 0},o.setDescs=T=function(t,e){h(t);for(var n,r=o.getKeys(e),i=r.length,a=0;i>a;)o.setDesc(t,n=r[a++],e[n]);return t}),i(i.S+i.F*!a,"Object",{getOwnPropertyDescriptor:o.getDesc,defineProperty:o.setDesc,defineProperties:T});var L="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),R=L.concat("length","prototype"),$=L.length,M=function(){var t,e=s("iframe"),n=$,r=">";for(e.style.display="none",u.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("