@walkeros/web-destination-meta 4.9.0-next-1793283841805 → 4.9.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/CHANGELOG.md +6 -3
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/walkerOS.json +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @walkeros/web-destination-meta
|
|
2
2
|
|
|
3
|
-
## 4.9.0
|
|
3
|
+
## 4.9.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -23,21 +23,24 @@
|
|
|
23
23
|
`content_type`, `contents`, currency, value and the event id for
|
|
24
24
|
deduplication, recorded as `window.fbq` calls. Their mapping functions now
|
|
25
25
|
also work when copied from the published examples.
|
|
26
|
+
- Updated dependencies [a67546d]
|
|
26
27
|
- Updated dependencies [29d2218]
|
|
27
28
|
- Updated dependencies [1306d8a]
|
|
28
29
|
- Updated dependencies [34fd225]
|
|
29
30
|
- Updated dependencies [5313635]
|
|
30
31
|
- Updated dependencies [1306d8a]
|
|
32
|
+
- Updated dependencies [fa46337]
|
|
31
33
|
- Updated dependencies [5313635]
|
|
32
34
|
- Updated dependencies [5313635]
|
|
33
35
|
- Updated dependencies [5313635]
|
|
34
36
|
- Updated dependencies [5313635]
|
|
35
37
|
- Updated dependencies [34fd225]
|
|
38
|
+
- Updated dependencies [fa46337]
|
|
36
39
|
- Updated dependencies [1306d8a]
|
|
37
40
|
- Updated dependencies [5313635]
|
|
38
41
|
- Updated dependencies [5313635]
|
|
39
|
-
- @walkeros/
|
|
40
|
-
- @walkeros/core@4.9.0
|
|
42
|
+
- @walkeros/core@4.9.0
|
|
43
|
+
- @walkeros/web-core@4.9.0
|
|
41
44
|
|
|
42
45
|
## 4.8.2
|
|
43
46
|
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r),i={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(i,{DestinationMeta:()=>V,default:()=>N,destinationMeta:()=>L});var c=Object.defineProperty,s=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})};function u(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}s({},{stepId:()=>u});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}s({},{getDestination:()=>a});s({},{Level:()=>l});var f,l=((f=l||{})[f.ERROR=0]="ERROR",f[f.WARN=1]="WARN",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f);function d(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}s({},{getTransformer:()=>d});function p(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}s({},{getSource:()=>p});function y(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}s({},{getStore:()=>y,getStoreValue:()=>g});var w="\\$flow\\.([a-zA-Z_][a-zA-Z0-9_-]*)(?:\\.([a-zA-Z0-9_.]+))?";new RegExp(`^${w}$`),new RegExp(w,"g");function h(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function b(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}var v=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],m=class extends Error{constructor(e,t){super(e),o(this,"code"),o(this,"status"),o(this,"retryable"),o(this,"body"),void 0!==t.cause&&function(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})}(this,t.cause),this.name="StepError",this.code=t.code,void 0!==t.status&&(this.status=t.status),this.retryable=function(e){if(void 0!==e.retryable)return e.retryable;const{status:t}=e;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return v.includes(e.code)}(t),void 0!==t.body&&(this.body=t.body),Object.setPrototypeOf(this,new.target.prototype)}};async function O(e,t,n){try{return await e()}catch(e){if(e instanceof m)throw e;throw new m(n,{code:t,cause:e})}}var j="observe";function P(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function R(e){return"function"==typeof e}function E(e){return"object"==typeof e&&null!==e}var x=["name","length","prototype","arguments","caller"];function A(e,t){if(-1!==x.indexOf(t))return!1;let n=e;for(;R(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!R(e)||!R(Object.getPrototypeOf(e)))return!1;n=e}return!1}function k(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function _(e,t){let n=e;for(const e of t){if(R(n)){if(!A(n,e))return!0;if(!k(n,e))return!1}else if(h(n)){if(!(e in n))return!0}else if(!E(n)||!(e in n))return!1;n=Reflect.get(n,e)}return R(n)}function S(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[j];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[j];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=P(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),_(e,t)||o.push(r)}const c=new WeakMap,s=new WeakSet;function u(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function a(e,t){return 0===t.length||f(e)?e:h(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>a(e,t)):R(e)?w(e,[],t):E(e)?d(e,t):e}function f(e){return(E(e)||R(e))&&s.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=c.get(e))?n:new Map;c.set(e,o);const i=o.get(r);if(i)return i;const s=p(e,t);return o.set(r,s),s}function p(e,t){return R(e)?y(e,t):t.some(t=>!k(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=g(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return s.add(o),o}(e,t):y(e,t)}function y(e,t){const n=g(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||k(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return s.add(r),r}function g(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!R(i)&&!E(i))return i;if(f(i))return i;const c=r.get(o);if(c&&c.value===i)return c.out;const{leafs:s,deeper:u}=l(t,o);if(!(s.length>0||u.length>0)&&(!R(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let a=i;return R(i)?a=w(i,s,u,{proxy:n(),target:e}):u.length>0&&(a=d(i,u)),r.set(o,{value:i,out:a}),a}}}function w(e,t,n,r){const o=()=>n.filter(t=>!A(e,t.rest[0])),i=new Map,c=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!k(e,t))return r;if(!A(e,t))return r;const{leafs:o,deeper:s}=l(n,t);if(0===o.length&&0===s.length)return r;if(f(r))return r;const u=i.get(t);if(u&&u.value===r)return u.out;let a=r;return R(r)?a=w(r,o,s,{proxy:c,target:e}):E(r)&&s.length>0&&(a=d(r,s)),i.set(t,{value:r,out:a}),a},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){u(t,i);const c=!r||n!==r.proxy&&void 0!==n?n:r.target;return a(Reflect.apply(e,c,i),o())},construct(e,n,r){u(t,n);const i=Reflect.construct(e,n,r===c?e:r),s=a(i,o());return E(s)||R(s)?s:i}});return s.add(c),c}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=P(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var M="data-walkeros-vendor",$=new WeakMap;var q=()=>new m("Vendor script failed to load",{code:"vendor-not-loaded"});function D(e,t,n={}){var r,o;const i=()=>null!=t();let c;if(e){const t=null!=(r=n.document)?r:"undefined"!=typeof document?document:void 0;if(!t)throw new m(`Vendor script ${e} has no document to go into`,{code:"vendor-not-ready"});c=function(e,t,n,r,o){const i=function(e,t){const n=e.querySelectorAll(`script[${M}]`);return Array.from(n).find(e=>e.getAttribute("src")===t)}(e,t),c=i&&$.get(i);if(c)return c;const s={state:"loading",expired:!1,timeout:n,waiting:[]};if(i&&o())return s.state="loaded",$.set(i,s),s;const u=null!=i?i:e.createElement("script"),a=e=>{const t=s.waiting;s.waiting=[],t.forEach(t=>t(e))},f=setTimeout(()=>{s.expired=!0,a("expired")},n);if($.set(u,s),u.addEventListener("load",()=>{clearTimeout(f),s.state="loaded",a("loaded")}),u.addEventListener("error",()=>{clearTimeout(f),s.state="failed",a("failed")}),!i){for(const[e,t]of Object.entries(r))u.setAttribute(e,t);u.src=t,u.async=!0,u.setAttribute(M,""),e.head.appendChild(u)}return s}(t,e,function(e){return"number"==typeof e&&e>0?e:1e4}(n.timeout),null!=(o=n.attributes)?o:{},i)}const s=()=>{const e=t();return null==e?Promise.reject(new m("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:()=>c?"failed"===c.state?Promise.reject(q()):"loaded"===c.state||c.expired?s():new Promise((e,t)=>{c.waiting.push(n=>{var r;"failed"===n?t(q()):"expired"===n?t((r=c.timeout,new m(`Vendor script did not load within ${r}ms`,{code:"vendor-timeout"}))):s().then(e,t)})}):s(),check(){if("failed"===(null==c?void 0:c.state))throw q()}}}var V={};function W(e,t){return D(e.loadScript?"https://connect.facebook.net/en_US/fbevents.js":void 0,()=>S(t).window.fbq,{timeout:e.timeout,document:S(t).document})}function I(e){const{fbq:t}=S(e).window;if(!t)throw new m("Meta Pixel not ready: window.fbq is missing",{code:"vendor-not-ready"});return t}var T,L={type:"meta-pixel",config:{},async init({config:e,env:t}){const{pixelId:n}=e.settings||{};if(!n)throw new m("Meta Pixel needs settings.pixelId",{code:"config"});!function(e){const{window:t}=S(e);if(t.fbq)return;const n=Object.assign(function(...e){n.callMethod?n.callMethod.apply(n,e):n.queue.push(e)},{queue:[]});n.push=n,n.loaded=!0,n.version="2.0",t.fbq=n,t._fbq||(t._fbq=n)}(t),W(e,t);const r=I(t);await O(()=>r("init",n),"vendor-not-ready","Meta Pixel init call failed")},async push(e,{config:t,rule:n={},data:r,env:o}){W(t,o).check();const i=I(o),{track:c,trackCustom:s}=n.settings||{};"page view"!==e.name||n.settings||(e.name="PageView");const u=c||s||e.name;n.silent||await O(()=>i(s?"trackCustom":"track",String(u),b(r)?r:{},{eventID:e.id}),"transport","Meta Pixel call failed")},async on(e,{config:t,data:n,env:r,collector:o}){const i=t.consent;if("consent"!==e||!i||!b(n))return;if(!Object.keys(i).some(e=>e in n))return;const c=!1!==function(e,t={},n={}){const r={...t,...n},o={};let i=!e||0===Object.keys(e).length;return Object.keys(r).forEach(t=>{r[t]&&(o[t]=!0,e&&e[t]&&(i=!0))}),!!i&&o}(i,o.consent),{fbq:s}=S(r).window;"function"==typeof s&&await O(()=>s("consent",c?"grant":"revoke"),"consent-not-applied","Meta Pixel did not take the consent update")}},N=L;return T=i,((o,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let u of n(i))r.call(o,u)||u===c||e(o,u,{get:()=>i[u],enumerable:!(s=t(i,u))||s.enumerable});return o})(e({},"__esModule",{value:!0}),T)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r),i={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(i,{DestinationMeta:()=>W,default:()=>B,destinationMeta:()=>N});var c=Object.defineProperty,s=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})};function u(e,t){if("collector"===e)return"collector";if(!t)throw new Error(`stepId(${e}) requires an id`);return`${e}.${t}`}s({},{stepId:()=>u});function a(e,t){const n=e.destinations[t];if(!n)throw new Error(`Destination not found: ${t}`);return n}s({},{getDestination:()=>a});s({},{Level:()=>l});var f,l=((f=l||{})[f.ERROR=0]="ERROR",f[f.WARN=1]="WARN",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f);function d(e,t){const n=e.transformers[t];if(!n)throw new Error(`Transformer not found: ${t}`);return n}s({},{getTransformer:()=>d});function p(e,t){const n=e.sources[t];if(!n)throw new Error(`Source not found: ${t}`);return n}s({},{getSource:()=>p});function y(e,t){const n=e.stores[t];if(!n)throw new Error(`Store not found: ${t}`);return n}async function g(e,t){return await e.get(t)}s({},{getStore:()=>y,getStoreValue:()=>g});var w="\\$flow\\.([a-zA-Z_][a-zA-Z0-9_-]*)(?:\\.([a-zA-Z0-9_.]+))?";new RegExp(`^${w}$`),new RegExp(w,"g");function h(e){return"object"==typeof e&&null!==e&&"then"in e&&"function"==typeof e.then}function b(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}function v(e,t={},n={}){const r=function(e={},t={}){const n={...e,...t},r={};return Object.keys(n).forEach(e=>{n[e]&&(r[e]=!0)}),r}(t,n);return e&&0!==Object.keys(e).length?!!Object.keys(e).some(t=>e[t]&&r[t])&&r:r}var m=["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"],O=class extends Error{constructor(e,t){super(e),o(this,"code"),o(this,"status"),o(this,"retryable"),o(this,"body"),void 0!==t.cause&&function(e,t){Object.defineProperty(e,"cause",{value:t,writable:!0,configurable:!0})}(this,t.cause),this.name="StepError",this.code=t.code,void 0!==t.status&&(this.status=t.status),this.retryable=function(e){if(void 0!==e.retryable)return e.retryable;const{status:t}=e;if(void 0!==t){if(429===t||t>=500&&t<600)return!0;if(t>=400&&t<500)return!1}return m.includes(e.code)}(t),void 0!==t.body&&(this.body=t.body),Object.setPrototypeOf(this,new.target.prototype)}};async function j(e,t,n){try{return await e()}catch(e){if(e instanceof O)throw e;throw new O(n,{code:t,cause:e})}}var P="observe";function R(e){const t=(e.startsWith("call:")?e.slice(5):e).split(".");return t.some(e=>""===e)?[]:t}function E(e){return"function"==typeof e}function x(e){return"object"==typeof e&&null!==e}var k=["name","length","prototype","arguments","caller"];function A(e,t){if(-1!==k.indexOf(t))return!1;let n=e;for(;E(n);){if(Object.prototype.hasOwnProperty.call(n,t))return!0;const e=Object.getPrototypeOf(n);if(!E(e)||!E(Object.getPrototypeOf(e)))return!1;n=e}return!1}function _(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!(n&&!n.configurable)||"value"in n&&!0===n.writable}function S(e,t){let n=e;for(const e of t){if(E(n)){if(!A(n,e))return!0;if(!_(n,e))return!1}else if(h(n)){if(!(e in n))return!0}else if(!x(n)||!(e in n))return!1;n=Reflect.get(n,e)}return E(n)}function M(e){const t={window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document,...e},n=e&&e[P];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(e){if("object"!=typeof e||null===e)return!1;if(!("paths"in e)||!("record"in e))return!1;const{paths:t,record:n}=e;return Array.isArray(t)&&t.every(e=>"string"==typeof e)&&"function"==typeof n}(n)){delete t[P];const e=function(e,t,n){const r=[],o=[],i=[];for(const n of t){const t=R(n);if(0===t.length)continue;const r=t.join(".");i.push({rest:t,fn:r}),S(e,t)||o.push(r)}const c=new WeakMap,s=new WeakSet;function u(e,t){for(const o of e)if(n)try{n(o,t)}catch(e){}else r.push({fn:o,args:t,ts:Date.now()})}function a(e,t){return 0===t.length||f(e)?e:h(e)&&!t.some(t=>t.rest[0]in e)?Promise.resolve(e).then(e=>a(e,t)):E(e)?w(e,[],t):x(e)?d(e,t):e}function f(e){return(x(e)||E(e))&&s.has(e)}function l(e,t){const n=[],r=[];for(const o of e)o.rest[0]===t&&(1===o.rest.length?n.includes(o.fn)||n.push(o.fn):r.push({rest:o.rest.slice(1),fn:o.fn}));return{leafs:n,deeper:r}}function d(e,t){var n;const r=t.map(e=>`${e.fn}:${e.rest.join(".")}`).join("|"),o=null!=(n=c.get(e))?n:new Map;c.set(e,o);const i=o.get(r);if(i)return i;const s=p(e,t);return o.set(r,s),s}function p(e,t){return E(e)?y(e,t):t.some(t=>!_(e,t.rest[0]))?function(e,t){const n=Object.create(Object.getPrototypeOf(e)),r=g(e,t,()=>o),o=new Proxy(n,{get:(e,t)=>r.get(t),set:(t,n,r)=>Reflect.set(e,n,r,e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),getOwnPropertyDescriptor(t,n){const r=Reflect.getOwnPropertyDescriptor(e,n);return r&&{...r,configurable:!0}},defineProperty:(t,n,r)=>Reflect.defineProperty(e,n,r),deleteProperty:(t,n)=>Reflect.deleteProperty(e,n)});return s.add(o),o}(e,t):y(e,t)}function y(e,t){const n=g(e,t,()=>r),r=new Proxy(e,{get:(e,t)=>"string"!=typeof t||_(e,t)?n.get(t):Reflect.get(e,t,e),set:(e,t,n)=>Reflect.set(e,t,n,e)});return s.add(r),r}function g(e,t,n){const r=new Map;return{get(o){const i=Reflect.get(e,o,e);if("string"!=typeof o)return i;if(!E(i)&&!x(i))return i;if(f(i))return i;const c=r.get(o);if(c&&c.value===i)return c.out;const{leafs:s,deeper:u}=l(t,o);if(!(s.length>0||u.length>0)&&(!E(i)||function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e)))return i;let a=i;return E(i)?a=w(i,s,u,{proxy:n(),target:e}):u.length>0&&(a=d(i,u)),r.set(o,{value:i,out:a}),a}}}function w(e,t,n,r){const o=()=>n.filter(t=>!A(e,t.rest[0])),i=new Map,c=new Proxy(e,{get(e,t){const r=Reflect.get(e,t,e);if("string"!=typeof t||!_(e,t))return r;if(!A(e,t))return r;const{leafs:o,deeper:s}=l(n,t);if(0===o.length&&0===s.length)return r;if(f(r))return r;const u=i.get(t);if(u&&u.value===r)return u.out;let a=r;return E(r)?a=w(r,o,s,{proxy:c,target:e}):x(r)&&s.length>0&&(a=d(r,s)),i.set(t,{value:r,out:a}),a},set:(e,t,n)=>Reflect.set(e,t,n,e),apply(e,n,i){u(t,i);const c=!r||n!==r.proxy&&void 0!==n?n:r.target;return a(Reflect.apply(e,c,i),o())},construct(e,n,r){u(t,n);const i=Reflect.construct(e,n,r===c?e:r),s=a(i,o());return x(s)||E(s)?s:i}});return s.add(c),c}return{env:p(e,i),calls:r,unresolved:o}}(t,n.paths,n.record).env,r=new Set;for(const e of n.paths){const n=R(e)[0];if(void 0===n)continue;const o=t[n];null!==o&&"object"==typeof o&&r.add(n)}const o=Array.from(r,t=>[t,e[t]]);for(const[e,n]of o)t[e]=n}return t}var $="data-walkeros-vendor",q=new WeakMap;var D=()=>new O("Vendor script failed to load",{code:"vendor-not-loaded"});function V(e,t,n={}){var r,o;const i=()=>null!=t();let c;if(e){const t=null!=(r=n.document)?r:"undefined"!=typeof document?document:void 0;if(!t)throw new O(`Vendor script ${e} has no document to go into`,{code:"vendor-not-ready"});c=function(e,t,n,r,o){const i=function(e,t){const n=e.querySelectorAll(`script[${$}]`);return Array.from(n).find(e=>e.getAttribute("src")===t)}(e,t),c=i&&q.get(i);if(c)return c;const s={state:"loading",expired:!1,timeout:n,waiting:[]};if(i&&o())return s.state="loaded",q.set(i,s),s;const u=null!=i?i:e.createElement("script"),a=e=>{const t=s.waiting;s.waiting=[],t.forEach(t=>t(e))},f=setTimeout(()=>{s.expired=!0,a("expired")},n);if(q.set(u,s),u.addEventListener("load",()=>{clearTimeout(f),s.state="loaded",a("loaded")}),u.addEventListener("error",()=>{clearTimeout(f),s.state="failed",a("failed")}),!i){for(const[e,t]of Object.entries(r))u.setAttribute(e,t);u.src=t,u.async=!0,u.setAttribute($,""),e.head.appendChild(u)}return s}(t,e,function(e){return"number"==typeof e&&e>0?e:1e4}(n.timeout),null!=(o=n.attributes)?o:{},i)}const s=()=>{const e=t();return null==e?Promise.reject(new O("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(e)};return{ready:()=>c?"failed"===c.state?Promise.reject(D()):"loaded"===c.state||c.expired?s():new Promise((e,t)=>{c.waiting.push(n=>{var r;"failed"===n?t(D()):"expired"===n?t((r=c.timeout,new O(`Vendor script did not load within ${r}ms`,{code:"vendor-timeout"}))):s().then(e,t)})}):s(),check(){if("failed"===(null==c?void 0:c.state))throw D()}}}var W={};function I(e,t){return V(e.loadScript?"https://connect.facebook.net/en_US/fbevents.js":void 0,()=>M(t).window.fbq,{timeout:e.timeout,document:M(t).document})}function T(e){const{fbq:t}=M(e).window;if(!t)throw new O("Meta Pixel not ready: window.fbq is missing",{code:"vendor-not-ready"});return t}var L,N={type:"meta-pixel",config:{},async init({config:e,env:t}){const{pixelId:n}=e.settings||{};if(!n)throw new O("Meta Pixel needs settings.pixelId",{code:"config"});!function(e){const{window:t}=M(e);if(t.fbq)return;const n=Object.assign(function(...e){n.callMethod?n.callMethod.apply(n,e):n.queue.push(e)},{queue:[]});n.push=n,n.loaded=!0,n.version="2.0",t.fbq=n,t._fbq||(t._fbq=n)}(t),I(e,t);const r=T(t);await j(()=>r("init",n),"vendor-not-ready","Meta Pixel init call failed")},async push(e,{config:t,rule:n={},data:r,env:o}){I(t,o).check();const i=T(o),{track:c,trackCustom:s}=n.settings||{};"page view"!==e.name||n.settings||(e.name="PageView");const u=c||s||e.name;n.silent||await j(()=>i(s?"trackCustom":"track",String(u),b(r)?r:{},{eventID:e.id}),"transport","Meta Pixel call failed")},async on(e,{config:t,data:n,env:r,collector:o}){const i=t.consent;if("consent"!==e||!i||!b(n))return;if(!Object.keys(i).some(e=>e in n))return;const c=!1!==v(i,o.consent),{fbq:s}=M(r).window;"function"==typeof s&&await j(()=>s("consent",c?"grant":"revoke"),"consent-not-applied","Meta Pixel did not take the consent update")}},B=N;return L=i,((o,i,c,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let u of n(i))r.call(o,u)||u===c||e(o,u,{get:()=>i[u],enumerable:!(s=t(i,u))||s.enumerable});return o})(e({},"__esModule",{value:!0}),L)})();
|
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _array_like_to_array(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _array_with_holes(t){if(Array.isArray(t))return t}function _assert_this_initialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function asyncGeneratorStep(t,e,r,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function _async_to_generator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function u(t){asyncGeneratorStep(i,n,o,u,a,"next",t)}function a(t){asyncGeneratorStep(i,n,o,u,a,"throw",t)}u(void 0)})}}function _call_super(t,e,r){return e=_get_prototype_of(e),_possible_constructor_return(t,_is_native_reflect_construct()?Reflect.construct(e,r||[],_get_prototype_of(t).constructor):e.apply(t,r))}function _class_call_check(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _construct(t,e,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _get_prototype_of(t){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},_get_prototype_of(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_set_prototype_of(t,e)}function _instanceof(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _is_native_function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}function _iterable_to_array_limit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ownKeys(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}function _possible_constructor_return(t,e){return!e||"object"!==_type_of(e)&&"function"!=typeof e?_assert_this_initialized(t):e}function _set_prototype_of(t,e){return _set_prototype_of=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_set_prototype_of(t,e)}function _sliced_to_array(t,e){return _array_with_holes(t)||_iterable_to_array_limit(t,e)||_unsupported_iterable_to_array(t,e)||_non_iterable_rest()}function _type_of(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function _unsupported_iterable_to_array(t,e){if(t){if("string"==typeof t)return _array_like_to_array(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(t,e):void 0}}function _wrap_native_super(t){var e="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(t){if(null===t||!_is_native_function(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _construct(t,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,t)},_wrap_native_super(t)}function _is_native_reflect_construct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_is_native_reflect_construct=function(){return!!t})()}function _ts_generator(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var Destination=function(){var t=function(t,e){if("collector"===t)return"collector";if(!e)throw new Error("stepId(".concat(t,") requires an id"));return"".concat(t,".").concat(e)},e=function(t,e){var r=t.destinations[e];if(!r)throw new Error("Destination not found: ".concat(e));return r},r=function(t,e){var r=t.transformers[e];if(!r)throw new Error("Transformer not found: ".concat(e));return r},n=function(t,e){var r=t.sources[e];if(!r)throw new Error("Source not found: ".concat(e));return r},o=function(t,e){var r=t.stores[e];if(!r)throw new Error("Store not found: ".concat(e));return r},i=function(t,e){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,t.get(e)];case 1:return[2,r.sent()]}})})()},u=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t&&"then"in t&&"function"==typeof t.then},a=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)},c=function(t,e,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t()];case 1:return[2,o.sent()];case 2:if(_instanceof(n=o.sent(),D))throw n;throw new D(r,{code:e,cause:n});case 3:return[2]}})})()},f=function(t){var e=(t.startsWith(q)?t.slice(5):t).split(".");return e.some(function(t){return""===t})?[]:e},l=function(t){return"function"==typeof t},s=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t},p=function(t,e){if(-1!==T.indexOf(e))return!1;for(var r=t;l(r);){if(Object.prototype.hasOwnProperty.call(r,e))return!0;var n=Object.getPrototypeOf(r);if(!l(n)||!l(Object.getPrototypeOf(n)))return!1;r=n}return!1},y=function(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},d=function(t,e){var r=t,n=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var f=a.value;if(l(r)){if(!p(r,f))return!0;if(!y(r,f))return!1}else if(u(r)){if(!(f in r))return!0}else if(!s(r)||!(f in r))return!1;r=Reflect.get(r,f)}}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return l(r)},_=function(t){var e=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},t),r=t&&t[I];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(t){if("object"!=(void 0===t?"undefined":_type_of(t))||null===t)return!1;if(!("paths"in t)||!("record"in t))return!1;var e=t.paths,r=t.record;return Array.isArray(e)&&e.every(function(t){return"string"==typeof t})&&"function"==typeof r}(r)){delete e[I];var n=function(t,e,r){var n=[],o=[],i=[],a=!0,c=!1,_=void 0;try{for(var v,b=e[Symbol.iterator]();!(a=(v=b.next()).done);a=!0){var h=v.value,g=f(h);if(0!==g.length){var w=g.join(".");i.push({rest:g,fn:w}),d(t,g)||o.push(w)}}}catch(t){c=!0,_=t}finally{try{a||null==b.return||b.return()}finally{if(c)throw _}}var m=new WeakMap,O=new WeakSet;function j(t,e){var o=!0,i=!1,u=void 0;try{for(var a,c=t[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var f=a.value;if(r)try{r(f,e)}catch(t){}else n.push({fn:f,args:e,ts:Date.now()})}}catch(t){i=!0,u=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw u}}}function P(t,e){return 0===e.length||S(t)?t:u(t)&&!e.some(function(e){return e.rest[0]in t})?Promise.resolve(t).then(function(t){return P(t,e)}):l(t)?M(t,[],e):s(t)?R(t,e):t}function S(t){return(s(t)||l(t))&&O.has(t)}function x(t,e){var r=[],n=[],o=!0,i=!1,u=void 0;try{for(var a,c=t[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var f=a.value;f.rest[0]===e&&(1===f.rest.length?r.includes(f.fn)||r.push(f.fn):n.push({rest:f.rest.slice(1),fn:f.fn}))}}catch(t){i=!0,u=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw u}}return{leafs:r,deeper:n}}function R(t,e){var r,n=e.map(function(t){return"".concat(t.fn,":").concat(t.rest.join("."))}).join("|"),o=null!==(r=m.get(t))&&void 0!==r?r:new Map;m.set(t,o);var i=o.get(n);if(i)return i;var u=E(t,e);return o.set(n,u),u}function E(t,e){return l(t)?k(t,e):e.some(function(e){return!y(t,e.rest[0])})?function(t,e){var r=Object.create(Object.getPrototypeOf(t)),n=A(t,e,function(){return o}),o=new Proxy(r,{get:function(t,e){return n.get(e)},set:function(e,r,n){return Reflect.set(t,r,n,t)},has:function(e,r){return Reflect.has(t,r)},ownKeys:function(){return Reflect.ownKeys(t)},getOwnPropertyDescriptor:function(e,r){var n=Reflect.getOwnPropertyDescriptor(t,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(e,r,n){return Reflect.defineProperty(t,r,n)},deleteProperty:function(e,r){return Reflect.deleteProperty(t,r)}});return O.add(o),o}(t,e):k(t,e)}function k(t,e){var r=A(t,e,function(){return n}),n=new Proxy(t,{get:function(t,e){return"string"!=typeof e||y(t,e)?r.get(e):Reflect.get(t,e,t)},set:function(t,e,r){return Reflect.set(t,e,r,t)}});return O.add(n),n}function A(t,e,r){var n=new Map;return{get:function(o){var i=Reflect.get(t,o,t);if("string"!=typeof o)return i;if(!l(i)&&!s(i))return i;if(S(i))return i;var u=n.get(o);if(u&&u.value===i)return u.out;var a=x(e,o),c=a.leafs,f=a.deeper;if(!(c.length>0||f.length>0)&&(!l(i)||function(t){if(Array.isArray(t))return!0;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}(t)))return i;var p=i;return l(i)?p=M(i,c,f,{proxy:r(),target:t}):f.length>0&&(p=R(i,f)),n.set(o,{value:i,out:p}),p}}}function M(t,e,r,n){var o=function(){return r.filter(function(e){return!p(t,e.rest[0])})},i=new Map,u=new Proxy(t,{get:function(t,e){var n=Reflect.get(t,e,t);if("string"!=typeof e||!y(t,e))return n;if(!p(t,e))return n;var o=x(r,e),a=o.leafs,c=o.deeper;if(0===a.length&&0===c.length)return n;if(S(n))return n;var f=i.get(e);if(f&&f.value===n)return f.out;var d=n;return l(n)?d=M(n,a,c,{proxy:u,target:t}):s(n)&&c.length>0&&(d=R(n,c)),i.set(e,{value:n,out:d}),d},set:function(t,e,r){return Reflect.set(t,e,r,t)},apply:function(t,r,i){j(e,i);var u=!n||r!==n.proxy&&void 0!==r?r:n.target;return P(Reflect.apply(t,u,i),o())},construct:function(t,r,n){j(e,r);var i=Reflect.construct(t,r,n===u?t:n),a=P(i,o());return s(a)||l(a)?a:i}});return O.add(u),u}return{env:E(t,i),calls:n,unresolved:o}}(e,r.paths,r.record).env,o=new Set,i=!0,a=!1,c=void 0;try{for(var _,v=r.paths[Symbol.iterator]();!(i=(_=v.next()).done);i=!0){var b=_.value,h=f(b)[0];if(void 0!==h){var g=e[h];null!==g&&"object"==(void 0===g?"undefined":_type_of(g))&&o.add(h)}}}catch(t){a=!0,c=t}finally{try{i||null==v.return||v.return()}finally{if(a)throw c}}var w=Array.from(o,function(t){return[t,n[t]]}),m=!0,O=!1,j=void 0;try{for(var P,S=w[Symbol.iterator]();!(m=(P=S.next()).done);m=!0){var x=_sliced_to_array(P.value,2),R=x[0],E=x[1];e[R]=E}}catch(t){O=!0,j=t}finally{try{m||null==S.return||S.return()}finally{if(O)throw j}}}return e},v=function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var u=null!=(r=i.document)?r:"undefined"!=typeof document?document:void 0;if(!u)throw new D("Vendor script ".concat(t," has no document to go into"),{code:"vendor-not-ready"});o=function(t,e,r,n,o){var i=function(t,e){var r=t.querySelectorAll("script[".concat(V,"]"));return Array.from(r).find(function(t){return t.getAttribute("src")===e})}(t,e),u=i&&W.get(i);if(u)return u;var a={state:"loading",expired:!1,timeout:r,waiting:[]};if(i&&o())return a.state="loaded",W.set(i,a),a;var c=null!=i?i:t.createElement("script"),f=function(t){var e=a.waiting;a.waiting=[],e.forEach(function(e){return e(t)})},l=setTimeout(function(){a.expired=!0,f("expired")},r);if(W.set(c,a),c.addEventListener("load",function(){clearTimeout(l),a.state="loaded",f("loaded")}),c.addEventListener("error",function(){clearTimeout(l),a.state="failed",f("failed")}),!i){var s=!0,p=!1,y=void 0;try{for(var d,_=Object.entries(n)[Symbol.iterator]();!(s=(d=_.next()).done);s=!0){var v=_sliced_to_array(d.value,2),b=v[0],h=v[1];c.setAttribute(b,h)}}catch(t){p=!0,y=t}finally{try{s||null==_.return||_.return()}finally{if(p)throw y}}c.src=e,c.async=!0,c.setAttribute(V,""),t.head.appendChild(c)}return a}(u,t,function(t){return"number"==typeof t&&t>0?t:1e4}(i.timeout),null!=(n=i.attributes)?n:{},function(){return null!=e()})}var a=function(){var t=e();return null==t?Promise.reject(new D("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(t)};return{ready:function(){return o?"failed"===o.state?Promise.reject(B()):"loaded"===o.state||o.expired?a():new Promise(function(t,e){o.waiting.push(function(r){var n;"failed"===r?e(B()):"expired"===r?e((n=o.timeout,new D("Vendor script did not load within ".concat(n,"ms"),{code:"vendor-timeout"}))):a().then(t,e)})}):a()},check:function(){if("failed"===(null==o?void 0:o.state))throw B()}}},b=function(t,e){return v(t.loadScript?G:void 0,function(){return _(e).window.fbq},{timeout:t.timeout,document:_(e).document})},h=function(t){var e=_(t).window.fbq;if(!e)throw new D("Meta Pixel not ready: window.fbq is missing",{code:"vendor-not-ready"});return e},g=Object.defineProperty,w=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,O=Object.prototype.hasOwnProperty,j=function(t,e,r){return function(t,e,r){return e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r}(t,"symbol"!==(void 0===e?"undefined":_type_of(e))?e+"":e,r)},P={};!function(t,e){for(var r in e)g(t,r,{get:e[r],enumerable:!0})}(P,{DestinationMeta:function(){return K},default:function(){return C},destinationMeta:function(){return z}});var S=Object.defineProperty,x=function(t,e){for(var r in e)S(t,r,{get:e[r],enumerable:!0})};x({},{stepId:function(){return t}});x({},{getDestination:function(){return e}});x({},{Level:function(){return E}});var R,E=((R=E||{})[R.ERROR=0]="ERROR",R[R.WARN=1]="WARN",R[R.INFO=2]="INFO",R[R.DEBUG=3]="DEBUG",R);x({},{getTransformer:function(){return r}});x({},{getSource:function(){return n}});x({},{getStore:function(){return o},getStoreValue:function(){return i}});var k,A="\\$flow\\.(".concat("[a-zA-Z_][a-zA-Z0-9_-]*",")(?:\\.([a-zA-Z0-9_.]+))?"),M=(new RegExp("^".concat(A,"$")),new RegExp(A,"g"),["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"]),D=function(t){function e(t,r){var n;return _class_call_check(this,e),n=_call_super(this,e,[t]),j(n,"code"),j(n,"status"),j(n,"retryable"),j(n,"body"),void 0!==r.cause&&function(t,e){Object.defineProperty(t,"cause",{value:e,writable:!0,configurable:!0})}(n,r.cause),n.name="StepError",n.code=r.code,void 0!==r.status&&(n.status=r.status),n.retryable=function(t){if(void 0!==t.retryable)return t.retryable;var e=t.status;if(void 0!==e){if(429===e||e>=500&&e<600)return!0;if(e>=400&&e<500)return!1}return M.includes(t.code)}(r),void 0!==r.body&&(n.body=r.body),Object.setPrototypeOf(n,(_instanceof(this,e)?this.constructor:void 0).prototype),n}return _inherits(e,t),e}(_wrap_native_super(Error)),I="observe",q="call:",T=["name","length","prototype","arguments","caller"],V="data-walkeros-vendor",W=new WeakMap,B=function(){return new D("Vendor script failed to load",{code:"vendor-not-loaded"})},G="https://connect.facebook.net/en_US/fbevents.js",K={},z={type:"meta-pixel",config:{},init:function(t){return _async_to_generator(function(t){var e,r,n,o;return _ts_generator(this,function(i){switch(i.label){case 0:if(e=t.config,r=t.env,!(n=(e.settings||{}).pixelId))throw new D("Meta Pixel needs settings.pixelId",{code:"config"});return function(t){var e=_(t).window;if(!e.fbq){var r=Object.assign(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.callMethod?r.callMethod.apply(r,e):r.queue.push(e)},{queue:[]});r.push=r,r.loaded=!0,r.version="2.0",e.fbq=r,e._fbq||(e._fbq=r)}}(r),b(e,r),o=h(r),[4,c(function(){return o("init",n)},"vendor-not-ready","Meta Pixel init call failed")];case 1:return i.sent(),[2]}})}).apply(this,arguments)},push:function(t,e){return _async_to_generator(function(t,e){var r,n,o,i,u,f,l,s,p,y;return _ts_generator(this,function(d){switch(d.label){case 0:return r=e.config,n=e.rule,o=void 0===n?{}:n,i=e.data,u=e.env,b(r,u).check(),f=h(u),l=o.settings||{},s=l.track,p=l.trackCustom,"page view"!==t.name||o.settings||(t.name="PageView"),y=s||p||t.name,o.silent?[3,2]:[4,c(function(){return f(p?"trackCustom":"track",String(y),a(i)?i:{},{eventID:t.id})},"transport","Meta Pixel call failed")];case 1:d.sent(),d.label=2;case 2:return[2]}})}).apply(this,arguments)},on:function(t,e){return _async_to_generator(function(t,e){var r,n,o,i,u,f,l;return _ts_generator(this,function(s){switch(s.label){case 0:return r=e.config,n=e.data,o=e.env,i=e.collector,u=r.consent,"consent"===t&&u&&a(n)?Object.keys(u).some(function(t){return t in n})?(f=!1!==function(t){var e=_object_spread({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r={},n=!t||0===Object.keys(t).length;return Object.keys(e).forEach(function(o){e[o]&&(r[o]=!0,t&&t[o]&&(n=!0))}),!!n&&r}(u,i.consent),"function"!=typeof(l=_(o).window.fbq)?[2]:[4,c(function(){return l("consent",f?"grant":"revoke")},"consent-not-applied","Meta Pixel did not take the consent update")]):[2]:[2];case 1:return s.sent(),[2]}})}).apply(this,arguments)}},C=z;return k=P,function(t,e,r,n){if(e&&"object"===(void 0===e?"undefined":_type_of(e))||"function"==typeof e){var o=!0,i=!1,u=void 0;try{for(var a,c=function(){var o=a.value;O.call(t,o)||o===r||g(t,o,{get:function(){return e[o]},enumerable:!(n=w(e,o))||n.enumerable})},f=m(e)[Symbol.iterator]();!(o=(a=f.next()).done);o=!0)c()}catch(t){i=!0,u=t}finally{try{o||null==f.return||f.return()}finally{if(i)throw u}}}return t}(g({},"__esModule",{value:!0}),k)}();
|
|
1
|
+
"use strict";function _array_like_to_array(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _array_with_holes(t){if(Array.isArray(t))return t}function _assert_this_initialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function asyncGeneratorStep(t,e,r,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function _async_to_generator(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function u(t){asyncGeneratorStep(i,n,o,u,a,"next",t)}function a(t){asyncGeneratorStep(i,n,o,u,a,"throw",t)}u(void 0)})}}function _call_super(t,e,r){return e=_get_prototype_of(e),_possible_constructor_return(t,_is_native_reflect_construct()?Reflect.construct(e,r||[],_get_prototype_of(t).constructor):e.apply(t,r))}function _class_call_check(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _construct(t,e,r){return _construct=_is_native_reflect_construct()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&_set_prototype_of(o,r.prototype),o},_construct.apply(null,arguments)}function _define_property(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _get_prototype_of(t){return _get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},_get_prototype_of(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_set_prototype_of(t,e)}function _instanceof(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _is_native_function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}function _iterable_to_array_limit(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){_define_property(t,e,r[e])})}return t}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _object_spread_props(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ownKeys(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}function _possible_constructor_return(t,e){return!e||"object"!==_type_of(e)&&"function"!=typeof e?_assert_this_initialized(t):e}function _set_prototype_of(t,e){return _set_prototype_of=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_set_prototype_of(t,e)}function _sliced_to_array(t,e){return _array_with_holes(t)||_iterable_to_array_limit(t,e)||_unsupported_iterable_to_array(t,e)||_non_iterable_rest()}function _type_of(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function _unsupported_iterable_to_array(t,e){if(t){if("string"==typeof t)return _array_like_to_array(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_array_like_to_array(t,e):void 0}}function _wrap_native_super(t){var e="function"==typeof Map?new Map:void 0;return _wrap_native_super=function(t){if(null===t||!_is_native_function(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _construct(t,arguments,_get_prototype_of(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_set_prototype_of(r,t)},_wrap_native_super(t)}function _is_native_reflect_construct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_is_native_reflect_construct=function(){return!!t})()}function _ts_generator(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var Destination=function(){var t=function(t,e){if("collector"===t)return"collector";if(!e)throw new Error("stepId(".concat(t,") requires an id"));return"".concat(t,".").concat(e)},e=function(t,e){var r=t.destinations[e];if(!r)throw new Error("Destination not found: ".concat(e));return r},r=function(t,e){var r=t.transformers[e];if(!r)throw new Error("Transformer not found: ".concat(e));return r},n=function(t,e){var r=t.sources[e];if(!r)throw new Error("Source not found: ".concat(e));return r},o=function(t,e){var r=t.stores[e];if(!r)throw new Error("Store not found: ".concat(e));return r},i=function(t,e){return _async_to_generator(function(){return _ts_generator(this,function(r){switch(r.label){case 0:return[4,t.get(e)];case 1:return[2,r.sent()]}})})()},u=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t&&"then"in t&&"function"==typeof t.then},a=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)},c=function(t){var e=function(){var t=_object_spread({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e={};return Object.keys(t).forEach(function(r){t[r]&&(e[r]=!0)}),e}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return t&&0!==Object.keys(t).length?!!Object.keys(t).some(function(r){return t[r]&&e[r]})&&e:e},f=function(t,e,r){return _async_to_generator(function(){var n;return _ts_generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t()];case 1:return[2,o.sent()];case 2:if(_instanceof(n=o.sent(),I))throw n;throw new I(r,{code:e,cause:n});case 3:return[2]}})})()},l=function(t){var e=(t.startsWith(T)?t.slice(5):t).split(".");return e.some(function(t){return""===t})?[]:e},s=function(t){return"function"==typeof t},p=function(t){return"object"==(void 0===t?"undefined":_type_of(t))&&null!==t},y=function(t,e){if(-1!==V.indexOf(e))return!1;for(var r=t;s(r);){if(Object.prototype.hasOwnProperty.call(r,e))return!0;var n=Object.getPrototypeOf(r);if(!s(n)||!s(Object.getPrototypeOf(n)))return!1;r=n}return!1},d=function(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);return!(r&&!r.configurable)||"value"in r&&!0===r.writable},_=function(t,e){var r=t,n=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var f=a.value;if(s(r)){if(!y(r,f))return!0;if(!d(r,f))return!1}else if(u(r)){if(!(f in r))return!0}else if(!p(r)||!(f in r))return!1;r=Reflect.get(r,f)}}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return s(r)},v=function(t){var e=_object_spread({window:"undefined"!=typeof window?window:globalThis.window,document:"undefined"!=typeof document?document:globalThis.document},t),r=t&&t[q];if(("undefined"==typeof __WALKEROS_OBSERVE__||__WALKEROS_OBSERVE__)&&function(t){if("object"!=(void 0===t?"undefined":_type_of(t))||null===t)return!1;if(!("paths"in t)||!("record"in t))return!1;var e=t.paths,r=t.record;return Array.isArray(e)&&e.every(function(t){return"string"==typeof t})&&"function"==typeof r}(r)){delete e[q];var n=function(t,e,r){var n=[],o=[],i=[],a=!0,c=!1,f=void 0;try{for(var v,b=e[Symbol.iterator]();!(a=(v=b.next()).done);a=!0){var h=v.value,g=l(h);if(0!==g.length){var w=g.join(".");i.push({rest:g,fn:w}),_(t,g)||o.push(w)}}}catch(t){c=!0,f=t}finally{try{a||null==b.return||b.return()}finally{if(c)throw f}}var m=new WeakMap,O=new WeakSet;function j(t,e){var o=!0,i=!1,u=void 0;try{for(var a,c=t[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var f=a.value;if(r)try{r(f,e)}catch(t){}else n.push({fn:f,args:e,ts:Date.now()})}}catch(t){i=!0,u=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw u}}}function P(t,e){return 0===e.length||S(t)?t:u(t)&&!e.some(function(e){return e.rest[0]in t})?Promise.resolve(t).then(function(t){return P(t,e)}):s(t)?M(t,[],e):p(t)?R(t,e):t}function S(t){return(p(t)||s(t))&&O.has(t)}function x(t,e){var r=[],n=[],o=!0,i=!1,u=void 0;try{for(var a,c=t[Symbol.iterator]();!(o=(a=c.next()).done);o=!0){var f=a.value;f.rest[0]===e&&(1===f.rest.length?r.includes(f.fn)||r.push(f.fn):n.push({rest:f.rest.slice(1),fn:f.fn}))}}catch(t){i=!0,u=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw u}}return{leafs:r,deeper:n}}function R(t,e){var r,n=e.map(function(t){return"".concat(t.fn,":").concat(t.rest.join("."))}).join("|"),o=null!==(r=m.get(t))&&void 0!==r?r:new Map;m.set(t,o);var i=o.get(n);if(i)return i;var u=E(t,e);return o.set(n,u),u}function E(t,e){return s(t)?k(t,e):e.some(function(e){return!d(t,e.rest[0])})?function(t,e){var r=Object.create(Object.getPrototypeOf(t)),n=A(t,e,function(){return o}),o=new Proxy(r,{get:function(t,e){return n.get(e)},set:function(e,r,n){return Reflect.set(t,r,n,t)},has:function(e,r){return Reflect.has(t,r)},ownKeys:function(){return Reflect.ownKeys(t)},getOwnPropertyDescriptor:function(e,r){var n=Reflect.getOwnPropertyDescriptor(t,r);return n&&_object_spread_props(_object_spread({},n),{configurable:!0})},defineProperty:function(e,r,n){return Reflect.defineProperty(t,r,n)},deleteProperty:function(e,r){return Reflect.deleteProperty(t,r)}});return O.add(o),o}(t,e):k(t,e)}function k(t,e){var r=A(t,e,function(){return n}),n=new Proxy(t,{get:function(t,e){return"string"!=typeof e||d(t,e)?r.get(e):Reflect.get(t,e,t)},set:function(t,e,r){return Reflect.set(t,e,r,t)}});return O.add(n),n}function A(t,e,r){var n=new Map;return{get:function(o){var i=Reflect.get(t,o,t);if("string"!=typeof o)return i;if(!s(i)&&!p(i))return i;if(S(i))return i;var u=n.get(o);if(u&&u.value===i)return u.out;var a=x(e,o),c=a.leafs,f=a.deeper;if(!(c.length>0||f.length>0)&&(!s(i)||function(t){if(Array.isArray(t))return!0;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}(t)))return i;var l=i;return s(i)?l=M(i,c,f,{proxy:r(),target:t}):f.length>0&&(l=R(i,f)),n.set(o,{value:i,out:l}),l}}}function M(t,e,r,n){var o=function(){return r.filter(function(e){return!y(t,e.rest[0])})},i=new Map,u=new Proxy(t,{get:function(t,e){var n=Reflect.get(t,e,t);if("string"!=typeof e||!d(t,e))return n;if(!y(t,e))return n;var o=x(r,e),a=o.leafs,c=o.deeper;if(0===a.length&&0===c.length)return n;if(S(n))return n;var f=i.get(e);if(f&&f.value===n)return f.out;var l=n;return s(n)?l=M(n,a,c,{proxy:u,target:t}):p(n)&&c.length>0&&(l=R(n,c)),i.set(e,{value:n,out:l}),l},set:function(t,e,r){return Reflect.set(t,e,r,t)},apply:function(t,r,i){j(e,i);var u=!n||r!==n.proxy&&void 0!==r?r:n.target;return P(Reflect.apply(t,u,i),o())},construct:function(t,r,n){j(e,r);var i=Reflect.construct(t,r,n===u?t:n),a=P(i,o());return p(a)||s(a)?a:i}});return O.add(u),u}return{env:E(t,i),calls:n,unresolved:o}}(e,r.paths,r.record).env,o=new Set,i=!0,a=!1,c=void 0;try{for(var f,v=r.paths[Symbol.iterator]();!(i=(f=v.next()).done);i=!0){var b=f.value,h=l(b)[0];if(void 0!==h){var g=e[h];null!==g&&"object"==(void 0===g?"undefined":_type_of(g))&&o.add(h)}}}catch(t){a=!0,c=t}finally{try{i||null==v.return||v.return()}finally{if(a)throw c}}var w=Array.from(o,function(t){return[t,n[t]]}),m=!0,O=!1,j=void 0;try{for(var P,S=w[Symbol.iterator]();!(m=(P=S.next()).done);m=!0){var x=_sliced_to_array(P.value,2),R=x[0],E=x[1];e[R]=E}}catch(t){O=!0,j=t}finally{try{m||null==S.return||S.return()}finally{if(O)throw j}}}return e},b=function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var u=null!=(r=i.document)?r:"undefined"!=typeof document?document:void 0;if(!u)throw new I("Vendor script ".concat(t," has no document to go into"),{code:"vendor-not-ready"});o=function(t,e,r,n,o){var i=function(t,e){var r=t.querySelectorAll("script[".concat(W,"]"));return Array.from(r).find(function(t){return t.getAttribute("src")===e})}(t,e),u=i&&B.get(i);if(u)return u;var a={state:"loading",expired:!1,timeout:r,waiting:[]};if(i&&o())return a.state="loaded",B.set(i,a),a;var c=null!=i?i:t.createElement("script"),f=function(t){var e=a.waiting;a.waiting=[],e.forEach(function(e){return e(t)})},l=setTimeout(function(){a.expired=!0,f("expired")},r);if(B.set(c,a),c.addEventListener("load",function(){clearTimeout(l),a.state="loaded",f("loaded")}),c.addEventListener("error",function(){clearTimeout(l),a.state="failed",f("failed")}),!i){var s=!0,p=!1,y=void 0;try{for(var d,_=Object.entries(n)[Symbol.iterator]();!(s=(d=_.next()).done);s=!0){var v=_sliced_to_array(d.value,2),b=v[0],h=v[1];c.setAttribute(b,h)}}catch(t){p=!0,y=t}finally{try{s||null==_.return||_.return()}finally{if(p)throw y}}c.src=e,c.async=!0,c.setAttribute(W,""),t.head.appendChild(c)}return a}(u,t,function(t){return"number"==typeof t&&t>0?t:1e4}(i.timeout),null!=(n=i.attributes)?n:{},function(){return null!=e()})}var a=function(){var t=e();return null==t?Promise.reject(new I("Vendor not ready: its global is missing",{code:"vendor-not-ready"})):Promise.resolve(t)};return{ready:function(){return o?"failed"===o.state?Promise.reject(G()):"loaded"===o.state||o.expired?a():new Promise(function(t,e){o.waiting.push(function(r){var n;"failed"===r?e(G()):"expired"===r?e((n=o.timeout,new I("Vendor script did not load within ".concat(n,"ms"),{code:"vendor-timeout"}))):a().then(t,e)})}):a()},check:function(){if("failed"===(null==o?void 0:o.state))throw G()}}},h=function(t,e){return b(t.loadScript?K:void 0,function(){return v(e).window.fbq},{timeout:t.timeout,document:v(e).document})},g=function(t){var e=v(t).window.fbq;if(!e)throw new I("Meta Pixel not ready: window.fbq is missing",{code:"vendor-not-ready"});return e},w=Object.defineProperty,m=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,j=Object.prototype.hasOwnProperty,P=function(t,e,r){return function(t,e,r){return e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r}(t,"symbol"!==(void 0===e?"undefined":_type_of(e))?e+"":e,r)},S={};!function(t,e){for(var r in e)w(t,r,{get:e[r],enumerable:!0})}(S,{DestinationMeta:function(){return z},default:function(){return L},destinationMeta:function(){return C}});var x=Object.defineProperty,R=function(t,e){for(var r in e)x(t,r,{get:e[r],enumerable:!0})};R({},{stepId:function(){return t}});R({},{getDestination:function(){return e}});R({},{Level:function(){return k}});var E,k=((E=k||{})[E.ERROR=0]="ERROR",E[E.WARN=1]="WARN",E[E.INFO=2]="INFO",E[E.DEBUG=3]="DEBUG",E);R({},{getTransformer:function(){return r}});R({},{getSource:function(){return n}});R({},{getStore:function(){return o},getStoreValue:function(){return i}});var A,M="\\$flow\\.(".concat("[a-zA-Z_][a-zA-Z0-9_-]*",")(?:\\.([a-zA-Z0-9_.]+))?"),D=(new RegExp("^".concat(M,"$")),new RegExp(M,"g"),["transport","timeout","breaker-open","blocked","queue-full","vendor-not-ready","vendor-timeout"]),I=function(t){function e(t,r){var n;return _class_call_check(this,e),n=_call_super(this,e,[t]),P(n,"code"),P(n,"status"),P(n,"retryable"),P(n,"body"),void 0!==r.cause&&function(t,e){Object.defineProperty(t,"cause",{value:e,writable:!0,configurable:!0})}(n,r.cause),n.name="StepError",n.code=r.code,void 0!==r.status&&(n.status=r.status),n.retryable=function(t){if(void 0!==t.retryable)return t.retryable;var e=t.status;if(void 0!==e){if(429===e||e>=500&&e<600)return!0;if(e>=400&&e<500)return!1}return D.includes(t.code)}(r),void 0!==r.body&&(n.body=r.body),Object.setPrototypeOf(n,(_instanceof(this,e)?this.constructor:void 0).prototype),n}return _inherits(e,t),e}(_wrap_native_super(Error)),q="observe",T="call:",V=["name","length","prototype","arguments","caller"],W="data-walkeros-vendor",B=new WeakMap,G=function(){return new I("Vendor script failed to load",{code:"vendor-not-loaded"})},K="https://connect.facebook.net/en_US/fbevents.js",z={},C={type:"meta-pixel",config:{},init:function(t){return _async_to_generator(function(t){var e,r,n,o;return _ts_generator(this,function(i){switch(i.label){case 0:if(e=t.config,r=t.env,!(n=(e.settings||{}).pixelId))throw new I("Meta Pixel needs settings.pixelId",{code:"config"});return function(t){var e=v(t).window;if(!e.fbq){var r=Object.assign(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.callMethod?r.callMethod.apply(r,e):r.queue.push(e)},{queue:[]});r.push=r,r.loaded=!0,r.version="2.0",e.fbq=r,e._fbq||(e._fbq=r)}}(r),h(e,r),o=g(r),[4,f(function(){return o("init",n)},"vendor-not-ready","Meta Pixel init call failed")];case 1:return i.sent(),[2]}})}).apply(this,arguments)},push:function(t,e){return _async_to_generator(function(t,e){var r,n,o,i,u,c,l,s,p,y;return _ts_generator(this,function(d){switch(d.label){case 0:return r=e.config,n=e.rule,o=void 0===n?{}:n,i=e.data,u=e.env,h(r,u).check(),c=g(u),l=o.settings||{},s=l.track,p=l.trackCustom,"page view"!==t.name||o.settings||(t.name="PageView"),y=s||p||t.name,o.silent?[3,2]:[4,f(function(){return c(p?"trackCustom":"track",String(y),a(i)?i:{},{eventID:t.id})},"transport","Meta Pixel call failed")];case 1:d.sent(),d.label=2;case 2:return[2]}})}).apply(this,arguments)},on:function(t,e){return _async_to_generator(function(t,e){var r,n,o,i,u,l,s;return _ts_generator(this,function(p){switch(p.label){case 0:return r=e.config,n=e.data,o=e.env,i=e.collector,u=r.consent,"consent"===t&&u&&a(n)?Object.keys(u).some(function(t){return t in n})?(l=!1!==c(u,i.consent),"function"!=typeof(s=v(o).window.fbq)?[2]:[4,f(function(){return s("consent",l?"grant":"revoke")},"consent-not-applied","Meta Pixel did not take the consent update")]):[2]:[2];case 1:return p.sent(),[2]}})}).apply(this,arguments)}},L=C;return A=S,function(t,e,r,n){if(e&&"object"===(void 0===e?"undefined":_type_of(e))||"function"==typeof e){var o=!0,i=!1,u=void 0;try{for(var a,c=function(){var o=a.value;j.call(t,o)||o===r||w(t,o,{get:function(){return e[o]},enumerable:!(n=m(e,o))||n.enumerable})},f=O(e)[Symbol.iterator]();!(o=(a=f.next()).done);o=!0)c()}catch(t){i=!0,u=t}finally{try{o||null==f.return||f.return()}finally{if(i)throw u}}}return t}(w({},"__esModule",{value:!0}),A)}();
|
package/dist/walkerOS.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-destination-meta",
|
|
3
3
|
"description": "Meta pixel web destination for walkerOS",
|
|
4
|
-
"version": "4.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u && npm update"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@walkeros/core": "4.9.0
|
|
42
|
-
"@walkeros/web-core": "4.9.0
|
|
41
|
+
"@walkeros/core": "4.9.0",
|
|
42
|
+
"@walkeros/web-core": "4.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/facebook-pixel": "^0.0.31",
|
|
46
|
-
"@walkeros/collector": "4.9.0
|
|
46
|
+
"@walkeros/collector": "4.9.0"
|
|
47
47
|
},
|
|
48
48
|
"repository": {
|
|
49
49
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|