@pie-element/venn-classification 0.1.1-next.4 → 0.1.1-next.5
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/author/index.js +1159 -915
- package/dist/author/index.js.map +1 -1
- package/dist/browser/{VennClassification-BT81NwZz.js → VennClassification-DCPzzIcj.js} +1291 -1251
- package/dist/browser/VennClassification-DCPzzIcj.js.map +1 -0
- package/dist/browser/author/index.js +5002 -4917
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +8 -7
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/index.d.ts +6 -0
- package/dist/delivery/index.js +934 -849
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +6 -6
- package/dist/index.js +934 -849
- package/dist/index.js.map +1 -1
- package/package.json +1 -15
- package/dist/browser/VennClassification-BT81NwZz.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/disclose-version.js
|
|
2
2
|
if (typeof window !== "undefined") {
|
|
3
3
|
var _window$__svelte, _window;
|
|
4
4
|
((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
7
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/constants.js
|
|
8
8
|
var HYDRATION_ERROR = {};
|
|
9
9
|
var UNINITIALIZED = Symbol("uninitialized");
|
|
10
10
|
var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
|
|
11
11
|
var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
13
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/utils.js
|
|
14
14
|
var is_array = Array.isArray;
|
|
15
15
|
var index_of = Array.prototype.indexOf;
|
|
16
16
|
var includes = Array.prototype.includes;
|
|
@@ -132,6 +132,8 @@ var REACTION_IS_UPDATING = 1 << 21;
|
|
|
132
132
|
var ASYNC = 1 << 22;
|
|
133
133
|
var ERROR_VALUE = 1 << 23;
|
|
134
134
|
var STATE_SYMBOL = Symbol("$state");
|
|
135
|
+
/** Marks component export objects, so that `proxy(...)` leaves them untouched */
|
|
136
|
+
var COMPONENT_SYMBOL = Symbol("component");
|
|
135
137
|
var LEGACY_PROPS = Symbol("legacy props");
|
|
136
138
|
var LOADING_ATTR_SYMBOL = Symbol("");
|
|
137
139
|
var ATTRIBUTES_CACHE = Symbol("attributes");
|
|
@@ -149,106 +151,6 @@ var STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
149
151
|
}();
|
|
150
152
|
var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
151
153
|
/**
|
|
152
|
-
* `%name%(...)` can only be used during component initialisation
|
|
153
|
-
* @param {string} name
|
|
154
|
-
* @returns {never}
|
|
155
|
-
*/
|
|
156
|
-
function lifecycle_outside_component(name) {
|
|
157
|
-
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
158
|
-
}
|
|
159
|
-
//#endregion
|
|
160
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/errors.js
|
|
161
|
-
/**
|
|
162
|
-
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
163
|
-
* @returns {never}
|
|
164
|
-
*/
|
|
165
|
-
function async_derived_orphan() {
|
|
166
|
-
throw new Error(`https://svelte.dev/e/async_derived_orphan`);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Keyed each block has duplicate key `%value%` at indexes %a% and %b%
|
|
170
|
-
* @param {string} a
|
|
171
|
-
* @param {string} b
|
|
172
|
-
* @param {string | undefined | null} [value]
|
|
173
|
-
* @returns {never}
|
|
174
|
-
*/
|
|
175
|
-
function each_key_duplicate(a, b, value) {
|
|
176
|
-
throw new Error(`https://svelte.dev/e/each_key_duplicate`);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* `%rune%` cannot be used inside an effect cleanup function
|
|
180
|
-
* @param {string} rune
|
|
181
|
-
* @returns {never}
|
|
182
|
-
*/
|
|
183
|
-
function effect_in_teardown(rune) {
|
|
184
|
-
throw new Error(`https://svelte.dev/e/effect_in_teardown`);
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Effect cannot be created inside a `$derived` value that was not itself created inside an effect
|
|
188
|
-
* @returns {never}
|
|
189
|
-
*/
|
|
190
|
-
function effect_in_unowned_derived() {
|
|
191
|
-
throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* `%rune%` can only be used inside an effect (e.g. during component initialisation)
|
|
195
|
-
* @param {string} rune
|
|
196
|
-
* @returns {never}
|
|
197
|
-
*/
|
|
198
|
-
function effect_orphan(rune) {
|
|
199
|
-
throw new Error(`https://svelte.dev/e/effect_orphan`);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
203
|
-
* @returns {never}
|
|
204
|
-
*/
|
|
205
|
-
function effect_update_depth_exceeded() {
|
|
206
|
-
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Failed to hydrate the application
|
|
210
|
-
* @returns {never}
|
|
211
|
-
*/
|
|
212
|
-
function hydration_failed() {
|
|
213
|
-
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
217
|
-
* @param {string} key
|
|
218
|
-
* @returns {never}
|
|
219
|
-
*/
|
|
220
|
-
function props_invalid_value(key) {
|
|
221
|
-
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
225
|
-
* @returns {never}
|
|
226
|
-
*/
|
|
227
|
-
function state_descriptors_fixed() {
|
|
228
|
-
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Cannot set prototype of `$state` object
|
|
232
|
-
* @returns {never}
|
|
233
|
-
*/
|
|
234
|
-
function state_prototype_fixed() {
|
|
235
|
-
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
239
|
-
* @returns {never}
|
|
240
|
-
*/
|
|
241
|
-
function state_unsafe_mutation() {
|
|
242
|
-
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
246
|
-
* @returns {never}
|
|
247
|
-
*/
|
|
248
|
-
function svelte_boundary_reset_onerror() {
|
|
249
|
-
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
154
|
* Reading a derived belonging to a now-destroyed effect may result in stale values
|
|
253
155
|
*/
|
|
254
156
|
function derived_inert() {
|
|
@@ -268,7 +170,7 @@ function svelte_boundary_reset_noop() {
|
|
|
268
170
|
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
269
171
|
}
|
|
270
172
|
//#endregion
|
|
271
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
173
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/hydration.js
|
|
272
174
|
/** @import { TemplateNode } from '#client' */
|
|
273
175
|
/**
|
|
274
176
|
* Use this variable to guard everything related to hydration code so it can be treeshaken out
|
|
@@ -347,7 +249,7 @@ function read_hydration_instruction(node) {
|
|
|
347
249
|
return node.data;
|
|
348
250
|
}
|
|
349
251
|
//#endregion
|
|
350
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
252
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
351
253
|
/** @import { Equals } from '#client' */
|
|
352
254
|
/** @type {Equals} */
|
|
353
255
|
function equals(value) {
|
|
@@ -365,14 +267,114 @@ function safe_not_equal(a, b) {
|
|
|
365
267
|
function safe_equals(value) {
|
|
366
268
|
return !safe_not_equal(value, this.v);
|
|
367
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* `%name%(...)` can only be used during component initialisation
|
|
272
|
+
* @param {string} name
|
|
273
|
+
* @returns {never}
|
|
274
|
+
*/
|
|
275
|
+
function lifecycle_outside_component(name) {
|
|
276
|
+
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/errors.js
|
|
280
|
+
/**
|
|
281
|
+
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
282
|
+
* @returns {never}
|
|
283
|
+
*/
|
|
284
|
+
function async_derived_orphan() {
|
|
285
|
+
throw new Error(`https://svelte.dev/e/async_derived_orphan`);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Keyed each block has duplicate key `%value%` at indexes %a% and %b%
|
|
289
|
+
* @param {string} a
|
|
290
|
+
* @param {string} b
|
|
291
|
+
* @param {string | undefined | null} [value]
|
|
292
|
+
* @returns {never}
|
|
293
|
+
*/
|
|
294
|
+
function each_key_duplicate(a, b, value) {
|
|
295
|
+
throw new Error(`https://svelte.dev/e/each_key_duplicate`);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* `%rune%` cannot be used inside an effect cleanup function
|
|
299
|
+
* @param {string} rune
|
|
300
|
+
* @returns {never}
|
|
301
|
+
*/
|
|
302
|
+
function effect_in_teardown(rune) {
|
|
303
|
+
throw new Error(`https://svelte.dev/e/effect_in_teardown`);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Effect cannot be created inside a `$derived` value that was not itself created inside an effect
|
|
307
|
+
* @returns {never}
|
|
308
|
+
*/
|
|
309
|
+
function effect_in_unowned_derived() {
|
|
310
|
+
throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* `%rune%` can only be used inside an effect (e.g. during component initialisation)
|
|
314
|
+
* @param {string} rune
|
|
315
|
+
* @returns {never}
|
|
316
|
+
*/
|
|
317
|
+
function effect_orphan(rune) {
|
|
318
|
+
throw new Error(`https://svelte.dev/e/effect_orphan`);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
322
|
+
* @returns {never}
|
|
323
|
+
*/
|
|
324
|
+
function effect_update_depth_exceeded() {
|
|
325
|
+
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Failed to hydrate the application
|
|
329
|
+
* @returns {never}
|
|
330
|
+
*/
|
|
331
|
+
function hydration_failed() {
|
|
332
|
+
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
336
|
+
* @param {string} key
|
|
337
|
+
* @returns {never}
|
|
338
|
+
*/
|
|
339
|
+
function props_invalid_value(key) {
|
|
340
|
+
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
344
|
+
* @returns {never}
|
|
345
|
+
*/
|
|
346
|
+
function state_descriptors_fixed() {
|
|
347
|
+
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Cannot set prototype of `$state` object
|
|
351
|
+
* @returns {never}
|
|
352
|
+
*/
|
|
353
|
+
function state_prototype_fixed() {
|
|
354
|
+
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
358
|
+
* @returns {never}
|
|
359
|
+
*/
|
|
360
|
+
function state_unsafe_mutation() {
|
|
361
|
+
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
365
|
+
* @returns {never}
|
|
366
|
+
*/
|
|
367
|
+
function svelte_boundary_reset_onerror() {
|
|
368
|
+
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
369
|
+
}
|
|
368
370
|
//#endregion
|
|
369
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
371
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/flags/index.js
|
|
370
372
|
/** True if experimental.async=true */
|
|
371
373
|
var async_mode_flag = false;
|
|
372
374
|
/** True if we're not certain that we only have Svelte 5 code in the compilation */
|
|
373
375
|
var legacy_mode_flag = false;
|
|
374
376
|
//#endregion
|
|
375
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
377
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/context.js
|
|
376
378
|
/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
|
|
377
379
|
/** @type {ComponentContext | null} */
|
|
378
380
|
var component_context = null;
|
|
@@ -417,14 +419,22 @@ function pop(component) {
|
|
|
417
419
|
if (component !== void 0) context.x = component;
|
|
418
420
|
context.i = true;
|
|
419
421
|
component_context = context.p;
|
|
420
|
-
return component
|
|
422
|
+
return mark_as_component(component);
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Add a symbol to the object (or create one if undefined) to mark it as a component so it isn't proxified.
|
|
426
|
+
* @param {any} component
|
|
427
|
+
*/
|
|
428
|
+
function mark_as_component(component = {}) {
|
|
429
|
+
define_property(component, COMPONENT_SYMBOL, { value: true });
|
|
430
|
+
return component;
|
|
421
431
|
}
|
|
422
432
|
/** @returns {boolean} */
|
|
423
433
|
function is_runes() {
|
|
424
434
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
425
435
|
}
|
|
426
436
|
//#endregion
|
|
427
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
437
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/task.js
|
|
428
438
|
/** @type {Array<() => void>} */
|
|
429
439
|
var micro_tasks = [];
|
|
430
440
|
function run_micro_tasks() {
|
|
@@ -450,40 +460,8 @@ function queue_micro_task(fn) {
|
|
|
450
460
|
function flush_tasks() {
|
|
451
461
|
while (micro_tasks.length > 0) run_micro_tasks();
|
|
452
462
|
}
|
|
453
|
-
/**
|
|
454
|
-
* @param {unknown} error
|
|
455
|
-
*/
|
|
456
|
-
function handle_error(error) {
|
|
457
|
-
var effect = active_effect;
|
|
458
|
-
if (effect === null) {
|
|
459
|
-
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
460
|
-
return error;
|
|
461
|
-
}
|
|
462
|
-
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
463
|
-
invoke_error_boundary(error, effect);
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* @param {unknown} error
|
|
467
|
-
* @param {Effect | null} effect
|
|
468
|
-
*/
|
|
469
|
-
function invoke_error_boundary(error, effect) {
|
|
470
|
-
if (effect !== null && (effect.f & 16384) !== 0) return;
|
|
471
|
-
while (effect !== null) {
|
|
472
|
-
if ((effect.f & 128) !== 0) {
|
|
473
|
-
if ((effect.f & 32768) === 0) throw error;
|
|
474
|
-
try {
|
|
475
|
-
/** @type {Boundary} */ effect.b.error(error);
|
|
476
|
-
return;
|
|
477
|
-
} catch (e) {
|
|
478
|
-
error = e;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
effect = effect.parent;
|
|
482
|
-
}
|
|
483
|
-
throw error;
|
|
484
|
-
}
|
|
485
463
|
//#endregion
|
|
486
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
464
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/status.js
|
|
487
465
|
/** @import { Derived, Signal } from '#client' */
|
|
488
466
|
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
489
467
|
/**
|
|
@@ -502,7 +480,7 @@ function update_derived_status(derived) {
|
|
|
502
480
|
else set_signal_status(derived, MAYBE_DIRTY);
|
|
503
481
|
}
|
|
504
482
|
//#endregion
|
|
505
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
483
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
506
484
|
/** @import { Derived, Effect, Value } from '#client' */
|
|
507
485
|
/**
|
|
508
486
|
* @param {Value[] | null} deps
|
|
@@ -530,7 +508,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
|
530
508
|
set_signal_status(effect, CLEAN);
|
|
531
509
|
}
|
|
532
510
|
//#endregion
|
|
533
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
511
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/store.js
|
|
534
512
|
/**
|
|
535
513
|
* We set this to `true` when updating a store so that we correctly
|
|
536
514
|
* schedule effects if the update takes place inside a `$:` effect
|
|
@@ -560,7 +538,7 @@ function capture_store_binding(fn) {
|
|
|
560
538
|
}
|
|
561
539
|
}
|
|
562
540
|
//#endregion
|
|
563
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
541
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/misc.js
|
|
564
542
|
var listening_to_form_reset = false;
|
|
565
543
|
function add_form_reset_listener() {
|
|
566
544
|
if (!listening_to_form_reset) {
|
|
@@ -574,7 +552,7 @@ function add_form_reset_listener() {
|
|
|
574
552
|
}
|
|
575
553
|
}
|
|
576
554
|
//#endregion
|
|
577
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
555
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
578
556
|
/**
|
|
579
557
|
* @template T
|
|
580
558
|
* @param {() => T} fn
|
|
@@ -592,481 +570,7 @@ function without_reactive_context(fn) {
|
|
|
592
570
|
}
|
|
593
571
|
}
|
|
594
572
|
//#endregion
|
|
595
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
596
|
-
/**
|
|
597
|
-
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
598
|
-
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
599
|
-
*
|
|
600
|
-
* If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
|
|
601
|
-
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
602
|
-
*
|
|
603
|
-
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
604
|
-
*
|
|
605
|
-
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
606
|
-
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
607
|
-
*
|
|
608
|
-
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
609
|
-
*
|
|
610
|
-
* ```js
|
|
611
|
-
* import { createSubscriber } from 'svelte/reactivity';
|
|
612
|
-
* import { on } from 'svelte/events';
|
|
613
|
-
*
|
|
614
|
-
* export class MediaQuery {
|
|
615
|
-
* #query;
|
|
616
|
-
* #subscribe;
|
|
617
|
-
*
|
|
618
|
-
* constructor(query) {
|
|
619
|
-
* this.#query = window.matchMedia(`(${query})`);
|
|
620
|
-
*
|
|
621
|
-
* this.#subscribe = createSubscriber((update) => {
|
|
622
|
-
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
623
|
-
* const off = on(this.#query, 'change', update);
|
|
624
|
-
*
|
|
625
|
-
* // stop listening when all the effects are destroyed
|
|
626
|
-
* return () => off();
|
|
627
|
-
* });
|
|
628
|
-
* }
|
|
629
|
-
*
|
|
630
|
-
* get current() {
|
|
631
|
-
* // This makes the getter reactive, if read in an effect
|
|
632
|
-
* this.#subscribe();
|
|
633
|
-
*
|
|
634
|
-
* // Return the current state of the query, whether or not we're in an effect
|
|
635
|
-
* return this.#query.matches;
|
|
636
|
-
* }
|
|
637
|
-
* }
|
|
638
|
-
* ```
|
|
639
|
-
* @param {(update: () => void) => (() => void) | void} start
|
|
640
|
-
* @since 5.7.0
|
|
641
|
-
*/
|
|
642
|
-
function createSubscriber(start) {
|
|
643
|
-
let subscribers = 0;
|
|
644
|
-
let version = source(0);
|
|
645
|
-
/** @type {(() => void) | void} */
|
|
646
|
-
let stop;
|
|
647
|
-
return () => {
|
|
648
|
-
if (effect_tracking()) {
|
|
649
|
-
get(version);
|
|
650
|
-
render_effect(() => {
|
|
651
|
-
if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
|
|
652
|
-
subscribers += 1;
|
|
653
|
-
return () => {
|
|
654
|
-
queue_micro_task(() => {
|
|
655
|
-
subscribers -= 1;
|
|
656
|
-
if (subscribers === 0) {
|
|
657
|
-
stop?.();
|
|
658
|
-
stop = void 0;
|
|
659
|
-
increment(version);
|
|
660
|
-
}
|
|
661
|
-
});
|
|
662
|
-
};
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
//#endregion
|
|
668
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
|
|
669
|
-
function _checkPrivateRedeclaration(e, t) {
|
|
670
|
-
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
671
|
-
}
|
|
672
|
-
//#endregion
|
|
673
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
674
|
-
function _classPrivateMethodInitSpec(e, a) {
|
|
675
|
-
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
676
|
-
}
|
|
677
|
-
//#endregion
|
|
678
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
679
|
-
function _classPrivateFieldInitSpec(e, t, a) {
|
|
680
|
-
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
681
|
-
}
|
|
682
|
-
//#endregion
|
|
683
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
|
|
684
|
-
function _assertClassBrand(e, t, n) {
|
|
685
|
-
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
686
|
-
throw new TypeError("Private element is not present on this object");
|
|
687
|
-
}
|
|
688
|
-
//#endregion
|
|
689
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
|
|
690
|
-
function _classPrivateFieldSet2(s, a, r) {
|
|
691
|
-
return s.set(_assertClassBrand(s, a), r), r;
|
|
692
|
-
}
|
|
693
|
-
//#endregion
|
|
694
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
|
|
695
|
-
function _classPrivateFieldGet2(s, a) {
|
|
696
|
-
return s.get(_assertClassBrand(s, a));
|
|
697
|
-
}
|
|
698
|
-
//#endregion
|
|
699
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
700
|
-
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
701
|
-
/**
|
|
702
|
-
* @typedef {{
|
|
703
|
-
* onerror?: ((error: unknown, reset: () => void) => void) | null;
|
|
704
|
-
* failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
|
|
705
|
-
* pending?: ((anchor: Node) => void) | null;
|
|
706
|
-
* }} BoundaryProps
|
|
707
|
-
*/
|
|
708
|
-
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
|
|
709
|
-
/**
|
|
710
|
-
* @param {TemplateNode} node
|
|
711
|
-
* @param {BoundaryProps} props
|
|
712
|
-
* @param {((anchor: Node) => void)} children
|
|
713
|
-
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
714
|
-
* @returns {void}
|
|
715
|
-
*/
|
|
716
|
-
function boundary(node, props, children, transform_error) {
|
|
717
|
-
new Boundary(node, props, children, transform_error);
|
|
718
|
-
}
|
|
719
|
-
var _anchor = /* @__PURE__ */ new WeakMap();
|
|
720
|
-
var _hydrate_open = /* @__PURE__ */ new WeakMap();
|
|
721
|
-
var _props = /* @__PURE__ */ new WeakMap();
|
|
722
|
-
var _children = /* @__PURE__ */ new WeakMap();
|
|
723
|
-
var _effect = /* @__PURE__ */ new WeakMap();
|
|
724
|
-
var _main_effect = /* @__PURE__ */ new WeakMap();
|
|
725
|
-
var _pending_effect = /* @__PURE__ */ new WeakMap();
|
|
726
|
-
var _failed_effect = /* @__PURE__ */ new WeakMap();
|
|
727
|
-
var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
|
|
728
|
-
var _local_pending_count = /* @__PURE__ */ new WeakMap();
|
|
729
|
-
var _pending_count = /* @__PURE__ */ new WeakMap();
|
|
730
|
-
var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
|
|
731
|
-
var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
732
|
-
var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
733
|
-
var _effect_pending = /* @__PURE__ */ new WeakMap();
|
|
734
|
-
var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
|
|
735
|
-
var _Boundary_brand = /* @__PURE__ */ new WeakSet();
|
|
736
|
-
var Boundary = class {
|
|
737
|
-
/**
|
|
738
|
-
* @param {TemplateNode} node
|
|
739
|
-
* @param {BoundaryProps} props
|
|
740
|
-
* @param {((anchor: Node) => void)} children
|
|
741
|
-
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
742
|
-
*/
|
|
743
|
-
constructor(node, props, children, transform_error) {
|
|
744
|
-
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
745
|
-
_defineProperty(
|
|
746
|
-
this,
|
|
747
|
-
/** @type {Boundary | null} */
|
|
748
|
-
"parent",
|
|
749
|
-
void 0
|
|
750
|
-
);
|
|
751
|
-
_defineProperty(this, "is_pending", false);
|
|
752
|
-
_defineProperty(
|
|
753
|
-
this,
|
|
754
|
-
/**
|
|
755
|
-
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
756
|
-
* Inherited from parent boundary, or defaults to identity.
|
|
757
|
-
* @type {(error: unknown) => unknown}
|
|
758
|
-
*/
|
|
759
|
-
"transform_error",
|
|
760
|
-
void 0
|
|
761
|
-
);
|
|
762
|
-
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
763
|
-
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
764
|
-
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
765
|
-
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
766
|
-
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
767
|
-
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
768
|
-
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
769
|
-
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
770
|
-
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
771
|
-
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
772
|
-
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
773
|
-
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
774
|
-
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
775
|
-
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
776
|
-
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
777
|
-
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
778
|
-
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
779
|
-
return () => {
|
|
780
|
-
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
781
|
-
};
|
|
782
|
-
}));
|
|
783
|
-
_classPrivateFieldSet2(_anchor, this, node);
|
|
784
|
-
_classPrivateFieldSet2(_props, this, props);
|
|
785
|
-
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
786
|
-
var effect = active_effect;
|
|
787
|
-
effect.b = this;
|
|
788
|
-
effect.f |= 128;
|
|
789
|
-
children(anchor);
|
|
790
|
-
});
|
|
791
|
-
this.parent = active_effect.b;
|
|
792
|
-
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
793
|
-
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
794
|
-
if (hydrating) {
|
|
795
|
-
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
796
|
-
hydrate_next();
|
|
797
|
-
const server_rendered_pending = comment.data === "[!";
|
|
798
|
-
if (comment.data.startsWith("[?")) {
|
|
799
|
-
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
800
|
-
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
801
|
-
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
802
|
-
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
803
|
-
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
804
|
-
}, flags));
|
|
805
|
-
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
806
|
-
}
|
|
807
|
-
/**
|
|
808
|
-
* Defer an effect inside a pending boundary until the boundary resolves
|
|
809
|
-
* @param {Effect} effect
|
|
810
|
-
*/
|
|
811
|
-
defer_effect(effect) {
|
|
812
|
-
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
816
|
-
* @returns {boolean}
|
|
817
|
-
*/
|
|
818
|
-
is_rendered() {
|
|
819
|
-
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
820
|
-
}
|
|
821
|
-
has_pending_snippet() {
|
|
822
|
-
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
826
|
-
* and controls when the current `pending` snippet (if any) is removed.
|
|
827
|
-
* Do not call from inside the class
|
|
828
|
-
* @param {1 | -1} d
|
|
829
|
-
* @param {Batch} batch
|
|
830
|
-
*/
|
|
831
|
-
update_pending_count(d, batch) {
|
|
832
|
-
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
833
|
-
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
834
|
-
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
835
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
836
|
-
queue_micro_task(() => {
|
|
837
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
838
|
-
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
|
-
get_effect_pending() {
|
|
842
|
-
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
843
|
-
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
844
|
-
}
|
|
845
|
-
/** @param {unknown} error */
|
|
846
|
-
error(error) {
|
|
847
|
-
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
848
|
-
if (current_batch?.is_fork) {
|
|
849
|
-
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
850
|
-
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
851
|
-
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
852
|
-
current_batch.oncommit(() => {
|
|
853
|
-
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
854
|
-
});
|
|
855
|
-
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
function _hydrate_resolved_content() {
|
|
859
|
-
try {
|
|
860
|
-
_classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
|
|
861
|
-
} catch (error) {
|
|
862
|
-
this.error(error);
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* @param {unknown} error The deserialized error from the server's hydration comment
|
|
867
|
-
*/
|
|
868
|
-
function _hydrate_failed_content(error) {
|
|
869
|
-
const failed = _classPrivateFieldGet2(_props, this).failed;
|
|
870
|
-
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
|
|
871
|
-
queue_micro_task(invoke_onerror);
|
|
872
|
-
if (!failed) return;
|
|
873
|
-
_classPrivateFieldSet2(_failed_effect, this, branch(() => {
|
|
874
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
|
|
875
|
-
}));
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Creates the `reset` function for a failed boundary, along with a function
|
|
879
|
-
* that invokes `onerror` with it (if provided)
|
|
880
|
-
* @param {unknown} error
|
|
881
|
-
* @returns {{ reset: () => void, invoke_onerror: () => void }}
|
|
882
|
-
*/
|
|
883
|
-
function _create_reset(error) {
|
|
884
|
-
var did_reset = false;
|
|
885
|
-
var calling_on_error = false;
|
|
886
|
-
const reset = () => {
|
|
887
|
-
if (did_reset) {
|
|
888
|
-
svelte_boundary_reset_noop();
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
did_reset = true;
|
|
892
|
-
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
893
|
-
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
894
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
895
|
-
});
|
|
896
|
-
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
897
|
-
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
898
|
-
});
|
|
899
|
-
};
|
|
900
|
-
const invoke_onerror = () => {
|
|
901
|
-
try {
|
|
902
|
-
calling_on_error = true;
|
|
903
|
-
_classPrivateFieldGet2(_props, this).onerror?.(error, reset);
|
|
904
|
-
calling_on_error = false;
|
|
905
|
-
} catch (err) {
|
|
906
|
-
invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
return {
|
|
910
|
-
reset,
|
|
911
|
-
invoke_onerror
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
function _hydrate_pending_content() {
|
|
915
|
-
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
916
|
-
if (!pending) return;
|
|
917
|
-
this.is_pending = true;
|
|
918
|
-
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
919
|
-
queue_micro_task(() => {
|
|
920
|
-
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
921
|
-
var anchor = create_text();
|
|
922
|
-
fragment.append(anchor);
|
|
923
|
-
_classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
924
|
-
return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
|
|
925
|
-
}));
|
|
926
|
-
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
927
|
-
_classPrivateFieldGet2(_anchor, this).before(fragment);
|
|
928
|
-
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
929
|
-
pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
930
|
-
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
931
|
-
});
|
|
932
|
-
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
933
|
-
}
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
function _render() {
|
|
937
|
-
try {
|
|
938
|
-
this.is_pending = this.has_pending_snippet();
|
|
939
|
-
_classPrivateFieldSet2(_pending_count, this, 0);
|
|
940
|
-
_classPrivateFieldSet2(_local_pending_count, this, 0);
|
|
941
|
-
_classPrivateFieldSet2(_main_effect, this, branch(() => {
|
|
942
|
-
_classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
|
|
943
|
-
}));
|
|
944
|
-
if (_classPrivateFieldGet2(_pending_count, this) > 0) {
|
|
945
|
-
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
946
|
-
move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
|
|
947
|
-
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
948
|
-
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
949
|
-
} else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
950
|
-
} catch (error) {
|
|
951
|
-
this.error(error);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* @param {Batch} batch
|
|
956
|
-
*/
|
|
957
|
-
function _resolve(batch) {
|
|
958
|
-
this.is_pending = false;
|
|
959
|
-
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* @template T
|
|
963
|
-
* @param {() => T} fn
|
|
964
|
-
*/
|
|
965
|
-
function _run(fn) {
|
|
966
|
-
var previous_effect = active_effect;
|
|
967
|
-
var previous_reaction = active_reaction;
|
|
968
|
-
var previous_ctx = component_context;
|
|
969
|
-
set_active_effect(_classPrivateFieldGet2(_effect, this));
|
|
970
|
-
set_active_reaction(_classPrivateFieldGet2(_effect, this));
|
|
971
|
-
set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
|
|
972
|
-
try {
|
|
973
|
-
Batch.ensure();
|
|
974
|
-
return fn();
|
|
975
|
-
} catch (e) {
|
|
976
|
-
handle_error(e);
|
|
977
|
-
return null;
|
|
978
|
-
} finally {
|
|
979
|
-
set_active_effect(previous_effect);
|
|
980
|
-
set_active_reaction(previous_reaction);
|
|
981
|
-
set_component_context(previous_ctx);
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
/**
|
|
985
|
-
* Updates the pending count associated with the currently visible pending snippet,
|
|
986
|
-
* if any, such that we can replace the snippet with content once work is done
|
|
987
|
-
* @param {1 | -1} d
|
|
988
|
-
* @param {Batch} batch
|
|
989
|
-
*/
|
|
990
|
-
function _update_pending_count(d, batch) {
|
|
991
|
-
if (!this.has_pending_snippet()) {
|
|
992
|
-
if (this.parent) {
|
|
993
|
-
var _this$parent;
|
|
994
|
-
_assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
|
|
995
|
-
}
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
_classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
|
|
999
|
-
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
1000
|
-
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
|
|
1001
|
-
if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
1002
|
-
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
1003
|
-
});
|
|
1004
|
-
if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
|
|
1005
|
-
_classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
|
|
1006
|
-
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
/**
|
|
1011
|
-
* @param {unknown} error
|
|
1012
|
-
*/
|
|
1013
|
-
function _handle_error(error) {
|
|
1014
|
-
if (_classPrivateFieldGet2(_main_effect, this)) {
|
|
1015
|
-
destroy_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
1016
|
-
_classPrivateFieldSet2(_main_effect, this, null);
|
|
1017
|
-
}
|
|
1018
|
-
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
1019
|
-
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
1020
|
-
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
1021
|
-
}
|
|
1022
|
-
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
1023
|
-
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
1024
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1025
|
-
}
|
|
1026
|
-
if (hydrating) {
|
|
1027
|
-
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
1028
|
-
next();
|
|
1029
|
-
set_hydrate_node(skip_nodes());
|
|
1030
|
-
}
|
|
1031
|
-
let failed = _classPrivateFieldGet2(_props, this).failed;
|
|
1032
|
-
/** @param {unknown} transformed_error */
|
|
1033
|
-
const handle_error_result = (transformed_error) => {
|
|
1034
|
-
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
|
|
1035
|
-
invoke_onerror();
|
|
1036
|
-
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1037
|
-
try {
|
|
1038
|
-
return branch(() => {
|
|
1039
|
-
var effect = active_effect;
|
|
1040
|
-
effect.b = this;
|
|
1041
|
-
effect.f |= 128;
|
|
1042
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
1043
|
-
});
|
|
1044
|
-
} catch (error) {
|
|
1045
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
1046
|
-
return null;
|
|
1047
|
-
}
|
|
1048
|
-
}));
|
|
1049
|
-
};
|
|
1050
|
-
queue_micro_task(() => {
|
|
1051
|
-
/** @type {unknown} */
|
|
1052
|
-
var result;
|
|
1053
|
-
try {
|
|
1054
|
-
result = this.transform_error(error);
|
|
1055
|
-
} catch (e) {
|
|
1056
|
-
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1057
|
-
return;
|
|
1058
|
-
}
|
|
1059
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
1060
|
-
/** @type {any} */ result.then(
|
|
1061
|
-
handle_error_result,
|
|
1062
|
-
/** @param {unknown} e */
|
|
1063
|
-
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
1064
|
-
);
|
|
1065
|
-
else handle_error_result(result);
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
//#endregion
|
|
1069
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
573
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
1070
574
|
/** @import { Blocker, Effect, Source, Value } from '#client' */
|
|
1071
575
|
/**
|
|
1072
576
|
* @param {Blocker[]} blockers
|
|
@@ -1355,7 +859,38 @@ function unfreeze_derived_effects(derived) {
|
|
|
1355
859
|
for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
|
|
1356
860
|
}
|
|
1357
861
|
//#endregion
|
|
1358
|
-
//#region
|
|
862
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
|
|
863
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
864
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
868
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
869
|
+
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
870
|
+
}
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
873
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
874
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
|
|
878
|
+
function _assertClassBrand(e, t, n) {
|
|
879
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
880
|
+
throw new TypeError("Private element is not present on this object");
|
|
881
|
+
}
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
|
|
884
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
885
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
886
|
+
}
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
|
|
889
|
+
function _classPrivateFieldGet2(s, a) {
|
|
890
|
+
return s.get(_assertClassBrand(s, a));
|
|
891
|
+
}
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
1359
894
|
/** @import { Fork } from 'svelte' */
|
|
1360
895
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
1361
896
|
var _Batch;
|
|
@@ -1408,8 +943,8 @@ var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
|
1408
943
|
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
1409
944
|
var _roots = /* @__PURE__ */ new WeakMap();
|
|
1410
945
|
var _new_effects = /* @__PURE__ */ new WeakMap();
|
|
1411
|
-
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
1412
|
-
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
946
|
+
var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
947
|
+
var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
1413
948
|
var _skipped_branches = /* @__PURE__ */ new WeakMap();
|
|
1414
949
|
var _unskipped_branches = /* @__PURE__ */ new WeakMap();
|
|
1415
950
|
var _decrement_queued = /* @__PURE__ */ new WeakMap();
|
|
@@ -1456,8 +991,8 @@ var Batch = class Batch {
|
|
|
1456
991
|
_classPrivateFieldInitSpec(this, _deferred, null);
|
|
1457
992
|
_classPrivateFieldInitSpec(this, _roots, []);
|
|
1458
993
|
_classPrivateFieldInitSpec(this, _new_effects, []);
|
|
1459
|
-
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
1460
|
-
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
994
|
+
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
995
|
+
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
1461
996
|
_classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
|
|
1462
997
|
_classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
|
|
1463
998
|
_defineProperty(this, "is_fork", false);
|
|
@@ -1586,8 +1121,8 @@ var Batch = class Batch {
|
|
|
1586
1121
|
* @param {Set<Effect>} maybe_dirty_effects
|
|
1587
1122
|
*/
|
|
1588
1123
|
transfer_effects(dirty_effects, maybe_dirty_effects) {
|
|
1589
|
-
for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects, this).add(e);
|
|
1590
|
-
for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(e);
|
|
1124
|
+
for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects$1, this).add(e);
|
|
1125
|
+
for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(e);
|
|
1591
1126
|
dirty_effects.clear();
|
|
1592
1127
|
maybe_dirty_effects.clear();
|
|
1593
1128
|
}
|
|
@@ -1682,12 +1217,12 @@ function _process() {
|
|
|
1682
1217
|
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1683
1218
|
infinite_loop_guard();
|
|
1684
1219
|
}
|
|
1685
|
-
for (const e of _classPrivateFieldGet2(_dirty_effects, this)) {
|
|
1686
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).delete(e);
|
|
1220
|
+
for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
|
|
1221
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
|
|
1687
1222
|
set_signal_status(e, DIRTY);
|
|
1688
1223
|
this.schedule(e);
|
|
1689
1224
|
}
|
|
1690
|
-
for (const e of _classPrivateFieldGet2(_maybe_dirty_effects, this)) {
|
|
1225
|
+
for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
|
|
1691
1226
|
set_signal_status(e, MAYBE_DIRTY);
|
|
1692
1227
|
this.schedule(e);
|
|
1693
1228
|
}
|
|
@@ -1732,8 +1267,8 @@ function _process() {
|
|
|
1732
1267
|
_assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
|
|
1733
1268
|
return;
|
|
1734
1269
|
}
|
|
1735
|
-
_classPrivateFieldGet2(_dirty_effects, this).clear();
|
|
1736
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).clear();
|
|
1270
|
+
_classPrivateFieldGet2(_dirty_effects$1, this).clear();
|
|
1271
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
|
|
1737
1272
|
for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
|
|
1738
1273
|
_classPrivateFieldGet2(_commit_callbacks, this).clear();
|
|
1739
1274
|
previous_batch = this;
|
|
@@ -1753,7 +1288,10 @@ function _process() {
|
|
|
1753
1288
|
const batch = next_batch;
|
|
1754
1289
|
_classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
|
|
1755
1290
|
} else next_batch = this;
|
|
1756
|
-
if (next_batch !== null)
|
|
1291
|
+
if (next_batch !== null) {
|
|
1292
|
+
old_values.clear();
|
|
1293
|
+
_assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
|
|
1294
|
+
}
|
|
1757
1295
|
}
|
|
1758
1296
|
/**
|
|
1759
1297
|
* Traverse the effect tree, executing effects or stashing
|
|
@@ -1773,7 +1311,7 @@ function _traverse(root, effects, render_effects) {
|
|
|
1773
1311
|
else if ((flags & 4) !== 0) effects.push(effect);
|
|
1774
1312
|
else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
|
|
1775
1313
|
else if (is_dirty(effect)) {
|
|
1776
|
-
if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(effect);
|
|
1314
|
+
if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(effect);
|
|
1777
1315
|
update_effect(effect);
|
|
1778
1316
|
}
|
|
1779
1317
|
var child = effect.first;
|
|
@@ -1815,7 +1353,7 @@ function _merge(batch) {
|
|
|
1815
1353
|
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1816
1354
|
}
|
|
1817
1355
|
batch.async_deriveds.clear();
|
|
1818
|
-
this.transfer_effects(_classPrivateFieldGet2(_dirty_effects, batch), _classPrivateFieldGet2(_maybe_dirty_effects, batch));
|
|
1356
|
+
this.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, batch), _classPrivateFieldGet2(_maybe_dirty_effects$1, batch));
|
|
1819
1357
|
/**
|
|
1820
1358
|
* mark all effects that depend on `batch.current`, except the
|
|
1821
1359
|
* async effects that we just resolved (TODO unless they depend
|
|
@@ -1834,7 +1372,7 @@ function _merge(batch) {
|
|
|
1834
1372
|
else {
|
|
1835
1373
|
var effect = reaction;
|
|
1836
1374
|
if (flags & 4194320 && !this.async_deriveds.has(effect)) {
|
|
1837
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).delete(effect);
|
|
1375
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(effect);
|
|
1838
1376
|
set_signal_status(effect, DIRTY);
|
|
1839
1377
|
this.schedule(effect);
|
|
1840
1378
|
}
|
|
@@ -1851,7 +1389,7 @@ function _merge(batch) {
|
|
|
1851
1389
|
* @param {Effect[]} effects
|
|
1852
1390
|
*/
|
|
1853
1391
|
function _defer_effects(effects) {
|
|
1854
|
-
for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
1392
|
+
for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
1855
1393
|
}
|
|
1856
1394
|
function _commit$1() {
|
|
1857
1395
|
for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
|
|
@@ -1896,7 +1434,7 @@ function _commit$1() {
|
|
|
1896
1434
|
for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
|
|
1897
1435
|
set_signal_status(effect, DIRTY);
|
|
1898
1436
|
batch.schedule(effect);
|
|
1899
|
-
} else _classPrivateFieldGet2(_dirty_effects, batch).add(effect);
|
|
1437
|
+
} else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
|
|
1900
1438
|
}
|
|
1901
1439
|
if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
|
|
1902
1440
|
batch.apply();
|
|
@@ -2068,7 +1606,7 @@ function reset_all(effect) {
|
|
|
2068
1606
|
}
|
|
2069
1607
|
}
|
|
2070
1608
|
//#endregion
|
|
2071
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1609
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
2072
1610
|
/** @import { Derived, Effect, Source, Value } from '#client' */
|
|
2073
1611
|
/** @type {Set<Effect>} */
|
|
2074
1612
|
var eager_effects = /* @__PURE__ */ new Set();
|
|
@@ -2138,7 +1676,8 @@ function set(source, value, should_proxy = false) {
|
|
|
2138
1676
|
*/
|
|
2139
1677
|
function internal_set(source, value, updated_during_traversal = null) {
|
|
2140
1678
|
if (!source.equals(value)) {
|
|
2141
|
-
old_values.set(source,
|
|
1679
|
+
if (is_destroying_effect) old_values.set(source, value);
|
|
1680
|
+
else if (!old_values.has(source)) old_values.set(source, source.v);
|
|
2142
1681
|
var batch = Batch.ensure();
|
|
2143
1682
|
batch.capture(source, value);
|
|
2144
1683
|
if ((source.f & 2) !== 0) {
|
|
@@ -2214,7 +1753,7 @@ function mark_reactions(signal, status, updated_during_traversal) {
|
|
|
2214
1753
|
* @returns {T}
|
|
2215
1754
|
*/
|
|
2216
1755
|
function proxy(value) {
|
|
2217
|
-
if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value;
|
|
1756
|
+
if (typeof value !== "object" || value === null || STATE_SYMBOL in value || COMPONENT_SYMBOL in value) return value;
|
|
2218
1757
|
const prototype = get_prototype_of(value);
|
|
2219
1758
|
if (prototype !== object_prototype && prototype !== array_prototype) return value;
|
|
2220
1759
|
/** @type {Map<any, Source<any>>} */
|
|
@@ -2367,7 +1906,7 @@ function proxy(value) {
|
|
|
2367
1906
|
});
|
|
2368
1907
|
}
|
|
2369
1908
|
//#endregion
|
|
2370
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1909
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/operations.js
|
|
2371
1910
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
2372
1911
|
/** @type {Window} */
|
|
2373
1912
|
var $window;
|
|
@@ -2467,6 +2006,21 @@ function first_child(node, is_text = false) {
|
|
|
2467
2006
|
return hydrate_node;
|
|
2468
2007
|
}
|
|
2469
2008
|
/**
|
|
2009
|
+
* `child`, for the very common case of an element with exactly one child. Resetting the
|
|
2010
|
+
* hydration cursor is part of the same step, so the compiler doesn't have to emit a
|
|
2011
|
+
* separate `reset` call for every `<p>{text}</p>` in an app.
|
|
2012
|
+
* Don't mark this as side-effect-free, hydration needs to walk all nodes
|
|
2013
|
+
* @param {TemplateNode} node
|
|
2014
|
+
* @param {boolean} [is_text]
|
|
2015
|
+
* @returns {TemplateNode | null}
|
|
2016
|
+
*/
|
|
2017
|
+
function only_child(node, is_text = false) {
|
|
2018
|
+
if (!hydrating) return /* @__PURE__ */ get_first_child(node);
|
|
2019
|
+
var first = child(node, is_text);
|
|
2020
|
+
reset$1(node);
|
|
2021
|
+
return first;
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2470
2024
|
* Don't mark this as side-effect-free, hydration needs to walk all nodes
|
|
2471
2025
|
* @param {TemplateNode} node
|
|
2472
2026
|
* @param {number} count
|
|
@@ -2544,8 +2098,40 @@ function merge_text_nodes(text) {
|
|
|
2544
2098
|
next = text.nextSibling;
|
|
2545
2099
|
}
|
|
2546
2100
|
}
|
|
2101
|
+
/**
|
|
2102
|
+
* @param {unknown} error
|
|
2103
|
+
*/
|
|
2104
|
+
function handle_error(error) {
|
|
2105
|
+
var effect = active_effect;
|
|
2106
|
+
if (effect === null) {
|
|
2107
|
+
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
2108
|
+
return error;
|
|
2109
|
+
}
|
|
2110
|
+
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
2111
|
+
invoke_error_boundary(error, effect);
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* @param {unknown} error
|
|
2115
|
+
* @param {Effect | null} effect
|
|
2116
|
+
*/
|
|
2117
|
+
function invoke_error_boundary(error, effect) {
|
|
2118
|
+
if (effect !== null && (effect.f & 16384) !== 0) return;
|
|
2119
|
+
while (effect !== null) {
|
|
2120
|
+
if ((effect.f & 128) !== 0 && (effect.f & 33570816) === 0) {
|
|
2121
|
+
if ((effect.f & 32768) === 0) throw error;
|
|
2122
|
+
try {
|
|
2123
|
+
/** @type {Boundary} */ effect.b.error(error);
|
|
2124
|
+
return;
|
|
2125
|
+
} catch (e) {
|
|
2126
|
+
error = e;
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
effect = effect.parent;
|
|
2130
|
+
}
|
|
2131
|
+
throw error;
|
|
2132
|
+
}
|
|
2547
2133
|
//#endregion
|
|
2548
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2134
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
2549
2135
|
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
2550
2136
|
/**
|
|
2551
2137
|
* @param {'$effect' | '$effect.pre' | '$inspect'} rune
|
|
@@ -2748,6 +2334,8 @@ function execute_effect_teardown(effect) {
|
|
|
2748
2334
|
set_active_reaction(null);
|
|
2749
2335
|
try {
|
|
2750
2336
|
teardown.call(null);
|
|
2337
|
+
} catch (error) {
|
|
2338
|
+
invoke_error_boundary(error, effect.parent);
|
|
2751
2339
|
} finally {
|
|
2752
2340
|
set_is_destroying_effect(previously_destroying_effect);
|
|
2753
2341
|
set_active_reaction(previous_reaction);
|
|
@@ -2850,6 +2438,7 @@ function unlink_effect(effect) {
|
|
|
2850
2438
|
function pause_effect(effect, callback, destroy = true) {
|
|
2851
2439
|
/** @type {TransitionManager[]} */
|
|
2852
2440
|
var transitions = [];
|
|
2441
|
+
effect.f |= 256;
|
|
2853
2442
|
pause_children(effect, transitions, true);
|
|
2854
2443
|
var fn = () => {
|
|
2855
2444
|
if (destroy) destroy_effect(effect);
|
|
@@ -2889,6 +2478,7 @@ function pause_children(effect, transitions, local) {
|
|
|
2889
2478
|
* @param {Effect} effect
|
|
2890
2479
|
*/
|
|
2891
2480
|
function resume_effect(effect) {
|
|
2481
|
+
effect.f &= -257;
|
|
2892
2482
|
resume_children(effect, true);
|
|
2893
2483
|
}
|
|
2894
2484
|
/**
|
|
@@ -2896,6 +2486,7 @@ function resume_effect(effect) {
|
|
|
2896
2486
|
* @param {boolean} local
|
|
2897
2487
|
*/
|
|
2898
2488
|
function resume_children(effect, local) {
|
|
2489
|
+
if ((effect.f & 256) !== 0) return;
|
|
2899
2490
|
if ((effect.f & 8192) === 0) return;
|
|
2900
2491
|
effect.f ^= INERT;
|
|
2901
2492
|
if ((effect.f & 1024) === 0) {
|
|
@@ -2931,14 +2522,14 @@ function move_effect(effect, fragment) {
|
|
|
2931
2522
|
}
|
|
2932
2523
|
}
|
|
2933
2524
|
//#endregion
|
|
2934
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2525
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/legacy.js
|
|
2935
2526
|
/**
|
|
2936
2527
|
* @type {Set<Value> | null}
|
|
2937
2528
|
* @deprecated
|
|
2938
2529
|
*/
|
|
2939
2530
|
var captured_signals = null;
|
|
2940
2531
|
//#endregion
|
|
2941
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2532
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/runtime.js
|
|
2942
2533
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2943
2534
|
/**
|
|
2944
2535
|
* True if updating in an effect context that is reactive (i.e. not branch/root effects)
|
|
@@ -2995,7 +2586,7 @@ function set_untracked_writes(value) {
|
|
|
2995
2586
|
* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
|
|
2996
2587
|
**/
|
|
2997
2588
|
var write_version = 1;
|
|
2998
|
-
/** @type {number} Used to version each read of a source of derived to avoid duplicating
|
|
2589
|
+
/** @type {number} Used to version each read of a source of derived to avoid duplicating dependencies inside a reaction */
|
|
2999
2590
|
var read_version = 0;
|
|
3000
2591
|
var update_version = read_version;
|
|
3001
2592
|
/** @param {number} value */
|
|
@@ -3076,24 +2667,8 @@ function update_reaction(reaction) {
|
|
|
3076
2667
|
var fn = reaction.fn;
|
|
3077
2668
|
var result = fn();
|
|
3078
2669
|
reaction.f |= REACTION_RAN;
|
|
3079
|
-
var deps = reaction
|
|
3080
|
-
var
|
|
3081
|
-
if (new_deps !== null) {
|
|
3082
|
-
var i;
|
|
3083
|
-
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
3084
|
-
if (deps !== null && skipped_deps > 0) {
|
|
3085
|
-
deps.length = skipped_deps + new_deps.length;
|
|
3086
|
-
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
3087
|
-
} else reaction.deps = deps = new_deps;
|
|
3088
|
-
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
3089
|
-
var _deps$i;
|
|
3090
|
-
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
3091
|
-
}
|
|
3092
|
-
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
3093
|
-
remove_reactions(reaction, skipped_deps);
|
|
3094
|
-
deps.length = skipped_deps;
|
|
3095
|
-
}
|
|
3096
|
-
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
2670
|
+
var deps = update_dependencies(reaction);
|
|
2671
|
+
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (var i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
3097
2672
|
if (previous_reaction !== null && previous_reaction !== reaction) {
|
|
3098
2673
|
read_version++;
|
|
3099
2674
|
if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
|
|
@@ -3104,6 +2679,7 @@ function update_reaction(reaction) {
|
|
|
3104
2679
|
if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
|
|
3105
2680
|
return result;
|
|
3106
2681
|
} catch (error) {
|
|
2682
|
+
update_dependencies(reaction);
|
|
3107
2683
|
return handle_error(error);
|
|
3108
2684
|
} finally {
|
|
3109
2685
|
reaction.f ^= REACTION_IS_UPDATING;
|
|
@@ -3118,6 +2694,29 @@ function update_reaction(reaction) {
|
|
|
3118
2694
|
}
|
|
3119
2695
|
}
|
|
3120
2696
|
/**
|
|
2697
|
+
* @param {Reaction} reaction
|
|
2698
|
+
*/
|
|
2699
|
+
function update_dependencies(reaction) {
|
|
2700
|
+
var deps = reaction.deps;
|
|
2701
|
+
var is_fork = current_batch?.is_fork;
|
|
2702
|
+
if (new_deps !== null) {
|
|
2703
|
+
var i;
|
|
2704
|
+
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
2705
|
+
if (deps !== null && skipped_deps > 0) {
|
|
2706
|
+
deps.length = skipped_deps + new_deps.length;
|
|
2707
|
+
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
2708
|
+
} else reaction.deps = deps = new_deps;
|
|
2709
|
+
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
2710
|
+
var _deps$i;
|
|
2711
|
+
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
2712
|
+
}
|
|
2713
|
+
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
2714
|
+
remove_reactions(reaction, skipped_deps);
|
|
2715
|
+
deps.length = skipped_deps;
|
|
2716
|
+
}
|
|
2717
|
+
return deps;
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
3121
2720
|
* @template V
|
|
3122
2721
|
* @param {Reaction} signal
|
|
3123
2722
|
* @param {Value<V>} dependency
|
|
@@ -3302,7 +2901,7 @@ function untrack(fn) {
|
|
|
3302
2901
|
}
|
|
3303
2902
|
}
|
|
3304
2903
|
//#endregion
|
|
3305
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2904
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
3306
2905
|
/**
|
|
3307
2906
|
* Used on elements, as a map of event type -> event handler,
|
|
3308
2907
|
* and on events themselves to track which element handled an event
|
|
@@ -3370,6 +2969,7 @@ function delegate(events) {
|
|
|
3370
2969
|
for (var fn of root_event_handles) fn(events);
|
|
3371
2970
|
}
|
|
3372
2971
|
var last_propagated_event = null;
|
|
2972
|
+
var last_propagated_event_clear_scheduled = false;
|
|
3373
2973
|
/**
|
|
3374
2974
|
* @this {EventTarget}
|
|
3375
2975
|
* @param {Event} event
|
|
@@ -3382,6 +2982,13 @@ function handle_event_propagation(event) {
|
|
|
3382
2982
|
var path = event.composedPath?.() || [];
|
|
3383
2983
|
var current_target = path[0] || event.target;
|
|
3384
2984
|
last_propagated_event = event;
|
|
2985
|
+
if (!last_propagated_event_clear_scheduled) {
|
|
2986
|
+
last_propagated_event_clear_scheduled = true;
|
|
2987
|
+
setTimeout(() => {
|
|
2988
|
+
last_propagated_event_clear_scheduled = false;
|
|
2989
|
+
last_propagated_event = null;
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
3385
2992
|
var path_idx = 0;
|
|
3386
2993
|
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
3387
2994
|
if (handled_at) {
|
|
@@ -3442,7 +3049,7 @@ function handle_event_propagation(event) {
|
|
|
3442
3049
|
}
|
|
3443
3050
|
}
|
|
3444
3051
|
//#endregion
|
|
3445
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3052
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
3446
3053
|
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
3447
3054
|
/** @param {string} html */
|
|
3448
3055
|
createHTML: (html) => {
|
|
@@ -3461,7 +3068,7 @@ function create_fragment_from_html(html) {
|
|
|
3461
3068
|
return elem.content;
|
|
3462
3069
|
}
|
|
3463
3070
|
//#endregion
|
|
3464
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3071
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/template.js
|
|
3465
3072
|
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
3466
3073
|
/** @import { TemplateStructure } from './types' */
|
|
3467
3074
|
/**
|
|
@@ -3605,6 +3212,462 @@ var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
|
|
3605
3212
|
function is_passive_event(name) {
|
|
3606
3213
|
return PASSIVE_EVENTS.includes(name);
|
|
3607
3214
|
}
|
|
3215
|
+
//#endregion
|
|
3216
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/reactivity/create-subscriber.js
|
|
3217
|
+
/**
|
|
3218
|
+
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
3219
|
+
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
3220
|
+
*
|
|
3221
|
+
* If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
|
|
3222
|
+
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
3223
|
+
*
|
|
3224
|
+
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
3225
|
+
*
|
|
3226
|
+
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
3227
|
+
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
3228
|
+
*
|
|
3229
|
+
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
3230
|
+
*
|
|
3231
|
+
* ```js
|
|
3232
|
+
* import { createSubscriber } from 'svelte/reactivity';
|
|
3233
|
+
* import { on } from 'svelte/events';
|
|
3234
|
+
*
|
|
3235
|
+
* export class MediaQuery {
|
|
3236
|
+
* #query;
|
|
3237
|
+
* #subscribe;
|
|
3238
|
+
*
|
|
3239
|
+
* constructor(query) {
|
|
3240
|
+
* this.#query = window.matchMedia(`(${query})`);
|
|
3241
|
+
*
|
|
3242
|
+
* this.#subscribe = createSubscriber((update) => {
|
|
3243
|
+
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
3244
|
+
* const off = on(this.#query, 'change', update);
|
|
3245
|
+
*
|
|
3246
|
+
* // stop listening when all the effects are destroyed
|
|
3247
|
+
* return () => off();
|
|
3248
|
+
* });
|
|
3249
|
+
* }
|
|
3250
|
+
*
|
|
3251
|
+
* get current() {
|
|
3252
|
+
* // This makes the getter reactive, if read in an effect
|
|
3253
|
+
* this.#subscribe();
|
|
3254
|
+
*
|
|
3255
|
+
* // Return the current state of the query, whether or not we're in an effect
|
|
3256
|
+
* return this.#query.matches;
|
|
3257
|
+
* }
|
|
3258
|
+
* }
|
|
3259
|
+
* ```
|
|
3260
|
+
* @param {(update: () => void) => (() => void) | void} start
|
|
3261
|
+
* @since 5.7.0
|
|
3262
|
+
*/
|
|
3263
|
+
function createSubscriber(start) {
|
|
3264
|
+
let subscribers = 0;
|
|
3265
|
+
let version = source(0);
|
|
3266
|
+
/** @type {(() => void) | void} */
|
|
3267
|
+
let stop;
|
|
3268
|
+
return () => {
|
|
3269
|
+
if (effect_tracking()) {
|
|
3270
|
+
get(version);
|
|
3271
|
+
render_effect(() => {
|
|
3272
|
+
if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
|
|
3273
|
+
subscribers += 1;
|
|
3274
|
+
return () => {
|
|
3275
|
+
queue_micro_task(() => {
|
|
3276
|
+
subscribers -= 1;
|
|
3277
|
+
if (subscribers === 0) {
|
|
3278
|
+
stop?.();
|
|
3279
|
+
stop = void 0;
|
|
3280
|
+
increment(version);
|
|
3281
|
+
}
|
|
3282
|
+
});
|
|
3283
|
+
};
|
|
3284
|
+
});
|
|
3285
|
+
}
|
|
3286
|
+
};
|
|
3287
|
+
}
|
|
3288
|
+
//#endregion
|
|
3289
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
3290
|
+
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
3291
|
+
/**
|
|
3292
|
+
* @typedef {{
|
|
3293
|
+
* onerror?: ((error: unknown, reset: () => void) => void) | null;
|
|
3294
|
+
* failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
|
|
3295
|
+
* pending?: ((anchor: Node) => void) | null;
|
|
3296
|
+
* }} BoundaryProps
|
|
3297
|
+
*/
|
|
3298
|
+
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
|
|
3299
|
+
/**
|
|
3300
|
+
* @param {TemplateNode} node
|
|
3301
|
+
* @param {BoundaryProps} props
|
|
3302
|
+
* @param {((anchor: Node) => void)} children
|
|
3303
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
3304
|
+
* @returns {void}
|
|
3305
|
+
*/
|
|
3306
|
+
function boundary(node, props, children, transform_error) {
|
|
3307
|
+
new Boundary(node, props, children, transform_error);
|
|
3308
|
+
}
|
|
3309
|
+
var _anchor = /* @__PURE__ */ new WeakMap();
|
|
3310
|
+
var _hydrate_open = /* @__PURE__ */ new WeakMap();
|
|
3311
|
+
var _props = /* @__PURE__ */ new WeakMap();
|
|
3312
|
+
var _children = /* @__PURE__ */ new WeakMap();
|
|
3313
|
+
var _effect = /* @__PURE__ */ new WeakMap();
|
|
3314
|
+
var _main_effect = /* @__PURE__ */ new WeakMap();
|
|
3315
|
+
var _pending_effect = /* @__PURE__ */ new WeakMap();
|
|
3316
|
+
var _failed_effect = /* @__PURE__ */ new WeakMap();
|
|
3317
|
+
var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
|
|
3318
|
+
var _local_pending_count = /* @__PURE__ */ new WeakMap();
|
|
3319
|
+
var _pending_count = /* @__PURE__ */ new WeakMap();
|
|
3320
|
+
var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
|
|
3321
|
+
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
3322
|
+
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
3323
|
+
var _effect_pending = /* @__PURE__ */ new WeakMap();
|
|
3324
|
+
var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
|
|
3325
|
+
var _Boundary_brand = /* @__PURE__ */ new WeakSet();
|
|
3326
|
+
var Boundary = class {
|
|
3327
|
+
/**
|
|
3328
|
+
* @param {TemplateNode} node
|
|
3329
|
+
* @param {BoundaryProps} props
|
|
3330
|
+
* @param {((anchor: Node) => void)} children
|
|
3331
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
3332
|
+
*/
|
|
3333
|
+
constructor(node, props, children, transform_error) {
|
|
3334
|
+
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
3335
|
+
_defineProperty(
|
|
3336
|
+
this,
|
|
3337
|
+
/** @type {Boundary | null} */
|
|
3338
|
+
"parent",
|
|
3339
|
+
void 0
|
|
3340
|
+
);
|
|
3341
|
+
_defineProperty(this, "is_pending", false);
|
|
3342
|
+
_defineProperty(
|
|
3343
|
+
this,
|
|
3344
|
+
/**
|
|
3345
|
+
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
3346
|
+
* Inherited from parent boundary, or defaults to identity.
|
|
3347
|
+
* @type {(error: unknown) => unknown}
|
|
3348
|
+
*/
|
|
3349
|
+
"transform_error",
|
|
3350
|
+
void 0
|
|
3351
|
+
);
|
|
3352
|
+
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
3353
|
+
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
3354
|
+
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
3355
|
+
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
3356
|
+
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
3357
|
+
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
3358
|
+
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
3359
|
+
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
3360
|
+
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
3361
|
+
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
3362
|
+
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
3363
|
+
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
3364
|
+
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
3365
|
+
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
3366
|
+
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
3367
|
+
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
3368
|
+
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
3369
|
+
return () => {
|
|
3370
|
+
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
3371
|
+
};
|
|
3372
|
+
}));
|
|
3373
|
+
_classPrivateFieldSet2(_anchor, this, node);
|
|
3374
|
+
_classPrivateFieldSet2(_props, this, props);
|
|
3375
|
+
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
3376
|
+
var effect = active_effect;
|
|
3377
|
+
effect.b = this;
|
|
3378
|
+
effect.f |= 128;
|
|
3379
|
+
children(anchor);
|
|
3380
|
+
});
|
|
3381
|
+
this.parent = active_effect.b;
|
|
3382
|
+
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
3383
|
+
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
3384
|
+
if (hydrating) {
|
|
3385
|
+
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
3386
|
+
hydrate_next();
|
|
3387
|
+
const server_rendered_pending = comment.data === "[!";
|
|
3388
|
+
if (comment.data.startsWith("[?")) {
|
|
3389
|
+
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
3390
|
+
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
3391
|
+
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
3392
|
+
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
3393
|
+
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
3394
|
+
}, flags));
|
|
3395
|
+
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
3399
|
+
* @param {Effect} effect
|
|
3400
|
+
*/
|
|
3401
|
+
defer_effect(effect) {
|
|
3402
|
+
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
3406
|
+
* @returns {boolean}
|
|
3407
|
+
*/
|
|
3408
|
+
is_rendered() {
|
|
3409
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
3410
|
+
}
|
|
3411
|
+
has_pending_snippet() {
|
|
3412
|
+
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
3416
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
3417
|
+
* Do not call from inside the class
|
|
3418
|
+
* @param {1 | -1} d
|
|
3419
|
+
* @param {Batch} batch
|
|
3420
|
+
*/
|
|
3421
|
+
update_pending_count(d, batch) {
|
|
3422
|
+
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
3423
|
+
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
3424
|
+
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
3425
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
3426
|
+
queue_micro_task(() => {
|
|
3427
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
3428
|
+
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
3429
|
+
});
|
|
3430
|
+
}
|
|
3431
|
+
get_effect_pending() {
|
|
3432
|
+
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
3433
|
+
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
3434
|
+
}
|
|
3435
|
+
/** @param {unknown} error */
|
|
3436
|
+
error(error) {
|
|
3437
|
+
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
3438
|
+
if (current_batch?.is_fork) {
|
|
3439
|
+
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
3440
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
3441
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
3442
|
+
current_batch.oncommit(() => {
|
|
3443
|
+
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
3444
|
+
});
|
|
3445
|
+
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
3446
|
+
}
|
|
3447
|
+
};
|
|
3448
|
+
function _hydrate_resolved_content() {
|
|
3449
|
+
try {
|
|
3450
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
|
|
3451
|
+
} catch (error) {
|
|
3452
|
+
this.error(error);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
/**
|
|
3456
|
+
* @param {unknown} error The deserialized error from the server's hydration comment
|
|
3457
|
+
*/
|
|
3458
|
+
function _hydrate_failed_content(error) {
|
|
3459
|
+
const failed = _classPrivateFieldGet2(_props, this).failed;
|
|
3460
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
|
|
3461
|
+
queue_micro_task(invoke_onerror);
|
|
3462
|
+
if (!failed) return;
|
|
3463
|
+
_classPrivateFieldSet2(_failed_effect, this, branch(() => {
|
|
3464
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
|
|
3465
|
+
}));
|
|
3466
|
+
}
|
|
3467
|
+
/**
|
|
3468
|
+
* Creates the `reset` function for a failed boundary, along with a function
|
|
3469
|
+
* that invokes `onerror` with it (if provided)
|
|
3470
|
+
* @param {unknown} error
|
|
3471
|
+
* @returns {{ reset: () => void, invoke_onerror: () => void }}
|
|
3472
|
+
*/
|
|
3473
|
+
function _create_reset(error) {
|
|
3474
|
+
var did_reset = false;
|
|
3475
|
+
var calling_on_error = false;
|
|
3476
|
+
const reset = () => {
|
|
3477
|
+
if (did_reset) {
|
|
3478
|
+
svelte_boundary_reset_noop();
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3481
|
+
did_reset = true;
|
|
3482
|
+
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
3483
|
+
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
3484
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
3485
|
+
});
|
|
3486
|
+
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3487
|
+
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
3488
|
+
});
|
|
3489
|
+
};
|
|
3490
|
+
const invoke_onerror = () => {
|
|
3491
|
+
try {
|
|
3492
|
+
calling_on_error = true;
|
|
3493
|
+
_classPrivateFieldGet2(_props, this).onerror?.(error, reset);
|
|
3494
|
+
calling_on_error = false;
|
|
3495
|
+
} catch (err) {
|
|
3496
|
+
invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
3497
|
+
}
|
|
3498
|
+
};
|
|
3499
|
+
return {
|
|
3500
|
+
reset,
|
|
3501
|
+
invoke_onerror
|
|
3502
|
+
};
|
|
3503
|
+
}
|
|
3504
|
+
function _hydrate_pending_content() {
|
|
3505
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
3506
|
+
if (!pending) return;
|
|
3507
|
+
this.is_pending = true;
|
|
3508
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
3509
|
+
queue_micro_task(() => {
|
|
3510
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
3511
|
+
var anchor = create_text();
|
|
3512
|
+
var handled = false;
|
|
3513
|
+
fragment.append(anchor);
|
|
3514
|
+
_classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3515
|
+
try {
|
|
3516
|
+
return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
|
|
3517
|
+
} catch (error) {
|
|
3518
|
+
try {
|
|
3519
|
+
this.error(error);
|
|
3520
|
+
handled = true;
|
|
3521
|
+
} catch (error) {
|
|
3522
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
3523
|
+
}
|
|
3524
|
+
return null;
|
|
3525
|
+
}
|
|
3526
|
+
}));
|
|
3527
|
+
if (_classPrivateFieldGet2(_main_effect, this) === null) {
|
|
3528
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3529
|
+
if (handled) _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3530
|
+
return;
|
|
3531
|
+
}
|
|
3532
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
3533
|
+
_classPrivateFieldGet2(_anchor, this).before(fragment);
|
|
3534
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3535
|
+
pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
3536
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3537
|
+
});
|
|
3538
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3539
|
+
}
|
|
3540
|
+
});
|
|
3541
|
+
}
|
|
3542
|
+
function _render() {
|
|
3543
|
+
try {
|
|
3544
|
+
this.is_pending = this.has_pending_snippet();
|
|
3545
|
+
_classPrivateFieldSet2(_pending_count, this, 0);
|
|
3546
|
+
_classPrivateFieldSet2(_local_pending_count, this, 0);
|
|
3547
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => {
|
|
3548
|
+
_classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
|
|
3549
|
+
}));
|
|
3550
|
+
if (_classPrivateFieldGet2(_pending_count, this) > 0) {
|
|
3551
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
3552
|
+
move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
|
|
3553
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
3554
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
3555
|
+
} else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3556
|
+
} catch (error) {
|
|
3557
|
+
this.error(error);
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
/**
|
|
3561
|
+
* @param {Batch} batch
|
|
3562
|
+
*/
|
|
3563
|
+
function _resolve(batch) {
|
|
3564
|
+
this.is_pending = false;
|
|
3565
|
+
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
3566
|
+
}
|
|
3567
|
+
/**
|
|
3568
|
+
* @template T
|
|
3569
|
+
* @param {() => T} fn
|
|
3570
|
+
*/
|
|
3571
|
+
function _run(fn) {
|
|
3572
|
+
var previous_effect = active_effect;
|
|
3573
|
+
var previous_reaction = active_reaction;
|
|
3574
|
+
var previous_ctx = component_context;
|
|
3575
|
+
set_active_effect(_classPrivateFieldGet2(_effect, this));
|
|
3576
|
+
set_active_reaction(_classPrivateFieldGet2(_effect, this));
|
|
3577
|
+
set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
|
|
3578
|
+
try {
|
|
3579
|
+
Batch.ensure();
|
|
3580
|
+
return fn();
|
|
3581
|
+
} finally {
|
|
3582
|
+
set_active_effect(previous_effect);
|
|
3583
|
+
set_active_reaction(previous_reaction);
|
|
3584
|
+
set_component_context(previous_ctx);
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
/**
|
|
3588
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
3589
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
3590
|
+
* @param {1 | -1} d
|
|
3591
|
+
* @param {Batch} batch
|
|
3592
|
+
*/
|
|
3593
|
+
function _update_pending_count(d, batch) {
|
|
3594
|
+
if (!this.has_pending_snippet()) {
|
|
3595
|
+
if (this.parent) {
|
|
3596
|
+
var _this$parent;
|
|
3597
|
+
_assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
|
|
3598
|
+
}
|
|
3599
|
+
return;
|
|
3600
|
+
}
|
|
3601
|
+
_classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
|
|
3602
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
3603
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
|
|
3604
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
3605
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3606
|
+
});
|
|
3607
|
+
if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
|
|
3608
|
+
_classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
|
|
3609
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
/**
|
|
3614
|
+
* @param {unknown} error
|
|
3615
|
+
*/
|
|
3616
|
+
function _handle_error(error) {
|
|
3617
|
+
if (_classPrivateFieldGet2(_main_effect, this)) {
|
|
3618
|
+
destroy_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
3619
|
+
_classPrivateFieldSet2(_main_effect, this, null);
|
|
3620
|
+
}
|
|
3621
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
3622
|
+
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
3623
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3624
|
+
}
|
|
3625
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
3626
|
+
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
3627
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
3628
|
+
}
|
|
3629
|
+
if (hydrating) {
|
|
3630
|
+
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
3631
|
+
next();
|
|
3632
|
+
set_hydrate_node(skip_nodes());
|
|
3633
|
+
}
|
|
3634
|
+
let failed = _classPrivateFieldGet2(_props, this).failed;
|
|
3635
|
+
/** @param {unknown} transformed_error */
|
|
3636
|
+
const handle_error_result = (transformed_error) => {
|
|
3637
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
|
|
3638
|
+
invoke_onerror();
|
|
3639
|
+
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3640
|
+
try {
|
|
3641
|
+
return branch(() => {
|
|
3642
|
+
var effect = active_effect;
|
|
3643
|
+
effect.b = this;
|
|
3644
|
+
effect.f |= 128;
|
|
3645
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
3646
|
+
});
|
|
3647
|
+
} catch (error) {
|
|
3648
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
3649
|
+
return null;
|
|
3650
|
+
}
|
|
3651
|
+
}));
|
|
3652
|
+
};
|
|
3653
|
+
queue_micro_task(() => {
|
|
3654
|
+
/** @type {unknown} */
|
|
3655
|
+
var result;
|
|
3656
|
+
try {
|
|
3657
|
+
result = this.transform_error(error);
|
|
3658
|
+
} catch (e) {
|
|
3659
|
+
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
3660
|
+
return;
|
|
3661
|
+
}
|
|
3662
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
3663
|
+
/** @type {any} */ result.then(
|
|
3664
|
+
handle_error_result,
|
|
3665
|
+
/** @param {unknown} e */
|
|
3666
|
+
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
3667
|
+
);
|
|
3668
|
+
else handle_error_result(result);
|
|
3669
|
+
});
|
|
3670
|
+
}
|
|
3608
3671
|
/**
|
|
3609
3672
|
* @param {Element} text
|
|
3610
3673
|
* @param {string} value
|
|
@@ -3707,7 +3770,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
3707
3770
|
if (events)
|
|
3708
3771
|
/** @type {any} */ props.$$events = events;
|
|
3709
3772
|
if (hydrating) assign_nodes(anchor_node, null);
|
|
3710
|
-
component = Component(anchor_node, props) ||
|
|
3773
|
+
component = Component(anchor_node, props) || mark_as_component();
|
|
3711
3774
|
if (hydrating) {
|
|
3712
3775
|
/** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node;
|
|
3713
3776
|
if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") {
|
|
@@ -3793,7 +3856,7 @@ function unmount(component, options) {
|
|
|
3793
3856
|
return Promise.resolve();
|
|
3794
3857
|
}
|
|
3795
3858
|
//#endregion
|
|
3796
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3859
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/branches.js
|
|
3797
3860
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
3798
3861
|
var _batches = /* @__PURE__ */ new WeakMap();
|
|
3799
3862
|
var _onscreen = /* @__PURE__ */ new WeakMap();
|
|
@@ -3916,7 +3979,7 @@ var BranchManager = class {
|
|
|
3916
3979
|
}
|
|
3917
3980
|
};
|
|
3918
3981
|
//#endregion
|
|
3919
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3982
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/snippet.js
|
|
3920
3983
|
/** @import { Snippet } from 'svelte' */
|
|
3921
3984
|
/** @import { TemplateNode } from '#client' */
|
|
3922
3985
|
/** @import { Getters } from '#shared' */
|
|
@@ -4037,7 +4100,7 @@ function init_update_callbacks(context) {
|
|
|
4037
4100
|
});
|
|
4038
4101
|
}
|
|
4039
4102
|
//#endregion
|
|
4040
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4103
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/if.js
|
|
4041
4104
|
/** @import { TemplateNode } from '#client' */
|
|
4042
4105
|
/**
|
|
4043
4106
|
* @param {TemplateNode} node
|
|
@@ -4083,7 +4146,7 @@ function if_block(node, fn, elseif = false) {
|
|
|
4083
4146
|
}, flags);
|
|
4084
4147
|
}
|
|
4085
4148
|
//#endregion
|
|
4086
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4149
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/each.js
|
|
4087
4150
|
/** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
4088
4151
|
/** @import { Batch } from '../../reactivity/batch.js'; */
|
|
4089
4152
|
/**
|
|
@@ -4123,7 +4186,7 @@ function pause_effects(state, to_destroy, controlled_anchor) {
|
|
|
4123
4186
|
}, false);
|
|
4124
4187
|
}
|
|
4125
4188
|
if (remaining === 0) {
|
|
4126
|
-
var fast_path = transitions.length === 0 && controlled_anchor !== null;
|
|
4189
|
+
var fast_path = transitions.length === 0 && controlled_anchor !== null && state.pending.size === 0;
|
|
4127
4190
|
if (fast_path) {
|
|
4128
4191
|
var anchor = controlled_anchor;
|
|
4129
4192
|
var parent_node = anchor.parentNode;
|
|
@@ -4555,13 +4618,14 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
|
|
|
4555
4618
|
});
|
|
4556
4619
|
}
|
|
4557
4620
|
//#endregion
|
|
4558
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4621
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/css.js
|
|
4559
4622
|
/**
|
|
4560
4623
|
* @param {Node} anchor
|
|
4561
4624
|
* @param {{ hash: string, code: string }} css
|
|
4562
4625
|
*/
|
|
4563
4626
|
function append_styles$1(anchor, css) {
|
|
4564
4627
|
effect(() => {
|
|
4628
|
+
anchor = active_effect?.parent?.nodes?.start ?? anchor;
|
|
4565
4629
|
var root = anchor.getRootNode();
|
|
4566
4630
|
var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
|
|
4567
4631
|
if (!target.querySelector("#" + css.hash)) {
|
|
@@ -4573,7 +4637,7 @@ function append_styles$1(anchor, css) {
|
|
|
4573
4637
|
});
|
|
4574
4638
|
}
|
|
4575
4639
|
//#endregion
|
|
4576
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4640
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/attributes.js
|
|
4577
4641
|
var whitespace$1 = [..." \n\r\f\xA0\v"];
|
|
4578
4642
|
/**
|
|
4579
4643
|
* @param {any} value
|
|
@@ -4637,7 +4701,7 @@ function to_style(value, styles) {
|
|
|
4637
4701
|
important_styles = styles[1];
|
|
4638
4702
|
} else normal_styles = styles;
|
|
4639
4703
|
if (value) {
|
|
4640
|
-
value = String(value).replaceAll(
|
|
4704
|
+
value = String(value).replaceAll(/\/\*.*?\*\//g, "").trim();
|
|
4641
4705
|
/** @type {boolean | '"' | "'"} */
|
|
4642
4706
|
var in_str = false;
|
|
4643
4707
|
var in_apo = 0;
|
|
@@ -4683,7 +4747,7 @@ function to_style(value, styles) {
|
|
|
4683
4747
|
return value == null ? null : String(value);
|
|
4684
4748
|
}
|
|
4685
4749
|
//#endregion
|
|
4686
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4750
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/class.js
|
|
4687
4751
|
/**
|
|
4688
4752
|
* @param {Element} dom
|
|
4689
4753
|
* @param {boolean | number} is_html
|
|
@@ -4708,7 +4772,7 @@ function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
|
|
|
4708
4772
|
return next_classes;
|
|
4709
4773
|
}
|
|
4710
4774
|
//#endregion
|
|
4711
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4775
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/style.js
|
|
4712
4776
|
/**
|
|
4713
4777
|
* @param {Element & ElementCSSInlineStyle} dom
|
|
4714
4778
|
* @param {Record<string, any>} prev
|
|
@@ -4742,7 +4806,7 @@ function set_style(dom, value, prev_styles, next_styles) {
|
|
|
4742
4806
|
return next_styles;
|
|
4743
4807
|
}
|
|
4744
4808
|
//#endregion
|
|
4745
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4809
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/attributes.js
|
|
4746
4810
|
/** @import { Blocker, Effect } from '#client' */
|
|
4747
4811
|
var IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
4748
4812
|
var IS_HTML = Symbol("is html");
|
|
@@ -4811,7 +4875,7 @@ function set_attribute(element, attribute, value, skip_warning) {
|
|
|
4811
4875
|
if (attributes[attribute] === (attributes[attribute] = value)) return;
|
|
4812
4876
|
if (attribute === "loading") element[LOADING_ATTR_SYMBOL] = value;
|
|
4813
4877
|
if (value == null) element.removeAttribute(attribute);
|
|
4814
|
-
else if (typeof value !== "string" && get_setters(element).
|
|
4878
|
+
else if (typeof value !== "string" && get_setters(element).has(attribute)) element[attribute] = value;
|
|
4815
4879
|
else element.setAttribute(attribute, value);
|
|
4816
4880
|
}
|
|
4817
4881
|
/**
|
|
@@ -4824,26 +4888,26 @@ function get_attributes(element) {
|
|
|
4824
4888
|
[IS_HTML]: element.namespaceURI === "http://www.w3.org/1999/xhtml"
|
|
4825
4889
|
});
|
|
4826
4890
|
}
|
|
4827
|
-
/** @type {Map<string, string
|
|
4891
|
+
/** @type {Map<string, Set<string>>} */
|
|
4828
4892
|
var setters_cache = /* @__PURE__ */ new Map();
|
|
4829
4893
|
/** @param {Element} element */
|
|
4830
4894
|
function get_setters(element) {
|
|
4831
4895
|
var cache_key = element.getAttribute("is") || element.nodeName;
|
|
4832
4896
|
var setters = setters_cache.get(cache_key);
|
|
4833
4897
|
if (setters) return setters;
|
|
4834
|
-
setters_cache.set(cache_key, setters =
|
|
4898
|
+
setters_cache.set(cache_key, setters = /* @__PURE__ */ new Set());
|
|
4835
4899
|
var descriptors;
|
|
4836
4900
|
var proto = element;
|
|
4837
4901
|
var element_proto = Element.prototype;
|
|
4838
4902
|
while (element_proto !== proto) {
|
|
4839
4903
|
descriptors = get_descriptors(proto);
|
|
4840
|
-
for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.
|
|
4904
|
+
for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.add(key);
|
|
4841
4905
|
proto = get_prototype_of(proto);
|
|
4842
4906
|
}
|
|
4843
4907
|
return setters;
|
|
4844
4908
|
}
|
|
4845
4909
|
//#endregion
|
|
4846
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4910
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
4847
4911
|
var _ResizeObserverSingleton;
|
|
4848
4912
|
var _listeners = /* @__PURE__ */ new WeakMap();
|
|
4849
4913
|
var _observer = /* @__PURE__ */ new WeakMap();
|
|
@@ -4908,7 +4972,7 @@ function bind_element_size(element, type, set) {
|
|
|
4908
4972
|
});
|
|
4909
4973
|
}
|
|
4910
4974
|
//#endregion
|
|
4911
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4975
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
|
|
4912
4976
|
/** @import { ComponentContext, Effect } from '#client' */
|
|
4913
4977
|
/**
|
|
4914
4978
|
* @param {any} bound_value
|
|
@@ -4926,7 +4990,7 @@ function is_bound_this(bound_value, element_or_component) {
|
|
|
4926
4990
|
* returns all the parts of the each block context that are used in the expression
|
|
4927
4991
|
* @returns {void}
|
|
4928
4992
|
*/
|
|
4929
|
-
function bind_this(element_or_component =
|
|
4993
|
+
function bind_this(element_or_component = mark_as_component(), update, get_value, get_parts) {
|
|
4930
4994
|
var component_effect = component_context.r;
|
|
4931
4995
|
var parent = active_effect;
|
|
4932
4996
|
effect(() => {
|
|
@@ -5050,7 +5114,7 @@ function prop(props, key, flags, fallback) {
|
|
|
5050
5114
|
});
|
|
5051
5115
|
}
|
|
5052
5116
|
//#endregion
|
|
5053
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
5117
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/legacy/legacy-client.js
|
|
5054
5118
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
5055
5119
|
/**
|
|
5056
5120
|
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
|
|
@@ -5169,7 +5233,7 @@ var Svelte4Component = class {
|
|
|
5169
5233
|
}
|
|
5170
5234
|
};
|
|
5171
5235
|
//#endregion
|
|
5172
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
5236
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
5173
5237
|
/**
|
|
5174
5238
|
* @typedef {Object} CustomElementPropDefinition
|
|
5175
5239
|
* @property {string} [attribute]
|
|
@@ -37187,7 +37251,7 @@ var Gapcursor$1 = Extension.create({
|
|
|
37187
37251
|
});
|
|
37188
37252
|
var DEFAULT_DATA_ATTRIBUTE$1 = "placeholder";
|
|
37189
37253
|
var PLUGIN_KEY$1 = new PluginKey("tiptap__placeholder");
|
|
37190
|
-
var VIEWPORT_OVERSCAN_PX
|
|
37254
|
+
var VIEWPORT_OVERSCAN_PX = 200;
|
|
37191
37255
|
function createPlaceholderDecoration$1(options) {
|
|
37192
37256
|
const { editor, placeholder, dataAttribute, pos, node, isEmptyDoc, hasAnchor, classes: { emptyNode, emptyEditor } } = options;
|
|
37193
37257
|
const classes = [emptyNode];
|
|
@@ -37255,15 +37319,15 @@ function buildPlaceholderDecorations$1({ editor, options, dataAttribute, doc, se
|
|
|
37255
37319
|
function preparePlaceholderAttribute$1(attr) {
|
|
37256
37320
|
return attr.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
37257
37321
|
}
|
|
37258
|
-
function isScrollable
|
|
37322
|
+
function isScrollable(el) {
|
|
37259
37323
|
const style = getComputedStyle(el);
|
|
37260
37324
|
const overflow = `${style.overflow} ${style.overflowY} ${style.overflowX}`;
|
|
37261
37325
|
return /auto|scroll|overlay/.test(overflow);
|
|
37262
37326
|
}
|
|
37263
|
-
function findScrollParent
|
|
37327
|
+
function findScrollParent(element) {
|
|
37264
37328
|
let el = element;
|
|
37265
37329
|
while (el) {
|
|
37266
|
-
if (isScrollable
|
|
37330
|
+
if (isScrollable(el)) return el;
|
|
37267
37331
|
const parent = el.parentElement;
|
|
37268
37332
|
if (!parent) {
|
|
37269
37333
|
const root = el.getRootNode();
|
|
@@ -37277,21 +37341,21 @@ function findScrollParent$1(element) {
|
|
|
37277
37341
|
}
|
|
37278
37342
|
return window;
|
|
37279
37343
|
}
|
|
37280
|
-
function getContainerRect
|
|
37344
|
+
function getContainerRect(container) {
|
|
37281
37345
|
if (container === window) return {
|
|
37282
37346
|
top: 0,
|
|
37283
37347
|
bottom: window.innerHeight
|
|
37284
37348
|
};
|
|
37285
37349
|
return container.getBoundingClientRect();
|
|
37286
37350
|
}
|
|
37287
|
-
function getViewportBoundaryPositions
|
|
37351
|
+
function getViewportBoundaryPositions({ doc, view, scrollContainer }) {
|
|
37288
37352
|
const editorRect = view.dom.getBoundingClientRect();
|
|
37289
|
-
const containerRect = scrollContainer ? getContainerRect
|
|
37353
|
+
const containerRect = scrollContainer ? getContainerRect(scrollContainer) : {
|
|
37290
37354
|
top: 0,
|
|
37291
37355
|
bottom: window.innerHeight
|
|
37292
37356
|
};
|
|
37293
|
-
const visibleTop = Math.max(editorRect.top, containerRect.top) - VIEWPORT_OVERSCAN_PX
|
|
37294
|
-
const visibleBottom = Math.min(editorRect.bottom, containerRect.bottom) + VIEWPORT_OVERSCAN_PX
|
|
37357
|
+
const visibleTop = Math.max(editorRect.top, containerRect.top) - VIEWPORT_OVERSCAN_PX;
|
|
37358
|
+
const visibleBottom = Math.min(editorRect.bottom, containerRect.bottom) + VIEWPORT_OVERSCAN_PX;
|
|
37295
37359
|
if (visibleTop >= visibleBottom) return {
|
|
37296
37360
|
top: 0,
|
|
37297
37361
|
bottom: doc.content.size
|
|
@@ -37310,7 +37374,7 @@ function getViewportBoundaryPositions$1({ doc, view, scrollContainer }) {
|
|
|
37310
37374
|
bottom: bottomPos ? bottomPos.pos : doc.content.size
|
|
37311
37375
|
};
|
|
37312
37376
|
}
|
|
37313
|
-
var viewportPluginState
|
|
37377
|
+
var viewportPluginState = {
|
|
37314
37378
|
/**
|
|
37315
37379
|
* Initialises the viewport state with no known positions.
|
|
37316
37380
|
* @returns The initial viewport state.
|
|
@@ -37340,10 +37404,10 @@ var viewportPluginState$1 = {
|
|
|
37340
37404
|
};
|
|
37341
37405
|
}
|
|
37342
37406
|
};
|
|
37343
|
-
function createViewportPluginView
|
|
37344
|
-
const scrollContainer = findScrollParent
|
|
37407
|
+
function createViewportPluginView(view) {
|
|
37408
|
+
const scrollContainer = findScrollParent(view.dom);
|
|
37345
37409
|
const computeAndDispatch = () => {
|
|
37346
|
-
const positions = getViewportBoundaryPositions
|
|
37410
|
+
const positions = getViewportBoundaryPositions({
|
|
37347
37411
|
view,
|
|
37348
37412
|
doc: view.state.doc,
|
|
37349
37413
|
scrollContainer
|
|
@@ -37383,8 +37447,8 @@ function createPlaceholderPlugin$1({ editor, options }) {
|
|
|
37383
37447
|
const dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute$1(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE$1}`;
|
|
37384
37448
|
return new Plugin({
|
|
37385
37449
|
key: PLUGIN_KEY$1,
|
|
37386
|
-
state: viewportPluginState
|
|
37387
|
-
view: createViewportPluginView
|
|
37450
|
+
state: viewportPluginState,
|
|
37451
|
+
view: createViewportPluginView,
|
|
37388
37452
|
props: { decorations: ({ doc, selection }) => buildPlaceholderDecorations$1({
|
|
37389
37453
|
editor,
|
|
37390
37454
|
options,
|
|
@@ -37509,7 +37573,7 @@ var UndoRedo$1 = Extension.create({
|
|
|
37509
37573
|
};
|
|
37510
37574
|
}
|
|
37511
37575
|
});
|
|
37512
|
-
var index_default$
|
|
37576
|
+
var index_default$4 = Extension.create({
|
|
37513
37577
|
name: "starterKit",
|
|
37514
37578
|
addExtensions() {
|
|
37515
37579
|
var _a, _b, _c, _d;
|
|
@@ -37794,7 +37858,11 @@ Extension$1.create({
|
|
|
37794
37858
|
}
|
|
37795
37859
|
});
|
|
37796
37860
|
//#endregion
|
|
37797
|
-
//#region ../../../node_modules/.bun/@tiptap+extensions@3.
|
|
37861
|
+
//#region ../../../node_modules/.bun/@tiptap+extensions@3.31.3+a55e136bd95da1c1/node_modules/@tiptap/extensions/dist/index.js
|
|
37862
|
+
/**
|
|
37863
|
+
* This extension allows you to count the characters and words of your document.
|
|
37864
|
+
* @see https://tiptap.dev/api/extensions/character-count
|
|
37865
|
+
*/
|
|
37798
37866
|
var CharacterCount = Extension$1.create({
|
|
37799
37867
|
name: "characterCount",
|
|
37800
37868
|
addOptions() {
|
|
@@ -37814,15 +37882,15 @@ var CharacterCount = Extension$1.create({
|
|
|
37814
37882
|
},
|
|
37815
37883
|
onBeforeCreate() {
|
|
37816
37884
|
this.storage.characters = (options) => {
|
|
37817
|
-
const node = (options
|
|
37818
|
-
if (((options
|
|
37885
|
+
const node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;
|
|
37886
|
+
if (((options === null || options === void 0 ? void 0 : options.mode) || this.options.mode) === "textSize") {
|
|
37819
37887
|
const text = node.textBetween(0, node.content.size, void 0, " ");
|
|
37820
37888
|
return this.options.textCounter(text);
|
|
37821
37889
|
}
|
|
37822
37890
|
return node.nodeSize;
|
|
37823
37891
|
};
|
|
37824
37892
|
this.storage.words = (options) => {
|
|
37825
|
-
const node = (options
|
|
37893
|
+
const node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;
|
|
37826
37894
|
const text = node.textBetween(0, node.content.size, " ", " ");
|
|
37827
37895
|
return this.options.wordCounter(text);
|
|
37828
37896
|
};
|
|
@@ -37924,17 +37992,31 @@ Extension$1.create({
|
|
|
37924
37992
|
return [gapCursor()];
|
|
37925
37993
|
},
|
|
37926
37994
|
extendNodeSchema(extension) {
|
|
37927
|
-
var
|
|
37928
|
-
return { allowGapCursor: (
|
|
37995
|
+
var _callOrReturn;
|
|
37996
|
+
return { allowGapCursor: (_callOrReturn = callOrReturn$1(getExtensionField$1(extension, "allowGapCursor", {
|
|
37929
37997
|
name: extension.name,
|
|
37930
37998
|
options: extension.options,
|
|
37931
37999
|
storage: extension.storage
|
|
37932
|
-
})))
|
|
38000
|
+
}))) !== null && _callOrReturn !== void 0 ? _callOrReturn : null };
|
|
37933
38001
|
}
|
|
37934
38002
|
});
|
|
38003
|
+
/** The default data attribute label */
|
|
37935
38004
|
var DEFAULT_DATA_ATTRIBUTE = "placeholder";
|
|
38005
|
+
/** The plugin key used to store and read the placeholder decoration set */
|
|
37936
38006
|
var PLUGIN_KEY = new PluginKey("tiptap__placeholder");
|
|
37937
|
-
|
|
38007
|
+
/**
|
|
38008
|
+
* Creates a ProseMirror node decoration that applies a placeholder
|
|
38009
|
+
* CSS class and data attribute to an empty node.
|
|
38010
|
+
* @param options.editor - The editor instance
|
|
38011
|
+
* @param options.pos - The position of the node in the document
|
|
38012
|
+
* @param options.node - The ProseMirror node
|
|
38013
|
+
* @param options.isEmptyDoc - Whether the entire document is empty
|
|
38014
|
+
* @param options.hasAnchor - Whether the selection anchor is within the node
|
|
38015
|
+
* @param options.dataAttribute - The data attribute name (e.g. `data-placeholder`)
|
|
38016
|
+
* @param options.classes - CSS classes for empty nodes and the empty editor
|
|
38017
|
+
* @param options.placeholder - The placeholder text or a function that returns it
|
|
38018
|
+
* @returns A ProseMirror node decoration with placeholder classes and data attribute
|
|
38019
|
+
*/
|
|
37938
38020
|
function createPlaceholderDecoration(options) {
|
|
37939
38021
|
const { editor, placeholder, dataAttribute, pos, node, isEmptyDoc, hasAnchor, classes: { emptyNode, emptyEditor } } = options;
|
|
37940
38022
|
const classes = [emptyNode];
|
|
@@ -37949,16 +38031,57 @@ function createPlaceholderDecoration(options) {
|
|
|
37949
38031
|
}) : placeholder
|
|
37950
38032
|
});
|
|
37951
38033
|
}
|
|
38034
|
+
function resolveEmptyNodeClass(emptyNodeClass, props) {
|
|
38035
|
+
return typeof emptyNodeClass === "function" ? emptyNodeClass(props) : emptyNodeClass;
|
|
38036
|
+
}
|
|
38037
|
+
/**
|
|
38038
|
+
* Scans a document range for empty textblocks that should receive placeholder
|
|
38039
|
+
* decorations. Used by the slow path and incremental state updates.
|
|
38040
|
+
*/
|
|
38041
|
+
function scanRangeForDecorations({ editor, options, dataAttribute, doc, selection, from, to }) {
|
|
38042
|
+
const { anchor } = selection;
|
|
38043
|
+
const decorations = [];
|
|
38044
|
+
const isEmptyDoc = editor.isEmpty;
|
|
38045
|
+
doc.nodesBetween(from, to, (node, pos) => {
|
|
38046
|
+
const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
|
|
38047
|
+
const isEmpty = !node.isLeaf && isNodeEmpty$1(node);
|
|
38048
|
+
if (!node.type.isTextblock) return options.includeChildren;
|
|
38049
|
+
if ((hasAnchor || !options.showOnlyCurrent) && isEmpty) decorations.push(createPlaceholderDecoration({
|
|
38050
|
+
editor,
|
|
38051
|
+
isEmptyDoc,
|
|
38052
|
+
dataAttribute,
|
|
38053
|
+
hasAnchor,
|
|
38054
|
+
placeholder: options.placeholder,
|
|
38055
|
+
classes: {
|
|
38056
|
+
emptyEditor: options.emptyEditorClass,
|
|
38057
|
+
emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {
|
|
38058
|
+
editor,
|
|
38059
|
+
node,
|
|
38060
|
+
pos,
|
|
38061
|
+
hasAnchor
|
|
38062
|
+
})
|
|
38063
|
+
},
|
|
38064
|
+
node,
|
|
38065
|
+
pos
|
|
38066
|
+
}));
|
|
38067
|
+
return options.includeChildren;
|
|
38068
|
+
});
|
|
38069
|
+
return decorations;
|
|
38070
|
+
}
|
|
38071
|
+
/**
|
|
38072
|
+
* Builds the placeholder decorations for the current document state.
|
|
38073
|
+
* @param options.editor - The editor instance.
|
|
38074
|
+
* @param options.options - The resolved placeholder options.
|
|
38075
|
+
* @param options.dataAttribute - The prepared `data-*` attribute name.
|
|
38076
|
+
* @param options.doc - The current document node.
|
|
38077
|
+
* @param options.selection - The current selection.
|
|
38078
|
+
* @returns A decoration set, or `null` when no placeholders should be shown.
|
|
38079
|
+
*/
|
|
37952
38080
|
function buildPlaceholderDecorations({ editor, options, dataAttribute, doc, selection }) {
|
|
37953
|
-
var _a, _b;
|
|
37954
38081
|
if (!(editor.isEditable || !options.showOnlyWhenEditable)) return null;
|
|
37955
38082
|
const { anchor } = selection;
|
|
37956
38083
|
const decorations = [];
|
|
37957
38084
|
const isEmptyDoc = editor.isEmpty;
|
|
37958
|
-
const classes = {
|
|
37959
|
-
emptyEditor: options.emptyEditorClass,
|
|
37960
|
-
emptyNode: options.emptyNodeClass
|
|
37961
|
-
};
|
|
37962
38085
|
if (options.showOnlyCurrent && !options.includeChildren) {
|
|
37963
38086
|
const resolved = doc.resolve(anchor);
|
|
37964
38087
|
const node = resolved.depth > 0 ? resolved.node(1) : resolved.nodeAfter;
|
|
@@ -37971,174 +38094,231 @@ function buildPlaceholderDecorations({ editor, options, dataAttribute, doc, sele
|
|
|
37971
38094
|
dataAttribute,
|
|
37972
38095
|
hasAnchor,
|
|
37973
38096
|
placeholder: options.placeholder,
|
|
37974
|
-
classes
|
|
38097
|
+
classes: {
|
|
38098
|
+
emptyEditor: options.emptyEditorClass,
|
|
38099
|
+
emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {
|
|
38100
|
+
editor,
|
|
38101
|
+
node,
|
|
38102
|
+
pos: nodeStart,
|
|
38103
|
+
hasAnchor
|
|
38104
|
+
})
|
|
38105
|
+
},
|
|
37975
38106
|
node,
|
|
37976
38107
|
pos: nodeStart
|
|
37977
38108
|
}));
|
|
37978
38109
|
}
|
|
37979
|
-
} else {
|
|
37980
|
-
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
doc
|
|
37984
|
-
|
|
37985
|
-
|
|
37986
|
-
|
|
37987
|
-
|
|
37988
|
-
editor,
|
|
37989
|
-
isEmptyDoc,
|
|
37990
|
-
dataAttribute,
|
|
37991
|
-
hasAnchor,
|
|
37992
|
-
placeholder: options.placeholder,
|
|
37993
|
-
classes,
|
|
37994
|
-
node,
|
|
37995
|
-
pos
|
|
37996
|
-
}));
|
|
37997
|
-
return options.includeChildren;
|
|
37998
|
-
});
|
|
37999
|
-
}
|
|
38110
|
+
} else decorations.push(...scanRangeForDecorations({
|
|
38111
|
+
editor,
|
|
38112
|
+
options,
|
|
38113
|
+
dataAttribute,
|
|
38114
|
+
doc,
|
|
38115
|
+
selection,
|
|
38116
|
+
from: 0,
|
|
38117
|
+
to: doc.content.size
|
|
38118
|
+
}));
|
|
38000
38119
|
return DecorationSet$1.create(doc, decorations);
|
|
38001
38120
|
}
|
|
38002
|
-
|
|
38003
|
-
|
|
38004
|
-
|
|
38005
|
-
|
|
38006
|
-
|
|
38007
|
-
const
|
|
38008
|
-
|
|
38009
|
-
|
|
38010
|
-
|
|
38011
|
-
|
|
38012
|
-
|
|
38013
|
-
|
|
38014
|
-
|
|
38015
|
-
|
|
38016
|
-
|
|
38017
|
-
|
|
38018
|
-
|
|
38019
|
-
|
|
38020
|
-
}
|
|
38021
|
-
return window;
|
|
38022
|
-
}
|
|
38023
|
-
el = parent;
|
|
38121
|
+
/**
|
|
38122
|
+
* Resolves a document position to the `[from, to)` range of its containing
|
|
38123
|
+
* top-level block node in absolute document positions.
|
|
38124
|
+
*/
|
|
38125
|
+
function resolveTopLevelRange(doc, pos) {
|
|
38126
|
+
const resolved = doc.resolve(pos);
|
|
38127
|
+
if (resolved.depth === 0) {
|
|
38128
|
+
var _resolved$nodeAfter;
|
|
38129
|
+
const node = (_resolved$nodeAfter = resolved.nodeAfter) !== null && _resolved$nodeAfter !== void 0 ? _resolved$nodeAfter : resolved.nodeBefore;
|
|
38130
|
+
if (!node) return {
|
|
38131
|
+
from: pos,
|
|
38132
|
+
to: pos
|
|
38133
|
+
};
|
|
38134
|
+
const nodePos = resolved.nodeAfter ? pos : pos - node.nodeSize;
|
|
38135
|
+
return {
|
|
38136
|
+
from: nodePos,
|
|
38137
|
+
to: nodePos + node.nodeSize
|
|
38138
|
+
};
|
|
38024
38139
|
}
|
|
38025
|
-
|
|
38026
|
-
|
|
38027
|
-
|
|
38028
|
-
|
|
38029
|
-
top: 0,
|
|
38030
|
-
bottom: window.innerHeight
|
|
38140
|
+
const topLevelPos = resolved.before(1);
|
|
38141
|
+
return {
|
|
38142
|
+
from: topLevelPos,
|
|
38143
|
+
to: topLevelPos + resolved.node(1).nodeSize
|
|
38031
38144
|
};
|
|
38032
|
-
return container.getBoundingClientRect();
|
|
38033
38145
|
}
|
|
38034
|
-
|
|
38035
|
-
|
|
38036
|
-
|
|
38037
|
-
|
|
38038
|
-
|
|
38039
|
-
};
|
|
38040
|
-
const visibleTop = Math.max(editorRect.top, containerRect.top) - VIEWPORT_OVERSCAN_PX;
|
|
38041
|
-
const visibleBottom = Math.min(editorRect.bottom, containerRect.bottom) + VIEWPORT_OVERSCAN_PX;
|
|
38042
|
-
if (visibleTop >= visibleBottom) return {
|
|
38043
|
-
top: 0,
|
|
38044
|
-
bottom: doc.content.size
|
|
38045
|
-
};
|
|
38046
|
-
const x = getComputedStyle(view.dom).direction === "rtl" ? Math.max(editorRect.right - 2, editorRect.left + 2) : editorRect.left + 2;
|
|
38047
|
-
const topPos = view.posAtCoords({
|
|
38048
|
-
left: x,
|
|
38049
|
-
top: visibleTop + 2
|
|
38050
|
-
});
|
|
38051
|
-
const bottomPos = view.posAtCoords({
|
|
38052
|
-
left: x,
|
|
38053
|
-
top: visibleBottom - 2
|
|
38054
|
-
});
|
|
38146
|
+
/**
|
|
38147
|
+
* Converts an absolute document range to content-relative positions used by
|
|
38148
|
+
* `Node#nodesBetween` and `Node#forEach` offsets.
|
|
38149
|
+
*/
|
|
38150
|
+
function toContentRelativeRange(doc, range) {
|
|
38055
38151
|
return {
|
|
38056
|
-
|
|
38057
|
-
|
|
38152
|
+
from: Math.max(0, range.from - 1),
|
|
38153
|
+
to: Math.min(doc.content.size, range.to - 1)
|
|
38058
38154
|
};
|
|
38059
38155
|
}
|
|
38060
|
-
|
|
38061
|
-
|
|
38062
|
-
|
|
38063
|
-
|
|
38064
|
-
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38070
|
-
|
|
38071
|
-
|
|
38072
|
-
|
|
38073
|
-
|
|
38074
|
-
|
|
38075
|
-
* @returns The next viewport state.
|
|
38076
|
-
*/
|
|
38077
|
-
apply(tr, prev) {
|
|
38078
|
-
const meta = tr.getMeta(PLUGIN_KEY);
|
|
38079
|
-
if (meta == null ? void 0 : meta.positions) return {
|
|
38080
|
-
topPos: meta.positions.top,
|
|
38081
|
-
bottomPos: meta.positions.bottom
|
|
38082
|
-
};
|
|
38083
|
-
if (!tr.docChanged) return prev;
|
|
38084
|
-
return {
|
|
38085
|
-
topPos: prev.topPos !== null ? tr.mapping.map(prev.topPos) : null,
|
|
38086
|
-
bottomPos: prev.bottomPos !== null ? tr.mapping.map(prev.bottomPos) : null
|
|
38087
|
-
};
|
|
38088
|
-
}
|
|
38089
|
-
};
|
|
38090
|
-
function createViewportPluginView(view) {
|
|
38091
|
-
const scrollContainer = findScrollParent(view.dom);
|
|
38092
|
-
const computeAndDispatch = () => {
|
|
38093
|
-
const positions = getViewportBoundaryPositions({
|
|
38094
|
-
view,
|
|
38095
|
-
doc: view.state.doc,
|
|
38096
|
-
scrollContainer
|
|
38156
|
+
/**
|
|
38157
|
+
* Returns the top-level block ranges that intersect a document change range.
|
|
38158
|
+
* Input `from`/`to` are absolute positions (e.g. from `getChangedRanges`).
|
|
38159
|
+
* Returned ranges are content-relative, matching `Node#forEach` offsets.
|
|
38160
|
+
*/
|
|
38161
|
+
function getTopLevelBlocksInRange(doc, from, to) {
|
|
38162
|
+
const ranges = [];
|
|
38163
|
+
doc.forEach((node, offset) => {
|
|
38164
|
+
const nodeStart = offset;
|
|
38165
|
+
const nodeEnd = nodeStart + node.nodeSize;
|
|
38166
|
+
const absNodeStart = nodeStart + 1;
|
|
38167
|
+
const absNodeEnd = nodeEnd + 1;
|
|
38168
|
+
if (absNodeStart < to && absNodeEnd > from) ranges.push({
|
|
38169
|
+
from: nodeStart,
|
|
38170
|
+
to: nodeEnd
|
|
38097
38171
|
});
|
|
38098
|
-
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
|
|
38172
|
+
});
|
|
38173
|
+
return ranges;
|
|
38174
|
+
}
|
|
38175
|
+
/**
|
|
38176
|
+
* Sorts ranges by start position and merges overlapping or adjacent ranges.
|
|
38177
|
+
*/
|
|
38178
|
+
function mergeRanges(ranges) {
|
|
38179
|
+
if (ranges.length === 0) return [];
|
|
38180
|
+
const sorted = [...ranges].sort((a, b) => a.from - b.from);
|
|
38181
|
+
const merged = [{ ...sorted[0] }];
|
|
38182
|
+
for (let i = 1; i < sorted.length; i += 1) {
|
|
38183
|
+
const last = merged[merged.length - 1];
|
|
38184
|
+
const current = sorted[i];
|
|
38185
|
+
if (current.from <= last.to) last.to = Math.max(last.to, current.to);
|
|
38186
|
+
else merged.push({ ...current });
|
|
38187
|
+
}
|
|
38188
|
+
return merged;
|
|
38189
|
+
}
|
|
38190
|
+
/**
|
|
38191
|
+
* Expands a single changed range to the top-level blocks it touches.
|
|
38192
|
+
* Also resolves blocks at range boundaries so split/merge edits update
|
|
38193
|
+
* adjacent empty nodes (e.g. a new paragraph after Enter).
|
|
38194
|
+
*/
|
|
38195
|
+
function collectBlocksForChange(doc, change) {
|
|
38196
|
+
const ranges = getTopLevelBlocksInRange(doc, change.from, change.to);
|
|
38197
|
+
ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, change.from)));
|
|
38198
|
+
if (change.to > change.from) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.to, doc.content.size + 1) - 1)));
|
|
38199
|
+
else if (change.from < doc.content.size + 1) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.from + 1, doc.content.size))));
|
|
38200
|
+
return ranges;
|
|
38201
|
+
}
|
|
38202
|
+
/**
|
|
38203
|
+
* Collects content-relative top-level block ranges that need placeholder
|
|
38204
|
+
* decorations recomputed after a transaction.
|
|
38205
|
+
*/
|
|
38206
|
+
function collectRescanRanges(tr, oldState, newState) {
|
|
38207
|
+
const ranges = [];
|
|
38208
|
+
if (tr.docChanged) {
|
|
38209
|
+
const changes = getChangedRanges$1(tr);
|
|
38210
|
+
for (const change of changes) ranges.push(...collectBlocksForChange(newState.doc, change.newRange));
|
|
38211
|
+
}
|
|
38212
|
+
if (tr.selectionSet) {
|
|
38213
|
+
ranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, tr.mapping.map(oldState.selection.anchor))));
|
|
38214
|
+
ranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, newState.selection.anchor)));
|
|
38215
|
+
}
|
|
38216
|
+
return mergeRanges(ranges);
|
|
38217
|
+
}
|
|
38218
|
+
/** Clamps a content-relative range to `[0, doc.content.size]`. */
|
|
38219
|
+
function clampRange(from, to, doc) {
|
|
38220
|
+
const clampedFrom = Math.max(0, Math.min(from, doc.content.size));
|
|
38221
|
+
return {
|
|
38222
|
+
from: clampedFrom,
|
|
38223
|
+
to: Math.max(clampedFrom, Math.min(to, doc.content.size))
|
|
38102
38224
|
};
|
|
38103
|
-
|
|
38104
|
-
|
|
38105
|
-
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
|
|
38109
|
-
|
|
38110
|
-
|
|
38111
|
-
|
|
38112
|
-
|
|
38113
|
-
|
|
38114
|
-
|
|
38225
|
+
}
|
|
38226
|
+
/**
|
|
38227
|
+
* Removes and rebuilds placeholder decorations within the given ranges.
|
|
38228
|
+
* Only drops decorations fully contained in a range so mapped decorations
|
|
38229
|
+
* on neighbouring blocks (e.g. at a block boundary) are kept intact.
|
|
38230
|
+
*/
|
|
38231
|
+
function updateDecorationsInRanges({ decorations, ranges, editor, options, dataAttribute, doc, selection }) {
|
|
38232
|
+
let next = decorations;
|
|
38233
|
+
for (const range of ranges) {
|
|
38234
|
+
const { from, to } = clampRange(range.from, range.to, doc);
|
|
38235
|
+
const existing = next.find(from, to).filter((decoration) => decoration.from >= from && decoration.to <= to);
|
|
38236
|
+
if (existing.length) next = next.remove(existing);
|
|
38237
|
+
const newDecos = scanRangeForDecorations({
|
|
38238
|
+
editor,
|
|
38239
|
+
options,
|
|
38240
|
+
dataAttribute,
|
|
38241
|
+
doc,
|
|
38242
|
+
selection,
|
|
38243
|
+
from,
|
|
38244
|
+
to
|
|
38115
38245
|
});
|
|
38116
|
-
|
|
38117
|
-
|
|
38118
|
-
|
|
38246
|
+
if (newDecos.length) next = next.add(doc, newDecos);
|
|
38247
|
+
}
|
|
38248
|
+
return next;
|
|
38249
|
+
}
|
|
38250
|
+
/**
|
|
38251
|
+
* Creates the incremental `StateField<DecorationSet>` used by the slow path
|
|
38252
|
+
* (`showOnlyCurrent: false` or `includeChildren: true`).
|
|
38253
|
+
*
|
|
38254
|
+
* Decorations are mapped through each transaction and only recomputed for
|
|
38255
|
+
* top-level blocks touched by document or selection changes.
|
|
38256
|
+
* @param options.editor - The editor instance.
|
|
38257
|
+
* @param options.options - The resolved placeholder options.
|
|
38258
|
+
* @param options.dataAttribute - The prepared `data-*` attribute name.
|
|
38259
|
+
* @returns A ProseMirror state field storing the placeholder decoration set.
|
|
38260
|
+
*/
|
|
38261
|
+
function createPlaceholderStateField({ editor, options, dataAttribute }) {
|
|
38119
38262
|
return {
|
|
38120
|
-
|
|
38121
|
-
|
|
38263
|
+
init(_config, state) {
|
|
38264
|
+
const decorations = buildPlaceholderDecorations({
|
|
38265
|
+
editor,
|
|
38266
|
+
options,
|
|
38267
|
+
dataAttribute,
|
|
38268
|
+
doc: state.doc,
|
|
38269
|
+
selection: state.selection
|
|
38270
|
+
});
|
|
38271
|
+
return decorations !== null && decorations !== void 0 ? decorations : DecorationSet$1.empty;
|
|
38122
38272
|
},
|
|
38123
|
-
|
|
38124
|
-
if (
|
|
38125
|
-
|
|
38273
|
+
apply(tr, prev, oldState, newState) {
|
|
38274
|
+
if (!tr.docChanged && !tr.selectionSet) return prev;
|
|
38275
|
+
return updateDecorationsInRanges({
|
|
38276
|
+
decorations: prev.map(tr.mapping, tr.doc),
|
|
38277
|
+
ranges: collectRescanRanges(tr, oldState, newState),
|
|
38278
|
+
editor,
|
|
38279
|
+
options,
|
|
38280
|
+
dataAttribute,
|
|
38281
|
+
doc: newState.doc,
|
|
38282
|
+
selection: newState.selection
|
|
38283
|
+
});
|
|
38126
38284
|
}
|
|
38127
38285
|
};
|
|
38128
38286
|
}
|
|
38287
|
+
/**
|
|
38288
|
+
* Prepares the placeholder attribute by ensuring it is properly formatted.
|
|
38289
|
+
* @param attr - The placeholder attribute string.
|
|
38290
|
+
* @returns The prepared placeholder attribute string.
|
|
38291
|
+
*/
|
|
38292
|
+
function preparePlaceholderAttribute(attr) {
|
|
38293
|
+
return attr.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
38294
|
+
}
|
|
38295
|
+
/**
|
|
38296
|
+
* Creates the ProseMirror plugin that renders placeholder decorations.
|
|
38297
|
+
* @param options.editor - The editor instance.
|
|
38298
|
+
* @param options.options - The resolved placeholder options.
|
|
38299
|
+
* @returns The configured placeholder plugin.
|
|
38300
|
+
*/
|
|
38129
38301
|
function createPlaceholderPlugin({ editor, options }) {
|
|
38130
38302
|
const dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;
|
|
38303
|
+
const useResolvedPath = options.showOnlyCurrent && !options.includeChildren;
|
|
38131
38304
|
return new Plugin({
|
|
38132
38305
|
key: PLUGIN_KEY,
|
|
38133
|
-
state:
|
|
38134
|
-
|
|
38135
|
-
|
|
38306
|
+
...useResolvedPath ? {} : { state: createPlaceholderStateField({
|
|
38307
|
+
editor,
|
|
38308
|
+
options,
|
|
38309
|
+
dataAttribute
|
|
38310
|
+
}) },
|
|
38311
|
+
props: { decorations: useResolvedPath ? ({ doc, selection }) => buildPlaceholderDecorations({
|
|
38136
38312
|
editor,
|
|
38137
38313
|
options,
|
|
38138
38314
|
dataAttribute,
|
|
38139
38315
|
doc,
|
|
38140
38316
|
selection
|
|
38141
|
-
})
|
|
38317
|
+
}) : (state) => {
|
|
38318
|
+
var _PLUGIN_KEY$getState;
|
|
38319
|
+
if (options.showOnlyWhenEditable && !editor.isEditable) return DecorationSet$1.empty;
|
|
38320
|
+
return (_PLUGIN_KEY$getState = PLUGIN_KEY.getState(state)) !== null && _PLUGIN_KEY$getState !== void 0 ? _PLUGIN_KEY$getState : DecorationSet$1.empty;
|
|
38321
|
+
} }
|
|
38142
38322
|
});
|
|
38143
38323
|
}
|
|
38144
38324
|
Extension$1.create({
|
|
@@ -38161,6 +38341,31 @@ Extension$1.create({
|
|
|
38161
38341
|
})];
|
|
38162
38342
|
}
|
|
38163
38343
|
});
|
|
38344
|
+
/**
|
|
38345
|
+
* Whether the native browser selection should be cleared on blur and restored on focus.
|
|
38346
|
+
* Only applies to non-empty text selections in an editable editor.
|
|
38347
|
+
*/
|
|
38348
|
+
function shouldSyncDomSelection(state, editor) {
|
|
38349
|
+
return !state.selection.empty && !isNodeSelection$1(state.selection) && editor.isEditable;
|
|
38350
|
+
}
|
|
38351
|
+
/**
|
|
38352
|
+
* Whether the selection decoration should be rendered to keep the selection
|
|
38353
|
+
* visible while the editor is blurred (and not dragging).
|
|
38354
|
+
*/
|
|
38355
|
+
function shouldPreserveSelection(state, editor) {
|
|
38356
|
+
return shouldSyncDomSelection(state, editor) && !editor.isFocused && !editor.view.dragging;
|
|
38357
|
+
}
|
|
38358
|
+
function clearDomSelection() {
|
|
38359
|
+
var _window$getSelection;
|
|
38360
|
+
(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();
|
|
38361
|
+
}
|
|
38362
|
+
/**
|
|
38363
|
+
* Sync the native selection from the editor state.
|
|
38364
|
+
* @see https://prosemirror.net/docs/ref/#view.EditorView.focus
|
|
38365
|
+
*/
|
|
38366
|
+
function restoreDomSelection(view) {
|
|
38367
|
+
view.focus();
|
|
38368
|
+
}
|
|
38164
38369
|
Extension$1.create({
|
|
38165
38370
|
name: "selection",
|
|
38166
38371
|
addOptions() {
|
|
@@ -38170,15 +38375,31 @@ Extension$1.create({
|
|
|
38170
38375
|
const { editor, options } = this;
|
|
38171
38376
|
return [new Plugin({
|
|
38172
38377
|
key: new PluginKey("selection"),
|
|
38173
|
-
props: {
|
|
38174
|
-
|
|
38175
|
-
|
|
38176
|
-
|
|
38378
|
+
props: {
|
|
38379
|
+
decorations(state) {
|
|
38380
|
+
if (!shouldPreserveSelection(state, editor)) return null;
|
|
38381
|
+
return DecorationSet$1.create(state.doc, [Decoration$1.inline(state.selection.from, state.selection.to, { class: options.className })]);
|
|
38382
|
+
},
|
|
38383
|
+
handleDOMEvents: {
|
|
38384
|
+
blur(view) {
|
|
38385
|
+
if (!shouldSyncDomSelection(view.state, editor)) return false;
|
|
38386
|
+
clearDomSelection();
|
|
38387
|
+
return false;
|
|
38388
|
+
},
|
|
38389
|
+
focus(view) {
|
|
38390
|
+
if (!shouldSyncDomSelection(view.state, editor)) return false;
|
|
38391
|
+
requestAnimationFrame(() => {
|
|
38392
|
+
if (!editor.isDestroyed && view.hasFocus()) restoreDomSelection(view);
|
|
38393
|
+
});
|
|
38394
|
+
return false;
|
|
38395
|
+
}
|
|
38396
|
+
}
|
|
38397
|
+
}
|
|
38177
38398
|
})];
|
|
38178
38399
|
}
|
|
38179
38400
|
});
|
|
38180
38401
|
function nodeEqualsType({ types, node }) {
|
|
38181
|
-
return node && Array.isArray(types) && types.includes(node.type) || (node
|
|
38402
|
+
return node && Array.isArray(types) && types.includes(node.type) || (node === null || node === void 0 ? void 0 : node.type) === types;
|
|
38182
38403
|
}
|
|
38183
38404
|
Extension$1.create({
|
|
38184
38405
|
name: "trailingNode",
|
|
@@ -38189,9 +38410,9 @@ Extension$1.create({
|
|
|
38189
38410
|
};
|
|
38190
38411
|
},
|
|
38191
38412
|
addProseMirrorPlugins() {
|
|
38192
|
-
var
|
|
38413
|
+
var _this$editor$schema$t;
|
|
38193
38414
|
const plugin = new PluginKey(this.name);
|
|
38194
|
-
const defaultNode = this.options.node || ((
|
|
38415
|
+
const defaultNode = this.options.node || ((_this$editor$schema$t = this.editor.schema.topNodeType.contentMatch.defaultType) === null || _this$editor$schema$t === void 0 ? void 0 : _this$editor$schema$t.name) || "paragraph";
|
|
38195
38416
|
const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));
|
|
38196
38417
|
return [new Plugin({
|
|
38197
38418
|
key: plugin,
|
|
@@ -38256,7 +38477,7 @@ Extension$1.create({
|
|
|
38256
38477
|
};
|
|
38257
38478
|
}
|
|
38258
38479
|
});
|
|
38259
|
-
var index_default$
|
|
38480
|
+
var index_default$3 = Mark$1.create({
|
|
38260
38481
|
name: "superscript",
|
|
38261
38482
|
addOptions() {
|
|
38262
38483
|
return { HTMLAttributes: {} };
|
|
@@ -38294,7 +38515,7 @@ var index_default$4 = Mark$1.create({
|
|
|
38294
38515
|
return { "Mod-.": () => this.editor.commands.toggleSuperscript() };
|
|
38295
38516
|
}
|
|
38296
38517
|
});
|
|
38297
|
-
var index_default$
|
|
38518
|
+
var index_default$2 = Mark$1.create({
|
|
38298
38519
|
name: "subscript",
|
|
38299
38520
|
addOptions() {
|
|
38300
38521
|
return { HTMLAttributes: {} };
|
|
@@ -38332,7 +38553,7 @@ var index_default$3 = Mark$1.create({
|
|
|
38332
38553
|
return { "Mod-,": () => this.editor.commands.toggleSubscript() };
|
|
38333
38554
|
}
|
|
38334
38555
|
});
|
|
38335
|
-
var index_default$
|
|
38556
|
+
var index_default$1 = Extension$1.create({
|
|
38336
38557
|
name: "textAlign",
|
|
38337
38558
|
addOptions() {
|
|
38338
38559
|
return {
|
|
@@ -38388,9 +38609,12 @@ var index_default$2 = Extension$1.create({
|
|
|
38388
38609
|
}
|
|
38389
38610
|
});
|
|
38390
38611
|
//#endregion
|
|
38391
|
-
//#region ../../../node_modules/.bun/@tiptap+extension-image@3.
|
|
38612
|
+
//#region ../../../node_modules/.bun/@tiptap+extension-image@3.31.3+a55e136bd95da1c1/node_modules/@tiptap/extension-image/dist/index.js
|
|
38613
|
+
/**
|
|
38614
|
+
* Matches an image to a  on input.
|
|
38615
|
+
*/
|
|
38392
38616
|
var inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;
|
|
38393
|
-
var
|
|
38617
|
+
var src_default = Node3$1.create({
|
|
38394
38618
|
name: "image",
|
|
38395
38619
|
addOptions() {
|
|
38396
38620
|
return {
|
|
@@ -38430,27 +38654,58 @@ var index_default$1 = Node3$1.create({
|
|
|
38430
38654
|
});
|
|
38431
38655
|
},
|
|
38432
38656
|
renderMarkdown: (node) => {
|
|
38433
|
-
var
|
|
38434
|
-
const src = (
|
|
38435
|
-
const alt = (
|
|
38436
|
-
const title = (
|
|
38657
|
+
var _node$attrs$src, _node$attrs, _node$attrs$alt, _node$attrs2, _node$attrs$title, _node$attrs3;
|
|
38658
|
+
const src = (_node$attrs$src = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.src) !== null && _node$attrs$src !== void 0 ? _node$attrs$src : "";
|
|
38659
|
+
const alt = (_node$attrs$alt = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.alt) !== null && _node$attrs$alt !== void 0 ? _node$attrs$alt : "";
|
|
38660
|
+
const title = (_node$attrs$title = (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.title) !== null && _node$attrs$title !== void 0 ? _node$attrs$title : "";
|
|
38437
38661
|
return title ? `` : ``;
|
|
38438
38662
|
},
|
|
38439
38663
|
addNodeView() {
|
|
38440
38664
|
if (!this.options.resize || !this.options.resize.enabled || typeof document === "undefined") return null;
|
|
38441
38665
|
const { directions, minWidth, minHeight, alwaysPreserveAspectRatio } = this.options.resize;
|
|
38666
|
+
const resizeManagedAttributes = /* @__PURE__ */ new Set([
|
|
38667
|
+
"src",
|
|
38668
|
+
"width",
|
|
38669
|
+
"height"
|
|
38670
|
+
]);
|
|
38442
38671
|
return ({ node, getPos, HTMLAttributes, editor }) => {
|
|
38443
38672
|
const el = document.createElement("img");
|
|
38444
|
-
|
|
38673
|
+
el.draggable = false;
|
|
38674
|
+
const mergedAttributes = mergeAttributes$1(this.options.HTMLAttributes, HTMLAttributes);
|
|
38675
|
+
Object.entries(mergedAttributes).forEach(([key, value]) => {
|
|
38445
38676
|
if (value != null) switch (key) {
|
|
38677
|
+
case "src":
|
|
38446
38678
|
case "width":
|
|
38447
38679
|
case "height": break;
|
|
38448
|
-
default:
|
|
38449
|
-
el.setAttribute(key, value);
|
|
38450
|
-
break;
|
|
38680
|
+
default: el.setAttribute(key, value);
|
|
38451
38681
|
}
|
|
38452
38682
|
});
|
|
38453
|
-
el.src =
|
|
38683
|
+
if (mergedAttributes.src !== null) el.src = mergedAttributes.src;
|
|
38684
|
+
let previousHTMLAttributes = { ...HTMLAttributes };
|
|
38685
|
+
const syncImageSource = (src) => {
|
|
38686
|
+
if (typeof src === "string" && src !== "") {
|
|
38687
|
+
if (el.getAttribute("src") !== src) el.src = src;
|
|
38688
|
+
return;
|
|
38689
|
+
}
|
|
38690
|
+
if (el.hasAttribute("src")) el.removeAttribute("src");
|
|
38691
|
+
if (el.src !== "") el.src = "";
|
|
38692
|
+
};
|
|
38693
|
+
syncImageSource(HTMLAttributes.src);
|
|
38694
|
+
const onUpdate = (updatedNode) => {
|
|
38695
|
+
if (updatedNode.type !== node.type) return false;
|
|
38696
|
+
const newHTMLAttributes = getRenderedAttributes$1(updatedNode, editor.extensionManager.attributes.filter((attribute) => attribute.type === updatedNode.type.name));
|
|
38697
|
+
Object.keys(previousHTMLAttributes).forEach((key) => {
|
|
38698
|
+
if (!resizeManagedAttributes.has(key) && !(key in newHTMLAttributes)) el.removeAttribute(key);
|
|
38699
|
+
});
|
|
38700
|
+
Object.entries(newHTMLAttributes).forEach(([key, value]) => {
|
|
38701
|
+
if (resizeManagedAttributes.has(key)) return;
|
|
38702
|
+
if (value != null) el.setAttribute(key, value);
|
|
38703
|
+
else el.removeAttribute(key);
|
|
38704
|
+
});
|
|
38705
|
+
syncImageSource(newHTMLAttributes.src);
|
|
38706
|
+
previousHTMLAttributes = newHTMLAttributes;
|
|
38707
|
+
return true;
|
|
38708
|
+
};
|
|
38454
38709
|
const nodeView = new ResizableNodeView({
|
|
38455
38710
|
element: el,
|
|
38456
38711
|
editor,
|
|
@@ -38468,10 +38723,7 @@ var index_default$1 = Node3$1.create({
|
|
|
38468
38723
|
height
|
|
38469
38724
|
}).run();
|
|
38470
38725
|
},
|
|
38471
|
-
onUpdate
|
|
38472
|
-
if (updatedNode.type !== node.type) return false;
|
|
38473
|
-
return true;
|
|
38474
|
-
},
|
|
38726
|
+
onUpdate,
|
|
38475
38727
|
options: {
|
|
38476
38728
|
directions,
|
|
38477
38729
|
min: {
|
|
@@ -38482,12 +38734,17 @@ var index_default$1 = Node3$1.create({
|
|
|
38482
38734
|
}
|
|
38483
38735
|
});
|
|
38484
38736
|
const dom = nodeView.dom;
|
|
38485
|
-
|
|
38486
|
-
dom.style.pointerEvents = "none";
|
|
38487
|
-
el.onload = () => {
|
|
38737
|
+
const showNodeView = () => {
|
|
38488
38738
|
dom.style.visibility = "";
|
|
38489
38739
|
dom.style.pointerEvents = "";
|
|
38490
38740
|
};
|
|
38741
|
+
dom.style.visibility = "hidden";
|
|
38742
|
+
dom.style.pointerEvents = "none";
|
|
38743
|
+
if (el.complete && el.naturalWidth > 0) showNodeView();
|
|
38744
|
+
else {
|
|
38745
|
+
el.onload = showNodeView;
|
|
38746
|
+
el.onerror = showNodeView;
|
|
38747
|
+
}
|
|
38491
38748
|
return nodeView;
|
|
38492
38749
|
};
|
|
38493
38750
|
},
|
|
@@ -41085,7 +41342,7 @@ function EditableHtml($$anchor, $$props) {
|
|
|
41085
41342
|
set(editor, new Editor({
|
|
41086
41343
|
element: editorElement,
|
|
41087
41344
|
extensions: [
|
|
41088
|
-
index_default$
|
|
41345
|
+
index_default$4.configure({ heading: { levels: [
|
|
41089
41346
|
1,
|
|
41090
41347
|
2,
|
|
41091
41348
|
3,
|
|
@@ -41096,9 +41353,9 @@ function EditableHtml($$anchor, $$props) {
|
|
|
41096
41353
|
TextStyle,
|
|
41097
41354
|
CharacterCount.configure({ limit: 1e6 }),
|
|
41098
41355
|
index_default,
|
|
41356
|
+
index_default$2,
|
|
41099
41357
|
index_default$3,
|
|
41100
|
-
index_default$
|
|
41101
|
-
index_default$2.configure({
|
|
41358
|
+
index_default$1.configure({
|
|
41102
41359
|
types: ["heading", "paragraph"],
|
|
41103
41360
|
alignments: [
|
|
41104
41361
|
"left",
|
|
@@ -41106,7 +41363,7 @@ function EditableHtml($$anchor, $$props) {
|
|
|
41106
41363
|
"center"
|
|
41107
41364
|
]
|
|
41108
41365
|
}),
|
|
41109
|
-
|
|
41366
|
+
src_default,
|
|
41110
41367
|
Table.configure({
|
|
41111
41368
|
resizable: true,
|
|
41112
41369
|
HTMLAttributes: { border: "0" }
|
|
@@ -41599,19 +41856,16 @@ function RegionPicker($$anchor, $$props) {
|
|
|
41599
41856
|
var button = root$4();
|
|
41600
41857
|
let classes;
|
|
41601
41858
|
var span = child(button);
|
|
41602
|
-
var text =
|
|
41603
|
-
|
|
41604
|
-
var span_1 = sibling(span, 2);
|
|
41605
|
-
var text_1 = child(span_1, true);
|
|
41606
|
-
reset$1(span_1);
|
|
41859
|
+
var text = only_child(span, true);
|
|
41860
|
+
var text_1 = only_child(sibling(span, 2), true);
|
|
41607
41861
|
reset$1(button);
|
|
41608
41862
|
template_effect(($0, $1, $2, $3) => {
|
|
41609
|
-
classes = set_class(button, 1, "region-cell svelte-1u97j9p", null, classes, $0);
|
|
41863
|
+
classes = set_class(button, 1, "region-cell svelte-1u97j9p", null, classes, { selected: $0 });
|
|
41610
41864
|
set_attribute(button, "aria-checked", $1);
|
|
41611
41865
|
set_text(text, $2);
|
|
41612
41866
|
set_text(text_1, $3);
|
|
41613
41867
|
}, [
|
|
41614
|
-
() =>
|
|
41868
|
+
() => isSelected(get(region)),
|
|
41615
41869
|
() => isSelected(get(region)),
|
|
41616
41870
|
() => regionKey(get(region)) || "—",
|
|
41617
41871
|
() => label(get(region))
|
|
@@ -41677,7 +41931,7 @@ function n$1(e, n = {}) {
|
|
|
41677
41931
|
}
|
|
41678
41932
|
return null;
|
|
41679
41933
|
}
|
|
41680
|
-
function
|
|
41934
|
+
function a$1({ sourceEl: t, fallbackSelector: r, component: i, complete: a, session: o }) {
|
|
41681
41935
|
let s = n$1(t, { fallbackSelector: r });
|
|
41682
41936
|
return s ? typeof s.onSessionChange == "function" ? (s.onSessionChange(o), s) : (s.dispatchEvent(new t$2(i, a)), s) : null;
|
|
41683
41937
|
}
|
|
@@ -42042,8 +42296,7 @@ function Tray($$anchor, $$props) {
|
|
|
42042
42296
|
var div = root$2();
|
|
42043
42297
|
let classes;
|
|
42044
42298
|
var div_1 = child(div);
|
|
42045
|
-
var text =
|
|
42046
|
-
reset$1(div_1);
|
|
42299
|
+
var text = only_child(div_1, true);
|
|
42047
42300
|
var div_2 = sibling(div_1, 2);
|
|
42048
42301
|
var node = child(div_2);
|
|
42049
42302
|
var consequent = ($$anchor) => {
|
|
@@ -42466,7 +42719,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
42466
42719
|
tileId,
|
|
42467
42720
|
placement
|
|
42468
42721
|
});
|
|
42469
|
-
|
|
42722
|
+
a$1({
|
|
42470
42723
|
sourceEl: containerEl,
|
|
42471
42724
|
fallbackSelector: "venn-classification",
|
|
42472
42725
|
component: "venn-classification",
|
|
@@ -42643,9 +42896,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
42643
42896
|
if (get(showCorrect)) $$render(consequent_1);
|
|
42644
42897
|
else $$render(alternate, -1);
|
|
42645
42898
|
});
|
|
42646
|
-
var
|
|
42647
|
-
var text = child(span);
|
|
42648
|
-
reset$1(span);
|
|
42899
|
+
var text = only_child(sibling(node_2, 2));
|
|
42649
42900
|
reset$1(button);
|
|
42650
42901
|
template_effect(() => {
|
|
42651
42902
|
set_attribute(button, "aria-pressed", get(showCorrect));
|
|
@@ -42671,8 +42922,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
42671
42922
|
var circle_3 = sibling(circle_2);
|
|
42672
42923
|
reset$1(mask_1);
|
|
42673
42924
|
var clipPath = sibling(mask_1);
|
|
42674
|
-
var circle_4 =
|
|
42675
|
-
reset$1(clipPath);
|
|
42925
|
+
var circle_4 = only_child(clipPath);
|
|
42676
42926
|
var mask_2 = sibling(clipPath);
|
|
42677
42927
|
var rect_3 = child(mask_2);
|
|
42678
42928
|
var circle_5 = sibling(rect_3);
|
|
@@ -42757,8 +43007,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
42757
43007
|
each(node_9, 17, () => geometry.circles, index, ($$anchor, c, idx) => {
|
|
42758
43008
|
var text_1 = root_10$1();
|
|
42759
43009
|
set_attribute(text_1, "text-anchor", idx === 0 ? "start" : "end");
|
|
42760
|
-
var text_2 =
|
|
42761
|
-
reset$1(text_1);
|
|
43010
|
+
var text_2 = only_child(text_1, true);
|
|
42762
43011
|
template_effect(($0, $1) => {
|
|
42763
43012
|
set_attribute(text_1, "x", $0);
|
|
42764
43013
|
set_attribute(text_1, "y", $1);
|
|
@@ -43271,9 +43520,7 @@ function Author($$anchor, $$props) {
|
|
|
43271
43520
|
var node_2 = sibling(label_6, 2);
|
|
43272
43521
|
var consequent_2 = ($$anchor) => {
|
|
43273
43522
|
var div_11 = root_2();
|
|
43274
|
-
|
|
43275
|
-
reset$1(div_11);
|
|
43276
|
-
delegated("click", button_1, () => clearTileImage(get(idx)));
|
|
43523
|
+
delegated("click", only_child(div_11), () => clearTileImage(get(idx)));
|
|
43277
43524
|
append($$anchor, div_11);
|
|
43278
43525
|
};
|
|
43279
43526
|
var d = /* @__PURE__ */ user_derived(() => (get(tile).imageUrl ?? "").trim());
|
|
@@ -43339,8 +43586,7 @@ function Author($$anchor, $$props) {
|
|
|
43339
43586
|
const placeholder = /* @__PURE__ */ user_derived(() => composeRegionLabel(get(m).circles || [], get(region)));
|
|
43340
43587
|
var label_9 = root_4();
|
|
43341
43588
|
var span_1 = child(label_9);
|
|
43342
|
-
var text =
|
|
43343
|
-
reset$1(span_1);
|
|
43589
|
+
var text = only_child(span_1, true);
|
|
43344
43590
|
var input_8 = sibling(span_1, 2);
|
|
43345
43591
|
remove_input_defaults(input_8);
|
|
43346
43592
|
reset$1(label_9);
|
|
@@ -43412,9 +43658,7 @@ function Author($$anchor, $$props) {
|
|
|
43412
43658
|
});
|
|
43413
43659
|
var text_4 = sibling(node_8);
|
|
43414
43660
|
reset$1(span_2);
|
|
43415
|
-
var
|
|
43416
|
-
var text_5 = child(span_3, true);
|
|
43417
|
-
reset$1(span_3);
|
|
43661
|
+
var text_5 = only_child(sibling(span_2, 4), true);
|
|
43418
43662
|
reset$1(li_1);
|
|
43419
43663
|
template_effect(($0, $1) => {
|
|
43420
43664
|
set_text(text_4, ` ${$0 ?? ""}`);
|