@overlastic/svelte 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +102 -0
- package/dist/index.cjs +230 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.global.js +766 -0
- package/dist/index.js +216 -0
- package/package.json +42 -0
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var OverlaysSvelte = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
Overlay: () => Overlay,
|
|
25
|
+
defineOverlay: () => defineOverlay,
|
|
26
|
+
renderOverlay: () => renderOverlay,
|
|
27
|
+
usePrograms: () => usePrograms
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// ../@core/src/define/global.ts
|
|
31
|
+
var UnifiedOverlayProviderID = "unified-overlay";
|
|
32
|
+
function defineGlobalElement(id = "", root = document.body) {
|
|
33
|
+
const el = document.createElement("div");
|
|
34
|
+
if (id)
|
|
35
|
+
el.id = id;
|
|
36
|
+
if (root !== false)
|
|
37
|
+
root.appendChild(el);
|
|
38
|
+
return el;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ../@core/src/internal/index.ts
|
|
42
|
+
var context = {
|
|
43
|
+
position: null,
|
|
44
|
+
spaces: {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// ../@core/src/define/name-index.ts
|
|
48
|
+
function defineName(id = UnifiedOverlayProviderID, auto = true) {
|
|
49
|
+
if (!context.spaces[id])
|
|
50
|
+
context.spaces[id] = 0;
|
|
51
|
+
if (auto)
|
|
52
|
+
return `${id}--${++context.spaces[id]}`;
|
|
53
|
+
return id;
|
|
54
|
+
}
|
|
55
|
+
function getIndex(id = UnifiedOverlayProviderID) {
|
|
56
|
+
return context.spaces[id] || 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ../@core/src/deferred.ts
|
|
60
|
+
function createDeferred() {
|
|
61
|
+
let resolve, reject;
|
|
62
|
+
const promise = new Promise((_resolve, _reject) => {
|
|
63
|
+
resolve = _resolve;
|
|
64
|
+
reject = _reject;
|
|
65
|
+
});
|
|
66
|
+
promise.resolve = (v) => {
|
|
67
|
+
resolve(v);
|
|
68
|
+
return promise;
|
|
69
|
+
};
|
|
70
|
+
promise.reject = reject;
|
|
71
|
+
return promise;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ../@core/src/events/index.ts
|
|
75
|
+
function watchClickPosition() {
|
|
76
|
+
if (typeof window === "undefined" && typeof document === "undefined")
|
|
77
|
+
return;
|
|
78
|
+
document.addEventListener("click", (event) => {
|
|
79
|
+
if (event.target instanceof Element) {
|
|
80
|
+
const { left, top, width, height } = event.target.getBoundingClientRect();
|
|
81
|
+
if (left > 0 || top > 0) {
|
|
82
|
+
context.position = { x: left + width / 2, y: top + height / 2 };
|
|
83
|
+
} else {
|
|
84
|
+
context.position = null;
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
context.position = null;
|
|
88
|
+
}
|
|
89
|
+
setTimeout(() => context.position = null, 64);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ../@core/src/constructor.ts
|
|
94
|
+
function createConstructor(mount) {
|
|
95
|
+
function define(instance2, options) {
|
|
96
|
+
function executor(props, options2) {
|
|
97
|
+
const deferred = createDeferred();
|
|
98
|
+
const name = defineName(options2.id, options2.autoIncrement);
|
|
99
|
+
const index = getIndex(options2.id);
|
|
100
|
+
const container = defineGlobalElement(name, options2.root);
|
|
101
|
+
mount(instance2, props, Object.assign(options2, {
|
|
102
|
+
position: context.position,
|
|
103
|
+
id: name,
|
|
104
|
+
deferred,
|
|
105
|
+
index,
|
|
106
|
+
container
|
|
107
|
+
}));
|
|
108
|
+
return deferred;
|
|
109
|
+
}
|
|
110
|
+
let inst;
|
|
111
|
+
function only(props, options2) {
|
|
112
|
+
if (!inst) {
|
|
113
|
+
inst = executor(props, options2);
|
|
114
|
+
inst.finally(() => inst = void 0);
|
|
115
|
+
}
|
|
116
|
+
return inst;
|
|
117
|
+
}
|
|
118
|
+
function caller(props, overrides) {
|
|
119
|
+
const opts = { ...options, ...overrides };
|
|
120
|
+
return opts.only ? only(props, opts) : executor(props, opts);
|
|
121
|
+
}
|
|
122
|
+
return caller;
|
|
123
|
+
}
|
|
124
|
+
function render(instance2, props, options) {
|
|
125
|
+
return define(instance2, options)(props);
|
|
126
|
+
}
|
|
127
|
+
return { define, render };
|
|
128
|
+
}
|
|
129
|
+
watchClickPosition();
|
|
130
|
+
|
|
131
|
+
// ../@core/src/utils/util.ts
|
|
132
|
+
function delay(milliseconds) {
|
|
133
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/internal/index.ts
|
|
137
|
+
var injectOverlayKey = Symbol("overlays:svelte");
|
|
138
|
+
var injectOptionsKey = Symbol("overlays:options");
|
|
139
|
+
|
|
140
|
+
// src/define/constructor.ts
|
|
141
|
+
var constructor = createConstructor((Inst, props, options) => {
|
|
142
|
+
const { container, deferred, context: _context = /* @__PURE__ */ new Map() } = options;
|
|
143
|
+
function vanish() {
|
|
144
|
+
childApp.$destroy();
|
|
145
|
+
container.remove();
|
|
146
|
+
}
|
|
147
|
+
const context2 = new Map([..._context.entries()]);
|
|
148
|
+
context2.set(injectOverlayKey, {
|
|
149
|
+
resolve: deferred.resolve,
|
|
150
|
+
reject: deferred.reject,
|
|
151
|
+
deferred,
|
|
152
|
+
visible: false,
|
|
153
|
+
vanish
|
|
154
|
+
});
|
|
155
|
+
const childApp = new Inst({
|
|
156
|
+
target: container,
|
|
157
|
+
props,
|
|
158
|
+
context: context2
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// src/define/index.ts
|
|
163
|
+
var defineOverlay = constructor.define;
|
|
164
|
+
var renderOverlay = constructor.render;
|
|
165
|
+
|
|
166
|
+
// ../../node_modules/.pnpm/svelte@3.57.0/node_modules/svelte/internal/index.mjs
|
|
167
|
+
function noop() {
|
|
168
|
+
}
|
|
169
|
+
function assign(tar, src) {
|
|
170
|
+
for (const k in src)
|
|
171
|
+
tar[k] = src[k];
|
|
172
|
+
return tar;
|
|
173
|
+
}
|
|
174
|
+
function run(fn) {
|
|
175
|
+
return fn();
|
|
176
|
+
}
|
|
177
|
+
function blank_object() {
|
|
178
|
+
return /* @__PURE__ */ Object.create(null);
|
|
179
|
+
}
|
|
180
|
+
function run_all(fns) {
|
|
181
|
+
fns.forEach(run);
|
|
182
|
+
}
|
|
183
|
+
function is_function(thing) {
|
|
184
|
+
return typeof thing === "function";
|
|
185
|
+
}
|
|
186
|
+
function safe_not_equal(a, b) {
|
|
187
|
+
return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function");
|
|
188
|
+
}
|
|
189
|
+
function is_empty(obj) {
|
|
190
|
+
return Object.keys(obj).length === 0;
|
|
191
|
+
}
|
|
192
|
+
function create_slot(definition, ctx, $$scope, fn) {
|
|
193
|
+
if (definition) {
|
|
194
|
+
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
|
195
|
+
return definition[0](slot_ctx);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function get_slot_context(definition, ctx, $$scope, fn) {
|
|
199
|
+
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
|
|
200
|
+
}
|
|
201
|
+
function get_slot_changes(definition, $$scope, dirty, fn) {
|
|
202
|
+
if (definition[2] && fn) {
|
|
203
|
+
const lets = definition[2](fn(dirty));
|
|
204
|
+
if ($$scope.dirty === void 0) {
|
|
205
|
+
return lets;
|
|
206
|
+
}
|
|
207
|
+
if (typeof lets === "object") {
|
|
208
|
+
const merged = [];
|
|
209
|
+
const len = Math.max($$scope.dirty.length, lets.length);
|
|
210
|
+
for (let i = 0; i < len; i += 1) {
|
|
211
|
+
merged[i] = $$scope.dirty[i] | lets[i];
|
|
212
|
+
}
|
|
213
|
+
return merged;
|
|
214
|
+
}
|
|
215
|
+
return $$scope.dirty | lets;
|
|
216
|
+
}
|
|
217
|
+
return $$scope.dirty;
|
|
218
|
+
}
|
|
219
|
+
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
|
|
220
|
+
if (slot_changes) {
|
|
221
|
+
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
|
222
|
+
slot.p(slot_context, slot_changes);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function get_all_dirty_from_scope($$scope) {
|
|
226
|
+
if ($$scope.ctx.length > 32) {
|
|
227
|
+
const dirty = [];
|
|
228
|
+
const length = $$scope.ctx.length / 32;
|
|
229
|
+
for (let i = 0; i < length; i++) {
|
|
230
|
+
dirty[i] = -1;
|
|
231
|
+
}
|
|
232
|
+
return dirty;
|
|
233
|
+
}
|
|
234
|
+
return -1;
|
|
235
|
+
}
|
|
236
|
+
var is_hydrating = false;
|
|
237
|
+
function start_hydrating() {
|
|
238
|
+
is_hydrating = true;
|
|
239
|
+
}
|
|
240
|
+
function end_hydrating() {
|
|
241
|
+
is_hydrating = false;
|
|
242
|
+
}
|
|
243
|
+
function insert(target, node, anchor) {
|
|
244
|
+
target.insertBefore(node, anchor || null);
|
|
245
|
+
}
|
|
246
|
+
function detach(node) {
|
|
247
|
+
if (node.parentNode) {
|
|
248
|
+
node.parentNode.removeChild(node);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function text(data) {
|
|
252
|
+
return document.createTextNode(data);
|
|
253
|
+
}
|
|
254
|
+
function empty() {
|
|
255
|
+
return text("");
|
|
256
|
+
}
|
|
257
|
+
function children(element) {
|
|
258
|
+
return Array.from(element.childNodes);
|
|
259
|
+
}
|
|
260
|
+
var current_component;
|
|
261
|
+
function set_current_component(component) {
|
|
262
|
+
current_component = component;
|
|
263
|
+
}
|
|
264
|
+
function get_current_component() {
|
|
265
|
+
if (!current_component)
|
|
266
|
+
throw new Error("Function called outside component initialization");
|
|
267
|
+
return current_component;
|
|
268
|
+
}
|
|
269
|
+
function setContext(key, context2) {
|
|
270
|
+
get_current_component().$$.context.set(key, context2);
|
|
271
|
+
return context2;
|
|
272
|
+
}
|
|
273
|
+
function getContext(key) {
|
|
274
|
+
return get_current_component().$$.context.get(key);
|
|
275
|
+
}
|
|
276
|
+
var dirty_components = [];
|
|
277
|
+
var binding_callbacks = [];
|
|
278
|
+
var render_callbacks = [];
|
|
279
|
+
var flush_callbacks = [];
|
|
280
|
+
var resolved_promise = /* @__PURE__ */ Promise.resolve();
|
|
281
|
+
var update_scheduled = false;
|
|
282
|
+
function schedule_update() {
|
|
283
|
+
if (!update_scheduled) {
|
|
284
|
+
update_scheduled = true;
|
|
285
|
+
resolved_promise.then(flush);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function add_render_callback(fn) {
|
|
289
|
+
render_callbacks.push(fn);
|
|
290
|
+
}
|
|
291
|
+
var seen_callbacks = /* @__PURE__ */ new Set();
|
|
292
|
+
var flushidx = 0;
|
|
293
|
+
function flush() {
|
|
294
|
+
if (flushidx !== 0) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const saved_component = current_component;
|
|
298
|
+
do {
|
|
299
|
+
try {
|
|
300
|
+
while (flushidx < dirty_components.length) {
|
|
301
|
+
const component = dirty_components[flushidx];
|
|
302
|
+
flushidx++;
|
|
303
|
+
set_current_component(component);
|
|
304
|
+
update(component.$$);
|
|
305
|
+
}
|
|
306
|
+
} catch (e) {
|
|
307
|
+
dirty_components.length = 0;
|
|
308
|
+
flushidx = 0;
|
|
309
|
+
throw e;
|
|
310
|
+
}
|
|
311
|
+
set_current_component(null);
|
|
312
|
+
dirty_components.length = 0;
|
|
313
|
+
flushidx = 0;
|
|
314
|
+
while (binding_callbacks.length)
|
|
315
|
+
binding_callbacks.pop()();
|
|
316
|
+
for (let i = 0; i < render_callbacks.length; i += 1) {
|
|
317
|
+
const callback = render_callbacks[i];
|
|
318
|
+
if (!seen_callbacks.has(callback)) {
|
|
319
|
+
seen_callbacks.add(callback);
|
|
320
|
+
callback();
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
render_callbacks.length = 0;
|
|
324
|
+
} while (dirty_components.length);
|
|
325
|
+
while (flush_callbacks.length) {
|
|
326
|
+
flush_callbacks.pop()();
|
|
327
|
+
}
|
|
328
|
+
update_scheduled = false;
|
|
329
|
+
seen_callbacks.clear();
|
|
330
|
+
set_current_component(saved_component);
|
|
331
|
+
}
|
|
332
|
+
function update($$) {
|
|
333
|
+
if ($$.fragment !== null) {
|
|
334
|
+
$$.update();
|
|
335
|
+
run_all($$.before_update);
|
|
336
|
+
const dirty = $$.dirty;
|
|
337
|
+
$$.dirty = [-1];
|
|
338
|
+
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
|
339
|
+
$$.after_update.forEach(add_render_callback);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function flush_render_callbacks(fns) {
|
|
343
|
+
const filtered = [];
|
|
344
|
+
const targets = [];
|
|
345
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
|
346
|
+
targets.forEach((c) => c());
|
|
347
|
+
render_callbacks = filtered;
|
|
348
|
+
}
|
|
349
|
+
var outroing = /* @__PURE__ */ new Set();
|
|
350
|
+
var outros;
|
|
351
|
+
function group_outros() {
|
|
352
|
+
outros = {
|
|
353
|
+
r: 0,
|
|
354
|
+
c: [],
|
|
355
|
+
p: outros
|
|
356
|
+
// parent group
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function check_outros() {
|
|
360
|
+
if (!outros.r) {
|
|
361
|
+
run_all(outros.c);
|
|
362
|
+
}
|
|
363
|
+
outros = outros.p;
|
|
364
|
+
}
|
|
365
|
+
function transition_in(block, local) {
|
|
366
|
+
if (block && block.i) {
|
|
367
|
+
outroing.delete(block);
|
|
368
|
+
block.i(local);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function transition_out(block, local, detach2, callback) {
|
|
372
|
+
if (block && block.o) {
|
|
373
|
+
if (outroing.has(block))
|
|
374
|
+
return;
|
|
375
|
+
outroing.add(block);
|
|
376
|
+
outros.c.push(() => {
|
|
377
|
+
outroing.delete(block);
|
|
378
|
+
if (callback) {
|
|
379
|
+
if (detach2)
|
|
380
|
+
block.d(1);
|
|
381
|
+
callback();
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
block.o(local);
|
|
385
|
+
} else if (callback) {
|
|
386
|
+
callback();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
|
390
|
+
var _boolean_attributes = [
|
|
391
|
+
"allowfullscreen",
|
|
392
|
+
"allowpaymentrequest",
|
|
393
|
+
"async",
|
|
394
|
+
"autofocus",
|
|
395
|
+
"autoplay",
|
|
396
|
+
"checked",
|
|
397
|
+
"controls",
|
|
398
|
+
"default",
|
|
399
|
+
"defer",
|
|
400
|
+
"disabled",
|
|
401
|
+
"formnovalidate",
|
|
402
|
+
"hidden",
|
|
403
|
+
"inert",
|
|
404
|
+
"ismap",
|
|
405
|
+
"itemscope",
|
|
406
|
+
"loop",
|
|
407
|
+
"multiple",
|
|
408
|
+
"muted",
|
|
409
|
+
"nomodule",
|
|
410
|
+
"novalidate",
|
|
411
|
+
"open",
|
|
412
|
+
"playsinline",
|
|
413
|
+
"readonly",
|
|
414
|
+
"required",
|
|
415
|
+
"reversed",
|
|
416
|
+
"selected"
|
|
417
|
+
];
|
|
418
|
+
var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]);
|
|
419
|
+
function mount_component(component, target, anchor, customElement) {
|
|
420
|
+
const { fragment, after_update } = component.$$;
|
|
421
|
+
fragment && fragment.m(target, anchor);
|
|
422
|
+
if (!customElement) {
|
|
423
|
+
add_render_callback(() => {
|
|
424
|
+
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
|
425
|
+
if (component.$$.on_destroy) {
|
|
426
|
+
component.$$.on_destroy.push(...new_on_destroy);
|
|
427
|
+
} else {
|
|
428
|
+
run_all(new_on_destroy);
|
|
429
|
+
}
|
|
430
|
+
component.$$.on_mount = [];
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
after_update.forEach(add_render_callback);
|
|
434
|
+
}
|
|
435
|
+
function destroy_component(component, detaching) {
|
|
436
|
+
const $$ = component.$$;
|
|
437
|
+
if ($$.fragment !== null) {
|
|
438
|
+
flush_render_callbacks($$.after_update);
|
|
439
|
+
run_all($$.on_destroy);
|
|
440
|
+
$$.fragment && $$.fragment.d(detaching);
|
|
441
|
+
$$.on_destroy = $$.fragment = null;
|
|
442
|
+
$$.ctx = [];
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function make_dirty(component, i) {
|
|
446
|
+
if (component.$$.dirty[0] === -1) {
|
|
447
|
+
dirty_components.push(component);
|
|
448
|
+
schedule_update();
|
|
449
|
+
component.$$.dirty.fill(0);
|
|
450
|
+
}
|
|
451
|
+
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
|
452
|
+
}
|
|
453
|
+
function init(component, options, instance2, create_fragment2, not_equal, props, append_styles, dirty = [-1]) {
|
|
454
|
+
const parent_component = current_component;
|
|
455
|
+
set_current_component(component);
|
|
456
|
+
const $$ = component.$$ = {
|
|
457
|
+
fragment: null,
|
|
458
|
+
ctx: [],
|
|
459
|
+
// state
|
|
460
|
+
props,
|
|
461
|
+
update: noop,
|
|
462
|
+
not_equal,
|
|
463
|
+
bound: blank_object(),
|
|
464
|
+
// lifecycle
|
|
465
|
+
on_mount: [],
|
|
466
|
+
on_destroy: [],
|
|
467
|
+
on_disconnect: [],
|
|
468
|
+
before_update: [],
|
|
469
|
+
after_update: [],
|
|
470
|
+
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
|
471
|
+
// everything else
|
|
472
|
+
callbacks: blank_object(),
|
|
473
|
+
dirty,
|
|
474
|
+
skip_bound: false,
|
|
475
|
+
root: options.target || parent_component.$$.root
|
|
476
|
+
};
|
|
477
|
+
append_styles && append_styles($$.root);
|
|
478
|
+
let ready = false;
|
|
479
|
+
$$.ctx = instance2 ? instance2(component, options.props || {}, (i, ret, ...rest) => {
|
|
480
|
+
const value = rest.length ? rest[0] : ret;
|
|
481
|
+
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
|
482
|
+
if (!$$.skip_bound && $$.bound[i])
|
|
483
|
+
$$.bound[i](value);
|
|
484
|
+
if (ready)
|
|
485
|
+
make_dirty(component, i);
|
|
486
|
+
}
|
|
487
|
+
return ret;
|
|
488
|
+
}) : [];
|
|
489
|
+
$$.update();
|
|
490
|
+
ready = true;
|
|
491
|
+
run_all($$.before_update);
|
|
492
|
+
$$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
|
|
493
|
+
if (options.target) {
|
|
494
|
+
if (options.hydrate) {
|
|
495
|
+
start_hydrating();
|
|
496
|
+
const nodes = children(options.target);
|
|
497
|
+
$$.fragment && $$.fragment.l(nodes);
|
|
498
|
+
nodes.forEach(detach);
|
|
499
|
+
} else {
|
|
500
|
+
$$.fragment && $$.fragment.c();
|
|
501
|
+
}
|
|
502
|
+
if (options.intro)
|
|
503
|
+
transition_in(component.$$.fragment);
|
|
504
|
+
mount_component(component, options.target, options.anchor, options.customElement);
|
|
505
|
+
end_hydrating();
|
|
506
|
+
flush();
|
|
507
|
+
}
|
|
508
|
+
set_current_component(parent_component);
|
|
509
|
+
}
|
|
510
|
+
var SvelteElement;
|
|
511
|
+
if (typeof HTMLElement === "function") {
|
|
512
|
+
SvelteElement = class extends HTMLElement {
|
|
513
|
+
constructor() {
|
|
514
|
+
super();
|
|
515
|
+
this.attachShadow({ mode: "open" });
|
|
516
|
+
}
|
|
517
|
+
connectedCallback() {
|
|
518
|
+
const { on_mount } = this.$$;
|
|
519
|
+
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
|
520
|
+
for (const key in this.$$.slotted) {
|
|
521
|
+
this.appendChild(this.$$.slotted[key]);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
attributeChangedCallback(attr, _oldValue, newValue) {
|
|
525
|
+
this[attr] = newValue;
|
|
526
|
+
}
|
|
527
|
+
disconnectedCallback() {
|
|
528
|
+
run_all(this.$$.on_disconnect);
|
|
529
|
+
}
|
|
530
|
+
$destroy() {
|
|
531
|
+
destroy_component(this, 1);
|
|
532
|
+
this.$destroy = noop;
|
|
533
|
+
}
|
|
534
|
+
$on(type, callback) {
|
|
535
|
+
if (!is_function(callback)) {
|
|
536
|
+
return noop;
|
|
537
|
+
}
|
|
538
|
+
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
539
|
+
callbacks.push(callback);
|
|
540
|
+
return () => {
|
|
541
|
+
const index = callbacks.indexOf(callback);
|
|
542
|
+
if (index !== -1)
|
|
543
|
+
callbacks.splice(index, 1);
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
$set($$props) {
|
|
547
|
+
if (this.$$set && !is_empty($$props)) {
|
|
548
|
+
this.$$.skip_bound = true;
|
|
549
|
+
this.$$set($$props);
|
|
550
|
+
this.$$.skip_bound = false;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
var SvelteComponent = class {
|
|
556
|
+
$destroy() {
|
|
557
|
+
destroy_component(this, 1);
|
|
558
|
+
this.$destroy = noop;
|
|
559
|
+
}
|
|
560
|
+
$on(type, callback) {
|
|
561
|
+
if (!is_function(callback)) {
|
|
562
|
+
return noop;
|
|
563
|
+
}
|
|
564
|
+
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
565
|
+
callbacks.push(callback);
|
|
566
|
+
return () => {
|
|
567
|
+
const index = callbacks.indexOf(callback);
|
|
568
|
+
if (index !== -1)
|
|
569
|
+
callbacks.splice(index, 1);
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
$set($$props) {
|
|
573
|
+
if (this.$$set && !is_empty($$props)) {
|
|
574
|
+
this.$$.skip_bound = true;
|
|
575
|
+
this.$$set($$props);
|
|
576
|
+
this.$$.skip_bound = false;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
var SvelteComponentDev = class extends SvelteComponent {
|
|
581
|
+
constructor(options) {
|
|
582
|
+
if (!options || !options.target && !options.$$inline) {
|
|
583
|
+
throw new Error("'target' is a required option");
|
|
584
|
+
}
|
|
585
|
+
super();
|
|
586
|
+
}
|
|
587
|
+
$destroy() {
|
|
588
|
+
super.$destroy();
|
|
589
|
+
this.$destroy = () => {
|
|
590
|
+
console.warn("Component was already destroyed");
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
$capture_state() {
|
|
594
|
+
}
|
|
595
|
+
$inject_state() {
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
var SvelteComponentTyped = class extends SvelteComponentDev {
|
|
599
|
+
constructor(options) {
|
|
600
|
+
super(options);
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
// ../../node_modules/.pnpm/svelte@3.57.0/node_modules/svelte/ssr.mjs
|
|
605
|
+
function onMount() {
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// src/composable/usePrograms.ts
|
|
609
|
+
function usePrograms(options = {}) {
|
|
610
|
+
setContext(injectOptionsKey, options);
|
|
611
|
+
return getContext(injectOverlayKey);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// src/components/index.ts
|
|
615
|
+
function create_if_block(ctx) {
|
|
616
|
+
let current;
|
|
617
|
+
const default_slot_template = (
|
|
618
|
+
/* #slots */
|
|
619
|
+
ctx[2].default
|
|
620
|
+
);
|
|
621
|
+
const default_slot = create_slot(
|
|
622
|
+
default_slot_template,
|
|
623
|
+
ctx,
|
|
624
|
+
/* $$scope */
|
|
625
|
+
ctx[1],
|
|
626
|
+
null
|
|
627
|
+
);
|
|
628
|
+
return {
|
|
629
|
+
c() {
|
|
630
|
+
if (default_slot)
|
|
631
|
+
default_slot.c();
|
|
632
|
+
},
|
|
633
|
+
m(target, anchor) {
|
|
634
|
+
if (default_slot)
|
|
635
|
+
default_slot.m(target, anchor);
|
|
636
|
+
current = true;
|
|
637
|
+
},
|
|
638
|
+
p(ctx2, dirty) {
|
|
639
|
+
if (default_slot) {
|
|
640
|
+
if (default_slot.p && (!current || dirty & 2)) {
|
|
641
|
+
update_slot_base(
|
|
642
|
+
default_slot,
|
|
643
|
+
default_slot_template,
|
|
644
|
+
ctx2,
|
|
645
|
+
/* $$scope */
|
|
646
|
+
ctx2[1],
|
|
647
|
+
!current ? get_all_dirty_from_scope(
|
|
648
|
+
/* $$scope */
|
|
649
|
+
ctx2[1]
|
|
650
|
+
) : get_slot_changes(
|
|
651
|
+
default_slot_template,
|
|
652
|
+
/* $$scope */
|
|
653
|
+
ctx2[1],
|
|
654
|
+
dirty,
|
|
655
|
+
null
|
|
656
|
+
),
|
|
657
|
+
null
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
i(local) {
|
|
663
|
+
if (current)
|
|
664
|
+
return;
|
|
665
|
+
transition_in(default_slot, local);
|
|
666
|
+
current = true;
|
|
667
|
+
},
|
|
668
|
+
o(local) {
|
|
669
|
+
transition_out(default_slot, local);
|
|
670
|
+
current = false;
|
|
671
|
+
},
|
|
672
|
+
d(detaching) {
|
|
673
|
+
if (default_slot)
|
|
674
|
+
default_slot.d(detaching);
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function create_fragment(ctx) {
|
|
679
|
+
let if_block_anchor;
|
|
680
|
+
let current;
|
|
681
|
+
let if_block = (
|
|
682
|
+
/* visible */
|
|
683
|
+
ctx[0] && create_if_block(ctx)
|
|
684
|
+
);
|
|
685
|
+
return {
|
|
686
|
+
c() {
|
|
687
|
+
if (if_block)
|
|
688
|
+
if_block.c();
|
|
689
|
+
if_block_anchor = empty();
|
|
690
|
+
},
|
|
691
|
+
m(target, anchor) {
|
|
692
|
+
if (if_block)
|
|
693
|
+
if_block.m(target, anchor);
|
|
694
|
+
insert(target, if_block_anchor, anchor);
|
|
695
|
+
current = true;
|
|
696
|
+
},
|
|
697
|
+
p(ctx2, [dirty]) {
|
|
698
|
+
if (
|
|
699
|
+
/* visible */
|
|
700
|
+
ctx2[0]
|
|
701
|
+
) {
|
|
702
|
+
if (if_block) {
|
|
703
|
+
if_block.p(ctx2, dirty);
|
|
704
|
+
if (dirty & 1)
|
|
705
|
+
transition_in(if_block, 1);
|
|
706
|
+
} else {
|
|
707
|
+
if_block = create_if_block(ctx2);
|
|
708
|
+
if_block.c();
|
|
709
|
+
transition_in(if_block, 1);
|
|
710
|
+
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
711
|
+
}
|
|
712
|
+
} else if (if_block) {
|
|
713
|
+
group_outros();
|
|
714
|
+
transition_out(if_block, 1, 1, () => {
|
|
715
|
+
if_block = null;
|
|
716
|
+
});
|
|
717
|
+
check_outros();
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
i() {
|
|
721
|
+
if (current)
|
|
722
|
+
return;
|
|
723
|
+
transition_in(if_block);
|
|
724
|
+
current = true;
|
|
725
|
+
},
|
|
726
|
+
o() {
|
|
727
|
+
transition_out(if_block);
|
|
728
|
+
current = false;
|
|
729
|
+
},
|
|
730
|
+
d(detaching) {
|
|
731
|
+
if (if_block)
|
|
732
|
+
if_block.d(detaching);
|
|
733
|
+
if (detaching)
|
|
734
|
+
detach(if_block_anchor);
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
function instance($$self, $$props, $$invalidate) {
|
|
739
|
+
let { $$slots: slots = {}, $$scope } = $$props;
|
|
740
|
+
let { visible = false } = $$props;
|
|
741
|
+
const { duration = 0, immediate = true } = getContext(injectOptionsKey) || {};
|
|
742
|
+
const { deferred, vanish } = getContext(injectOverlayKey);
|
|
743
|
+
async function destroy() {
|
|
744
|
+
$$invalidate(0, visible = false);
|
|
745
|
+
await delay(duration);
|
|
746
|
+
vanish == null ? void 0 : vanish();
|
|
747
|
+
return Promise.resolve();
|
|
748
|
+
}
|
|
749
|
+
onMount(() => immediate && $$invalidate(0, visible = true));
|
|
750
|
+
deferred == null ? void 0 : deferred.then(destroy).catch(destroy);
|
|
751
|
+
$$self.$$set = ($$props2) => {
|
|
752
|
+
if ("visible" in $$props2)
|
|
753
|
+
$$invalidate(0, visible = $$props2.visible);
|
|
754
|
+
if ("$$scope" in $$props2)
|
|
755
|
+
$$invalidate(1, $$scope = $$props2.$$scope);
|
|
756
|
+
};
|
|
757
|
+
return [visible, $$scope, slots];
|
|
758
|
+
}
|
|
759
|
+
var Overlay = class extends SvelteComponentTyped {
|
|
760
|
+
constructor(options) {
|
|
761
|
+
super(options);
|
|
762
|
+
init(this, options, instance, create_fragment, safe_not_equal, { visible: 0 }, noop);
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
return __toCommonJS(src_exports);
|
|
766
|
+
})();
|