@livetiles/reach-components-react 0.5.0-preview.336 → 0.5.0-preview.337

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.
@@ -1 +1 @@
1
- import{v as i,w as r}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";function t(t){return i(this,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return[4,import("./index.umd-EZCVDQQZ.esm.js")];case 1:return i=r.sent(),t._plugins=i,[2]}}))}))}export{t as loadLegacyVideoPlugins};
1
+ import{v as i,w as r}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";function t(t){return i(this,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return[4,import("./index.umd-6F4DRWJX.esm.js")];case 1:return i=r.sent(),t._plugins=i,[2]}}))}))}export{t as loadLegacyVideoPlugins};
@@ -1 +1 @@
1
- export{P as applyDestinationMiddleware,j as sourceMiddlewarePlugin}from"./chunk-NYVNK6O3.esm.js";import"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";
1
+ export{P as applyDestinationMiddleware,j as sourceMiddlewarePlugin}from"./chunk-YNMH7CLT.esm.js";import"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@livetiles/reach-components-react",
3
3
  "description": "Provides React components to consume LiveTiles Reach data",
4
- "version": "0.5.0-preview.336",
4
+ "version": "0.5.0-preview.337",
5
5
  "peerDependencies": {
6
6
  "react": "^16.14.0 || ^17",
7
7
  "react-dom": "^16.14.0 || ^17",
@@ -1 +1 @@
1
- import{l as e}from"./chunk-IZB43MSE.esm.js";import{$ as t}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";function r(r,n){function i(i){var o=r,c=i.event.event;if(o&&c){var a=o[c];if(!e(o,a))return i.updateEvent("integrations",t(t({},i.event.integrations),{All:!1,"Segment.io":!0})),i;var s=function(e,t){var r,n;if(!e||!Object.keys(e))return{};var i=Object.keys(e.integrations).filter((function(t){return!1===e.integrations[t]})),o=[];return(null!==(r=t.remotePlugins)&&void 0!==r?r:[]).forEach((function(e){i.forEach((function(t){(e.name.includes(t)||t.includes(e.name))&&o.push(e.name)}))})),(null!==(n=t.remotePlugins)&&void 0!==n?n:[]).reduce((function(e,t){return t.settings.subscriptions&&o.includes(t.name)&&t.settings.subscriptions.forEach((function(r){return e["".concat(t.name," ").concat(r.partnerAction)]=!1})),e}),{})}(a,n);i.updateEvent("integrations",t(t(t({},i.event.integrations),a?.integrations),s))}return i}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:i,alias:i,track:i,identify:i,group:i}}export{r as schemaFilter};
1
+ import{l as e}from"./chunk-B3FF5TYY.esm.js";import{$ as t}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";function r(r,n){function i(i){var o=r,c=i.event.event;if(o&&c){var a=o[c];if(!e(o,a))return i.updateEvent("integrations",t(t({},i.event.integrations),{All:!1,"Segment.io":!0})),i;var s=function(e,t){var r,n;if(!e||!Object.keys(e))return{};var i=Object.keys(e.integrations).filter((function(t){return!1===e.integrations[t]})),o=[];return(null!==(r=t.remotePlugins)&&void 0!==r?r:[]).forEach((function(e){i.forEach((function(t){(e.name.includes(t)||t.includes(e.name))&&o.push(e.name)}))})),(null!==(n=t.remotePlugins)&&void 0!==n?n:[]).reduce((function(e,t){return t.settings.subscriptions&&o.includes(t.name)&&t.settings.subscriptions.forEach((function(r){return e["".concat(t.name," ").concat(r.partnerAction)]=!1})),e}),{})}(a,n);i.updateEvent("integrations",t(t(t({},i.event.integrations),null==a?void 0:a.integrations),s))}return i}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:i,alias:i,track:i,identify:i,group:i}}export{r as schemaFilter};
@@ -1,35 +0,0 @@
1
- import{A as t,M as e,v as r,w as n,N as o,B as i,C as a,D as s,x as u,$ as c,W as f,E as l,F as p,G as v,H as d,I as h,J as y,K as g,L as m,O as w,Q as b,R as x}from"./index.esm2.js";import{P as _}from"./chunk-NYVNK6O3.esm.js";import{l as A}from"./chunk-IZB43MSE.esm.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";var j=d(((t,e)=>{for(r=[],n=0;n<64;)r[n]=0|4294967296*Math.sin(++n%Math.PI);var r,n;e.exports=function(t){var e,o,i,a=[e=1732584193,o=4023233417,~e,~o],s=[],u=unescape(encodeURI(t))+"€",c=u.length;for(t=--c/4+2|15,s[--t]=8*c;~c;)s[c>>2]|=u.charCodeAt(c)<<8*c--;for(n=u=0;n<t;n+=16){for(c=a;u<64;c=[i=c[3],e+((i=c[0]+[e&o|~e&i,i&e|~i&o,e^o^i,o^(e|~i)][c=u>>4]+r[u]+~~s[n|15&[u,5*u+1,3*u+5,7*u][c]])<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+u++%4])|i>>>-c),e,o])e=0|c[1],o=c[2];for(u=4;u;)a[--u]+=c[u]}for(t="";u<32;)t+=(a[u>>3]>>4*(1^u++)&15).toString(16);return t}})),k=d(((t,e)=>{var r=Number.POSITIVE_INFINITY;e.exports=r})),O=d(((t,e)=>{e.exports=Number})),S=d(((t,e)=>{var r=O();e.exports=r})),N=d(((t,e)=>{var r=S().NEGATIVE_INFINITY;e.exports=r})),I=d(((t,e)=>{e.exports=1023})),P=d(((t,e)=>{e.exports=1023})),E=d(((t,e)=>{e.exports=-1023})),U=d(((t,e)=>{e.exports=-1074})),M=d(((t,e)=>{e.exports=function(t){return t!=t}})),F=d(((t,e)=>{var r=M();e.exports=r})),z=d(((t,e)=>{var r=k(),n=N();e.exports=function(t){return t===r||t===n}})),D=d(((t,e)=>{var r=z();e.exports=r})),L=d(((t,e)=>{e.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}})),J=d(((t,e)=>{var r=L();e.exports=r})),H=d(((t,e)=>{var r=J()();e.exports=function(){return r&&"symbol"==typeof Symbol.toStringTag}})),T=d(((t,e)=>{var r=H();e.exports=r})),C=d(((t,e)=>{var r=Object.prototype.toString;e.exports=r})),R=d(((t,e)=>{var r=C();e.exports=function(t){return r.call(t)}})),B=d(((t,e)=>{var r=Object.prototype.hasOwnProperty;e.exports=function(t,e){return null!=t&&r.call(t,e)}})),G=d(((t,e)=>{var r=B();e.exports=r})),W=d(((t,e)=>{var r="function"==typeof Symbol?Symbol.toStringTag:"";e.exports=r})),Q=d(((t,e)=>{var r=G(),n=W(),o=C();e.exports=function(t){var e,i,a;if(null==t)return o.call(t);i=t[n],e=r(t,n);try{t[n]=void 0}catch{return o.call(t)}return a=o.call(t),e?t[n]=i:delete t[n],a}})),V=d(((t,e)=>{var r,n=T(),o=R(),i=Q();r=n()?i:o,e.exports=r})),Y=d(((t,e)=>{var r=V(),n="function"==typeof Uint32Array;e.exports=function(t){return n&&t instanceof Uint32Array||"[object Uint32Array]"===r(t)}})),K=d(((t,e)=>{var r=Y();e.exports=r})),q=d(((t,e)=>{e.exports=4294967295})),Z=d(((t,e)=>{var r="function"==typeof Uint32Array?Uint32Array:null;e.exports=r})),X=d(((t,e)=>{var r=K(),n=q(),o=Z();e.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,n+1,n+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===n-2&&0===e[3]&&1===e[4]}catch{t=!1}return t}})),$=d(((t,e)=>{var r=X();e.exports=r})),tt=d(((t,e)=>{var r="function"==typeof Uint32Array?Uint32Array:void 0;e.exports=r})),et=d(((t,e)=>{e.exports=function(){throw new Error("not implemented")}})),rt=d(((t,e)=>{var r,n=$(),o=tt(),i=et();r=n()?o:i,e.exports=r})),nt=d(((t,e)=>{var r=V(),n="function"==typeof Float64Array;e.exports=function(t){return n&&t instanceof Float64Array||"[object Float64Array]"===r(t)}})),ot=d(((t,e)=>{var r=nt();e.exports=r})),it=d(((t,e)=>{var r="function"==typeof Float64Array?Float64Array:null;e.exports=r})),at=d(((t,e)=>{var r=ot(),n=it();e.exports=function(){var t,e;if("function"!=typeof n)return!1;try{e=new n([1,3.14,-3.14,NaN]),t=r(e)&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch{t=!1}return t}})),st=d(((t,e)=>{var r=at();e.exports=r})),ut=d(((t,e)=>{var r="function"==typeof Float64Array?Float64Array:void 0;e.exports=r})),ct=d(((t,e)=>{e.exports=function(){throw new Error("not implemented")}})),ft=d(((t,e)=>{var r,n=st(),o=ut(),i=ct();r=n()?o:i,e.exports=r})),lt=d(((t,e)=>{var r=V(),n="function"==typeof Uint8Array;e.exports=function(t){return n&&t instanceof Uint8Array||"[object Uint8Array]"===r(t)}})),pt=d(((t,e)=>{var r=lt();e.exports=r})),vt=d(((t,e)=>{e.exports=255})),dt=d(((t,e)=>{var r="function"==typeof Uint8Array?Uint8Array:null;e.exports=r})),ht=d(((t,e)=>{var r=pt(),n=vt(),o=dt();e.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,n+1,n+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===n-2&&0===e[3]&&1===e[4]}catch{t=!1}return t}})),yt=d(((t,e)=>{var r=ht();e.exports=r})),gt=d(((t,e)=>{var r="function"==typeof Uint8Array?Uint8Array:void 0;e.exports=r})),mt=d(((t,e)=>{e.exports=function(){throw new Error("not implemented")}})),wt=d(((t,e)=>{var r,n=yt(),o=gt(),i=mt();r=n()?o:i,e.exports=r})),bt=d(((t,e)=>{var r=V(),n="function"==typeof Uint16Array;e.exports=function(t){return n&&t instanceof Uint16Array||"[object Uint16Array]"===r(t)}})),xt=d(((t,e)=>{var r=bt();e.exports=r})),_t=d(((t,e)=>{e.exports=65535})),At=d(((t,e)=>{var r="function"==typeof Uint16Array?Uint16Array:null;e.exports=r})),jt=d(((t,e)=>{var r=xt(),n=_t(),o=At();e.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,n+1,n+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===n-2&&0===e[3]&&1===e[4]}catch{t=!1}return t}})),kt=d(((t,e)=>{var r=jt();e.exports=r})),Ot=d(((t,e)=>{var r="function"==typeof Uint16Array?Uint16Array:void 0;e.exports=r})),St=d(((t,e)=>{e.exports=function(){throw new Error("not implemented")}})),Nt=d(((t,e)=>{var r,n=kt(),o=Ot(),i=St();r=n()?o:i,e.exports=r})),It=d(((t,e)=>{var r=wt(),n={uint16:Nt(),uint8:r};e.exports=n})),Pt=d(((t,e)=>{var r,n=It();r=function(){var t;return(t=new n.uint16(1))[0]=4660,52===new n.uint8(t.buffer)[0]}(),e.exports=r})),Et=d(((t,e)=>{var r=Pt();e.exports=r})),Ut=d(((t,e)=>{var r,n,o;!0===Et()?(n=1,o=0):(n=0,o=1),r={HIGH:n,LOW:o},e.exports=r})),Mt=d(((t,e)=>{var r=rt(),n=ft(),o=Ut(),i=new n(1),a=new r(i.buffer),s=o.HIGH,u=o.LOW;e.exports=function(t,e){return i[0]=e,t[0]=a[s],t[1]=a[u],t}})),Ft=d(((t,e)=>{var r=Mt();e.exports=function(t,e){return 1===arguments.length?r([0,0],t):r(t,e)}})),zt=d(((t,e)=>{var r=Ft();e.exports=r})),Dt=d(((t,e)=>{var r;r=!0===Et()?1:0,e.exports=r})),Lt=d(((t,e)=>{var r=rt(),n=ft(),o=Dt(),i=new n(1),a=new r(i.buffer);e.exports=function(t){return i[0]=t,a[o]}})),Jt=d(((t,e)=>{var r=Lt();e.exports=r})),Ht=d(((t,e)=>{var r,n,o;!0===Et()?(n=1,o=0):(n=0,o=1),r={HIGH:n,LOW:o},e.exports=r})),Tt=d(((t,e)=>{var r=rt(),n=ft(),o=Ht(),i=new n(1),a=new r(i.buffer),s=o.HIGH,u=o.LOW;e.exports=function(t,e){return a[s]=t,a[u]=e,i[0]}})),Ct=d(((t,e)=>{var r=Tt();e.exports=r})),Rt=d(((t,e)=>{var r=zt(),n=Jt(),o=Ct(),i=[0,0];e.exports=function(t,e){var a,s;return r(i,t),a=i[0],a&=2147483647,s=n(e),o(a|=s&=2147483648,i[1])}})),Bt=d(((t,e)=>{var r=Rt();e.exports=r})),Gt=d(((t,e)=>{e.exports=22250738585072014e-324})),Wt=d(((t,e)=>{e.exports=function(t){return Math.abs(t)}})),Qt=d(((t,e)=>{var r=Wt();e.exports=r})),Vt=d(((t,e)=>{var r=Gt(),n=D(),o=F(),i=Qt();e.exports=function(t,e){return o(e)||n(e)?(t[0]=e,t[1]=0,t):0!==e&&i(e)<r?(t[0]=4503599627370496*e,t[1]=-52,t):(t[0]=e,t[1]=0,t)}})),Yt=d(((t,e)=>{var r=Vt();e.exports=function(t,e){return 1===arguments.length?r([0,0],t):r(t,e)}})),Kt=d(((t,e)=>{var r=Yt();e.exports=r})),qt=d(((t,e)=>{e.exports=2146435072})),Zt=d(((t,e)=>{var r=Jt(),n=qt(),o=I();e.exports=function(t){var e=r(t);return(e=(e&n)>>>20)-o|0}})),Xt=d(((t,e)=>{var r=Zt();e.exports=r})),$t=d(((t,e)=>{var r=k(),n=N(),o=I(),i=P(),a=E(),s=U(),u=F(),c=D(),f=Bt(),l=Kt(),p=Xt(),v=zt(),d=Ct(),h=[0,0],y=[0,0];e.exports=function(t,e){var g,m;return 0===t||u(t)||c(t)?t:(l(h,t),e+=h[1],(e+=p(t=h[0]))<s?f(0,t):e>i?t<0?n:r:(e<=a?(e+=52,m=2220446049250313e-31):m=1,v(y,t),g=y[0],g&=2148532223,m*d(g|=e+o<<20,y[1])))}})),te=d(((t,e)=>{var r=$t();e.exports=r})),ee=d((t=>{t.dset=function(t,e,r){e.split&&(e=e.split("."));for(var n,o,i=0,a=e.length,s=t;i<a&&("__proto__"!==(o=e[i++])&&"constructor"!==o&&"prototype"!==o);)s=s[o]=i===a?r:typeof(n=s[o])==typeof e?n:0*e[i]!=0||~(""+e[i]).indexOf(".")?{}:[]}})),re=d((t=>{var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.unset=void 0;var r=e(b());t.unset=function(t,e){if((0,r.default)(t,e)){for(var n=e.split("."),o=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)o=n.pop().slice(0,-1)+"."+o;for(;n.length;)t=t[e=n.shift()];return delete t[o]}return!0}})),ne=d((t=>{var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e(j()),n=e(b()),o=e(te()),i=ee(),a=re();function s(t,e){for(var r in e.drop)if(e.drop.hasOwnProperty(r)){var o=""===r?t:(0,n.default)(t,r);if("object"==typeof o&&null!==o)for(var i=0,a=e.drop[r];i<a.length;i++){delete o[a[i]]}}}function u(t,e){for(var r in e.allow)if(e.allow.hasOwnProperty(r)){var o=""===r?t:(0,n.default)(t,r);if("object"==typeof o&&null!==o)for(var i in o)!o.hasOwnProperty(i)||-1===e.allow[r].indexOf(i)&&delete o[i]}}function c(t,e){var r=JSON.parse(JSON.stringify(t));for(var o in e.map)if(e.map.hasOwnProperty(o)){var s=e.map[o],u=o.split("."),c=void 0;if(u.length>1?(u.pop(),c=(0,n.default)(r,u.join("."))):c=t,"object"==typeof c){if(s.copy){var f=(0,n.default)(r,s.copy);void 0!==f&&(0,i.dset)(t,o,f)}else if(s.move){var l=(0,n.default)(r,s.move);void 0!==l&&(0,i.dset)(t,o,l),(0,a.unset)(t,s.move)}else s.hasOwnProperty("set")&&(0,i.dset)(t,o,s.set);if(s.to_string){var p=(0,n.default)(t,o);if("string"==typeof p||"object"==typeof p&&null!==p)continue;void 0!==p?(0,i.dset)(t,o,JSON.stringify(p)):(0,i.dset)(t,o,"undefined")}}}}function f(t,e){return!(e.sample.percent<=0)&&(e.sample.percent>=1||(e.sample.path?function(t,e){var i=(0,n.default)(t,e.sample.path),a=(0,r.default)(JSON.stringify(i)),s=-64,u=[];l(a.slice(0,8),u);for(var c=0,f=0;f<64&&1!==u[f];f++)c++;if(0!==c){var p=[];l(a.slice(9,16),p),s-=c,u.splice(0,c),p.splice(64-c),u=u.concat(p)}return u[63]=0===u[63]?1:0,(0,o.default)(parseInt(u.join(""),2),s)<e.sample.percent}(t,e):function(t){return Math.random()<=t}(e.sample.percent)))}function l(t,e){for(var r=0;r<8;r++)for(var n=t[r],o=128;o>=1;o/=2)n-o>=0?(n-=o,e.push(1)):e.push(0)}t.default=function(t,e){for(var r=t,n=0,o=e;n<o.length;n++){var i=o[n];switch(i.type){case"drop":return null;case"drop_properties":s(r,i.config);break;case"allow_properties":u(r,i.config);break;case"sample_event":if(f(r,i.config))break;return null;case"map_properties":c(r,i.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(i.type,'" is unsupported.'))}}return r}})),oe=d((t=>{var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e(b());function n(t,e){if(!Array.isArray(t))return!0===o(t,e);var r=t[0];switch(r){case"!":return!n(t[1],e);case"or":for(var u=1;u<t.length;u++)if(n(t[u],e))return!0;return!1;case"and":for(u=1;u<t.length;u++)if(!n(t[u],e))return!1;return!0;case"=":case"!=":return function(t,e,r,o){switch(i(t)&&(t=n(t,o)),i(e)&&(e=n(e,o)),"object"==typeof t&&"object"==typeof e&&(t=JSON.stringify(t),e=JSON.stringify(e)),r){case"=":return t===e;case"!=":return t!==e;default:throw new Error("Invalid operator in compareItems: ".concat(r))}}(o(t[1],e),o(t[2],e),r,e);case"<=":case"<":case">":case">=":return function(t,e,r,o){if(i(t)&&(t=n(t,o)),i(e)&&(e=n(e,o)),"number"!=typeof t||"number"!=typeof e)return!1;switch(r){case"<=":return t<=e;case">=":return t>=e;case"<":return t<e;case">":return t>e;default:throw new Error("Invalid operator in compareNumbers: ".concat(r))}}(o(t[1],e),o(t[2],e),r,e);case"contains":return function(t,e){return"string"==typeof t&&"string"==typeof e&&-1!==t.indexOf(e)}(o(t[1],e),o(t[2],e));case"match":return function(t,e){return"string"==typeof t&&"string"==typeof e&&function(t,e){var r,n;t:for(;t.length>0;){var o=void 0,i=void 0;if(o=(r=a(t)).star,i=r.chunk,t=r.pattern,o&&""===i)return!0;var u=s(i,e),c=u.t,f=u.ok,l=u.err;if(l)return!1;if(!f||!(0===c.length||t.length>0)){if(o)for(var p=0;p<e.length;p++){if(c=(n=s(i,e.slice(p+1))).t,f=n.ok,l=n.err,f){if(0===t.length&&c.length>0)continue;e=c;continue t}if(l)return!1}return!1}e=c}return 0===e.length}(e,t)}(o(t[1],e),o(t[2],e));case"lowercase":var c=o(t[1],e);return"string"!=typeof c?null:c.toLowerCase();case"typeof":return typeof o(t[1],e);case"length":return function(t){return null===t?0:Array.isArray(t)||"string"==typeof t?t.length:NaN}(o(t[1],e));default:throw new Error("FQL IR could not evaluate for token: ".concat(r))}}function o(t,e){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,r.default)(e,t)}function i(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function a(t){for(var e={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),e.star=!0;var r,n=!1;t:for(r=0;r<t.length;r++)switch(t[r]){case"\\":r+1<t.length&&r++;break;case"[":n=!0;break;case"]":n=!1;break;case"*":if(!n)break t}return e.chunk=t.slice(0,r),e.pattern=t.slice(r),e}function s(t,e){for(var r,n,o={t:"",ok:!1,err:!1};t.length>0;){if(0===e.length)return o;switch(t[0]){case"[":var i=e[0];e=e.slice(1);var a=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(a=!1,t=t.slice(1));for(var s=!1,c=0;;){if(t.length>0&&"]"===t[0]&&c>0){t=t.slice(1);break}var f,l="";if(f=(r=u(t)).char,t=r.newChunk,r.err||(l=f,"-"===t[0]&&(l=(n=u(t.slice(1))).char,t=n.newChunk,n.err)))return o;f<=i&&i<=l&&(s=!0),c++}if(s!==a)return o;break;case"?":e=e.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return o.err=!0,o;default:if(t[0]!==e[0])return o;e=e.slice(1),t=t.slice(1)}}return o.t=e,o.ok=!0,o.err=!1,o}function u(t){var e={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(e.err=!0,e):(e.char=t[0],e.newChunk=t.slice(1),0===e.newChunk.length&&(e.err=!0),e)}t.default=function(t,e){if(!e)throw new Error("No matcher supplied!");switch(e.type){case"all":return!0;case"fql":return function(t,e){if(!t)return!1;try{t=JSON.parse(t)}catch(e){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(e))}var r=n(t,e);return"boolean"==typeof r&&r}(e.ir,t);default:throw new Error("Matcher of type ".concat(e.type," unsupported."))}}})),ie=d((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var e=[],r=0,n=this.rules;r<n.length;r++){var o=n[r];(o.destinationName===t||void 0===o.destinationName)&&e.push(o)}return e},t}();t.default=e})),ae=d((t=>{var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Store=t.matches=t.transform=void 0;var r=ne();Object.defineProperty(t,"transform",{enumerable:!0,get:function(){return e(r).default}});var n=oe();Object.defineProperty(t,"matches",{enumerable:!0,get:function(){return e(n).default}});var o=ie();Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return e(o).default}})})),se=t(e()),ue=t(ae());function ce(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function fe(t,e){return void 0===e&&(e=!1),e?btoa(t).replace(/=/g,""):void 0}function le(t,e,a,s,u,c){return r(this,void 0,void 0,(function(){var r,f,l,p,v,d,y,g;return n(this,(function(n){switch(n.label){case 0:r=ce(a),f=fe(r,c),l=i(),p="".concat(l,"/integrations/").concat(f??r,"/").concat(s,"/").concat(f??r,".dynamic.js.gz"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,o(p)];case 2:return n.sent(),function(t,e,r){var n,o;try{var i=(null!==(o=null===(n=window?.performance)||void 0===n?void 0:n.getEntriesByName(t,"resource"))&&void 0!==o?o:[])[0];i&&e.stats.gauge("legacy_destination_time",Math.round(i.duration),h([r],i.duration<100?["cached"]:[],!0))}catch{}}(p,t,a),[3,4];case 3:throw v=n.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(a),"failed"]),v;case 4:return d=window["".concat(r,"Deps")],[4,Promise.all(d.map((function(t){return o(l+t+".gz")})))];case 5:return n.sent(),window["".concat(r,"Loader")](),(y=window["".concat(r,"Integration")]).Integration&&(y({user:function(){return e.user()},addIntegration:function(){}}),y=y.Integration),(g=new y(u)).analytics=e,[2,g]}}))}))}var pe=function(t){return JSON.parse(JSON.stringify(t))};function ve(t,e){return r(this,void 0,void 0,(function(){var o,i=this;return n(this,(function(a){switch(a.label){case 0:return o=[],s()?[2,e]:[4,l((function(){return e.length>0&&g()}),(function(){return r(i,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return(r=e.pop())?[4,y(r,t)]:[2];case 1:return i=n.sent(),i instanceof x||o.push(r),[2]}}))}))}))];case 1:return a.sent(),o.map((function(t){return e.pushWithBackoff(t)})),[2,e]}}))}))}var de=function(){function t(t,e,r,n){void 0===r&&(r={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=e,this.settings=c({},r),this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=n,this.buffer=n.disableClientPersistence?new m(4,[]):new w(4,"dest-".concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,e){return r(this,void 0,void 0,(function(){var r,o=this;return n(this,(function(n){switch(n.label){case 0:return this._ready||void 0!==this.onReady?[2]:(r=this,[4,le(t,e,this.name,this.version,this.settings,this.options.obfuscate)]);case 1:r.integration=n.sent(),this.onReady=new Promise((function(t){o.integration.once("ready",(function(){o._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){o.integration.on("initialize",(function(){o._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(e){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),e}return[2]}}))}))},t.prototype.unload=function(t,e){return function(t,e,o){return r(this,void 0,void 0,(function(){var r,s,u,c;return n(this,(function(n){return r=i(),s=ce(t),u=fe(t,o),c="".concat(r,"/integrations/").concat(u??s,"/").concat(e,"/").concat(u??s,".dynamic.js.gz"),[2,a(c)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.middleware=(t=this.middleware).concat.apply(t,e)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(s()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,e,o){var i,a;return r(this,void 0,void 0,(function(){var r,s,l,p,v,d;return n(this,(function(n){switch(n.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(r=null===(a=null===(i=this.options)||void 0===i?void 0:i.plan)||void 0===a?void 0:a.track,s=t.event.event,r&&s&&"Segment.io"!==this.name){if(l=r[s],!A(r,l))return t.updateEvent("integrations",c(c({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new f({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",c(c({},t.event.integrations),l?.integrations)),l?.enabled&&!1===l?.integrations[this.name])return t.cancel(new f({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,_(this.name,pe(t.event),this.middleware)];case 1:if(null===(p=n.sent()))return[2,t];v=new e(p,{}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(o),"integration_name:".concat(this.name)]),n.label=2;case 2:return n.trys.push([2,5,,6]),this.integration?[4,u(this.integration.invoke.call(this.integration,o,v))]:[3,4];case 3:n.sent(),n.label=4;case 4:return[3,6];case 5:throw d=n.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(o),"integration_name:".concat(this.name)]),d;case 6:return[2,t]}}))}))},t.prototype.track=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.send(t,se.Track,"track")]}))}))},t.prototype.page=function(t){var e;return r(this,void 0,void 0,(function(){var r=this;return n(this,(function(n){return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return r.send(t,se.Page,"page")}))]}))}))},t.prototype.identify=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.send(t,se.Identify,"identify")]}))}))},t.prototype.alias=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.send(t,se.Alias,"alias")]}))}))},t.prototype.group=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.send(t,se.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return r(t,void 0,void 0,(function(){var t;return n(this,(function(e){switch(e.label){case 0:return this.flushing=!0,t=this,[4,ve(this,this.buffer)];case 1:return t.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function he(t,e,r){var n,o;if(void 0===e&&(e={}),void 0===r&&(r={}),p())return[];t.plan&&((r=r??{}).plan=t.plan);var i=null!==(o=null===(n=t.middlewareSettings)||void 0===n?void 0:n.routingRules)&&void 0!==o?o:[],a=function(t){return function(e){var r=e.payload,n=e.integration,o=e.next;new ue.Store(t).getRulesByDestinationName(n).forEach((function(t){for(var e=t.matchers,n=t.transformers,i=0;i<e.length;i++)if(ue.matches(r.obj,e[i])&&(r.obj=ue.transform(r.obj,n[i]),null===r.obj))return o(null)})),o(r)}}(i),s=v(t,r??{});return Object.entries(t.integrations).map((function(t){var n,o=t[0],u=t[1];if(!o.startsWith("Segment")){var c=!1===e.All&&void 0===e[o];if(!1!==e[o]&&!c){var f=u.type,l=u.bundlingStatus,p=u.versionSettings;if(("unbundled"!==l&&("browser"===f||(null===(n=p?.componentTypes)||void 0===n?void 0:n.includes("browser")))||"Segment.io"===o)&&"Iterable"!==o){var v=function(t){var e,r,n,o;return null!==(o=null!==(r=null===(e=t.versionSettings)||void 0===e?void 0:e.override)&&void 0!==r?r:null===(n=t.versionSettings)||void 0===n?void 0:n.version)&&void 0!==o?o:"latest"}(u),d=new de(o,v,s[o],r);return i.filter((function(t){return t.destinationName===o})).length>0&&d.addMiddleware(a),d}}}})).filter((function(t){return void 0!==t}))}
2
- /**
3
- * @license Apache-2.0
4
- *
5
- * Copyright (c) 2018 The Stdlib Authors.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- /**
20
- * @license Apache-2.0
21
- *
22
- * Copyright (c) 2021 The Stdlib Authors.
23
- *
24
- * Licensed under the Apache License, Version 2.0 (the "License");
25
- * you may not use this file except in compliance with the License.
26
- * You may obtain a copy of the License at
27
- *
28
- * http://www.apache.org/licenses/LICENSE-2.0
29
- *
30
- * Unless required by applicable law or agreed to in writing, software
31
- * distributed under the License is distributed on an "AS IS" BASIS,
32
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33
- * See the License for the specific language governing permissions and
34
- * limitations under the License.
35
- */export{de as LegacyDestination,he as ajsDestinations};
@@ -1 +0,0 @@
1
- import{t}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";function e(e,r,n,i){var o=this;return e?((e instanceof Element?[e]:"toArray"in e?e.toArray():e).forEach((function(e){e.addEventListener("click",(function(c){var a,u,s=r instanceof Function?r(e):r,f=n instanceof Function?n(e):n,m=e.getAttribute("href")||e.getAttributeNS("http://www.w3.org/1999/xlink","href")||e.getAttribute("xlink:href")||(null===(a=e.getElementsByTagName("a")[0])||void 0===a?void 0:a.getAttribute("href")),l=t(o.track(s,f,i??{}),null!==(u=o.settings.timeout)&&void 0!==u?u:500);!function(t,e){return!("_blank"!==t.target||!e)}(e,m)&&!function(t){var e=t;return!!(e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1==e.button)}(c)&&m&&(c.preventDefault?c.preventDefault():c.returnValue=!1,l.catch(console.error).then((function(){window.location.href=m})).catch(console.error))}),!1)})),this):this}function r(e,r,n,i){var o=this;return e?(e instanceof HTMLFormElement&&(e=[e]),e.forEach((function(e){if(!(e instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var c=function(c){var a;c.preventDefault?c.preventDefault():c.returnValue=!1;var u=r instanceof Function?r(e):r,s=n instanceof Function?n(e):n;t(o.track(u,s,i??{}),null!==(a=o.settings.timeout)&&void 0!==a?a:500).catch(console.error).then((function(){e.submit()})).catch(console.error)},a=window.jQuery||window.Zepto;a?a(e).submit(c):e.addEventListener("submit",c,!1)})),this):this}export{r as form,e as link};
@@ -1 +0,0 @@
1
- function e(e,l){var n,o;return"boolean"==typeof l?.enabled?l.enabled:null===(o=null===(n=e?.__default)||void 0===n?void 0:n.enabled)||void 0===o||o}export{e as l};
@@ -1 +0,0 @@
1
- import{v as n,w as e,$ as t,x as r,y as i,W as a}from"./index.esm2.js";function o(a,o,s){return n(this,void 0,void 0,(function(){function u(o,s){return n(this,void 0,void 0,(function(){var n,u,c;return e(this,(function(e){switch(e.label){case 0:return n=!1,u=null,[4,r(s({payload:i(o,{clone:!0,traverse:!1}),integration:a,next:function(e){n=!0,null===e&&(u=null),e&&(u=e.obj)}}))];case 1:return e.sent(),!n&&null!==u&&(u.integrations=t(t({},o.integrations),((c={})[a]=!1,c))),[2,u]}}))}))}var c,l,d,f;return e(this,(function(n){switch(n.label){case 0:c=0,l=s,n.label=1;case 1:return c<l.length?(d=l[c],[4,u(o,d)]):[3,4];case 2:if(null===(f=n.sent()))return[2,null];o=f,n.label=3;case 3:return c++,[3,1];case 4:return[2,o]}}))}))}function s(t,o){function s(s){return n(this,void 0,void 0,(function(){var n;return e(this,(function(e){switch(e.label){case 0:return n=!1,[4,r(t({payload:i(s.event,{clone:!0,traverse:!1}),integrations:o??{},next:function(e){n=!0,e&&(s.event=e.obj)}}))];case 1:if(e.sent(),!n)throw new a({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,s]}}))}))}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:s,page:s,identify:s,alias:s,group:s}}export{o as P,s as j};
@@ -1 +0,0 @@
1
- import{H as e}from"./index.esm2.js";import"react/jsx-runtime";import"events";import"react";import"office-ui-fabric-react";import"react-router-dom";import"react-is";import"styled-components";import"react-dom";import"office-ui-fabric-core/dist/css/fabric.css";import"office-ui-fabric-react/lib/common/DirectionalHint";import"react-dom/server";var t=e(((e,t)=>{var a,n;a=window,n=function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(n,i,function(t){return e[t]}.bind(null,i));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=2)}([function(e,t,a){a.r(t);var n="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(a,n){var i=new XMLHttpRequest;for(var r in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(r,t.headers[r]);function o(){var e,t=[],a=[],n={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,r,o){t.push(r=r.toLowerCase()),a.push([r,o]),e=n[r],n[r]=e?e+","+o:o})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:o,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 a},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"==t.credentials,i.onload=function(){a(o())},i.onerror=n,i.send(t.body)}))};t.default=n},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=function(){function e(t,a){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.pluginName=t}return n(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var n=r(a(3)),i=r(a(4));function r(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=n.default,t.YouTubeAnalytics=i.default},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=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 n.authToken=a,n.player=e,n.metadata={content:{},playback:{videoPlayer:"Vimeo"}},n.mostRecentHeartbeat=0,n.isPaused=!1,n}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),n(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 a in t)this.registerHandler(a,t[a]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var a=this;this.player.on(e,(function(e){a.updateMetadata(e),t.call(a,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(a,n){var r=e.id;(0,i.default)("https://api.vimeo.com/videos/"+r,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():n(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),n(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(a,n){t.player.getVolume().then((function(n){n&&(t.metadata.playback.sound=100*n),t.metadata.playback.position=e.seconds,a()})).catch(n)}))}}]),t}(r(a(1)).default);t.default=o},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=r(a(0));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=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 n.player=e,n.apiKey=a,n.playerLoaded=!1,n.playbackStarted=!1,n.contentStarted=!1,n.isPaused=!1,n.isBuffering=!1,n.isSeeking=!1,n.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},n.metadata=[{playback:{video_player:"youtube"},content:{}}],n.playlistIndex=0,n}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),n(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,a){var n=e.player.getVideoData(),r=e.player.getPlaylist()||[n.video_id],o=r.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+o+"&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(a){e.metadata=[];for(var n=0,i=0;i<r.length;i++){var o=a.items[i];e.metadata.push({content:{title:o.snippet.title,description:o.snippet.description,keywords:o.snippet.tags,channel:o.snippet.channelTitle,airdate:o.snippet.publishedAt}}),n+=s(o.contentDetails.duration)}for(i=0;i<r.length;i++)e.metadata[i].playback={total_length:n,video_player:"youtube"};t()})).catch((function(t){e.metadata=r.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),a(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}(r(a(1)).default);function s(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=o}])},"object"==typeof e&&"object"==typeof t?t.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof e?e.analyticsVideoPlugins=n():a.analyticsVideoPlugins=n()})),a=t();export{a as default};