zar 0.2.0 → 0.4.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 +156 -34
- 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 Z=(ue,Ce,ee)=>new Promise((Re,_e)=>{var qe=C=>{try{ne(ee.next(C))}catch(ge){_e(ge)}},te=C=>{try{ne(ee.throw(C))}catch(ge){_e(ge)}},ne=C=>C.done?Re(C.value):Promise.resolve(C.value).then(qe,te);ne((ee=ee.apply(ue,Ce)).next())});var zar=function(ue){"use strict";function Ce(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 ee="undefined",Re="object",_e="any",qe="*",te="__",ne=typeof process!="undefined"?process:{};ne.env&&ne.env.NODE_ENV;var C=typeof window!="undefined";ne.versions!=null&&ne.versions.node!=null,typeof Deno!="undefined"&&Deno.core,C&&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 xr=ge.bind(null,"toUpperCase"),Or=ge.bind(null,"toLowerCase");function Er(e){return It(e)?xr("null"):typeof e=="object"?zr(e):Object.prototype.toString.call(e).slice(8,-1)}function Be(e,t){t===void 0&&(t=!0);var r=Er(e);return t?Or(r):r}function Ne(e,t){return typeof t===e}var Q=Ne.bind(null,"function"),ve=Ne.bind(null,"string"),me=Ne.bind(null,"undefined"),kr=Ne.bind(null,"boolean");Ne.bind(null,"symbol");function It(e){return e===null}function _r(e){return Be(e)==="number"&&!isNaN(e)}function Nr(e){return Be(e)==="array"}function F(e){if(!jr(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function jr(e){return e&&(typeof e=="object"||e!==null)}function zr(e){return Q(e.constructor)?e.constructor.name:null}function Tr(e){return e instanceof Error||ve(e.message)&&e.constructor&&_r(e.constructor.stackTraceLimit)}function Pt(e,t){if(typeof t!="object"||It(t))return!1;if(t instanceof e)return!0;var r=Be(new e(""));if(Tr(t))for(;t;){if(Be(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Pt.bind(null,TypeError),Pt.bind(null,SyntaxError);function Ve(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?Ar(e,t):r}function Ar(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Je(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Je(Ve,"form"),Je(Ve,"button"),Je(Ve,"input"),Je(Ve,"select");function St(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function Dr(){if(C){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function Lr(){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=St(r[1]),o=St(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&&($r(n,p.map(function(g){return g.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 C&&window.location.search.substring(1)}(e))}function $r(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 Fe(){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 je="global",he=te+"global"+te,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,r){var n;try{if(it(e)){var i=window[e];n=i[t].bind(i)}}catch(a){}return n||r}ye[he]||(ye[he]={});var He={};function it(e){if(typeof He[e]!==ee)return He[e];try{var t=window[e];t.setItem(ee,ee),t.removeItem(ee)}catch(r){return He[e]=!1}return He[e]=!0}function v(){return v=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},v.apply(this,arguments)}var ie="function",re="undefined",Ur="@@redux/"+Math.random().toString(36),xt=function(){return typeof Symbol===ie&&Symbol.observable||"@@observable"}(),Ge=" != "+ie;function Ot(e,t,r){var n;if(typeof t===ie&&typeof r===re&&(r=t,t=void 0),typeof r!==re){if(typeof r!==ie)throw new Error("enhancer"+Ge);return r(Ot)(e,t)}if(typeof e!==ie)throw new Error("reducer"+Ge);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"+Ge);var T=!0;return g(),s.push(h),function(){if(T){T=!1,g();var I=s.indexOf(h);s.splice(I,1)}}}function N(h){if(!F(h))throw new Error("Act != obj");if(typeof h.type===re)throw new Error("ActType "+re);if(p)throw new Error("Dispatch in reducer");try{p=!0,a=i(a,h)}finally{p=!1}for(var T=o=s,I=0;I<T.length;I++)(0,T[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"+Ge);i=h,N({type:"@@redux/INIT"})}})[xt]=function(){var h,T=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:T(y)}}})[xt]=function(){return this},h},n}function Cr(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+re}function Ie(){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 Rr(){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(g){return s(g)}};return a=[].slice.call(e).map(function(g){return g(p)}),v({},o,{dispatch:s=Ie.apply(void 0,a)(o.dispatch)})}}}var ae=te+"anon_id",le=te+"user_id",Pe=te+"user_traits",oe="userId",Se="anonymousId",We=["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"],at=["name","EVENTS","config","loaded"],m=We.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Et=/^utm_/,kt=/^an_prop_/,_t=/^an_trait_/;function qr(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,g=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(ae,o.anonymousId),g||t(le,o.userId),p.traits&&t(Pe,v({},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(T,I){if(I.match(Et)||I.match(/^(d|g)clid/)){var y=I.replace(Et,"");T.campaign[y==="campaign"?"name":y]=a[I]}return I.match(kt)&&(T.props[I.replace(kt,"")]=a[I]),I.match(_t)&&(T.traits[I.replace(_t,"")]=a[I]),T},{campaign:{},props:{},traits:{}});r.dispatch(v({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 Br(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===m.setItemEnd){if(r.key===ae)return v({},t,{anonymousId:r.value});if(r.key===le)return v({},t,{userId:r.value})}switch(r.type){case m.identify:return Object.assign({},t,{userId:r.userId,traits:v({},t.traits,r.traits)});case m.reset:return[le,ae,Pe].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Nt(e){return{userId:e.getItem(le),anonymousId:e.getItem(ae),traits:e.getItem(Pe)}}var ot=function(e){return te+"TEMP"+te+e};function Vr(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,g=s.traits,x=s.options;if(s.type===m.reset&&([le,Pe,ae].forEach(function(h){n(h)}),[oe,Se,"traits"].forEach(function(h){be(ot(h))})),s.type===m.identify){i(ae)||r(ae,Fe());var d=i(le),N=i(Pe)||{};d&&d!==p&&a.dispatch({type:m.userIdChanged,old:{userId:d,traits:N},new:{userId:p,traits:g},options:x}),p&&r(le,p),g&&r(Pe,v({},N,g))}return o(s)}}}}var ze={};function jt(e,t){ze[e]&&Q(ze[e])&&(ze[e](t),delete ze[e])}function zt(e,t,r){return new Promise(function(n,i){return t()?n(e):r<1?i(v({},e,{queue:!0})):new Promise(function(a){return setTimeout(a,10)}).then(function(a){return zt(e,t,r-10).then(n,i)})})}function Tt(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,T=n[N][h];if(T&&Q(T)){var I=function(E,j){return E===void 0&&(E={}),j===void 0&&(j={}),[oe,Se].reduce(function(A,l){return E.hasOwnProperty(l)&&j[l]&&j[l]!==E[l]&&(A[l]=j[l]),A},E)}(d.payload,s);T({payload:I,config:a[N].config,instance:r});var y=h+":"+N;e.dispatch(v({},I,{type:y,_:{called:y,from:"queueDrain"}}))}});var g=o.actions.filter(function(x,d){return!~p.processIndex.indexOf(d)});o.actions=g}}}var ut=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 g=i.plugins,x=i.context,d=r.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 T=function(y,E){return function(j,A,l){var b=A.config,M=A.name,D=M+"."+j.type;l&&(D=l.event);var L=j.type.match(xe)?function(B,$,H,R,G){return function(P,z){var X=R?R.name:B,J=z&&Te(z)?z:H;if(R&&(!(J=z&&Te(z)?z:[B]).includes(B)||J.length!==1))throw new Error("Method "+$+" can only abort "+B+" plugin. "+JSON.stringify(J)+" input valid");return v({},G,{abort:{reason:P,plugins:J,caller:$,_:X}})}}(M,D,E,l,j):function(B,$){return function(){throw new Error(B.type+" action not cancellable. Remove abort in "+$)}}(j,D);return{payload:Jr(j),instance:y,config:b||{},abort:L}}}(n,h),I=t.exact.reduce(function(y,E){var j=E.pluginName,A=E.methodName,l=!1;return A.match(/^initialize/)||A.match(/^reset/)||(l=!g[j].loaded),x.offline&&A.match(/^(page|track|identify)/)&&(l=!0),y[""+j]=l,y},{});return Promise.resolve(t.exact.reduce(function(y,E,j){var A=E.pluginName;return Promise.resolve(y).then(function(l){function b(){return Promise.resolve(l)}var M=function(){if(t.namespaced&&t.namespaced[A])return Promise.resolve(t.namespaced[A].reduce(function(D,L,B){return Promise.resolve(D).then(function($){return L.method&&Q(L.method)?(function(P,z){var X=Rt(P);if(X&&X.name===z){var J=Rt(X.method);throw new Error([z+" plugin is calling method "+P,"Plugins cant call self","Use "+X.method+" "+(J?"or "+J.method:"")+" in "+z+" plugin insteadof "+P].join(`
|
|
2
|
+
`))}}(L.methodName,L.pluginName),Promise.resolve(L.method({payload:$,instance:n,abort:(H=$,R=A,G=L.pluginName,function(P,z){return v({},H,{abort:{reason:P,plugins:z||[R],caller:d,from:G||R}})}),config:Lt(L.pluginName,g,a),plugins:g})).then(function(P){var z=F(P)?P:{};return Promise.resolve(v({},$,z))})):$;var H,R,G})},Promise.resolve(r))).then(function(D){l[A]=D});l[A]=r}();return M&&M.then?M.then(b):b()})},Promise.resolve({}))).then(function(y){return Promise.resolve(t.exact.reduce(function(E,j,A){try{var l=t.exact.length===A+1,b=j.pluginName,M=a[b];return Promise.resolve(E).then(function(D){var L=y[b]?y[b]:{};if(N&&(L=D),st(L,b))return ct({data:L,method:d,instance:n,pluginName:b,store:s}),Promise.resolve(D);if(st(D,b))return l&&ct({data:D,method:d,instance:n,store:s}),Promise.resolve(D);if(I.hasOwnProperty(b)&&I[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(D);var B=T(y[b],a[b]);return Promise.resolve(M[d]({abort:B.abort,payload:L,instance:n,config:Lt(b,g,a),plugins:g})).then(function($){var H=F($)?$:{},R=v({},D,H),G=y[b];if(st(G,b))ct({data:G,method:d,instance:n,pluginName:b,store:s});else{var P=d+":"+b;(P.match(/:/g)||[]).length<2&&!d.match(At)&&!d.match(Dt)&&n.dispatch(v({},N?R:L,{type:P,_:{called:P,from:"submethod"}}))}return Promise.resolve(R)})})}catch(D){return Promise.reject(D)}},Promise.resolve(r))).then(function(E){if(!(d.match(xe)||d.match(/^registerPlugin/)||d.match(Dt)||d.match(At)||d.match(/^params/)||d.match(/^userIdChanged/))){if(p.plugins.includes(d),E._&&E._.originalAction===d)return E;var j=v({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Ut(E,t.exact.length)&&!d.match(/End$/)&&(j=v({},j,{type:E.type+"Aborted"})),s.dispatch(j)}return E})})}catch(y){return Promise.reject(y)}},xe=/Start$/,At=/^bootstrap/,Dt=/^ready/;function ct(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(v({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Lt(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 $t(e,t){var r=e.replace(xe,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function st(e,t){var r=e.abort;return!!r&&(r===!0||Ct(r,t)||r&&Ct(r.plugins,t))}function Ut(e,t){var r=e.abort;if(!r)return!1;if(r===!0||ve(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 Ct(e,t){return!(!e||!Te(e))&&e.includes(t)}function Rt(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function Jr(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=F(e[r])?Object.assign({},e[r]):e[r]),t},{})}function Fr(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)},g=o.type,x=o.plugins,d=o;if(o.abort)return Promise.resolve(a(o));if(g===m.enablePlugin&&i.dispatch({type:m.initializeStart,plugins:x,disabled:[],fromEnable:!0,meta:o.meta}),g===m.disablePlugin&&setTimeout(function(){return jt(o.meta.rid,{payload:o})},0),g===m.initializeEnd){var N=t(),h=Object.keys(N),T=h.filter(function(l){return x.includes(l)}).map(function(l){return N[l]}),I=[],y=[],E=o.disabled,j=T.map(function(l){var b=l.name;return zt(l,l.loaded,1e4).then(function(M){return n[b]||(i.dispatch({type:m.pluginReadyType(b),name:b,events:Object.keys(l).filter(function(D){return!at.includes(D)})}),n[b]=!0),I=I.concat(b),l}).catch(function(M){if(M instanceof Error)throw new Error(M);return y=y.concat(M.name),M})});Promise.all(j).then(function(l){var b={plugins:I,failed:y,disabled:E};setTimeout(function(){h.length===j.length+E.length&&i.dispatch(v({},{type:m.ready},b))},0)})}var A=function(){if(g!==m.bootstrap)return/^ready:([^:]*)$/.test(g)&&setTimeout(function(){return Tt(i,t,e)},0),Promise.resolve(function(l,b,M,D,L){try{var B=Q(b)?b():b,$=l.type,H=$.replace(xe,"");if(l._&&l._.called)return Promise.resolve(l);var R=M.getState(),G=(X=B,(J=R.plugins)===void 0&&(J={}),(c=l.options)===void 0&&(c={}),Object.keys(X).filter(function(u){var f=c.plugins||{};return kr(f[u])?f[u]:f.all!==!1&&(!J[u]||J[u].enabled!==!1)}).map(function(u){return X[u]}));$===m.initializeStart&&l.fromEnable&&(G=Object.keys(R.plugins).filter(function(u){var f=R.plugins[u];return l.plugins.includes(u)&&!f.initialized}).map(function(u){return B[u]}));var P=G.map(function(u){return u.name}),z=function(u,f,S){var O=$t(u).map(function(w){return Mt(w,f)});return f.reduce(function(w,q){var k=q.name,U=$t(u,k).map(function(ke){return Mt(ke,f)}),_=U[0],Y=U[1],Ee=U[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:{}})}($,G);return Promise.resolve(ut({action:l,data:{exact:z.before,namespaced:z.beforeNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(u){function f(){var w=function(){if($.match(xe))return Promise.resolve(ut({action:v({},S,{type:H+"End"}),data:{exact:z.after,namespaced:z.afterNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(q){q.meta&&q.meta.hasCallback&&jt(q.meta.rid,{payload:q})})}();return w&&w.then?w.then(function(){return u}):u}if(Ut(u,P.length))return u;var S,O=function(){if($!==H)return Promise.resolve(ut({action:v({},u,{type:H}),data:{exact:z.during,namespaced:z.duringNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(w){S=w});S=u}();return O&&O.then?O.then(f):f()})}catch(u){return Promise.reject(u)}var X,J,c}(o,t,e,i,r)).then(function(l){var b=a(l);return s=1,b})}();return Promise.resolve(A&&A.then?A.then(p):p(A))}catch(l){return Promise.reject(l)}}}}}function Hr(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 Gr=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 Ie.apply(void 0,o)(n)(i)}}}}};function Wr(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=qt(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||{}},v({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var s=qt(r.type,m.initialize),p=e()[s];return p&&s?(n[s]=v({},t[s],{initialized:!0,loaded:Boolean(p.loaded())}),v({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=v({},t[r.name],{loaded:!0}),v({},t,n);switch(r.type){case m.disablePlugin:return v({},t,Bt(r.plugins,!1,t));case m.enablePlugin:return v({},t,Bt(r.plugins,!0,t));default:return t}}}function qt(e,t){return e.substring(t.length+1,e.length)}function Bt(e,t,r){return e.reduce(function(n,i){return n[i]=v({},r[i],{enabled:t}),n},r)}function Vt(e){try{return JSON.parse(JSON.stringify(e))}catch(t){}return e}var Xr={last:{},history:[]};function Qr(e,t){e===void 0&&(e=Xr);var r=t.options,n=t.meta;if(t.type===m.track){var i=Vt(v({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return v({},e,{last:i,history:e.history.concat(i)})}return e}var Kr={actions:[]};function Yr(e,t){e===void 0&&(e=Kr);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),v({},e,{actions:n});case"dequeue":return[];default:return e}}var Jt=/#.*$/;function Zr(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Jt,""):"")}var Ft,Ht,Gt,Wt,en=function(e){if(e===void 0&&(e={}),!C)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,g=a.search,x=function(N){var h=function(){if(C){for(var T,I=document.getElementsByTagName("link"),y=0;T=I[y];y++)if(T.getAttribute("rel")==="canonical")return T.getAttribute("href")}}();return h?h.match(/\?/)?h:h+N:window.location.href.replace(Jt,"")}(g),d={title:r,url:x,path:Zr(x),hash:p,search:g,width:o,height:s};return n&&n!==""&&(d.referrer=n),v({},d,e)},tn={last:{},history:[]};function rn(e,t){e===void 0&&(e=tn);var r=t.options;if(t.type===m.page){var n=Vt(v({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return v({},e,{last:n,history:e.history.concat(n)})}return e}Ft=function(){if(!C)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"}(),Ht=C?document.referrer:null,Gt=Dr(),Wt=Lr();var Xt={initialized:!1,sessionId:Fe(),app:null,version:null,debug:!1,offline:!!C&&!navigator.onLine,os:{name:Ft},userAgent:C?navigator.userAgent:"node",library:{name:"analytics",version:"0.11.0"},timezone:Wt,locale:Gt,campaign:{},referrer:Ht};function nn(e,t){e===void 0&&(e=Xt);var r=e.initialized,n=t.campaign;switch(t.type){case m.campaign:return v({},e,{campaign:n});case m.offline:return v({},e,{offline:!0});case m.online:return v({},e,{offline:!1});default:return r?e:v({},Xt,e,{initialized:!0})}}var an=["plugins","reducers","storage"];function on(e,t,r){if(C){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){n(i,t)})}}function un(e){var t=on.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Qt(){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 ye[he].analytics.push(o.action||o),a(o)}})}}}function Kt(e){return function(){return Ie(Ie.apply(null,arguments),Qt())}}function lt(e){return e?Nr(e)?e:[e]:[]}function Yt(e,t,r){e===void 0&&(e={});var n,i,a=Fe();return t&&(ze[a]=(n=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}(r),function(o){i&&i(o),n(o)})),v({},e,{rid:a,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function cn(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,q){var k;return w[q]=(k=u.methods[q],function(){for(var U=Array.prototype.slice.call(arguments),_=new Array(k.length),Y=0;Y<U.length;Y++)_[Y]=U[Y];return _[_.length]=l,k.apply({instance:l},_)}),w},{}),delete u.methods);var S=Object.keys(u).concat(f),O=new Set(c.events.concat(S));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,S){return f.getState("user")[u]||(S&&F(S)&&S[u]?S[u]:Nt(c)[u]||ce(ot(u))||null)}}(i),o=n.plugins,s=n.events.filter(function(c){return!at.includes(c)}).sort(),p=new Set(s.concat(We).filter(function(c){return!at.includes(c)})),g=Array.from(p).sort(),x=function(){return o},d=new Gr,N=d.addMiddleware,h=d.removeMiddleware,T=d.dynamicMiddlewares,I=function(){throw new Error("Abort disabled inListener")},y=Mr(),E=Nt(i),j=v({},E,r,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});j.anonymousId||(j.anonymousId=Fe());var A=v({enable:function(c,u){return new Promise(function(f){P.dispatch({type:m.enablePlugin,plugins:lt(c),_:{originalAction:m.enablePlugin}},f,[u])})},disable:function(c,u){return new Promise(function(f){P.dispatch({type:m.disablePlugin,plugins:lt(c),_:{originalAction:m.disablePlugin}},f,[u])})}},n.methods),l={identify:function(c,u,f,S){try{var O=ve(c)?c:null,w=F(c)?c:u,q=f||{},k=l.user();se(ot(oe),O);var U=O||w.userId||a(oe,l,w);return Promise.resolve(new Promise(function(_){P.dispatch(v({type:m.identifyStart,userId:U,traits:w||{},options:q,anonymousId:k.anonymousId},k.id&&k.id!==O&&{previousId:k.id}),_,[u,f,S])}))}catch(_){return Promise.reject(_)}},track:function(c,u,f,S){try{var O=F(c)?c.event:c;if(!O||!ve(O))throw new Error("EventMissing");var w=F(c)?c:u||{},q=F(f)?f:{};return Promise.resolve(new Promise(function(k){P.dispatch({type:m.trackStart,event:O,properties:w,options:q,userId:a(oe,l,u),anonymousId:a(Se,l,u)},k,[u,f,S])}))}catch(k){return Promise.reject(k)}},page:function(c,u,f){try{var S=F(c)?c:{},O=F(u)?u:{};return Promise.resolve(new Promise(function(w){P.dispatch({type:m.pageStart,properties:en(S),options:O,userId:a(oe,l,S),anonymousId:a(Se,l,S)},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?Ce(u,c):u},reset:function(c){return new Promise(function(u){P.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 S=function(k){return function(U){return function(_){return _.type.match(f)&&u({payload:_,instance:l,plugins:o}),U(_)}}},O=function(k){return function(U){return function(_){return _.type.match(f)||u({payload:_,instance:l,plugins:o}),U(_)}}};return N(S,Xe),N(O,Qe),function(){h(S,Xe),h(O,Qe)}}var w=c.match(f)?Xe:Qe,q=function(k){return function(U){return function(_){return _.type===c&&u({payload:_,instance:l,plugins:o,abort:I}),U(_)}}};return N(q,w),function(){return h(q,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(S){u({payload:S.payload,instance:l,plugins:o,abort:I}),f()});return f},getState:function(c){var u=P.getState();return c?Ce(u,c):Object.assign({},u)},dispatch:function(c){var u=ve(c)?{type:c}:c;if(We.includes(u.type))throw new Error("reserved action "+u.type);var f=v({},u,{_:v({originalAction:u.type},c._||{})});P.dispatch(f)},enablePlugin:A.enable,disablePlugin:A.disable,plugins:A,storage:{getItem:i.getItem,setItem:function(c,u,f){P.dispatch({type:m.setItemStart,key:c,value:u,options:f})},removeItem:function(c,u){P.dispatch({type:m.removeItemStart,key:c,options:u})}},setAnonymousId:function(c,u){l.storage.setItem(ae,c,u)},events:{core:We,plugins:s}},b=n.middlewares.concat([function(c){return function(u){return function(f){return f.meta||(f.meta=Yt()),u(f)}}},T(Xe),Fr(l,x,{all:g,plugins:s}),Hr(i),qr(l),Vr(l),T(Qe)]),M={context:nn,user:Br(i),page:rn,track:Qr,plugins:Wr(x),queue:Yr},D=Ie,L=Ie;if(C&&e.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(D=B({trace:!0,traceLimit:25})),L=function(){return arguments.length===0?Qt():F(typeof arguments[0])?Kt():Kt().apply(null,arguments)}}var $,H=function(c){return Object.keys(c).reduce(function(u,f){return an.includes(f)||(u[f]=c[f]),u},{})}(e),R=n.pluginsArray.reduce(function(c,u){var f=u.name,S=u.config,O=u.loaded,w=n.pluginEnabled[f];return c[f]={enabled:w,initialized:!!w&&Boolean(!u.initialize),loaded:Boolean(O()),config:S||{}},c},{}),G={context:H,user:j,plugins:R},P=Ot(function(c){for(var u=Object.keys(c),f={},S=0;S<u.length;S++){var O=u[S];typeof c[O]===ie&&(f[O]=c[O])}var w,q=Object.keys(f);try{(function(k){Object.keys(k).forEach(function(U){var _=k[U];if(typeof _(void 0,{type:"@@redux/INIT"})===re||typeof _(void 0,{type:Ur})===re)throw new Error("reducer "+U+" "+re)})})(f)}catch(k){w=k}return function(k,U){if(k===void 0&&(k={}),w)throw w;for(var _=!1,Y={},Ee=0;Ee<q.length;Ee++){var ke=q[Ee],Sr=k[ke],wt=(0,f[ke])(Sr,U);if(typeof wt===re){var Vn=Cr(ke,U);throw new Error(Vn)}Y[ke]=wt,_=_||wt!==Sr}return _?Y:k}}(v({},M,t)),G,L(D(Rr.apply(void 0,b))));P.dispatch=($=P.dispatch,function(c,u,f){var S=v({},c,{meta:Yt(c.meta,u,lt(f))});return $.apply(null,[S])});var z=Object.keys(o);P.dispatch({type:m.bootstrap,plugins:z,config:H,params:y,user:j,initialUser:r,persistedUser:E});var X=z.filter(function(c){return n.pluginEnabled[c]}),J=z.filter(function(c){return!n.pluginEnabled[c]});return P.dispatch({type:m.registerPlugins,plugins:z,enabled:n.pluginEnabled}),n.pluginsArray.map(function(c,u){var f=c.bootstrap,S=c.config,O=c.name;f&&Q(f)&&f({instance:l,config:S,payload:c}),P.dispatch({type:m.registerPluginType(O),name:O,enabled:n.pluginEnabled[O],plugin:c}),n.pluginsArray.length===u+1&&P.dispatch({type:m.initializeStart,plugins:X,disabled:J})}),un(function(c){P.dispatch({type:c?m.offline:m.online})}),function(c,u,f){setInterval(function(){return Tt(c,u,f)},3e3)}(P,x,l),l}var Xe="before",Qe="after",Ae="cookie",fe=tr(),Zt=Ke,sn=Ke;function er(e){return fe?Ke(e,"",-1):be(e)}function tr(){if(fe!==void 0)return fe;var e="cookiecookie";try{Ke(e,e),fe=document.cookie.indexOf(e)!==-1,er(e)}catch(t){fe=!1}return fe}function Ke(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 De="localStorage",ln=it.bind(null,"localStorage");we("localStorage","getItem",ce),we("localStorage","setItem",se),we("localStorage","removeItem",be);var Le="sessionStorage",fn=it.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(F(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(r){}if(t!==null&&t!=="")return t}var dn=ln(),pn=fn(),gn=tr();function rr(e,t){if(e){var r=ft(t),n=!vt(r),i=dt(r)?Oe(localStorage.getItem(e)):void 0;if(n&&!me(i))return i;var a=pt(r)?Oe(Zt(e)):void 0;if(n&&a)return a;var o=gt(r)?Oe(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 vn(e,t,r){if(e&&!me(t)){var n={},i=ft(r),a=JSON.stringify(t),o=!vt(i);return dt(i)&&(n[De]=Ze(De,t,Oe(localStorage.getItem(e))),localStorage.setItem(e,a),o)?n[De]:pt(i)&&(n[Ae]=Ze(Ae,t,Oe(Zt(e))),sn(e,a),o)?n[Ae]:gt(i)&&(n[Le]=Ze(Le,t,Oe(sessionStorage.getItem(e))),sessionStorage.setItem(e,a),o)?n[Le]:(n[je]=Ze(je,t,ce(e)),se(e,t),o?n[je]:n)}}function mn(e,t){if(e){var r=ft(t),n=rr(e,qe),i={};return!me(n.localStorage)&&dt(r)&&(localStorage.removeItem(e),i[De]=n.localStorage),!me(n.cookie)&&pt(r)&&(er(e),i[Ae]=n.cookie),!me(n.sessionStorage)&>(r)&&(sessionStorage.removeItem(e),i[Le]=n.sessionStorage),!me(n.global)&&Ye(r,je)&&(be(e),i[je]=n.global),i}}function ft(e){return e?ve(e)?e:e.storage:_e}function dt(e){return dn&&Ye(e,De)}function pt(e){return gn&&Ye(e,Ae)}function gt(e){return pn&&Ye(e,Le)}function vt(e){return e===qe||e==="all"}function Ye(e,t){return e===_e||e===t||vt(e)}function Ze(e,t,r){return{location:e,current:t,previous:r}}var hn={setItem:vn,getItem:rr,removeItem:mn};function yn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nr(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 ir(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nr(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:hn};return cn(ir(ir({},t),e))}function bn(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 wn({trackingId:e}){bn(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),window.fbq("init",e)}function In(e={}){return{name:"facebook",config:e,initialize:function({config:t,instance:r}){if(!t.trackingId)throw new Error("No Facebook trackingId defined");wn({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 Me(){window.dataLayer.push(arguments)}window.gtag=Me;function Pn({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||[],Me("js",new Date),r&&Me("set",r),Me("config",e,t)}}function Sn(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}Pn({trackingId:t.trackingId,configParams:n,setParams:i})},page:function({payload:t,config:r,instance:n}){},track:function({payload:t,config:r,instance:n}){Me("event",t.event,t.properties)},identify:function({payload:t,config:r}){},loaded:function(){return!!window.gtag}}}var xn=new URLSearchParams(window.location.search),On=xn.get("zdbg"),or={};const et="undefined";function K(){On==1&&console.debug(...arguments)}function V(e){console.warn(e),window.Rollbar&&window.Rollbar.warning(e)}function En(e){return e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function)}function ur(){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 kn(e){document.readyState==="complete"||document.readyState==="loaded"||document.readyState==="interactive"?e():window.addEventListener("DOMContentLoaded",e)}var de=_n();function _n(){if(typeof de!==et)return de;de=!0;try{sessionStorage.setItem(et,et),sessionStorage.removeItem(et)}catch(e){de=!1}return de}function cr(e){var t,r=or[e];return de?(t=sessionStorage.getItem(e),!t&&r&&(t=r,sessionStorage.setItem(e,t))):t=r,t?JSON.parse(t):void 0}function Nn(e,t){var r=JSON.stringify(t);de&&sessionStorage.setItem(e,r),or[e]=r}function jn(){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 sr({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 zn(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function Tn(r){return Z(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 V("postBeacon:"),!1}return!1})}function An(n){return Z(this,arguments,function*({url:e,params:t=null,json:r=!0}){var i=e;return t&&(i=i+zn(t)),yield sr({method:"GET",url:i,json:r})})}function tt(i){return Z(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 Tn({url:e,data:t});if(o)return;K("Beacon failed")}return yield sr({method:"POST",url:e,data:a,json:r})})}var rt="__zar_vid",lr="success",$e="error",Dn=30*1e3,fr=0,Ln=3,W={};window.zarPoolData=window.zarPoolData||null,window.zarPoolDLObserverDone=window.zarPoolDLObserverDone||!1,window.zarPoolDataLayer=window.zarPoolDataLayer||[];var pe=new Map;function Mn(){return Date.now().toString(36)+"."+Math.random().toString(36).substring(2)}function $n(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 dr(){var e=$n(rt,Mn,cr,Nn);return{vid:e}}function pr(){return window.location.protocol+"://"+window.location.host+"/api/v2"}function gr(e){return cr(e)}function vr(e){var t=gr(e);return t?t.id:null}function Ue(){return{vid:gr(rt)}}function Un(){return{vid:vr(rt)}}function mr({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,force:r=!1}){var n,i=t;t.startsWith("+1")||(i="+1"+t);for(var a=0;a<e.length;a++){if(pe.has(e[a]))if(r)n=pe.get(e[a]);else{K("element already in overlay map:",e[a]);continue}var o=mr({elem:e[a]});if(n?!r&&o.number&&n.number&&n.number!==o.number&&V("overlaying multiple numbers with a single number",n.number,o.number):n=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 ht({elems:e}){for(var t=0;t<e.length;t++)if(pe.has(e[t])){var r=e[t].innerHTML,n=pe.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),pe.delete(e[t])}else K("element not in map:",e[t])}function hr(e){clearInterval(W[e]),delete W[e]}function yr(){for(var e in W)hr(e)}function br(i){return Z(this,arguments,function*({poolId:e,apiUrl:t,number:r=null,context:n=null}){var a={pool_id:e,number:r,context:n,properties:{zar:Ue()}},o=yield tt({url:`${t}/number_pool`,data:a});return o})}function yt(){return window.zarPoolData&&window.zarPoolData.status===lr&&window.zarPoolData.number}function nt(){if(!window.zarPoolDataLayer||!Array.isArray(window.zarPoolDataLayer))return{};for(var e={},t=0;t<window.zarPoolDataLayer.length;t++){var r=window.zarPoolDataLayer[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return window.zarPoolDataLayer.length=0,e}function wr(i){return Z(this,arguments,function*({apiUrl:e,poolId:t,number:r,context:n}){if(!yt()){V("no valid pool data, not updating context");return}var a={pool_id:t,number:r,context:n,properties:{zar:Ue()}},o=yield tt({url:`${e}/update_number`,data:a});return o})}function Cn(n){return Z(this,arguments,function*({apiUrl:e,key:t=null,with_contexts:r=!1}){var i={key:t,with_contexts:r},a=yield An({url:`${e}/number_pool_stats`,params:i});return a})}function Rn(){return Z(this,arguments,function*({overlayElements:e,apiUrl:t=pr(),contextCallback:r=null}={}){var n=nt()||{};r&&(n=r(n)||{});const i=window.zarPoolData.pool_id,a=window.zarPoolData.number;try{var o=yield br({poolId:i,apiUrl:t,number:a,context:n})}catch(g){var s="error getting number: "+JSON.stringify(g);return V(s),fr++,fr>=Ln&&(V("max failures, stopping pool"),yr(),e&&ht({elems:e})),{status:$e,msg:s}}if(o.status===lr&&o.number){var p=!1;o.number!==window.zarPoolData.number&&(V("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&&ht({elems:e}),W[i]&&(clearInterval(W[i]),delete W[i]);return o})}function bt(e){return En(e)?e():e}function qn(e){if(!window.zarPoolDLObserverDone&&!!yt()){var t=window.zarPoolDataLayer.push;window.zarPoolDataLayer.push=function(...r){var n=t.apply(this,r),i=nt();return i&&wr({apiUrl:e,poolId:window.zarPoolData.pool_id,number:window.zarPoolData.number,context:i}),n},window.zarPoolDLObserverDone=!0}}function Ir(){return Z(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),V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W;var i=nt()||{};t.contextCallback&&(i=t.contextCallback(i)||{});var a=bt(t.poolId);if(!a)return n="no pool ID",V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W;if(!e)try{e=yield br({poolId:a,apiUrl:r,number:null,context:i})}catch(o){return n="error getting number on init: "+JSON.stringify(o),V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W}if(window.zarPoolData=e,yt()){try{qn(r)}catch(o){V("data layer observer error: "+JSON.stringify(o))}kn(function(){var o=document.querySelectorAll(t.overlayQuerySelector);if(!o){var s="No elems found for:"+t.overlayQuerySelector;V(s),t.initCallback&&t.initCallback({status:$e,msg:s});return}mt({elems:o,number:e.number});var p=setInterval(function(){try{Rn({overlayElements:o,apiUrl:r,contextCallback:t.contextCallback})}catch(x){var g="error on interval: "+JSON.stringify(x);V(g)}},t.renewalInterval||Dn);W[e.pool_id]=p,t.initCallback&&t.initCallback(e)})}return W})}function Pr({apiUrl:e,poolConfig:t}){return dr(),{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=Ue(),r.properties.referrer=document.referrer,r.properties.is_bot=ur(),"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;if(a&&a.poolId){r.properties.pool_id=bt(a.poolId);var o=nt()||{};a.contextCallback&&(r.properties.pool_context=a.contextCallback(o)||{})}}catch(s){V("error getting pool id: "+JSON.stringify(s))}return r},page:function(o){return Z(this,arguments,function*({payload:r,options:n,instance:i,config:a}){K("page",r,n,a);for(var s=0,p=3,g;s<p;)try{g=yield tt({url:`${a.apiUrl}/page`,data:r});break}catch(x){if(s++,s>=p)throw V("error posting page: "+JSON.stringify(x)),x;yield new Promise(d=>setTimeout(d,1e3))}g&&g.pool_data&&Ir({poolData:g.pool_data,poolConfig:a.poolConfig,apiUrl:a.apiUrl})})},trackStart:function({payload:r,config:n,instance:i}){return r.properties.zar=Ue(),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),tt({url:`${a.apiUrl}/track`,data:r,beacon:!0})},methods:{apiUrl(){return e},poolConfig(){return t},initIDs(){return dr()},getIDs(){return Un()},getStorage(){return Ue()},getVID(){return vr(rt)},hasAdBlock(){return jn()},isBot(){return ur()},initTrackingPool({poolConfig:r}){var n=this.instance.plugins.zar;return Ir({poolData:null,poolConfig:Object.assign(n.poolConfig(),r||{}),apiUrl:n.apiUrl()})},updateTrackingNumberContext({number:r,context:n}){var i=this.instance.plugins.zar,a=i.poolConfig();return wr({apiUrl:this.instance.plugins.zar.apiUrl(),poolId:bt(a.poolId),number:r,context:n})},getPoolIntervals(){return W},clearPoolInterval({poolId:r}){hr(r)},clearPoolIntervals(){yr()},extractPhoneNumbers({elems:r}){for(var n=[],i=0;i<r.length;i++){var a=mr({elem:r[i]});n.push(a)}return n},overlayPhoneNumber({overlayElements:r,number:n}){mt({elems:r,number:n})},revertOverlayNumbers({overlayElements:r}){ht({elems:r})},getPoolStats({key:r=null,with_contexts:n=!1}){return Cn({apiUrl:this.instance.plugins.zar.apiUrl(),key:r,with_contexts:n})}}}}function Bn({app:e,ga4Config:t=null,facebookConfig:r=null,apiUrl:n=null,poolConfig:i=null}){n||(n=pr());var a=[Pr({apiUrl:n,poolConfig:i})];return t&&a.push(Sn(t)),r&&a.push(In(r)),ar({app:e,plugins:a})}return ue.Analytics=ar,ue.init=Bn,ue.zar=Pr,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ue}({});
|
|
3
3
|
//# sourceMappingURL=zar.iife.js.map
|