appscms-tools-theme 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,75 +1,114 @@
1
1
  /* Partytown 0.7.5 - MIT builder.io */
2
- !function(win, doc, nav, top, useAtomics, config, libPath, timeout, scripts, sandbox, mainForwardFn, isReady) {
3
- function ready() {
4
- if (!isReady) {
5
- isReady = 1;
6
- libPath = (config.lib || "/~partytown/") + (false !== config.debug ? "debug/" : "");
7
- if ("/" == libPath[0]) {
8
- scripts = doc.querySelectorAll('script[type="text/partytown"]');
9
- if (top != win) {
10
- top.dispatchEvent(new CustomEvent("pt1", {
11
- detail: win
12
- }));
13
- } else {
14
- timeout = setTimeout(fallback, 1e4);
15
- doc.addEventListener("pt0", clearFallback);
16
- useAtomics ? loadSandbox(1) : nav.serviceWorker ? nav.serviceWorker.register(libPath + (config.swPath || "partytown-sw.js"), {
17
- scope: libPath
18
- }).then((function(swRegistration) {
19
- if (swRegistration.active) {
20
- loadSandbox();
21
- } else if (swRegistration.installing) {
22
- swRegistration.installing.addEventListener("statechange", (function(ev) {
23
- "activated" == ev.target.state && loadSandbox();
24
- }));
25
- } else {
26
- console.warn(swRegistration);
27
- }
28
- }), console.error) : fallback();
29
- }
30
- } else {
31
- console.warn('Partytown config.lib url must start with "/"');
32
- }
2
+ !(function (
3
+ win,
4
+ doc,
5
+ nav,
6
+ top,
7
+ useAtomics,
8
+ config,
9
+ libPath,
10
+ timeout,
11
+ scripts,
12
+ sandbox,
13
+ mainForwardFn,
14
+ isReady
15
+ ) {
16
+ function ready() {
17
+ if (!isReady) {
18
+ isReady = 1;
19
+ libPath =
20
+ (config.lib || "/~partytown/") +
21
+ (false !== config.debug ? "debug/" : "");
22
+ if ("/" == libPath[0]) {
23
+ scripts = doc.querySelectorAll('script[type="text/partytown"]');
24
+ if (top != win) {
25
+ top.dispatchEvent(
26
+ new CustomEvent("pt1", {
27
+ detail: win,
28
+ })
29
+ );
30
+ } else {
31
+ timeout = setTimeout(fallback, 1e4);
32
+ doc.addEventListener("pt0", clearFallback);
33
+ useAtomics
34
+ ? loadSandbox(1)
35
+ : nav.serviceWorker
36
+ ? nav.serviceWorker
37
+ .register(libPath + (config.swPath || "partytown-sw.js"), {
38
+ scope: libPath,
39
+ })
40
+ .then(function (swRegistration) {
41
+ if (swRegistration.active) {
42
+ loadSandbox();
43
+ } else if (swRegistration.installing) {
44
+ swRegistration.installing.addEventListener(
45
+ "statechange",
46
+ function (ev) {
47
+ "activated" == ev.target.state && loadSandbox();
48
+ }
49
+ );
50
+ } else {
51
+ console.warn(swRegistration);
52
+ }
53
+ }, console.error)
54
+ : fallback();
33
55
  }
56
+ } else {
57
+ console.warn('Partytown config.lib url must start with "/"');
58
+ }
34
59
  }
35
- function loadSandbox(isAtomics) {
36
- sandbox = doc.createElement(isAtomics ? "script" : "iframe");
37
- if (!isAtomics) {
38
- sandbox.setAttribute("style", "display:block;width:0;height:0;border:0;visibility:hidden");
39
- sandbox.setAttribute("aria-hidden", !0);
40
- }
41
- sandbox.src = libPath + "partytown-" + (isAtomics ? "atomics.js?v=0.7.5" : "sandbox-sw.html?" + Date.now());
42
- doc.body.appendChild(sandbox);
43
- }
44
- function fallback(i, script) {
45
- console.warn("Partytown script fallback");
46
- clearFallback();
47
- top == win && (config.forward || []).map((function(forwardProps) {
48
- delete win[forwardProps.split(".")[0]];
49
- }));
50
- for (i = 0; i < scripts.length; i++) {
51
- script = doc.createElement("script");
52
- script.innerHTML = scripts[i].innerHTML;
53
- doc.head.appendChild(script);
54
- }
55
- sandbox && sandbox.parentNode.removeChild(sandbox);
60
+ }
61
+ function loadSandbox(isAtomics) {
62
+ sandbox = doc.createElement(isAtomics ? "script" : "iframe");
63
+ if (!isAtomics) {
64
+ sandbox.setAttribute(
65
+ "style",
66
+ "display:block;width:0;height:0;border:0;visibility:hidden"
67
+ );
68
+ sandbox.setAttribute("aria-hidden", !0);
56
69
  }
57
- function clearFallback() {
58
- clearTimeout(timeout);
70
+ sandbox.src =
71
+ libPath +
72
+ "partytown-" +
73
+ (isAtomics ? "atomics.js?v=0.7.5" : "sandbox-sw.html?" + Date.now());
74
+ doc.body.appendChild(sandbox);
75
+ }
76
+ function fallback(i, script) {
77
+ console.warn("Partytown script fallback");
78
+ clearFallback();
79
+ top == win &&
80
+ (config.forward || []).map(function (forwardProps) {
81
+ delete win[forwardProps.split(".")[0]];
82
+ });
83
+ for (i = 0; i < scripts.length; i++) {
84
+ script = doc.createElement("script");
85
+ script.innerHTML = scripts[i].innerHTML;
86
+ doc.head.appendChild(script);
59
87
  }
60
- config = win.partytown || {};
61
- top == win && (config.forward || []).map((function(forwardProps) {
62
- mainForwardFn = win;
63
- forwardProps.split(".").map((function(_, i, forwardPropsArr) {
64
- mainForwardFn = mainForwardFn[forwardPropsArr[i]] = i + 1 < forwardPropsArr.length ? "push" == forwardPropsArr[i + 1] ? [] : mainForwardFn[forwardPropsArr[i]] || {} : function() {
88
+ sandbox && sandbox.parentNode.removeChild(sandbox);
89
+ }
90
+ function clearFallback() {
91
+ clearTimeout(timeout);
92
+ }
93
+ config = win.partytown || {};
94
+ top == win &&
95
+ (config.forward || []).map(function (forwardProps) {
96
+ mainForwardFn = win;
97
+ forwardProps.split(".").map(function (_, i, forwardPropsArr) {
98
+ mainForwardFn = mainForwardFn[forwardPropsArr[i]] =
99
+ i + 1 < forwardPropsArr.length
100
+ ? "push" == forwardPropsArr[i + 1]
101
+ ? []
102
+ : mainForwardFn[forwardPropsArr[i]] || {}
103
+ : function () {
65
104
  (win._ptf = win._ptf || []).push(forwardPropsArr, arguments);
66
- };
67
- }));
68
- }));
69
- if ("complete" == doc.readyState) {
70
- ready();
71
- } else {
72
- win.addEventListener("DOMContentLoaded", ready);
73
- win.addEventListener("load", ready);
74
- }
75
- }(window, document, navigator, top, window.crossOriginIsolated);
105
+ };
106
+ });
107
+ });
108
+ if ("complete" == doc.readyState) {
109
+ ready();
110
+ } else {
111
+ win.addEventListener("DOMContentLoaded", ready);
112
+ win.addEventListener("load", ready);
113
+ }
114
+ })(window, document, navigator, top, window.crossOriginIsolated);