New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@builder.io/partytown

Package Overview
Dependencies
Maintainers
10
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/partytown - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

index.cjs

6

integration/index.d.ts

@@ -44,5 +44,7 @@ /**

/**
* Root directory the Partytown library files can be found.
* The library path must end with a `/`.
* An absolute path to the root directory which Partytown library files
* can be found. The library path must start and end with a `/`.
* By default the files will load from the server's `/~partytown/` directory.
* Note that the library path must be on the same origin as the html document,
* and is also used as the `scope` of the Partytown service worker.
*/

@@ -49,0 +51,0 @@ lib?: string;

@@ -6,4 +6,4 @@ {

"types": "index.d.ts",
"version": "0.0.15",
"version": "0.0.16",
"private": true
}

@@ -22,8 +22,4 @@ const isPromise = v => "object" == typeof v && v && v.then;

const isValidMemberName = memberName => !(startsWith(memberName, "webkit") || startsWith(memberName, "toJSON") || startsWith(memberName, "constructor") || startsWith(memberName, "toString"));
const isValidMemberName = memberName => !(startsWith(memberName, "webkit") || startsWith(memberName, "toJSON") || startsWith(memberName, "constructor") || startsWith(memberName, "toString") || startsWith(memberName, "_"));
const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
const randomId = () => Math.round(9999999999 * Math.random() + 4);

@@ -106,3 +102,3 @@

$instanceId$: 0
} ] : "HTMLCollection" === cstrName || "NodeList" === cstrName ? [ 7, Array.from(value).map((v => serializeForWorker($winId$, v, added)[1])) ] : "Event" === cstrName ? [ 4, serializeObjectForWorker($winId$, value, added) ] : "CSSRuleList" === cstrName ? [ 3, Array.from(value).map(serializeCssRuleForWorker) ] : cstrName.startsWith("CSS") && cstrName.endsWith("Rule") ? [ 2, serializeCssRuleForWorker(value) ] : "CSSStyleDeclaration" === cstrName ? [ 8, serializeObjectForWorker($winId$, value, added) ] : "Attr" === cstrName ? [ 1, [ value.name, value.value ] ] : value.nodeType ? [ 6, {
} ] : "HTMLCollection" === cstrName || "NodeList" === cstrName ? [ 7, Array.from(value).map((v => serializeForWorker($winId$, v, added)[1])) ] : "Event" === cstrName ? [ 4, serializeObjectForWorker($winId$, value, added) ] : "CSSRuleList" === cstrName ? [ 3, Array.from(value).map(serializeCssRuleForWorker) ] : startsWith(cstrName, "CSS") && cstrName.endsWith("Rule") ? [ 2, serializeCssRuleForWorker(value) ] : "CSSStyleDeclaration" === cstrName ? [ 8, serializeObjectForWorker($winId$, value, added) ] : "Attr" === cstrName ? [ 1, [ value.name, value.value ] ] : value.nodeType ? [ 6, {
$winId$: $winId$,

@@ -109,0 +105,0 @@ $instanceId$: getAndSetInstanceId(value),

@@ -15,5 +15,3 @@ (window => {

const startsWith = (str, val) => str.startsWith(val);
const isValidMemberName = memberName => !(startsWith(memberName, "webkit") || startsWith(memberName, "toJSON") || startsWith(memberName, "constructor") || startsWith(memberName, "toString"));
const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
const isValidMemberName = memberName => !(startsWith(memberName, "webkit") || startsWith(memberName, "toJSON") || startsWith(memberName, "constructor") || startsWith(memberName, "toString") || startsWith(memberName, "_"));
const randomId = () => Math.round(9999999999 * Math.random() + 4);

@@ -86,3 +84,3 @@ const instanceIds = new WeakMap;

$instanceId$: 0
} ] : "HTMLCollection" === cstrName || "NodeList" === cstrName ? [ 7, Array.from(value).map((v => serializeForWorker($winId$, v, added)[1])) ] : "Event" === cstrName ? [ 4, serializeObjectForWorker($winId$, value, added) ] : "CSSRuleList" === cstrName ? [ 3, Array.from(value).map(serializeCssRuleForWorker) ] : cstrName.startsWith("CSS") && cstrName.endsWith("Rule") ? [ 2, serializeCssRuleForWorker(value) ] : "CSSStyleDeclaration" === cstrName ? [ 8, serializeObjectForWorker($winId$, value, added) ] : "Attr" === cstrName ? [ 1, [ value.name, value.value ] ] : value.nodeType ? [ 6, {
} ] : "HTMLCollection" === cstrName || "NodeList" === cstrName ? [ 7, Array.from(value).map((v => serializeForWorker($winId$, v, added)[1])) ] : "Event" === cstrName ? [ 4, serializeObjectForWorker($winId$, value, added) ] : "CSSRuleList" === cstrName ? [ 3, Array.from(value).map(serializeCssRuleForWorker) ] : startsWith(cstrName, "CSS") && cstrName.endsWith("Rule") ? [ 2, serializeCssRuleForWorker(value) ] : "CSSStyleDeclaration" === cstrName ? [ 8, serializeObjectForWorker($winId$, value, added) ] : "Attr" === cstrName ? [ 1, [ value.name, value.value ] ] : value.nodeType ? [ 6, {
$winId$: $winId$,

@@ -89,0 +87,0 @@ $instanceId$: getAndSetInstanceId(value),

@@ -1,5 +0,1 @@

const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
const resolves = new Map;

@@ -6,0 +2,0 @@

@@ -170,3 +170,2 @@ (self => {

const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
const randomId = () => Math.round(9999999999 * Math.random() + 4);

@@ -173,0 +172,0 @@ const definePrototypeProperty = (Cstr, memberName, descriptor) => Object.defineProperty(Cstr.prototype, memberName, {

@@ -170,3 +170,2 @@ (self => {

const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
const randomId = () => Math.round(9999999999 * Math.random() + 4);

@@ -173,0 +172,0 @@ const definePrototypeProperty = (Cstr, memberName, descriptor) => Object.defineProperty(Cstr.prototype, memberName, {

@@ -1,7 +0,3 @@

const EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
!function(win, doc, nav, libPath, sandbox, scripts, timeout) {
function ready(msgType) {
function loadSandbox(msgType) {
if (!sandbox) {

@@ -24,33 +20,36 @@ (sandbox = doc.createElement("iframe")).dataset.partytown = "sandbox";

}
libPath = (win.partytown || {}).lib || "/~partytown/";
libPath += "debug/";
scripts = doc.querySelectorAll('script[type="text/partytown"]');
if (top !== win) {
top.dispatchEvent(new CustomEvent("pt1", {
detail: win
}));
} else if (scripts.length) {
timeout = setTimeout(fallback, 6e4);
doc.addEventListener("pt0", (function() {
clearTimeout(timeout);
}));
let useAtomics = win.crossOriginIsolated;
useAtomics && (useAtomics = !window.location.search.includes("forceServiceWorker"));
if (useAtomics) {
ready("atomics");
} else if ("serviceWorker" in nav) {
const isolatedQuery = win.crossOriginIsolated ? "?isolated" : "";
nav.serviceWorker.register(libPath + "partytown-sw.js" + isolatedQuery, {
scope: libPath
}).then((function(swRegistration) {
swRegistration.active ? ready("sw") : swRegistration.installing ? swRegistration.installing.addEventListener("statechange", (function(ev) {
"activated" === ev.target.state && ready("sw");
})) : console.warn(swRegistration);
}), (function(e) {
console.error(e);
function ready() {
libPath = (win.partytown || {}).lib || "/~partytown/";
libPath += "debug/";
scripts = doc.querySelectorAll('script[type="text/partytown"]');
if (top !== win) {
top.dispatchEvent(new CustomEvent("pt1", {
detail: win
}));
} else {
fallback();
} else if (scripts.length) {
timeout = setTimeout(fallback, 6e4);
doc.addEventListener("pt0", (function() {
clearTimeout(timeout);
}));
let useAtomics = win.crossOriginIsolated;
useAtomics && (useAtomics = !window.location.search.includes("forceServiceWorker"));
if (useAtomics) {
loadSandbox("atomics");
} else if ("serviceWorker" in nav) {
const isolatedQuery = win.crossOriginIsolated ? "?isolated" : "";
nav.serviceWorker.register(libPath + "partytown-sw.js" + isolatedQuery, {
scope: libPath
}).then((function(swRegistration) {
swRegistration.active ? loadSandbox("sw") : swRegistration.installing ? swRegistration.installing.addEventListener("statechange", (function(ev) {
"activated" === ev.target.state && loadSandbox("sw");
})) : console.warn(swRegistration);
}), (function(e) {
console.error(e);
}));
} else {
fallback();
}
}
}
"complete" === doc.readyState ? ready() : window.addEventListener("load", ready);
}(window, document, navigator);

@@ -1,1 +0,1 @@

const t=new Map,e=(t,e)=>({C:t.C,l:e}),r=(t,e,r)=>{const n={"content-type":r||"text/html","Cache-Control":"no-store"};return e&&(n["Cross-Origin-Embedder-Policy"]="require-corp"),new Response(t,{headers:n})};self.oninstall=()=>self.skipWaiting(),self.onactivate=()=>self.clients.claim(),self.onmessage=e=>{const r=e.data,n=t.get(r.C);n&&(t.delete(r.C),clearTimeout(n[1]),n[0](r))},self.onfetch=n=>{const s=n.request,o=new URL(s.url).pathname;o.endsWith("partytown-sandbox-sw.html")?n.respondWith(r('<!DOCTYPE html><html><head><meta charset="utf-8"><script type="module">(t=>{const e=()=>!0,r=t=>t.length,n=t=>t&&t.constructor&&t.constructor.name||"",s=(t,e)=>t.startsWith(e),o=t=>!(s(t,"webkit")||s(t,"toJSON")||s(t,"constructor")||s(t,"toString")),i=()=>Math.round(9999999999*Math.random()+4),a=new WeakMap,c=new Map,l=new Map,u={},h=new WeakMap,d=(t,e,r)=>t?t===t.window?0:"#document"===(r=t.nodeName)?1:"HTML"===r?2:"HEAD"===r?3:"BODY"===r?4:("number"!=typeof(e=a.get(t))&&m(t,e=i()),e):-1,p=(t,e,r)=>{const n=u[t].M,s=n.document;return 0===e?n:1===e?s:2===e?s.documentElement:3===e?s.head:4===e?s.body:c.get(e)},m=(t,e)=>{t&&(c.set(e,t),a.set(t,e),g++,g>99999&&(c.forEach(((t,e)=>{t.nodeType&&!t.isConnected&&c.delete(e)})),g=0))};let g=0;const f=(t,e,r,s,o)=>{if(void 0!==e){if("string"==(s=typeof e)||"number"===s||"boolean"===s||null==e)return[9,e];if("function"===s)return[5];if(r=r||new Set,Array.isArray(e))return r.has(e)?[0,[]]:(r.add(e),[0,e.map((e=>f(t,e,r)))]);if("object"===s)return"Window"===(o=n(e))?[6,{P:t,t:0}]:"HTMLCollection"===o||"NodeList"===o?[7,Array.from(e).map((e=>f(t,e,r)[1]))]:"Event"===o?[4,y(t,e,r)]:"CSSRuleList"===o?[3,Array.from(e).map($)]:o.startsWith("CSS")&&o.endsWith("Rule")?[2,$(e)]:"CSSStyleDeclaration"===o?[8,y(t,e,r)]:"Attr"===o?[1,[e.name,e.value]]:e.nodeType?[6,{P:t,t:d(e),D:e.nodeName}]:[8,y(t,e,r,!0,!0)]}},y=(t,e,r,n,s,i,a,c)=>{if(i={},!r.has(e))for(a in r.add(e),e)o(a)&&(c=e[a],(n||"function"!=typeof c)&&(s||""!==c)&&(i[a]=f(t,c,r)));return i},$=t=>{let e,r={};for(e in t)E.includes(e)&&(r[e]=t[e]);return r},w=(t,e,r,n)=>{if(e){if(r=e[0],n=e[1],9===r)return n;if(10===r)return v(t,n);if(0===r)return n.map((e=>w(t,e)));if(6===r)return p(n.P,n.t);if(4===r)return b(T(t,n));if(8===r)return T(t,n)}},v=(t,{P:e,t:r,G:n})=>{let s=l.get(n);return s||(s=function(...s){const o={t:r,G:n,K:f(e,this),b:f(e,s)};t.postMessage([7,o])},l.set(n,s)),s},b=t=>new("detail"in t?CustomEvent:Event)(t.type,t),T=(t,e,r,n)=>{for(n in r={},e)r[n]=w(t,e[n]);return r},E="cssText,selectorText,href,media,namespaceURI,prefix,name,conditionText".split(","),S=(t,e,n,s)=>{let o,i,a,c,l=0,u=r(n);for(;l<u;l++){i=n[l],o=n[l+1],a=n[l-1];try{if(!Array.isArray(o))if("string"==typeof i||"number"==typeof i){if(l+1===u&&s){const t={};return s.map((r=>t[r]=e[r])),t}e=e[i]}else{if(0===o)return void(e[a]=w(t,i));"function"==typeof e[a]&&(c=w(t,i),"insertRule"===a&&c[1]>r(e.cssRules)&&(c[1]=r(e.cssRules)),e=e[a].apply(e,c))}}catch(t){console.warn(t)}}return e},N=(t,e,r)=>{if(!h.has(r)){h.set(r,e);const n=r.document,s=n.baseURI,o={P:e,E:h.get(r.parent),L:s},i=()=>t.postMessage([3,o]);u[e]={P:e,M:r,L:s},"complete"===n.readyState?i():r.addEventListener("load",i)}},M=(t,e)=>{let n,s,o=e.P,i=e.M,a=i.document,c=a.querySelector(\'script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])\');c||(c=a.querySelector(\'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])\')),c?(c.dataset.ptid=n=d(c,o),s={P:o,t:n},c.src?s.L=c.src:s.f=c.innerHTML,t.postMessage([6,s])):e.v||(e.v=1,((t,e,n)=>{let s=n._ptf,o=n._ptf=[],i=0;if(o.push=(r,n)=>t.postMessage([8,{P:e,t:0,m:r,b:f(e,Array.from(n))}]),s)for(;i<r(s);i+=2)o.push(s[i],s[i+1])})(t,o,i),a.dispatchEvent(new CustomEvent("pt0")),t.postMessage([4,o]))},L=t=>{const r=t.document.implementation.createHTMLDocument(),n=r.createTextNode(""),s=r.createComment(""),o=r.createDocumentFragment(),i=r.createElement("i"),a=r.createElementNS("http://www.w3.org/2000/svg","svg"),c=r.createElement("canvas").getContext("2d"),l=new MutationObserver(e),u=new ResizeObserver(e),h=Object.getOwnPropertyNames(t).filter((t=>/^HTML.+Element$/.test(t))).map((t=>{const e=C(t);return[r.createElement(e)]})),d=[[t.localStorage],[t.history],[t.screen],[t.screen.orientation],[l,12],[u,12],[n],[s],[o],[i],[i.attributes],[i.classList],[i.dataset],[i.style],[a],[r],[r.doctype],[c],...h].filter((t=>t[0])).map((e=>{const r=e[0],n=e[1],s=r.constructor.name;return[s,t[s].prototype,r,n]})),p=[I("Window",t),I("Node",n)],m=t.partytown||{},g=(m.lib||"/~partytown/")+"",f={e:JSON.stringify(m,((t,e)=>"function"==typeof e?String(e):e)),z:new URL(g,t.location)+"",s:p};return d.map((([t,e,r,n])=>R(p,t,e,r,n))),f},I=(t,e)=>{const r=[],n=[t,"Object",r];for(const t in e)x(r,e,t);return n},R=(t,e,r,n,s)=>{if("Object"!==e&&!t.some((t=>t[0]===e))){const o=Object.getPrototypeOf(r),i=o.constructor.name,a=[];R(t,i,o,n,s),Object.keys(Object.getOwnPropertyDescriptors(r)).map((t=>x(a,n,t)));const c=[e,i,a,s,n.nodeName];t.push(c)}},x=(t,e,r,s)=>{if(o(r)){const o=e[r],i=typeof o;"function"===i?String(o).includes("[native")&&t.push([r,5]):"object"===i&&null!=o&&"Object"!==(s=n(o))?o.nodeType?t.push([r,o.nodeType]):t.push([r,s]):"symbol"!==i&&(r.toUpperCase()===r?t.push([r,6,o]):t.push([r,6]))}},O={Anchor:"A",DList:"DL",Image:"IMG",OList:"OL",Paragraph:"P",TableCaption:"CAPTION",TableCell:"TD",TableCol:"COLGROUP",TableRow:"TR",TableSection:"TBODY",UList:"UL"},C=t=>(t=t.substr(4).replace("Element",""),O[t]||t);(async t=>{let e;const n=t.parent,s=await(async(t,n)=>{const s=t.navigator.serviceWorker,o=await s.getRegistration();return s.addEventListener("message",(t=>{return n=t.data,s=t=>o.active&&o.active.postMessage(t),(async(t,e)=>{const n={C:e.C},s=r(e.J);for(let r=0;r<s;r++)try{let s,i,a=e.J[r],c=a.P,l=a.t,h=a.a;if(u[c]||await new Promise((t=>{let e=0,r=()=>{u[c]||e++>999?t():setTimeout(r,9)};r()})),1===h[0]&&h[1]in u[c].M){const e=new u[c].M[h[1]](...w(t,h[2]));m(e,l)}else s=p(c,l),s?(i=S(t,s,h,a.o),a.c&&m(i,a.c),"object"==typeof(o=i)&&o&&o.then&&(i=await i,n.w=!0),n.H=f(c,i)):n.l=l+" not found"}catch(t){r===s-1?n.l=String(t.stack||t):console.error(t)}var o;return n})(e,n).then(s);var n,s})),o?(t,e,r)=>{0===r[0]?t.postMessage([1,L(e)]):((t,e,r)=>{const n=r[0];if(2===n)N(t,i(),e);else{const e=r[1],s=u[e];s&&(6===n?M(t,s):5===n&&((t,e,r,n,s)=>{(s=e.M.document.querySelector(`[data-ptid="${r}"]`))&&(n?s.dataset.pterror=n:s.type+="-x"),M(t,e)})(t,s,r[2],r[3]))}})(t,e,r)}:null})(t);s&&(e=new Worker(URL.createObjectURL(new Blob([\'(t=>{const e=Symbol(),r=Symbol(),n=Symbol(),s=Symbol(),i=Symbol(),o=Symbol(),a=new Map,c={},l=new WeakMap,u={},h={},$={},d={},p=new Map,g=new Map,m="getClientRects,getBoundingClientRect".split(","),f="innerHeight,innerWidth,outerHeight,outerWidth,clientHeight,clientWidth,clientTop,clientLeft,scrollHeight,scrollWidth,scrollTop,scrollLeft,offsetHeight,offsetWidth,offsetTop,offsetLeft".split(","),w="childElementCount,children,firstElementChild,lastElementChild,nextElementSibling,previousElementSibling",y=()=>!0,v=t=>t.length,I=(t,e)=>Object.defineProperty(t,"name",{value:e}),E=[],b=()=>Math.round(9999999999*Math.random()+4),S="text/partytown",T=(t,e,r)=>Object.defineProperty(t.prototype,e,{...r,configurable:!0}),N=(t,e)=>Object.defineProperties(t.prototype,e),M=(t,e,r)=>T(t,e,{value:r,writable:!0}),x=[],L=(t,n,s,o,a)=>{const c=t[r];if(x.push({P:t[e],t:c,a:[...t[i],...n],c:o,o:a}),!s)return C();setTimeout(C,40)},C=()=>{if(v(x)){const t=x[v(x)-1],e={C:b(),J:x.slice()};x.length=0;const r=((t,e)=>{const r=new XMLHttpRequest,n=t.z+"proxytown";return r.open("POST",n,!1),r.send(JSON.stringify(e)),JSON.parse(r.responseText)})($,e),n=r.w,s=nt(t.t,t.a,r.H);if(r.l){if(n)return Promise.reject(r.l);throw new Error(r.l)}return n?Promise.resolve(s):s}},W=(t,e,r)=>L(t,e,!1,void 0,r),R=(t,e,r)=>{const n=[...e,rt(t,r),0];L(t,n,!0)},H=(t,e,r,n)=>{const s=e[v(e)-1],i=P.includes(s),o=[...e,rt(t,r)],a=L(t,o,i,n);return i||m.includes(s)||p.clear(),a},P="addEventListener,removeEventListener,createElement,createTextNode,insertBefore,insertRule,deleteRule,setAttribute,setItem,removeItem,classList.add,classList.remove,classList.toggle".split(","),O=(t,e,r,n)=>{let s=a.get(e);return s||(s=A(t,e,r,n),a.set(e,s)),s},A=(e,r,n,s)=>new(u[n]?u[n]:n.includes("-")?u.UNKNOWN:t.HTMLElement)(e,r,[],n,s),j=(t,e)=>e in t[o],D=(t,e)=>t[o][e],k=(t,e,r)=>t[o][e]=r,B=(t,e,r,n)=>{let s="";try{t.g=e,F(t,r)}catch(t){console.error(r,t),s=String(t.stack||t)+""}return t.g=-1,s},F=(t,e)=>{new Function(`with(this){${e}}`).apply(t.M)},U=(t,e,r)=>{(r=D(t,e))&&setTimeout((()=>r.map((t=>t({type:e})))),undefined)},_=(t,e,r)=>{for(r=t.A;!r.host&&(r=(t=d[t.E]).A,t.P!==t.E););const n=new URL(e||"",r);if($.e.resolveUrl){const t=$.e.resolveUrl(n,r);if(t)return t}return n},z=(t,e)=>_(t,e)+"",J=t=>_(Q(t),D(t,4)),q=()=>`<script src=${JSON.stringify($.z+"partytown.js")} async defer><\\\\/script>`,G=t=>class{constructor(){this.s="",this.l=[],this.e=[]}get src(){return this.s}set src(e){fetch(z(t,e),{mode:"no-cors",keepalive:!0}).then((t=>{t.ok||0===t.status?this.l.map((t=>t({type:"load"}))):this.e.map((t=>t({type:"error"})))}),(()=>this.e.forEach((t=>t({type:"error"})))))}addEventListener(t,e){"load"===t&&this.l.push(e),"error"===t&&this.e.push(e)}get onload(){return this.l[0]}set onload(t){this.l=[t]}get onerror(){return this.e[0]}set onerror(t){this.e=[t]}};class V extends URL{assign(){}reload(){}replace(){}}class X{constructor(t,a,c,l,u){this[e]=t,this[r]=a,this[i]=c||[],this[n]=l,this[o]={},u&&(this[s]=u)}}class Y extends X{constructor(t,e,r,n){return super(t,e,r,n),new Proxy(this,{get:(t,e)=>W(t,[e]),set:(t,e,r)=>(R(t,[e],r),!0)})}}class Window extends X{constructor(e,r,n){super(e,0);for(const e in t)if(!(e in this)&&"onmessage"!==e){const r=t[e];if(null!=r){const n="function"==typeof r&&!r.toString().startsWith("class");this[e]=n?r.bind(t):r}}Object.getOwnPropertyNames(t).map((e=>{e in this||(this[e]=t[e])}));for(const t in h)this[t]=I(class{constructor(...r){const n=new(0,h[t])(e,b()),s=rt(n,r);return L(n,[1,t,s]),n}},t);const s=new Proxy(this,{has:()=>!0});return d[e]={P:e,E:r,M:s,j:A(e,1,"#document"),k:A(e,2,"HTML"),p:A(e,3,"HEAD"),d:A(e,4,"BODY"),A:new V(n)},this.requestAnimationFrame=t=>setTimeout((()=>t(performance.now())),9),this.cancelAnimationFrame=t=>clearTimeout(t),s}get Audio(){return t=Q(this),class{constructor(e){const r=t.j.createElement("audio");return r.src=e,r}};var t}get body(){return Q(this).d}get document(){return Q(this).j}get documentElement(){return Q(this).k}get frameElement(){const t=Q(this),e=t.E,r=t.P;return r===e?null:O(e,r,"IFRAME")}get globalThis(){return this}get head(){return Q(this).p}get location(){return Q(this).A}set location(t){Q(this).A.href=t+""}get Image(){return G(Q(this))}get name(){const t=this[e];return name+t}get navigator(){return(e=>{const r=t.navigator;return r.sendBeacon=(t,r)=>{const n=d[e];try{return fetch(z(n,t),{method:"POST",body:r,mode:"no-cors",keepalive:!0}),!0}catch(t){return console.error(t),!1}},r})(this[e])}get origin(){return Q(this).A.origin}get parent(){return d[Q(this).E].M}get self(){return this}get top(){for(const t in d)if(d[t].P===d[t].E)return d[t].M}get window(){return this}}const K=({P:t,E:e,L:r})=>{d[t]?d[t].A.href=r:new Window(t,e,r),$.F([6,t])},Q=t=>d[t[e]];class Node extends X{appendChild(t){return this.insertBefore(t,null)}get href(){}set href(t){}insertBefore(t,s){const i=t[e]=this[e],o=t[r],a=t[n],c="SCRIPT"===a,l="IFRAME"===a;if(c){const e=D(t,3);if(e){const r=B(Q(t),o,e),n=r?"pterror":"ptid",s=r||o;R(t,["type"],S+"-x"),R(t,["dataset",n],s),R(t,["innerHTML"],e)}}return H(this,["insertBefore"],[t,s]),l&&(t=>{let e=0;const n=t[r],s=()=>{if(d[n]&&d[n].v){let e=D(t,1)?"error":"load",r=D(t,e);r&&r.map((t=>t({type:e})))}else if(e++>2e3){let e=D(t,"error");e&&e.map((t=>t({type:"error"}))),console.error("Timeout")}else setTimeout(s,9)};s()})(t),c&&(C(),$.F([6,i])),t}get nodeName(){return this[n]}get nodeType(){return 3}get ownerDocument(){return Q(this).j}}class Z{constructor(t){this.name=t[0],this.value=t[1]}get nodeName(){return this.name}get nodeType(){return 2}}class NodeList{constructor(t){(this._=t).map(((t,e)=>this[e]=t))}entries(){return this._.entries()}forEach(t,e){this._.map(t,e)}item(t){return this[t]}keys(){return this._.keys()}get length(){return v(this._)}values(){return this._.values()}[Symbol.iterator](){return this._[Symbol.iterator]()}}const tt=(t,n,s,i)=>{if(void 0!==s){let u=typeof s;if("string"===u||"boolean"===u||"number"===u||null==s)return[9,s];if("function"===u)return[10,{P:t,t:n,G:(o=s,(a=l.get(o))||(l.set(o,a=b()),c[a]=o),a)}];if(i=i||new Set,Array.isArray(s))return i.has(s)?[0,[]]:[0,s.map((e=>tt(t,n,e,i)))];if("object"===u)return"number"==typeof s[r]?[6,{P:s[e],t:s[r]}]:s instanceof Event?[4,et(t,n,s,!1,i)]:[8,et(t,n,s,!0,i)]}var o,a},et=(t,e,r,n,s,i,o,a)=>{if(i={},!s.has(r))for(o in s.add(r),r)a=r[o],(n||"function"!=typeof a)&&(i[o]=tt(t,e,a,s));return i},rt=(t,n)=>t?tt(t[e],t[r],n):[9,n],nt=(t,e,r,n,s)=>{if(r){if(n=r[0],s=r[1],9===n||2===n||3===n)return s;if(10===n)return at(e,s);if(6===n)return it(s);if(7===n)return new NodeList(s.map(it));if(1===n)return new Z(s);if(0===n)return s.map((r=>nt(t,e,r)));if(4===n)return i=st(t,e,s),new Proxy(new Event(i.type,i),{get:(t,e)=>e in i?i[e]:t[String(e)]});if(8===n)return st(t,e,s)}var i},st=(t,e,r,n,s)=>{for(s in n={},r)n[s]=nt(t,[...e,s],r[s]);return n},it=({P:t,t:e,D:r})=>ot(t,e)||O(t,e,r),ot=(t,e)=>{const r=d[t];return 0===e?r.M:1===e?r.j:2===e?r.k:3===e?r.p:4===e?r.d:void 0},at=(t,{P:e,t:r,D:n,G:s})=>(c[s]||l.set(c[s]=function(...s){const i=O(e,r,n);return H(i,t,s)},s),c[s]),ct={sheet:{get(){return new lt(this)}}};class lt{constructor(t){this.ownerNode=t}get cssRules(){const t=this.ownerNode;return new Proxy({},{get(e,r){const n=String(r);return"item"===n?e=>ht(t,e):"length"===n?ut(t).length:isNaN(n)?e[r]:ht(t,n)}})}insertRule(t,e){const r=ut(this.ownerNode);return(e=void 0===e?0:e)>=0&&e<=r.length&&(H(this.ownerNode,["sheet","insertRule"],[t,e]),r.splice(e,0,0)),e}deleteRule(t){H(this.ownerNode,["sheet","deleteRule"],[t]),ut(this.ownerNode).splice(t,1)}}const ut=t=>{let e=D(t,2);return e||(e=W(t,["sheet","cssRules"]),k(t,2,e)),e},ht=(t,e)=>{let r=ut(t);return 0===r[e]&&(r[e]=W(t,["sheet","cssRules",parseInt(e,10)])),r[e]},$t={body:{get(){return Q(this).d}},createElement:{value(t){t=t.toUpperCase();const r=this[e],n=b(),s=O(r,n,t);return H(this,["createElement"],[t],n),"IFRAME"===t?(K({P:n,E:r,L:"about:blank"}),R(s,["srcdoc"],q())):"SCRIPT"===t&&R(s,["type"],S),s}},createElementNS:{value(t,r){r=r.toLowerCase();const n=this[e],s=b(),i=O(n,s,r,t);return H(this,["createElementNS"],[t,r],s),i}},createTextNode:{value(t){const r=this[e],n=b(),s=O(r,n,"#text");return H(this,["createTextNode"],[t],n),s}},createEvent:{value:t=>new Event(t)},currentScript:{get(){const t=this[e],r=Q(this).g;return r>0?O(t,r,"SCRIPT"):null}},defaultView:{get(){return Q(this).M}},documentElement:{get(){return Q(this).k}},getElementsByTagName:{value(t){return"BODY"===(t=t.toUpperCase())?[Q(this).d]:"HEAD"===t?[Q(this).p]:H(this,["getElementsByTagName"],[t])}},head:{get(){return Q(this).p}},implementation:{value:{hasFeature:y}},location:{get(){return Q(this).A},set(t){Q(this).A.href=t+""}},nodeType:{value:9},parentNode:{value:null},parentElement:{value:null},readyState:{value:"complete"}},dt={parentElement:{get(){return this.parentNode}},parentNode:{get(){return Q(this).k}}},pt={parentElement:{value:null},parentNode:{get(){return Q(this).j}}},gt={localName:{get(){return this[n].toLowerCase()}},namespaceURI:{get(){return this[s]||"http://www.w3.org/1999/xhtml"}},nodeType:{value:1},tagName:{get(){return this[n]}}},mt={hash:{get(){return J(this).hash}},host:{get(){return J(this).host}},hostname:{get(){return J(this).hostname}},href:{get(){return J(this).href},set(t){k(this,4,t+=""),R(this,["href"],t)}},origin:{get(){return J(this).origin}},pathname:{get(){return J(this).pathname}},port:{get(){return J(this).port}},protocol:{get(){return J(this).protocol}},search:{get(){return J(this).search}}},ft={getContext:{value(...n){const s=["getContext",rt(this,n)];return new t.CanvasRenderingContext2D(this[e],this[r],s)}}},wt={addEventListener:{value(...t){const e=t[0],r=D(this,e)||[];r.push(t[1]),k(this,e,r)}},async:{get:y,set:y},defer:{get:y,set:y},onload:{get(){let t=D(this,"load");return t&&t[0]||null},set(t){k(this,"load",t?[t]:null)}},onerror:{get(){let t=D(this,"error");return t&&t[0]||null},set(t){k(this,"error",t?[t]:null)}}},yt={contentDocument:{get(){return this.contentWindow.document}},contentWindow:{get(){const t=this[r];return d[t].M}},src:{get(){return D(this,4)||""},set(t){let e,r=new XMLHttpRequest;t=z(Q(this),t),k(this,1,void 0),k(this,4,t),r.open("GET",t,!1),r.send(),e=r.status,e>199&&e<300?R(this,["srcdoc"],((t,e)=>`<base href="${t}">`+e.replace(/<script>/g,\\\'<script type="text/partytown">\\\').replace(/<script /g,\\\'<script type="text/partytown" \\\').replace(/text\\\\/javascript/g,S)+q())(t,r.responseText)):k(this,1,e)}},...wt},vt={get(){return D(this,3)||""},set(t){k(this,3,t)}},It={innerHTML:vt,innerText:vt,src:{get(){return D(this,4)||""},set(t){t=z(Q(this),t),k(this,4,t),R(this,["src"],t)}},getAttribute:{value(t){return"src"===t?this.src:H(this,["getAttribute"],[t])}},setAttribute:{value(t,e){"src"===t?this.src=e:H(this,["setAttribute"],[t,e])}},textContent:vt,type:{get(){return W(this,["type"])},set(t){"text/javascript"!==t&&R(this,["type"],t)}},...wt},Et=([s,o,a,c,l])=>{const $=bt[s]?Y:"Object"===o||"EventTarget"===o?X:t[o],d=t[s]=I(t[s]||class extends ${},s);12===c&&(h[s]=d),l&&(u[l]=d),a.map((([s,o,a])=>{s in d.prototype||s in $.prototype||("string"==typeof o?T(d,s,{get(){if(!j(this,s)){const a=this[e],c=this[r],l=[...this[i],s],u=this[n],h=t[o];k(this,s,new h(a,c,l,u))}return D(this,s)},set(t){k(this,s,t)}}):5===o?M(d,s,(function(...t){return H(this,[s],t)})):o>0&&(void 0!==a?M(d,s,a):T(d,s,{get(){return W(this,[s])},set(t){return R(this,[s],t)}})))}))},bt={CSSStyleDeclaration:1,DOMStringMap:1,NamedNodeMap:1},St=(t,e)=>M(t,"nodeType",e),Tt=(t,e)=>e.split(",").map((e=>T(t,e,{get(){let t=Nt(this,e),r=g.get(t);return r||(r=W(this,[e]),g.set(t,r)),r}}))),Nt=(t,n)=>t[e]+"."+t[r]+"."+n,Mt=(t,e)=>e.split(",").map((e=>T(t,e,{get(){return j(this,e)||k(this,e,W(this,[e])),D(this,e)},set(t){k(this,e,t)}}))),xt=(t,e)=>Object.keys(e).map((r=>M(t,r,e[r]))),Lt=t=>f.map((e=>T(t,e,{get(){const t=p.get(Nt(this,e));if("number"==typeof t)return t;const r=W(this,[e],f);return Object.entries(r).map((([t,e])=>{p.set(Nt(this,t),e)})),r[e]}}))),Ct=t=>m.map((e=>{t.prototype[e]=function(){let t=Nt(this,e),r=p.get(t);return r||(r=H(this,[e],E),p.set(t,r)),r}})),Wt=[],Rt=e=>{const r=e.data,n=r[0];var s;$.v?6===n?(async e=>{let r,n,s=e.P,i=e.t,o=O(s,i,"SCRIPT"),a=e.f,c=e.L,l="",u=d[s];if(c)try{n=_(u,c),c=n+"",k(o,4,c),r=await t.fetch(c),r.ok?(a=await r.text(),u.g=i,F(u,a),U(o,"load")):(console.error(r.status,"url:",c),l=r.statusText,U(o,"error"))}catch(t){console.error("url:",c,t),l=String(t.stack||t)+"",U(o,"error")}else a&&(l=B(u,i,a));u.g=-1,$.F([5,s,i,l])})(r[1]):7===n?(({t:t,G:e,K:r,b:n})=>{if(c[e])try{const s=nt(t,[],r),i=nt(t,[],n);c[e].apply(s,i)}catch(t){console.error(t)}})(r[1]):8===n?(({P:e,t:r,m:n,b:s})=>{try{const i=d[e].M,o=n[0]in i?i:n[0]in t?t:{},a=nt(r,[],s),c=o[n[0]];Array.isArray(c)?c.push(...a):"function"==typeof c&&c.apply(o,a)}catch(t){console.error(t)}})(r[1]):3===n?K(r[1]):4===n&&(d[r[1]].v=1):1===n?(s=r[1],Object.assign($,s),$.e=JSON.parse($.e),(t=>{let e=$.e[t];e&&((e.startsWith("(")||e.startsWith("function"))&&(e=`${t}:${e}`),Object.assign($.e,new Function(`return{${e}}`)()))})("resolveUrl"),$.n=($.e.forward||E).map((t=>t[0])),$.F=postMessage.bind(t),t.postMessage=t.importScripts=void 0,t.Node=Node,t.Window=Window,t.CSSStyleSheet=lt,$.s.map(Et),(()=>{const e=t.Document,r=t.DocumentFragment,n=t.Element;"atob,btoa,crypto,indexedDB,performance,setTimeout,setInterval,clearTimeout,clearInterval".split(",").map((t=>delete Window.prototype[t])),N(n,gt),N(e,$t),N(t.HTMLAnchorElement,mt),N(t.HTMLCanvasElement,ft),N(t.HTMLIFrameElement,yt),N(t.HTMLScriptElement,It),N(t.HTMLStyleElement,ct),N(t.HTMLHeadElement,dt),N(t.HTMLBodyElement,dt),N(t.HTMLHtmlElement,pt),xt(lt,{type:"text/css"}),St(t.Comment,8),St(t.DocumentType,10),St(r,11),Tt(Node,"childNodes,firstChild,isConnected,lastChild,nextSibling,parentElement,parentNode,previousSibling"),Tt(n,w),Tt(r,w),Lt(n),Lt(Window),Ct(n),Mt(e,"compatMode,referrer")})(),$.v=1,$.F([2]),Wt.slice().forEach(Rt),Wt.length=0):Wt.push(e)};t.onmessage=Rt,postMessage([0])})(self);\\n\'],{type:"text/javascript"})),{name:"Partytown 🎉"}),e.onmessage=t=>s(e,n,t.data),n.addEventListener("pt1",(t=>{const r=t.detail,n=d(r.frameElement);N(e,n,r)})))})(t)})(window);\n<\/script></head></html>',false)):o.endsWith("proxytown")&&n.respondWith(((n,s)=>new Promise((async o=>{const i=await n.clone().json(),a=await(r=>new Promise((async n=>{const s=[...await self.clients.matchAll()].sort(((t,e)=>t.url>e.url?-1:t.url<e.url?1:0))[0];if(s){const o=[n,setTimeout((()=>{t.delete(r.C),n(e(r,"Timeout"))}),1e4)];t.set(r.C,o),s.postMessage(r)}else n(e(r,"No Party"))})))(i);o(r(JSON.stringify(a),s,"application/json"))})))(s,false))};
const t=new Map,e=(t,e)=>({C:t.C,l:e}),r=(t,e,r)=>{const n={"content-type":r||"text/html","Cache-Control":"no-store"};return e&&(n["Cross-Origin-Embedder-Policy"]="require-corp"),new Response(t,{headers:n})};self.oninstall=()=>self.skipWaiting(),self.onactivate=()=>self.clients.claim(),self.onmessage=e=>{const r=e.data,n=t.get(r.C);n&&(t.delete(r.C),clearTimeout(n[1]),n[0](r))},self.onfetch=n=>{const s=n.request,o=new URL(s.url).pathname;o.endsWith("partytown-sandbox-sw.html")?n.respondWith(r('<!DOCTYPE html><html><head><meta charset="utf-8"><script type="module">(t=>{const e=()=>!0,r=t=>t.length,n=t=>t&&t.constructor&&t.constructor.name||"",s=(t,e)=>t.startsWith(e),o=t=>!(s(t,"webkit")||s(t,"toJSON")||s(t,"constructor")||s(t,"toString")||s(t,"_")),i=()=>Math.round(9999999999*Math.random()+4),a=new WeakMap,c=new Map,l=new Map,u={},h=new WeakMap,d=(t,e,r)=>t?t===t.window?0:"#document"===(r=t.nodeName)?1:"HTML"===r?2:"HEAD"===r?3:"BODY"===r?4:("number"!=typeof(e=a.get(t))&&m(t,e=i()),e):-1,p=(t,e,r)=>{const n=u[t].M,s=n.document;return 0===e?n:1===e?s:2===e?s.documentElement:3===e?s.head:4===e?s.body:c.get(e)},m=(t,e)=>{t&&(c.set(e,t),a.set(t,e),g++,g>99999&&(c.forEach(((t,e)=>{t.nodeType&&!t.isConnected&&c.delete(e)})),g=0))};let g=0;const f=(t,e,r,o,i)=>{if(void 0!==e){if("string"==(o=typeof e)||"number"===o||"boolean"===o||null==e)return[9,e];if("function"===o)return[5];if(r=r||new Set,Array.isArray(e))return r.has(e)?[0,[]]:(r.add(e),[0,e.map((e=>f(t,e,r)))]);if("object"===o)return"Window"===(i=n(e))?[6,{P:t,t:0}]:"HTMLCollection"===i||"NodeList"===i?[7,Array.from(e).map((e=>f(t,e,r)[1]))]:"Event"===i?[4,y(t,e,r)]:"CSSRuleList"===i?[3,Array.from(e).map($)]:s(i,"CSS")&&i.endsWith("Rule")?[2,$(e)]:"CSSStyleDeclaration"===i?[8,y(t,e,r)]:"Attr"===i?[1,[e.name,e.value]]:e.nodeType?[6,{P:t,t:d(e),D:e.nodeName}]:[8,y(t,e,r,!0,!0)]}},y=(t,e,r,n,s,i,a,c)=>{if(i={},!r.has(e))for(a in r.add(e),e)o(a)&&(c=e[a],(n||"function"!=typeof c)&&(s||""!==c)&&(i[a]=f(t,c,r)));return i},$=t=>{let e,r={};for(e in t)E.includes(e)&&(r[e]=t[e]);return r},w=(t,e,r,n)=>{if(e){if(r=e[0],n=e[1],9===r)return n;if(10===r)return v(t,n);if(0===r)return n.map((e=>w(t,e)));if(6===r)return p(n.P,n.t);if(4===r)return b(T(t,n));if(8===r)return T(t,n)}},v=(t,{P:e,t:r,G:n})=>{let s=l.get(n);return s||(s=function(...s){const o={t:r,G:n,K:f(e,this),b:f(e,s)};t.postMessage([7,o])},l.set(n,s)),s},b=t=>new("detail"in t?CustomEvent:Event)(t.type,t),T=(t,e,r,n)=>{for(n in r={},e)r[n]=w(t,e[n]);return r},E="cssText,selectorText,href,media,namespaceURI,prefix,name,conditionText".split(","),S=(t,e,n,s)=>{let o,i,a,c,l=0,u=r(n);for(;l<u;l++){i=n[l],o=n[l+1],a=n[l-1];try{if(!Array.isArray(o))if("string"==typeof i||"number"==typeof i){if(l+1===u&&s){const t={};return s.map((r=>t[r]=e[r])),t}e=e[i]}else{if(0===o)return void(e[a]=w(t,i));"function"==typeof e[a]&&(c=w(t,i),"insertRule"===a&&c[1]>r(e.cssRules)&&(c[1]=r(e.cssRules)),e=e[a].apply(e,c))}}catch(t){console.warn(t)}}return e},N=(t,e,r)=>{if(!h.has(r)){h.set(r,e);const n=r.document,s=n.baseURI,o={P:e,E:h.get(r.parent),L:s},i=()=>t.postMessage([3,o]);u[e]={P:e,M:r,L:s},"complete"===n.readyState?i():r.addEventListener("load",i)}},M=(t,e)=>{let n,s,o=e.P,i=e.M,a=i.document,c=a.querySelector(\'script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])\');c||(c=a.querySelector(\'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])\')),c?(c.dataset.ptid=n=d(c,o),s={P:o,t:n},c.src?s.L=c.src:s.f=c.innerHTML,t.postMessage([6,s])):e.v||(e.v=1,((t,e,n)=>{let s=n._ptf,o=n._ptf=[],i=0;if(o.push=(r,n)=>t.postMessage([8,{P:e,t:0,m:r,b:f(e,Array.from(n))}]),s)for(;i<r(s);i+=2)o.push(s[i],s[i+1])})(t,o,i),a.dispatchEvent(new CustomEvent("pt0")),t.postMessage([4,o]))},L=t=>{const r=t.document.implementation.createHTMLDocument(),n=r.createTextNode(""),s=r.createComment(""),o=r.createDocumentFragment(),i=r.createElement("i"),a=r.createElementNS("http://www.w3.org/2000/svg","svg"),c=r.createElement("canvas").getContext("2d"),l=new MutationObserver(e),u=new ResizeObserver(e),h=Object.getOwnPropertyNames(t).filter((t=>/^HTML.+Element$/.test(t))).map((t=>{const e=C(t);return[r.createElement(e)]})),d=[[t.localStorage],[t.history],[t.screen],[t.screen.orientation],[l,12],[u,12],[n],[s],[o],[i],[i.attributes],[i.classList],[i.dataset],[i.style],[a],[r],[r.doctype],[c],...h].filter((t=>t[0])).map((e=>{const r=e[0],n=e[1],s=r.constructor.name;return[s,t[s].prototype,r,n]})),p=[I("Window",t),I("Node",n)],m=t.partytown||{},g=(m.lib||"/~partytown/")+"",f={e:JSON.stringify(m,((t,e)=>"function"==typeof e?String(e):e)),z:new URL(g,t.location)+"",s:p};return d.map((([t,e,r,n])=>R(p,t,e,r,n))),f},I=(t,e)=>{const r=[],n=[t,"Object",r];for(const t in e)x(r,e,t);return n},R=(t,e,r,n,s)=>{if("Object"!==e&&!t.some((t=>t[0]===e))){const o=Object.getPrototypeOf(r),i=o.constructor.name,a=[];R(t,i,o,n,s),Object.keys(Object.getOwnPropertyDescriptors(r)).map((t=>x(a,n,t)));const c=[e,i,a,s,n.nodeName];t.push(c)}},x=(t,e,r,s)=>{if(o(r)){const o=e[r],i=typeof o;"function"===i?String(o).includes("[native")&&t.push([r,5]):"object"===i&&null!=o&&"Object"!==(s=n(o))?o.nodeType?t.push([r,o.nodeType]):t.push([r,s]):"symbol"!==i&&(r.toUpperCase()===r?t.push([r,6,o]):t.push([r,6]))}},O={Anchor:"A",DList:"DL",Image:"IMG",OList:"OL",Paragraph:"P",TableCaption:"CAPTION",TableCell:"TD",TableCol:"COLGROUP",TableRow:"TR",TableSection:"TBODY",UList:"UL"},C=t=>(t=t.substr(4).replace("Element",""),O[t]||t);(async t=>{let e;const n=t.parent,s=await(async(t,n)=>{const s=t.navigator.serviceWorker,o=await s.getRegistration();return s.addEventListener("message",(t=>{return n=t.data,s=t=>o.active&&o.active.postMessage(t),(async(t,e)=>{const n={C:e.C},s=r(e.J);for(let r=0;r<s;r++)try{let s,i,a=e.J[r],c=a.P,l=a.t,h=a.a;if(u[c]||await new Promise((t=>{let e=0,r=()=>{u[c]||e++>999?t():setTimeout(r,9)};r()})),1===h[0]&&h[1]in u[c].M){const e=new u[c].M[h[1]](...w(t,h[2]));m(e,l)}else s=p(c,l),s?(i=S(t,s,h,a.o),a.c&&m(i,a.c),"object"==typeof(o=i)&&o&&o.then&&(i=await i,n.w=!0),n.H=f(c,i)):n.l=l+" not found"}catch(t){r===s-1?n.l=String(t.stack||t):console.error(t)}var o;return n})(e,n).then(s);var n,s})),o?(t,e,r)=>{0===r[0]?t.postMessage([1,L(e)]):((t,e,r)=>{const n=r[0];if(2===n)N(t,i(),e);else{const e=r[1],s=u[e];s&&(6===n?M(t,s):5===n&&((t,e,r,n,s)=>{(s=e.M.document.querySelector(`[data-ptid="${r}"]`))&&(n?s.dataset.pterror=n:s.type+="-x"),M(t,e)})(t,s,r[2],r[3]))}})(t,e,r)}:null})(t);s&&(e=new Worker(URL.createObjectURL(new Blob([\'(t=>{const e=Symbol(),r=Symbol(),n=Symbol(),s=Symbol(),i=Symbol(),o=Symbol(),a=new Map,c={},l=new WeakMap,u={},h={},$={},d={},p=new Map,g=new Map,m="getClientRects,getBoundingClientRect".split(","),f="innerHeight,innerWidth,outerHeight,outerWidth,clientHeight,clientWidth,clientTop,clientLeft,scrollHeight,scrollWidth,scrollTop,scrollLeft,offsetHeight,offsetWidth,offsetTop,offsetLeft".split(","),w="childElementCount,children,firstElementChild,lastElementChild,nextElementSibling,previousElementSibling",y=()=>!0,v=t=>t.length,I=(t,e)=>Object.defineProperty(t,"name",{value:e}),E=[],b=()=>Math.round(9999999999*Math.random()+4),S="text/partytown",T=(t,e,r)=>Object.defineProperty(t.prototype,e,{...r,configurable:!0}),N=(t,e)=>Object.defineProperties(t.prototype,e),M=(t,e,r)=>T(t,e,{value:r,writable:!0}),x=[],L=(t,n,s,o,a)=>{const c=t[r];if(x.push({P:t[e],t:c,a:[...t[i],...n],c:o,o:a}),!s)return C();setTimeout(C,40)},C=()=>{if(v(x)){const t=x[v(x)-1],e={C:b(),J:x.slice()};x.length=0;const r=((t,e)=>{const r=new XMLHttpRequest,n=t.z+"proxytown";return r.open("POST",n,!1),r.send(JSON.stringify(e)),JSON.parse(r.responseText)})($,e),n=r.w,s=nt(t.t,t.a,r.H);if(r.l){if(n)return Promise.reject(r.l);throw new Error(r.l)}return n?Promise.resolve(s):s}},W=(t,e,r)=>L(t,e,!1,void 0,r),R=(t,e,r)=>{const n=[...e,rt(t,r),0];L(t,n,!0)},H=(t,e,r,n)=>{const s=e[v(e)-1],i=P.includes(s),o=[...e,rt(t,r)],a=L(t,o,i,n);return i||m.includes(s)||p.clear(),a},P="addEventListener,removeEventListener,createElement,createTextNode,insertBefore,insertRule,deleteRule,setAttribute,setItem,removeItem,classList.add,classList.remove,classList.toggle".split(","),O=(t,e,r,n)=>{let s=a.get(e);return s||(s=A(t,e,r,n),a.set(e,s)),s},A=(e,r,n,s)=>new(u[n]?u[n]:n.includes("-")?u.UNKNOWN:t.HTMLElement)(e,r,[],n,s),j=(t,e)=>e in t[o],D=(t,e)=>t[o][e],k=(t,e,r)=>t[o][e]=r,B=(t,e,r,n)=>{let s="";try{t.g=e,F(t,r)}catch(t){console.error(r,t),s=String(t.stack||t)+""}return t.g=-1,s},F=(t,e)=>{new Function(`with(this){${e}}`).apply(t.M)},U=(t,e,r)=>{(r=D(t,e))&&setTimeout((()=>r.map((t=>t({type:e})))),undefined)},_=(t,e,r)=>{for(r=t.A;!r.host&&(r=(t=d[t.E]).A,t.P!==t.E););const n=new URL(e||"",r);if($.e.resolveUrl){const t=$.e.resolveUrl(n,r);if(t)return t}return n},z=(t,e)=>_(t,e)+"",J=t=>_(Q(t),D(t,4)),q=()=>`<script src=${JSON.stringify($.z+"partytown.js")} async defer><\\\\/script>`,G=t=>class{constructor(){this.s="",this.l=[],this.e=[]}get src(){return this.s}set src(e){fetch(z(t,e),{mode:"no-cors",keepalive:!0}).then((t=>{t.ok||0===t.status?this.l.map((t=>t({type:"load"}))):this.e.map((t=>t({type:"error"})))}),(()=>this.e.forEach((t=>t({type:"error"})))))}addEventListener(t,e){"load"===t&&this.l.push(e),"error"===t&&this.e.push(e)}get onload(){return this.l[0]}set onload(t){this.l=[t]}get onerror(){return this.e[0]}set onerror(t){this.e=[t]}};class V extends URL{assign(){}reload(){}replace(){}}class X{constructor(t,a,c,l,u){this[e]=t,this[r]=a,this[i]=c||[],this[n]=l,this[o]={},u&&(this[s]=u)}}class Y extends X{constructor(t,e,r,n){return super(t,e,r,n),new Proxy(this,{get:(t,e)=>W(t,[e]),set:(t,e,r)=>(R(t,[e],r),!0)})}}class Window extends X{constructor(e,r,n){super(e,0);for(const e in t)if(!(e in this)&&"onmessage"!==e){const r=t[e];if(null!=r){const n="function"==typeof r&&!r.toString().startsWith("class");this[e]=n?r.bind(t):r}}Object.getOwnPropertyNames(t).map((e=>{e in this||(this[e]=t[e])}));for(const t in h)this[t]=I(class{constructor(...r){const n=new(0,h[t])(e,b()),s=rt(n,r);return L(n,[1,t,s]),n}},t);const s=new Proxy(this,{has:()=>!0});return d[e]={P:e,E:r,M:s,j:A(e,1,"#document"),k:A(e,2,"HTML"),p:A(e,3,"HEAD"),d:A(e,4,"BODY"),A:new V(n)},this.requestAnimationFrame=t=>setTimeout((()=>t(performance.now())),9),this.cancelAnimationFrame=t=>clearTimeout(t),s}get Audio(){return t=Q(this),class{constructor(e){const r=t.j.createElement("audio");return r.src=e,r}};var t}get body(){return Q(this).d}get document(){return Q(this).j}get documentElement(){return Q(this).k}get frameElement(){const t=Q(this),e=t.E,r=t.P;return r===e?null:O(e,r,"IFRAME")}get globalThis(){return this}get head(){return Q(this).p}get location(){return Q(this).A}set location(t){Q(this).A.href=t+""}get Image(){return G(Q(this))}get name(){const t=this[e];return name+t}get navigator(){return(e=>{const r=t.navigator;return r.sendBeacon=(t,r)=>{const n=d[e];try{return fetch(z(n,t),{method:"POST",body:r,mode:"no-cors",keepalive:!0}),!0}catch(t){return console.error(t),!1}},r})(this[e])}get origin(){return Q(this).A.origin}get parent(){return d[Q(this).E].M}get self(){return this}get top(){for(const t in d)if(d[t].P===d[t].E)return d[t].M}get window(){return this}}const K=({P:t,E:e,L:r})=>{d[t]?d[t].A.href=r:new Window(t,e,r),$.F([6,t])},Q=t=>d[t[e]];class Node extends X{appendChild(t){return this.insertBefore(t,null)}get href(){}set href(t){}insertBefore(t,s){const i=t[e]=this[e],o=t[r],a=t[n],c="SCRIPT"===a,l="IFRAME"===a;if(c){const e=D(t,3);if(e){const r=B(Q(t),o,e),n=r?"pterror":"ptid",s=r||o;R(t,["type"],S+"-x"),R(t,["dataset",n],s),R(t,["innerHTML"],e)}}return H(this,["insertBefore"],[t,s]),l&&(t=>{let e=0;const n=t[r],s=()=>{if(d[n]&&d[n].v){let e=D(t,1)?"error":"load",r=D(t,e);r&&r.map((t=>t({type:e})))}else if(e++>2e3){let e=D(t,"error");e&&e.map((t=>t({type:"error"}))),console.error("Timeout")}else setTimeout(s,9)};s()})(t),c&&(C(),$.F([6,i])),t}get nodeName(){return this[n]}get nodeType(){return 3}get ownerDocument(){return Q(this).j}}class Z{constructor(t){this.name=t[0],this.value=t[1]}get nodeName(){return this.name}get nodeType(){return 2}}class NodeList{constructor(t){(this._=t).map(((t,e)=>this[e]=t))}entries(){return this._.entries()}forEach(t,e){this._.map(t,e)}item(t){return this[t]}keys(){return this._.keys()}get length(){return v(this._)}values(){return this._.values()}[Symbol.iterator](){return this._[Symbol.iterator]()}}const tt=(t,n,s,i)=>{if(void 0!==s){let u=typeof s;if("string"===u||"boolean"===u||"number"===u||null==s)return[9,s];if("function"===u)return[10,{P:t,t:n,G:(o=s,(a=l.get(o))||(l.set(o,a=b()),c[a]=o),a)}];if(i=i||new Set,Array.isArray(s))return i.has(s)?[0,[]]:[0,s.map((e=>tt(t,n,e,i)))];if("object"===u)return"number"==typeof s[r]?[6,{P:s[e],t:s[r]}]:s instanceof Event?[4,et(t,n,s,!1,i)]:[8,et(t,n,s,!0,i)]}var o,a},et=(t,e,r,n,s,i,o,a)=>{if(i={},!s.has(r))for(o in s.add(r),r)a=r[o],(n||"function"!=typeof a)&&(i[o]=tt(t,e,a,s));return i},rt=(t,n)=>t?tt(t[e],t[r],n):[9,n],nt=(t,e,r,n,s)=>{if(r){if(n=r[0],s=r[1],9===n||2===n||3===n)return s;if(10===n)return at(e,s);if(6===n)return it(s);if(7===n)return new NodeList(s.map(it));if(1===n)return new Z(s);if(0===n)return s.map((r=>nt(t,e,r)));if(4===n)return i=st(t,e,s),new Proxy(new Event(i.type,i),{get:(t,e)=>e in i?i[e]:t[String(e)]});if(8===n)return st(t,e,s)}var i},st=(t,e,r,n,s)=>{for(s in n={},r)n[s]=nt(t,[...e,s],r[s]);return n},it=({P:t,t:e,D:r})=>ot(t,e)||O(t,e,r),ot=(t,e)=>{const r=d[t];return 0===e?r.M:1===e?r.j:2===e?r.k:3===e?r.p:4===e?r.d:void 0},at=(t,{P:e,t:r,D:n,G:s})=>(c[s]||l.set(c[s]=function(...s){const i=O(e,r,n);return H(i,t,s)},s),c[s]),ct={sheet:{get(){return new lt(this)}}};class lt{constructor(t){this.ownerNode=t}get cssRules(){const t=this.ownerNode;return new Proxy({},{get(e,r){const n=String(r);return"item"===n?e=>ht(t,e):"length"===n?ut(t).length:isNaN(n)?e[r]:ht(t,n)}})}insertRule(t,e){const r=ut(this.ownerNode);return(e=void 0===e?0:e)>=0&&e<=r.length&&(H(this.ownerNode,["sheet","insertRule"],[t,e]),r.splice(e,0,0)),e}deleteRule(t){H(this.ownerNode,["sheet","deleteRule"],[t]),ut(this.ownerNode).splice(t,1)}}const ut=t=>{let e=D(t,2);return e||(e=W(t,["sheet","cssRules"]),k(t,2,e)),e},ht=(t,e)=>{let r=ut(t);return 0===r[e]&&(r[e]=W(t,["sheet","cssRules",parseInt(e,10)])),r[e]},$t={body:{get(){return Q(this).d}},createElement:{value(t){t=t.toUpperCase();const r=this[e],n=b(),s=O(r,n,t);return H(this,["createElement"],[t],n),"IFRAME"===t?(K({P:n,E:r,L:"about:blank"}),R(s,["srcdoc"],q())):"SCRIPT"===t&&R(s,["type"],S),s}},createElementNS:{value(t,r){r=r.toLowerCase();const n=this[e],s=b(),i=O(n,s,r,t);return H(this,["createElementNS"],[t,r],s),i}},createTextNode:{value(t){const r=this[e],n=b(),s=O(r,n,"#text");return H(this,["createTextNode"],[t],n),s}},createEvent:{value:t=>new Event(t)},currentScript:{get(){const t=this[e],r=Q(this).g;return r>0?O(t,r,"SCRIPT"):null}},defaultView:{get(){return Q(this).M}},documentElement:{get(){return Q(this).k}},getElementsByTagName:{value(t){return"BODY"===(t=t.toUpperCase())?[Q(this).d]:"HEAD"===t?[Q(this).p]:H(this,["getElementsByTagName"],[t])}},head:{get(){return Q(this).p}},implementation:{value:{hasFeature:y}},location:{get(){return Q(this).A},set(t){Q(this).A.href=t+""}},nodeType:{value:9},parentNode:{value:null},parentElement:{value:null},readyState:{value:"complete"}},dt={parentElement:{get(){return this.parentNode}},parentNode:{get(){return Q(this).k}}},pt={parentElement:{value:null},parentNode:{get(){return Q(this).j}}},gt={localName:{get(){return this[n].toLowerCase()}},namespaceURI:{get(){return this[s]||"http://www.w3.org/1999/xhtml"}},nodeType:{value:1},tagName:{get(){return this[n]}}},mt={hash:{get(){return J(this).hash}},host:{get(){return J(this).host}},hostname:{get(){return J(this).hostname}},href:{get(){return J(this).href},set(t){k(this,4,t+=""),R(this,["href"],t)}},origin:{get(){return J(this).origin}},pathname:{get(){return J(this).pathname}},port:{get(){return J(this).port}},protocol:{get(){return J(this).protocol}},search:{get(){return J(this).search}}},ft={getContext:{value(...n){const s=["getContext",rt(this,n)];return new t.CanvasRenderingContext2D(this[e],this[r],s)}}},wt={addEventListener:{value(...t){const e=t[0],r=D(this,e)||[];r.push(t[1]),k(this,e,r)}},async:{get:y,set:y},defer:{get:y,set:y},onload:{get(){let t=D(this,"load");return t&&t[0]||null},set(t){k(this,"load",t?[t]:null)}},onerror:{get(){let t=D(this,"error");return t&&t[0]||null},set(t){k(this,"error",t?[t]:null)}}},yt={contentDocument:{get(){return this.contentWindow.document}},contentWindow:{get(){const t=this[r];return d[t].M}},src:{get(){return D(this,4)||""},set(t){let e,r=new XMLHttpRequest;t=z(Q(this),t),k(this,1,void 0),k(this,4,t),r.open("GET",t,!1),r.send(),e=r.status,e>199&&e<300?R(this,["srcdoc"],((t,e)=>`<base href="${t}">`+e.replace(/<script>/g,\\\'<script type="text/partytown">\\\').replace(/<script /g,\\\'<script type="text/partytown" \\\').replace(/text\\\\/javascript/g,S)+q())(t,r.responseText)):k(this,1,e)}},...wt},vt={get(){return D(this,3)||""},set(t){k(this,3,t)}},It={innerHTML:vt,innerText:vt,src:{get(){return D(this,4)||""},set(t){t=z(Q(this),t),k(this,4,t),R(this,["src"],t)}},getAttribute:{value(t){return"src"===t?this.src:H(this,["getAttribute"],[t])}},setAttribute:{value(t,e){"src"===t?this.src=e:H(this,["setAttribute"],[t,e])}},textContent:vt,type:{get(){return W(this,["type"])},set(t){"text/javascript"!==t&&R(this,["type"],t)}},...wt},Et=([s,o,a,c,l])=>{const $=bt[s]?Y:"Object"===o||"EventTarget"===o?X:t[o],d=t[s]=I(t[s]||class extends ${},s);12===c&&(h[s]=d),l&&(u[l]=d),a.map((([s,o,a])=>{s in d.prototype||s in $.prototype||("string"==typeof o?T(d,s,{get(){if(!j(this,s)){const a=this[e],c=this[r],l=[...this[i],s],u=this[n],h=t[o];k(this,s,new h(a,c,l,u))}return D(this,s)},set(t){k(this,s,t)}}):5===o?M(d,s,(function(...t){return H(this,[s],t)})):o>0&&(void 0!==a?M(d,s,a):T(d,s,{get(){return W(this,[s])},set(t){return R(this,[s],t)}})))}))},bt={CSSStyleDeclaration:1,DOMStringMap:1,NamedNodeMap:1},St=(t,e)=>M(t,"nodeType",e),Tt=(t,e)=>e.split(",").map((e=>T(t,e,{get(){let t=Nt(this,e),r=g.get(t);return r||(r=W(this,[e]),g.set(t,r)),r}}))),Nt=(t,n)=>t[e]+"."+t[r]+"."+n,Mt=(t,e)=>e.split(",").map((e=>T(t,e,{get(){return j(this,e)||k(this,e,W(this,[e])),D(this,e)},set(t){k(this,e,t)}}))),xt=(t,e)=>Object.keys(e).map((r=>M(t,r,e[r]))),Lt=t=>f.map((e=>T(t,e,{get(){const t=p.get(Nt(this,e));if("number"==typeof t)return t;const r=W(this,[e],f);return Object.entries(r).map((([t,e])=>{p.set(Nt(this,t),e)})),r[e]}}))),Ct=t=>m.map((e=>{t.prototype[e]=function(){let t=Nt(this,e),r=p.get(t);return r||(r=H(this,[e],E),p.set(t,r)),r}})),Wt=[],Rt=e=>{const r=e.data,n=r[0];var s;$.v?6===n?(async e=>{let r,n,s=e.P,i=e.t,o=O(s,i,"SCRIPT"),a=e.f,c=e.L,l="",u=d[s];if(c)try{n=_(u,c),c=n+"",k(o,4,c),r=await t.fetch(c),r.ok?(a=await r.text(),u.g=i,F(u,a),U(o,"load")):(console.error(r.status,"url:",c),l=r.statusText,U(o,"error"))}catch(t){console.error("url:",c,t),l=String(t.stack||t)+"",U(o,"error")}else a&&(l=B(u,i,a));u.g=-1,$.F([5,s,i,l])})(r[1]):7===n?(({t:t,G:e,K:r,b:n})=>{if(c[e])try{const s=nt(t,[],r),i=nt(t,[],n);c[e].apply(s,i)}catch(t){console.error(t)}})(r[1]):8===n?(({P:e,t:r,m:n,b:s})=>{try{const i=d[e].M,o=n[0]in i?i:n[0]in t?t:{},a=nt(r,[],s),c=o[n[0]];Array.isArray(c)?c.push(...a):"function"==typeof c&&c.apply(o,a)}catch(t){console.error(t)}})(r[1]):3===n?K(r[1]):4===n&&(d[r[1]].v=1):1===n?(s=r[1],Object.assign($,s),$.e=JSON.parse($.e),(t=>{let e=$.e[t];e&&((e.startsWith("(")||e.startsWith("function"))&&(e=`${t}:${e}`),Object.assign($.e,new Function(`return{${e}}`)()))})("resolveUrl"),$.n=($.e.forward||E).map((t=>t[0])),$.F=postMessage.bind(t),t.postMessage=t.importScripts=void 0,t.Node=Node,t.Window=Window,t.CSSStyleSheet=lt,$.s.map(Et),(()=>{const e=t.Document,r=t.DocumentFragment,n=t.Element;"atob,btoa,crypto,indexedDB,performance,setTimeout,setInterval,clearTimeout,clearInterval".split(",").map((t=>delete Window.prototype[t])),N(n,gt),N(e,$t),N(t.HTMLAnchorElement,mt),N(t.HTMLCanvasElement,ft),N(t.HTMLIFrameElement,yt),N(t.HTMLScriptElement,It),N(t.HTMLStyleElement,ct),N(t.HTMLHeadElement,dt),N(t.HTMLBodyElement,dt),N(t.HTMLHtmlElement,pt),xt(lt,{type:"text/css"}),St(t.Comment,8),St(t.DocumentType,10),St(r,11),Tt(Node,"childNodes,firstChild,isConnected,lastChild,nextSibling,parentElement,parentNode,previousSibling"),Tt(n,w),Tt(r,w),Lt(n),Lt(Window),Ct(n),Mt(e,"compatMode,referrer")})(),$.v=1,$.F([2]),Wt.slice().forEach(Rt),Wt.length=0):Wt.push(e)};t.onmessage=Rt,postMessage([0])})(self);\\n\'],{type:"text/javascript"})),{name:"Partytown 🎉"}),e.onmessage=t=>s(e,n,t.data),n.addEventListener("pt1",(t=>{const r=t.detail,n=d(r.frameElement);N(e,n,r)})))})(t)})(window);\n<\/script></head></html>',false)):o.endsWith("proxytown")&&n.respondWith(((n,s)=>new Promise((async o=>{const i=await n.clone().json(),a=await(r=>new Promise((async n=>{const s=[...await self.clients.matchAll()].sort(((t,e)=>t.url>e.url?-1:t.url<e.url?1:0))[0];if(s){const o=[n,setTimeout((()=>{t.delete(r.C),n(e(r,"Timeout"))}),1e4)];t.set(r.C,o),s.postMessage(r)}else n(e(r,"No Party"))})))(i);o(r(JSON.stringify(a),s,"application/json"))})))(s,false))};

@@ -1,1 +0,1 @@

!function(t,e,n,i,o,r,s){function a(t){o||((o=e.createElement("iframe")).dataset.partytown="sandbox",o.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),o.setAttribute("aria-hidden","true"),o.src=i+"partytown-sandbox-"+t+".html?"+Date.now(),e.body.appendChild(o))}function c(t,n){for(clearTimeout(s),o=1,t=0;t<r.length;t++)(n=e.createElement("script")).innerHTML=r[t].innerHTML,e.body.appendChild(n)}if(i=(t.partytown||{}).lib||"/~partytown/",r=e.querySelectorAll('script[type="text/partytown"]'),top!==t)top.dispatchEvent(new CustomEvent("pt1",{detail:t}));else if(r.length){if(s=setTimeout(c,1e4),e.addEventListener("pt0",(function(){clearTimeout(s)})),t.crossOriginIsolated)a("atomics");else if("serviceWorker"in n){const e=t.crossOriginIsolated?"?isolated":"";n.serviceWorker.register(i+"partytown-sw.js"+e,{scope:i}).then((function(t){t.active?a("sw"):t.installing?t.installing.addEventListener("statechange",(function(t){"activated"===t.target.state&&a("sw")})):console.warn(t)}),(function(t){console.error(t)}))}else c()}}(window,document,navigator);
!function(t,e,n,i,o,r,a){function s(t){o||((o=e.createElement("iframe")).dataset.partytown="sandbox",o.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),o.setAttribute("aria-hidden","true"),o.src=i+"partytown-sandbox-"+t+".html?"+Date.now(),e.body.appendChild(o))}function d(t,n){for(clearTimeout(a),o=1,t=0;t<r.length;t++)(n=e.createElement("script")).innerHTML=r[t].innerHTML,e.body.appendChild(n)}function c(){if(i=(t.partytown||{}).lib||"/~partytown/",r=e.querySelectorAll('script[type="text/partytown"]'),top!==t)top.dispatchEvent(new CustomEvent("pt1",{detail:t}));else if(r.length){if(a=setTimeout(d,1e4),e.addEventListener("pt0",(function(){clearTimeout(a)})),t.crossOriginIsolated)s("atomics");else if("serviceWorker"in n){const e=t.crossOriginIsolated?"?isolated":"";n.serviceWorker.register(i+"partytown-sw.js"+e,{scope:i}).then((function(t){t.active?s("sw"):t.installing?t.installing.addEventListener("statechange",(function(t){"activated"===t.target.state&&s("sw")})):console.warn(t)}),(function(t){console.error(t)}))}else d()}}"complete"===e.readyState?c():window.addEventListener("load",c)}(window,document,navigator);
{
"name": "@builder.io/partytown",
"version": "0.0.15",
"description": "Relocate resource intensive 3rd-party scripts off of the main thread and into a web worker.",
"version": "0.0.16",
"description": "Relocate resource intensive third-party scripts off of the main thread and into a web worker.",
"license": "MIT",
"main": "index.js",
"main": "index.cjs",
"module": "index.mjs",
"types": "index.d.ts",
"type": "module",
"exports": {

@@ -16,10 +19,20 @@ "./integration": {

},
"./utils": {
"import": "./utils/index.mjs",
"require": "./utils/index.cjs"
},
"./package.json": "./package.json",
".": {
"require": "./index.js"
"import": "./index.mjs",
"require": "./index.cjs"
}
},
"files": [
"index.cjs",
"index.mjs",
"index.d.ts",
"integration/",
"lib/",
"react/"
"react/",
"utils/"
],

@@ -32,6 +45,6 @@ "scripts": {

"release": "npm run build && npm test && np --no-tests",
"serve": "node scripts/serve.js 4000",
"serve.test": "node scripts/serve.js 4001",
"serve.atomics": "node scripts/serve.js 4002 --atomics",
"serve.atomics.test": "node scripts/serve.js 4003 --atomics",
"serve": "node scripts/serve.cjs 4000",
"serve.test": "node scripts/serve.cjs 4001",
"serve.atomics": "node scripts/serve.cjs 4002 --atomics",
"serve.atomics.test": "node scripts/serve.cjs 4003 --atomics",
"test": "playwright test tests/platform --browser=chromium",

@@ -38,0 +51,0 @@ "test.atomics": "playwright test tests/platform --config playwright.atomics.config.ts --browser=chromium",

@@ -12,3 +12,3 @@ /**

*/
export declare const GoogleTagManager: ({ containerId }: GoogleTagManagerProps) => any;
export declare const GoogleTagManager: ({ containerId, dataLayerName }: GoogleTagManagerProps) => any;

@@ -29,3 +29,3 @@ /**

*/
export declare type GoogleTagManagerProps = {
export declare interface GoogleTagManagerProps {
/**

@@ -35,3 +35,8 @@ * Google Tag Manager Container ID, formatted as GTM-XXXXXX

containerId: string;
};
/**
* The default name of the data layer object initiated by the global site tag or Tag Manager is `dataLayer`.
* Use this prop to use a different name for your data layer.
*/
dataLayerName?: string;
}

@@ -80,5 +85,7 @@ /**

/**
* Root directory the Partytown library files can be found.
* The library path must end with a `/`.
* An absolute path to the root directory which Partytown library files
* can be found. The library path must start and end with a `/`.
* By default the files will load from the server's `/~partytown/` directory.
* Note that the library path must be on the same origin as the html document,
* and is also used as the `scope` of the Partytown service worker.
*/

@@ -85,0 +92,0 @@ lib?: string;

@@ -6,4 +6,4 @@ {

"types": "index.d.ts",
"version": "0.0.15",
"version": "0.0.16",
"private": true
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc