Comparing version 0.19.0 to 0.20.0
{ | ||
"name": "sajari", | ||
"version": "0.19.0", | ||
"version": "0.20.0", | ||
"description": "JavaScript SDK for the Sajari search API", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,8 +0,6 @@ | ||
# Sajari Javascript SDK (Browser only) | ||
# Sajari Javascript SDK (Browser only) · [![npm](https://img.shields.io/npm/v/sajari.svg?style=flat-square)](https://www.npmjs.com/package/sajari) [![build status](https://travis-ci.org/sajari/sajari-sdk-js.svg?branch=master)](https://travis-ci.org/sajari/sajari-sdk-js) [![docs](https://sajari.github.io/sajari-sdk-js/badge.svg)](https://sajari.github.io/sajari-sdk-js/) [![license](http://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE) | ||
[![npm](https://img.shields.io/npm/v/sajari.svg?style=flat-square)](https://www.npmjs.com/package/sajari) [![build status](https://travis-ci.org/sajari/sajari-sdk-js.svg?branch=master)](https://travis-ci.org/sajari/sajari-sdk-js) ![docs](https://doc.esdoc.org/github.com/sajari/sajari-sdk-js/badge.svg) [![license](http://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE) | ||
The Sajari Javascript SDK provides a basic API for querying Sajari search services from web browsers. | ||
If you are want to create a search UI for your website then you go to [Creating Website Search Interfaces](https://github.com/sajari/sajari-sdk-react/tree/master/examples/basic-site-integration). | ||
If you are want to create a search UI for your website then checkout our [React SDK](https://www.github.com/sajari/sajari-sdk-react) or generate a search interface from our [Console](https://www.sajari.com/console). | ||
@@ -47,3 +45,3 @@ ## Table of Contents | ||
Full documentation can be found at [https://doc.esdoc.org/github.com/sajari/sajari-sdk-js/](https://doc.esdoc.org/github.com/sajari/sajari-sdk-js/). | ||
Full documentation can be found at [https://sajari.github.io/sajari-sdk-js/](https://sajari.github.io/sajari-sdk-js/). | ||
@@ -50,0 +48,0 @@ ## License |
@@ -1,2 +0,2 @@ | ||
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="/",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return{text:t,weight:e||1}}function u(t,e,r){return[t,{metric:{field:e,type:r}}]}function a(t,e){return[t,{count:{field:e}}]}function s(t,e){return{name:t,filter:e}}function f(t,e){return[t,{bucket:{buckets:e}}]}function h(t){return t instanceof Array?{repeated:{values:t.map(String)}}:null===t?{null:!0}:{single:String(t)}}function c(t){switch(t){case"=":return"EQUAL_TO";case"!=":return"NOT_EQUAL_TO";case">":return"GREATER_THAN";case">=":return"GREATER_THAN_OR_EQUAL_TO";case"<":return"LESS_THAN";case"<=":return"LESS_THAN_OR_EQUAL_TO";case"~":return"CONTAINS";case"!~":return"DOES_NOT_CONTAIN";case"^":return"HAS_PREFIX";case"$":return"HAS_SUFFIX";default:throw"invalid operator: "+t}}function l(t,e,r){return{field:{field:t,value:h(r),operator:c(e)}}}function p(t,e,r,n,i,o){return{geo:{field_lat:t,field_lng:e,lat:r,lng:n,radius:i,region:o}}}function d(t,e){return{combinator:{filters:t,operator:e}}}function g(t){return d(t,"ALL")}function y(t){return d(t,"ANY")}function v(t){return d(t,"ONE")}function w(t){return d(t,"NONE")}function m(t,e){return{field:{field:t,value:e}}}function A(t,e){return{score:{threshold:t,minCount:e}}}function E(t,e){return{filter:{filter:t,value:e}}}function _(t,e){return{point:t,value:e}}function b(t,e){return{interval:{field:t,points:e}}}function S(t,e){return{element:{field:t,elts:e}}}function R(t,e){return{text:{field:t,text:e}}}function T(t,e){return{field_boost:t,value:e}}function I(t,e,r){return{pipeline:{name:t},values:e,tracking:r}}function B(t){return"-"===t[0]?{field:t.slice(1),order:"DESC"}:{field:t,order:"ASC"}}function P(t){return{identifier:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Tracking=e.posNeg=e.clickTracking=e.Query=e.FeatureQuery=e.IndexQuery=e.GEO_FIELD_BOOST_REGION_OUTSIDE=e.GEO_FIELD_BOOST_REGION_INSIDE=e.METRIC_TYPE_SUM=e.METRIC_TYPE_AVG=e.METRIC_TYPE_MIN=e.METRIC_TYPE_MAX=e.Client=e.userAgent=void 0;var O=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),C="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};/** | ||
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="/",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return{text:t,weight:e||1}}function u(t,e,r){return[t,{metric:{field:e,type:r}}]}function a(t,e){return[t,{count:{field:e}}]}function s(t,e){return{name:t,filter:e}}function f(t,e){return[t,{bucket:{buckets:e}}]}function c(t){return t instanceof Array?{repeated:{values:t.map(String)}}:null===t?{null:!0}:{single:String(t)}}function h(t){switch(t){case"=":return"EQUAL_TO";case"!=":return"NOT_EQUAL_TO";case">":return"GREATER_THAN";case">=":return"GREATER_THAN_OR_EQUAL_TO";case"<":return"LESS_THAN";case"<=":return"LESS_THAN_OR_EQUAL_TO";case"~":return"CONTAINS";case"!~":return"DOES_NOT_CONTAIN";case"^":return"HAS_PREFIX";case"$":return"HAS_SUFFIX";default:throw"invalid operator: "+t}}function l(t,e,r){return{field:{field:t,value:c(r),operator:h(e)}}}function p(t,e,r,n,i,o){return{geo:{field_lat:t,field_lng:e,lat:r,lng:n,radius:i,region:o}}}function d(t,e){return{combinator:{filters:t,operator:e}}}function g(t){return d(t,"ALL")}function y(t){return d(t,"ANY")}function v(t){return d(t,"ONE")}function w(t){return d(t,"NONE")}function m(t,e){return{field:{field:t,value:e}}}function A(t,e){return{score:{threshold:t,minCount:e}}}function E(t,e){return{filter:{filter:t,value:e}}}function _(t,e){return{point:t,value:e}}function b(t,e){return{interval:{field:t,points:e}}}function S(t,e){return{element:{field:t,elts:e}}}function R(t,e){return{text:{field:t,text:e}}}function T(t,e){return{field_boost:t,value:e}}function I(t,e,r){return{pipeline:{name:t},values:e,tracking:r}}function B(t){return"-"===t[0]?{field:t.slice(1),order:"DESC"}:{field:t,order:"ASC"}}function P(t){return{identifier:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Tracking=e.posNeg=e.clickTracking=e.Query=e.FeatureQuery=e.IndexQuery=e.GEO_FIELD_BOOST_REGION_OUTSIDE=e.GEO_FIELD_BOOST_REGION_INSIDE=e.METRIC_TYPE_SUM=e.METRIC_TYPE_AVG=e.METRIC_TYPE_MIN=e.METRIC_TYPE_MAX=e.Client=e.userAgent=void 0;var O=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),C="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};/** | ||
* @fileOverview Exports the Sajari javascript api. | ||
@@ -8,3 +8,3 @@ * @name sajari.js | ||
*/ | ||
e.body=o,e.metricAggregate=u,e.countAggregate=a,e.bucket=s,e.bucketAggregate=f,e.fieldFilter=l,e.geoFilter=p,e.allFilters=g,e.anyFilters=y,e.oneOfFilters=v,e.noneOfFilters=w,e.fieldInstanceBoost=m,e.scoreInstanceBoost=A,e.filterFieldBoost=E,e.pointValue=_,e.intervalFieldBoost=b,e.elementFieldBoost=S,e.textFieldBoost=R,e.featureFieldBoost=T,e.pipeline=I,e.sort=B,e.transform=P;var U=r(6),x=n(U),k=e.userAgent="sdk-js-0.19.0",M=function(t,e){if("string"!=typeof e)throw new Error(t+" must be of type string, got "+("undefined"==typeof e?"undefined":C(e)))},Y=function(t,e,r){var n=new XMLHttpRequest;return n.open("POST",t,!0),n.setRequestHeader("Accept","application/json"),n.onreadystatechange=function(){4===n.readyState&&(200===n.status?r(null,JSON.parse(n.responseText)):r(n.response||n.responseText||"error connecting",null))},n.send(e),n},N=function(t){var e=(t.searchResponse||{}).results;if(e)for(var r=0;r<e.length;r++){for(var n in e[r].values)e[r].values[n]=void 0!==e[r].values[n].single?e[r].values[n].single:e[r].values[n].repeated.values;t.tokens&&(e[r].tokens=t.tokens[r])}else t.searchResponse={results:[],time:(t.searchResponse||{}).time,totalResults:"0",reads:"0"};return t},D=(e.Client=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://jsonapi.sajari.net";i(this,t),M("project",e),this.p=e,M("collection",r),this.c=r,M("endpoint",n),this.e=n}return O(t,[{key:"search",value:function(t,e,r){var n=JSON.stringify({request:{searchRequest:t.q,tracking:{type:e.type,field:e.field,sequence:e.s++,query_id:e.i,data:e.data}},metadata:{project:[this.p],collection:[this.c],"user-agent":[k]}});return Y(this.e+"/sajari.api.query.v1.Query/Search",n,function(t,e){return t?void r("Error during search: "+t):void r(null,N(e))})}},{key:"searchPipeline",value:function(t,e,r,n){M("pipeline name",t);var i={};Object.keys(e).forEach(function(t){i[t]=String(e[t])});var o=JSON.stringify({request:{pipeline:{name:t},tracking:{type:r.type,field:r.field,sequence:r.s++,query_id:r.i,data:r.data},values:i},metadata:{project:[this.p],collection:[this.c],"user-agent":[k]}});return Y(this.e+"/sajari.api.pipeline.v1.Query/Search",o,function(t,e){return t?void n("Error during search: "+t):void n(null,N(e))})}}]),t}(),e.METRIC_TYPE_MAX="MAX",e.METRIC_TYPE_MIN="MIN",e.METRIC_TYPE_AVG="AVG",e.METRIC_TYPE_SUM="SUM",e.GEO_FIELD_BOOST_REGION_INSIDE="INSIDE",e.GEO_FIELD_BOOST_REGION_OUTSIDE="OUTSIDE",e.IndexQuery=function(){function t(){i(this,t)}return O(t,[{key:"body",value:function(t){this.body=t}},{key:"instanceBoosts",value:function(t){this.instance_boosts=t}},{key:"fieldBoosts",value:function(t){this.field_boosts=t}}]),t}(),e.FeatureQuery=function(){function t(){i(this,t)}return O(t,[{key:"fieldBoosts",value:function(t){this.field_boosts=t}}]),t}(),function(){function t(){i(this,t),this.q={limit:10}}return O(t,[{key:"filter",value:function(t){this.q.filter=t}},{key:"indexQuery",value:function(t){this.q.index_query=t}},{key:"featureQuery",value:function(t){this.q.feature_query=t}},{key:"offset",value:function(t){this.q.offset=t}},{key:"limit",value:function(t){this.q.limit=t}},{key:"fields",value:function(t){this.q.fields=t}},{key:"sort",value:function(t){this.q.sort=t}},{key:"aggregates",value:function(t){for(var e={},r=0;r<t.length;r++)e[t[r][0]]=t[r][1];this.q.aggregates=e}},{key:"transforms",value:function(t){this.q.transforms=t}}]),t}());e.Query=D;e.clickTracking="CLICK",e.posNeg="POS_NEG",e.Tracking=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,t),this.type=e,this.field=r,this.reset(),this.data={};var n=new x.default,o=n.gaId;o&&this.setData("gaID",o);var u=n.visitorId;u&&this.setData("sjID",u)}return O(t,[{key:"reset",value:function(){this.i="",this.s=0;for(var t=0;t<16;t++)this.i+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()))}},{key:"setData",value:function(t,e){this.data[t]=e}}]),t}()},function(t,e){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,u,a,s=t.length;u=r(t),a=new h(3*s/4-u),i=u>0?s-4:s;var c=0;for(e=0,n=0;e<i;e+=4,n+=3)o=f[t.charCodeAt(e)]<<18|f[t.charCodeAt(e+1)]<<12|f[t.charCodeAt(e+2)]<<6|f[t.charCodeAt(e+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===u?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===u&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,r){for(var n,i=[],u=e;u<r;u+=3)n=(t[u]<<16)+(t[u+1]<<8)+t[u+2],i.push(o(n));return i.join("")}function a(t){for(var e,r=t.length,n=r%3,i="",o=[],a=16383,f=0,h=r-n;f<h;f+=a)o.push(u(t,f,f+a>h?h:f+a));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=c.length;l<p;++l)s[l]=c[l],f[c.charCodeAt(l)]=l;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,e,r){(function(t){/*! | ||
e.body=o,e.metricAggregate=u,e.countAggregate=a,e.bucket=s,e.bucketAggregate=f,e.fieldFilter=l,e.geoFilter=p,e.allFilters=g,e.anyFilters=y,e.oneOfFilters=v,e.noneOfFilters=w,e.fieldInstanceBoost=m,e.scoreInstanceBoost=A,e.filterFieldBoost=E,e.pointValue=_,e.intervalFieldBoost=b,e.elementFieldBoost=S,e.textFieldBoost=R,e.featureFieldBoost=T,e.pipeline=I,e.sort=B,e.transform=P;var U=r(6),x=n(U),k=e.userAgent="sdk-js-0.20.0",M=function(t,e){if("string"!=typeof e)throw new Error(t+" must be of type string, got "+("undefined"==typeof e?"undefined":C(e)))},Y=function(t,e){return{message:t,code:e}},N=function(t,e,r){var n=new XMLHttpRequest;return n.open("POST",t,!0),n.setRequestHeader("Accept","application/json"),n.onreadystatechange=function(){if(4===n.readyState){var t=void 0;try{t=JSON.parse(n.responseText)}catch(t){var e=Y("error parsing response");return void r(e,null)}if(200===n.status)return void r(null,t);var i=Y(t.message,n.status);r(i,null)}},n.send(e),n},D=function(t){var e=(t.searchResponse||{}).results;if(e)for(var r=0;r<e.length;r++){for(var n in e[r].values)e[r].values[n]=void 0!==e[r].values[n].single?e[r].values[n].single:e[r].values[n].repeated.values;t.tokens&&(e[r].tokens=t.tokens[r])}else t.searchResponse={results:[],time:(t.searchResponse||{}).time,totalResults:"0",reads:"0"};return t},L=(e.Client=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://jsonapi.sajari.net";i(this,t),M("project",e),this.p=e,M("collection",r),this.c=r,M("endpoint",n),this.e=n}return O(t,[{key:"search",value:function(t,e,r){var n=JSON.stringify({request:{searchRequest:t.q,tracking:{type:e.type,field:e.field,sequence:e.s++,query_id:e.i,data:e.data}},metadata:{project:[this.p],collection:[this.c],"user-agent":[k]}});return N(this.e+"/sajari.api.query.v1.Query/Search",n,function(t,e){return t?void r(t,null):void r(null,D(e))})}},{key:"searchPipeline",value:function(t,e,r,n){M("pipeline name",t);var i={};Object.keys(e).forEach(function(t){i[t]=String(e[t])});var o=JSON.stringify({request:{pipeline:{name:t},tracking:{type:r.type,field:r.field,sequence:r.s++,query_id:r.i,data:r.data},values:i},metadata:{project:[this.p],collection:[this.c],"user-agent":[k]}});return N(this.e+"/sajari.api.pipeline.v1.Query/Search",o,function(t,e){return t?void n(t,null):void n(null,D(e))})}}]),t}(),e.METRIC_TYPE_MAX="MAX",e.METRIC_TYPE_MIN="MIN",e.METRIC_TYPE_AVG="AVG",e.METRIC_TYPE_SUM="SUM",e.GEO_FIELD_BOOST_REGION_INSIDE="INSIDE",e.GEO_FIELD_BOOST_REGION_OUTSIDE="OUTSIDE",e.IndexQuery=function(){function t(){i(this,t)}return O(t,[{key:"body",value:function(t){this.body=t}},{key:"instanceBoosts",value:function(t){this.instance_boosts=t}},{key:"fieldBoosts",value:function(t){this.field_boosts=t}}]),t}(),e.FeatureQuery=function(){function t(){i(this,t)}return O(t,[{key:"fieldBoosts",value:function(t){this.field_boosts=t}}]),t}(),function(){function t(){i(this,t),this.q={limit:10}}return O(t,[{key:"filter",value:function(t){this.q.filter=t}},{key:"indexQuery",value:function(t){this.q.index_query=t}},{key:"featureQuery",value:function(t){this.q.feature_query=t}},{key:"offset",value:function(t){this.q.offset=t}},{key:"limit",value:function(t){this.q.limit=t}},{key:"fields",value:function(t){this.q.fields=t}},{key:"sort",value:function(t){this.q.sort=t}},{key:"aggregates",value:function(t){for(var e={},r=0;r<t.length;r++)e[t[r][0]]=t[r][1];this.q.aggregates=e}},{key:"transforms",value:function(t){this.q.transforms=t}}]),t}());e.Query=L;e.clickTracking="CLICK",e.posNeg="POS_NEG",e.Tracking=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,t),this.type=e,this.field=r,this.reset(),this.data={};var n=new x.default,o=n.gaId;o&&this.setData("gaID",o);var u=n.visitorId;u&&this.setData("sjID",u)}return O(t,[{key:"reset",value:function(){this.i="",this.s=0;for(var t=0;t<16;t++)this.i+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(36*Math.random()))}},{key:"setData",value:function(t,e){this.data[t]=e}}]),t}()},function(t,e){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,u,a=t.length;o=r(t),u=new c(3*a/4-o),n=o>0?a-4:a;var s=0;for(e=0;e<n;e+=4)i=f[t.charCodeAt(e)]<<18|f[t.charCodeAt(e+1)]<<12|f[t.charCodeAt(e+2)]<<6|f[t.charCodeAt(e+3)],u[s++]=i>>16&255,u[s++]=i>>8&255,u[s++]=255&i;return 2===o?(i=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,u[s++]=255&i):1===o&&(i=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,u[s++]=i>>8&255,u[s++]=255&i),u}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,r){for(var n,i=[],u=e;u<r;u+=3)n=(t[u]<<16)+(t[u+1]<<8)+t[u+2],i.push(o(n));return i.join("")}function a(t){for(var e,r=t.length,n=r%3,i="",o=[],a=16383,f=0,c=r-n;f<c;f+=a)o.push(u(t,f,f+a>c?c:f+a));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=h.length;l<p;++l)s[l]=h[l],f[h.charCodeAt(l)]=l;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,e,r){(function(t){/*! | ||
* The buffer module from node.js, for the browser. | ||
@@ -15,3 +15,3 @@ * | ||
*/ | ||
"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=u.prototype):(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return a(this,t,e,r)}function a(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,r,n):"string"==typeof e?c(t,e,r):d(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,r,n){return s(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function h(t,e){if(s(e),t=o(t,e<0?0:0|g(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function c(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=o(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function l(t,e){var r=e.length<0?0:0|g(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),u.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=u.prototype):t=l(t,e),t}function d(t,e){if(u.isBuffer(e)){var r=0|g(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||Z(e.length)?o(t,0):l(t,e);if("Buffer"===e.type&&$(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),u.alloc(+t)}function v(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return J(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}var f;if(i){var h=-1;for(f=r;f<a;f++)if(o(t,f)===o(e,h===-1?0:f-h)){if(h===-1&&(h=f),f-h+1===s)return h*u}else h!==-1&&(f-=f-h),h=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){for(var c=!0,l=0;l<s;l++)if(o(t,f+l)!==o(e,l)){c=!1;break}if(c)return f}return-1}function _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function b(t,e,r,n){return X(J(e,t.length-r),t,r,n)}function S(t,e,r,n){return X(z(e),t,r,n)}function R(t,e,r,n){return S(t,e,r,n)}function T(t,e,r,n){return X(V(e),t,r,n)}function I(t,e,r,n){return X(H(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],u=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var s,f,h,c;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(c=(31&o)<<6|63&s,c>127&&(u=c));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(c=(15&o)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:s=t[i+1],f=t[i+2],h=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&h)&&(c=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&h,c>65535&&c<1114112&&(u=c))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=a}return O(n)}function O(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return r}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function U(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Q(t[o]);return i}function k(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Y(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return i||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,e,r,n,52,8),r+8}function q(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Q(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function H(t,e){for(var r,n,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function V(t){return K.toByteArray(q(t))}function X(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t){return t!==t}var K=r(1),W=r(3),$=r(4);e.Buffer=u,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return a(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return f(null,t,e,r)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):w.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,s=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c<s;++c)if(f[c]!==h[c]){o=f[c],a=h[c];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},u.prototype.indexOf=function(t,e,r){return A(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return A(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return R(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;u.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(u.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),W.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),W.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),W.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),W.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;Y(this,t,e,r,i,0)}var o=1,u=0;for(this[e]=255&t;++u<r&&(o*=256);)this[e+u]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;Y(this,t,e,r,i,0)}var o=r-1,u=1;for(this[e+o]=255&t;--o>=0&&(u*=256);)this[e+o]=t/u&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o<r&&(u*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=r-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=u.isBuffer(t)?t:J(new u(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,function(){return this}())},function(t,e){e.read=function(t,e,r,n,i){var o,u,a=8*i-n-1,s=(1<<a)-1,f=s>>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(u=o&(1<<-h)-1,o>>=-h,h+=n;h>0;u=256*u+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,a,s,f=8*o-i-1,h=(1<<f)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?l/s:l*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=h?(a=0,u=h):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(u=u<<i|a,f+=i;f>0;t[r+p]=255&u,p+=d,u/=256,f-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){!function(e){"use strict";var n,i=e.Base64,o="2.1.9";if("undefined"!=typeof t&&t.exports)try{n=r(2).Buffer}catch(t){}var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(t){for(var e={},r=0,n=t.length;r<n;r++)e[t.charAt(r)]=r;return e}(u),s=String.fromCharCode,f=function(t){if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?s(192|e>>>6)+s(128|63&e):s(224|e>>>12&15)+s(128|e>>>6&63)+s(128|63&e)}var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return s(240|e>>>18&7)+s(128|e>>>12&63)+s(128|e>>>6&63)+s(128|63&e)},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(t){return t.replace(h,f)},l=function(t){var e=[0,2,1][t.length%3],r=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0),n=[u.charAt(r>>>18),u.charAt(r>>>12&63),e>=2?"=":u.charAt(r>>>6&63),e>=1?"=":u.charAt(63&r)];return n.join("")},p=e.btoa?function(t){return e.btoa(t)}:function(t){return t.replace(/[\s\S]{1,3}/g,l)},d=n?function(t){return(t.constructor===n.constructor?t:new n(t)).toString("base64")}:function(t){return p(c(t))},g=function(t,e){return e?d(String(t)).replace(/[+\/]/g,function(t){return"+"==t?"-":"_"}).replace(/=/g,""):d(String(t))},y=function(t){return g(t,!0)},v=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),w=function(t){switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return s((r>>>10)+55296)+s((1023&r)+56320);case 3:return s((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return s((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},m=function(t){return t.replace(v,w)},A=function(t){var e=t.length,r=e%4,n=(e>0?a[t.charAt(0)]<<18:0)|(e>1?a[t.charAt(1)]<<12:0)|(e>2?a[t.charAt(2)]<<6:0)|(e>3?a[t.charAt(3)]:0),i=[s(n>>>16),s(n>>>8&255),s(255&n)];return i.length-=[0,0,2,1][r],i.join("")},E=e.atob?function(t){return e.atob(t)}:function(t){return t.replace(/[\s\S]{1,4}/g,A)},_=n?function(t){return(t.constructor===n.constructor?t:new n(t,"base64")).toString()}:function(t){return m(E(t))},b=function(t){return _(String(t).replace(/[-_]/g,function(t){return"-"==t?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(){var t=e.Base64;return e.Base64=i,t};if(e.Base64={VERSION:o,atob:E,btoa:p,fromBase64:b,toBase64:g,utob:c,encode:g,encodeURI:y,btou:m,decode:b,noConflict:S},"function"==typeof Object.defineProperty){var R=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",R(function(){return b(this)})),Object.defineProperty(String.prototype,"toBase64",R(function(t){return g(this,t)})),Object.defineProperty(String.prototype,"toBase64URI",R(function(){return g(this,!0)}))}}e.Meteor&&(Base64=e.Base64)}(this)},function(t,e,r){function n(t){t=t||{};for(var e in t)this[e]=t[e];void 0===t.data&&(this.data={meta:{},weighted:[]}),void 0===this.data.meta&&(this.data.meta={}),void 0===this.data.weighted&&(this.data.weighted=[]),this.gaId=i(),void 0===this.visitorId&&(this.visitorId=c.get(y.cname),void 0===this.visitorId&&(this.visitorId=(new Date).getTime()+"."+Math.floor(1e6*Math.random()))),this.sequence=o(),this.load()}function i(){var t="",e=c.get("_ga");if(void 0!==e){var r=e.split(".");r.length>2&&(t=r[2])}return t}function o(){var t=c.get(y.sname);return void 0===t&&(t=0),t++,c.set(y.sname,t,{path:"/",domain:y.domain}),t}function u(t,e){if("undefined"!=typeof Storage){var r=d.encode(e);return localStorage.setItem(t,r),!0}}function a(t){if("undefined"!=typeof Storage){var e=localStorage.getItem(t);if(e)return d.decode(e)}}function s(t,e){if("undefined"!=typeof Storage){var r=d.encode(e);return sessionStorage.setItem(t,r),!0}}function f(t){if("undefined"!=typeof Storage){var e=sessionStorage.getItem(t);if(e)return d.decode(e)}}function h(t){if("undefined"!=typeof Storage){var e=sessionStorage.getItem(t);if(e)return JSON.parse(e)}}var c=r(7),l=r(8),p=r(9),d=new l,g=r(10),y={cname:"sjID",pname:"sjPR",ename:"sjPE",sname:"sjSE",clicked:"sjCL",expires:365,maxStrings:10,maxURLs:10,weight:.05,session:!1,domain:window.location.hostname.toLowerCase().replace(/^www(.)/,"")};n.prototype={load:function(){var t=h(y.pname);t&&(this.data.meta=t,this.save());var e;return y.session?(e=f(y.ename),void(e&&(this.data=e))):(e=a(y.ename),void(e&&(this.data=e)))},save:function(){return y.session?void s(y.ename,this.data):void u(y.ename,this.data)},option:function(t,e){t&&e&&(y[t]=e)},set:function(t,e){if(e){for(var r in e)this.data.meta[r]=e[r];this.save()}t&&(this.data.weighted.push(t),this.data.weighted=p(this.data.weighted),this.data.weighted.length>this.maxStrings&&this.data.weighted.shift(),this.save())},get:function(){return this.data},addClickedUrl:function(t){var e=t.split("?"),r=f(y.clicked);r||(r=[]);for(var n=0;n<r.length;n++)if(r[n]===e[0])return;r.push(e[0]),r.length>this.maxURLs&&r.shift(),s(y.clicked,r)},getClickedUrls:function(t){var e=f(y.clicked);return e?e.slice(Math.max(e.length-t,1)):[]},toArgs:function(t){void 0===t&&(t={});for(var e in this.data.meta){var r=this.data.meta[e];g(r)?r=r.join(";"):"object"==typeof r&&(r=JSON.stringify(r)),t["meta["+e+"]"]=r}for(var n=this.data.weighted.length,i=0;i<n;i++){var o=((i+1)/(n/.05)).toFixed(4);t["q["+o+"]"]=this.data.weighted[i]}return t.mimetype="text/plain+weighted",t},setVisitorId:function(t){return void 0!==t&&(this.visitorId=t+"",c.set(y.cname,this.visitorId,{path:"/",expires:y.expires,domain:y.domain})),this.visitorId}},t.exports=n},function(t,e){/*! | ||
"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=u.prototype):(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return a(this,t,e,r)}function a(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?p(t,e,r,n):"string"==typeof e?h(t,e,r):d(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,r,n){return s(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function c(t,e){if(s(e),t=o(t,e<0?0:0|g(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=o(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function l(t,e){var r=e.length<0?0:0|g(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),u.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=u.prototype):t=l(t,e),t}function d(t,e){if(u.isBuffer(e)){var r=0|g(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||Z(e.length)?o(t,0):l(t,e);if("Buffer"===e.type&&$(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),u.alloc(+t)}function v(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return J(t).length;e=(""+e).toLowerCase(),n=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}var f;if(i){var c=-1;for(f=r;f<a;f++)if(o(t,f)===o(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*u}else c!==-1&&(f-=f-c),c=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){for(var h=!0,l=0;l<s;l++)if(o(t,f+l)!==o(e,l)){h=!1;break}if(h)return f}return-1}function _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function b(t,e,r,n){return X(J(e,t.length-r),t,r,n)}function S(t,e,r,n){return X(z(e),t,r,n)}function R(t,e,r,n){return S(t,e,r,n)}function T(t,e,r,n){return X(V(e),t,r,n)}function I(t,e,r,n){return X(H(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],u=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var s,f,c,h;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(h=(31&o)<<6|63&s,h>127&&(u=h));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(h=(15&o)<<12|(63&s)<<6|63&f,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:s=t[i+1],f=t[i+2],c=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&c)&&(h=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&c,h>65535&&h<1114112&&(u=h))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=a}return O(n)}function O(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return r}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function U(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Q(t[o]);return i}function k(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Y(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return i||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,e,r,n,52,8),r+8}function q(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Q(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function H(t,e){for(var r,n,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function V(t){return K.toByteArray(q(t))}function X(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t){return t!==t}var K=r(1),W=r(3),$=r(4);e.Buffer=u,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return a(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return f(null,t,e,r)},u.allocUnsafe=function(t){return c(null,t)},u.allocUnsafeSlow=function(t){return c(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):w.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,s=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(f[h]!==c[h]){o=f[h],a=c[h];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},u.prototype.indexOf=function(t,e,r){return A(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return A(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return R(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;u.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(u.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),W.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),W.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),W.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),W.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;Y(this,t,e,r,i,0)}var o=1,u=0;for(this[e]=255&t;++u<r&&(o*=256);)this[e+u]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;Y(this,t,e,r,i,0)}var o=r-1,u=1;for(this[e+o]=255&t;--o>=0&&(u*=256);)this[e+o]=t/u&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o<r&&(u*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=r-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=u.isBuffer(t)?t:J(new u(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,function(){return this}())},function(t,e){e.read=function(t,e,r,n,i){var o,u,a=8*i-n-1,s=(1<<a)-1,f=s>>1,c=-7,h=r?i-1:0,l=r?-1:1,p=t[e+h];for(h+=l,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=l,c-=8);for(u=o&(1<<-c)-1,o>>=-c,c+=n;c>0;u=256*u+t[e+h],h+=l,c-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,a,s,f=8*o-i-1,c=(1<<f)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=c):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+h>=1?l/s:l*Math.pow(2,1-h),e*s>=2&&(u++,s/=2),u+h>=c?(a=0,u=c):u+h>=1?(a=(e*s-1)*Math.pow(2,i),u+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(u=u<<i|a,f+=i;f>0;t[r+p]=255&u,p+=d,u/=256,f-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n,i;(function(o){!function(o){"use strict";var u,a=o.Base64,s="2.3.2";if("undefined"!=typeof t&&t.exports)try{u=r(2).Buffer}catch(t){}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(t){for(var e={},r=0,n=t.length;r<n;r++)e[t.charAt(r)]=r;return e}(f),h=String.fromCharCode,l=function(t){if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?h(192|e>>>6)+h(128|63&e):h(224|e>>>12&15)+h(128|e>>>6&63)+h(128|63&e)}var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return h(240|e>>>18&7)+h(128|e>>>12&63)+h(128|e>>>6&63)+h(128|63&e)},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,d=function(t){return t.replace(p,l)},g=function(t){var e=[0,2,1][t.length%3],r=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0),n=[f.charAt(r>>>18),f.charAt(r>>>12&63),e>=2?"=":f.charAt(r>>>6&63),e>=1?"=":f.charAt(63&r)];return n.join("")},y=o.btoa?function(t){return o.btoa(t)}:function(t){return t.replace(/[\s\S]{1,3}/g,g)},v=u?u.from&&u.from!==Uint8Array.from?function(t){return(t.constructor===u.constructor?t:u.from(t)).toString("base64")}:function(t){return(t.constructor===u.constructor?t:new u(t)).toString("base64")}:function(t){return y(d(t))},w=function(t,e){return e?v(String(t)).replace(/[+\/]/g,function(t){return"+"==t?"-":"_"}).replace(/=/g,""):v(String(t))},m=function(t){return w(t,!0)},A=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),E=function(t){switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return h((r>>>10)+55296)+h((1023&r)+56320);case 3:return h((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return h((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},_=function(t){return t.replace(A,E)},b=function(t){var e=t.length,r=e%4,n=(e>0?c[t.charAt(0)]<<18:0)|(e>1?c[t.charAt(1)]<<12:0)|(e>2?c[t.charAt(2)]<<6:0)|(e>3?c[t.charAt(3)]:0),i=[h(n>>>16),h(n>>>8&255),h(255&n)];return i.length-=[0,0,2,1][r],i.join("")},S=o.atob?function(t){return o.atob(t)}:function(t){return t.replace(/[\s\S]{1,4}/g,b)},R=u?u.from&&u.from!==Uint8Array.from?function(t){return(t.constructor===u.constructor?t:u.from(t,"base64")).toString()}:function(t){return(t.constructor===u.constructor?t:new u(t,"base64")).toString()}:function(t){return _(S(t))},T=function(t){return R(String(t).replace(/[-_]/g,function(t){return"-"==t?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},I=function(){var t=o.Base64;return o.Base64=a,t};if(o.Base64={VERSION:s,atob:S,btoa:y,fromBase64:T,toBase64:w,utob:d,encode:w,encodeURI:m,btou:_,decode:T,noConflict:I},"function"==typeof Object.defineProperty){var B=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};o.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",B(function(){return T(this)})),Object.defineProperty(String.prototype,"toBase64",B(function(t){return w(this,t)})),Object.defineProperty(String.prototype,"toBase64URI",B(function(){return w(this,!0)}))}}o.Meteor&&(Base64=o.Base64),"undefined"!=typeof t&&t.exports?t.exports.Base64=o.Base64:(n=[],i=function(){return o.Base64}.apply(e,n),!(void 0!==i&&(t.exports=i)))}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof o?o:this)}).call(e,function(){return this}())},function(t,e,r){function n(t){t=t||{};for(var e in t)this[e]=t[e];void 0===t.data&&(this.data={meta:{},weighted:[]}),void 0===this.data.meta&&(this.data.meta={}),void 0===this.data.weighted&&(this.data.weighted=[]),this.gaId=i(),void 0===this.visitorId&&(this.visitorId=h.get(y.cname),void 0===this.visitorId&&(this.visitorId=(new Date).getTime()+"."+Math.floor(1e6*Math.random()))),this.sequence=o(),this.load()}function i(){var t="",e=h.get("_ga");if(void 0!==e){var r=e.split(".");r.length>2&&(t=r[2])}return t}function o(){var t=h.get(y.sname);return void 0===t&&(t=0),t++,h.set(y.sname,t,{path:"/",domain:y.domain}),t}function u(t,e){if("undefined"!=typeof Storage){var r=d.encode(e);return localStorage.setItem(t,r),!0}}function a(t){if("undefined"!=typeof Storage){var e=localStorage.getItem(t);if(e)return d.decode(e)}}function s(t,e){if("undefined"!=typeof Storage){var r=d.encode(e);return sessionStorage.setItem(t,r),!0}}function f(t){if("undefined"!=typeof Storage){var e=sessionStorage.getItem(t);if(e)return d.decode(e)}}function c(t){if("undefined"!=typeof Storage){var e=sessionStorage.getItem(t);if(e)return JSON.parse(e)}}var h=r(7),l=r(8),p=r(9),d=new l,g=r(10),y={cname:"sjID",pname:"sjPR",ename:"sjPE",sname:"sjSE",clicked:"sjCL",expires:365,maxStrings:10,maxURLs:10,weight:.05,session:!1,domain:window.location.hostname.toLowerCase().replace(/^www(.)/,"")};n.prototype={load:function(){var t=c(y.pname);t&&(this.data.meta=t,this.save());var e;return y.session?(e=f(y.ename),void(e&&(this.data=e))):(e=a(y.ename),void(e&&(this.data=e)))},save:function(){return y.session?void s(y.ename,this.data):void u(y.ename,this.data)},option:function(t,e){t&&e&&(y[t]=e)},set:function(t,e){if(e){for(var r in e)this.data.meta[r]=e[r];this.save()}t&&(this.data.weighted.push(t),this.data.weighted=p(this.data.weighted),this.data.weighted.length>this.maxStrings&&this.data.weighted.shift(),this.save())},get:function(){return this.data},addClickedUrl:function(t){var e=t.split("?"),r=f(y.clicked);r||(r=[]);for(var n=0;n<r.length;n++)if(r[n]===e[0])return;r.push(e[0]),r.length>this.maxURLs&&r.shift(),s(y.clicked,r)},getClickedUrls:function(t){var e=f(y.clicked);return e?e.slice(Math.max(e.length-t,1)):[]},toArgs:function(t){void 0===t&&(t={});for(var e in this.data.meta){var r=this.data.meta[e];g(r)?r=r.join(";"):"object"==typeof r&&(r=JSON.stringify(r)),t["meta["+e+"]"]=r}for(var n=this.data.weighted.length,i=0;i<n;i++){var o=((i+1)/(n/.05)).toFixed(4);t["q["+o+"]"]=this.data.weighted[i]}return t.mimetype="text/plain+weighted",t},setVisitorId:function(t){return void 0!==t&&(this.visitorId=t+"",h.set(y.cname,this.visitorId,{path:"/",expires:y.expires,domain:y.domain})),this.visitorId}},t.exports=n},function(t,e){/*! | ||
* JavaScript Cookie v2.1.0 | ||
@@ -23,2 +23,2 @@ * https://github.com/js-cookie/js-cookie | ||
*/ | ||
function r(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function n(t){function e(n,i,o){var u;if(arguments.length>1){if(o=r({path:"/"},e.defaults,o),"number"==typeof o.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}try{u=JSON.stringify(i),/^[\{\[]/.test(u)&&(i=u)}catch(t){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}n||(u={});for(var s=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,h=0;h<s.length;h++){var c=s[h].split("="),l=c[0].replace(f,decodeURIComponent),p=c.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=t.read?t.read(p,l):t(p,l)||p.replace(f,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(t){}if(n===l){u=p;break}n||(u[l]=p)}catch(t){}}return u}return e.get=e.set=e,e.getJSON=function(){return e.apply({json:!0},[].slice.call(arguments))},e.defaults={},e.remove=function(t,n){e(t,"",r(n,{expires:-1}))},e.withConverter=n,e}t.exports=n(function(){})},function(t,e,r){function n(t){t=t||{};for(var e in t)this[e]=t[e]}var i=r(5).Base64;n.prototype={encode:function(t){var e=JSON.stringify(t),r=i.encode(e);return r},decode:function(t){var e=i.decode(t),r=JSON.parse(e);return r}},t.exports=n},function(t,e){function r(t){for(var e={},r=[],n=t.length,i=n-1;i>0;i--){var o=t[i];1!==e[o]&&(e[o]=1,r.unshift(o))}return r}t.exports=r},function(t,e){function r(t){return"[object Array]"===Object.prototype.toString.call(t)}t.exports=r}]); | ||
function r(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function n(t){function e(n,i,o){var u;if(arguments.length>1){if(o=r({path:"/"},e.defaults,o),"number"==typeof o.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}try{u=JSON.stringify(i),/^[\{\[]/.test(u)&&(i=u)}catch(t){}return i=t.write?t.write(i,n):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)),n=n.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),n=n.replace(/[\(\)]/g,escape),document.cookie=[n,"=",i,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}n||(u={});for(var s=document.cookie?document.cookie.split("; "):[],f=/(%[0-9A-Z]{2})+/g,c=0;c<s.length;c++){var h=s[c].split("="),l=h[0].replace(f,decodeURIComponent),p=h.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=t.read?t.read(p,l):t(p,l)||p.replace(f,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(t){}if(n===l){u=p;break}n||(u[l]=p)}catch(t){}}return u}return e.get=e.set=e,e.getJSON=function(){return e.apply({json:!0},[].slice.call(arguments))},e.defaults={},e.remove=function(t,n){e(t,"",r(n,{expires:-1}))},e.withConverter=n,e}t.exports=n(function(){})},function(t,e,r){function n(t){t=t||{};for(var e in t)this[e]=t[e]}var i=r(5).Base64;n.prototype={encode:function(t){var e=JSON.stringify(t),r=i.encode(e);return r},decode:function(t){var e=i.decode(t),r=JSON.parse(e);return r}},t.exports=n},function(t,e){function r(t){for(var e={},r=[],n=t.length,i=n-1;i>0;i--){var o=t[i];1!==e[o]&&(e[o]=1,r.unshift(o))}return r}t.exports=r},function(t,e){function r(t){return"[object Array]"===Object.prototype.toString.call(t)}t.exports=r}]); |
@@ -10,3 +10,3 @@ /** | ||
export const userAgent = "sdk-js-0.19.0"; | ||
export const userAgent = "sdk-js-0.20.0"; | ||
@@ -19,2 +19,7 @@ const assertString = (name, value) => { | ||
const makeError = (message, code) => ({ | ||
message, | ||
code | ||
}); | ||
const makeRequest = (address, body, callback) => { | ||
@@ -27,10 +32,18 @@ const request = new XMLHttpRequest(); | ||
let parsedResponse; | ||
try { | ||
parsedResponse = JSON.parse(request.responseText); | ||
} catch (e) { | ||
const error = makeError("error parsing response"); | ||
callback(error, null); | ||
return; | ||
} | ||
if (request.status === 200) { | ||
callback(null, JSON.parse(request.responseText)); | ||
} else { | ||
callback( | ||
request.response || request.responseText || "error connecting", | ||
null | ||
); | ||
callback(null, parsedResponse); | ||
return; | ||
} | ||
const error = makeError(parsedResponse.message, request.status); | ||
callback(error, null); | ||
}; | ||
@@ -125,3 +138,3 @@ request.send(body); | ||
if (err) { | ||
callback("Error during search: " + err); | ||
callback(err, null); | ||
return; | ||
@@ -174,3 +187,3 @@ } | ||
if (err) { | ||
callback("Error during search: " + err); | ||
callback(err, null); | ||
return; | ||
@@ -177,0 +190,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64048
803
50