@pie-element/element-player 0.1.2-next.1 → 0.1.2-next.3
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/README.md +25 -0
- package/dist/pie-element-player.js +160 -172
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,6 +126,31 @@ For elements with import maps:
|
|
|
126
126
|
- Handle math rendering automatically
|
|
127
127
|
- Support for both React and Svelte elements
|
|
128
128
|
|
|
129
|
+
### Events
|
|
130
|
+
|
|
131
|
+
The player dispatches each event from `<pie-element-player>`, bubbling and composed. A bubble-phase listener on the player, on an ancestor or on `document` hears each event once, with `event.target` the player; a listener outside a shadow root that contains the player sees that root's host instead. The element's own `session-changed` stops at the element, and the player dispatches its copy in its place. A capture-phase listener on the player or above it also hears every `session-changed` the element dispatches, ahead of the player's copy, and should ignore events whose `event.composedPath()[0]` is not the player. That equals `event.target` when no shadow root lies between listener and player. A closed shadow root hides the player from both, so listen in the bubble phase there.
|
|
132
|
+
|
|
133
|
+
| Event | When | `detail` |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `session-changed` | delivery: the learner changes the session, or the element re-reports a session the player set (below) | the element's detail, with `session` the new session |
|
|
136
|
+
| `model-changed` | author: the author edits the model | the whole model |
|
|
137
|
+
| `load-complete` | the element is mounted | `strategy`, `view`, `tagName` |
|
|
138
|
+
| `load-cancelled` | a newer load supersedes this one, or the load fails with an abort error (below) | `reason`, `strategy`, `view` |
|
|
139
|
+
| `player-error` | the load fails | `error`, `strategy`, `view`, `retry` |
|
|
140
|
+
| `build-state` | the load changes stage | `loading`, `error`, `stage`, and `strategy`, `view`, `retry` where known |
|
|
141
|
+
| `bundle-retry-status` | IIFE: a bundle build is polled; any strategy: the load fails with an abort error | the retry state |
|
|
142
|
+
| `bundle-meta` | IIFE: the bundle loads | the bundle's metadata |
|
|
143
|
+
| `controller-load` | a load completes, except a `preloaded` one that finds its tag defined (below) | `status`, `source`, `packageName`, `strategy`, `view`, `message` |
|
|
144
|
+
| `controller-changed` | IIFE delivery: the bundle's controller loads | the controller |
|
|
145
|
+
|
|
146
|
+
`session-changed` also fires with no learner action. Once the element has a model, the player sets `session` on it, and sets it again whenever the host assigns a different session. An element that reports that assignment after its setter returns, as multiple-choice does, has the report forwarded.
|
|
147
|
+
|
|
148
|
+
An abort error is a load error whose message contains `aborted`, whatever the strategy. The player then emits `bundle-retry-status` with state `cancelled`, `build-state` with stage `cancelled` and `load-cancelled`, in place of `player-error`.
|
|
149
|
+
|
|
150
|
+
`controller-load` reports `status` `loaded` in delivery view, where any other status fails the load. Author view can also report `missing` or `failed`, and print view reports `not-required` unless an IIFE bundle carries a controller.
|
|
151
|
+
|
|
152
|
+
A player removed from the document mid-load emits nothing more from that load, and re-attaching it starts a new one; a synchronous move keeps the load.
|
|
153
|
+
|
|
129
154
|
## Testing Elements Locally
|
|
130
155
|
|
|
131
156
|
Use the existing demo commands to test elements:
|
|
@@ -1712,28 +1712,9 @@ function vr(e) {
|
|
|
1712
1712
|
if (typeof t == "function") return t;
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
|
-
function yr(e, t, { bubbles: n = !1, cancelable: r = !1 } = {}) {
|
|
1716
|
-
return new CustomEvent(e, {
|
|
1717
|
-
detail: t,
|
|
1718
|
-
bubbles: n,
|
|
1719
|
-
cancelable: r
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
|
-
function br() {
|
|
1723
|
-
let e = M;
|
|
1724
|
-
return e === null && Se("createEventDispatcher"), (t, n, i) => {
|
|
1725
|
-
let a = e.s.$$events?.[t];
|
|
1726
|
-
if (a) {
|
|
1727
|
-
let o = r(a) ? a.slice() : [a], s = yr(t, n, i);
|
|
1728
|
-
for (let t of o) t.call(e.x, s);
|
|
1729
|
-
return !s.defaultPrevented;
|
|
1730
|
-
}
|
|
1731
|
-
return !0;
|
|
1732
|
-
};
|
|
1733
|
-
}
|
|
1734
1715
|
//#endregion
|
|
1735
1716
|
//#region ../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/if.js
|
|
1736
|
-
function
|
|
1717
|
+
function yr(e, t, n = !1) {
|
|
1737
1718
|
var r;
|
|
1738
1719
|
D && (r = O, A());
|
|
1739
1720
|
var i = new _r(e), a = n ? ne : 0;
|
|
@@ -1757,7 +1738,7 @@ function xr(e, t, n = !1) {
|
|
|
1757
1738
|
}
|
|
1758
1739
|
//#endregion
|
|
1759
1740
|
//#region ../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/css.js
|
|
1760
|
-
function
|
|
1741
|
+
function br(e, t) {
|
|
1761
1742
|
ln(() => {
|
|
1762
1743
|
e = G?.parent?.nodes?.start ?? e;
|
|
1763
1744
|
var n = e.getRootNode(), r = n.host ? n : n.head ?? n.ownerDocument.head;
|
|
@@ -1769,22 +1750,22 @@ function Sr(e, t) {
|
|
|
1769
1750
|
}
|
|
1770
1751
|
//#endregion
|
|
1771
1752
|
//#region ../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
|
|
1772
|
-
function
|
|
1753
|
+
function xr(e, t) {
|
|
1773
1754
|
return e === t || e?.[E] === t;
|
|
1774
1755
|
}
|
|
1775
|
-
function
|
|
1756
|
+
function Sr(e = Le(), t, n, r) {
|
|
1776
1757
|
var i = M.r, a = G;
|
|
1777
1758
|
return ln(() => {
|
|
1778
1759
|
var o, s;
|
|
1779
1760
|
return dn(() => {
|
|
1780
1761
|
o = s, s = r?.() || [], Gn(() => {
|
|
1781
|
-
|
|
1762
|
+
xr(n(...s), e) || (t(e, ...s), o && xr(n(...o), e) && t(null, ...o));
|
|
1782
1763
|
});
|
|
1783
1764
|
}), () => {
|
|
1784
1765
|
let r = a;
|
|
1785
1766
|
for (; r !== i && r.parent !== null && r.parent.f & 33554432;) r = r.parent;
|
|
1786
1767
|
let o = () => {
|
|
1787
|
-
s &&
|
|
1768
|
+
s && xr(n(...s), e) && t(null, ...s);
|
|
1788
1769
|
}, c = r.teardown;
|
|
1789
1770
|
r.teardown = () => {
|
|
1790
1771
|
o(), c?.();
|
|
@@ -1830,10 +1811,10 @@ function Q(e, t, n, r) {
|
|
|
1830
1811
|
}
|
|
1831
1812
|
//#endregion
|
|
1832
1813
|
//#region ../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/legacy/legacy-client.js
|
|
1833
|
-
function
|
|
1834
|
-
return new
|
|
1814
|
+
function Cr(e) {
|
|
1815
|
+
return new wr(e);
|
|
1835
1816
|
}
|
|
1836
|
-
var
|
|
1817
|
+
var wr = class {
|
|
1837
1818
|
#e;
|
|
1838
1819
|
#t;
|
|
1839
1820
|
constructor(e) {
|
|
@@ -1892,8 +1873,8 @@ var Er = class {
|
|
|
1892
1873
|
$destroy() {
|
|
1893
1874
|
this.#t.$destroy();
|
|
1894
1875
|
}
|
|
1895
|
-
},
|
|
1896
|
-
typeof HTMLElement == "function" && (
|
|
1876
|
+
}, Tr;
|
|
1877
|
+
typeof HTMLElement == "function" && (Tr = class extends HTMLElement {
|
|
1897
1878
|
$$ctor;
|
|
1898
1879
|
$$s;
|
|
1899
1880
|
$$c;
|
|
@@ -1930,14 +1911,14 @@ typeof HTMLElement == "function" && (Dr = class extends HTMLElement {
|
|
|
1930
1911
|
e !== "default" && (n.name = e), rr(t, n);
|
|
1931
1912
|
};
|
|
1932
1913
|
}
|
|
1933
|
-
let t = {}, n =
|
|
1914
|
+
let t = {}, n = Dr(this);
|
|
1934
1915
|
for (let r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
|
|
1935
1916
|
for (let e of this.attributes) {
|
|
1936
1917
|
let t = this.$$g_p(e.name);
|
|
1937
|
-
t in this.$$d || (this.$$d[t] =
|
|
1918
|
+
t in this.$$d || (this.$$d[t] = Er(t, e.value, this.$$p_d, "toProp"));
|
|
1938
1919
|
}
|
|
1939
1920
|
for (let e in this.$$p_d) !(e in this.$$d) && this[e] !== void 0 && (this.$$d[e] = this[e], delete this[e]);
|
|
1940
|
-
this.$$c =
|
|
1921
|
+
this.$$c = Cr({
|
|
1941
1922
|
component: this.$$ctor,
|
|
1942
1923
|
target: this.$$shadowRoot || this,
|
|
1943
1924
|
props: {
|
|
@@ -1951,7 +1932,7 @@ typeof HTMLElement == "function" && (Dr = class extends HTMLElement {
|
|
|
1951
1932
|
for (let e of s(this.$$c)) {
|
|
1952
1933
|
if (!this.$$p_d[e]?.reflect) continue;
|
|
1953
1934
|
this.$$d[e] = this.$$c[e];
|
|
1954
|
-
let t =
|
|
1935
|
+
let t = Er(e, this.$$d[e], this.$$p_d, "toAttribute");
|
|
1955
1936
|
t == null ? this.removeAttribute(this.$$p_d[e].attribute || e) : this.setAttribute(this.$$p_d[e].attribute || e, t);
|
|
1956
1937
|
}
|
|
1957
1938
|
this.$$r = !1;
|
|
@@ -1965,7 +1946,7 @@ typeof HTMLElement == "function" && (Dr = class extends HTMLElement {
|
|
|
1965
1946
|
}
|
|
1966
1947
|
}
|
|
1967
1948
|
attributeChangedCallback(e, t, n) {
|
|
1968
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] =
|
|
1949
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = Er(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
|
|
1969
1950
|
}
|
|
1970
1951
|
disconnectedCallback() {
|
|
1971
1952
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
@@ -1976,7 +1957,7 @@ typeof HTMLElement == "function" && (Dr = class extends HTMLElement {
|
|
|
1976
1957
|
return s(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
|
|
1977
1958
|
}
|
|
1978
1959
|
});
|
|
1979
|
-
function
|
|
1960
|
+
function Er(e, t, n, r) {
|
|
1980
1961
|
let i = n[e]?.type;
|
|
1981
1962
|
if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) return t;
|
|
1982
1963
|
if (r === "toAttribute") switch (i) {
|
|
@@ -1994,14 +1975,14 @@ function Or(e, t, n, r) {
|
|
|
1994
1975
|
default: return t;
|
|
1995
1976
|
}
|
|
1996
1977
|
}
|
|
1997
|
-
function
|
|
1978
|
+
function Dr(e) {
|
|
1998
1979
|
let t = {};
|
|
1999
1980
|
return e.childNodes.forEach((e) => {
|
|
2000
1981
|
t[e.slot || "default"] = !0;
|
|
2001
1982
|
}), t;
|
|
2002
1983
|
}
|
|
2003
|
-
function
|
|
2004
|
-
let o = class extends
|
|
1984
|
+
function Or(e, t, n, r, i, a) {
|
|
1985
|
+
let o = class extends Tr {
|
|
2005
1986
|
constructor() {
|
|
2006
1987
|
super(e, n, i), this.$$p_d = t;
|
|
2007
1988
|
}
|
|
@@ -2015,7 +1996,7 @@ function Ar(e, t, n, r, i, a) {
|
|
|
2015
1996
|
return this.$$c && e in this.$$c ? this.$$c[e] : this.$$d[e];
|
|
2016
1997
|
},
|
|
2017
1998
|
set(n) {
|
|
2018
|
-
n =
|
|
1999
|
+
n = Er(e, n, t), this.$$d[e] = n;
|
|
2019
2000
|
var r = this.$$c;
|
|
2020
2001
|
r && (l(r, e)?.get ? r[e] = n : r.$set({ [e]: n }));
|
|
2021
2002
|
}
|
|
@@ -2028,13 +2009,13 @@ function Ar(e, t, n, r, i, a) {
|
|
|
2028
2009
|
}
|
|
2029
2010
|
//#endregion
|
|
2030
2011
|
//#region src/lib/element-loader.ts
|
|
2031
|
-
var
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2012
|
+
var kr = null;
|
|
2013
|
+
function Ar(e) {
|
|
2014
|
+
kr = e ?? null;
|
|
2034
2015
|
}
|
|
2035
|
-
async function
|
|
2036
|
-
if (!e.cdnUrl &&
|
|
2037
|
-
let n = await
|
|
2016
|
+
async function jr(e, t = !1) {
|
|
2017
|
+
if (!e.cdnUrl && kr) {
|
|
2018
|
+
let n = await kr(e);
|
|
2038
2019
|
if (n != null) return t && console.log(`[element-loader] Resolved ${e.kind} module via injected resolver for ${e.packagePath}`), n;
|
|
2039
2020
|
}
|
|
2040
2021
|
let n = e.cdnUrl ? `${e.cdnUrl}/${e.packagePath}` : e.packagePath;
|
|
@@ -2043,14 +2024,14 @@ async function Nr(e, t = !1) {
|
|
|
2043
2024
|
n
|
|
2044
2025
|
);
|
|
2045
2026
|
}
|
|
2046
|
-
async function
|
|
2027
|
+
async function Mr(e, t, n, r = !1, i = !1) {
|
|
2047
2028
|
if (customElements.get(t)) {
|
|
2048
2029
|
r && console.log(`[element-loader] Element ${t} already registered`);
|
|
2049
2030
|
return;
|
|
2050
2031
|
}
|
|
2051
2032
|
r && console.log(`[element-loader] Loading element ${e} (cdnUrl: ${n || "local"})`);
|
|
2052
2033
|
try {
|
|
2053
|
-
let i = e.replace(/^@pie-element\//, "").replace(/\/(author|print|controller)$/, ""), a = e.endsWith("/author") ? "author" : e.endsWith("/print") ? "print" : "delivery", o = await
|
|
2034
|
+
let i = e.replace(/^@pie-element\//, "").replace(/\/(author|print|controller)$/, ""), a = e.endsWith("/author") ? "author" : e.endsWith("/print") ? "print" : "delivery", o = await jr({
|
|
2054
2035
|
packagePath: e,
|
|
2055
2036
|
packageName: `@pie-element/${i}`,
|
|
2056
2037
|
elementName: i,
|
|
@@ -2066,11 +2047,11 @@ async function Pr(e, t, n, r = !1, i = !1) {
|
|
|
2066
2047
|
r && console.log(`[element-loader] Optional element ${e} not available`);
|
|
2067
2048
|
}
|
|
2068
2049
|
}
|
|
2069
|
-
async function
|
|
2050
|
+
async function Nr(e, t, n = !1) {
|
|
2070
2051
|
let r = `${e}/controller`;
|
|
2071
2052
|
n && console.log(`[element-loader] Loading controller from ${r} (cdnUrl: ${t || "local"})`);
|
|
2072
2053
|
try {
|
|
2073
|
-
let i = await
|
|
2054
|
+
let i = await jr({
|
|
2074
2055
|
packagePath: r,
|
|
2075
2056
|
packageName: e,
|
|
2076
2057
|
elementName: e.replace(/^@pie-element\//, ""),
|
|
@@ -2084,10 +2065,10 @@ async function Fr(e, t, n = !1) {
|
|
|
2084
2065
|
throw console.error(`[element-loader] Failed to load controller ${e}:`, n), Error(`Failed to load controller ${e}: ${n.message}`);
|
|
2085
2066
|
}
|
|
2086
2067
|
}
|
|
2087
|
-
async function
|
|
2068
|
+
async function Pr(e, t, n = !1) {
|
|
2088
2069
|
let r = `${e}/runtime-support`;
|
|
2089
2070
|
n && console.log(`[element-loader] Loading runtime support ${r} (cdnUrl: ${t || "local"})`);
|
|
2090
|
-
let i = await
|
|
2071
|
+
let i = await jr({
|
|
2091
2072
|
packagePath: r,
|
|
2092
2073
|
packageName: e,
|
|
2093
2074
|
elementName: e.replace(/^@pie-element\//, ""),
|
|
@@ -2099,7 +2080,7 @@ async function Ir(e, t, n = !1) {
|
|
|
2099
2080
|
}
|
|
2100
2081
|
//#endregion
|
|
2101
2082
|
//#region src/lib/iife-bundle-loader.ts
|
|
2102
|
-
var
|
|
2083
|
+
var Fr = {
|
|
2103
2084
|
retryDelayMs: 3e3,
|
|
2104
2085
|
timeoutMs: 12e4
|
|
2105
2086
|
}, $ = class extends Error {
|
|
@@ -2107,30 +2088,30 @@ var Lr = {
|
|
|
2107
2088
|
super(t), this.name = "IifeBundleLoadError", this.code = e, this.metadata = n;
|
|
2108
2089
|
}
|
|
2109
2090
|
};
|
|
2110
|
-
function
|
|
2091
|
+
function Ir(e) {
|
|
2111
2092
|
return {
|
|
2112
|
-
retryDelayMs: typeof e?.retryDelayMs == "number" && e.retryDelayMs > 0 ? e.retryDelayMs :
|
|
2113
|
-
timeoutMs: typeof e?.timeoutMs == "number" && e.timeoutMs > 0 ? e.timeoutMs :
|
|
2093
|
+
retryDelayMs: typeof e?.retryDelayMs == "number" && e.retryDelayMs > 0 ? e.retryDelayMs : Fr.retryDelayMs,
|
|
2094
|
+
timeoutMs: typeof e?.timeoutMs == "number" && e.timeoutMs > 0 ? e.timeoutMs : Fr.timeoutMs
|
|
2114
2095
|
};
|
|
2115
2096
|
}
|
|
2116
|
-
function
|
|
2097
|
+
function Lr(e) {
|
|
2117
2098
|
return e instanceof $ ? e.code === "SCRIPT_LOAD_FAILED" || e.code === "BUILD_START_FAILED" || e.code === "BUILD_STATUS_FAILED" : !1;
|
|
2118
2099
|
}
|
|
2119
|
-
function
|
|
2100
|
+
function Rr(e) {
|
|
2120
2101
|
return e instanceof Error ? e.message : typeof e == "string" ? e : String(e);
|
|
2121
2102
|
}
|
|
2122
|
-
function
|
|
2103
|
+
function zr(e) {
|
|
2123
2104
|
return new Promise((t) => setTimeout(t, e));
|
|
2124
2105
|
}
|
|
2125
|
-
function
|
|
2106
|
+
function Br(e) {
|
|
2126
2107
|
if (e?.aborted) throw new $("LOAD_ABORTED", "IIFE bundle load aborted");
|
|
2127
2108
|
}
|
|
2128
|
-
async function
|
|
2109
|
+
async function Vr(e, t) {
|
|
2129
2110
|
if (!t) {
|
|
2130
|
-
await
|
|
2111
|
+
await zr(e);
|
|
2131
2112
|
return;
|
|
2132
2113
|
}
|
|
2133
|
-
t.aborted &&
|
|
2114
|
+
t.aborted && Br(t), await new Promise((n, r) => {
|
|
2134
2115
|
let i = setTimeout(() => {
|
|
2135
2116
|
t.removeEventListener("abort", a), n();
|
|
2136
2117
|
}, e), a = () => {
|
|
@@ -2139,48 +2120,48 @@ async function Ur(e, t) {
|
|
|
2139
2120
|
t.addEventListener("abort", a);
|
|
2140
2121
|
});
|
|
2141
2122
|
}
|
|
2142
|
-
var
|
|
2143
|
-
function
|
|
2144
|
-
|
|
2123
|
+
var Hr = /* @__PURE__ */ new Map(), Ur = {};
|
|
2124
|
+
function Wr(e) {
|
|
2125
|
+
Ur = e ?? {};
|
|
2145
2126
|
}
|
|
2146
|
-
function
|
|
2127
|
+
function Gr() {
|
|
2147
2128
|
let e = window.pie;
|
|
2148
2129
|
if (!e) throw new $("REGISTRY_INVALID", "window.pie not found after loading IIFE bundle");
|
|
2149
2130
|
let t = e.default || e;
|
|
2150
2131
|
if (!t || typeof t != "object") throw new $("REGISTRY_INVALID", "Invalid IIFE package registry shape");
|
|
2151
2132
|
return t;
|
|
2152
2133
|
}
|
|
2153
|
-
function
|
|
2154
|
-
let t =
|
|
2134
|
+
function Kr(e) {
|
|
2135
|
+
let t = Hr.get(e);
|
|
2155
2136
|
if (t) return t;
|
|
2156
2137
|
let n = new Promise((t, n) => {
|
|
2157
2138
|
let r = document.createElement("script");
|
|
2158
2139
|
r.src = e, r.defer = !0, r.dataset.pieBundle = "true", r.onload = () => {
|
|
2159
2140
|
try {
|
|
2160
|
-
t(
|
|
2141
|
+
t(Gr());
|
|
2161
2142
|
} catch (t) {
|
|
2162
|
-
|
|
2143
|
+
Hr.delete(e), n(t instanceof Error ? t : new $("REGISTRY_INVALID", String(t)));
|
|
2163
2144
|
}
|
|
2164
2145
|
}, r.onerror = () => {
|
|
2165
|
-
|
|
2146
|
+
Hr.delete(e), n(new $("SCRIPT_LOAD_FAILED", `Failed to load IIFE bundle: ${e}`, { url: e }));
|
|
2166
2147
|
}, document.head.appendChild(r);
|
|
2167
2148
|
});
|
|
2168
|
-
return
|
|
2149
|
+
return Hr.set(e, n), n;
|
|
2169
2150
|
}
|
|
2170
|
-
function
|
|
2151
|
+
function qr(e, t) {
|
|
2171
2152
|
return e ? t === "player" ? e.player || "" : t === "editor" ? e.editor || "" : e.clientPlayer || "" : "";
|
|
2172
2153
|
}
|
|
2173
|
-
function
|
|
2154
|
+
function Jr(e) {
|
|
2174
2155
|
return `${e.trim().replace(/\/+$/, "")}/`;
|
|
2175
2156
|
}
|
|
2176
|
-
function
|
|
2157
|
+
function Yr(e) {
|
|
2177
2158
|
return e === "editor" ? "editor.js" : e === "player" ? "player.js" : "client-player.js";
|
|
2178
2159
|
}
|
|
2179
|
-
function
|
|
2180
|
-
let a = encodeURI(`${t}@${n}`), o = `${
|
|
2160
|
+
function Xr({ bundleHost: e, packageName: t, version: n, bundleTarget: r, forceRebuild: i }) {
|
|
2161
|
+
let a = encodeURI(`${t}@${n}`), o = `${Jr(e)}${a}/${Yr(r)}`;
|
|
2181
2162
|
return i ? `${o}${o.includes("?") ? "&" : "?"}overwrite=true&rebuild=${Date.now()}` : o;
|
|
2182
2163
|
}
|
|
2183
|
-
function
|
|
2164
|
+
function Zr(e, t) {
|
|
2184
2165
|
let n = e[t];
|
|
2185
2166
|
if (!n) throw new $("PACKAGE_MISSING", `Package ${t} not found in loaded bundle. Available: ${Object.keys(e).join(", ")}`, {
|
|
2186
2167
|
packageName: t,
|
|
@@ -2188,7 +2169,7 @@ function $r(e, t) {
|
|
|
2188
2169
|
});
|
|
2189
2170
|
return n;
|
|
2190
2171
|
}
|
|
2191
|
-
var
|
|
2172
|
+
var Qr = {
|
|
2192
2173
|
async startBuild(e) {
|
|
2193
2174
|
let t = await fetch(e.endpoint, {
|
|
2194
2175
|
method: "POST",
|
|
@@ -2232,23 +2213,23 @@ var ei = {
|
|
|
2232
2213
|
await new Promise((e) => setTimeout(e, 500));
|
|
2233
2214
|
}
|
|
2234
2215
|
}
|
|
2235
|
-
},
|
|
2236
|
-
async function
|
|
2237
|
-
let t = e.bundleTarget || "client-player", n = e.endpoint || "/api/bundle", r =
|
|
2216
|
+
}, $r = { load: (e) => Kr(e) };
|
|
2217
|
+
async function ei(e) {
|
|
2218
|
+
let t = e.bundleTarget || "client-player", n = e.endpoint || "/api/bundle", r = Ir(e.iifeBundleRetry), i = e.adapters ?? Ur, a = i.buildClient ?? Qr, o = i.registryClient ?? $r, s = Date.now(), c = 0;
|
|
2238
2219
|
for (;;) {
|
|
2239
2220
|
c += 1;
|
|
2240
2221
|
try {
|
|
2241
|
-
if (
|
|
2222
|
+
if (Br(e.signal), e.bundleHost) {
|
|
2242
2223
|
e.onProgress?.({ stage: "script-load" });
|
|
2243
|
-
let n =
|
|
2224
|
+
let n = Xr({
|
|
2244
2225
|
bundleHost: e.bundleHost,
|
|
2245
2226
|
packageName: e.packageName,
|
|
2246
2227
|
version: e.version,
|
|
2247
2228
|
bundleTarget: t,
|
|
2248
2229
|
forceRebuild: !!e.forceRebuild
|
|
2249
2230
|
}), i = await o.load(n);
|
|
2250
|
-
|
|
2251
|
-
let a =
|
|
2231
|
+
Br(e.signal);
|
|
2232
|
+
let a = Zr(i, e.packageName), l = {
|
|
2252
2233
|
source: "hosted",
|
|
2253
2234
|
url: n
|
|
2254
2235
|
};
|
|
@@ -2277,11 +2258,11 @@ async function ni(e) {
|
|
|
2277
2258
|
endpoint: n,
|
|
2278
2259
|
onProgress: e.onProgress
|
|
2279
2260
|
});
|
|
2280
|
-
if (
|
|
2261
|
+
if (Br(e.signal), !l.success) throw new $("BUILD_RESULT_FAILED", l.errors?.join("\n") || "Local bundle build failed", {
|
|
2281
2262
|
packageName: e.packageName,
|
|
2282
2263
|
endpoint: n
|
|
2283
2264
|
});
|
|
2284
|
-
let u =
|
|
2265
|
+
let u = qr(l.bundles, t);
|
|
2285
2266
|
if (!u) throw new $("BUNDLE_URL_MISSING", "Bundle URL was not returned", {
|
|
2286
2267
|
packageName: e.packageName,
|
|
2287
2268
|
bundleTarget: t
|
|
@@ -2298,8 +2279,8 @@ async function ni(e) {
|
|
|
2298
2279
|
cached: l.cached,
|
|
2299
2280
|
url: u
|
|
2300
2281
|
}, p = await o.load(u);
|
|
2301
|
-
|
|
2302
|
-
let m =
|
|
2282
|
+
Br(e.signal);
|
|
2283
|
+
let m = Zr(p, e.packageName);
|
|
2303
2284
|
if (c > 1) {
|
|
2304
2285
|
let t = Date.now() - s;
|
|
2305
2286
|
console.info(`[iife-bundle-loader] retry recovered after ${c} attempts (${t}ms): ${e.packageName}@${e.version}`);
|
|
@@ -2321,10 +2302,10 @@ async function ni(e) {
|
|
|
2321
2302
|
attempt: c,
|
|
2322
2303
|
elapsedMs: Date.now() - s,
|
|
2323
2304
|
timeoutMs: r.timeoutMs,
|
|
2324
|
-
reason:
|
|
2305
|
+
reason: Rr(t)
|
|
2325
2306
|
}), t;
|
|
2326
|
-
if (!
|
|
2327
|
-
let i = Date.now() - s, a = r.timeoutMs - i, o =
|
|
2307
|
+
if (!Lr(t)) throw t;
|
|
2308
|
+
let i = Date.now() - s, a = r.timeoutMs - i, o = Rr(t);
|
|
2328
2309
|
if (a <= 0) throw e.onRetryStatus?.({
|
|
2329
2310
|
state: "timeout",
|
|
2330
2311
|
stage: t.code === "SCRIPT_LOAD_FAILED" ? "script-load" : "build-status",
|
|
@@ -2352,31 +2333,31 @@ async function ni(e) {
|
|
|
2352
2333
|
retryDelayMs: l,
|
|
2353
2334
|
timeoutMs: r.timeoutMs,
|
|
2354
2335
|
reason: o
|
|
2355
|
-
}), await
|
|
2336
|
+
}), await Vr(l, e.signal);
|
|
2356
2337
|
}
|
|
2357
2338
|
}
|
|
2358
2339
|
}
|
|
2359
2340
|
//#endregion
|
|
2360
2341
|
//#region src/lib/player-strategy.ts
|
|
2361
|
-
function
|
|
2342
|
+
function ti(e, t = "esm") {
|
|
2362
2343
|
return e === "esm" || e === "iife" || e === "preloaded" ? e : t;
|
|
2363
2344
|
}
|
|
2364
|
-
function
|
|
2345
|
+
function ni(e, t = "delivery") {
|
|
2365
2346
|
return e === "delivery" || e === "author" || e === "print" ? e : t;
|
|
2366
2347
|
}
|
|
2367
|
-
function
|
|
2368
|
-
let n =
|
|
2348
|
+
function ri(e, t = "delivery") {
|
|
2349
|
+
let n = ni(e.view ?? void 0, t);
|
|
2369
2350
|
return e.view ? n : e.mode === "author" ? "author" : e.mode === "print" ? "print" : t;
|
|
2370
2351
|
}
|
|
2371
2352
|
//#endregion
|
|
2372
2353
|
//#region src/lib/runtime-support.ts
|
|
2373
|
-
function
|
|
2354
|
+
function ii(e, t = "off") {
|
|
2374
2355
|
return e === "off" || e === "on" ? e : t;
|
|
2375
2356
|
}
|
|
2376
|
-
function
|
|
2357
|
+
function ai(e) {
|
|
2377
2358
|
return e === "on";
|
|
2378
2359
|
}
|
|
2379
|
-
function
|
|
2360
|
+
function oi(e, t, n) {
|
|
2380
2361
|
let r = e.supports?.[t];
|
|
2381
2362
|
if (!r) return !0;
|
|
2382
2363
|
let i = r[n];
|
|
@@ -2384,17 +2365,17 @@ function ci(e, t, n) {
|
|
|
2384
2365
|
}
|
|
2385
2366
|
//#endregion
|
|
2386
2367
|
//#region src/lib/unified-player-loader.ts
|
|
2387
|
-
var
|
|
2388
|
-
function
|
|
2368
|
+
var si = 3e4, ci = /* @__PURE__ */ new Map(), li = /* @__PURE__ */ new Map();
|
|
2369
|
+
function ui(e, t, n, r) {
|
|
2389
2370
|
if (n !== "delivery" || r?.status === "loaded") return;
|
|
2390
2371
|
let i = r?.message || `controller status=${r?.status || "missing"}`;
|
|
2391
2372
|
throw Error(`Controller contract violation for ${e.packageName} (${t}/${n}): ${i}. Delivery mode requires a loadable controller.`);
|
|
2392
2373
|
}
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2395
|
-
return e === "iife" ?
|
|
2374
|
+
var di = (e, t) => t === "delivery" ? `pie-iife-${e}`.replace(/[^a-z0-9-]/g, "-") : t === "author" ? `${e}-configure` : `${e}-print`, fi = (e, t) => t === "delivery" ? `${e}-element` : t === "author" ? `${e}-configure` : `${e}-print`;
|
|
2375
|
+
function pi(e, t, n) {
|
|
2376
|
+
return e === "iife" ? di(n, t) : fi(n, t);
|
|
2396
2377
|
}
|
|
2397
|
-
function
|
|
2378
|
+
function mi(e, t, n) {
|
|
2398
2379
|
return {
|
|
2399
2380
|
status: "not-required",
|
|
2400
2381
|
source: "none",
|
|
@@ -2403,13 +2384,13 @@ function gi(e, t, n) {
|
|
|
2403
2384
|
view: n
|
|
2404
2385
|
};
|
|
2405
2386
|
}
|
|
2406
|
-
async function
|
|
2387
|
+
async function hi(e, t, n) {
|
|
2407
2388
|
if (n !== "delivery" && n !== "author") return {
|
|
2408
2389
|
controller: void 0,
|
|
2409
|
-
diagnostic:
|
|
2390
|
+
diagnostic: mi(e.packageName, t, n)
|
|
2410
2391
|
};
|
|
2411
2392
|
try {
|
|
2412
|
-
let r = await
|
|
2393
|
+
let r = await Nr(e.packageName, e.cdnUrl || "");
|
|
2413
2394
|
return {
|
|
2414
2395
|
controller: r,
|
|
2415
2396
|
diagnostic: {
|
|
@@ -2436,18 +2417,18 @@ async function _i(e, t, n) {
|
|
|
2436
2417
|
};
|
|
2437
2418
|
}
|
|
2438
2419
|
}
|
|
2439
|
-
function
|
|
2440
|
-
|
|
2420
|
+
function gi(e) {
|
|
2421
|
+
Ar(e);
|
|
2441
2422
|
}
|
|
2442
|
-
function
|
|
2423
|
+
function _i(e) {
|
|
2443
2424
|
return `${e.packageName}@${e.elementVersion || "latest"}`;
|
|
2444
2425
|
}
|
|
2445
|
-
function
|
|
2426
|
+
function vi(e) {
|
|
2446
2427
|
let t = String(e || "").toLowerCase();
|
|
2447
2428
|
return t.includes("cannot find module") || t.includes("no known conditions") || t.includes("failed to fetch dynamically imported module") || t.includes("404") || t.includes("/runtime-support");
|
|
2448
2429
|
}
|
|
2449
|
-
async function
|
|
2450
|
-
if (!
|
|
2430
|
+
async function yi(e, t, n) {
|
|
2431
|
+
if (!ai(ii(e.runtimeSupportCheck, "off"))) return {
|
|
2451
2432
|
runtimeSupport: void 0,
|
|
2452
2433
|
diagnostic: {
|
|
2453
2434
|
status: "skipped",
|
|
@@ -2456,7 +2437,7 @@ async function xi(e, t, n) {
|
|
|
2456
2437
|
view: n
|
|
2457
2438
|
}
|
|
2458
2439
|
};
|
|
2459
|
-
let r =
|
|
2440
|
+
let r = _i(e), i = ci.get(r);
|
|
2460
2441
|
if (i) return {
|
|
2461
2442
|
runtimeSupport: i,
|
|
2462
2443
|
diagnostic: {
|
|
@@ -2466,8 +2447,8 @@ async function xi(e, t, n) {
|
|
|
2466
2447
|
view: n
|
|
2467
2448
|
}
|
|
2468
2449
|
};
|
|
2469
|
-
let a =
|
|
2470
|
-
if (a && Date.now() - a <
|
|
2450
|
+
let a = li.get(r);
|
|
2451
|
+
if (a && Date.now() - a < si) return {
|
|
2471
2452
|
runtimeSupport: void 0,
|
|
2472
2453
|
diagnostic: {
|
|
2473
2454
|
status: "missing",
|
|
@@ -2478,8 +2459,8 @@ async function xi(e, t, n) {
|
|
|
2478
2459
|
}
|
|
2479
2460
|
};
|
|
2480
2461
|
try {
|
|
2481
|
-
let i = await
|
|
2482
|
-
return
|
|
2462
|
+
let i = await Pr(e.packageName, e.cdnUrl || "");
|
|
2463
|
+
return ci.set(r, i), li.delete(r), {
|
|
2483
2464
|
runtimeSupport: i,
|
|
2484
2465
|
diagnostic: {
|
|
2485
2466
|
status: "loaded",
|
|
@@ -2490,7 +2471,7 @@ async function xi(e, t, n) {
|
|
|
2490
2471
|
};
|
|
2491
2472
|
} catch (i) {
|
|
2492
2473
|
let a = i instanceof Error ? i.message : String(i);
|
|
2493
|
-
return
|
|
2474
|
+
return vi(i) ? (li.set(r, Date.now()), {
|
|
2494
2475
|
runtimeSupport: void 0,
|
|
2495
2476
|
diagnostic: {
|
|
2496
2477
|
status: "missing",
|
|
@@ -2511,14 +2492,14 @@ async function xi(e, t, n) {
|
|
|
2511
2492
|
};
|
|
2512
2493
|
}
|
|
2513
2494
|
}
|
|
2514
|
-
function
|
|
2515
|
-
return !r || e !== "esm" && e !== "iife" ||
|
|
2495
|
+
function bi(e, t, n, r) {
|
|
2496
|
+
return !r || e !== "esm" && e !== "iife" || oi(r, e, t) ? "" : ` Runtime support metadata indicates ${e}/${t} is unsupported for ${n}.`;
|
|
2516
2497
|
}
|
|
2517
|
-
async function
|
|
2518
|
-
let a =
|
|
2519
|
-
await
|
|
2520
|
-
let { controller: o, diagnostic: s } = await
|
|
2521
|
-
return
|
|
2498
|
+
async function xi(e, t, n, r, i) {
|
|
2499
|
+
let a = fi(e.elementName, t);
|
|
2500
|
+
await Mr(t === "delivery" ? e.packageName : t === "author" ? `${e.packageName}/author` : `${e.packageName}/print`, a, e.cdnUrl || ""), await customElements.whenDefined(a);
|
|
2501
|
+
let { controller: o, diagnostic: s } = await hi(e, "esm", t);
|
|
2502
|
+
return ui(e, "esm", t, s), {
|
|
2522
2503
|
strategy: "esm",
|
|
2523
2504
|
requestedStrategy: n,
|
|
2524
2505
|
view: t,
|
|
@@ -2529,19 +2510,19 @@ async function Ci(e, t, n, r, i) {
|
|
|
2529
2510
|
runtimeSupportDiagnostic: i
|
|
2530
2511
|
};
|
|
2531
2512
|
}
|
|
2532
|
-
async function
|
|
2533
|
-
let a = t === "author" ? "editor" : t === "print" ? "player" : "client-player", { pkg: o, meta: s } = await
|
|
2513
|
+
async function Si(e, t, n, r, i) {
|
|
2514
|
+
let a = t === "author" ? "editor" : t === "print" ? "player" : "client-player", { pkg: o, meta: s } = await ei({
|
|
2534
2515
|
packageName: e.packageName,
|
|
2535
2516
|
version: e.elementVersion,
|
|
2536
2517
|
endpoint: e.iifeBundleEndpoint,
|
|
2537
2518
|
bundleHost: e.iifeBundleHost,
|
|
2538
|
-
iifeBundleRetry: e.iifeBundleRetry ??
|
|
2519
|
+
iifeBundleRetry: e.iifeBundleRetry ?? Fr,
|
|
2539
2520
|
onRetryStatus: e.onIifeBundleRetryStatus,
|
|
2540
2521
|
signal: e.signal,
|
|
2541
2522
|
bundleTarget: a,
|
|
2542
2523
|
forceRebuild: (e.rebuildVersion || 0) > 0,
|
|
2543
2524
|
clearCache: (e.rebuildVersion || 0) > 0
|
|
2544
|
-
}), c =
|
|
2525
|
+
}), c = di(e.elementName, t), l = t === "delivery" ? o.Element : t === "author" ? o.Configure : o.Print;
|
|
2545
2526
|
if (!l) throw Error(`IIFE bundle is missing ${t} export for ${e.packageName}`);
|
|
2546
2527
|
customElements.get(c) || customElements.define(c, class extends l {}), await customElements.whenDefined(c);
|
|
2547
2528
|
let u = o.controller, d;
|
|
@@ -2561,10 +2542,10 @@ async function wi(e, t, n, r, i) {
|
|
|
2561
2542
|
message: "client-player bundle did not include controller export"
|
|
2562
2543
|
};
|
|
2563
2544
|
else {
|
|
2564
|
-
let n = await
|
|
2545
|
+
let n = await hi(e, "iife", t);
|
|
2565
2546
|
u = n.controller, d = n.diagnostic;
|
|
2566
2547
|
}
|
|
2567
|
-
return
|
|
2548
|
+
return ui(e, "iife", t, d), {
|
|
2568
2549
|
strategy: "iife",
|
|
2569
2550
|
requestedStrategy: n,
|
|
2570
2551
|
view: t,
|
|
@@ -2576,36 +2557,46 @@ async function wi(e, t, n, r, i) {
|
|
|
2576
2557
|
runtimeSupportDiagnostic: i
|
|
2577
2558
|
};
|
|
2578
2559
|
}
|
|
2579
|
-
async function
|
|
2580
|
-
let t =
|
|
2560
|
+
async function Ci(e) {
|
|
2561
|
+
let t = ti(e.strategy, "esm"), n = t, r = ni(e.view, "delivery");
|
|
2581
2562
|
if (n === "preloaded") {
|
|
2582
|
-
let t =
|
|
2563
|
+
let t = ti(e.preloadedFallbackStrategy, "esm"), n = pi(t, r, e.elementName);
|
|
2583
2564
|
return customElements.get(n) ? {
|
|
2584
2565
|
strategy: "preloaded",
|
|
2585
2566
|
view: r,
|
|
2586
2567
|
tagName: n
|
|
2587
|
-
} :
|
|
2568
|
+
} : Ci({
|
|
2588
2569
|
...e,
|
|
2589
2570
|
strategy: t
|
|
2590
2571
|
});
|
|
2591
2572
|
}
|
|
2592
|
-
let i = await
|
|
2573
|
+
let i = await yi(e, n, r);
|
|
2593
2574
|
try {
|
|
2594
|
-
return n === "iife" ?
|
|
2575
|
+
return n === "iife" ? Si(e, r, t, i.runtimeSupport, i.diagnostic) : xi(e, r, t, i.runtimeSupport, i.diagnostic);
|
|
2595
2576
|
} catch (t) {
|
|
2596
|
-
let a = t instanceof Error ? t.message : String(t), o =
|
|
2577
|
+
let a = t instanceof Error ? t.message : String(t), o = bi(n, r, e.packageName, i.runtimeSupport);
|
|
2597
2578
|
throw Error(`${a}${o}`);
|
|
2598
2579
|
}
|
|
2599
2580
|
}
|
|
2600
2581
|
//#endregion
|
|
2601
2582
|
//#region src/players/PieElementPlayer.svelte
|
|
2602
|
-
var
|
|
2583
|
+
var wi = /* @__PURE__ */ nr("<div class=\"loading-warning svelte-srjg3v\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"> </div>"), Ti = /* @__PURE__ */ nr("<div class=\"loading svelte-srjg3v\"> <!></div>"), Ei = /* @__PURE__ */ nr("<div class=\"error svelte-srjg3v\"><strong>Element player error:</strong> <pre class=\"svelte-srjg3v\"> </pre></div>"), Di = /* @__PURE__ */ nr("<div class=\"demo-element-player element-player-host svelte-srjg3v\"><div class=\"element-player-mount svelte-srjg3v\"></div> <!> <!></div>"), Oi = {
|
|
2603
2584
|
hash: "svelte-srjg3v",
|
|
2604
2585
|
code: ".element-player-host.svelte-srjg3v {width:100%;min-height:100px;}.element-player-mount.svelte-srjg3v {width:100%;}.loading.svelte-srjg3v {padding:2rem;text-align:center;color:hsl(var(--bc) / 0.6);font-style:italic;}.loading-warning.svelte-srjg3v {margin-top:0.5rem;color:#9a6700;font-style:normal;}.error.svelte-srjg3v {padding:1rem;background:hsl(var(--er) / 0.1);border:1px solid hsl(var(--er) / 0.3);border-radius:4px;color:hsl(var(--er));}.error.svelte-srjg3v pre:where(.svelte-srjg3v) {margin:0.5rem 0 0;padding:0.5rem;background:#fff;border-radius:4px;font-size:0.875rem;overflow-x:auto;}"
|
|
2605
2586
|
};
|
|
2606
|
-
function
|
|
2607
|
-
Fe(n, !0),
|
|
2608
|
-
let r = Q(n, "strategy", 7, "esm"), i = Q(n, "view", 7, "delivery"), a = Q(n, "mode", 7, ""), o = Q(n, "elementName", 7, ""), s = Q(n, "packageName", 7, ""), c = Q(n, "elementVersion", 7, "latest"), l = Q(n, "role", 7, "student"), u = Q(n, "cdnUrl", 7, ""), d = Q(n, "iifeBundleEndpoint", 7, "/api/bundle"), f = Q(n, "iifeBundleHost", 7, ""), p = Q(n, "iifeBundleRetry", 7,
|
|
2587
|
+
function ki(t, n) {
|
|
2588
|
+
Fe(n, !0), br(t, Oi);
|
|
2589
|
+
let r = Q(n, "strategy", 7, "esm"), i = Q(n, "view", 7, "delivery"), a = Q(n, "mode", 7, ""), o = Q(n, "elementName", 7, ""), s = Q(n, "packageName", 7, ""), c = Q(n, "elementVersion", 7, "latest"), l = Q(n, "role", 7, "student"), u = Q(n, "cdnUrl", 7, ""), d = Q(n, "iifeBundleEndpoint", 7, "/api/bundle"), f = Q(n, "iifeBundleHost", 7, ""), p = Q(n, "iifeBundleRetry", 7, Fr), m = Q(n, "preloadedFallbackStrategy", 7, "esm"), h = Q(n, "runtimeSupportCheck", 7, "off"), g = Q(n, "rebuildVersion", 7, 0), _ = Q(n, "model", 15), v = Q(n, "session", 15);
|
|
2590
|
+
function y(e, t) {
|
|
2591
|
+
Gn(() => {
|
|
2592
|
+
n.$$host.dispatchEvent(new CustomEvent(e, {
|
|
2593
|
+
detail: t,
|
|
2594
|
+
bubbles: !0,
|
|
2595
|
+
composed: !0
|
|
2596
|
+
}));
|
|
2597
|
+
});
|
|
2598
|
+
}
|
|
2599
|
+
let b, ee, x = /* @__PURE__ */ L(null), te = /* @__PURE__ */ L(null), ne = /* @__PURE__ */ L(!0), S = /* @__PURE__ */ L(null), C = /* @__PURE__ */ L(null), re = 0, w = null, ie = null, T = null, E = null, ae = !1, oe = !1, se = null, ce = null, le = !1, ue = !1, de = "", fe = "", pe = /* @__PURE__ */ new Set(["complete", "component"]), me = null, D = "", he = "", O = /* @__PURE__ */ rt(() => {
|
|
2609
2600
|
if (Z(C)?.state !== "retrying") return null;
|
|
2610
2601
|
let e = Math.max(1, Math.ceil(Z(C).elapsedMs / 1e3)), t = Math.max(1, Math.ceil(Z(C).timeoutMs / 1e3));
|
|
2611
2602
|
return `Bundle is still building. Retrying attempt ${Z(C).attempt} (${e}s of ${t}s).`;
|
|
@@ -2615,7 +2606,7 @@ function ji(t, n) {
|
|
|
2615
2606
|
let t = e;
|
|
2616
2607
|
return t.code === "LOAD_ABORTED" || typeof t.message == "string" && t.message.includes("aborted");
|
|
2617
2608
|
}
|
|
2618
|
-
let A = /* @__PURE__ */ rt(() =>
|
|
2609
|
+
let A = /* @__PURE__ */ rt(() => ti(r(), "esm")), j = /* @__PURE__ */ rt(() => ri({
|
|
2619
2610
|
mode: a(),
|
|
2620
2611
|
view: i()
|
|
2621
2612
|
}, "delivery")), _e = /* @__PURE__ */ rt(() => s() || (o() ? `@pie-element/${o()}` : ""));
|
|
@@ -2675,7 +2666,7 @@ function ji(t, n) {
|
|
|
2675
2666
|
}
|
|
2676
2667
|
function we(e) {
|
|
2677
2668
|
Z(x) && (Ce(), e === "delivery" && (se = (e) => {
|
|
2678
|
-
if (le || ue) {
|
|
2669
|
+
if (le || ue || !D) {
|
|
2679
2670
|
e.stopPropagation();
|
|
2680
2671
|
return;
|
|
2681
2672
|
}
|
|
@@ -2723,7 +2714,7 @@ function ji(t, n) {
|
|
|
2723
2714
|
t !== D && (Z(x).model = ve(e ?? {}), D = t);
|
|
2724
2715
|
}
|
|
2725
2716
|
function Ee(e) {
|
|
2726
|
-
if (!Z(x) || Z(j) !== "delivery" || e == null) return;
|
|
2717
|
+
if (!Z(x) || Z(j) !== "delivery" || e == null || !D) return;
|
|
2727
2718
|
let t = ye(e ?? {});
|
|
2728
2719
|
if (t !== he) {
|
|
2729
2720
|
le = !0;
|
|
@@ -2754,7 +2745,7 @@ function ji(t, n) {
|
|
|
2754
2745
|
stage: "build-status",
|
|
2755
2746
|
attempt: 0,
|
|
2756
2747
|
elapsedMs: 0,
|
|
2757
|
-
timeoutMs: p()?.timeoutMs ??
|
|
2748
|
+
timeoutMs: p()?.timeoutMs ?? Fr.timeoutMs,
|
|
2758
2749
|
reason: "superseded by new load request"
|
|
2759
2750
|
}
|
|
2760
2751
|
}), y("load-cancelled", {
|
|
@@ -2765,7 +2756,7 @@ function ji(t, n) {
|
|
|
2765
2756
|
let t = new AbortController();
|
|
2766
2757
|
w = t, R(ne, !0), R(S, null), R(C, null);
|
|
2767
2758
|
try {
|
|
2768
|
-
let n = await
|
|
2759
|
+
let n = await Ci({
|
|
2769
2760
|
strategy: Z(A),
|
|
2770
2761
|
view: Z(j),
|
|
2771
2762
|
elementName: o(),
|
|
@@ -2778,17 +2769,14 @@ function ji(t, n) {
|
|
|
2778
2769
|
signal: t.signal,
|
|
2779
2770
|
runtimeSupportCheck: h(),
|
|
2780
2771
|
onIifeBundleRetryStatus: (t) => {
|
|
2781
|
-
|
|
2782
|
-
R(C, t, !0), y("bundle-retry-status", t);
|
|
2783
|
-
let n = {
|
|
2772
|
+
e === re && (R(C, t, !0), y("bundle-retry-status", t), y("build-state", {
|
|
2784
2773
|
loading: t.state === "retrying",
|
|
2785
2774
|
error: null,
|
|
2786
2775
|
stage: t.state,
|
|
2787
2776
|
strategy: Z(A),
|
|
2788
2777
|
view: Z(j),
|
|
2789
2778
|
retry: t
|
|
2790
|
-
};
|
|
2791
|
-
y("build-state", n);
|
|
2779
|
+
}));
|
|
2792
2780
|
},
|
|
2793
2781
|
preloadedFallbackStrategy: m(),
|
|
2794
2782
|
rebuildVersion: g()
|
|
@@ -2811,7 +2799,7 @@ function ji(t, n) {
|
|
|
2811
2799
|
stage: "build-status",
|
|
2812
2800
|
attempt: 0,
|
|
2813
2801
|
elapsedMs: 0,
|
|
2814
|
-
timeoutMs: p()?.timeoutMs ??
|
|
2802
|
+
timeoutMs: p()?.timeoutMs ?? Fr.timeoutMs,
|
|
2815
2803
|
reason: n instanceof Error ? n.message : String(n)
|
|
2816
2804
|
};
|
|
2817
2805
|
R(S, null), R(ne, !1), R(C, r, !0), y("bundle-retry-status", r), y("build-state", {
|
|
@@ -2856,7 +2844,7 @@ function ji(t, n) {
|
|
|
2856
2844
|
u(),
|
|
2857
2845
|
d(),
|
|
2858
2846
|
f(),
|
|
2859
|
-
JSON.stringify(p() ||
|
|
2847
|
+
JSON.stringify(p() || Fr),
|
|
2860
2848
|
m(),
|
|
2861
2849
|
g()
|
|
2862
2850
|
].join("|"), Oe();
|
|
@@ -2871,7 +2859,7 @@ function ji(t, n) {
|
|
|
2871
2859
|
Se();
|
|
2872
2860
|
}, 100);
|
|
2873
2861
|
}), xe(), Se()), () => {
|
|
2874
|
-
E &&= (clearTimeout(E), null), T &&= (T.disconnect(), null), ee && ee.replaceChildren(), w?.abort(), w = null, Ce();
|
|
2862
|
+
E &&= (clearTimeout(E), null), T &&= (T.disconnect(), null), ee && ee.replaceChildren(), re++, w?.abort(), w = null, Ce();
|
|
2875
2863
|
}));
|
|
2876
2864
|
var ke = {
|
|
2877
2865
|
get strategy() {
|
|
@@ -2937,7 +2925,7 @@ function ji(t, n) {
|
|
|
2937
2925
|
get iifeBundleRetry() {
|
|
2938
2926
|
return p();
|
|
2939
2927
|
},
|
|
2940
|
-
set iifeBundleRetry(e =
|
|
2928
|
+
set iifeBundleRetry(e = Fr) {
|
|
2941
2929
|
p(e), I();
|
|
2942
2930
|
},
|
|
2943
2931
|
get preloadedFallbackStrategy() {
|
|
@@ -2970,29 +2958,29 @@ function ji(t, n) {
|
|
|
2970
2958
|
set session(e) {
|
|
2971
2959
|
v(e), I();
|
|
2972
2960
|
}
|
|
2973
|
-
}, Ae =
|
|
2974
|
-
|
|
2961
|
+
}, Ae = Di(), je = Kt(Ae);
|
|
2962
|
+
Sr(je, (e) => ee = e, () => ee);
|
|
2975
2963
|
var Me = Jt(je, 2), Ne = (e) => {
|
|
2976
|
-
var t =
|
|
2977
|
-
var t =
|
|
2964
|
+
var t = Ti(), n = Kt(t), r = Jt(n), i = (e) => {
|
|
2965
|
+
var t = wi(), n = qt(t, !0);
|
|
2978
2966
|
fn(() => ur(n, Z(O))), rr(e, t);
|
|
2979
2967
|
};
|
|
2980
|
-
|
|
2968
|
+
yr(r, (e) => {
|
|
2981
2969
|
Z(O) && e(i);
|
|
2982
2970
|
}), ge(t), fn(() => ur(n, `Loading ${o() ?? ""} (${Z(A) ?? ""}/${Z(j) ?? ""})... `)), rr(e, t);
|
|
2983
2971
|
};
|
|
2984
|
-
|
|
2972
|
+
yr(Me, (e) => {
|
|
2985
2973
|
Z(ne) && e(Ne);
|
|
2986
2974
|
});
|
|
2987
2975
|
var M = Jt(Me, 2), Pe = (e) => {
|
|
2988
|
-
var t =
|
|
2976
|
+
var t = Ei(), n = qt(Jt(Kt(t), 2), !0);
|
|
2989
2977
|
ge(t), fn(() => ur(n, Z(S))), rr(e, t);
|
|
2990
2978
|
};
|
|
2991
|
-
return
|
|
2979
|
+
return yr(M, (e) => {
|
|
2992
2980
|
Z(S) && e(Pe);
|
|
2993
|
-
}), ge(Ae),
|
|
2981
|
+
}), ge(Ae), Sr(Ae, (e) => b = e, () => b), rr(t, Ae), Ie(ke);
|
|
2994
2982
|
}
|
|
2995
|
-
customElements.define("pie-element-player",
|
|
2983
|
+
customElements.define("pie-element-player", Or(ki, {
|
|
2996
2984
|
strategy: {
|
|
2997
2985
|
reflect: !0,
|
|
2998
2986
|
type: "String"
|
|
@@ -3058,4 +3046,4 @@ customElements.define("pie-element-player", Ar(ji, {
|
|
|
3058
3046
|
session: { type: "Object" }
|
|
3059
3047
|
}, [], []));
|
|
3060
3048
|
//#endregion
|
|
3061
|
-
export {
|
|
3049
|
+
export { Fr as DEFAULT_IIFE_BUNDLE_RETRY_CONFIG, $ as IifeBundleLoadError, Wr as configureIifeBundleLoader, gi as configureUnifiedPlayerResolver, ti as normalizeElementPlayerStrategy, ni as normalizeElementPlayerView, ii as normalizeRuntimeSupportCheck, ri as resolveElementPlayerView };
|