zar 0.2.0 → 0.3.0
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.
- package/dist/zar.es.js +34 -22
- package/dist/zar.es.js.map +1 -1
- package/dist/zar.iife.js +2 -2
- package/dist/zar.iife.js.map +1 -1
- package/dist/zar.umd.js +2 -2
- package/dist/zar.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/zar.iife.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var re=(ue,Re,Z)=>new Promise((qe,ke)=>{var Ce=q=>{try{ne(Z.next(q))}catch(pe){ke(pe)}},ee=q=>{try{ne(Z.throw(q))}catch(pe){ke(pe)}},ne=q=>q.done?qe(q.value):Promise.resolve(q.value).then(Ce,ee);ne((Z=Z.apply(ue,Re)).next())});var zar=function(ue){"use strict";function Re(e,t,r,n,i){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:i;return e===i?r:e}var Z="undefined",qe="object",ke="any",Ce="*",ee="__",ne=typeof process!="undefined"?process:{};ne.env&&ne.env.NODE_ENV;var q=typeof window!="undefined";ne.versions!=null&&ne.versions.node!=null,typeof Deno!="undefined"&&Deno.core,q&&window.name==="nodejs"||typeof navigator!="undefined"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function pe(e,t){return t.charAt(0)[e]()+t.slice(1)}var Ir=pe.bind(null,"toUpperCase"),Sr=pe.bind(null,"toLowerCase");function Pr(e){return yt(e)?Ir("null"):typeof e=="object"?_r(e):Object.prototype.toString.call(e).slice(8,-1)}function Be(e,t){t===void 0&&(t=!0);var r=Pr(e);return t?Sr(r):r}function _e(e,t){return typeof t===e}var Q=_e.bind(null,"function"),ge=_e.bind(null,"string"),me=_e.bind(null,"undefined"),xr=_e.bind(null,"boolean");_e.bind(null,"symbol");function yt(e){return e===null}function Or(e){return Be(e)==="number"&&!isNaN(e)}function Er(e){return Be(e)==="array"}function J(e){if(!kr(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function kr(e){return e&&(typeof e=="object"||e!==null)}function _r(e){return Q(e.constructor)?e.constructor.name:null}function Nr(e){return e instanceof Error||ge(e.message)&&e.constructor&&Or(e.constructor.stackTraceLimit)}function bt(e,t){if(typeof t!="object"||yt(t))return!1;if(t instanceof e)return!0;var r=Be(new e(""));if(Nr(t))for(;t;){if(Be(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}bt.bind(null,TypeError),bt.bind(null,SyntaxError);function De(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?jr(e,t):r}function jr(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Ve(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Ve(De,"form"),Ve(De,"button"),Ve(De,"input"),Ve(De,"select");function wt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function Tr(){if(q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function Ar(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}function Mr(e){return function(t){for(var r,n=Object.create(null),i=/([^&=]+)=?([^&]*)/g;r=i.exec(t);){var a=wt(r[1]),o=wt(r[2]);a.substring(a.length-2)==="[]"?(n[a=a.substring(0,a.length-2)]||(n[a]=[])).push(o):n[a]=o===""||o}for(var s in n){var p=s.split("[");p.length>1&&(zr(n,p.map(function(v){return v.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){if(t){var r=t.match(/\?(.*)/);return r&&r[1]?r[1].split("#")[0]:""}return q&&window.location.search.substring(1)}(e))}function zr(e,t,r){for(var n=t.length-1,i=0;i<n;++i){var a=t[i];if(a==="__proto__"||a==="constructor")break;a in e||(e[a]={}),e=e[a]}e[t[n]]=r}function Je(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&r;e+=n=="-"||n=="4"?n:(n=="x"?i:3&i|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}var Ne="global",ve=ee+"global"+ee,he=typeof self===qe&&self.self===self&&self||typeof global===qe&&global.global===global&&global||void 0;function ce(e){return he[ve][e]}function se(e,t){return he[ve][e]=t}function ye(e){delete he[ve][e]}function be(e,t,r){var n;try{if(rt(e)){var i=window[e];n=i[t].bind(i)}}catch(a){}return n||r}he[ve]||(he[ve]={});var Fe={};function rt(e){if(typeof Fe[e]!==Z)return Fe[e];try{var t=window[e];t.setItem(Z,Z),t.removeItem(Z)}catch(r){return Fe[e]=!1}return Fe[e]=!0}function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}var ie="function",te="undefined",Lr="@@redux/"+Math.random().toString(36),It=function(){return typeof Symbol===ie&&Symbol.observable||"@@observable"}(),He=" != "+ie;function St(e,t,r){var n;if(typeof t===ie&&typeof r===te&&(r=t,t=void 0),typeof r!==te){if(typeof r!==ie)throw new Error("enhancer"+He);return r(St)(e,t)}if(typeof e!==ie)throw new Error("reducer"+He);var i=e,a=t,o=[],s=o,p=!1;function v(){s===o&&(s=o.slice())}function x(){return a}function d(h){if(typeof h!==ie)throw new Error("Listener"+He);var A=!0;return v(),s.push(h),function(){if(A){A=!1,v();var I=s.indexOf(h);s.splice(I,1)}}}function N(h){if(!J(h))throw new Error("Act != obj");if(typeof h.type===te)throw new Error("ActType "+te);if(p)throw new Error("Dispatch in reducer");try{p=!0,a=i(a,h)}finally{p=!1}for(var A=o=s,I=0;I<A.length;I++)(0,A[I])();return h}return N({type:"@@redux/INIT"}),(n={dispatch:N,subscribe:d,getState:x,replaceReducer:function(h){if(typeof h!==ie)throw new Error("next reducer"+He);i=h,N({type:"@@redux/INIT"})}})[It]=function(){var h,A=d;return(h={subscribe:function(I){if(typeof I!="object")throw new TypeError("Observer != obj");function y(){I.next&&I.next(x())}return y(),{unsubscribe:A(y)}}})[It]=function(){return this},h},n}function $r(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+te}function we(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function Ur(){var e=arguments;return function(t){return function(r,n,i){var a,o=t(r,n,i),s=o.dispatch,p={getState:o.getState,dispatch:function(v){return s(v)}};return a=[].slice.call(e).map(function(v){return v(p)}),g({},o,{dispatch:s=we.apply(void 0,a)(o.dispatch)})}}}var ae=ee+"anon_id",le=ee+"user_id",Ie=ee+"user_traits",oe="userId",Se="anonymousId",Ge=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],nt=["name","EVENTS","config","loaded"],m=Ge.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Pt=/^utm_/,xt=/^an_prop_/,Ot=/^an_trait_/;function Rr(e){var t=e.storage.setItem;return function(r){return function(n){return function(i){if(i.type===m.bootstrap){var a=i.params,o=i.user,s=i.persistedUser,p=i.initialUser,v=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(ae,o.anonymousId),v||t(le,o.userId),p.traits&&t(Ie,g({},v&&s.traits?s.traits:{},p.traits));var x=Object.keys(i.params);if(x.length){var d=a.an_uid,N=a.an_event,h=x.reduce(function(A,I){if(I.match(Pt)||I.match(/^(d|g)clid/)){var y=I.replace(Pt,"");A.campaign[y==="campaign"?"name":y]=a[I]}return I.match(xt)&&(A.props[I.replace(xt,"")]=a[I]),I.match(Ot)&&(A.traits[I.replace(Ot,"")]=a[I]),A},{campaign:{},props:{},traits:{}});r.dispatch(g({type:m.params,raw:a},h,d?{userId:d}:{})),d&&setTimeout(function(){return e.identify(d,h.traits)},0),N&&setTimeout(function(){return e.track(N,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:m.campaign,campaign:h.campaign})}}return n(i)}}}}function qr(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===m.setItemEnd){if(r.key===ae)return g({},t,{anonymousId:r.value});if(r.key===le)return g({},t,{userId:r.value})}switch(r.type){case m.identify:return Object.assign({},t,{userId:r.userId,traits:g({},t.traits,r.traits)});case m.reset:return[le,ae,Ie].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Et(e){return{userId:e.getItem(le),anonymousId:e.getItem(ae),traits:e.getItem(Ie)}}var it=function(e){return ee+"TEMP"+ee+e};function Cr(e){var t=e.storage,r=t.setItem,n=t.removeItem,i=t.getItem;return function(a){return function(o){return function(s){var p=s.userId,v=s.traits,x=s.options;if(s.type===m.reset&&([le,Ie,ae].forEach(function(h){n(h)}),[oe,Se,"traits"].forEach(function(h){ye(it(h))})),s.type===m.identify){i(ae)||r(ae,Je());var d=i(le),N=i(Ie)||{};d&&d!==p&&a.dispatch({type:m.userIdChanged,old:{userId:d,traits:N},new:{userId:p,traits:v},options:x}),p&&r(le,p),v&&r(Ie,g({},N,v))}return o(s)}}}}var je={};function kt(e,t){je[e]&&Q(je[e])&&(je[e](t),delete je[e])}function _t(e,t,r){return new Promise(function(n,i){return t()?n(e):r<1?i(g({},e,{queue:!0})):new Promise(function(a){return setTimeout(a,10)}).then(function(a){return _t(e,t,r-10).then(n,i)})})}function Nt(e,t,r){var n=t(),i=e.getState(),a=i.plugins,o=i.queue,s=i.user;if(!i.context.offline&&o&&o.actions&&o.actions.length){var p=o.actions.reduce(function(x,d,N){return a[d.plugin].loaded?(x.process.push(d),x.processIndex.push(N)):(x.requeue.push(d),x.requeueIndex.push(N)),x},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(p.processIndex&&p.processIndex.length){p.processIndex.forEach(function(x){var d=o.actions[x],N=d.plugin,h=d.payload.type,A=n[N][h];if(A&&Q(A)){var I=function(E,j){return E===void 0&&(E={}),j===void 0&&(j={}),[oe,Se].reduce(function(M,l){return E.hasOwnProperty(l)&&j[l]&&j[l]!==E[l]&&(M[l]=j[l]),M},E)}(d.payload,s);A({payload:I,config:a[N].config,instance:r});var y=h+":"+N;e.dispatch(g({},I,{type:y,_:{called:y,from:"queueDrain"}}))}});var v=o.actions.filter(function(x,d){return!~p.processIndex.indexOf(d)});o.actions=v}}}var at=function(e){var t=e.data,r=e.action,n=e.instance,i=e.state,a=e.allPlugins,o=e.allMatches,s=e.store,p=e.EVENTS;try{var v=i.plugins,x=i.context,d=r.type,N=d.match(Pe),h=t.exact.map(function(y){return y.pluginName});N&&(h=o.during.map(function(y){return y.pluginName}));var A=function(y,E){return function(j,M,l){var b=M.config,$=M.name,z=$+"."+j.type;l&&(z=l.event);var L=j.type.match(Pe)?function(D,U,F,C,H){return function(S,T){var W=C?C.name:D,V=T&&Te(T)?T:F;if(C&&(!(V=T&&Te(T)?T:[D]).includes(D)||V.length!==1))throw new Error("Method "+U+" can only abort "+D+" plugin. "+JSON.stringify(V)+" input valid");return g({},H,{abort:{reason:S,plugins:V,caller:U,_:W}})}}($,z,E,l,j):function(D,U){return function(){throw new Error(D.type+" action not cancellable. Remove abort in "+U)}}(j,z);return{payload:Br(j),instance:y,config:b||{},abort:L}}}(n,h),I=t.exact.reduce(function(y,E){var j=E.pluginName,M=E.methodName,l=!1;return M.match(/^initialize/)||M.match(/^reset/)||(l=!v[j].loaded),x.offline&&M.match(/^(page|track|identify)/)&&(l=!0),y[""+j]=l,y},{});return Promise.resolve(t.exact.reduce(function(y,E,j){var M=E.pluginName;return Promise.resolve(y).then(function(l){function b(){return Promise.resolve(l)}var $=function(){if(t.namespaced&&t.namespaced[M])return Promise.resolve(t.namespaced[M].reduce(function(z,L,D){return Promise.resolve(z).then(function(U){return L.method&&Q(L.method)?(function(S,T){var W=Ut(S);if(W&&W.name===T){var V=Ut(W.method);throw new Error([T+" plugin is calling method "+S,"Plugins cant call self","Use "+W.method+" "+(V?"or "+V.method:"")+" in "+T+" plugin insteadof "+S].join(`
|
|
2
|
-
`))}}(L.methodName,L.pluginName),Promise.resolve(L.method({payload:U,instance:n,abort:(F=U,C=M,H=L.pluginName,function(S,T){return g({},F,{abort:{reason:S,plugins:T||[C],caller:d,from:H||C}})}),config:At(L.pluginName,v,a),plugins:v})).then(function(S){var T=J(S)?S:{};return Promise.resolve(g({},U,T))})):U;var F,C,H})},Promise.resolve(r))).then(function(z){l[M]=z});l[M]=r}();return $&&$.then?$.then(b):b()})},Promise.resolve({}))).then(function(y){return Promise.resolve(t.exact.reduce(function(E,j,M){try{var l=t.exact.length===M+1,b=j.pluginName,$=a[b];return Promise.resolve(E).then(function(z){var L=y[b]?y[b]:{};if(N&&(L=z),ut(L,b))return ot({data:L,method:d,instance:n,pluginName:b,store:s}),Promise.resolve(z);if(ut(z,b))return l&&ot({data:z,method:d,instance:n,store:s}),Promise.resolve(z);if(I.hasOwnProperty(b)&&I[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(z);var D=A(y[b],a[b]);return Promise.resolve($[d]({abort:D.abort,payload:L,instance:n,config:At(b,v,a),plugins:v})).then(function(U){var F=J(U)?U:{},C=g({},z,F),H=y[b];if(ut(H,b))ot({data:H,method:d,instance:n,pluginName:b,store:s});else{var S=d+":"+b;(S.match(/:/g)||[]).length<2&&!d.match(jt)&&!d.match(Tt)&&n.dispatch(g({},N?C:L,{type:S,_:{called:S,from:"submethod"}}))}return Promise.resolve(C)})})}catch(z){return Promise.reject(z)}},Promise.resolve(r))).then(function(E){if(!(d.match(Pe)||d.match(/^registerPlugin/)||d.match(Tt)||d.match(jt)||d.match(/^params/)||d.match(/^userIdChanged/))){if(p.plugins.includes(d),E._&&E._.originalAction===d)return E;var j=g({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Lt(E,t.exact.length)&&!d.match(/End$/)&&(j=g({},j,{type:E.type+"Aborted"})),s.dispatch(j)}return E})})}catch(y){return Promise.reject(y)}},Pe=/Start$/,jt=/^bootstrap/,Tt=/^ready/;function ot(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(g({},e.data,{type:r,_:{called:r,from:"abort"}}))}function At(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Mt(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function zt(e,t){var r=e.replace(Pe,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function ut(e,t){var r=e.abort;return!!r&&(r===!0||$t(r,t)||r&&$t(r.plugins,t))}function Lt(e,t){var r=e.abort;if(!r)return!1;if(r===!0||ge(r))return!0;var n=r.plugins;return Te(r)&&r.length===t||Te(n)&&n.length===t}function Te(e){return Array.isArray(e)}function $t(e,t){return!(!e||!Te(e))&&e.includes(t)}function Ut(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function Br(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=J(e[r])?Object.assign({},e[r]):e[r]),t},{})}function Dr(e,t,r){var n={};return function(i){return function(a){return function(o){try{var s,p=function(l){return s?l:a(d)},v=o.type,x=o.plugins,d=o;if(o.abort)return Promise.resolve(a(o));if(v===m.enablePlugin&&i.dispatch({type:m.initializeStart,plugins:x,disabled:[],fromEnable:!0,meta:o.meta}),v===m.disablePlugin&&setTimeout(function(){return kt(o.meta.rid,{payload:o})},0),v===m.initializeEnd){var N=t(),h=Object.keys(N),A=h.filter(function(l){return x.includes(l)}).map(function(l){return N[l]}),I=[],y=[],E=o.disabled,j=A.map(function(l){var b=l.name;return _t(l,l.loaded,1e4).then(function($){return n[b]||(i.dispatch({type:m.pluginReadyType(b),name:b,events:Object.keys(l).filter(function(z){return!nt.includes(z)})}),n[b]=!0),I=I.concat(b),l}).catch(function($){if($ instanceof Error)throw new Error($);return y=y.concat($.name),$})});Promise.all(j).then(function(l){var b={plugins:I,failed:y,disabled:E};setTimeout(function(){h.length===j.length+E.length&&i.dispatch(g({},{type:m.ready},b))},0)})}var M=function(){if(v!==m.bootstrap)return/^ready:([^:]*)$/.test(v)&&setTimeout(function(){return Nt(i,t,e)},0),Promise.resolve(function(l,b,$,z,L){try{var D=Q(b)?b():b,U=l.type,F=U.replace(Pe,"");if(l._&&l._.called)return Promise.resolve(l);var C=$.getState(),H=(W=D,(V=C.plugins)===void 0&&(V={}),(c=l.options)===void 0&&(c={}),Object.keys(W).filter(function(u){var f=c.plugins||{};return xr(f[u])?f[u]:f.all!==!1&&(!V[u]||V[u].enabled!==!1)}).map(function(u){return W[u]}));U===m.initializeStart&&l.fromEnable&&(H=Object.keys(C.plugins).filter(function(u){var f=C.plugins[u];return l.plugins.includes(u)&&!f.initialized}).map(function(u){return D[u]}));var S=H.map(function(u){return u.name}),T=function(u,f,P){var O=zt(u).map(function(w){return Mt(w,f)});return f.reduce(function(w,B){var k=B.name,R=zt(u,k).map(function(Ee){return Mt(Ee,f)}),_=R[0],Y=R[1],Oe=R[2];return _.length&&(w.beforeNS[k]=_),Y.length&&(w.duringNS[k]=Y),Oe.length&&(w.afterNS[k]=Oe),w},{before:O[0],beforeNS:{},during:O[1],duringNS:{},after:O[2],afterNS:{}})}(U,H);return Promise.resolve(at({action:l,data:{exact:T.before,namespaced:T.beforeNS},state:C,allPlugins:D,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(u){function f(){var w=function(){if(U.match(Pe))return Promise.resolve(at({action:g({},P,{type:F+"End"}),data:{exact:T.after,namespaced:T.afterNS},state:C,allPlugins:D,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(B){B.meta&&B.meta.hasCallback&&kt(B.meta.rid,{payload:B})})}();return w&&w.then?w.then(function(){return u}):u}if(Lt(u,S.length))return u;var P,O=function(){if(U!==F)return Promise.resolve(at({action:g({},u,{type:F}),data:{exact:T.during,namespaced:T.duringNS},state:C,allPlugins:D,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(w){P=w});P=u}();return O&&O.then?O.then(f):f()})}catch(u){return Promise.reject(u)}var W,V,c}(o,t,e,i,r)).then(function(l){var b=a(l);return s=1,b})}();return Promise.resolve(M&&M.then?M.then(p):p(M))}catch(l){return Promise.reject(l)}}}}}function Vr(e){return function(t){return function(r){return function(n){var i=n.type,a=n.key,o=n.value,s=n.options;if(i===m.setItem||i===m.removeItem){if(n.abort)return r(n);i===m.setItem?e.setItem(a,o,s):e.removeItem(a,s)}return r(n)}}}}var Jr=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(i){return i===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(i){var a={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(a)});return we.apply(void 0,o)(n)(i)}}}}};function Fr(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Rt(r.type,"registerPlugin"),a=e()[i];if(!a||!i)return t;var o=r.enabled;return n[i]={enabled:o,initialized:!!o&&Boolean(!a.initialize),loaded:!!o&&Boolean(a.loaded()),config:a.config||{}},g({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var s=Rt(r.type,m.initialize),p=e()[s];return p&&s?(n[s]=g({},t[s],{initialized:!0,loaded:Boolean(p.loaded())}),g({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=g({},t[r.name],{loaded:!0}),g({},t,n);switch(r.type){case m.disablePlugin:return g({},t,qt(r.plugins,!1,t));case m.enablePlugin:return g({},t,qt(r.plugins,!0,t));default:return t}}}function Rt(e,t){return e.substring(t.length+1,e.length)}function qt(e,t,r){return e.reduce(function(n,i){return n[i]=g({},r[i],{enabled:t}),n},r)}function Ct(e){try{return JSON.parse(JSON.stringify(e))}catch(t){}return e}var Hr={last:{},history:[]};function Gr(e,t){e===void 0&&(e=Hr);var r=t.options,n=t.meta;if(t.type===m.track){var i=Ct(g({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return g({},e,{last:i,history:e.history.concat(i)})}return e}var Wr={actions:[]};function Xr(e,t){e===void 0&&(e=Wr);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===m.identify?[t].concat(e.actions):e.actions.concat(t),g({},e,{actions:n});case"dequeue":return[];default:return e}}var Bt=/#.*$/;function Qr(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Bt,""):"")}var Dt,Vt,Jt,Ft,Kr=function(e){if(e===void 0&&(e={}),!q)return e;var t=document,r=t.title,n=t.referrer,i=window,a=i.location,o=i.innerWidth,s=i.innerHeight,p=a.hash,v=a.search,x=function(N){var h=function(){if(q){for(var A,I=document.getElementsByTagName("link"),y=0;A=I[y];y++)if(A.getAttribute("rel")==="canonical")return A.getAttribute("href")}}();return h?h.match(/\?/)?h:h+N:window.location.href.replace(Bt,"")}(v),d={title:r,url:x,path:Qr(x),hash:p,search:v,width:o,height:s};return n&&n!==""&&(d.referrer=n),g({},d,e)},Yr={last:{},history:[]};function Zr(e,t){e===void 0&&(e=Yr);var r=t.options;if(t.type===m.page){var n=Ct(g({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return g({},e,{last:n,history:e.history.concat(n)})}return e}Dt=function(){if(!q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Vt=q?document.referrer:null,Jt=Tr(),Ft=Ar();var Ht={initialized:!1,sessionId:Je(),app:null,version:null,debug:!1,offline:!!q&&!navigator.onLine,os:{name:Dt},userAgent:q?navigator.userAgent:"node",library:{name:"analytics",version:"0.11.0"},timezone:Ft,locale:Jt,campaign:{},referrer:Vt};function en(e,t){e===void 0&&(e=Ht);var r=e.initialized,n=t.campaign;switch(t.type){case m.campaign:return g({},e,{campaign:n});case m.offline:return g({},e,{offline:!0});case m.online:return g({},e,{offline:!1});default:return r?e:g({},Ht,e,{initialized:!0})}}var tn=["plugins","reducers","storage"];function rn(e,t,r){if(q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){n(i,t)})}}function nn(e){var t=rn.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Gt(){return se("analytics",[]),function(e){return function(t,r,n){var i=e(t,r,n),a=i.dispatch;return Object.assign(i,{dispatch:function(o){return he[ve].analytics.push(o.action||o),a(o)}})}}}function Wt(e){return function(){return we(we.apply(null,arguments),Gt())}}function ct(e){return e?Er(e)?e:[e]:[]}function Xt(e,t,r){e===void 0&&(e={});var n,i,a=Je();return t&&(je[a]=(n=t,i=function(o){for(var s,p=o||Array.prototype.slice.call(arguments),v=0;v<p.length;v++)if(Q(p[v])){s=p[v];break}return s}(r),function(o){i&&i(o),n(o)})),g({},e,{rid:a,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function an(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(c,u){if(Q(u))return c.middlewares=c.middlewares.concat(u),c;if(u.NAMESPACE&&(u.name=u.NAMESPACE),!u.name)throw new Error("https://lytics.dev/errors/1");var f=u.EVENTS?Object.keys(u.EVENTS).map(function(w){return u.EVENTS[w]}):[];c.pluginEnabled[u.name]=!(u.enabled===!1||u.config&&u.config.enabled===!1),delete u.enabled,u.methods&&(c.methods[u.name]=Object.keys(u.methods).reduce(function(w,B){var k;return w[B]=(k=u.methods[B],function(){for(var R=Array.prototype.slice.call(arguments),_=new Array(k.length),Y=0;Y<R.length;Y++)_[Y]=R[Y];return _[_.length]=l,k.apply({instance:l},_)}),w},{}),delete u.methods);var P=Object.keys(u).concat(f),O=new Set(c.events.concat(P));if(c.events=Array.from(O),c.pluginsArray=c.pluginsArray.concat(u),c.plugins[u.name])throw new Error(u.name+"AlreadyLoaded");return c.plugins[u.name]=u,c.plugins[u.name].loaded||(c.plugins[u.name].loaded=function(){return!0}),c},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:ce,setItem:se,removeItem:ye},a=function(c){return function(u,f,P){return f.getState("user")[u]||(P&&J(P)&&P[u]?P[u]:Et(c)[u]||ce(it(u))||null)}}(i),o=n.plugins,s=n.events.filter(function(c){return!nt.includes(c)}).sort(),p=new Set(s.concat(Ge).filter(function(c){return!nt.includes(c)})),v=Array.from(p).sort(),x=function(){return o},d=new Jr,N=d.addMiddleware,h=d.removeMiddleware,A=d.dynamicMiddlewares,I=function(){throw new Error("Abort disabled inListener")},y=Mr(),E=Et(i),j=g({},E,r,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});j.anonymousId||(j.anonymousId=Je());var M=g({enable:function(c,u){return new Promise(function(f){S.dispatch({type:m.enablePlugin,plugins:ct(c),_:{originalAction:m.enablePlugin}},f,[u])})},disable:function(c,u){return new Promise(function(f){S.dispatch({type:m.disablePlugin,plugins:ct(c),_:{originalAction:m.disablePlugin}},f,[u])})}},n.methods),l={identify:function(c,u,f,P){try{var O=ge(c)?c:null,w=J(c)?c:u,B=f||{},k=l.user();se(it(oe),O);var R=O||w.userId||a(oe,l,w);return Promise.resolve(new Promise(function(_){S.dispatch(g({type:m.identifyStart,userId:R,traits:w||{},options:B,anonymousId:k.anonymousId},k.id&&k.id!==O&&{previousId:k.id}),_,[u,f,P])}))}catch(_){return Promise.reject(_)}},track:function(c,u,f,P){try{var O=J(c)?c.event:c;if(!O||!ge(O))throw new Error("EventMissing");var w=J(c)?c:u||{},B=J(f)?f:{};return Promise.resolve(new Promise(function(k){S.dispatch({type:m.trackStart,event:O,properties:w,options:B,userId:a(oe,l,u),anonymousId:a(Se,l,u)},k,[u,f,P])}))}catch(k){return Promise.reject(k)}},page:function(c,u,f){try{var P=J(c)?c:{},O=J(u)?u:{};return Promise.resolve(new Promise(function(w){S.dispatch({type:m.pageStart,properties:Kr(P),options:O,userId:a(oe,l,P),anonymousId:a(Se,l,P)},w,[c,u,f])}))}catch(w){return Promise.reject(w)}},user:function(c){if(c===oe||c==="id")return a(oe,l);if(c===Se||c==="anonId")return a(Se,l);var u=l.getState("user");return c?Re(u,c):u},reset:function(c){return new Promise(function(u){S.dispatch({type:m.resetStart},u,c)})},ready:function(c){return l.on(m.ready,c)},on:function(c,u){if(!c||!Q(u))return!1;if(c===m.bootstrap)throw new Error(".on disabled for "+c);var f=/Start$|Start:/;if(c==="*"){var P=function(k){return function(R){return function(_){return _.type.match(f)&&u({payload:_,instance:l,plugins:o}),R(_)}}},O=function(k){return function(R){return function(_){return _.type.match(f)||u({payload:_,instance:l,plugins:o}),R(_)}}};return N(P,We),N(O,Xe),function(){h(P,We),h(O,Xe)}}var w=c.match(f)?We:Xe,B=function(k){return function(R){return function(_){return _.type===c&&u({payload:_,instance:l,plugins:o,abort:I}),R(_)}}};return N(B,w),function(){return h(B,w)}},once:function(c,u){if(!c||!Q(u))return!1;if(c===m.bootstrap)throw new Error(".once disabled for "+c);var f=l.on(c,function(P){u({payload:P.payload,instance:l,plugins:o,abort:I}),f()});return f},getState:function(c){var u=S.getState();return c?Re(u,c):Object.assign({},u)},dispatch:function(c){var u=ge(c)?{type:c}:c;if(Ge.includes(u.type))throw new Error("reserved action "+u.type);var f=g({},u,{_:g({originalAction:u.type},c._||{})});S.dispatch(f)},enablePlugin:M.enable,disablePlugin:M.disable,plugins:M,storage:{getItem:i.getItem,setItem:function(c,u,f){S.dispatch({type:m.setItemStart,key:c,value:u,options:f})},removeItem:function(c,u){S.dispatch({type:m.removeItemStart,key:c,options:u})}},setAnonymousId:function(c,u){l.storage.setItem(ae,c,u)},events:{core:Ge,plugins:s}},b=n.middlewares.concat([function(c){return function(u){return function(f){return f.meta||(f.meta=Xt()),u(f)}}},A(We),Dr(l,x,{all:v,plugins:s}),Vr(i),Rr(l),Cr(l),A(Xe)]),$={context:en,user:qr(i),page:Zr,track:Gr,plugins:Fr(x),queue:Xr},z=we,L=we;if(q&&e.debug){var D=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;D&&(z=D({trace:!0,traceLimit:25})),L=function(){return arguments.length===0?Gt():J(typeof arguments[0])?Wt():Wt().apply(null,arguments)}}var U,F=function(c){return Object.keys(c).reduce(function(u,f){return tn.includes(f)||(u[f]=c[f]),u},{})}(e),C=n.pluginsArray.reduce(function(c,u){var f=u.name,P=u.config,O=u.loaded,w=n.pluginEnabled[f];return c[f]={enabled:w,initialized:!!w&&Boolean(!u.initialize),loaded:Boolean(O()),config:P||{}},c},{}),H={context:F,user:j,plugins:C},S=St(function(c){for(var u=Object.keys(c),f={},P=0;P<u.length;P++){var O=u[P];typeof c[O]===ie&&(f[O]=c[O])}var w,B=Object.keys(f);try{(function(k){Object.keys(k).forEach(function(R){var _=k[R];if(typeof _(void 0,{type:"@@redux/INIT"})===te||typeof _(void 0,{type:Lr})===te)throw new Error("reducer "+R+" "+te)})})(f)}catch(k){w=k}return function(k,R){if(k===void 0&&(k={}),w)throw w;for(var _=!1,Y={},Oe=0;Oe<B.length;Oe++){var Ee=B[Oe],wr=k[Ee],ht=(0,f[Ee])(wr,R);if(typeof ht===te){var qn=$r(Ee,R);throw new Error(qn)}Y[Ee]=ht,_=_||ht!==wr}return _?Y:k}}(g({},$,t)),H,L(z(Ur.apply(void 0,b))));S.dispatch=(U=S.dispatch,function(c,u,f){var P=g({},c,{meta:Xt(c.meta,u,ct(f))});return U.apply(null,[P])});var T=Object.keys(o);S.dispatch({type:m.bootstrap,plugins:T,config:F,params:y,user:j,initialUser:r,persistedUser:E});var W=T.filter(function(c){return n.pluginEnabled[c]}),V=T.filter(function(c){return!n.pluginEnabled[c]});return S.dispatch({type:m.registerPlugins,plugins:T,enabled:n.pluginEnabled}),n.pluginsArray.map(function(c,u){var f=c.bootstrap,P=c.config,O=c.name;f&&Q(f)&&f({instance:l,config:P,payload:c}),S.dispatch({type:m.registerPluginType(O),name:O,enabled:n.pluginEnabled[O],plugin:c}),n.pluginsArray.length===u+1&&S.dispatch({type:m.initializeStart,plugins:W,disabled:V})}),nn(function(c){S.dispatch({type:c?m.offline:m.online})}),function(c,u,f){setInterval(function(){return Nt(c,u,f)},3e3)}(S,x,l),l}var We="before",Xe="after",Ae="cookie",fe=Yt(),Qt=Qe,on=Qe;function Kt(e){return fe?Qe(e,"",-1):ye(e)}function Yt(){if(fe!==void 0)return fe;var e="cookiecookie";try{Qe(e,e),fe=document.cookie.indexOf(e)!==-1,Kt(e)}catch(t){fe=!1}return fe}function Qe(e,t,r,n,i,a){if(typeof window!="undefined"){var o=arguments.length>1;return fe===!1&&(o?se(e,t):ce(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(i?"; domain="+i:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var Me="localStorage",un=rt.bind(null,"localStorage");be("localStorage","getItem",ce),be("localStorage","setItem",se),be("localStorage","removeItem",ye);var ze="sessionStorage",cn=rt.bind(null,"sessionStorage");be("sessionStorage","getItem",ce),be("sessionStorage","setItem",se),be("sessionStorage","removeItem",ye);function xe(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(J(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(r){}if(t!==null&&t!=="")return t}var sn=un(),ln=cn(),fn=Yt();function Zt(e,t){if(e){var r=st(t),n=!pt(r),i=lt(r)?xe(localStorage.getItem(e)):void 0;if(n&&!me(i))return i;var a=ft(r)?xe(Qt(e)):void 0;if(n&&a)return a;var o=dt(r)?xe(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ce(e);return n?s:{localStorage:i,sessionStorage:o,cookie:a,global:s}}}function dn(e,t,r){if(e&&!me(t)){var n={},i=st(r),a=JSON.stringify(t),o=!pt(i);return lt(i)&&(n[Me]=Ye(Me,t,xe(localStorage.getItem(e))),localStorage.setItem(e,a),o)?n[Me]:ft(i)&&(n[Ae]=Ye(Ae,t,xe(Qt(e))),on(e,a),o)?n[Ae]:dt(i)&&(n[ze]=Ye(ze,t,xe(sessionStorage.getItem(e))),sessionStorage.setItem(e,a),o)?n[ze]:(n[Ne]=Ye(Ne,t,ce(e)),se(e,t),o?n[Ne]:n)}}function pn(e,t){if(e){var r=st(t),n=Zt(e,Ce),i={};return!me(n.localStorage)&<(r)&&(localStorage.removeItem(e),i[Me]=n.localStorage),!me(n.cookie)&&ft(r)&&(Kt(e),i[Ae]=n.cookie),!me(n.sessionStorage)&&dt(r)&&(sessionStorage.removeItem(e),i[ze]=n.sessionStorage),!me(n.global)&&Ke(r,Ne)&&(ye(e),i[Ne]=n.global),i}}function st(e){return e?ge(e)?e:e.storage:ke}function lt(e){return sn&&Ke(e,Me)}function ft(e){return fn&&Ke(e,Ae)}function dt(e){return ln&&Ke(e,ze)}function pt(e){return e===Ce||e==="all"}function Ke(e,t){return e===ke||e===t||pt(e)}function Ye(e,t,r){return{location:e,current:t,previous:r}}var gn={setItem:dn,getItem:Zt,removeItem:pn};function mn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function er(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?er(Object(r),!0).forEach(function(n){mn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:gn};return an(tr(tr({},t),e))}function vn(e,t,r,n,i,a,o){e.fbq||(i=e.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},e._fbq||(e._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],a=t.createElement(r),a.async=!0,a.src=n,o=t.getElementsByTagName(r)[0],o.parentNode.insertBefore(a,o))}function hn({trackingId:e}){vn(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),window.fbq("init",e)}function yn(e={}){return{name:"facebook",config:e,initialize:function({config:t,instance:r}){if(!t.trackingId)throw new Error("No Facebook trackingId defined");hn({trackingId:t.trackingId})},page:function({payload:t,config:r,instance:n}){window.fbq("track","PageView")},track:function({payload:t,config:r,instance:n}){window.fbq("track",t.event,t.properties)},identify:function({payload:t,config:r}){},loaded:function(){return!!window.fbq}}}function Le(){window.dataLayer.push(arguments)}window.gtag=Le;function bn({trackingId:e,configParams:t={},setParams:r={}}){var n="ga-gtag";if(!document.getElementById(n)){var i=document.head,a=document.createElement("script");a.id=n,a.type="text/javascript",a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id="+e,i.insertBefore(a,i.firstChild),window.dataLayer=window.dataLayer||[],Le("js",new Date),r&&Le("set",r),Le("config",e,t)}}function wn(e={}){return{name:"google-analytics-4",config:e,initialize:function({config:t,instance:r}){if(!t.trackingId)throw new Error("No GA trackingId defined");var n={},i={};if(t.customDimensions){for(var a={},o=0;o<t.customDimensions.length;o++){var s=t.customDimensions[o];n[s.name]=s.callback(r,t),a["dimension"+(o+1)]=s.name}i.custom_map=a}bn({trackingId:t.trackingId,configParams:n,setParams:i})},page:function({payload:t,config:r,instance:n}){},track:function({payload:t,config:r,instance:n}){Le("event",t.event,t.properties)},identify:function({payload:t,config:r}){},loaded:function(){return!!window.gtag}}}var In=new URLSearchParams(window.location.search),Sn=In.get("zdbg"),nr={};const Ze="undefined";function K(){Sn==1&&console.debug(...arguments)}function X(e){console.warn(e),window.Rollbar&&window.Rollbar.warning(e)}function Pn(e){return e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function)}function ir(){try{var e=navigator.userAgent||"",t=new RegExp([/bot/,/spider/,/crawl/,/mediapartners/,/Google-Read-Aloud/,/semrush/].map(r=>r.source).join("|"),"i");return t.test(e)}catch(r){return!1}}function xn(e){document.readyState==="complete"||document.readyState==="loaded"||document.readyState==="interactive"?e():window.addEventListener("DOMContentLoaded",e)}var de=On();function On(){if(typeof de!==Ze)return de;de=!0;try{sessionStorage.setItem(Ze,Ze),sessionStorage.removeItem(Ze)}catch(e){de=!1}return de}function ar(e){var t,r=nr[e];return de?(t=sessionStorage.getItem(e),!t&&r&&(t=r,sessionStorage.setItem(e,t))):t=r,t?JSON.parse(t):void 0}function En(e,t){var r=JSON.stringify(t);de&&sessionStorage.setItem(e,r),nr[e]=r}function kn(){var e=document.createElement("div");e.innerHTML=" ",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;");try{if(document.body.appendChild(e),document.body.getAttribute("abp")!==null||e.offsetHeight===0||e.clientHeight===0)return!0;if(typeof getComputedStyle!="undefined"){var t=window.getComputedStyle(e,null);if(t&&(t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"))return!0}document.body.removeChild(e)}catch(r){}return!1}function or({method:e,url:t,data:r,json:n=!0}){return new Promise(function(i,a){var o=new XMLHttpRequest;o.open(e,t),o.withCredentials=!0,n&&(o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Content-Type","application/json")),o.onload=function(){this.status>=200&&this.status<300?i(n?JSON.parse(o.response):o.response):a({status:this.status,message:o.statusText})},o.onerror=function(){a({status:this.status,message:"Network Error"})},r?o.send(r):o.send()})}function _n(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function Nn(r){return re(this,arguments,function*({url:e,data:t}){if(window&&window.navigator&&typeof window.navigator.sendBeacon=="function"&&typeof window.Blob=="function")try{const n=new Blob([JSON.stringify(t)],{type:"text/plain; charset=UTF-8"});return!!window.navigator.sendBeacon(e,n)}catch(n){return X("postBeacon:"),!1}return!1})}function jn(n){return re(this,arguments,function*({url:e,params:t=null,json:r=!0}){var i=e;return t&&(i=i+_n(t)),yield or({method:"GET",url:i,json:r})})}function gt(i){return re(this,arguments,function*({url:e,data:t,json:r=!0,beacon:n=!1}){var a=t;if(r&&(a=JSON.stringify(a)),n){var o=yield Nn({url:e,data:t});if(o)return;K("Beacon failed")}return yield or({method:"POST",url:e,data:a,json:r})})}var et="__zar_vid",ur="success",$e="error",Tn=30*1e3,cr=0,An=3,G={},Ue=new Map;function Mn(){return Date.now().toString(36)+"."+Math.random().toString(36).substring(2)}function zn(e,t,r,n){var i,a=!1,o=null,s=r(e);!s||!s.id?(i=t(),o=document.referrer,a=!0,K("new ID for",e,"-",i)):(i=s.id,o=s.origReferrer);var p={id:i,t:Date.now(),origReferrer:o,isNew:a};return n(e,p),p}function sr(){var e=zn(et,Mn,ar,En);return{vid:e}}function lr(){return window.location.host+"/api/v1"}function fr(e){return ar(e)}function dr(e){var t=fr(e);return t?t.id:null}function tt(){return{vid:fr(et)}}function Ln(){return{vid:dr(et)}}function pr({elem:e}){var t=null,r=null,n=null,i=new RegExp("\\+?\\(?\\d*\\)? ?\\(?\\d+\\)?\\d*([\\s./-]?\\d{2,})+","g");e.href&&e.href.startsWith("tel:")&&(n=e.href);var a=e.innerText,o=e.innerHTML,s=i.exec(a);return s&&(t=s[0].trim(),r=t.replace("+","").replace(/-/g,"").replace(/ /g,"").replace("(","").replace(")","").replace(/^1/,"")),{text:a,html:o,numberText:t,href:n,number:r}}function mt({elems:e,number:t}){var r,n=t;t.startsWith("+1")||(n="+1"+t);for(var i=0;i<e.length;i++){if(Ue.has(e[i])){K("element already in overlay map:",e[i]);continue}var a=pr({elem:e[i]});if(r?a.number&&r.number&&r.number!==a.number&&X("overlaying multiple numbers with a single number",r.number,a.number):r=a,K("overlaying",n,"on",e[i]),Ue.set(e[i],a),a.href&&(e[i].href="tel:"+n),a.numberText)if(e[i].innerHTML="",a.text){var o=n;if(a.numberText.indexOf("-")>-1&&(o=n.slice(2,5)+"-"+n.slice(5,8)+"-"+n.slice(8,12)),a.html.indexOf("<img")>-1){var s=a.html.replace(a.numberText,o);e[i].innerHTML=s}else{var p=a.text.replace(a.numberText,o);e[i].appendChild(document.createTextNode(p))}}else e[i].appendChild(document.createTextNode(n));else K("no number text found:",e[i])}}function vt({elems:e}){for(var t=0;t<e.length;t++)if(Ue.has(e[t])){var r=e[t].innerHTML,n=Ue.get(e[t]);K("orig:",n);var i=n.html;K("reverting",r,"to",i),e[t].innerHTML=i,n.href&&(e[t].href=n.href),Ue.delete(e[t])}else K("element not in map:",e[t])}function gr(e){clearInterval(G[e]),delete G[e]}function mr(){for(var e in G)gr(e)}function vr(i){return re(this,arguments,function*({poolId:e,apiUrl:t,number:r=null,context:n=null}){var a={pool_id:e,number:r,context:n,properties:{zar:tt()}},o=yield gt({url:`${t}/number_pool`,data:a});return o})}function $n(n){return re(this,arguments,function*({apiUrl:e,key:t=null,with_contexts:r=!1}){var i={key:t,with_contexts:r},a=yield jn({url:`${e}/number_pool_stats`,params:i});return a})}function Un(){return re(this,arguments,function*({poolId:e,number:t,overlayElements:r,apiUrl:n=lr(),contextCallback:i=null}={}){var a={};i&&(a=i()||{});try{var o=yield vr({poolId:e,apiUrl:n,number:t,context:a})}catch(p){var s="error getting number: "+JSON.stringify(p);return X(s),cr++,cr>=An&&(X("max failures, stopping pool"),mr(),r&&vt({elems:r})),{status:$e,msg:s}}return o.status===ur&&o.number?r&&mt({elems:r,number:o.number}):(r&&vt({elems:r}),G[e]&&(clearInterval(G[e]),delete G[e])),o})}function hr(e){return Pn(e)?e():e}function yr(){return re(this,arguments,function*({poolData:e,poolConfig:t,apiUrl:r}={}){var n;if(!t||!t.poolId||!t.overlayQuerySelector||!r)return n="missing pool config: "+JSON.stringify(t),X(n),t.initCallback&&t.initCallback({status:$e,msg:n}),G;var i={};t.contextCallback&&(i=t.contextCallback()||{});var a=hr(t.poolId);if(!a)return n="no pool ID",X(n),t.initCallback&&t.initCallback({status:$e,msg:n}),G;if(!e)try{e=yield vr({poolId:a,apiUrl:r,number:null,context:i})}catch(o){return n="error getting number on init: "+JSON.stringify(o),X(n),t.initCallback&&t.initCallback({status:$e,msg:n}),G}return e&&e.status===ur&&e.number&&xn(function(){var o=document.querySelectorAll(t.overlayQuerySelector);if(!o){var s="No elems found for:"+t.overlayQuerySelector;X(s),t.initCallback&&t.initCallback({status:$e,msg:s});return}mt({elems:o,number:e.number});var p=setInterval(function(){try{Un({poolId:e.pool_id,number:e.number,overlayElements:o,apiUrl:r,contextCallback:t.contextCallback})}catch(x){var v="error on interval: "+JSON.stringify(x);X(v)}},t.renewalInterval||Tn);G[e.pool_id]=p,t.initCallback&&t.initCallback(e)}),G})}function br({apiUrl:e,poolConfig:t}){return sr(),{name:"zar",config:{apiUrl:e,poolConfig:t},initialize:function({config:r}){},loaded:function(){return!0},pageStart:function({payload:r,config:n,instance:i}){r.properties.zar=tt(),r.properties.referrer=document.referrer,r.properties.is_bot=ir(),"hash"in r.properties&&delete r.properties.hash,"path"in r.properties&&delete r.properties.path,"search"in r.properties&&delete r.properties.search;try{var a=n.poolConfig;a&&a.poolId&&(r.properties.pool_id=hr(a.poolId),a.contextCallback&&(r.properties.pool_context=a.contextCallback()||{}))}catch(o){X("error getting pool id: "+JSON.stringify(o))}return r},page:function(o){return re(this,arguments,function*({payload:r,options:n,instance:i,config:a}){K("page",r,n,a);for(var s=0,p=3,v;s<p;)try{v=yield gt({url:`${a.apiUrl}/page`,data:r});break}catch(x){if(s++,s>=p)throw X("error posting page: "+JSON.stringify(x)),x;yield new Promise(d=>setTimeout(d,1e3))}v&&v.pool_data&&yr({poolData:v.pool_data,poolConfig:a.poolConfig,apiUrl:a.apiUrl})})},trackStart:function({payload:r,config:n,instance:i}){return r.properties.zar=tt(),r.properties.url=window.location.href,r.properties.referrer=document.referrer,r},track:function({payload:r,options:n,instance:i,config:a}){K("track",r),gt({url:`${a.apiUrl}/track`,data:r,beacon:!0})},methods:{apiUrl(){return e},poolConfig(){return t},initIDs(){return sr()},getIDs(){return Ln()},getStorage(){return tt()},getVID(){return dr(et)},hasAdBlock(){return kn()},isBot(){return ir()},initTrackingPool({poolConfig:r}){var n=this.instance.plugins.zar;return yr({poolData:null,poolConfig:Object.assign(n.poolConfig(),r||{}),apiUrl:n.apiUrl()})},getPoolIntervals(){return G},clearPoolInterval({poolId:r}){gr(r)},clearPoolIntervals(){mr()},extractPhoneNumbers({elems:r}){for(var n=[],i=0;i<r.length;i++){var a=pr({elem:r[i]});n.push(a)}return n},overlayPhoneNumber({overlayElements:r,number:n}){mt({elems:r,number:n})},revertOverlayNumbers({overlayElements:r}){vt({elems:r})},getPoolStats({key:r=null,with_contexts:n=!1}){return $n({apiUrl:this.instance.plugins.zar.apiUrl(),key:r,with_contexts:n})}}}}function Rn({app:e,ga4Config:t=null,facebookConfig:r=null,apiUrl:n=null,poolConfig:i=null}){n||(n=lr());var a=[br({apiUrl:n,poolConfig:i})];return t&&a.push(wn(t)),r&&a.push(yn(r)),rr({app:e,plugins:a})}return ue.Analytics=rr,ue.init=Rn,ue.zar=br,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ue}({});
|
|
1
|
+
var ne=(ue,De,Z)=>new Promise((Re,_e)=>{var qe=R=>{try{re(Z.next(R))}catch(ge){_e(ge)}},ee=R=>{try{re(Z.throw(R))}catch(ge){_e(ge)}},re=R=>R.done?Re(R.value):Promise.resolve(R.value).then(qe,ee);re((Z=Z.apply(ue,De)).next())});var zar=function(ue){"use strict";function De(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Z="undefined",Re="object",_e="any",qe="*",ee="__",re=typeof process!="undefined"?process:{};re.env&&re.env.NODE_ENV;var R=typeof window!="undefined";re.versions!=null&&re.versions.node!=null,typeof Deno!="undefined"&&Deno.core,R&&window.name==="nodejs"||typeof navigator!="undefined"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ge(e,t){return t.charAt(0)[e]()+t.slice(1)}var Sn=ge.bind(null,"toUpperCase"),Pn=ge.bind(null,"toLowerCase");function xn(e){return yt(e)?Sn("null"):typeof e=="object"?Nn(e):Object.prototype.toString.call(e).slice(8,-1)}function Ce(e,t){t===void 0&&(t=!0);var n=xn(e);return t?Pn(n):n}function Ne(e,t){return typeof t===e}var Q=Ne.bind(null,"function"),me=Ne.bind(null,"string"),ve=Ne.bind(null,"undefined"),On=Ne.bind(null,"boolean");Ne.bind(null,"symbol");function yt(e){return e===null}function En(e){return Ce(e)==="number"&&!isNaN(e)}function kn(e){return Ce(e)==="array"}function J(e){if(!_n(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _n(e){return e&&(typeof e=="object"||e!==null)}function Nn(e){return Q(e.constructor)?e.constructor.name:null}function jn(e){return e instanceof Error||me(e.message)&&e.constructor&&En(e.constructor.stackTraceLimit)}function bt(e,t){if(typeof t!="object"||yt(t))return!1;if(t instanceof e)return!0;var n=Ce(new e(""));if(jn(t))for(;t;){if(Ce(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}bt.bind(null,TypeError),bt.bind(null,SyntaxError);function Be(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?Tn(e,t):n}function Tn(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Ve(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Ve(Be,"form"),Ve(Be,"button"),Ve(Be,"input"),Ve(Be,"select");function wt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function An(){if(R){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function Mn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}function zn(e){return function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var a=wt(n[1]),o=wt(n[2]);a.substring(a.length-2)==="[]"?(r[a=a.substring(0,a.length-2)]||(r[a]=[])).push(o):r[a]=o===""||o}for(var s in r){var p=s.split("[");p.length>1&&(Ln(r,p.map(function(g){return g.replace(/[?[\]\\ ]/g,"")}),r[s]),delete r[s])}return r}(function(t){if(t){var n=t.match(/\?(.*)/);return n&&n[1]?n[1].split("#")[0]:""}return R&&window.location.search.substring(1)}(e))}function Ln(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var a=t[i];if(a==="__proto__"||a==="constructor")break;a in e||(e[a]={}),e=e[a]}e[t[r]]=n}function Je(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var je="global",he=ee+"global"+ee,ye=typeof self===Re&&self.self===self&&self||typeof global===Re&&global.global===global&&global||void 0;function ce(e){return ye[he][e]}function se(e,t){return ye[he][e]=t}function be(e){delete ye[he][e]}function we(e,t,n){var r;try{if(nt(e)){var i=window[e];r=i[t].bind(i)}}catch(a){}return r||n}ye[he]||(ye[he]={});var Fe={};function nt(e){if(typeof Fe[e]!==Z)return Fe[e];try{var t=window[e];t.setItem(Z,Z),t.removeItem(Z)}catch(n){return Fe[e]=!1}return Fe[e]=!0}function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}var ie="function",te="undefined",$n="@@redux/"+Math.random().toString(36),It=function(){return typeof Symbol===ie&&Symbol.observable||"@@observable"}(),He=" != "+ie;function St(e,t,n){var r;if(typeof t===ie&&typeof n===te&&(n=t,t=void 0),typeof n!==te){if(typeof n!==ie)throw new Error("enhancer"+He);return n(St)(e,t)}if(typeof e!==ie)throw new Error("reducer"+He);var i=e,a=t,o=[],s=o,p=!1;function g(){s===o&&(s=o.slice())}function x(){return a}function d(h){if(typeof h!==ie)throw new Error("Listener"+He);var A=!0;return g(),s.push(h),function(){if(A){A=!1,g();var I=s.indexOf(h);s.splice(I,1)}}}function N(h){if(!J(h))throw new Error("Act != obj");if(typeof h.type===te)throw new Error("ActType "+te);if(p)throw new Error("Dispatch in reducer");try{p=!0,a=i(a,h)}finally{p=!1}for(var A=o=s,I=0;I<A.length;I++)(0,A[I])();return h}return N({type:"@@redux/INIT"}),(r={dispatch:N,subscribe:d,getState:x,replaceReducer:function(h){if(typeof h!==ie)throw new Error("next reducer"+He);i=h,N({type:"@@redux/INIT"})}})[It]=function(){var h,A=d;return(h={subscribe:function(I){if(typeof I!="object")throw new TypeError("Observer != obj");function y(){I.next&&I.next(x())}return y(),{unsubscribe:A(y)}}})[It]=function(){return this},h},r}function Un(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+"reducer "+e+" returns "+te}function Ie(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function Dn(){var e=arguments;return function(t){return function(n,r,i){var a,o=t(n,r,i),s=o.dispatch,p={getState:o.getState,dispatch:function(g){return s(g)}};return a=[].slice.call(e).map(function(g){return g(p)}),m({},o,{dispatch:s=Ie.apply(void 0,a)(o.dispatch)})}}}var ae=ee+"anon_id",le=ee+"user_id",Se=ee+"user_traits",oe="userId",Pe="anonymousId",Ge=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],rt=["name","EVENTS","config","loaded"],v=Ge.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Pt=/^utm_/,xt=/^an_prop_/,Ot=/^an_trait_/;function Rn(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===v.bootstrap){var a=i.params,o=i.user,s=i.persistedUser,p=i.initialUser,g=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(ae,o.anonymousId),g||t(le,o.userId),p.traits&&t(Se,m({},g&&s.traits?s.traits:{},p.traits));var x=Object.keys(i.params);if(x.length){var d=a.an_uid,N=a.an_event,h=x.reduce(function(A,I){if(I.match(Pt)||I.match(/^(d|g)clid/)){var y=I.replace(Pt,"");A.campaign[y==="campaign"?"name":y]=a[I]}return I.match(xt)&&(A.props[I.replace(xt,"")]=a[I]),I.match(Ot)&&(A.traits[I.replace(Ot,"")]=a[I]),A},{campaign:{},props:{},traits:{}});n.dispatch(m({type:v.params,raw:a},h,d?{userId:d}:{})),d&&setTimeout(function(){return e.identify(d,h.traits)},0),N&&setTimeout(function(){return e.track(N,h.props)},0),Object.keys(h.campaign).length&&n.dispatch({type:v.campaign,campaign:h.campaign})}}return r(i)}}}}function qn(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===v.setItemEnd){if(n.key===ae)return m({},t,{anonymousId:n.value});if(n.key===le)return m({},t,{userId:n.value})}switch(n.type){case v.identify:return Object.assign({},t,{userId:n.userId,traits:m({},t.traits,n.traits)});case v.reset:return[le,ae,Se].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Et(e){return{userId:e.getItem(le),anonymousId:e.getItem(ae),traits:e.getItem(Se)}}var it=function(e){return ee+"TEMP"+ee+e};function Cn(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(a){return function(o){return function(s){var p=s.userId,g=s.traits,x=s.options;if(s.type===v.reset&&([le,Se,ae].forEach(function(h){r(h)}),[oe,Pe,"traits"].forEach(function(h){be(it(h))})),s.type===v.identify){i(ae)||n(ae,Je());var d=i(le),N=i(Se)||{};d&&d!==p&&a.dispatch({type:v.userIdChanged,old:{userId:d,traits:N},new:{userId:p,traits:g},options:x}),p&&n(le,p),g&&n(Se,m({},N,g))}return o(s)}}}}var Te={};function kt(e,t){Te[e]&&Q(Te[e])&&(Te[e](t),delete Te[e])}function _t(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(m({},e,{queue:!0})):new Promise(function(a){return setTimeout(a,10)}).then(function(a){return _t(e,t,n-10).then(r,i)})})}function Nt(e,t,n){var r=t(),i=e.getState(),a=i.plugins,o=i.queue,s=i.user;if(!i.context.offline&&o&&o.actions&&o.actions.length){var p=o.actions.reduce(function(x,d,N){return a[d.plugin].loaded?(x.process.push(d),x.processIndex.push(N)):(x.requeue.push(d),x.requeueIndex.push(N)),x},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(p.processIndex&&p.processIndex.length){p.processIndex.forEach(function(x){var d=o.actions[x],N=d.plugin,h=d.payload.type,A=r[N][h];if(A&&Q(A)){var I=function(E,j){return E===void 0&&(E={}),j===void 0&&(j={}),[oe,Pe].reduce(function(M,l){return E.hasOwnProperty(l)&&j[l]&&j[l]!==E[l]&&(M[l]=j[l]),M},E)}(d.payload,s);A({payload:I,config:a[N].config,instance:n});var y=h+":"+N;e.dispatch(m({},I,{type:y,_:{called:y,from:"queueDrain"}}))}});var g=o.actions.filter(function(x,d){return!~p.processIndex.indexOf(d)});o.actions=g}}}var at=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,a=e.allPlugins,o=e.allMatches,s=e.store,p=e.EVENTS;try{var g=i.plugins,x=i.context,d=n.type,N=d.match(xe),h=t.exact.map(function(y){return y.pluginName});N&&(h=o.during.map(function(y){return y.pluginName}));var A=function(y,E){return function(j,M,l){var b=M.config,$=M.name,z=$+"."+j.type;l&&(z=l.event);var L=j.type.match(xe)?function(B,U,F,q,H){return function(S,T){var X=q?q.name:B,V=T&&Ae(T)?T:F;if(q&&(!(V=T&&Ae(T)?T:[B]).includes(B)||V.length!==1))throw new Error("Method "+U+" can only abort "+B+" plugin. "+JSON.stringify(V)+" input valid");return m({},H,{abort:{reason:S,plugins:V,caller:U,_:X}})}}($,z,E,l,j):function(B,U){return function(){throw new Error(B.type+" action not cancellable. Remove abort in "+U)}}(j,z);return{payload:Bn(j),instance:y,config:b||{},abort:L}}}(r,h),I=t.exact.reduce(function(y,E){var j=E.pluginName,M=E.methodName,l=!1;return M.match(/^initialize/)||M.match(/^reset/)||(l=!g[j].loaded),x.offline&&M.match(/^(page|track|identify)/)&&(l=!0),y[""+j]=l,y},{});return Promise.resolve(t.exact.reduce(function(y,E,j){var M=E.pluginName;return Promise.resolve(y).then(function(l){function b(){return Promise.resolve(l)}var $=function(){if(t.namespaced&&t.namespaced[M])return Promise.resolve(t.namespaced[M].reduce(function(z,L,B){return Promise.resolve(z).then(function(U){return L.method&&Q(L.method)?(function(S,T){var X=Ut(S);if(X&&X.name===T){var V=Ut(X.method);throw new Error([T+" plugin is calling method "+S,"Plugins cant call self","Use "+X.method+" "+(V?"or "+V.method:"")+" in "+T+" plugin insteadof "+S].join(`
|
|
2
|
+
`))}}(L.methodName,L.pluginName),Promise.resolve(L.method({payload:U,instance:r,abort:(F=U,q=M,H=L.pluginName,function(S,T){return m({},F,{abort:{reason:S,plugins:T||[q],caller:d,from:H||q}})}),config:At(L.pluginName,g,a),plugins:g})).then(function(S){var T=J(S)?S:{};return Promise.resolve(m({},U,T))})):U;var F,q,H})},Promise.resolve(n))).then(function(z){l[M]=z});l[M]=n}();return $&&$.then?$.then(b):b()})},Promise.resolve({}))).then(function(y){return Promise.resolve(t.exact.reduce(function(E,j,M){try{var l=t.exact.length===M+1,b=j.pluginName,$=a[b];return Promise.resolve(E).then(function(z){var L=y[b]?y[b]:{};if(N&&(L=z),ut(L,b))return ot({data:L,method:d,instance:r,pluginName:b,store:s}),Promise.resolve(z);if(ut(z,b))return l&&ot({data:z,method:d,instance:r,store:s}),Promise.resolve(z);if(I.hasOwnProperty(b)&&I[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(z);var B=A(y[b],a[b]);return Promise.resolve($[d]({abort:B.abort,payload:L,instance:r,config:At(b,g,a),plugins:g})).then(function(U){var F=J(U)?U:{},q=m({},z,F),H=y[b];if(ut(H,b))ot({data:H,method:d,instance:r,pluginName:b,store:s});else{var S=d+":"+b;(S.match(/:/g)||[]).length<2&&!d.match(jt)&&!d.match(Tt)&&r.dispatch(m({},N?q:L,{type:S,_:{called:S,from:"submethod"}}))}return Promise.resolve(q)})})}catch(z){return Promise.reject(z)}},Promise.resolve(n))).then(function(E){if(!(d.match(xe)||d.match(/^registerPlugin/)||d.match(Tt)||d.match(jt)||d.match(/^params/)||d.match(/^userIdChanged/))){if(p.plugins.includes(d),E._&&E._.originalAction===d)return E;var j=m({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Lt(E,t.exact.length)&&!d.match(/End$/)&&(j=m({},j,{type:E.type+"Aborted"})),s.dispatch(j)}return E})})}catch(y){return Promise.reject(y)}},xe=/Start$/,jt=/^bootstrap/,Tt=/^ready/;function ot(e){var t=e.pluginName,n=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(m({},e.data,{type:n,_:{called:n,from:"abort"}}))}function At(e,t,n){var r=t[e]||n[e];return r&&r.config?r.config:{}}function Mt(e,t){return t.reduce(function(n,r){return r[e]?n.concat({methodName:e,pluginName:r.name,method:r[e]}):n},[])}function zt(e,t){var n=e.replace(xe,""),r=t?":"+t:"";return[""+e+r,""+n+r,n+"End"+r]}function ut(e,t){var n=e.abort;return!!n&&(n===!0||$t(n,t)||n&&$t(n.plugins,t))}function Lt(e,t){var n=e.abort;if(!n)return!1;if(n===!0||me(n))return!0;var r=n.plugins;return Ae(n)&&n.length===t||Ae(r)&&r.length===t}function Ae(e){return Array.isArray(e)}function $t(e,t){return!(!e||!Ae(e))&&e.includes(t)}function Ut(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function Bn(e){return Object.keys(e).reduce(function(t,n){return n==="type"||(t[n]=J(e[n])?Object.assign({},e[n]):e[n]),t},{})}function Vn(e,t,n){var r={};return function(i){return function(a){return function(o){try{var s,p=function(l){return s?l:a(d)},g=o.type,x=o.plugins,d=o;if(o.abort)return Promise.resolve(a(o));if(g===v.enablePlugin&&i.dispatch({type:v.initializeStart,plugins:x,disabled:[],fromEnable:!0,meta:o.meta}),g===v.disablePlugin&&setTimeout(function(){return kt(o.meta.rid,{payload:o})},0),g===v.initializeEnd){var N=t(),h=Object.keys(N),A=h.filter(function(l){return x.includes(l)}).map(function(l){return N[l]}),I=[],y=[],E=o.disabled,j=A.map(function(l){var b=l.name;return _t(l,l.loaded,1e4).then(function($){return r[b]||(i.dispatch({type:v.pluginReadyType(b),name:b,events:Object.keys(l).filter(function(z){return!rt.includes(z)})}),r[b]=!0),I=I.concat(b),l}).catch(function($){if($ instanceof Error)throw new Error($);return y=y.concat($.name),$})});Promise.all(j).then(function(l){var b={plugins:I,failed:y,disabled:E};setTimeout(function(){h.length===j.length+E.length&&i.dispatch(m({},{type:v.ready},b))},0)})}var M=function(){if(g!==v.bootstrap)return/^ready:([^:]*)$/.test(g)&&setTimeout(function(){return Nt(i,t,e)},0),Promise.resolve(function(l,b,$,z,L){try{var B=Q(b)?b():b,U=l.type,F=U.replace(xe,"");if(l._&&l._.called)return Promise.resolve(l);var q=$.getState(),H=(X=B,(V=q.plugins)===void 0&&(V={}),(c=l.options)===void 0&&(c={}),Object.keys(X).filter(function(u){var f=c.plugins||{};return On(f[u])?f[u]:f.all!==!1&&(!V[u]||V[u].enabled!==!1)}).map(function(u){return X[u]}));U===v.initializeStart&&l.fromEnable&&(H=Object.keys(q.plugins).filter(function(u){var f=q.plugins[u];return l.plugins.includes(u)&&!f.initialized}).map(function(u){return B[u]}));var S=H.map(function(u){return u.name}),T=function(u,f,P){var O=zt(u).map(function(w){return Mt(w,f)});return f.reduce(function(w,C){var k=C.name,D=zt(u,k).map(function(ke){return Mt(ke,f)}),_=D[0],Y=D[1],Ee=D[2];return _.length&&(w.beforeNS[k]=_),Y.length&&(w.duringNS[k]=Y),Ee.length&&(w.afterNS[k]=Ee),w},{before:O[0],beforeNS:{},during:O[1],duringNS:{},after:O[2],afterNS:{}})}(U,H);return Promise.resolve(at({action:l,data:{exact:T.before,namespaced:T.beforeNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(u){function f(){var w=function(){if(U.match(xe))return Promise.resolve(at({action:m({},P,{type:F+"End"}),data:{exact:T.after,namespaced:T.afterNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(C){C.meta&&C.meta.hasCallback&&kt(C.meta.rid,{payload:C})})}();return w&&w.then?w.then(function(){return u}):u}if(Lt(u,S.length))return u;var P,O=function(){if(U!==F)return Promise.resolve(at({action:m({},u,{type:F}),data:{exact:T.during,namespaced:T.duringNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(w){P=w});P=u}();return O&&O.then?O.then(f):f()})}catch(u){return Promise.reject(u)}var X,V,c}(o,t,e,i,n)).then(function(l){var b=a(l);return s=1,b})}();return Promise.resolve(M&&M.then?M.then(p):p(M))}catch(l){return Promise.reject(l)}}}}}function Jn(e){return function(t){return function(n){return function(r){var i=r.type,a=r.key,o=r.value,s=r.options;if(i===v.setItem||i===v.removeItem){if(r.abort)return n(r);i===v.setItem?e.setItem(a,o,s):e.removeItem(a,s)}return n(r)}}}}var Fn=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,n){e[n]=e[n].concat(t)},this.removeMiddleware=function(t,n){var r=e[n].findIndex(function(i){return i===t});r!==-1&&(e[n]=[].concat(e[n].slice(0,r),e[n].slice(r+1)))},this.dynamicMiddlewares=function(t){return function(n){return function(r){return function(i){var a={getState:n.getState,dispatch:function(s){return n.dispatch(s)}},o=e[t].map(function(s){return s(a)});return Ie.apply(void 0,o)(r)(i)}}}}};function Hn(e){return function(t,n){t===void 0&&(t={});var r={};if(n.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(n.type)){var i=Dt(n.type,"registerPlugin"),a=e()[i];if(!a||!i)return t;var o=n.enabled;return r[i]={enabled:o,initialized:!!o&&Boolean(!a.initialize),loaded:!!o&&Boolean(a.loaded()),config:a.config||{}},m({},t,r)}if(/^initialize:([^:]*)$/.test(n.type)){var s=Dt(n.type,v.initialize),p=e()[s];return p&&s?(r[s]=m({},t[s],{initialized:!0,loaded:Boolean(p.loaded())}),m({},t,r)):t}if(/^ready:([^:]*)$/.test(n.type))return r[n.name]=m({},t[n.name],{loaded:!0}),m({},t,r);switch(n.type){case v.disablePlugin:return m({},t,Rt(n.plugins,!1,t));case v.enablePlugin:return m({},t,Rt(n.plugins,!0,t));default:return t}}}function Dt(e,t){return e.substring(t.length+1,e.length)}function Rt(e,t,n){return e.reduce(function(r,i){return r[i]=m({},n[i],{enabled:t}),r},n)}function qt(e){try{return JSON.parse(JSON.stringify(e))}catch(t){}return e}var Gn={last:{},history:[]};function Wn(e,t){e===void 0&&(e=Gn);var n=t.options,r=t.meta;if(t.type===v.track){var i=qt(m({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r}));return m({},e,{last:i,history:e.history.concat(i)})}return e}var Xn={actions:[]};function Qn(e,t){e===void 0&&(e=Xn);var n=t.payload;switch(t.type){case"queue":var r;return r=n&&n.type&&n.type===v.identify?[t].concat(e.actions):e.actions.concat(t),m({},e,{actions:r});case"dequeue":return[];default:return e}}var Ct=/#.*$/;function Kn(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Ct,""):"")}var Bt,Vt,Jt,Ft,Yn=function(e){if(e===void 0&&(e={}),!R)return e;var t=document,n=t.title,r=t.referrer,i=window,a=i.location,o=i.innerWidth,s=i.innerHeight,p=a.hash,g=a.search,x=function(N){var h=function(){if(R){for(var A,I=document.getElementsByTagName("link"),y=0;A=I[y];y++)if(A.getAttribute("rel")==="canonical")return A.getAttribute("href")}}();return h?h.match(/\?/)?h:h+N:window.location.href.replace(Ct,"")}(g),d={title:n,url:x,path:Kn(x),hash:p,search:g,width:o,height:s};return r&&r!==""&&(d.referrer=r),m({},d,e)},Zn={last:{},history:[]};function er(e,t){e===void 0&&(e=Zn);var n=t.options;if(t.type===v.page){var r=qt(m({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n}));return m({},e,{last:r,history:e.history.concat(r)})}return e}Bt=function(){if(!R)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Vt=R?document.referrer:null,Jt=An(),Ft=Mn();var Ht={initialized:!1,sessionId:Je(),app:null,version:null,debug:!1,offline:!!R&&!navigator.onLine,os:{name:Bt},userAgent:R?navigator.userAgent:"node",library:{name:"analytics",version:"0.11.0"},timezone:Ft,locale:Jt,campaign:{},referrer:Vt};function tr(e,t){e===void 0&&(e=Ht);var n=e.initialized,r=t.campaign;switch(t.type){case v.campaign:return m({},e,{campaign:r});case v.offline:return m({},e,{offline:!0});case v.online:return m({},e,{offline:!1});default:return n?e:m({},Ht,e,{initialized:!0})}}var nr=["plugins","reducers","storage"];function rr(e,t,n){if(R){var r=window[(n?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){r(i,t)})}}function ir(e){var t=rr.bind(null,"online offline",function(n){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(n){return t(!1)}}function Gt(){return se("analytics",[]),function(e){return function(t,n,r){var i=e(t,n,r),a=i.dispatch;return Object.assign(i,{dispatch:function(o){return ye[he].analytics.push(o.action||o),a(o)}})}}}function Wt(e){return function(){return Ie(Ie.apply(null,arguments),Gt())}}function ct(e){return e?kn(e)?e:[e]:[]}function Xt(e,t,n){e===void 0&&(e={});var r,i,a=Je();return t&&(Te[a]=(r=t,i=function(o){for(var s,p=o||Array.prototype.slice.call(arguments),g=0;g<p.length;g++)if(Q(p[g])){s=p[g];break}return s}(n),function(o){i&&i(o),r(o)})),m({},e,{rid:a,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function ar(e){e===void 0&&(e={});var t=e.reducers||{},n=e.initialUser||{},r=(e.plugins||[]).reduce(function(c,u){if(Q(u))return c.middlewares=c.middlewares.concat(u),c;if(u.NAMESPACE&&(u.name=u.NAMESPACE),!u.name)throw new Error("https://lytics.dev/errors/1");var f=u.EVENTS?Object.keys(u.EVENTS).map(function(w){return u.EVENTS[w]}):[];c.pluginEnabled[u.name]=!(u.enabled===!1||u.config&&u.config.enabled===!1),delete u.enabled,u.methods&&(c.methods[u.name]=Object.keys(u.methods).reduce(function(w,C){var k;return w[C]=(k=u.methods[C],function(){for(var D=Array.prototype.slice.call(arguments),_=new Array(k.length),Y=0;Y<D.length;Y++)_[Y]=D[Y];return _[_.length]=l,k.apply({instance:l},_)}),w},{}),delete u.methods);var P=Object.keys(u).concat(f),O=new Set(c.events.concat(P));if(c.events=Array.from(O),c.pluginsArray=c.pluginsArray.concat(u),c.plugins[u.name])throw new Error(u.name+"AlreadyLoaded");return c.plugins[u.name]=u,c.plugins[u.name].loaded||(c.plugins[u.name].loaded=function(){return!0}),c},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:ce,setItem:se,removeItem:be},a=function(c){return function(u,f,P){return f.getState("user")[u]||(P&&J(P)&&P[u]?P[u]:Et(c)[u]||ce(it(u))||null)}}(i),o=r.plugins,s=r.events.filter(function(c){return!rt.includes(c)}).sort(),p=new Set(s.concat(Ge).filter(function(c){return!rt.includes(c)})),g=Array.from(p).sort(),x=function(){return o},d=new Fn,N=d.addMiddleware,h=d.removeMiddleware,A=d.dynamicMiddlewares,I=function(){throw new Error("Abort disabled inListener")},y=zn(),E=Et(i),j=m({},E,n,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});j.anonymousId||(j.anonymousId=Je());var M=m({enable:function(c,u){return new Promise(function(f){S.dispatch({type:v.enablePlugin,plugins:ct(c),_:{originalAction:v.enablePlugin}},f,[u])})},disable:function(c,u){return new Promise(function(f){S.dispatch({type:v.disablePlugin,plugins:ct(c),_:{originalAction:v.disablePlugin}},f,[u])})}},r.methods),l={identify:function(c,u,f,P){try{var O=me(c)?c:null,w=J(c)?c:u,C=f||{},k=l.user();se(it(oe),O);var D=O||w.userId||a(oe,l,w);return Promise.resolve(new Promise(function(_){S.dispatch(m({type:v.identifyStart,userId:D,traits:w||{},options:C,anonymousId:k.anonymousId},k.id&&k.id!==O&&{previousId:k.id}),_,[u,f,P])}))}catch(_){return Promise.reject(_)}},track:function(c,u,f,P){try{var O=J(c)?c.event:c;if(!O||!me(O))throw new Error("EventMissing");var w=J(c)?c:u||{},C=J(f)?f:{};return Promise.resolve(new Promise(function(k){S.dispatch({type:v.trackStart,event:O,properties:w,options:C,userId:a(oe,l,u),anonymousId:a(Pe,l,u)},k,[u,f,P])}))}catch(k){return Promise.reject(k)}},page:function(c,u,f){try{var P=J(c)?c:{},O=J(u)?u:{};return Promise.resolve(new Promise(function(w){S.dispatch({type:v.pageStart,properties:Yn(P),options:O,userId:a(oe,l,P),anonymousId:a(Pe,l,P)},w,[c,u,f])}))}catch(w){return Promise.reject(w)}},user:function(c){if(c===oe||c==="id")return a(oe,l);if(c===Pe||c==="anonId")return a(Pe,l);var u=l.getState("user");return c?De(u,c):u},reset:function(c){return new Promise(function(u){S.dispatch({type:v.resetStart},u,c)})},ready:function(c){return l.on(v.ready,c)},on:function(c,u){if(!c||!Q(u))return!1;if(c===v.bootstrap)throw new Error(".on disabled for "+c);var f=/Start$|Start:/;if(c==="*"){var P=function(k){return function(D){return function(_){return _.type.match(f)&&u({payload:_,instance:l,plugins:o}),D(_)}}},O=function(k){return function(D){return function(_){return _.type.match(f)||u({payload:_,instance:l,plugins:o}),D(_)}}};return N(P,We),N(O,Xe),function(){h(P,We),h(O,Xe)}}var w=c.match(f)?We:Xe,C=function(k){return function(D){return function(_){return _.type===c&&u({payload:_,instance:l,plugins:o,abort:I}),D(_)}}};return N(C,w),function(){return h(C,w)}},once:function(c,u){if(!c||!Q(u))return!1;if(c===v.bootstrap)throw new Error(".once disabled for "+c);var f=l.on(c,function(P){u({payload:P.payload,instance:l,plugins:o,abort:I}),f()});return f},getState:function(c){var u=S.getState();return c?De(u,c):Object.assign({},u)},dispatch:function(c){var u=me(c)?{type:c}:c;if(Ge.includes(u.type))throw new Error("reserved action "+u.type);var f=m({},u,{_:m({originalAction:u.type},c._||{})});S.dispatch(f)},enablePlugin:M.enable,disablePlugin:M.disable,plugins:M,storage:{getItem:i.getItem,setItem:function(c,u,f){S.dispatch({type:v.setItemStart,key:c,value:u,options:f})},removeItem:function(c,u){S.dispatch({type:v.removeItemStart,key:c,options:u})}},setAnonymousId:function(c,u){l.storage.setItem(ae,c,u)},events:{core:Ge,plugins:s}},b=r.middlewares.concat([function(c){return function(u){return function(f){return f.meta||(f.meta=Xt()),u(f)}}},A(We),Vn(l,x,{all:g,plugins:s}),Jn(i),Rn(l),Cn(l),A(Xe)]),$={context:tr,user:qn(i),page:er,track:Wn,plugins:Hn(x),queue:Qn},z=Ie,L=Ie;if(R&&e.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(z=B({trace:!0,traceLimit:25})),L=function(){return arguments.length===0?Gt():J(typeof arguments[0])?Wt():Wt().apply(null,arguments)}}var U,F=function(c){return Object.keys(c).reduce(function(u,f){return nr.includes(f)||(u[f]=c[f]),u},{})}(e),q=r.pluginsArray.reduce(function(c,u){var f=u.name,P=u.config,O=u.loaded,w=r.pluginEnabled[f];return c[f]={enabled:w,initialized:!!w&&Boolean(!u.initialize),loaded:Boolean(O()),config:P||{}},c},{}),H={context:F,user:j,plugins:q},S=St(function(c){for(var u=Object.keys(c),f={},P=0;P<u.length;P++){var O=u[P];typeof c[O]===ie&&(f[O]=c[O])}var w,C=Object.keys(f);try{(function(k){Object.keys(k).forEach(function(D){var _=k[D];if(typeof _(void 0,{type:"@@redux/INIT"})===te||typeof _(void 0,{type:$n})===te)throw new Error("reducer "+D+" "+te)})})(f)}catch(k){w=k}return function(k,D){if(k===void 0&&(k={}),w)throw w;for(var _=!1,Y={},Ee=0;Ee<C.length;Ee++){var ke=C[Ee],In=k[ke],ht=(0,f[ke])(In,D);if(typeof ht===te){var Rr=Un(ke,D);throw new Error(Rr)}Y[ke]=ht,_=_||ht!==In}return _?Y:k}}(m({},$,t)),H,L(z(Dn.apply(void 0,b))));S.dispatch=(U=S.dispatch,function(c,u,f){var P=m({},c,{meta:Xt(c.meta,u,ct(f))});return U.apply(null,[P])});var T=Object.keys(o);S.dispatch({type:v.bootstrap,plugins:T,config:F,params:y,user:j,initialUser:n,persistedUser:E});var X=T.filter(function(c){return r.pluginEnabled[c]}),V=T.filter(function(c){return!r.pluginEnabled[c]});return S.dispatch({type:v.registerPlugins,plugins:T,enabled:r.pluginEnabled}),r.pluginsArray.map(function(c,u){var f=c.bootstrap,P=c.config,O=c.name;f&&Q(f)&&f({instance:l,config:P,payload:c}),S.dispatch({type:v.registerPluginType(O),name:O,enabled:r.pluginEnabled[O],plugin:c}),r.pluginsArray.length===u+1&&S.dispatch({type:v.initializeStart,plugins:X,disabled:V})}),ir(function(c){S.dispatch({type:c?v.offline:v.online})}),function(c,u,f){setInterval(function(){return Nt(c,u,f)},3e3)}(S,x,l),l}var We="before",Xe="after",Me="cookie",fe=Yt(),Qt=Qe,or=Qe;function Kt(e){return fe?Qe(e,"",-1):be(e)}function Yt(){if(fe!==void 0)return fe;var e="cookiecookie";try{Qe(e,e),fe=document.cookie.indexOf(e)!==-1,Kt(e)}catch(t){fe=!1}return fe}function Qe(e,t,n,r,i,a){if(typeof window!="undefined"){var o=arguments.length>1;return fe===!1&&(o?se(e,t):ce(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var ze="localStorage",ur=nt.bind(null,"localStorage");we("localStorage","getItem",ce),we("localStorage","setItem",se),we("localStorage","removeItem",be);var Le="sessionStorage",cr=nt.bind(null,"sessionStorage");we("sessionStorage","getItem",ce),we("sessionStorage","setItem",se),we("sessionStorage","removeItem",be);function Oe(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(J(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(n){}if(t!==null&&t!=="")return t}var sr=ur(),lr=cr(),fr=Yt();function Zt(e,t){if(e){var n=st(t),r=!pt(n),i=lt(n)?Oe(localStorage.getItem(e)):void 0;if(r&&!ve(i))return i;var a=ft(n)?Oe(Qt(e)):void 0;if(r&&a)return a;var o=dt(n)?Oe(sessionStorage.getItem(e)):void 0;if(r&&o)return o;var s=ce(e);return r?s:{localStorage:i,sessionStorage:o,cookie:a,global:s}}}function dr(e,t,n){if(e&&!ve(t)){var r={},i=st(n),a=JSON.stringify(t),o=!pt(i);return lt(i)&&(r[ze]=Ye(ze,t,Oe(localStorage.getItem(e))),localStorage.setItem(e,a),o)?r[ze]:ft(i)&&(r[Me]=Ye(Me,t,Oe(Qt(e))),or(e,a),o)?r[Me]:dt(i)&&(r[Le]=Ye(Le,t,Oe(sessionStorage.getItem(e))),sessionStorage.setItem(e,a),o)?r[Le]:(r[je]=Ye(je,t,ce(e)),se(e,t),o?r[je]:r)}}function pr(e,t){if(e){var n=st(t),r=Zt(e,qe),i={};return!ve(r.localStorage)&<(n)&&(localStorage.removeItem(e),i[ze]=r.localStorage),!ve(r.cookie)&&ft(n)&&(Kt(e),i[Me]=r.cookie),!ve(r.sessionStorage)&&dt(n)&&(sessionStorage.removeItem(e),i[Le]=r.sessionStorage),!ve(r.global)&&Ke(n,je)&&(be(e),i[je]=r.global),i}}function st(e){return e?me(e)?e:e.storage:_e}function lt(e){return sr&&Ke(e,ze)}function ft(e){return fr&&Ke(e,Me)}function dt(e){return lr&&Ke(e,Le)}function pt(e){return e===qe||e==="all"}function Ke(e,t){return e===_e||e===t||pt(e)}function Ye(e,t,n){return{location:e,current:t,previous:n}}var gr={setItem:dr,getItem:Zt,removeItem:pr};function mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?en(Object(n),!0).forEach(function(r){mr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:gr};return ar(tn(tn({},t),e))}function vr(e,t,n,r,i,a,o){e.fbq||(i=e.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},e._fbq||(e._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],a=t.createElement(n),a.async=!0,a.src=r,o=t.getElementsByTagName(n)[0],o.parentNode.insertBefore(a,o))}function hr({trackingId:e}){vr(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),window.fbq("init",e)}function yr(e={}){return{name:"facebook",config:e,initialize:function({config:t,instance:n}){if(!t.trackingId)throw new Error("No Facebook trackingId defined");hr({trackingId:t.trackingId})},page:function({payload:t,config:n,instance:r}){window.fbq("track","PageView")},track:function({payload:t,config:n,instance:r}){window.fbq("track",t.event,t.properties)},identify:function({payload:t,config:n}){},loaded:function(){return!!window.fbq}}}function $e(){window.dataLayer.push(arguments)}window.gtag=$e;function br({trackingId:e,configParams:t={},setParams:n={}}){var r="ga-gtag";if(!document.getElementById(r)){var i=document.head,a=document.createElement("script");a.id=r,a.type="text/javascript",a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id="+e,i.insertBefore(a,i.firstChild),window.dataLayer=window.dataLayer||[],$e("js",new Date),n&&$e("set",n),$e("config",e,t)}}function wr(e={}){return{name:"google-analytics-4",config:e,initialize:function({config:t,instance:n}){if(!t.trackingId)throw new Error("No GA trackingId defined");var r={},i={};if(t.customDimensions){for(var a={},o=0;o<t.customDimensions.length;o++){var s=t.customDimensions[o];r[s.name]=s.callback(n,t),a["dimension"+(o+1)]=s.name}i.custom_map=a}br({trackingId:t.trackingId,configParams:r,setParams:i})},page:function({payload:t,config:n,instance:r}){},track:function({payload:t,config:n,instance:r}){$e("event",t.event,t.properties)},identify:function({payload:t,config:n}){},loaded:function(){return!!window.gtag}}}var Ir=new URLSearchParams(window.location.search),Sr=Ir.get("zdbg"),rn={};const Ze="undefined";function K(){Sr==1&&console.debug(...arguments)}function G(e){console.warn(e),window.Rollbar&&window.Rollbar.warning(e)}function Pr(e){return e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function)}function an(){try{var e=navigator.userAgent||"",t=new RegExp([/bot/,/spider/,/crawl/,/mediapartners/,/Google-Read-Aloud/,/semrush/].map(n=>n.source).join("|"),"i");return t.test(e)}catch(n){return!1}}function xr(e){document.readyState==="complete"||document.readyState==="loaded"||document.readyState==="interactive"?e():window.addEventListener("DOMContentLoaded",e)}var de=Or();function Or(){if(typeof de!==Ze)return de;de=!0;try{sessionStorage.setItem(Ze,Ze),sessionStorage.removeItem(Ze)}catch(e){de=!1}return de}function on(e){var t,n=rn[e];return de?(t=sessionStorage.getItem(e),!t&&n&&(t=n,sessionStorage.setItem(e,t))):t=n,t?JSON.parse(t):void 0}function Er(e,t){var n=JSON.stringify(t);de&&sessionStorage.setItem(e,n),rn[e]=n}function kr(){var e=document.createElement("div");e.innerHTML=" ",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;");try{if(document.body.appendChild(e),document.body.getAttribute("abp")!==null||e.offsetHeight===0||e.clientHeight===0)return!0;if(typeof getComputedStyle!="undefined"){var t=window.getComputedStyle(e,null);if(t&&(t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"))return!0}document.body.removeChild(e)}catch(n){}return!1}function un({method:e,url:t,data:n,json:r=!0}){return new Promise(function(i,a){var o=new XMLHttpRequest;o.open(e,t),o.withCredentials=!0,r&&(o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Content-Type","application/json")),o.onload=function(){this.status>=200&&this.status<300?i(r?JSON.parse(o.response):o.response):a({status:this.status,message:o.statusText})},o.onerror=function(){a({status:this.status,message:"Network Error"})},n?o.send(n):o.send()})}function _r(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function Nr(n){return ne(this,arguments,function*({url:e,data:t}){if(window&&window.navigator&&typeof window.navigator.sendBeacon=="function"&&typeof window.Blob=="function")try{const r=new Blob([JSON.stringify(t)],{type:"text/plain; charset=UTF-8"});return!!window.navigator.sendBeacon(e,r)}catch(r){return G("postBeacon:"),!1}return!1})}function jr(r){return ne(this,arguments,function*({url:e,params:t=null,json:n=!0}){var i=e;return t&&(i=i+_r(t)),yield un({method:"GET",url:i,json:n})})}function gt(i){return ne(this,arguments,function*({url:e,data:t,json:n=!0,beacon:r=!1}){var a=t;if(n&&(a=JSON.stringify(a)),r){var o=yield Nr({url:e,data:t});if(o)return;K("Beacon failed")}return yield un({method:"POST",url:e,data:a,json:n})})}var et="__zar_vid",cn="success",Ue="error",Tr=30*1e3,sn=0,Ar=3,W={};window.zarPoolData=null;var pe=new Map;function Mr(){return Date.now().toString(36)+"."+Math.random().toString(36).substring(2)}function zr(e,t,n,r){var i,a=!1,o=null,s=n(e);!s||!s.id?(i=t(),o=document.referrer,a=!0,K("new ID for",e,"-",i)):(i=s.id,o=s.origReferrer);var p={id:i,t:Date.now(),origReferrer:o,isNew:a};return r(e,p),p}function ln(){var e=zr(et,Mr,on,Er);return{vid:e}}function fn(){return window.location.host+"/api/v1"}function dn(e){return on(e)}function pn(e){var t=dn(e);return t?t.id:null}function tt(){return{vid:dn(et)}}function Lr(){return{vid:pn(et)}}function gn({elem:e}){var t=null,n=null,r=null,i=new RegExp("\\+?\\(?\\d*\\)? ?\\(?\\d+\\)?\\d*([\\s./-]?\\d{2,})+","g");e.href&&e.href.startsWith("tel:")&&(r=e.href);var a=e.innerText,o=e.innerHTML,s=i.exec(a);return s&&(t=s[0].trim(),n=t.replace("+","").replace(/-/g,"").replace(/ /g,"").replace("(","").replace(")","").replace(/^1/,"")),{text:a,html:o,numberText:t,href:r,number:n}}function mt({elems:e,number:t,force:n=!1}){var r,i=t;t.startsWith("+1")||(i="+1"+t);for(var a=0;a<e.length;a++){if(pe.has(e[a]))if(n)r=pe.get(e[a]);else{K("element already in overlay map:",e[a]);continue}var o=gn({elem:e[a]});if(r?!n&&o.number&&r.number&&r.number!==o.number&&G("overlaying multiple numbers with a single number",r.number,o.number):r=o,K("overlaying",i,"on",e[a]),pe.has(e[a])||pe.set(e[a],o),o.href&&(e[a].href="tel:"+i),o.numberText)if(e[a].innerHTML="",o.text){var s=i;if(o.numberText.indexOf("-")>-1&&(s=i.slice(2,5)+"-"+i.slice(5,8)+"-"+i.slice(8,12)),o.html.indexOf("<img")>-1){var p=o.html.replace(o.numberText,s);e[a].innerHTML=p}else{var g=o.text.replace(o.numberText,s);e[a].appendChild(document.createTextNode(g))}}else e[a].appendChild(document.createTextNode(i));else K("no number text found:",e[a])}}function vt({elems:e}){for(var t=0;t<e.length;t++)if(pe.has(e[t])){var n=e[t].innerHTML,r=pe.get(e[t]);K("orig:",r);var i=r.html;K("reverting",n,"to",i),e[t].innerHTML=i,r.href&&(e[t].href=r.href),pe.delete(e[t])}else K("element not in map:",e[t])}function mn(e){clearInterval(W[e]),delete W[e]}function vn(){for(var e in W)mn(e)}function hn(i){return ne(this,arguments,function*({poolId:e,apiUrl:t,number:n=null,context:r=null}){var a={pool_id:e,number:n,context:r,properties:{zar:tt()}},o=yield gt({url:`${t}/number_pool`,data:a});return o})}function $r(r){return ne(this,arguments,function*({apiUrl:e,key:t=null,with_contexts:n=!1}){var i={key:t,with_contexts:n},a=yield jr({url:`${e}/number_pool_stats`,params:i});return a})}function Ur(){return ne(this,arguments,function*({overlayElements:e,apiUrl:t=fn(),contextCallback:n=null}={}){var r={};n&&(r=n()||{});const i=window.zarPoolData.pool_id,a=window.zarPoolData.number;try{var o=yield hn({poolId:i,apiUrl:t,number:a,context:r})}catch(g){var s="error getting number: "+JSON.stringify(g);return G(s),sn++,sn>=Ar&&(G("max failures, stopping pool"),vn(),e&&vt({elems:e})),{status:Ue,msg:s}}if(o.status===cn&&o.number){var p=!1;o.number!==window.zarPoolData.number&&(G("number changed from "+window.zarPoolData.number+" to "+o.number),window.zarPoolData.number=o.number,p=!0),e&&mt({elems:e,number:o.number,force:p})}else e&&vt({elems:e}),W[i]&&(clearInterval(W[i]),delete W[i]);return o})}function yn(e){return Pr(e)?e():e}function bn(){return ne(this,arguments,function*({poolData:e,poolConfig:t,apiUrl:n}={}){var r;if(!t||!t.poolId||!t.overlayQuerySelector||!n)return r="missing pool config: "+JSON.stringify(t),G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W;var i={};t.contextCallback&&(i=t.contextCallback()||{});var a=yn(t.poolId);if(!a)return r="no pool ID",G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W;if(!e)try{e=yield hn({poolId:a,apiUrl:n,number:null,context:i})}catch(o){return r="error getting number on init: "+JSON.stringify(o),G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W}return window.zarPoolData=e,e&&e.status===cn&&e.number&&xr(function(){var o=document.querySelectorAll(t.overlayQuerySelector);if(!o){var s="No elems found for:"+t.overlayQuerySelector;G(s),t.initCallback&&t.initCallback({status:Ue,msg:s});return}mt({elems:o,number:e.number});var p=setInterval(function(){try{Ur({overlayElements:o,apiUrl:n,contextCallback:t.contextCallback})}catch(x){var g="error on interval: "+JSON.stringify(x);G(g)}},t.renewalInterval||Tr);W[e.pool_id]=p,t.initCallback&&t.initCallback(e)}),W})}function wn({apiUrl:e,poolConfig:t}){return ln(),{name:"zar",config:{apiUrl:e,poolConfig:t},initialize:function({config:n}){},loaded:function(){return!0},pageStart:function({payload:n,config:r,instance:i}){n.properties.zar=tt(),n.properties.referrer=document.referrer,n.properties.is_bot=an(),"hash"in n.properties&&delete n.properties.hash,"path"in n.properties&&delete n.properties.path,"search"in n.properties&&delete n.properties.search;try{var a=r.poolConfig;a&&a.poolId&&(n.properties.pool_id=yn(a.poolId),a.contextCallback&&(n.properties.pool_context=a.contextCallback()||{}))}catch(o){G("error getting pool id: "+JSON.stringify(o))}return n},page:function(o){return ne(this,arguments,function*({payload:n,options:r,instance:i,config:a}){K("page",n,r,a);for(var s=0,p=3,g;s<p;)try{g=yield gt({url:`${a.apiUrl}/page`,data:n});break}catch(x){if(s++,s>=p)throw G("error posting page: "+JSON.stringify(x)),x;yield new Promise(d=>setTimeout(d,1e3))}g&&g.pool_data&&bn({poolData:g.pool_data,poolConfig:a.poolConfig,apiUrl:a.apiUrl})})},trackStart:function({payload:n,config:r,instance:i}){return n.properties.zar=tt(),n.properties.url=window.location.href,n.properties.referrer=document.referrer,n},track:function({payload:n,options:r,instance:i,config:a}){K("track",n),gt({url:`${a.apiUrl}/track`,data:n,beacon:!0})},methods:{apiUrl(){return e},poolConfig(){return t},initIDs(){return ln()},getIDs(){return Lr()},getStorage(){return tt()},getVID(){return pn(et)},hasAdBlock(){return kr()},isBot(){return an()},initTrackingPool({poolConfig:n}){var r=this.instance.plugins.zar;return bn({poolData:null,poolConfig:Object.assign(r.poolConfig(),n||{}),apiUrl:r.apiUrl()})},getPoolIntervals(){return W},clearPoolInterval({poolId:n}){mn(n)},clearPoolIntervals(){vn()},extractPhoneNumbers({elems:n}){for(var r=[],i=0;i<n.length;i++){var a=gn({elem:n[i]});r.push(a)}return r},overlayPhoneNumber({overlayElements:n,number:r}){mt({elems:n,number:r})},revertOverlayNumbers({overlayElements:n}){vt({elems:n})},getPoolStats({key:n=null,with_contexts:r=!1}){return $r({apiUrl:this.instance.plugins.zar.apiUrl(),key:n,with_contexts:r})}}}}function Dr({app:e,ga4Config:t=null,facebookConfig:n=null,apiUrl:r=null,poolConfig:i=null}){r||(r=fn());var a=[wn({apiUrl:r,poolConfig:i})];return t&&a.push(wr(t)),n&&a.push(yr(n)),nn({app:e,plugins:a})}return ue.Analytics=nn,ue.init=Dr,ue.zar=wn,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ue}({});
|
|
3
3
|
//# sourceMappingURL=zar.iife.js.map
|