marko 6.3.14 → 6.3.16
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/common/errors.d.ts +2 -0
- package/dist/debug/dom.js +12 -0
- package/dist/debug/dom.mjs +12 -0
- package/dist/debug/html.js +179 -161
- package/dist/debug/html.mjs +179 -161
- package/dist/html/writer.d.ts +36 -36
- package/dist/html.js +122 -118
- package/dist/html.mjs +122 -118
- package/dist/translator/core/class.d.ts +3 -0
- package/dist/translator/core/index.d.ts +1 -0
- package/dist/translator/index.d.ts +1 -0
- package/dist/translator/index.js +160 -151
- package/dist/translator/util/references.d.ts +1 -1
- package/dist/translator/util/signals.d.ts +0 -1
- package/package.json +1 -1
package/dist/html.js
CHANGED
|
@@ -238,24 +238,26 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
238
238
|
[JSON, "JSON"],
|
|
239
239
|
[Math, "Math"],
|
|
240
240
|
[Reflect, "Reflect"]
|
|
241
|
-
]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, unsafeQuoteReg = /["\\<\n\r\u2028\u2029\0\ud800-\udfff]/u, $chunk,
|
|
241
|
+
]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, unsafeQuoteReg = /["\\<\n\r\u2028\u2029\0\ud800-\udfff]/u, $chunk, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
|
|
242
242
|
let { state } = $chunk.boundary, target = $chunk.serializeState, scope = scopeWithId(state, scopeId), pending = target.writeScopes[scopeId];
|
|
243
243
|
return state.needsMainRuntime = !0, Object.assign(scope, partialScope), pending && pending !== partialScope ? Object.assign(pending, partialScope) : target.writeScopes[scopeId] = partialScope, target.flushScopes = !0, scope;
|
|
244
|
-
}, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=[#a-zA-Z])/g, doubleQuoteAttrReplacements = /"|&(?=[#a-zA-Z])/g, needsQuotedAttr = /["'>\s]|&[#a-zA-Z]|\/$/g, voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
244
|
+
}, NOOP$2 = () => {}, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=[#a-zA-Z])/g, doubleQuoteAttrReplacements = /"|&(?=[#a-zA-Z])/g, needsQuotedAttr = /["'>\s]|&[#a-zA-Z]|\/$/g, voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
245
245
|
let shouldResume = serializeReason !== 0, renderer = normalizeDynamicRenderer(tag), state = getState(), branchId = _peek_scope_id(), rendered, result;
|
|
246
246
|
if (typeof renderer == "string") {
|
|
247
247
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (
|
|
253
|
-
|
|
248
|
+
rendered = !0, (() => {
|
|
249
|
+
if (_scope_id(), _html(`<${renderer}${_attrs(input, "a", branchId, renderer)}>`), !voidElementsReg.test(renderer)) {
|
|
250
|
+
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
251
|
+
if (renderer === "textarea") _html(_attr_textarea_value(branchId, "a", input.value, input.valueChange, 1));
|
|
252
|
+
else if (renderContent) {
|
|
253
|
+
if (typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
254
|
+
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent, 1) : _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
255
|
+
}
|
|
256
|
+
_html(`</${renderer}>`);
|
|
254
257
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
needsScript && (writeScope(branchId, { R: renderer }), _script(branchId, "d")), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
258
|
+
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
259
|
+
needsScript && (writeScope(branchId, { R: renderer }), _script(branchId, "d")), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
260
|
+
})();
|
|
259
261
|
} else {
|
|
260
262
|
shouldResume && _html(state.mark("[", ""));
|
|
261
263
|
let render = () => {
|
|
@@ -277,7 +279,7 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
277
279
|
let patched = patch(tag, scopeId, accessor);
|
|
278
280
|
return patched !== tag && (patched.a = tag), originalDynamicTag(scopeId, accessor, patched, input, content, inputIsArgs, resume);
|
|
279
281
|
};
|
|
280
|
-
})(_dynamic_tag), _template = (templateId, renderer, page) => (renderer.render = render, renderer.i = !page, renderer._ = renderer, _content_resume(templateId, renderer)), kAssets = Symbol(), kBlockIndex = Symbol(), kDeferIndex = Symbol(), assetFlush, SET_SCOPE_REGISTER_ID = "$C_s", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
|
|
282
|
+
})(_dynamic_tag), CONSUMED_RESULT_MESSAGE = "Cannot read from a consumed render result", _template = (templateId, renderer, page) => (renderer.render = render, renderer.i = !page, renderer._ = renderer, _content_resume(templateId, renderer)), kAssets = Symbol(), kBlockIndex = Symbol(), kDeferIndex = Symbol(), assetFlush, SET_SCOPE_REGISTER_ID = "$C_s", K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap(), compat = {
|
|
281
283
|
$global,
|
|
282
284
|
fork: _await,
|
|
283
285
|
write: _html,
|
|
@@ -1123,35 +1125,21 @@ function getState() {
|
|
|
1123
1125
|
function getScopeId(scope) {
|
|
1124
1126
|
return scope[K_SCOPE_ID];
|
|
1125
1127
|
}
|
|
1126
|
-
function
|
|
1127
|
-
$chunk.
|
|
1128
|
-
}
|
|
1129
|
-
function writeScript(script) {
|
|
1130
|
-
$chunk.writeScript(script);
|
|
1128
|
+
function getScopeById(scopeId) {
|
|
1129
|
+
if (scopeId !== void 0) return $chunk.boundary.state.scopes.get(scopeId);
|
|
1131
1130
|
}
|
|
1132
|
-
function
|
|
1133
|
-
|
|
1134
|
-
readyId,
|
|
1135
|
-
parent: chunk.serializeState,
|
|
1136
|
-
resumes: "",
|
|
1137
|
-
writeScopes: {},
|
|
1138
|
-
flushScopes: !1
|
|
1139
|
-
}), bodyEnd = body.render(renderer, input);
|
|
1140
|
-
body === bodyEnd ? (chunk.writeHTML(body.html), body.deferOwnReady(), chunk.deferredReady = push(chunk.deferredReady, body)) : (bodyEnd.next = $chunk = chunk.fork(boundary, chunk.next), chunk.next = body);
|
|
1131
|
+
function $global() {
|
|
1132
|
+
return $chunk.boundary.state.$global;
|
|
1141
1133
|
}
|
|
1142
|
-
function
|
|
1143
|
-
|
|
1134
|
+
function _id() {
|
|
1135
|
+
let state = $chunk.boundary.state, { $global } = state;
|
|
1136
|
+
return "s" + $global.runtimeId + $global.renderId + (state.tagId++).toString(36);
|
|
1144
1137
|
}
|
|
1145
|
-
function
|
|
1146
|
-
|
|
1147
|
-
render && (shouldResume ? withBranchId(branchId, render) : render()), _peek_scope_id() === branchId ? _scope_id() : shouldResume && writeScope(scopeId, {
|
|
1148
|
-
["A" + nodeAccessor]: writeScope(branchId, {}),
|
|
1149
|
-
["D" + nodeAccessor]: render?.a
|
|
1150
|
-
});
|
|
1138
|
+
function _scope_id() {
|
|
1139
|
+
return $chunk.boundary.state.scopeId++;
|
|
1151
1140
|
}
|
|
1152
|
-
function
|
|
1153
|
-
|
|
1154
|
-
if (renderer && typeof renderer == "function") return renderer;
|
|
1141
|
+
function _peek_scope_id() {
|
|
1142
|
+
return $chunk.boundary.state.scopeId;
|
|
1155
1143
|
}
|
|
1156
1144
|
function withContext(key, value, cb, cbValue) {
|
|
1157
1145
|
let ctx = $chunk.context ||= { [kPendingContexts]: 0 }, prev = ctx[key];
|
|
@@ -1162,43 +1150,36 @@ function withContext(key, value, cb, cbValue) {
|
|
|
1162
1150
|
ctx[kPendingContexts]--, ctx[key] = prev;
|
|
1163
1151
|
}
|
|
1164
1152
|
}
|
|
1165
|
-
function
|
|
1166
|
-
|
|
1167
|
-
let childScope = writeScopePassive(childScopeId, { T: _resume({}, registryId, parentScopeId) });
|
|
1168
|
-
nodeAccessor !== void 0 && writeScope(parentScopeId, { ["A" + nodeAccessor]: childScope });
|
|
1169
|
-
}
|
|
1170
|
-
function writeScopePassive(scopeId, partialScope) {
|
|
1171
|
-
let target = $chunk.serializeState, scope = _scope_with_id(scopeId), passive = target.passiveScopes ||= {};
|
|
1172
|
-
return Object.assign(scope, partialScope), passive[scopeId] = Object.assign(passive[scopeId] || {}, partialScope), scope;
|
|
1153
|
+
function isInResumedBranch() {
|
|
1154
|
+
return $chunk?.context?.[kBranchId] !== void 0;
|
|
1173
1155
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return
|
|
1156
|
+
function withBranchId(branchId, cb) {
|
|
1157
|
+
return withContext(kBranchId, branchId, cb);
|
|
1176
1158
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1179
|
-
return "s" + $global.runtimeId + $global.renderId + (state.tagId++).toString(36);
|
|
1159
|
+
function withIsAsync(cb, value) {
|
|
1160
|
+
return withContext(kIsAsync, !0, cb, value);
|
|
1180
1161
|
}
|
|
1181
|
-
function
|
|
1182
|
-
|
|
1162
|
+
function _html(html) {
|
|
1163
|
+
$chunk.writeHTML(html);
|
|
1183
1164
|
}
|
|
1184
|
-
function
|
|
1185
|
-
|
|
1165
|
+
function writeScript(script) {
|
|
1166
|
+
$chunk.writeScript(script);
|
|
1186
1167
|
}
|
|
1187
|
-
function
|
|
1188
|
-
|
|
1168
|
+
function _script(scopeId, registryId) {
|
|
1169
|
+
($chunk.serializeState.readyId || $chunk.context?.[kIsAsync]) && _resume_branch(scopeId), $chunk.boundary.state.needsMainRuntime = !0, $chunk.writeEffect(scopeId, registryId);
|
|
1189
1170
|
}
|
|
1190
|
-
function
|
|
1191
|
-
$chunk.boundary.state.
|
|
1171
|
+
function _trailers(html) {
|
|
1172
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1192
1173
|
}
|
|
1193
|
-
function
|
|
1194
|
-
|
|
1195
|
-
return $chunk.boundary.state.serializeReason = void 0, reason;
|
|
1174
|
+
function _resume(val, id, scopeId) {
|
|
1175
|
+
return register(id, val, scopeId === void 0 ? void 0 : _scope_with_id(scopeId));
|
|
1196
1176
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return
|
|
1177
|
+
function _el(scopeId, id) {
|
|
1178
|
+
return _resume(() => void 0, id, scopeId);
|
|
1199
1179
|
}
|
|
1200
|
-
function
|
|
1201
|
-
|
|
1180
|
+
function _hoist(scopeId, id) {
|
|
1181
|
+
let getter = () => void 0;
|
|
1182
|
+
return getter[Symbol.iterator] = _hoist_read_error, _resume(getter, id, scopeId);
|
|
1202
1183
|
}
|
|
1203
1184
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1204
1185
|
if (shouldResume === 0) return "";
|
|
@@ -1208,25 +1189,36 @@ function _el_resume(scopeId, accessor, shouldResume) {
|
|
|
1208
1189
|
function _sep(shouldResume) {
|
|
1209
1190
|
return shouldResume === 0 ? "" : "<!>";
|
|
1210
1191
|
}
|
|
1211
|
-
function _el(scopeId, id) {
|
|
1212
|
-
return _resume(() => void 0, id, scopeId);
|
|
1213
|
-
}
|
|
1214
|
-
function _hoist(scopeId, id) {
|
|
1215
|
-
let getter = () => void 0;
|
|
1216
|
-
return getter[Symbol.iterator] = _hoist_read_error, _resume(getter, id, scopeId);
|
|
1217
|
-
}
|
|
1218
1192
|
function _resume_branch(scopeId) {
|
|
1219
1193
|
let branchId = $chunk.context?.[kBranchId];
|
|
1220
1194
|
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, { G: branchId });
|
|
1221
1195
|
}
|
|
1222
|
-
function
|
|
1223
|
-
|
|
1196
|
+
function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
|
|
1197
|
+
let shouldResume = serializeReason !== 0, render = normalizeServerRender(content), branchId = _peek_scope_id();
|
|
1198
|
+
render && (shouldResume ? withBranchId(branchId, render) : render()), _peek_scope_id() === branchId ? _scope_id() : shouldResume && writeScope(scopeId, {
|
|
1199
|
+
["A" + nodeAccessor]: writeScope(branchId, {}),
|
|
1200
|
+
["D" + nodeAccessor]: render?.a
|
|
1201
|
+
});
|
|
1224
1202
|
}
|
|
1225
|
-
function
|
|
1226
|
-
|
|
1203
|
+
function normalizeServerRender(value) {
|
|
1204
|
+
let renderer = normalizeDynamicRenderer(value);
|
|
1205
|
+
if (renderer && typeof renderer == "function") return renderer;
|
|
1227
1206
|
}
|
|
1228
|
-
function
|
|
1229
|
-
|
|
1207
|
+
function _var(parentScopeId, scopeOffsetAccessor, childScopeId, registryId, nodeAccessor) {
|
|
1208
|
+
writeScopePassive(parentScopeId, { [scopeOffsetAccessor]: _scope_id() });
|
|
1209
|
+
let childScope = writeScopePassive(childScopeId, { T: _resume({}, registryId, parentScopeId) });
|
|
1210
|
+
nodeAccessor !== void 0 && writeScope(parentScopeId, { ["A" + nodeAccessor]: childScope });
|
|
1211
|
+
}
|
|
1212
|
+
function writeScopePassive(scopeId, partialScope) {
|
|
1213
|
+
let target = $chunk.serializeState, scope = _scope_with_id(scopeId), passive = target.passiveScopes ||= {};
|
|
1214
|
+
return Object.assign(scope, partialScope), passive[scopeId] = Object.assign(passive[scopeId] || {}, partialScope), scope;
|
|
1215
|
+
}
|
|
1216
|
+
function _show_start(display, mark) {
|
|
1217
|
+
display ? mark && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
|
|
1218
|
+
}
|
|
1219
|
+
function _show_end(scopeId, accessor, display, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1220
|
+
let branchId = _scope_id(), wrap = !display;
|
|
1221
|
+
wrap && $chunk.writeHTML("</t>"), writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, parentEndTag, wrap || singleNode ? 1 : void 0, " " + branchId);
|
|
1230
1222
|
}
|
|
1231
1223
|
function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1232
1224
|
forBranches(by, (each) => each ? forOf(list, (item, index) => {
|
|
@@ -1289,13 +1281,6 @@ function writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, p
|
|
|
1289
1281
|
} else $chunk.writeHTML(endTag + _el_resume(scopeId, accessor));
|
|
1290
1282
|
else $chunk.writeHTML(endTag);
|
|
1291
1283
|
}
|
|
1292
|
-
function _show_start(display, mark) {
|
|
1293
|
-
display ? mark && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
|
|
1294
|
-
}
|
|
1295
|
-
function _show_end(scopeId, accessor, display, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1296
|
-
let branchId = _scope_id(), wrap = !display;
|
|
1297
|
-
wrap && $chunk.writeHTML("</t>"), writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, parentEndTag, wrap || singleNode ? 1 : void 0, " " + branchId);
|
|
1298
|
-
}
|
|
1299
1284
|
function _existing_scope(scopeId) {
|
|
1300
1285
|
return writeScope(scopeId, {});
|
|
1301
1286
|
}
|
|
@@ -1306,8 +1291,35 @@ function scopeWithId(state, scopeId) {
|
|
|
1306
1291
|
let { scopes } = state, scope = scopes.get(scopeId);
|
|
1307
1292
|
return scope || scopes.set(scopeId, scope = { [K_SCOPE_ID]: scopeId }), scope;
|
|
1308
1293
|
}
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1294
|
+
function _subscribe(subscribers, scope) {
|
|
1295
|
+
if (subscribers) {
|
|
1296
|
+
let { serializer } = $chunk.boundary.state;
|
|
1297
|
+
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1298
|
+
}
|
|
1299
|
+
return scope;
|
|
1300
|
+
}
|
|
1301
|
+
function _set_serialize_reason(reason) {
|
|
1302
|
+
$chunk.boundary.state.serializeReason = reason;
|
|
1303
|
+
}
|
|
1304
|
+
function _scope_reason() {
|
|
1305
|
+
let reason = $chunk.boundary.state.serializeReason;
|
|
1306
|
+
return $chunk.boundary.state.serializeReason = void 0, reason;
|
|
1307
|
+
}
|
|
1308
|
+
function _serialize_if(condition, key) {
|
|
1309
|
+
return condition && (condition === 1 || (typeof condition == "number" ? condition >>> key + 1 & 1 : condition[key])) ? 1 : void 0;
|
|
1310
|
+
}
|
|
1311
|
+
function _serialize_guard(condition, key) {
|
|
1312
|
+
return _serialize_if(condition, key) || 0;
|
|
1313
|
+
}
|
|
1314
|
+
function writeWaitReady(readyId, renderer, input) {
|
|
1315
|
+
let chunk = $chunk, { boundary } = chunk, body = new Chunk(boundary, null, chunk.context, {
|
|
1316
|
+
readyId,
|
|
1317
|
+
parent: chunk.serializeState,
|
|
1318
|
+
resumes: "",
|
|
1319
|
+
writeScopes: {},
|
|
1320
|
+
flushScopes: !1
|
|
1321
|
+
}), bodyEnd = body.render(renderer, input);
|
|
1322
|
+
body === bodyEnd ? (chunk.writeHTML(body.html), body.deferOwnReady(), chunk.deferredReady = push(chunk.deferredReady, body)) : (bodyEnd.next = $chunk = chunk.fork(boundary, chunk.next), chunk.next = body);
|
|
1311
1323
|
}
|
|
1312
1324
|
function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
1313
1325
|
let resumeMarker = serializeMarker !== 0;
|
|
@@ -1634,8 +1646,20 @@ function depsMarker(deps) {
|
|
|
1634
1646
|
}
|
|
1635
1647
|
return marker;
|
|
1636
1648
|
}
|
|
1637
|
-
function
|
|
1638
|
-
|
|
1649
|
+
function getFilteredGlobals($global) {
|
|
1650
|
+
if (!$global) return 0;
|
|
1651
|
+
let serializedGlobals = $global.serializedGlobals;
|
|
1652
|
+
if (!serializedGlobals) return 0;
|
|
1653
|
+
let filtered = 0;
|
|
1654
|
+
if (Array.isArray(serializedGlobals)) for (let key of serializedGlobals) {
|
|
1655
|
+
let value = $global[key];
|
|
1656
|
+
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1657
|
+
}
|
|
1658
|
+
else for (let key in serializedGlobals) if (serializedGlobals[key]) {
|
|
1659
|
+
let value = $global[key];
|
|
1660
|
+
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1661
|
+
}
|
|
1662
|
+
return filtered;
|
|
1639
1663
|
}
|
|
1640
1664
|
function concatEffects(a, b) {
|
|
1641
1665
|
return a ? b ? a + " " + b : a : b;
|
|
@@ -1657,28 +1681,6 @@ function flushTickQueue() {
|
|
|
1657
1681
|
tickQueue = void 0;
|
|
1658
1682
|
for (let cb of queue) cb(!0);
|
|
1659
1683
|
}
|
|
1660
|
-
function getFilteredGlobals($global) {
|
|
1661
|
-
if (!$global) return 0;
|
|
1662
|
-
let serializedGlobals = $global.serializedGlobals;
|
|
1663
|
-
if (!serializedGlobals) return 0;
|
|
1664
|
-
let filtered = 0;
|
|
1665
|
-
if (Array.isArray(serializedGlobals)) for (let key of serializedGlobals) {
|
|
1666
|
-
let value = $global[key];
|
|
1667
|
-
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1668
|
-
}
|
|
1669
|
-
else for (let key in serializedGlobals) if (serializedGlobals[key]) {
|
|
1670
|
-
let value = $global[key];
|
|
1671
|
-
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1672
|
-
}
|
|
1673
|
-
return filtered;
|
|
1674
|
-
}
|
|
1675
|
-
function _subscribe(subscribers, scope) {
|
|
1676
|
-
if (subscribers) {
|
|
1677
|
-
let { serializer } = $chunk.boundary.state;
|
|
1678
|
-
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1679
|
-
}
|
|
1680
|
-
return scope;
|
|
1681
|
-
}
|
|
1682
1684
|
//#endregion
|
|
1683
1685
|
//#region src/html/attrs.ts
|
|
1684
1686
|
function _attr_class(value) {
|
|
@@ -1828,7 +1830,7 @@ function normalizedValueMatches(a, b) {
|
|
|
1828
1830
|
return !1;
|
|
1829
1831
|
}
|
|
1830
1832
|
function normalizeStrAttrValue(value) {
|
|
1831
|
-
return value && value !== !0
|
|
1833
|
+
return isNotVoid(value) && value !== !0 ? value + "" : "";
|
|
1832
1834
|
}
|
|
1833
1835
|
//#endregion
|
|
1834
1836
|
//#region src/html/dynamic-tag.ts
|
|
@@ -1952,16 +1954,18 @@ var ServerRendered = class {
|
|
|
1952
1954
|
#promise() {
|
|
1953
1955
|
return this.#cachedPromise ||= new Promise((resolve, reject) => {
|
|
1954
1956
|
let head = this.#head;
|
|
1955
|
-
if (this.#head = null, !head) return reject(/* @__PURE__ */ Error(
|
|
1957
|
+
if (this.#head = null, !head) return reject(/* @__PURE__ */ Error(CONSUMED_RESULT_MESSAGE));
|
|
1956
1958
|
let { boundary } = head;
|
|
1957
1959
|
(boundary.onNext = () => {
|
|
1958
1960
|
switch (!boundary.count && boundary.flush()) {
|
|
1959
1961
|
case 2:
|
|
1960
1962
|
boundary.onNext = NOOP$1, reject(boundary.signal.reason);
|
|
1961
1963
|
break;
|
|
1962
|
-
case 0:
|
|
1963
|
-
|
|
1964
|
+
case 0: {
|
|
1965
|
+
let consumed = head.consume();
|
|
1966
|
+
boundary.signal.aborted || resolve(consumed.flushHTML());
|
|
1964
1967
|
break;
|
|
1968
|
+
}
|
|
1965
1969
|
}
|
|
1966
1970
|
})();
|
|
1967
1971
|
});
|
|
@@ -1969,7 +1973,7 @@ var ServerRendered = class {
|
|
|
1969
1973
|
#read(onWrite, onAbort, onClose) {
|
|
1970
1974
|
let tick = !0, head = this.#head;
|
|
1971
1975
|
if (this.#head = null, !head) {
|
|
1972
|
-
onAbort(/* @__PURE__ */ Error(
|
|
1976
|
+
onAbort(/* @__PURE__ */ Error(CONSUMED_RESULT_MESSAGE));
|
|
1973
1977
|
return;
|
|
1974
1978
|
}
|
|
1975
1979
|
let { boundary } = head, onNext = boundary.onNext = (write) => {
|
|
@@ -1985,7 +1989,7 @@ var ServerRendered = class {
|
|
|
1985
1989
|
}
|
|
1986
1990
|
toString() {
|
|
1987
1991
|
let head = this.#head;
|
|
1988
|
-
if (this.#head = null, !head) throw Error(
|
|
1992
|
+
if (this.#head = null, !head) throw Error(CONSUMED_RESULT_MESSAGE);
|
|
1989
1993
|
let { boundary } = head;
|
|
1990
1994
|
switch (boundary.flush()) {
|
|
1991
1995
|
case 2: throw boundary.signal.reason;
|