lido-standalone 0.0.0-beta-19-dev → 0.0.0-beta-20-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-52f24ddb.js → index-9a2514de.js} +3 -1
- package/dist/cjs/index-9a2514de.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-standalone.cjs.entry.js +114 -65
- package/dist/cjs/lido-standalone.cjs.entry.js.map +1 -1
- package/dist/cjs/lido-standalone.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/lido-standalone/lido-standalone.js +148 -63
- package/dist/collection/components/lido-standalone/lido-standalone.js.map +1 -1
- package/dist/components/lido-standalone.js +117 -65
- package/dist/components/lido-standalone.js.map +1 -1
- package/dist/esm/{index-5da3b4be.js → index-32cd7d72.js} +3 -2
- package/dist/esm/index-32cd7d72.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-standalone.entry.js +114 -65
- package/dist/esm/lido-standalone.entry.js.map +1 -1
- package/dist/esm/lido-standalone.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/lido-standalone/index.esm.js +1 -1
- package/dist/lido-standalone/lido-standalone.esm.js +1 -1
- package/dist/lido-standalone/lido-standalone.esm.js.map +1 -1
- package/dist/lido-standalone/p-1469ddb8.js +3 -0
- package/dist/lido-standalone/p-1469ddb8.js.map +1 -0
- package/dist/lido-standalone/p-862a6695.entry.js +2 -0
- package/dist/lido-standalone/p-862a6695.entry.js.map +1 -0
- package/dist/types/components/lido-standalone/lido-standalone.d.ts +13 -3
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/src/components/lido-standalone/lido-standalone.tsx +142 -77
- package/src/components/lido-standalone/readme.md +2 -0
- package/src/components.d.ts +16 -0
- package/dist/cjs/index-52f24ddb.js.map +0 -1
- package/dist/esm/index-5da3b4be.js.map +0 -1
- package/dist/lido-standalone/p-1bb50e6d.entry.js +0 -2
- package/dist/lido-standalone/p-1bb50e6d.entry.js.map +0 -1
- package/dist/lido-standalone/p-3a3323c8.js +0 -3
- package/dist/lido-standalone/p-3a3323c8.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h, a as getElement } from './index-32cd7d72.js';
|
|
2
2
|
|
|
3
3
|
const lidoStandaloneCss = "";
|
|
4
4
|
const LidoStandaloneStyle0 = lidoStandaloneCss;
|
|
@@ -11,7 +11,9 @@ const LidoStandalone = class {
|
|
|
11
11
|
this.initialIndex = 0;
|
|
12
12
|
this.canplay = false;
|
|
13
13
|
this.height = '75vh';
|
|
14
|
+
this.language = undefined;
|
|
14
15
|
this.xmlData = undefined;
|
|
16
|
+
this.zipUrl = undefined;
|
|
15
17
|
this.codeFolderPath = undefined;
|
|
16
18
|
this.commonAudioPath = undefined;
|
|
17
19
|
this.scriptsInjected = false;
|
|
@@ -26,6 +28,10 @@ const LidoStandalone = class {
|
|
|
26
28
|
onXmlPathChange() {
|
|
27
29
|
this.fetchXmlData();
|
|
28
30
|
}
|
|
31
|
+
// Re-apply inline XML whenever the host prop changes.
|
|
32
|
+
onXmlDataChange() {
|
|
33
|
+
this.fetchXmlData();
|
|
34
|
+
}
|
|
29
35
|
componentWillLoad() {
|
|
30
36
|
// 1) Attempt to inject the Lido scripts from baseUrl
|
|
31
37
|
this.injectLidoScripts();
|
|
@@ -47,7 +53,11 @@ const LidoStandalone = class {
|
|
|
47
53
|
const cleanBase = this.baseUrl.replace(/\/+$/, '');
|
|
48
54
|
const scriptCheckUrl = `${cleanBase}/code/lido-player.esm.js`;
|
|
49
55
|
const fileExists = this.doesFileExistSync(scriptCheckUrl);
|
|
56
|
+
// --------------- CASE: NO codeFolderPath PROVIDED ---------------
|
|
57
|
+
// Try loading version from default /code_versions folder
|
|
58
|
+
// --------------- SINGLE CASE: codeFolderPath PROVIDED ---------------
|
|
50
59
|
if (fileExists) {
|
|
60
|
+
console.log("Using code from zip....");
|
|
51
61
|
// If it exists, inject them
|
|
52
62
|
const scriptEsm = document.createElement('script');
|
|
53
63
|
scriptEsm.type = 'module';
|
|
@@ -60,79 +70,117 @@ const LidoStandalone = class {
|
|
|
60
70
|
document.head.appendChild(scriptNoModule);
|
|
61
71
|
this.scriptsInjected = true;
|
|
62
72
|
console.debug('Lido scripts injected from:', this.baseUrl);
|
|
73
|
+
return;
|
|
63
74
|
}
|
|
64
|
-
|
|
75
|
+
if (this.codeFolderPath) {
|
|
65
76
|
const cleanBase = this.baseUrl.replace(/\/+$/, "");
|
|
66
|
-
const cfgUrl = `${cleanBase}/config.json`;
|
|
67
77
|
try {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// --- Version exists: try to load versioned folder ---
|
|
82
|
-
const codePath = this.codeFolderPath.replace(/\/+$/, "");
|
|
83
|
-
const versionFolder = `${codePath}/${version}`;
|
|
84
|
-
const esmUrl = `${versionFolder}/lido-player.esm.js`;
|
|
85
|
-
const noModuleUrl = `${versionFolder}/lido-player.js`;
|
|
86
|
-
// Check if versioned ESM exists
|
|
87
|
-
const headCheck = await fetch(esmUrl, { method: "HEAD" });
|
|
88
|
-
if (!headCheck.ok) {
|
|
89
|
-
console.warn(`Version folder found but lido-player.esm.js missing: ${esmUrl}`);
|
|
78
|
+
const lessonCfgUrl = `${cleanBase}/config.json`;
|
|
79
|
+
try {
|
|
80
|
+
// 1️⃣ Load lesson config.json safely
|
|
81
|
+
let lessonCfg = {};
|
|
82
|
+
let lessonVersion = null;
|
|
83
|
+
try {
|
|
84
|
+
const lessonResp = await fetch(lessonCfgUrl);
|
|
85
|
+
if (!lessonResp.ok)
|
|
86
|
+
throw new Error("Lesson config.json missing");
|
|
87
|
+
// Check for empty file (0 bytes)
|
|
88
|
+
const text = await lessonResp.text();
|
|
89
|
+
if (text.trim().length > 0) {
|
|
90
|
+
lessonCfg = JSON.parse(text);
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
92
|
-
|
|
93
|
-
const scriptEsm = document.createElement("script");
|
|
94
|
-
scriptEsm.type = "module";
|
|
95
|
-
scriptEsm.src = esmUrl;
|
|
96
|
-
document.head.appendChild(scriptEsm);
|
|
97
|
-
const scriptNoModule = document.createElement("script");
|
|
98
|
-
scriptNoModule.setAttribute("nomodule", "");
|
|
99
|
-
scriptNoModule.src = noModuleUrl;
|
|
100
|
-
document.head.appendChild(scriptNoModule);
|
|
101
|
-
this.scriptsInjected = true;
|
|
102
|
-
console.debug("Loaded version from config.json:", versionFolder);
|
|
103
|
-
return; // return when version successfully loaded
|
|
93
|
+
console.warn("Lesson config.json is EMPTY → falling back to latest version");
|
|
104
94
|
}
|
|
95
|
+
lessonVersion = lessonCfg.code_version;
|
|
96
|
+
console.log(`%c USING THE VERSION FOLDER--> ${lessonVersion} `, "color: #3bffe8ff; background:#d32f2f; font-size: 15px; font-weight: bold; padding: 6px 10px; border-radius: 4px;");
|
|
97
|
+
}
|
|
98
|
+
catch (parseErr) {
|
|
99
|
+
console.warn("Lesson config.json invalid or unreadable → fallback to latest version");
|
|
100
|
+
lessonVersion = null;
|
|
105
101
|
}
|
|
102
|
+
// Normalize invalid versions
|
|
103
|
+
if (!lessonVersion || typeof lessonVersion !== "string" || lessonVersion.trim() === "") {
|
|
104
|
+
console.warn("Lesson has NO valid codeVersion → using latest version in code-folder-path");
|
|
105
|
+
lessonVersion = null;
|
|
106
|
+
}
|
|
107
|
+
// 2️⃣ Load version list from code-folder-path/config.json
|
|
108
|
+
const codeCfgUrl = `${this.codeFolderPath.replace(/\/+$/, '')}/config.json`;
|
|
109
|
+
const codeResp = await fetch(codeCfgUrl);
|
|
110
|
+
if (!codeResp.ok)
|
|
111
|
+
throw new Error("Code-folder config.json missing");
|
|
112
|
+
const codeCfg = await codeResp.json();
|
|
113
|
+
const availableVersions = codeCfg.versions || [];
|
|
114
|
+
if (!availableVersions.length) {
|
|
115
|
+
throw new Error("No versions listed in code-folder config.json");
|
|
116
|
+
}
|
|
117
|
+
// 3️⃣ Compute selected version
|
|
118
|
+
let selectedVersion = null;
|
|
119
|
+
if (lessonVersion) {
|
|
120
|
+
selectedVersion = availableVersions.find(v => v.includes(lessonVersion));
|
|
121
|
+
}
|
|
122
|
+
// Fallback: use latest version
|
|
123
|
+
if (!selectedVersion) {
|
|
124
|
+
selectedVersion = availableVersions[availableVersions.length - 1];
|
|
125
|
+
console.log(`%c USING THE LATEST VERSION FOLDER-> ${selectedVersion} `, "color: #3bffe8ff; background:#d32f2f; font-size: 15px; font-weight: bold; padding: 6px 10px; border-radius: 4px;");
|
|
126
|
+
}
|
|
127
|
+
// 4️⃣ Inject scripts
|
|
128
|
+
const versionDir = `${this.codeFolderPath}/${selectedVersion}`;
|
|
129
|
+
const esmUrl = `${versionDir}/lido-player.esm.js`;
|
|
130
|
+
const noModuleUrl = `${versionDir}/lido-player.js`;
|
|
131
|
+
// Check if version folder exists
|
|
132
|
+
const headCheck = await fetch(esmUrl, { method: "HEAD" });
|
|
133
|
+
if (!headCheck.ok)
|
|
134
|
+
throw new Error(`Versioned script missing: ${esmUrl}`);
|
|
135
|
+
// Inject main module file
|
|
136
|
+
const scriptEsm = document.createElement("script");
|
|
137
|
+
scriptEsm.type = "module";
|
|
138
|
+
scriptEsm.src = esmUrl;
|
|
139
|
+
document.head.appendChild(scriptEsm);
|
|
140
|
+
// Inject fallback nomodule script
|
|
141
|
+
const scriptNoModule = document.createElement("script");
|
|
142
|
+
scriptNoModule.setAttribute("nomodule", "");
|
|
143
|
+
scriptNoModule.src = noModuleUrl;
|
|
144
|
+
document.head.appendChild(scriptNoModule);
|
|
145
|
+
this.scriptsInjected = true;
|
|
146
|
+
console.debug("Loaded Lido version from:", versionDir);
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
console.warn("Failed to load versioned scripts, falling back to npm:", err);
|
|
150
|
+
this.fallbackNpmImport();
|
|
106
151
|
}
|
|
107
152
|
}
|
|
108
|
-
catch (
|
|
109
|
-
console.
|
|
153
|
+
catch (err) {
|
|
154
|
+
console.warn("Failed loading scripts → fallback to npm:", err);
|
|
110
155
|
this.fallbackNpmImport();
|
|
111
156
|
}
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
// Otherwise, fallback to the npm package
|
|
116
|
-
console.warn(`Could not find remote scripts at "${scriptCheckUrl}". Falling back to npm package "lido-player"...`);
|
|
117
|
-
this.fallbackNpmImport();
|
|
157
|
+
return;
|
|
118
158
|
}
|
|
159
|
+
this.fallbackNpmImport();
|
|
119
160
|
}
|
|
120
161
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
162
|
+
* Checks if a file truly exists (not a dev-server fallback).
|
|
163
|
+
* Ensures:
|
|
164
|
+
* - HTTP HEAD returns 2xx
|
|
165
|
+
* - responseURL matches the requested URL
|
|
166
|
+
*/
|
|
124
167
|
doesFileExistSync(url) {
|
|
125
|
-
let exists = false;
|
|
126
168
|
try {
|
|
127
169
|
const xhr = new XMLHttpRequest();
|
|
128
|
-
xhr.open(
|
|
129
|
-
xhr.send(
|
|
130
|
-
|
|
170
|
+
xhr.open("HEAD", url, false); // synchronous
|
|
171
|
+
xhr.send();
|
|
172
|
+
const statusOk = xhr.status >= 200 && xhr.status < 300;
|
|
173
|
+
if (!statusOk)
|
|
174
|
+
return false;
|
|
175
|
+
// Detect fallback HTML responses (common when folder/file is missing)
|
|
176
|
+
const contentType = xhr.getResponseHeader("Content-Type") || "";
|
|
177
|
+
const isHtmlFallback = contentType.includes("text/html");
|
|
178
|
+
return !isHtmlFallback;
|
|
131
179
|
}
|
|
132
180
|
catch (err) {
|
|
133
|
-
console.warn(
|
|
181
|
+
console.warn("File existence check failed for:", url, err);
|
|
182
|
+
return false;
|
|
134
183
|
}
|
|
135
|
-
return exists;
|
|
136
184
|
}
|
|
137
185
|
/**
|
|
138
186
|
* Fallback approach: dynamically import the "lido-player/loader" module,
|
|
@@ -159,15 +207,13 @@ const LidoStandalone = class {
|
|
|
159
207
|
return;
|
|
160
208
|
}
|
|
161
209
|
// If xmlPath is not explicitly provided, default to `index.xml` in baseUrl
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
210
|
+
if (this.baseUrl) {
|
|
211
|
+
const cleanBase = this.baseUrl.replace(/\/+$/, '');
|
|
212
|
+
this.xmlPath = `${cleanBase}/index.xml`;
|
|
213
|
+
this.xmlBaseUrl = this.baseUrl;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
return;
|
|
171
217
|
}
|
|
172
218
|
try {
|
|
173
219
|
const xhr = new XMLHttpRequest();
|
|
@@ -195,11 +241,14 @@ const LidoStandalone = class {
|
|
|
195
241
|
*
|
|
196
242
|
* This ensures the custom elements are defined before usage.
|
|
197
243
|
*/
|
|
198
|
-
|
|
244
|
+
const lang = this.language || 'en';
|
|
245
|
+
return h("lido-home", { key: '52fd8d3879919dbba73d4c687f2d540f0e4e601f', "common-audio-path": this.commonAudioPath, "initial-index": this.initialIndex, canplay: this.canplay, height: this.height, lang: lang, "xml-data": this.localXmlData, "base-url": this.xmlBaseUrl, "code-folder-path": this.codeFolderPath, "zip-url": this.zipUrl });
|
|
199
246
|
}
|
|
247
|
+
get hostElement() { return getElement(this); }
|
|
200
248
|
static get watchers() { return {
|
|
201
249
|
"baseUrl": ["onBaseUrlChange"],
|
|
202
|
-
"xmlPath": ["onXmlPathChange"]
|
|
250
|
+
"xmlPath": ["onXmlPathChange"],
|
|
251
|
+
"xmlData": ["onXmlDataChange"]
|
|
203
252
|
}; }
|
|
204
253
|
};
|
|
205
254
|
LidoStandalone.style = LidoStandaloneStyle0;
|
|
@@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AK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACrC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEf,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;gBACzC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;aACtC;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,4BAA4B,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;aACvE;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,2BAA2B,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;SAC/D;KACF;IAED,MAAM;;;;;;;;;;;QAYJ,OAAO,uFAA+B,IAAI,CAAC,eAAe,mBAAiB,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,cAAY,IAAI,CAAC,YAAY,cAAY,IAAI,CAAC,UAAU,sBAAoB,IAAI,CAAC,cAAc,GAAc,CAAC;KACvP;;;;;;;;;;","names":[],"sources":["src/components/lido-standalone/lido-standalone.css?tag=lido-standalone","src/components/lido-standalone/lido-standalone.tsx"],"sourcesContent":["","import { Component, Prop, State, Watch, h } from '@stencil/core';\n\n/**\n * <lido-standalone> usage example:\n *\n * <lido-standalone\n * base-url=\"https://example.com/path/to/folder/lido-game\"\n * xml-path=\"https://example.com/path/to/folder/lido-game/assets/xmlData.xml\"\n * initial-index=\"2\"\n * canplay=\"true\"\n * height=\"75vh\"\n * ></lido-standalone>\n *\n * This attempts to load the external Lido scripts at runtime (from `baseUrl`).\n * If they aren't found, it falls back to loading the Lido npm package\n * and calls defineCustomElements(...) to register <lido-home>.\n */\n@Component({\n tag: 'lido-standalone',\n styleUrl: 'lido-standalone.css',\n shadow: false,\n})\nexport class LidoStandalone {\n /**\n * The public URL where the unzipped Lido code is hosted, e.g.\n * \"https://example.com/path/to/lido-game\".\n *\n * Inside that folder, we expect:\n * - code/lido-player.esm.js\n * - code/lido-player.js\n * - assets/ (optional)\n */\n @Prop() baseUrl: string = '';\n\n /**\n * If provided, we'll fetch this XML path once and pass the loaded string\n * to <lido-home>'s `xml-data` attribute.\n */\n @Prop() xmlPath?: string;\n\n /** The initial index to pass down to <lido-home>. Defaults to 0. */\n @Prop() initialIndex: number = 0;\n\n /** Whether the <lido-home> can play. Defaults to false. */\n @Prop() canplay: boolean = false;\n\n /** The height prop to pass to <lido-home>. Defaults to \"75vh\". */\n @Prop() height: string = '75vh';\n\n /**\n * Optional prop for directly providing XML data instead of fetching.\n */\n @Prop() xmlData?: string;\n\n /**\n * If provided(in index.html) → tries versioned script loading from config.json.\n * If no version is found → automatically falls back to default player loading.\n * If not provided → version management is skipped entirely and falls back to default player loading.\n */\n @Prop() codeFolderPath?: string;\n\n @Prop() commonAudioPath?: string;\n\n /** Whether scripts are already injected (remote or fallback). */\n @State() scriptsInjected: boolean = false;\n\n /** Stores the fetched or provided XML data. */\n @State() localXmlData?: string;\n\n /** This might be used by <lido-home> if referencing assets. */\n @State() xmlBaseUrl?: string;\n\n // Re-inject scripts if the baseUrl changes\n @Watch('baseUrl')\n onBaseUrlChange() {\n this.injectLidoScripts();\n }\n\n // Re-fetch XML if the xmlPath changes\n @Watch('xmlPath')\n onXmlPathChange() {\n this.fetchXmlData();\n }\n\n componentWillLoad() {\n // 1) Attempt to inject the Lido scripts from baseUrl\n this.injectLidoScripts();\n // 2) Fetch the XML (or use the xmlData if provided)\n this.fetchXmlData();\n }\n\n private async injectLidoScripts() {\n console.log('injectLidoScripts() called. baseUrl=', this.baseUrl);\n\n // If no baseUrl is provided OR we already injected scripts, just go to fallback\n if (!this.baseUrl) {\n console.warn('lido-standalone: No baseUrl provided. Using npm fallback...');\n this.fallbackNpmImport();\n return;\n }\n if (this.scriptsInjected) {\n return;\n }\n\n // Synchronously check if remote ESM script exists at baseUrl/code/lido-player.esm.js\n const cleanBase = this.baseUrl.replace(/\\/+$/, '');\n const scriptCheckUrl = `${cleanBase}/code/lido-player.esm.js`;\n const fileExists = this.doesFileExistSync(scriptCheckUrl);\n\n if (fileExists) {\n // If it exists, inject them\n const scriptEsm = document.createElement('script');\n scriptEsm.type = 'module';\n scriptEsm.src = scriptCheckUrl;\n document.head.appendChild(scriptEsm);\n\n // (Optional) NoModule script for older browsers\n const scriptNoModule = document.createElement('script');\n scriptNoModule.setAttribute('nomodule', '');\n scriptNoModule.src = `${cleanBase}/code/lido-player.js`;\n document.head.appendChild(scriptNoModule);\n\n this.scriptsInjected = true;\n console.debug('Lido scripts injected from:', this.baseUrl);\n }\n\n else if (this.codeFolderPath) {\n const cleanBase = this.baseUrl.replace(/\\/+$/, \"\");\n const cfgUrl = `${cleanBase}/config.json`;\n\n try {\n const res = await fetch(cfgUrl);\n\n if (!res.ok) {\n console.warn(\"config.json not found. Skipping versioning and continuing...\");\n throw new Error(\"config.json fetch failed\");\n } \n else {\n const cfg = await res.json();\n const version = cfg.codeVersion;\n\n if (!version) {\n console.warn(\"config.json missing codeVersion. Skipping versioning. Falling back to npm package lido-player...\");\n throw new Error(\"codeVersion missing in config.json\");\n } else {\n // --- Version exists: try to load versioned folder ---\n const codePath = this.codeFolderPath.replace(/\\/+$/, \"\");\n const versionFolder = `${codePath}/${version}`;\n\n const esmUrl = `${versionFolder}/lido-player.esm.js`;\n const noModuleUrl = `${versionFolder}/lido-player.js`;\n\n // Check if versioned ESM exists\n const headCheck = await fetch(esmUrl, { method: \"HEAD\" });\n\n if (!headCheck.ok) {\n console.warn(`Version folder found but lido-player.esm.js missing: ${esmUrl}`);\n } else {\n // --- Load versioned scripts (SUCCESS CASE) ---\n const scriptEsm = document.createElement(\"script\");\n scriptEsm.type = \"module\";\n scriptEsm.src = esmUrl;\n document.head.appendChild(scriptEsm);\n\n const scriptNoModule = document.createElement(\"script\");\n scriptNoModule.setAttribute(\"nomodule\", \"\");\n scriptNoModule.src = noModuleUrl;\n document.head.appendChild(scriptNoModule);\n\n this.scriptsInjected = true;\n console.debug(\"Loaded version from config.json:\", versionFolder);\n return; // return when version successfully loaded\n }\n }\n }\n } catch (e) {\n console.error(\"Failed to read config.json. Skipping versioning...\", e);\n this.fallbackNpmImport();\n }\n // If we reach this point, version loading FAILED → continue to final else\n }\n\n else {\n // Otherwise, fallback to the npm package\n console.warn(`Could not find remote scripts at \"${scriptCheckUrl}\". Falling back to npm package \"lido-player\"...`);\n this.fallbackNpmImport();\n }\n }\n\n /**\n * Synchronously checks if a file exists via HTTP HEAD request.\n * Returns true if status is 2xx, false otherwise.\n */\n private doesFileExistSync(url: string): boolean {\n let exists = false;\n try {\n const xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false); // false = synchronous\n xhr.send(null);\n exists = xhr.status >= 200 && xhr.status < 300;\n } catch (err) {\n console.warn('Synchronous HEAD request failed for:', url, err);\n }\n return exists;\n }\n\n /**\n * Fallback approach: dynamically import the \"lido-player/loader\" module,\n * then call defineCustomElements(window) to register the <lido-home> component.\n * This is asynchronous by nature.\n */\n private fallbackNpmImport() {\n import('lido-player/loader')\n .then(({ defineCustomElements }) => {\n // Register custom elements on 'window'\n defineCustomElements(window);\n // Mark scripts as loaded so we can proceed\n this.scriptsInjected = true;\n console.debug('Lido scripts loaded via npm fallback (defineCustomElements).');\n })\n .catch(err => {\n console.error('Failed to load from npm package \"lido-player\":', err);\n });\n }\n\n private fetchXmlData() {\n // If the user provided raw XML data, just store it\n if (this.xmlData) {\n this.localXmlData = this.xmlData;\n return;\n }\n\n // If xmlPath is not explicitly provided, default to `index.xml` in baseUrl\n if (!this.xmlPath) {\n if (this.baseUrl) {\n const cleanBase = this.baseUrl.replace(/\\/+$/, '');\n this.xmlPath = `${cleanBase}/index.xml`;\n this.xmlBaseUrl = this.baseUrl;\n } else {\n return;\n }\n }\n\n try {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', this.xmlPath, false); // false = synchronous\n xhr.send(null);\n\n if (xhr.status >= 200 && xhr.status < 300) {\n this.localXmlData = xhr.responseText;\n } else {\n console.warn(`Failed to fetch XML from ${this.xmlPath}:`, xhr.status);\n }\n } catch (err) {\n console.warn(`Error fetching XML from ${this.xmlPath}:`, err);\n }\n }\n\n render() {\n /**\n * If you want to hide <lido-home> until the fallback is fully loaded,\n * you could do something like:\n *\n * if (!this.scriptsInjected) {\n * return <div>Loading Lido...</div>;\n * }\n *\n * This ensures the custom elements are defined before usage.\n */\n\n return <lido-home common-audio-path={this.commonAudioPath} initial-index={this.initialIndex} canplay={this.canplay} height={this.height} xml-data={this.localXmlData} base-url={this.xmlBaseUrl} code-folder-path={this.codeFolderPath}></lido-home>;\n }\n\n \n}\n\n\n"],"version":3}
|
|
1
|
+
{"file":"lido-standalone.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,6BAAe,iBAAiB;;MCqBnB,cAAc;;;uBAYC,EAAE;;4BASG,CAAC;uBAGL,KAAK;sBAGP,MAAM;;;;;;+BAyBK,KAAK;;;;;IAUzC,eAAe;QACb,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;;IAID,eAAe;QACb,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;;IAID,eAAe;QACb,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;IAED,iBAAiB;;QAEf,IAAI,CAAC,iBAAiB,EAAE,CAAC;;QAEzB,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;IAEO,MAAM,iBAAiB;QAC7B,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;;QAGlE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;YAC5E,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACzB,OAAO;SACR;QACD,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB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AI,CAAC,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;SAC/D;KACF;IAED,MAAM;;;;;;;;;;;QAYJ,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC;QACnC,OAAO,uFAA+B,IAAI,CAAC,eAAe,mBAAiB,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,cAAY,IAAI,CAAC,YAAY,cAAY,IAAI,CAAC,UAAU,sBAAoB,IAAI,CAAC,cAAc,aAAW,IAAI,CAAC,MAAM,GAAc,CAAC;KACzR;;;;;;;;;;;;","names":[],"sources":["src/components/lido-standalone/lido-standalone.css?tag=lido-standalone","src/components/lido-standalone/lido-standalone.tsx"],"sourcesContent":["","import { Component, Element, Prop, State, Watch, h } from '@stencil/core';\n\n/**\n * <lido-standalone> usage example:\n *\n * <lido-standalone\n * base-url=\"https://example.com/path/to/folder/lido-game\"\n * xml-path=\"https://example.com/path/to/folder/lido-game/assets/xmlData.xml\"\n * initial-index=\"2\"\n * canplay=\"true\"\n * height=\"75vh\"\n * ></lido-standalone>\n *\n * This attempts to load the external Lido scripts at runtime (from `baseUrl`).\n * If they aren't found, it falls back to loading the Lido npm package\n * and calls defineCustomElements(...) to register <lido-home>.\n */\n@Component({\n tag: 'lido-standalone',\n styleUrl: 'lido-standalone.css',\n shadow: false,\n})\nexport class LidoStandalone {\n @Element() hostElement!: HTMLElement;\n\n /**\n * The public URL where the unzipped Lido code is hosted, e.g.\n * \"https://example.com/path/to/lido-game\".\n *\n * Inside that folder, we expect:\n * - code/lido-player.esm.js\n * - code/lido-player.js\n * - assets/ (optional)\n */\n @Prop() baseUrl: string = '';\n\n /**\n * If provided, we'll fetch this XML path once and pass the loaded string\n * to <lido-home>'s `xml-data` attribute.\n */\n @Prop() xmlPath?: string;\n\n /** The initial index to pass down to <lido-home>. Defaults to 0. */\n @Prop() initialIndex: number = 0;\n\n /** Whether the <lido-home> can play. Defaults to false. */\n @Prop() canplay: boolean = false;\n\n /** The height prop to pass to <lido-home>. Defaults to \"75vh\". */\n @Prop() height: string = '75vh';\n\n /** The language prop to pass to <lido-home>. */\n @Prop() language?: string;\n\n /**\n * Optional prop for directly providing XML data instead of fetching.\n */\n @Prop() xmlData?: string;\n\n /**\n * To pass zip file directly to <lido-home> as its attribute.\n */\n @Prop() zipUrl?: string;\n\n /**\n * If provided(in index.html) → tries versioned script loading from config.json.\n * If no version is found → automatically falls back to default player loading.\n * If not provided → version management is skipped entirely and falls back to default player loading.\n */\n @Prop() codeFolderPath?: string;\n\n @Prop() commonAudioPath?: string;\n\n /** Whether scripts are already injected (remote or fallback). */\n @State() scriptsInjected: boolean = false;\n\n /** Stores the fetched or provided XML data. */\n @State() localXmlData?: string;\n\n /** This might be used by <lido-home> if referencing assets. */\n @State() xmlBaseUrl?: string;\n\n // Re-inject scripts if the baseUrl changes\n @Watch('baseUrl')\n onBaseUrlChange() {\n this.injectLidoScripts();\n }\n\n // Re-fetch XML if the xmlPath changes\n @Watch('xmlPath')\n onXmlPathChange() {\n this.fetchXmlData();\n }\n\n // Re-apply inline XML whenever the host prop changes.\n @Watch('xmlData')\n onXmlDataChange() {\n this.fetchXmlData();\n }\n\n componentWillLoad() {\n // 1) Attempt to inject the Lido scripts from baseUrl\n this.injectLidoScripts();\n // 2) Fetch the XML (or use the xmlData if provided)\n this.fetchXmlData();\n }\n\n private async injectLidoScripts() {\n console.log('injectLidoScripts() called. baseUrl=', this.baseUrl);\n\n // If no baseUrl is provided OR we already injected scripts, just go to fallback\n if (!this.baseUrl) {\n console.warn('lido-standalone: No baseUrl provided. Using npm fallback...');\n this.fallbackNpmImport();\n return;\n }\n if (this.scriptsInjected) {\n return;\n }\n\n // Synchronously check if remote ESM script exists at baseUrl/code/lido-player.esm.js\n const cleanBase = this.baseUrl.replace(/\\/+$/, '');\n const scriptCheckUrl = `${cleanBase}/code/lido-player.esm.js`;\n const fileExists = this.doesFileExistSync(scriptCheckUrl);\n\n // --------------- CASE: NO codeFolderPath PROVIDED ---------------\n // Try loading version from default /code_versions folder\n // --------------- SINGLE CASE: codeFolderPath PROVIDED ---------------\n\n if (fileExists) {\n console.log(\"Using code from zip....\")\n // If it exists, inject them\n const scriptEsm = document.createElement('script');\n scriptEsm.type = 'module';\n scriptEsm.src = scriptCheckUrl;\n document.head.appendChild(scriptEsm);\n // (Optional) NoModule script for older browsers\n const scriptNoModule = document.createElement('script');\n scriptNoModule.setAttribute('nomodule', '');\n scriptNoModule.src = `${cleanBase}/code/lido-player.js`;\n document.head.appendChild(scriptNoModule);\n this.scriptsInjected = true;\n console.debug('Lido scripts injected from:', this.baseUrl);\n return;\n }\n \n if (this.codeFolderPath) {\n const cleanBase = this.baseUrl.replace(/\\/+$/, \"\");\n try {\n const lessonCfgUrl = `${cleanBase}/config.json`;\n try {\n // 1️⃣ Load lesson config.json safely\n let lessonCfg: any = {};\n let lessonVersion: string | null = null;\n\n try {\n const lessonResp = await fetch(lessonCfgUrl);\n if (!lessonResp.ok) throw new Error(\"Lesson config.json missing\");\n\n // Check for empty file (0 bytes)\n const text = await lessonResp.text();\n if (text.trim().length > 0) {\n lessonCfg = JSON.parse(text);\n } else {\n console.warn(\"Lesson config.json is EMPTY → falling back to latest version\");\n }\n\n lessonVersion = lessonCfg.code_version;\n console.log(`%c USING THE VERSION FOLDER--> ${lessonVersion} `,\"color: #3bffe8ff; background:#d32f2f; font-size: 15px; font-weight: bold; padding: 6px 10px; border-radius: 4px;\");\n\n } catch (parseErr) {\n console.warn(\"Lesson config.json invalid or unreadable → fallback to latest version\");\n lessonVersion = null;\n }\n\n // Normalize invalid versions\n if (!lessonVersion || typeof lessonVersion !== \"string\" || lessonVersion.trim() === \"\") {\n console.warn(\"Lesson has NO valid codeVersion → using latest version in code-folder-path\");\n lessonVersion = null;\n }\n\n // 2️⃣ Load version list from code-folder-path/config.json\n const codeCfgUrl = `${this.codeFolderPath.replace(/\\/+$/, '')}/config.json`;\n const codeResp = await fetch(codeCfgUrl);\n if (!codeResp.ok) throw new Error(\"Code-folder config.json missing\");\n\n const codeCfg = await codeResp.json();\n const availableVersions: string[] = codeCfg.versions || [];\n\n if (!availableVersions.length) {\n throw new Error(\"No versions listed in code-folder config.json\");\n }\n\n // 3️⃣ Compute selected version\n let selectedVersion: string | undefined = null;\n\n if (lessonVersion) {\n selectedVersion = availableVersions.find(v => v.includes(lessonVersion));\n }\n\n // Fallback: use latest version\n if (!selectedVersion) {\n selectedVersion = availableVersions[availableVersions.length - 1];\n console.log(`%c USING THE LATEST VERSION FOLDER-> ${selectedVersion} `,\"color: #3bffe8ff; background:#d32f2f; font-size: 15px; font-weight: bold; padding: 6px 10px; border-radius: 4px;\");\n }\n\n // 4️⃣ Inject scripts\n const versionDir = `${this.codeFolderPath}/${selectedVersion}`;\n const esmUrl = `${versionDir}/lido-player.esm.js`;\n const noModuleUrl = `${versionDir}/lido-player.js`;\n\n // Check if version folder exists\n const headCheck = await fetch(esmUrl, { method: \"HEAD\" });\n if (!headCheck.ok) throw new Error(`Versioned script missing: ${esmUrl}`);\n\n // Inject main module file\n const scriptEsm = document.createElement(\"script\");\n scriptEsm.type = \"module\";\n scriptEsm.src = esmUrl;\n document.head.appendChild(scriptEsm);\n\n // Inject fallback nomodule script\n const scriptNoModule = document.createElement(\"script\");\n scriptNoModule.setAttribute(\"nomodule\", \"\");\n scriptNoModule.src = noModuleUrl;\n document.head.appendChild(scriptNoModule);\n\n this.scriptsInjected = true;\n console.debug(\"Loaded Lido version from:\", versionDir);\n\n }catch (err) {\n console.warn(\"Failed to load versioned scripts, falling back to npm:\", err);\n this.fallbackNpmImport();\n } \n } catch (err) {\n console.warn(\"Failed loading scripts → fallback to npm:\", err);\n this.fallbackNpmImport();\n }\n return;\n }\n this.fallbackNpmImport();\n }\n\n /**\n * Checks if a file truly exists (not a dev-server fallback).\n * Ensures:\n * - HTTP HEAD returns 2xx\n * - responseURL matches the requested URL\n */\nprivate doesFileExistSync(url: string): boolean {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", url, false); // synchronous\n xhr.send();\n\n const statusOk = xhr.status >= 200 && xhr.status < 300;\n\n if (!statusOk) return false;\n\n // Detect fallback HTML responses (common when folder/file is missing)\n const contentType = xhr.getResponseHeader(\"Content-Type\") || \"\";\n\n const isHtmlFallback = contentType.includes(\"text/html\");\n\n return !isHtmlFallback;\n } catch (err) {\n console.warn(\"File existence check failed for:\", url, err);\n return false;\n }\n}\n\n\n /**\n * Fallback approach: dynamically import the \"lido-player/loader\" module,\n * then call defineCustomElements(window) to register the <lido-home> component.\n * This is asynchronous by nature.\n */\n private fallbackNpmImport() {\n import('lido-player/loader')\n .then(({ defineCustomElements }) => {\n // Register custom elements on 'window'\n defineCustomElements(window);\n // Mark scripts as loaded so we can proceed\n this.scriptsInjected = true;\n console.debug('Lido scripts loaded via npm fallback (defineCustomElements).');\n })\n .catch(err => {\n console.error('Failed to load from npm package \"lido-player\":', err);\n });\n }\n\n private fetchXmlData() {\n // If the user provided raw XML data, just store it\n if (this.xmlData) {\n this.localXmlData = this.xmlData;\n return;\n }\n\n // If xmlPath is not explicitly provided, default to `index.xml` in baseUrl\n if (this.baseUrl) {\n const cleanBase = this.baseUrl.replace(/\\/+$/, '');\n this.xmlPath = `${cleanBase}/index.xml`;\n this.xmlBaseUrl = this.baseUrl;\n } else {\n return;\n }\n\n try {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', this.xmlPath, false); // false = synchronous\n xhr.send(null);\n\n if (xhr.status >= 200 && xhr.status < 300) {\n this.localXmlData = xhr.responseText;\n } else {\n console.warn(`Failed to fetch XML from ${this.xmlPath}:`, xhr.status);\n }\n } catch (err) {\n console.warn(`Error fetching XML from ${this.xmlPath}:`, err);\n }\n }\n\n render() {\n /**\n * If you want to hide <lido-home> until the fallback is fully loaded,\n * you could do something like:\n *\n * if (!this.scriptsInjected) {\n * return <div>Loading Lido...</div>;\n * }\n *\n * This ensures the custom elements are defined before usage.\n */\n\n const lang = this.language || 'en';\n return <lido-home common-audio-path={this.commonAudioPath} initial-index={this.initialIndex} canplay={this.canplay} height={this.height} lang={lang} xml-data={this.localXmlData} base-url={this.xmlBaseUrl} code-folder-path={this.codeFolderPath} zip-url={this.zipUrl}></lido-home>;\n }\n\n \n}\n\n\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-32cd7d72.js';
|
|
2
|
+
export { s as setNonce } from './index-32cd7d72.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -16,7 +16,7 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["lido-standalone",[[0,"lido-standalone",{"baseUrl":[1,"base-url"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"canplay":[4],"height":[1],"xmlData":[1,"xml-data"],"codeFolderPath":[1,"code-folder-path"],"commonAudioPath":[1,"common-audio-path"],"scriptsInjected":[32],"localXmlData":[32],"xmlBaseUrl":[32]},null,{"baseUrl":["onBaseUrlChange"],"xmlPath":["onXmlPathChange"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["lido-standalone",[[0,"lido-standalone",{"baseUrl":[1,"base-url"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"canplay":[4],"height":[1],"language":[1],"xmlData":[1,"xml-data"],"zipUrl":[1,"zip-url"],"codeFolderPath":[1,"code-folder-path"],"commonAudioPath":[1,"common-audio-path"],"scriptsInjected":[32],"localXmlData":[32],"xmlBaseUrl":[32]},null,{"baseUrl":["onBaseUrlChange"],"xmlPath":["onXmlPathChange"],"xmlData":["onXmlDataChange"]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
//# sourceMappingURL=lido-standalone.js.map
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-32cd7d72.js';
|
|
2
|
+
export { s as setNonce } from './index-32cd7d72.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["lido-standalone",[[0,"lido-standalone",{"baseUrl":[1,"base-url"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"canplay":[4],"height":[1],"xmlData":[1,"xml-data"],"codeFolderPath":[1,"code-folder-path"],"commonAudioPath":[1,"common-audio-path"],"scriptsInjected":[32],"localXmlData":[32],"xmlBaseUrl":[32]},null,{"baseUrl":["onBaseUrlChange"],"xmlPath":["onXmlPathChange"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["lido-standalone",[[0,"lido-standalone",{"baseUrl":[1,"base-url"],"xmlPath":[1,"xml-path"],"initialIndex":[2,"initial-index"],"canplay":[4],"height":[1],"language":[1],"xmlData":[1,"xml-data"],"zipUrl":[1,"zip-url"],"codeFolderPath":[1,"code-folder-path"],"commonAudioPath":[1,"common-audio-path"],"scriptsInjected":[32],"localXmlData":[32],"xmlBaseUrl":[32]},null,{"baseUrl":["onBaseUrlChange"],"xmlPath":["onXmlPathChange"],"xmlData":["onXmlDataChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as t,f as e}from"./p-
|
|
1
|
+
import{g as t,f as e}from"./p-1469ddb8.js";const n=(t,e,n)=>{const o=t.get(e);if(!o){t.set(e,[n])}else if(!o.includes(n)){o.push(n)}};const o=(t,e)=>{let n;return(...o)=>{if(n){clearTimeout(n)}n=setTimeout((()=>{n=0;t(...o)}),e)}};const s=t=>!("isConnected"in t)||t.isConnected;const r=o((t=>{for(let e of t.keys()){t.set(e,t.get(e).filter(s))}}),2e3);const c=()=>{if(typeof t!=="function"){return{}}const o=new Map;return{dispose:()=>o.clear(),get:e=>{const s=t();if(s){n(o,e,s)}},set:t=>{const n=o.get(t);if(n){o.set(t,n.filter(e))}r(o)},reset:()=>{o.forEach((t=>t.forEach(e)));r(o)}}};const u=(t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));const o={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));o.reset.forEach((t=>t()))};const r=()=>{o.dispose.forEach((t=>t()));s()};const c=t=>{o.get.forEach((e=>e(t)));return n.get(t)};const u=(t,s)=>{const r=n.get(t);if(e(s,r,t)){n.set(t,s);o.set.forEach((e=>e(t,s,r)))}};const f=typeof Proxy==="undefined"?{}:new Proxy(t,{get(t,e){return c(e)},ownKeys(t){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,e){return n.has(e)},set(t,e,n){u(e,n);return true}});const l=(t,e)=>{o[t].push(e);return()=>{i(o[t],e)}};const a=(e,n)=>{const o=l("set",((t,o)=>{if(t===e){n(o)}}));const s=l("reset",(()=>n(t[e])));return()=>{o();s()}};const p=(...t)=>{const e=t.reduce(((t,e)=>{if(e.set){t.push(l("set",e.set))}if(e.get){t.push(l("get",e.get))}if(e.reset){t.push(l("reset",e.reset))}if(e.dispose){t.push(l("dispose",e.dispose))}return t}),[]);return()=>e.forEach((t=>t()))};const d=t=>{const e=n.get(t);o.set.forEach((n=>n(t,e,e)))};return{state:f,get:c,set:u,on:l,onChange:a,use:p,dispose:r,reset:s,forceUpdate:d}};const i=(t,e)=>{const n=t.indexOf(e);if(n>=0){t[n]=t[t.length-1];t.length--}};const f=(t,e)=>{const n=u(t,e);n.use(c());return n};const l=t=>{var e;const n=window;const o=new URL(n.location.href);const s=(e=t===null||t===void 0?void 0:t.parseURL)!==null&&e!==void 0?e:p;const{state:r,onChange:c,dispose:u}=f({url:o,activePath:s(o)},((t,e,n)=>{if(n==="url"){return t.href!==e.href}return t!==e}));const i=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);r.url=e;r.activePath=s(e)};const l=t=>{const{activePath:e}=r;for(let n of t){const o=a(e,n.path);if(o){if(n.to!=null){const o=typeof n.to==="string"?n.to:n.to(e);i(o);return l(t)}else{return{params:o,route:n}}}}return undefined};const d=()=>{const t=new URL(n.location.href);r.url=t;r.activePath=s(t)};const g=(t,e)=>{const n=l(e);if(n){if(typeof n.route.jsx==="function"){return n.route.jsx(n.params)}else{return n.route.jsx}}};const w=()=>{n.removeEventListener("popstate",d);u()};const y={Switch:g,get url(){return r.url},get activePath(){return r.activePath},push:i,onChange:c,dispose:w};d();n.addEventListener("popstate",d);return y};const a=(t,e)=>{if(typeof e==="string"){if(e===t){return{}}}else if(typeof e==="function"){const n=e(t);if(n){return n===true?{}:{...n}}}else{const n=e.exec(t);if(n){e.lastIndex=0;return{...n}}}return undefined};const p=t=>t.pathname.toLowerCase();const d=l();export{d as Router};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as a,b as t}from"./p-
|
|
1
|
+
import{p as a,b as t}from"./p-1469ddb8.js";export{s as setNonce}from"./p-1469ddb8.js";import{g as l}from"./p-e1255160.js";var e=()=>{const t=import.meta.url;const l={};if(t!==""){l.resourcesUrl=new URL(".",t).href}return a(l)};e().then((async a=>{await l();return t([["p-862a6695",[[0,"lido-standalone",{baseUrl:[1,"base-url"],xmlPath:[1,"xml-path"],initialIndex:[2,"initial-index"],canplay:[4],height:[1],language:[1],xmlData:[1,"xml-data"],zipUrl:[1,"zip-url"],codeFolderPath:[1,"code-folder-path"],commonAudioPath:[1,"common-audio-path"],scriptsInjected:[32],localXmlData:[32],xmlBaseUrl:[32]},null,{baseUrl:["onBaseUrlChange"],xmlPath:["onXmlPathChange"],xmlData:["onXmlDataChange"]}]]]],a)}));
|
|
2
2
|
//# sourceMappingURL=lido-standalone.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","baseUrl","xmlPath","initialIndex","canplay","height","xmlData","codeFolderPath","commonAudioPath","scriptsInjected","localXmlData","xmlBaseUrl"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,qCAAqC,CAACC,QAAC,eAAAC,QAAA,eAAAC,aAAA,oBAAAC,QAAA,IAAAC,OAAA,IAAAC,QAAA,eAAAC,eAAA,uBAAAC,gBAAA,wBAAAC,gBAAA,KAAAC,aAAA,KAAAC,WAAA,
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","baseUrl","xmlPath","initialIndex","canplay","height","language","xmlData","zipUrl","codeFolderPath","commonAudioPath","scriptsInjected","localXmlData","xmlBaseUrl"],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EClB7BH,IAAeQ,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAc,qCAAqC,CAACC,QAAC,eAAAC,QAAA,eAAAC,aAAA,oBAAAC,QAAA,IAAAC,OAAA,IAAAC,SAAA,IAAAC,QAAA,eAAAC,OAAA,cAAAC,eAAA,uBAAAC,gBAAA,wBAAAC,gBAAA,KAAAC,aAAA,KAAAC,WAAA,YAAAZ,QAAA,oBAAAC,QAAA,oBAAAK,QAAA,yBAAAT,EAAA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const e="lido-standalone";const t={allRenderFn:true,appendChildSlotFix:false,asyncLoading:true,asyncQueue:false,attachStyles:true,cloneNodeFix:false,cmpDidLoad:false,cmpDidRender:false,cmpDidUnload:false,cmpDidUpdate:false,cmpShouldUpdate:false,cmpWillLoad:true,cmpWillRender:false,cmpWillUpdate:false,connectedCallback:false,constructableCSS:true,cssAnnotations:true,devTools:false,disconnectedCallback:false,element:false,event:false,experimentalScopedSlotChanges:false,experimentalSlotFixes:false,formAssociated:false,hasRenderFn:true,hostListener:false,hostListenerTarget:false,hostListenerTargetBody:false,hostListenerTargetDocument:false,hostListenerTargetParent:false,hostListenerTargetWindow:false,hotModuleReplacement:false,hydrateClientSide:false,hydrateServerSide:false,hydratedAttribute:false,hydratedClass:true,hydratedSelectorName:"hydrated",initializeNextTick:false,invisiblePrehydration:true,isDebug:false,isDev:false,isTesting:false,lazyLoad:true,lifecycle:true,lifecycleDOMEvents:false,member:true,method:false,mode:false,observeAttribute:true,profile:false,prop:true,propBoolean:true,propMutable:false,propNumber:true,propString:true,reflect:false,scoped:false,scopedSlotTextContentFix:false,scriptDataOpts:false,shadowDelegatesFocus:false,shadowDom:false,slot:false,slotChildNodesFix:false,slotRelocation:false,state:true,style:true,svg:false,taskQueue:true,transformTagName:false,updatable:true,vdomAttribute:true,vdomClass:false,vdomFunctional:false,vdomKey:true,vdomListener:false,vdomPropOrAttr:true,vdomRef:false,vdomRender:true,vdomStyle:false,vdomText:false,vdomXlink:false,watchCallback:true};var n=Object.defineProperty;var l=(e,t)=>{for(var l in t)n(e,l,{get:t[l],enumerable:true})};var s=new WeakMap;var r=e=>s.get(e);var a=(e,t)=>s.set(t.t=e,t);var o=(e,t)=>{const n={l:0,$hostElement$:e,o:t,i:new Map};{n.u=new Promise((e=>n.v=e));e["s-p"]=[];e["s-rc"]=[]}return s.set(e,n)};var i=(e,t)=>t in e;var f=(e,t)=>(0,console.error)(e,t);var c=new Map;var u=(e,t,n)=>{const l=e.h.replace(/-/g,"_");const s=e.p;if(!s){return void 0}const r=c.get(s);if(r){return r[l]}
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${s}.entry.js${""}`).then((e=>{{c.set(s,e)}return e[l]}),f)};var v=new Map;var d="{visibility:hidden}.hydrated{visibility:inherit}";var h="slot-fb{display:contents}slot-fb[hidden]{display:none}";var p=typeof window!=="undefined"?window:{};var m=p.document||{head:{}};var y={l:0,m:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)};var b=t.shadowDom;var w=e=>Promise.resolve(e);var S=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false})();var $=false;var g=[];var C=[];var k=(e,t)=>n=>{e.push(n);if(!$){$=true;if(t&&y.l&4){T(O)}else{y.raf(O)}}};var x=e=>{for(let t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){f(e)}}e.length=0};var O=()=>{x(g);{x(C);if($=g.length>0){y.raf(O)}}};var T=e=>w().then(e);var j=k(C,true);var D={};var L=e=>e!=null;var E=e=>{e=typeof e;return e==="object"||e==="function"};function F(e){var t,n,l;return(l=(n=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:n.getAttribute("content"))!=null?l:void 0}var M={};l(M,{err:()=>R,map:()=>P,ok:()=>A,unwrap:()=>N,unwrapErr:()=>U});var A=e=>({isOk:true,isErr:false,value:e});var R=e=>({isOk:false,isErr:true,value:e});function P(e,t){if(e.isOk){const n=t(e.value);if(n instanceof Promise){return n.then((e=>A(e)))}else{return A(n)}}if(e.isErr){const t=e.value;return R(t)}throw"should never get here"}var N=e=>{if(e.isOk){return e.value}else{throw e.value}};var U=e=>{if(e.isErr){return e.value}else{throw e.value}};var W=(e,t="")=>{{return()=>{}}};var H=(e,t)=>{{return()=>{}}};var z=(e,t,...n)=>{let l=null;let s=null;let r=false;let a=false;const o=[];const i=t=>{for(let n=0;n<t.length;n++){l=t[n];if(Array.isArray(l)){i(l)}else if(l!=null&&typeof l!=="boolean"){if(r=typeof e!=="function"&&!E(l)){l=String(l)}if(r&&a){o[o.length-1].S+=l}else{o.push(r?B(null,l):l)}a=r}}};i(n);if(t){if(t.key){s=t.key}}const f=B(e,null);f.$=t;if(o.length>0){f.C=o}{f.k=s}return f};var B=(e,t)=>{const n={l:0,O:e,S:t,T:null,C:null};{n.$=null}{n.k=null}return n};var Q={};var q=e=>e&&e.O===Q;var G=(e,t)=>{if(e!=null&&!E(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&2){return parseFloat(e)}if(t&1){return String(e)}return e}return e};var I=e=>r(e).$hostElement$;var K=(e,t,n)=>{const l=y.ce(t,n);e.dispatchEvent(l);return l};var V=new WeakMap;var X=(e,t,n)=>{let l=v.get(e);if(S&&n){l=l||new CSSStyleSheet;if(typeof l==="string"){l=t}else{l.replaceSync(t)}}else{l=t}v.set(e,l)};var _=(e,t,n)=>{var l;const s=Y(t);const r=v.get(s);e=e.nodeType===11?e:m;if(r){if(typeof r==="string"){e=e.head||e;let n=V.get(e);let a;if(!n){V.set(e,n=new Set)}if(!n.has(s)){{a=m.createElement("style");a.innerHTML=r;const n=(l=y.j)!=null?l:F(m);if(n!=null){a.setAttribute("nonce",n)}if(!(t.l&1)){if(e.nodeName==="HEAD"){const t=e.querySelectorAll("link[rel=preconnect]");const n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(a,n)}else if("host"in e){if(S){const t=new CSSStyleSheet;t.replaceSync(r);e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");if(t){t.innerHTML=r+t.innerHTML}else{e.prepend(a)}}}else{e.append(a)}}if(t.l&1&&e.nodeName!=="HEAD"){e.insertBefore(a,null)}}if(t.l&4){a.innerHTML+=h}if(n){n.add(s)}}}else if(!e.adoptedStyleSheets.includes(r)){e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}}return s};var J=e=>{const t=e.o;const n=e.$hostElement$;const l=W("attachStyles",t.h);_(n.getRootNode(),t);l()};var Y=(e,t)=>"sc-"+e.h;var Z=(e,t,n,l,s,r)=>{if(n!==l){let a=i(e,t);t.toLowerCase();if(t==="key");else{const o=E(l);if((a||o&&l!==null)&&!s){try{if(!e.tagName.includes("-")){const s=l==null?"":l;if(t==="list"){a=false}else if(n==null||e[t]!=s){if(typeof e.__lookupSetter__(t)==="function"){e[t]=s}else{e.setAttribute(t,s)}}}else{e[t]=l}}catch(e){}}if(l==null||l===false){if(l!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!a||r&4||s)&&!o){l=l===true?"":l;{e.setAttribute(t,l)}}}}};var ee=(e,t,n)=>{const l=t.T.nodeType===11&&t.T.host?t.T.host:t.T;const s=e&&e.$||D;const r=t.$||D;{for(const e of te(Object.keys(s))){if(!(e in r)){Z(l,e,s[e],void 0,n,t.l)}}}for(const e of te(Object.keys(r))){Z(l,e,s[e],r[e],n,t.l)}};function te(e){return e.includes("ref")?[...e.filter((e=>e!=="ref")),"ref"]:e}var ne;var le;var se=false;var re=false;var ae=(e,n,l,s)=>{const r=n.C[l];let a=0;let o;let i;{o=r.T=m.createElement(!se&&t.slotRelocation&&r.l&2?"slot-fb":r.O);{ee(null,r,re)}const n=o.getRootNode();const l=!n.querySelector("body");if(!l&&t.scoped&&L(ne)&&o["s-si"]!==ne){o.classList.add(o["s-si"]=ne)}if(r.C){for(a=0;a<r.C.length;++a){i=ae(e,r,a);if(i){o.appendChild(i)}}}}o["s-hn"]=le;return o};var oe=(e,t,n,l,s,r)=>{let a=e;let o;for(;s<=r;++s){if(l[s]){o=ae(null,n,s);if(o){l[s].T=o;ve(a,o,t)}}}};var ie=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.T;if(e){e.remove()}}}};var fe=(e,t,n,l,s=false)=>{let r=0;let a=0;let o=0;let i=0;let f=t.length-1;let c=t[0];let u=t[f];let v=l.length-1;let d=l[0];let h=l[v];let p;let m;while(r<=f&&a<=v){if(c==null){c=t[++r]}else if(u==null){u=t[--f]}else if(d==null){d=l[++a]}else if(h==null){h=l[--v]}else if(ce(c,d,s)){ue(c,d,s);c=t[++r];d=l[++a]}else if(ce(u,h,s)){ue(u,h,s);u=t[--f];h=l[--v]}else if(ce(c,h,s)){ue(c,h,s);ve(e,c.T,u.T.nextSibling);c=t[++r];h=l[--v]}else if(ce(u,d,s)){ue(u,d,s);ve(e,u.T,c.T);u=t[--f];d=l[++a]}else{o=-1;{for(i=r;i<=f;++i){if(t[i]&&t[i].k!==null&&t[i].k===d.k){o=i;break}}}if(o>=0){m=t[o];if(m.O!==d.O){p=ae(t&&t[a],n,o)}else{ue(m,d,s);t[o]=void 0;p=m.T}d=l[++a]}else{p=ae(t&&t[a],n,a);d=l[++a]}if(p){{ve(c.T.parentNode,p,c.T)}}}}if(r>f){oe(e,l[v+1]==null?null:l[v+1].T,n,l,a,v)}else if(a>v){ie(t,r,f)}};var ce=(e,t,n=false)=>{if(e.O===t.O){if(!n){return e.k===t.k}return true}return false};var ue=(e,n,l=false)=>{const s=n.T=e.T;const r=e.C;const a=n.C;{{{ee(e,n,re)}}if(r!==null&&a!==null){fe(s,r,n,a,l)}else if(a!==null){oe(s,null,n,a,0,a.length-1)}else if(!l&&t.updatable&&r!==null){ie(r,0,r.length-1)}}};var ve=(e,t,n)=>{const l=e==null?void 0:e.insertBefore(t,n);return l};var de=(e,t,n=false)=>{const l=e.$hostElement$;const s=e.D||B(null,null);const r=q(t)?t:z(null,null,t);le=l.tagName;if(n&&r.$){for(const e of Object.keys(r.$)){if(l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)){r.$[e]=l[e]}}}r.O=null;r.l|=4;e.D=r;r.T=s.T=l;se=b;ue(s,r,n)};var he=(e,t)=>{if(t&&!e.L&&t["s-p"]){t["s-p"].push(new Promise((t=>e.L=t)))}};var pe=(e,t)=>{{e.l|=16}if(e.l&4){e.l|=512;return}he(e,e.F);const n=()=>me(e,t);return j(n)};var me=(e,t)=>{const n=e.$hostElement$;const l=W("scheduleUpdate",e.o.h);const s=e.t;if(!s){throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let r;if(t){{r=Oe(s,"componentWillLoad")}}l();return ye(r,(()=>we(e,s,t)))};var ye=(e,t)=>be(e)?e.then(t).catch((e=>{console.error(e);t()})):t();var be=e=>e instanceof Promise||e&&e.then&&typeof e.then==="function";var we=async(e,t,n)=>{var l;const s=e.$hostElement$;const r=W("update",e.o.h);const a=s["s-rc"];if(n){J(e)}const o=W("render",e.o.h);{$e(e,t,s,n)}if(a){a.map((e=>e()));s["s-rc"]=void 0}o();r();{const t=(l=s["s-p"])!=null?l:[];const n=()=>Ce(e);if(t.length===0){n()}else{Promise.all(t).then(n);e.l|=4;t.length=0}}};var Se=null;var $e=(e,t,n,l)=>{try{Se=t;t=t.render();{e.l&=~16}{e.l|=2}{{{de(e,t,l)}}}}catch(t){f(t,e.$hostElement$)}Se=null;return null};var ge=()=>Se;var Ce=e=>{const t=e.o.h;const n=e.$hostElement$;const l=W("postUpdate",t);const s=e.F;if(!(e.l&64)){e.l|=64;{Te(n)}l();{e.v(n);if(!s){xe()}}}else{l()}{if(e.L){e.L();e.L=void 0}if(e.l&512){T((()=>pe(e,false)))}e.l&=~(4|512)}};var ke=e=>{{const t=r(e);const n=t.$hostElement$.isConnected;if(n&&(t.l&(2|16))===2){pe(t,false)}return n}};var xe=t=>{{Te(m.documentElement)}T((()=>K(p,"appload",{detail:{namespace:e}})))};var Oe=(e,t,n)=>{if(e&&e[t]){try{return e[t](n)}catch(e){f(e)}}return void 0};var Te=e=>{var n;return e.classList.add((n=t.hydratedSelectorName)!=null?n:"hydrated")};var je=(e,t)=>r(e).i.get(t);var De=(e,t,n,l)=>{const s=r(e);if(!s){throw new Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`)}const a=s.$hostElement$;const o=s.i.get(t);const i=s.l;const c=s.t;n=G(n,l.M[t][0]);const u=Number.isNaN(o)&&Number.isNaN(n);const v=n!==o&&!u;if((!(i&8)||o===void 0)&&v){s.i.set(t,n);if(c){if(l.A&&i&128){const e=l.A[t];if(e){e.map((e=>{try{c[e](n,o,t)}catch(e){f(e,a)}}))}}if((i&(2|16))===2){pe(s,false)}}}};var Le=(e,t,n)=>{var l,s;const a=e.prototype;if(t.M||(t.A||e.watchers)){if(e.watchers&&!t.A){t.A=e.watchers}const o=Object.entries((l=t.M)!=null?l:{});o.map((([e,[l]])=>{if(l&31||n&2&&l&32){Object.defineProperty(a,e,{get(){return je(this,e)},set(n){De(this,e,n,t)},configurable:true,enumerable:true})}}));if(n&1){const n=new Map;a.attributeChangedCallback=function(e,l,s){y.jmp((()=>{var o;const i=n.get(e);if(this.hasOwnProperty(i)){s=this[i];delete this[i]}else if(a.hasOwnProperty(i)&&typeof this[i]==="number"&&this[i]==s){return}else if(i==null){const n=r(this);const a=n==null?void 0:n.l;if(a&&!(a&8)&&a&128&&s!==l){const r=n.t;const a=(o=t.A)==null?void 0:o[e];a==null?void 0:a.forEach((t=>{if(r[t]!=null){r[t].call(r,s,l,e)}}))}return}this[i]=s===null&&typeof this[i]==="boolean"?false:s}))};e.observedAttributes=Array.from(new Set([...Object.keys((s=t.A)!=null?s:{}),...o.filter((([e,t])=>t[0]&15)).map((([e,t])=>{const l=t[1]||e;n.set(l,e);return l}))]))}}return e};var Ee=async(e,t,n,l)=>{let s;if((t.l&32)===0){t.l|=32;const l=n.p;if(l){const e=u(n);if(e&&"then"in e){const t=H();s=await e;t()}else{s=e}if(!s){throw new Error(`Constructor for "${n.h}#${t.R}" was not found`)}if(!s.isProxied){{n.A=s.watchers}Le(s,n,2);s.isProxied=true}const l=W("createInstance",n.h);{t.l|=8}try{new s(t)}catch(e){f(e)}{t.l&=~8}{t.l|=128}l()}else{s=e.constructor;const n=e.localName;customElements.whenDefined(n).then((()=>t.l|=128))}if(s&&s.style){let e;if(typeof s.style==="string"){e=s.style}const t=Y(n);if(!v.has(t)){const l=W("registerStyles",n.h);X(t,e,!!(n.l&1));l()}}}const r=t.F;const a=()=>pe(t,true);if(r&&r["s-rc"]){r["s-rc"].push(a)}else{a()}};var Fe=e=>{};var Me=e=>{if((y.l&1)===0){const t=r(e);const n=t.o;const l=W("connectedCallback",n.h);if(!(t.l&1)){t.l|=1;{let n=e;while(n=n.parentNode||n.host){if(n["s-p"]){he(t,t.F=n);break}}}if(n.M){Object.entries(n.M).map((([t,[n]])=>{if(n&31&&e.hasOwnProperty(t)){const n=e[t];delete e[t];e[t]=n}}))}{Ee(e,t,n)}}else{if(t==null?void 0:t.t);else if(t==null?void 0:t.u){t.u.then((()=>Fe()))}}l()}};var Ae=e=>{};var Re=async e=>{if((y.l&1)===0){const t=r(e);if(t==null?void 0:t.t);else if(t==null?void 0:t.u){t.u.then((()=>Ae()))}}};var Pe=(e,t={})=>{var n;const l=W();const s=[];const a=t.exclude||[];const i=p.customElements;const f=m.head;const c=f.querySelector("meta[charset]");const u=m.createElement("style");const v=[];let b;let w=true;Object.assign(y,t);y.m=new URL(t.resourcesUrl||"./",m.baseURI).href;let S=false;e.map((e=>{e[1].map((t=>{var n;const l={l:t[0],h:t[1],M:t[2],P:t[3]};if(l.l&4){S=true}{l.M=t[2]}{l.A=(n=t[4])!=null?n:{}}const f=l.h;const c=class extends HTMLElement{constructor(e){super(e);this.hasRegisteredEventListeners=false;e=this;o(e,l)}connectedCallback(){r(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true}if(b){clearTimeout(b);b=null}if(w){v.push(this)}else{y.jmp((()=>Me(this)))}}disconnectedCallback(){y.jmp((()=>Re(this)))}componentOnReady(){return r(this).u}};l.p=e[0];if(!a.includes(f)&&!i.get(f)){s.push(f);i.define(f,Le(c,l,1))}}))}));if(s.length>0){if(S){u.textContent+=h}{u.textContent+=s.sort()+d}if(u.innerHTML.length){u.setAttribute("data-styles","");const e=(n=y.j)!=null?n:F(m);if(e!=null){u.setAttribute("nonce",e)}f.insertBefore(u,c?c.nextSibling:f.firstChild)}}w=false;if(v.length){v.map((e=>e.connectedCallback()))}else{{y.jmp((()=>b=setTimeout(xe,30)))}}l()};var Ne=e=>y.j=e;export{I as a,Pe as b,ke as f,ge as g,z as h,w as p,a as r,Ne as s};
|
|
3
|
+
//# sourceMappingURL=p-1469ddb8.js.map
|