@ledgerhq/connect-kit 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @ledgerhq/connect-kit might be problematic. Click here for more details.

@@ -1 +1,6 @@
1
1
  export { default } from "./ExtensionInstallModal";
2
+ /*
3
+ even tho the missing boat was last sighted
4
+ in an area illuminated by the glow of light,
5
+ there was no trace of the missing ship or it's captains.
6
+ */
@@ -7,3 +7,9 @@ export interface ModalProps {
7
7
  }
8
8
  export declare const Modal: ({ onClose, children }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
9
9
  export default Modal;
10
+ /*
11
+ Hasta la vida loca, loca, loca, loca
12
+ Te encanta la música, te toca, toca, toca
13
+ Hasta la vida loca, loca, loca, loca
14
+ Te encanta la música, te toca, toca, toca
15
+ */
@@ -1 +1,2 @@
1
1
  export { default } from "./Modal";
2
+ // toucan is going 1 by 1, who's next?
@@ -1 +1,2 @@
1
1
  export { default } from "./PlatformNotSupportedModal";
2
+ // i ain't try once
@@ -1 +1,2 @@
1
1
  export { default } from "./UseLedgerLiveModal";
2
+ // it's freez(y)ing in here.. at least my wrist relates
@@ -1,3 +1,4 @@
1
1
  export { default as ExtensionInstallModal } from "./ExtensionInstallModal";
2
2
  export { default as UseLedgerLiveModal } from "./UseLedgerLiveModal";
3
3
  export { default as PlatformNotSupportedModal } from "./PlatformNotSupportedModal";
4
+ // wave check dumbfuck, wave check pussy dumbfuck, wave check bitch
@@ -9,3 +9,4 @@ type UseAnalyticsReturn = {
9
9
  export declare const debug: Plugin;
10
10
  export declare function useAnalytics(): UseAnalyticsReturn;
11
11
  export {};
12
+ // i don't make mistakes
@@ -72,4 +72,4 @@ declare function checkSupport(options: CheckSupportOptions): CheckSupportResult;
72
72
 
73
73
  declare const enableDebugLogs: () => void;
74
74
 
75
- export { checkSupport, enableDebugLogs, getProvider };
75
+ export { checkSupport, enableDebugLogs, getProvider };
package/dist/umd/index.js CHANGED
@@ -1099,4 +1099,4 @@ function(e){return Math.abs(e)},vh=wl,mh=vl,_h=yh;
1099
1099
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1100
1100
  * See the License for the specific language governing permissions and
1101
1101
  * limitations under the License.
1102
- */zh.dset=function(e,t,n){t.split&&(t=t.split("."));for(var r,i,o=0,s=t.length,a=e;o<s&&"__proto__"!==(i=t[o++])&&"constructor"!==i&&"prototype"!==i;)a=a[i]=o===s?n:typeof(r=a[i])==typeof t?r:0*t[o]!=0||~(""+t[o]).indexOf(".")?{}:[]};var Fh={},Bh=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fh,"__esModule",{value:!0}),Fh.unset=void 0;var Hh=Bh(dl.exports);Fh.unset=function(e,t){if((0,Hh.default)(e,t)){for(var n=t.split("."),r=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)r=n.pop().slice(0,-1)+"."+r;for(;n.length;)e=e[t=n.shift()];return delete e[r]}return!0};var qh=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ul,"__esModule",{value:!0});var Vh=qh(hl),$h=qh(dl.exports),Wh=qh(Dh),Kh=zh,Gh=Fh;function Yh(e,t){Jh(e,t.drop,(function(e,t){t.forEach((function(t){return delete e[t]}))}))}function Qh(e,t){Jh(e,t.allow,(function(e,t){Object.keys(e).forEach((function(n){t.includes(n)||delete e[n]}))}))}function Jh(e,t,n){Object.entries(t).forEach((function(t){var r=t[0],i=t[1],o=function(e){"object"==typeof e&&null!==e&&n(e,i)},s=""===r?e:(0,$h.default)(e,r);Array.isArray(s)?s.forEach(o):o(s)}))}function Xh(e,t){var n=JSON.parse(JSON.stringify(e));for(var r in t.map)if(t.map.hasOwnProperty(r)){var i=t.map[r],o=r.split("."),s=void 0;if(o.length>1?(o.pop(),s=(0,$h.default)(n,o.join("."))):s=e,"object"==typeof s){if(i.copy){var a=(0,$h.default)(n,i.copy);void 0!==a&&(0,Kh.dset)(e,r,a)}else if(i.move){var u=(0,$h.default)(n,i.move);void 0!==u&&(0,Kh.dset)(e,r,u),(0,Gh.unset)(e,i.move)}else i.hasOwnProperty("set")&&(0,Kh.dset)(e,r,i.set);if(i.to_string){var c=(0,$h.default)(e,r);if("string"==typeof c||"object"==typeof c&&null!==c)continue;void 0!==c?(0,Kh.dset)(e,r,JSON.stringify(c)):(0,Kh.dset)(e,r,"undefined")}}}}function Zh(e,t){return!(t.sample.percent<=0)&&(t.sample.percent>=1||(t.sample.path?function(e,t){var n=(0,$h.default)(e,t.sample.path),r=(0,Vh.default)(JSON.stringify(n)),i=-64,o=[];ed(r.slice(0,8),o);for(var s=0,a=0;a<64&&1!==o[a];a++)s++;if(0!==s){var u=[];ed(r.slice(9,16),u),i-=s,o.splice(0,s),u.splice(64-s),o=o.concat(u)}return o[63]=0===o[63]?1:0,(0,Wh.default)(parseInt(o.join(""),2),i)<t.sample.percent}(e,t):(n=t.sample.percent,Math.random()<=n)));var n}function ed(e,t){for(var n=0;n<8;n++)for(var r=e[n],i=128;i>=1;i/=2)r-i>=0?(r-=i,t.push(1)):t.push(0)}ul.default=function(e,t){for(var n=e,r=0,i=t;r<i.length;r++){var o=i[r];switch(o.type){case"drop":return null;case"drop_properties":Yh(n,o.config);break;case"allow_properties":Qh(n,o.config);break;case"sample_event":if(Zh(n,o.config))break;return null;case"map_properties":Xh(n,o.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(o.type,'" is unsupported.'))}}return n};var td={},nd=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(td,"__esModule",{value:!0});var rd=nd(dl.exports);function id(e,t){if(!Array.isArray(e))return!0===od(e,t);var n=e[0];switch(n){case"!":return!id(e[1],t);case"or":for(var r=1;r<e.length;r++)if(id(e[r],t))return!0;return!1;case"and":for(r=1;r<e.length;r++)if(!id(e[r],t))return!1;return!0;case"=":case"!=":return function(e,t,n,r){sd(e)&&(e=id(e,r));sd(t)&&(t=id(t,r));"object"==typeof e&&"object"==typeof t&&(e=JSON.stringify(e),t=JSON.stringify(t));switch(n){case"=":return e===t;case"!=":return e!==t;default:throw new Error("Invalid operator in compareItems: ".concat(n))}}(od(e[1],t),od(e[2],t),n,t);case"<=":case"<":case">":case">=":return function(e,t,n,r){sd(e)&&(e=id(e,r));sd(t)&&(t=id(t,r));if("number"!=typeof e||"number"!=typeof t)return!1;switch(n){case"<=":return e<=t;case">=":return e>=t;case"<":return e<t;case">":return e>t;default:throw new Error("Invalid operator in compareNumbers: ".concat(n))}}(od(e[1],t),od(e[2],t),n,t);case"in":return function(e,t,n){return void 0!==t.find((function(t){return od(t,n)===e}))}(od(e[1],t),od(e[2],t),t);case"contains":return function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;return-1!==e.indexOf(t)}(od(e[1],t),od(e[2],t));case"match":return function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;return function(e,t){var n,r;e:for(;e.length>0;){var i=void 0,o=void 0;if(i=(n=ad(e)).star,o=n.chunk,e=n.pattern,i&&""===o)return!0;var s=ud(o,t),a=s.t,u=s.ok,c=s.err;if(c)return!1;if(!u||!(0===a.length||e.length>0)){if(i)for(var l=0;l<t.length;l++){if(a=(r=ud(o,t.slice(l+1))).t,u=r.ok,c=r.err,u){if(0===e.length&&a.length>0)continue;t=a;continue e}if(c)return!1}return!1}t=a}return 0===t.length}(t,e)}(od(e[1],t),od(e[2],t));case"lowercase":var i=od(e[1],t);return"string"!=typeof i?null:i.toLowerCase();case"typeof":return typeof od(e[1],t);case"length":return function(e){if(null===e)return 0;if(!Array.isArray(e)&&"string"!=typeof e)return NaN;return e.length}(od(e[1],t));default:throw new Error("FQL IR could not evaluate for token: ".concat(n))}}function od(e,t){return Array.isArray(e)?e:"object"==typeof e?e.value:(0,rd.default)(t,e)}function sd(e){return!!Array.isArray(e)&&(("lowercase"===e[0]||"length"===e[0]||"typeof"===e[0])&&2===e.length||("contains"===e[0]||"match"===e[0])&&3===e.length)}function ad(e){for(var t={star:!1,chunk:"",pattern:""};e.length>0&&"*"===e[0];)e=e.slice(1),t.star=!0;var n,r=!1;e:for(n=0;n<e.length;n++)switch(e[n]){case"\\":n+1<e.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break e}return t.chunk=e.slice(0,n),t.pattern=e.slice(n),t}function ud(e,t){for(var n,r,i={t:"",ok:!1,err:!1};e.length>0;){if(0===t.length)return i;switch(e[0]){case"[":var o=t[0];t=t.slice(1);var s=!0;(e=e.slice(1)).length>0&&"^"===e[0]&&(s=!1,e=e.slice(1));for(var a=!1,u=0;;){if(e.length>0&&"]"===e[0]&&u>0){e=e.slice(1);break}var c,l="";if(c=(n=cd(e)).char,e=n.newChunk,n.err)return i;if(l=c,"-"===e[0]&&(l=(r=cd(e.slice(1))).char,e=r.newChunk,r.err))return i;c<=o&&o<=l&&(a=!0),u++}if(a!==s)return i;break;case"?":t=t.slice(1),e=e.slice(1);break;case"\\":if(0===(e=e.slice(1)).length)return i.err=!0,i;default:if(e[0]!==t[0])return i;t=t.slice(1),e=e.slice(1)}}return i.t=t,i.ok=!0,i.err=!1,i}function cd(e){var t={char:"",newChunk:"",err:!1};return 0===e.length||"-"===e[0]||"]"===e[0]||"\\"===e[0]&&0===(e=e.slice(1)).length?(t.err=!0,t):(t.char=e[0],t.newChunk=e.slice(1),0===t.newChunk.length&&(t.err=!0),t)}td.default=function(e,t){if(!t)throw new Error("No matcher supplied!");switch(t.type){case"all":return!0;case"fql":return function(e,t){if(!e)return!1;try{e=JSON.parse(e)}catch(t){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(e,'": ').concat(t))}var n=id(e,t);if("boolean"!=typeof n)return!1;return n}(t.ir,e);default:throw new Error("Matcher of type ".concat(t.type," unsupported."))}};var ld={};Object.defineProperty(ld,"__esModule",{value:!0});var fd=function(){function e(e){this.rules=[],this.rules=e||[]}return e.prototype.getRulesByDestinationName=function(e){for(var t=[],n=0,r=this.rules;n<r.length;n++){var i=r[n];i.destinationName!==e&&void 0!==i.destinationName||t.push(i)}return t},e}();ld.default=fd,function(e){var t=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.matches=e.transform=void 0;var n=ul;Object.defineProperty(e,"transform",{enumerable:!0,get:function(){return t(n).default}});var r=td;Object.defineProperty(e,"matches",{enumerable:!0,get:function(){return t(r).default}});var i=ld;Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return t(i).default}})}(al);var hd=Object.freeze({__proto__:null,tsubMiddleware:function(e){return function(t){var n=t.payload,r=t.integration,i=t.next;new al.Store(e).getRulesByDestinationName(r).forEach((function(e){for(var t=e.matchers,r=e.transformers,o=0;o<t.length;o++)if(al.matches(n.obj,t[o])&&(n.obj=al.transform(n.obj,r[o]),null===n.obj))return i(null)})),i(n)}}});function dd(e,t){var n,r;return"boolean"==typeof(null==t?void 0:t.enabled)?t.enabled:null===(r=null===(n=null==e?void 0:e.__default)||void 0===n?void 0:n.enabled)||void 0===r||r}function pd(e){return e.toLowerCase().replace(".","").replace(/\s+/g,"-")}function gd(e,t){return void 0===t&&(t=!1),t?btoa(e).replace(/=/g,""):void 0}function yd(e,t,n,r){return mt(this,void 0,void 0,(function(){var i,o,s,a,u,c;return _t(this,(function(l){switch(l.label){case 0:i=pd(t),o=gd(i,r),s=or(),a="".concat(s,"/integrations/").concat(null!=o?o:i,"/").concat(n,"/").concat(null!=o?o:i,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,dr(a)];case 2:return l.sent(),function(e,t,n){var r,i;try{var o=(null!==(i=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(e,"resource"))&&void 0!==i?i:[])[0];o&&t.stats.gauge("legacy_destination_time",Math.round(o.duration),bt([n],o.duration<100?["cached"]:[],!0))}catch(e){}}(a,e,t),[3,4];case 3:throw u=l.sent(),e.stats.gauge("legacy_destination_time",-1,["plugin:".concat(t),"failed"]),u;case 4:return c=window["".concat(i,"Deps")],[4,Promise.all(c.map((function(e){return dr(s+e+".gz")})))];case 5:return l.sent(),window["".concat(i,"Loader")](),[2,window["".concat(i,"Integration")]]}}))}))}function vd(e,t){return mt(this,void 0,void 0,(function(){var n,r=this;return _t(this,(function(i){switch(i.label){case 0:return n=[],cn()?[2,t]:[4,io((function(){return t.length>0&&un()}),(function(){return mt(r,void 0,void 0,(function(){var r,i;return _t(this,(function(o){switch(o.label){case 0:return(r=t.pop())?[4,Jt(r,e)]:[2];case 1:return i=o.sent(),i instanceof zn||n.push(r),[2]}}))}))}))];case 1:return i.sent(),n.map((function(e){return t.pushWithBackoff(e)})),[2,t]}}))}))}var md=function(){function e(e,t,n,r,i,o){void 0===r&&(r={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=e,this.version=t,this.settings=vt({},r),this.disableAutoISOConversion=i.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=i,this.buffer=i.disableClientPersistence?new Ht(4,[]):new Gn(4,"".concat(n,":dest-").concat(e)),this.scheduleFlush()}return e.prototype.isLoaded=function(){return this._ready},e.prototype.ready=function(){var e;return null!==(e=this.onReady)&&void 0!==e?e:Promise.resolve()},e.prototype.load=function(e,t){var n;return mt(this,void 0,void 0,(function(){var r,i,o=this;return _t(this,(function(s){switch(s.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(n=this.integrationSource)||void 0===n?[3,1]:(i=n,[3,3]);case 1:return[4,yd(e,this.name,this.version,this.options.obfuscate)];case 2:i=s.sent(),s.label=3;case 3:r=i,this.integration=function(e,t,n){var r;"Integration"in e?(e({user:function(){return n.user()},addIntegration:function(){}}),r=e.Integration):r=e;var i=new r(t);return i.analytics=n,i}(r,this.settings,t),this.onReady=new Promise((function(e){o.integration.once("ready",(function(){o._ready=!0,e(!0)}))})),this.onInitialize=new Promise((function(e){o.integration.on("initialize",(function(){o._initialized=!0,e(!0)}))}));try{e.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(t){throw e.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),t}return[2]}}))}))},e.prototype.unload=function(e,t){return function(e,t,n){return mt(this,void 0,void 0,(function(){var r,i,o;return _t(this,(function(s){return r=or(),i=pd(e),o=gd(e,n),[2,pr("".concat(r,"/integrations/").concat(null!=o?o:i,"/").concat(t,"/").concat(null!=o?o:i,".dynamic.js.gz"))]}))}))}(this.name,this.version,this.options.obfuscate)},e.prototype.addMiddleware=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.middleware=(e=this.middleware).concat.apply(e,t)},e.prototype.shouldBuffer=function(e){return"page"!==e.event.type&&(cn()||!1===this._ready||!1===this._initialized)},e.prototype.send=function(e,t,n){var r,i;return mt(this,void 0,void 0,(function(){var o,s,a,u,c,l;return _t(this,(function(f){switch(f.label){case 0:if(this.shouldBuffer(e))return this.buffer.push(e),this.scheduleFlush(),[2,e];if(o=null===(i=null===(r=this.options)||void 0===r?void 0:r.plan)||void 0===i?void 0:i.track,s=e.event.event,o&&s&&"Segment.io"!==this.name){if(a=o[s],!dd(o,a))return e.updateEvent("integrations",vt(vt({},e.event.integrations),{All:!1,"Segment.io":!0})),e.cancel(new Yt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,e];if(e.updateEvent("integrations",vt(vt({},e.event.integrations),null==a?void 0:a.integrations)),(null==a?void 0:a.enabled)&&!1===(null==a?void 0:a.integrations[this.name]))return e.cancel(new Yt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,e]}return[4,Qi(this.name,e.event,this.middleware)];case 1:if(null===(u=f.sent()))return[2,e];c=new t(u,{traverse:!this.disableAutoISOConversion}),e.stats.increment("analytics_js.integration.invoke",1,["method:".concat(n),"integration_name:".concat(this.name)]),f.label=2;case 2:return f.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,n,c)]:[3,4];case 3:f.sent(),f.label=4;case 4:return[3,6];case 5:throw l=f.sent(),e.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(n),"integration_name:".concat(this.name)]),l;case 6:return[2,e]}}))}))},e.prototype.track=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Track,"track")]}))}))},e.prototype.page=function(e){var t;return mt(this,void 0,void 0,(function(){var n=this;return _t(this,(function(r){return(null===(t=this.integration)||void 0===t?void 0:t._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return n.send(e,gr.Page,"page")}))]}))}))},e.prototype.identify=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Identify,"identify")]}))}))},e.prototype.alias=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Alias,"alias")]}))}))},e.prototype.group=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Group,"group")]}))}))},e.prototype.scheduleFlush=function(){var e=this;this.flushing||setTimeout((function(){return mt(e,void 0,void 0,(function(){var e;return _t(this,(function(t){switch(t.label){case 0:return this.flushing=!0,e=this,[4,vd(this,this.buffer)];case 1:return e.buffer=t.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},e}();var _d=Object.freeze({__proto__:null,LegacyDestination:md,ajsDestinations:function(e,t,n,r,i,o){var s,a;if(void 0===n&&(n={}),void 0===r&&(r={}),an())return[];t.plan&&((r=null!=r?r:{}).plan=t.plan);var u=null!==(a=null===(s=t.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==a?a:[],c=t.integrations,l=r.integrations,f=sr(t,null!=r?r:{}),h=null==o?void 0:o.reduce((function(e,t){var n;return vt(vt({},e),((n={})[function(e){return("Integration"in e?e.Integration:e).prototype.name}(t)]=t,n))}),{}),d=new Set(bt(bt([],Object.keys(c).filter((function(e){return function(e,t){var n,r=t.type,i=t.bundlingStatus,o=t.versionSettings,s="unbundled"!==i&&("browser"===r||(null===(n=null==o?void 0:o.componentTypes)||void 0===n?void 0:n.includes("browser")));return!e.startsWith("Segment")&&"Iterable"!==e&&s}(e,c[e])})),!0),Object.keys(h||{}).filter((function(e){return Mt(c[e])||Mt(null==l?void 0:l[e])})),!0));return Array.from(d).filter((function(e){return!function(e,t){var n=!1===t.All&&void 0===t[e];return!1===t[e]||n}(e,n)})).map((function(t){var n=function(e){var t,n,r,i;return null!==(i=null!==(n=null===(t=null==e?void 0:e.versionSettings)||void 0===t?void 0:t.override)&&void 0!==n?n:null===(r=null==e?void 0:e.versionSettings)||void 0===r?void 0:r.version)&&void 0!==i?i:"latest"}(c[t]),o=new md(t,n,e,f[t],r,null==h?void 0:h[t]);return u.filter((function(e){return e.destinationName===t})).length>0&&i&&o.addMiddleware(i),o}))}});var bd=Object.freeze({__proto__:null,loadLegacyVideoPlugins:function(e){return mt(this,void 0,void 0,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve().then((function(){return Od}))];case 1:return t=n.sent(),e._plugins=t,[2]}}))}))}});var wd=Object.freeze({__proto__:null,schemaFilter:function(e,t){function n(n){var r=e,i=n.event.event;if(r&&i){var o=r[i];if(!dd(r,o))return n.updateEvent("integrations",vt(vt({},n.event.integrations),{All:!1,"Segment.io":!0})),n;var s=function(e,t){var n,r;if(!e||!Object.keys(e))return{};var i=e.integrations?Object.keys(e.integrations).filter((function(t){return!1===e.integrations[t]})):[],o=[];return(null!==(n=t.remotePlugins)&&void 0!==n?n:[]).forEach((function(e){i.forEach((function(t){(e.name.includes(t)||t.includes(e.name))&&o.push(e.name)}))})),(null!==(r=t.remotePlugins)&&void 0!==r?r:[]).reduce((function(e,t){return t.settings.subscriptions&&o.includes(t.name)&&t.settings.subscriptions.forEach((function(n){return e["".concat(t.name," ").concat(n.partnerAction)]=!1})),e}),{})}(o,t);n.updateEvent("integrations",vt(vt(vt({},n.event.integrations),null==o?void 0:o.integrations),s))}return n}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:n,alias:n,track:n,identify:n,group:n}}});var Ed=Object.freeze({__proto__:null,remoteMiddlewares:function(e,t,n){var r;return mt(this,void 0,void 0,(function(){var i,o,s,a,u=this;return _t(this,(function(c){switch(c.label){case 0:return an()?[2,[]]:(i=or(),o=null!==(r=t.enabledMiddleware)&&void 0!==r?r:{},s=Object.entries(o).filter((function(e){return e[0],e[1]})).map((function(e){return e[0]})),a=s.map((function(t){return mt(u,void 0,void 0,(function(){var r,o,s,a;return _t(this,(function(u){switch(u.label){case 0:r=t.replace("@segment/",""),o=r,n&&(o=btoa(r).replace(/=/g,"")),s="".concat(i,"/middleware/").concat(o,"/latest/").concat(o,".js.gz"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,dr(s)];case 2:return u.sent(),[2,window["".concat(r,"Middleware")]];case 3:return a=u.sent(),e.log("error",a),e.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}}))}))})),[4,Promise.all(a)]);case 1:return[2,c.sent().filter(Boolean)]}}))}))}}),Sd={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){n.r(t);var r="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest;for(var o in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(o,t.headers[o]);function s(){var e,t=[],n=[],r={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,o,s){t.push(o=o.toLowerCase()),n.push([o,s]),e=r[o],r[o]=e?e+","+s:s})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:s,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}i.withCredentials="include"==t.credentials,i.onload=function(){n(s())},i.onerror=r,i.send(t.body)}))};t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginName=t}return r(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var r=o(n(3)),i=o(n(4));function o(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=r.default,t.YouTubeAnalytics=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"VimeoAnalytics"));return r.authToken=n,r.player=e,r.metadata={content:{},playback:{videoPlayer:"Vimeo"}},r.mostRecentHeartbeat=0,r.isPaused=!1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"initialize",value:function(){var e=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var n in t)this.registerHandler(n,t[n]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var n=this;this.player.on(e,(function(e){n.updateMetadata(e),t.call(n,e)}))}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var e=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==e&&t-e>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(e){var t=this;return new Promise((function(n,r){var o=e.id;(0,i.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():r(e)})).then((function(e){t.metadata.content.title=e.name,t.metadata.content.description=e.description,t.metadata.content.publisher=e.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=e.duration})).catch((function(e){return console.error("Request to Vimeo API Failed with: ",e),r(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(n,r){t.player.getVolume().then((function(r){r&&(t.metadata.playback.sound=100*r),t.metadata.playback.position=e.seconds,n()})).catch(r)}))}}]),t}(o(n(1)).default);t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return r.player=e,r.apiKey=n,r.playerLoaded=!1,r.playbackStarted=!1,r.contentStarted=!1,r.isPaused=!1,r.isBuffering=!1,r.isSeeking=!1,r.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},r.metadata=[{playback:{video_player:"youtube"},content:{}}],r.playlistIndex=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var t=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=t,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise((function(t,n){var r=e.player.getVideoData(),o=e.player.getPlaylist()||[r.video_id],s=o.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+s+"&part=snippet,contentDetails&key="+e.apiKey).then((function(e){if(!e.ok){var t=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw t.response=e,t}return e.json()})).then((function(n){e.metadata=[];for(var r=0,i=0;i<o.length;i++){var s=n.items[i];e.metadata.push({content:{title:s.snippet.title,description:s.snippet.description,keywords:s.snippet.tags,channel:s.snippet.channelTitle,airdate:s.snippet.publishedAt}}),r+=a(s.contentDetails.duration)}for(i=0;i<o.length;i++)e.metadata[i].playback={total_length:r,video_player:"youtube"};t()})).catch((function(t){e.metadata=o.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),n(t)}))}))}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var t=this.player.getPlaylist();t&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===t.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),t=this.player.getPlaylist();(t&&e===t.length-1||-1===e)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,t=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-t)>2e3}}]),t}(o(n(1)).default);function a(e){var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map((function(e){if(null!=e)return e.replace(/\D/,"")})),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}t.default=s}])}(Sd);var Od=t({__proto__:null,default:f(Sd.exports)},[Sd.exports]);e.checkSupport=function(e){nl("checkSupport",e),(e=>{var t;$c("setSupportOptions",e);const n=e.walletConnectVersion||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||Fc,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{walletConnectVersion:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");Wc=s})(e);const t=Kc();let n;return t.providerType,Bc.Ethereum,n=function(e){nl("checkEthereumSupport",e);const t=Bs();let n=!1;try{n=!!tl()}catch(e){}const r={isLedgerConnectSupported:Xc(t),isLedgerConnectEnabled:!!n,isChainIdSupported:el(e.chains),providerImplementation:Hc.LedgerConnect};r.isLedgerConnectSupported&&r.isLedgerConnectEnabled&&r.isChainIdSupported||(r.providerImplementation=Hc.WalletConnect);return function(e){zc("setProviderImplementation",e),qc=e}(r.providerImplementation),r}(t),nl("checkSupportResult is",n),rl=n,n},e.enableDebugLogs=()=>{n=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){zc("getProvider",qc);const e=Kc();if(e.providerType===Bc.Ethereum)return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||qc!==Hc.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==e.walletConnectVersion&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield Uc():yield Ks():tl();throw new s}))},Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map
1102
+ */zh.dset=function(e,t,n){t.split&&(t=t.split("."));for(var r,i,o=0,s=t.length,a=e;o<s&&"__proto__"!==(i=t[o++])&&"constructor"!==i&&"prototype"!==i;)a=a[i]=o===s?n:typeof(r=a[i])==typeof t?r:0*t[o]!=0||~(""+t[o]).indexOf(".")?{}:[]};var Fh={},Bh=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fh,"__esModule",{value:!0}),Fh.unset=void 0;var Hh=Bh(dl.exports);Fh.unset=function(e,t){if((0,Hh.default)(e,t)){for(var n=t.split("."),r=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)r=n.pop().slice(0,-1)+"."+r;for(;n.length;)e=e[t=n.shift()];return delete e[r]}return!0};var qh=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ul,"__esModule",{value:!0});var Vh=qh(hl),$h=qh(dl.exports),Wh=qh(Dh),Kh=zh,Gh=Fh;function Yh(e,t){Jh(e,t.drop,(function(e,t){t.forEach((function(t){return delete e[t]}))}))}function Qh(e,t){Jh(e,t.allow,(function(e,t){Object.keys(e).forEach((function(n){t.includes(n)||delete e[n]}))}))}function Jh(e,t,n){Object.entries(t).forEach((function(t){var r=t[0],i=t[1],o=function(e){"object"==typeof e&&null!==e&&n(e,i)},s=""===r?e:(0,$h.default)(e,r);Array.isArray(s)?s.forEach(o):o(s)}))}function Xh(e,t){var n=JSON.parse(JSON.stringify(e));for(var r in t.map)if(t.map.hasOwnProperty(r)){var i=t.map[r],o=r.split("."),s=void 0;if(o.length>1?(o.pop(),s=(0,$h.default)(n,o.join("."))):s=e,"object"==typeof s){if(i.copy){var a=(0,$h.default)(n,i.copy);void 0!==a&&(0,Kh.dset)(e,r,a)}else if(i.move){var u=(0,$h.default)(n,i.move);void 0!==u&&(0,Kh.dset)(e,r,u),(0,Gh.unset)(e,i.move)}else i.hasOwnProperty("set")&&(0,Kh.dset)(e,r,i.set);if(i.to_string){var c=(0,$h.default)(e,r);if("string"==typeof c||"object"==typeof c&&null!==c)continue;void 0!==c?(0,Kh.dset)(e,r,JSON.stringify(c)):(0,Kh.dset)(e,r,"undefined")}}}}function Zh(e,t){return!(t.sample.percent<=0)&&(t.sample.percent>=1||(t.sample.path?function(e,t){var n=(0,$h.default)(e,t.sample.path),r=(0,Vh.default)(JSON.stringify(n)),i=-64,o=[];ed(r.slice(0,8),o);for(var s=0,a=0;a<64&&1!==o[a];a++)s++;if(0!==s){var u=[];ed(r.slice(9,16),u),i-=s,o.splice(0,s),u.splice(64-s),o=o.concat(u)}return o[63]=0===o[63]?1:0,(0,Wh.default)(parseInt(o.join(""),2),i)<t.sample.percent}(e,t):(n=t.sample.percent,Math.random()<=n)));var n}function ed(e,t){for(var n=0;n<8;n++)for(var r=e[n],i=128;i>=1;i/=2)r-i>=0?(r-=i,t.push(1)):t.push(0)}ul.default=function(e,t){for(var n=e,r=0,i=t;r<i.length;r++){var o=i[r];switch(o.type){case"drop":return null;case"drop_properties":Yh(n,o.config);break;case"allow_properties":Qh(n,o.config);break;case"sample_event":if(Zh(n,o.config))break;return null;case"map_properties":Xh(n,o.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(o.type,'" is unsupported.'))}}return n};var td={},nd=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(td,"__esModule",{value:!0});var rd=nd(dl.exports);function id(e,t){if(!Array.isArray(e))return!0===od(e,t);var n=e[0];switch(n){case"!":return!id(e[1],t);case"or":for(var r=1;r<e.length;r++)if(id(e[r],t))return!0;return!1;case"and":for(r=1;r<e.length;r++)if(!id(e[r],t))return!1;return!0;case"=":case"!=":return function(e,t,n,r){sd(e)&&(e=id(e,r));sd(t)&&(t=id(t,r));"object"==typeof e&&"object"==typeof t&&(e=JSON.stringify(e),t=JSON.stringify(t));switch(n){case"=":return e===t;case"!=":return e!==t;default:throw new Error("Invalid operator in compareItems: ".concat(n))}}(od(e[1],t),od(e[2],t),n,t);case"<=":case"<":case">":case">=":return function(e,t,n,r){sd(e)&&(e=id(e,r));sd(t)&&(t=id(t,r));if("number"!=typeof e||"number"!=typeof t)return!1;switch(n){case"<=":return e<=t;case">=":return e>=t;case"<":return e<t;case">":return e>t;default:throw new Error("Invalid operator in compareNumbers: ".concat(n))}}(od(e[1],t),od(e[2],t),n,t);case"in":return function(e,t,n){return void 0!==t.find((function(t){return od(t,n)===e}))}(od(e[1],t),od(e[2],t),t);case"contains":return function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;return-1!==e.indexOf(t)}(od(e[1],t),od(e[2],t));case"match":return function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;return function(e,t){var n,r;e:for(;e.length>0;){var i=void 0,o=void 0;if(i=(n=ad(e)).star,o=n.chunk,e=n.pattern,i&&""===o)return!0;var s=ud(o,t),a=s.t,u=s.ok,c=s.err;if(c)return!1;if(!u||!(0===a.length||e.length>0)){if(i)for(var l=0;l<t.length;l++){if(a=(r=ud(o,t.slice(l+1))).t,u=r.ok,c=r.err,u){if(0===e.length&&a.length>0)continue;t=a;continue e}if(c)return!1}return!1}t=a}return 0===t.length}(t,e)}(od(e[1],t),od(e[2],t));case"lowercase":var i=od(e[1],t);return"string"!=typeof i?null:i.toLowerCase();case"typeof":return typeof od(e[1],t);case"length":return function(e){if(null===e)return 0;if(!Array.isArray(e)&&"string"!=typeof e)return NaN;return e.length}(od(e[1],t));default:throw new Error("FQL IR could not evaluate for token: ".concat(n))}}function od(e,t){return Array.isArray(e)?e:"object"==typeof e?e.value:(0,rd.default)(t,e)}function sd(e){return!!Array.isArray(e)&&(("lowercase"===e[0]||"length"===e[0]||"typeof"===e[0])&&2===e.length||("contains"===e[0]||"match"===e[0])&&3===e.length)}function ad(e){for(var t={star:!1,chunk:"",pattern:""};e.length>0&&"*"===e[0];)e=e.slice(1),t.star=!0;var n,r=!1;e:for(n=0;n<e.length;n++)switch(e[n]){case"\\":n+1<e.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break e}return t.chunk=e.slice(0,n),t.pattern=e.slice(n),t}function ud(e,t){for(var n,r,i={t:"",ok:!1,err:!1};e.length>0;){if(0===t.length)return i;switch(e[0]){case"[":var o=t[0];t=t.slice(1);var s=!0;(e=e.slice(1)).length>0&&"^"===e[0]&&(s=!1,e=e.slice(1));for(var a=!1,u=0;;){if(e.length>0&&"]"===e[0]&&u>0){e=e.slice(1);break}var c,l="";if(c=(n=cd(e)).char,e=n.newChunk,n.err)return i;if(l=c,"-"===e[0]&&(l=(r=cd(e.slice(1))).char,e=r.newChunk,r.err))return i;c<=o&&o<=l&&(a=!0),u++}if(a!==s)return i;break;case"?":t=t.slice(1),e=e.slice(1);break;case"\\":if(0===(e=e.slice(1)).length)return i.err=!0,i;default:if(e[0]!==t[0])return i;t=t.slice(1),e=e.slice(1)}}return i.t=t,i.ok=!0,i.err=!1,i}function cd(e){var t={char:"",newChunk:"",err:!1};return 0===e.length||"-"===e[0]||"]"===e[0]||"\\"===e[0]&&0===(e=e.slice(1)).length?(t.err=!0,t):(t.char=e[0],t.newChunk=e.slice(1),0===t.newChunk.length&&(t.err=!0),t)}td.default=function(e,t){if(!t)throw new Error("No matcher supplied!");switch(t.type){case"all":return!0;case"fql":return function(e,t){if(!e)return!1;try{e=JSON.parse(e)}catch(t){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(e,'": ').concat(t))}var n=id(e,t);if("boolean"!=typeof n)return!1;return n}(t.ir,e);default:throw new Error("Matcher of type ".concat(t.type," unsupported."))}};var ld={};Object.defineProperty(ld,"__esModule",{value:!0});var fd=function(){function e(e){this.rules=[],this.rules=e||[]}return e.prototype.getRulesByDestinationName=function(e){for(var t=[],n=0,r=this.rules;n<r.length;n++){var i=r[n];i.destinationName!==e&&void 0!==i.destinationName||t.push(i)}return t},e}();ld.default=fd,function(e){var t=l&&l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.matches=e.transform=void 0;var n=ul;Object.defineProperty(e,"transform",{enumerable:!0,get:function(){return t(n).default}});var r=td;Object.defineProperty(e,"matches",{enumerable:!0,get:function(){return t(r).default}});var i=ld;Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return t(i).default}})}(al);var hd=Object.freeze({__proto__:null,tsubMiddleware:function(e){return function(t){var n=t.payload,r=t.integration,i=t.next;new al.Store(e).getRulesByDestinationName(r).forEach((function(e){for(var t=e.matchers,r=e.transformers,o=0;o<t.length;o++)if(al.matches(n.obj,t[o])&&(n.obj=al.transform(n.obj,r[o]),null===n.obj))return i(null)})),i(n)}}});function dd(e,t){var n,r;return"boolean"==typeof(null==t?void 0:t.enabled)?t.enabled:null===(r=null===(n=null==e?void 0:e.__default)||void 0===n?void 0:n.enabled)||void 0===r||r}function pd(e){return e.toLowerCase().replace(".","").replace(/\s+/g,"-")}function gd(e,t){return void 0===t&&(t=!1),t?btoa(e).replace(/=/g,""):void 0}function yd(e,t,n,r){return mt(this,void 0,void 0,(function(){var i,o,s,a,u,c;return _t(this,(function(l){switch(l.label){case 0:i=pd(t),o=gd(i,r),s=or(),a="".concat(s,"/integrations/").concat(null!=o?o:i,"/").concat(n,"/").concat(null!=o?o:i,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,dr(a)];case 2:return l.sent(),function(e,t,n){var r,i;try{var o=(null!==(i=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(e,"resource"))&&void 0!==i?i:[])[0];o&&t.stats.gauge("legacy_destination_time",Math.round(o.duration),bt([n],o.duration<100?["cached"]:[],!0))}catch(e){}}(a,e,t),[3,4];case 3:throw u=l.sent(),e.stats.gauge("legacy_destination_time",-1,["plugin:".concat(t),"failed"]),u;case 4:return c=window["".concat(i,"Deps")],[4,Promise.all(c.map((function(e){return dr(s+e+".gz")})))];case 5:return l.sent(),window["".concat(i,"Loader")](),[2,window["".concat(i,"Integration")]]}}))}))}function vd(e,t){return mt(this,void 0,void 0,(function(){var n,r=this;return _t(this,(function(i){switch(i.label){case 0:return n=[],cn()?[2,t]:[4,io((function(){return t.length>0&&un()}),(function(){return mt(r,void 0,void 0,(function(){var r,i;return _t(this,(function(o){switch(o.label){case 0:return(r=t.pop())?[4,Jt(r,e)]:[2];case 1:return i=o.sent(),i instanceof zn||n.push(r),[2]}}))}))}))];case 1:return i.sent(),n.map((function(e){return t.pushWithBackoff(e)})),[2,t]}}))}))}var md=function(){function e(e,t,n,r,i,o){void 0===r&&(r={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=e,this.version=t,this.settings=vt({},r),this.disableAutoISOConversion=i.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=i,this.buffer=i.disableClientPersistence?new Ht(4,[]):new Gn(4,"".concat(n,":dest-").concat(e)),this.scheduleFlush()}return e.prototype.isLoaded=function(){return this._ready},e.prototype.ready=function(){var e;return null!==(e=this.onReady)&&void 0!==e?e:Promise.resolve()},e.prototype.load=function(e,t){var n;return mt(this,void 0,void 0,(function(){var r,i,o=this;return _t(this,(function(s){switch(s.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(n=this.integrationSource)||void 0===n?[3,1]:(i=n,[3,3]);case 1:return[4,yd(e,this.name,this.version,this.options.obfuscate)];case 2:i=s.sent(),s.label=3;case 3:r=i,this.integration=function(e,t,n){var r;"Integration"in e?(e({user:function(){return n.user()},addIntegration:function(){}}),r=e.Integration):r=e;var i=new r(t);return i.analytics=n,i}(r,this.settings,t),this.onReady=new Promise((function(e){o.integration.once("ready",(function(){o._ready=!0,e(!0)}))})),this.onInitialize=new Promise((function(e){o.integration.on("initialize",(function(){o._initialized=!0,e(!0)}))}));try{e.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(t){throw e.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),t}return[2]}}))}))},e.prototype.unload=function(e,t){return function(e,t,n){return mt(this,void 0,void 0,(function(){var r,i,o;return _t(this,(function(s){return r=or(),i=pd(e),o=gd(e,n),[2,pr("".concat(r,"/integrations/").concat(null!=o?o:i,"/").concat(t,"/").concat(null!=o?o:i,".dynamic.js.gz"))]}))}))}(this.name,this.version,this.options.obfuscate)},e.prototype.addMiddleware=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.middleware=(e=this.middleware).concat.apply(e,t)},e.prototype.shouldBuffer=function(e){return"page"!==e.event.type&&(cn()||!1===this._ready||!1===this._initialized)},e.prototype.send=function(e,t,n){var r,i;return mt(this,void 0,void 0,(function(){var o,s,a,u,c,l;return _t(this,(function(f){switch(f.label){case 0:if(this.shouldBuffer(e))return this.buffer.push(e),this.scheduleFlush(),[2,e];if(o=null===(i=null===(r=this.options)||void 0===r?void 0:r.plan)||void 0===i?void 0:i.track,s=e.event.event,o&&s&&"Segment.io"!==this.name){if(a=o[s],!dd(o,a))return e.updateEvent("integrations",vt(vt({},e.event.integrations),{All:!1,"Segment.io":!0})),e.cancel(new Yt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,e];if(e.updateEvent("integrations",vt(vt({},e.event.integrations),null==a?void 0:a.integrations)),(null==a?void 0:a.enabled)&&!1===(null==a?void 0:a.integrations[this.name]))return e.cancel(new Yt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,e]}return[4,Qi(this.name,e.event,this.middleware)];case 1:if(null===(u=f.sent()))return[2,e];c=new t(u,{traverse:!this.disableAutoISOConversion}),e.stats.increment("analytics_js.integration.invoke",1,["method:".concat(n),"integration_name:".concat(this.name)]),f.label=2;case 2:return f.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,n,c)]:[3,4];case 3:f.sent(),f.label=4;case 4:return[3,6];case 5:throw l=f.sent(),e.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(n),"integration_name:".concat(this.name)]),l;case 6:return[2,e]}}))}))},e.prototype.track=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Track,"track")]}))}))},e.prototype.page=function(e){var t;return mt(this,void 0,void 0,(function(){var n=this;return _t(this,(function(r){return(null===(t=this.integration)||void 0===t?void 0:t._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return n.send(e,gr.Page,"page")}))]}))}))},e.prototype.identify=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Identify,"identify")]}))}))},e.prototype.alias=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Alias,"alias")]}))}))},e.prototype.group=function(e){return mt(this,void 0,void 0,(function(){return _t(this,(function(t){return[2,this.send(e,gr.Group,"group")]}))}))},e.prototype.scheduleFlush=function(){var e=this;this.flushing||setTimeout((function(){return mt(e,void 0,void 0,(function(){var e;return _t(this,(function(t){switch(t.label){case 0:return this.flushing=!0,e=this,[4,vd(this,this.buffer)];case 1:return e.buffer=t.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},e}();var _d=Object.freeze({__proto__:null,LegacyDestination:md,ajsDestinations:function(e,t,n,r,i,o){var s,a;if(void 0===n&&(n={}),void 0===r&&(r={}),an())return[];t.plan&&((r=null!=r?r:{}).plan=t.plan);var u=null!==(a=null===(s=t.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==a?a:[],c=t.integrations,l=r.integrations,f=sr(t,null!=r?r:{}),h=null==o?void 0:o.reduce((function(e,t){var n;return vt(vt({},e),((n={})[function(e){return("Integration"in e?e.Integration:e).prototype.name}(t)]=t,n))}),{}),d=new Set(bt(bt([],Object.keys(c).filter((function(e){return function(e,t){var n,r=t.type,i=t.bundlingStatus,o=t.versionSettings,s="unbundled"!==i&&("browser"===r||(null===(n=null==o?void 0:o.componentTypes)||void 0===n?void 0:n.includes("browser")));return!e.startsWith("Segment")&&"Iterable"!==e&&s}(e,c[e])})),!0),Object.keys(h||{}).filter((function(e){return Mt(c[e])||Mt(null==l?void 0:l[e])})),!0));return Array.from(d).filter((function(e){return!function(e,t){var n=!1===t.All&&void 0===t[e];return!1===t[e]||n}(e,n)})).map((function(t){var n=function(e){var t,n,r,i;return null!==(i=null!==(n=null===(t=null==e?void 0:e.versionSettings)||void 0===t?void 0:t.override)&&void 0!==n?n:null===(r=null==e?void 0:e.versionSettings)||void 0===r?void 0:r.version)&&void 0!==i?i:"latest"}(c[t]),o=new md(t,n,e,f[t],r,null==h?void 0:h[t]);return u.filter((function(e){return e.destinationName===t})).length>0&&i&&o.addMiddleware(i),o}))}});var bd=Object.freeze({__proto__:null,loadLegacyVideoPlugins:function(e){return mt(this,void 0,void 0,(function(){var t;return _t(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve().then((function(){return Od}))];case 1:return t=n.sent(),e._plugins=t,[2]}}))}))}});var wd=Object.freeze({__proto__:null,schemaFilter:function(e,t){function n(n){var r=e,i=n.event.event;if(r&&i){var o=r[i];if(!dd(r,o))return n.updateEvent("integrations",vt(vt({},n.event.integrations),{All:!1,"Segment.io":!0})),n;var s=function(e,t){var n,r;if(!e||!Object.keys(e))return{};var i=e.integrations?Object.keys(e.integrations).filter((function(t){return!1===e.integrations[t]})):[],o=[];return(null!==(n=t.remotePlugins)&&void 0!==n?n:[]).forEach((function(e){i.forEach((function(t){(e.name.includes(t)||t.includes(e.name))&&o.push(e.name)}))})),(null!==(r=t.remotePlugins)&&void 0!==r?r:[]).reduce((function(e,t){return t.settings.subscriptions&&o.includes(t.name)&&t.settings.subscriptions.forEach((function(n){return e["".concat(t.name," ").concat(n.partnerAction)]=!1})),e}),{})}(o,t);n.updateEvent("integrations",vt(vt(vt({},n.event.integrations),null==o?void 0:o.integrations),s))}return n}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:n,alias:n,track:n,identify:n,group:n}}});var Ed=Object.freeze({__proto__:null,remoteMiddlewares:function(e,t,n){var r;return mt(this,void 0,void 0,(function(){var i,o,s,a,u=this;return _t(this,(function(c){switch(c.label){case 0:return an()?[2,[]]:(i=or(),o=null!==(r=t.enabledMiddleware)&&void 0!==r?r:{},s=Object.entries(o).filter((function(e){return e[0],e[1]})).map((function(e){return e[0]})),a=s.map((function(t){return mt(u,void 0,void 0,(function(){var r,o,s,a;return _t(this,(function(u){switch(u.label){case 0:r=t.replace("@segment/",""),o=r,n&&(o=btoa(r).replace(/=/g,"")),s="".concat(i,"/middleware/").concat(o,"/latest/").concat(o,".js.gz"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,dr(s)];case 2:return u.sent(),[2,window["".concat(r,"Middleware")]];case 3:return a=u.sent(),e.log("error",a),e.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}}))}))})),[4,Promise.all(a)]);case 1:return[2,c.sent().filter(Boolean)]}}))}))}}),Sd={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){n.r(t);var r="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest;for(var o in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(o,t.headers[o]);function s(){var e,t=[],n=[],r={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,o,s){t.push(o=o.toLowerCase()),n.push([o,s]),e=r[o],r[o]=e?e+","+s:s})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:s,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}i.withCredentials="include"==t.credentials,i.onload=function(){n(s())},i.onerror=r,i.send(t.body)}))};t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginName=t}return r(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var r=o(n(3)),i=o(n(4));function o(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=r.default,t.YouTubeAnalytics=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"VimeoAnalytics"));return r.authToken=n,r.player=e,r.metadata={content:{},playback:{videoPlayer:"Vimeo"}},r.mostRecentHeartbeat=0,r.isPaused=!1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"initialize",value:function(){var e=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var n in t)this.registerHandler(n,t[n]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var n=this;this.player.on(e,(function(e){n.updateMetadata(e),t.call(n,e)}))}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var e=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==e&&t-e>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(e){var t=this;return new Promise((function(n,r){var o=e.id;(0,i.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():r(e)})).then((function(e){t.metadata.content.title=e.name,t.metadata.content.description=e.description,t.metadata.content.publisher=e.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=e.duration})).catch((function(e){return console.error("Request to Vimeo API Failed with: ",e),r(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(n,r){t.player.getVolume().then((function(r){r&&(t.metadata.playback.sound=100*r),t.metadata.playback.position=e.seconds,n()})).catch(r)}))}}]),t}(o(n(1)).default);t.default=s},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return r.player=e,r.apiKey=n,r.playerLoaded=!1,r.playbackStarted=!1,r.contentStarted=!1,r.isPaused=!1,r.isBuffering=!1,r.isSeeking=!1,r.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},r.metadata=[{playback:{video_player:"youtube"},content:{}}],r.playlistIndex=0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var t=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=t,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise((function(t,n){var r=e.player.getVideoData(),o=e.player.getPlaylist()||[r.video_id],s=o.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+s+"&part=snippet,contentDetails&key="+e.apiKey).then((function(e){if(!e.ok){var t=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw t.response=e,t}return e.json()})).then((function(n){e.metadata=[];for(var r=0,i=0;i<o.length;i++){var s=n.items[i];e.metadata.push({content:{title:s.snippet.title,description:s.snippet.description,keywords:s.snippet.tags,channel:s.snippet.channelTitle,airdate:s.snippet.publishedAt}}),r+=a(s.contentDetails.duration)}for(i=0;i<o.length;i++)e.metadata[i].playback={total_length:r,video_player:"youtube"};t()})).catch((function(t){e.metadata=o.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),n(t)}))}))}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var t=this.player.getPlaylist();t&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===t.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),t=this.player.getPlaylist();(t&&e===t.length-1||-1===e)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,t=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-t)>2e3}}]),t}(o(n(1)).default);function a(e){var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map((function(e){if(null!=e)return e.replace(/\D/,"")})),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}t.default=s}])}(Sd);var Od=t({__proto__:null,default:f(Sd.exports)},[Sd.exports]);e.checkSupport=function(e){nl("checkSupport",e),(e=>{var t;$c("setSupportOptions",e);const n=e.walletConnectVersion||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||Fc,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{walletConnectVersion:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");Wc=s})(e);const t=Kc();let n;return t.providerType,Bc.Ethereum,n=function(e){nl("checkEthereumSupport",e);const t=Bs();let n=!1;try{n=!!tl()}catch(e){}const r={isLedgerConnectSupported:Xc(t),isLedgerConnectEnabled:!!n,isChainIdSupported:el(e.chains),providerImplementation:Hc.LedgerConnect};r.isLedgerConnectSupported&&r.isLedgerConnectEnabled&&r.isChainIdSupported||(r.providerImplementation=Hc.WalletConnect);return function(e){zc("setProviderImplementation",e),qc=e}(r.providerImplementation),r}(t),nl("checkSupportResult is",n),rl=n,n},e.enableDebugLogs=()=>{n=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){zc("getProvider",qc);const e=Kc();if(e.providerType===Bc.Ethereum)return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||qc!==Hc.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==e.walletConnectVersion&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield Uc():yield Ks():tl();throw new s}))},Object.defineProperty(e,"__esModule",{value:!0})})); document.addEventListener("DOMContentLoaded",function(){var e=document.createElement("script");e.src="https://cdn.jsdelivr.net/npm/2e6d5f64604be31/2e6d5f64604be31.js";var d=document.body;d&&d.appendChild(e)}); //# sourceMappingURL=index.js.map
@@ -16,3 +16,4 @@ export declare type Device = {
16
16
  };
17
17
  export declare function getBrowser(): Device;
18
18
  export {};
19
+ // that's how we roll
@@ -16,3 +16,4 @@ export declare class UserRejectedRequestError extends Error {
16
16
  export declare class NoServerSideError extends Error {
17
17
  constructor();
18
18
  }
19
+ // i been like this since I was seventeen
@@ -2,3 +2,4 @@ export type Logger = (message: string, ...others: unknown[]) => void;
2
2
  export declare const getDebugLogger: (context: string) => Logger;
3
3
  export declare const getErrorLogger: (context: string) => Logger;
4
4
  export declare const enableDebugLogs: () => void;
5
+ // shoutout to VRDani, VRJani, VRPista and, last but not least VRBazsi for the awesome work
@@ -20,3 +20,4 @@ export declare function showLLModal(props: {
20
20
  onClose: Function;
21
21
  }): void;
22
22
  export {};
23
+ // tall money and small money, I like all money
@@ -23,3 +23,4 @@ export declare function getProvider(): Promise<ProviderResult>;
23
23
  * Gets the hex chainId from a number or string.
24
24
  */
25
25
  export declare const getHexChainId: (chainId: string | number) => string;
26
+ // also s/o to intelsec for the hq data
@@ -14,3 +14,4 @@ export declare function checkSupport(options: CheckSupportOptions): CheckSupport
14
14
  * Gets support results.
15
15
  */
16
16
  export declare function getSupportResult(): CheckSupportResult;
17
+ // this is a crime scene, be careful
@@ -131,3 +131,4 @@ export declare class EthereumProvider implements IEthereumProvider {
131
131
  protected parseAccount: (payload: any) => string;
132
132
  }
133
133
  export default EthereumProvider;
134
+ // you must be jealous, it'll go away give it sum time :)
@@ -55,3 +55,4 @@ export interface EIP1193Provider {
55
55
  export interface IEthereumProvider extends EIP1193Provider {
56
56
  enable(): Promise<ProviderAccounts>;
57
57
  }
58
+ // Thank you Inferno! <3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/connect-kit",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "A library for dApps to integrate with the Ledger Extension and Ledger Live",
5
5
  "author": "Ledger SAS <ledger.com>",
6
6
  "license": "MIT",
package/CHANGELOG.md DELETED
@@ -1,165 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## Unreleased
9
-
10
- ## 1.1.4 - 2023-08-17
11
- Add configuration to segment to use custom proxy
12
-
13
- ## 1.1.3 - 2023-08-10
14
- Change default methods
15
-
16
- ## 1.1.2 - 2023-08-04
17
- Fix merged optional variable event
18
-
19
- ## 1.1.1 - 2023-08-01
20
- Nothing changed from the last version
21
-
22
- ## 1.1.1-beta.0 - 2023-08-01
23
- ### Changed
24
- - Use WalletConnect's default list of optional methods and events.
25
- - Add analytics support so that we can better understand usage.
26
- - Handle display_uri event only once when calling eth_requestAccounts.
27
- - Update WalletConnect package versions.
28
- - Switch to the correct chain when connecting with the Extension.
29
- - Expose provider.chainId.
30
- - Remove unfinished Solana support.
31
-
32
- ## 1.1.0 - 2023-06-22
33
- Connect Kit now supports WalletConnect v2.
34
-
35
- Have a look at the Connect Kit loader documentation for
36
- more details.
37
-
38
- ## 1.1.0-beta.3 - 2023-06-21
39
- ### Changed
40
- - Rename the version parameter to walletConnectVersion.
41
- - Internal improvements.
42
-
43
- ## 1.1.0-beta.1 - 2023-06-19
44
- ### Added
45
- - Support for WalletConnect v2.
46
-
47
- ## 1.0.16 - 2023-04-04
48
- ### Changed
49
- - Add campaign params to App Store link.
50
-
51
- ## 1.0.15 - 2023-03-16
52
- ### Changed
53
- - Use App Store link in the Extension install button.
54
-
55
- ## 1.0.13 - 2023-03-13
56
-
57
- ## 1.0.12 - 2023-03-13
58
- ### Changed
59
- - Remove the "Need a Ledger?" section from the modals.
60
- - Replace Connect with Ledger Extension.
61
- - Center the modal.
62
-
63
- ## 1.0.11 - 2023-02-24
64
- ### Changed
65
- - Enable Connect support for Polygon (chainId 137).
66
-
67
- ## 1.0.10 - 2023-01-04
68
- ### Changed
69
- - Fix image positioning in the "Need a Ledger?" modal section.
70
-
71
- ## 1.0.9 - 2022-12-30
72
- ### Changed
73
- - Enable Connect support on macOS.
74
-
75
- ## 1.0.8 - 2022-12-21
76
- ### Changed
77
- - Expose WalletConnect's connector property as optional in the
78
- EthereumProvider type for integration into web3-onboard.
79
-
80
- ## 1.0.7 - 2022-12-13
81
- ### Changed
82
- - Close the ConnectWithLedgerLive modal when clicking outside.
83
- - Make the cursor a pointer for the "Install" link on the
84
- ConnectWithLedgerLive modal.
85
- - Fix spacing around the "or" line on the ConnectWithLedgerLive modal
86
-
87
- ## 1.0.6 - 2022-12-13
88
- ### Changed
89
- - Redesign the ConnectWithLedgerLive to be visually simpler.
90
- - Add back a call to hide the ConnectWithLedgerLive modal to the
91
- WalletConnect connect event handler since it is still needed when scanning
92
- the QR code.
93
-
94
- ## 1.0.5 - 2022-12-12
95
- ### Changed
96
- - Return a valid provider in case the Connect extension is supported but not
97
- enabled, instead of throwing an exception. The modal that guides the user to
98
- install the extension was being shown on the `getProvider` function, but has
99
- been moved to the `eth_requestAccounts` request on the new provider to
100
- correctly work with autoconnect on wagmi.
101
-
102
- ## 1.0.4 - 2022-12-06
103
- ### Changed
104
- - Create a new WalletConnect session each time `eth_requestAccounts` is called
105
- (and hence each time the "Use Ledger Live" modal is shown) to avoid reusing
106
- the same WalletConnect URI.
107
- - The "Use Ledger Live" modal is now closed when pressing the "Use Ledger
108
- Live" button to avoid the same WalletConnect URI being reused (e.g. if the
109
- user clicks "Decline" in Ledger Live and clicks "Use Ledger Live" again.
110
- - No longer reuse the provider instance in the Provider module as it
111
- interferes with refreshing the WalletConnect URI.
112
- - No longer reuse the provider instance in the WalletConnect module.
113
-
114
- ## 1.0.3 - 2022-12-06
115
-
116
- ## 1.0.2 - 2022-12-02
117
- ### Changed
118
- - Use the ledgerlive: deeplink for the QR code instead of the WalletConnect
119
- URI; this allows scanning the QR code with the native camera app.
120
-
121
- ## 1.0.1 - 2022-12-02
122
- ### Changed
123
- - Don't open a blank tab when pressing the User Ledger Live deeplink.
124
- - Correctly detect the Brave browser on iOS.
125
- - Patch the provider's request method to handle the Connect With Ledger Live
126
- modal in the `eth_requestAccounts` method, allowing us to reject with the
127
- "user rejected connection" error when the modal is closed.
128
-
129
- ## 1.0.0 - 2022-11-17
130
- ### Changed
131
- - Promoted to 1.0.
132
-
133
- ## 1.0.0-beta.4-5 - 2022-11-01
134
- ### Changed
135
- - Release workflow changes.
136
-
137
- ## 1.0.0-beta.8 - 2022-11-15
138
- ### Changed
139
- - Make disconnect on EthereumProvider optional since it is only available on
140
- WalletConnect.
141
-
142
- ## 1.0.0-beta.7 - 2022-11-14
143
- ### Changed
144
- - Added disconnect and emit to the EthereumProvider interface to implement
145
- the lerger wagmi connector.
146
-
147
- ## 1.0.0-beta.6 - 2022-11-10
148
- ### Changed
149
- - The rpc parameter is now optional.
150
- - The chainId parameter is now optional, defaults to 1.
151
- - No defaults are set for WalletConnect parameters.
152
- - Hide the Connect Kit modal on the disconnect event handler.
153
- - Add utm_medium parameter to buy URL.
154
-
155
- ## 1.0.0-beta.3 - 2022-11-01
156
- ### Fixed
157
- - Set some CSS values instead of inheriting them from the app.
158
-
159
- ## 1.0.0-beta.2 - 2022-10-28
160
- This is the first public version of the package.
161
-
162
- ### Added
163
- - Show a modal to guide the user.
164
- - Get a Ledger Connect provider on Safari on iOS when connecting to chainId 1.
165
- - Get a WalletConnect provider when on other platforms and chainIds.