fubi 1.0.0-beta.5 → 1.0.0-beta.6
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/index.es.js +1571 -571
- package/dist/index.iife.js +2 -2
- package/package.json +3 -4
package/dist/index.es.js
CHANGED
|
@@ -13,7 +13,6 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
13
13
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
14
14
|
var __superGet = (cls, obj, key2) => __reflectGet(__getProtoOf(cls), key2, obj);
|
|
15
15
|
var _previous, _callbacks, _pending, _blocking_pending, _deferred, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, resolve_fn, commit_fn, _pending2, _anchor, _hydrate_open, _props, _children, _effect, _main_effect, _pending_effect, _failed_effect, _offscreen_fragment, _local_pending_count, _pending_count, _is_creating_fallback, _effect_pending, _effect_pending_update, _effect_pending_subscriber, _Boundary_instances, hydrate_resolved_content_fn, hydrate_pending_content_fn, run_fn, show_pending_snippet_fn, update_pending_count_fn, _batches, _onscreen, _offscreen, _transition, _commit, _listeners, _observer, _options, _ResizeObserverSingleton_instances, getObserver_fn, _sources, _version, _size, _update_version, _SvelteMap_instances, source_fn, read_all_fn, _callback, _fpsLimitOption, _fpsLimit, _previousTimestamp, _frame, _fps, _running, _window, _AnimationFrames_instances, loop_fn, _current, _key, _serializer, _storage, _subscribe, _update, _proxies, _handleStorageEvent, _PersistedState_instances, deserialize_fn, serialize_fn, _options2, _element, _idle, _offset, _onScroll, _onStop, _eventListenerOptions, _behavior, _onError, _internalX, _internalY, _x, _y, _isScrolling, _arrived, _directions, _progress, _onScrollHandler, _loading, _ready, _error, _maintenance, _title, _message, _user, _msg, _listeners2, _hovering, _focusWithin, _lastUsedFeature, _visible, _minimized, _a, _active, _id, _current2, _error2, _id2, _current3, _error3, _hasAccess, _role, _data, _error4, _filter, _query, _sort, _page, _perPage, _empty, _unlockedFolders, _canAccess, _filter2, _query2, _users, _b, _c, _url, _filter3, _current4, _pageName, _error5, _isNew, _meta, _d, _stiffness, _damping, _precision, _current5, _target, _last_value, _last_time, _inverse_mass, _momentum, _task, _deferred2, _Spring_instances, update_fn, _el, _canOpen, _contentScrollState, _breakpoints, _currentBreakpoint, _nextBreakpoint, _dragging, _visible2, _back, _e, _visible3, _tabActive, _f, _touch, _root, _name, _key2, _size2, _observed, _options3, _node, _window2, _width, _height, _subscribe2, _variant, _prefix, _opts, _currentTabStopId, _opts2, _currentFrame, _AnimationsComplete_instances, cleanup_fn, executeCallback_fn, _opts3, _enabled, _afterAnimations, _shouldRender, _triggerNode, _contentNode, _overlayNode, _descriptionNode, _contentId, _titleId, _triggerId, _descriptionId, _cancelNode, _nestedOpenCount, _sharedProps, _props2, _props3, _props4, _snippetProps, _props5, _snippetProps2, _props6, _opts4, _search, _onMatch, _getCurrentItem, _opts5, _enabled2, _isPointerInTransit, _pointerGraceArea, _GraceArea_instances, removeGraceArea_fn, createGraceArea_fn, _ignoreCloseAutoFocus, _isPointerInTransit2, _contentNode2, _triggerNode2, _search2, _timer, _handleTypeaheadSearch, _mounted, _isSub, _MenuContentState_instances, getCandidateNodes_fn, isPointerMovingToSubmenu_fn, _snippetProps3, _props7, _isFocused, _props8, _isPointerDown, _MenuItemState_instances, handleSelect_fn, _props9, _ariaControls, _props10, _interactOutsideProp, _behaviorType, _interceptedEvents, _isResponsibleLayer, _isFocusInsideDOMTree, _documentObj, _onFocusOutside, _unsubClickListener, _handleFocus, _DismissibleLayerState_instances, addEventListeners_fn, _handleDismiss, _handleInteractOutside, _markInterceptedEvent, _markNonInterceptedEvent, _markResponsibleLayer, _isTargetWithinLayer, _resetState, isAnyEventIntercepted_fn, _onfocuscapture, _onblurcapture, _addEventListener, _onkeydown, _scopeStack, _focusHistory, _preFocusHistory, _paused, _container, _manager, _cleanupFns, _opts6, _FocusScope_instances, cleanup_fn2, handleOpenAutoFocus_fn, handleCloseAutoFocus_fn, setupEventListeners_fn, getTabbables_fn, getFirstTabbable_fn, getAllFocusables_fn, _unsubSelectionLock, _TextSelectionLayerState_instances, addEventListeners_fn2, _pointerdown, _resetSelectionLock, _factory, _subscribers, _state, _scope, _SharedState_instances, dispose_fn, _id3, _initialState, _restoreScrollDelay, _countState, _transformedStyle, _updatePositionStrategy, _arrowSize, _arrowWidth, _arrowHeight, _desiredPlacement, _boundary, _hasExplicitBoundaries, _detectOverflowOptions, _availableWidth, _availableHeight, _anchorWidth, _anchorHeight, _middleware, _placedSide, _placedAlign, _arrowX, _arrowY, _cannotCenterArrow, _contentZIndex, _arrowBaseSide, _wrapperProps, _props11, _arrowStyle, _contentNode3, _triggerNode3, _overlayNode2, _snippetProps4, _props12, _interval, _cb, _timer2, _TimeoutFn_instances, clear_fn, _isOpenDelayed, _timerFn, _openTooltip, _startTimer, _clearTimer, _delayDuration, _disableHoverableContent, _disableCloseOnTriggerClick, _disabled, _ignoreNonKeyboardFocus, _contentNode4, _triggerNode4, _wasOpenDelayed, _timerFn2, _stateAttr, _handleDelayedOpen, _isPointerDown2, _hasPointerMoveOpened, _isDisabled, _transitCheckTimeout, _clearTransitCheck, _onpointerup, _onpointerdown, _onpointerenter, _onpointermove, _onpointerleave, _onfocus, _onblur, _onclick, _props13, _snippetProps5, _props14, _routes, _navigating, _direction, _pageLoaded, _canBack, _hasAutoNavigatedToComments, _previous2, _next, _allowed, _scroll, _insideFubi, _mouse, _emptyHover, _previous3, _current6, _info, _isolated, _mode, _path, _highlightVisible, _highlightCoords, _ignoreSelectors, _ignoreNextClick, _filter4, _threads, _grouped, _filteredThreads, _bindings, _filter5, _query3, _url2, _current7, _html, _priority, _element2, _trigger, _focused, _visible4, _g, _open, _type, _query4, _selectedIndex, _anchorElement, _items, _h, _enabled3, _from, _to, _fromAnchor, _toAnchor, _isAbove, _isLeft, _isSameLevel, _isCloserToBottom, _bounds, _i, _instances, _visible5, _shareImage, _favicon, _touchicon, _title2, _description;
|
|
16
|
-
import PocketBase from "pocketbase";
|
|
17
16
|
var is_array = Array.isArray;
|
|
18
17
|
var index_of = Array.prototype.indexOf;
|
|
19
18
|
var array_from = Array.from;
|
|
@@ -30,8 +29,8 @@ function is_function(thing) {
|
|
|
30
29
|
const noop$2 = () => {
|
|
31
30
|
};
|
|
32
31
|
function run_all(arr) {
|
|
33
|
-
for (var
|
|
34
|
-
arr[
|
|
32
|
+
for (var i2 = 0; i2 < arr.length; i2++) {
|
|
33
|
+
arr[i2]();
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
function deferred() {
|
|
@@ -43,7 +42,7 @@ function deferred() {
|
|
|
43
42
|
});
|
|
44
43
|
return { promise, resolve, reject };
|
|
45
44
|
}
|
|
46
|
-
function to_array(value,
|
|
45
|
+
function to_array(value, n2) {
|
|
47
46
|
if (Array.isArray(value)) {
|
|
48
47
|
return value;
|
|
49
48
|
}
|
|
@@ -53,7 +52,7 @@ function to_array(value, n) {
|
|
|
53
52
|
const array = [];
|
|
54
53
|
for (const element of value) {
|
|
55
54
|
array.push(element);
|
|
56
|
-
if (array.length ===
|
|
55
|
+
if (array.length === n2) break;
|
|
57
56
|
}
|
|
58
57
|
return array;
|
|
59
58
|
}
|
|
@@ -207,10 +206,10 @@ function clone(value, cloned, path, paths, original = null, no_tojson = false) {
|
|
|
207
206
|
if (original !== null) {
|
|
208
207
|
cloned.set(original, copy);
|
|
209
208
|
}
|
|
210
|
-
for (var
|
|
211
|
-
var element = value[
|
|
212
|
-
if (
|
|
213
|
-
copy[
|
|
209
|
+
for (var i2 = 0; i2 < value.length; i2 += 1) {
|
|
210
|
+
var element = value[i2];
|
|
211
|
+
if (i2 in value) {
|
|
212
|
+
copy[i2] = clone(element, cloned, path, paths, null, no_tojson);
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
return copy;
|
|
@@ -264,7 +263,7 @@ function clone(value, cloned, path, paths, original = null, no_tojson = false) {
|
|
|
264
263
|
/** @type {Snapshot<T>} */
|
|
265
264
|
structuredClone(value)
|
|
266
265
|
);
|
|
267
|
-
} catch (
|
|
266
|
+
} catch (e2) {
|
|
268
267
|
return (
|
|
269
268
|
/** @type {Snapshot<T>} */
|
|
270
269
|
value
|
|
@@ -392,8 +391,8 @@ function invoke_error_boundary(error, effect2) {
|
|
|
392
391
|
try {
|
|
393
392
|
effect2.b.error(error);
|
|
394
393
|
return;
|
|
395
|
-
} catch (
|
|
396
|
-
error =
|
|
394
|
+
} catch (e2) {
|
|
395
|
+
error = e2;
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
398
|
effect2 = effect2.parent;
|
|
@@ -562,13 +561,13 @@ const _Batch = class _Batch {
|
|
|
562
561
|
decrement(blocking) {
|
|
563
562
|
__privateSet(this, _pending, __privateGet(this, _pending) - 1);
|
|
564
563
|
if (blocking) __privateSet(this, _blocking_pending, __privateGet(this, _blocking_pending) - 1);
|
|
565
|
-
for (const
|
|
566
|
-
set_signal_status(
|
|
567
|
-
schedule_effect(
|
|
564
|
+
for (const e2 of __privateGet(this, _dirty_effects)) {
|
|
565
|
+
set_signal_status(e2, DIRTY);
|
|
566
|
+
schedule_effect(e2);
|
|
568
567
|
}
|
|
569
|
-
for (const
|
|
570
|
-
set_signal_status(
|
|
571
|
-
schedule_effect(
|
|
568
|
+
for (const e2 of __privateGet(this, _maybe_dirty_effects)) {
|
|
569
|
+
set_signal_status(e2, MAYBE_DIRTY);
|
|
570
|
+
schedule_effect(e2);
|
|
572
571
|
}
|
|
573
572
|
__privateSet(this, _dirty_effects, []);
|
|
574
573
|
__privateSet(this, _maybe_dirty_effects, []);
|
|
@@ -670,10 +669,10 @@ traverse_effect_tree_fn = function(root2, target) {
|
|
|
670
669
|
* @param {Effect[]} effects
|
|
671
670
|
*/
|
|
672
671
|
defer_effects_fn = function(effects) {
|
|
673
|
-
for (const
|
|
674
|
-
const target = (
|
|
675
|
-
target.push(
|
|
676
|
-
set_signal_status(
|
|
672
|
+
for (const e2 of effects) {
|
|
673
|
+
const target = (e2.f & DIRTY) !== 0 ? __privateGet(this, _dirty_effects) : __privateGet(this, _maybe_dirty_effects);
|
|
674
|
+
target.push(e2);
|
|
675
|
+
set_signal_status(e2, CLEAN);
|
|
677
676
|
}
|
|
678
677
|
};
|
|
679
678
|
resolve_fn = function() {
|
|
@@ -717,7 +716,7 @@ commit_fn = function() {
|
|
|
717
716
|
if (sources.length === 0) {
|
|
718
717
|
continue;
|
|
719
718
|
}
|
|
720
|
-
const others = [...batch.current.keys()].filter((
|
|
719
|
+
const others = [...batch.current.keys()].filter((s2) => !this.current.has(s2));
|
|
721
720
|
if (others.length > 0) {
|
|
722
721
|
for (const source2 of sources) {
|
|
723
722
|
mark_effects(source2, others);
|
|
@@ -795,9 +794,9 @@ let eager_block_effects = null;
|
|
|
795
794
|
function flush_queued_effects(effects) {
|
|
796
795
|
var length = effects.length;
|
|
797
796
|
if (length === 0) return;
|
|
798
|
-
var
|
|
799
|
-
while (
|
|
800
|
-
var effect2 = effects[
|
|
797
|
+
var i2 = 0;
|
|
798
|
+
while (i2 < length) {
|
|
799
|
+
var effect2 = effects[i2++];
|
|
801
800
|
if ((effect2.f & (DESTROYED | INERT)) === 0 && is_dirty(effect2)) {
|
|
802
801
|
eager_block_effects = /* @__PURE__ */ new Set();
|
|
803
802
|
update_effect(effect2);
|
|
@@ -810,10 +809,10 @@ function flush_queued_effects(effects) {
|
|
|
810
809
|
}
|
|
811
810
|
if ((eager_block_effects == null ? void 0 : eager_block_effects.size) > 0) {
|
|
812
811
|
old_values.clear();
|
|
813
|
-
for (const
|
|
814
|
-
if ((
|
|
815
|
-
const ordered_effects = [
|
|
816
|
-
let ancestor =
|
|
812
|
+
for (const e2 of eager_block_effects) {
|
|
813
|
+
if ((e2.f & (DESTROYED | INERT)) !== 0) continue;
|
|
814
|
+
const ordered_effects = [e2];
|
|
815
|
+
let ancestor = e2.parent;
|
|
817
816
|
while (ancestor !== null) {
|
|
818
817
|
if (eager_block_effects.has(ancestor)) {
|
|
819
818
|
eager_block_effects.delete(ancestor);
|
|
@@ -822,9 +821,9 @@ function flush_queued_effects(effects) {
|
|
|
822
821
|
ancestor = ancestor.parent;
|
|
823
822
|
}
|
|
824
823
|
for (let j = ordered_effects.length - 1; j >= 0; j--) {
|
|
825
|
-
const
|
|
826
|
-
if ((
|
|
827
|
-
update_effect(
|
|
824
|
+
const e3 = ordered_effects[j];
|
|
825
|
+
if ((e3.f & (DESTROYED | INERT)) !== 0) continue;
|
|
826
|
+
update_effect(e3);
|
|
828
827
|
}
|
|
829
828
|
}
|
|
830
829
|
eager_block_effects.clear();
|
|
@@ -1164,8 +1163,8 @@ run_fn = function(fn) {
|
|
|
1164
1163
|
set_component_context(__privateGet(this, _effect).ctx);
|
|
1165
1164
|
try {
|
|
1166
1165
|
return fn();
|
|
1167
|
-
} catch (
|
|
1168
|
-
handle_error(
|
|
1166
|
+
} catch (e2) {
|
|
1167
|
+
handle_error(e2);
|
|
1169
1168
|
return null;
|
|
1170
1169
|
} finally {
|
|
1171
1170
|
set_active_effect(previous_effect);
|
|
@@ -1362,7 +1361,7 @@ function async_derived(fn, location) {
|
|
|
1362
1361
|
batch.decrement(blocking);
|
|
1363
1362
|
}
|
|
1364
1363
|
};
|
|
1365
|
-
d.promise.then(handler, (
|
|
1364
|
+
d.promise.then(handler, (e2) => handler(null, e2 || "unknown"));
|
|
1366
1365
|
});
|
|
1367
1366
|
teardown(() => {
|
|
1368
1367
|
for (const d of deferreds.values()) {
|
|
@@ -1399,10 +1398,10 @@ function destroy_derived_effects(derived2) {
|
|
|
1399
1398
|
var effects = derived2.effects;
|
|
1400
1399
|
if (effects !== null) {
|
|
1401
1400
|
derived2.effects = null;
|
|
1402
|
-
for (var
|
|
1401
|
+
for (var i2 = 0; i2 < effects.length; i2 += 1) {
|
|
1403
1402
|
destroy_effect(
|
|
1404
1403
|
/** @type {Effect} */
|
|
1405
|
-
effects[
|
|
1404
|
+
effects[i2]
|
|
1406
1405
|
);
|
|
1407
1406
|
}
|
|
1408
1407
|
}
|
|
@@ -1465,17 +1464,17 @@ function source(v, stack) {
|
|
|
1465
1464
|
}
|
|
1466
1465
|
// @__NO_SIDE_EFFECTS__
|
|
1467
1466
|
function state(v, stack) {
|
|
1468
|
-
const
|
|
1469
|
-
push_reaction_value(
|
|
1470
|
-
return
|
|
1467
|
+
const s2 = source(v);
|
|
1468
|
+
push_reaction_value(s2);
|
|
1469
|
+
return s2;
|
|
1471
1470
|
}
|
|
1472
1471
|
// @__NO_SIDE_EFFECTS__
|
|
1473
1472
|
function mutable_source(initial_value, immutable = false, trackable = true) {
|
|
1474
|
-
const
|
|
1473
|
+
const s2 = source(initial_value);
|
|
1475
1474
|
if (!immutable) {
|
|
1476
|
-
|
|
1475
|
+
s2.equals = safe_equals;
|
|
1477
1476
|
}
|
|
1478
|
-
return
|
|
1477
|
+
return s2;
|
|
1479
1478
|
}
|
|
1480
1479
|
function set(source2, value, should_proxy = false) {
|
|
1481
1480
|
if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
@@ -1525,8 +1524,8 @@ function mark_reactions(signal, status) {
|
|
|
1525
1524
|
var reactions = signal.reactions;
|
|
1526
1525
|
if (reactions === null) return;
|
|
1527
1526
|
var length = reactions.length;
|
|
1528
|
-
for (var
|
|
1529
|
-
var reaction = reactions[
|
|
1527
|
+
for (var i2 = 0; i2 < length; i2++) {
|
|
1528
|
+
var reaction = reactions[i2];
|
|
1530
1529
|
var flags2 = reaction.f;
|
|
1531
1530
|
var not_dirty = (flags2 & DIRTY) === 0;
|
|
1532
1531
|
if (not_dirty) {
|
|
@@ -1593,28 +1592,28 @@ function proxy$1(value) {
|
|
|
1593
1592
|
if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
|
|
1594
1593
|
state_descriptors_fixed();
|
|
1595
1594
|
}
|
|
1596
|
-
var
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1599
|
-
var
|
|
1600
|
-
sources.set(prop2,
|
|
1601
|
-
return
|
|
1595
|
+
var s2 = sources.get(prop2);
|
|
1596
|
+
if (s2 === void 0) {
|
|
1597
|
+
s2 = with_parent(() => {
|
|
1598
|
+
var s3 = /* @__PURE__ */ state(descriptor.value);
|
|
1599
|
+
sources.set(prop2, s3);
|
|
1600
|
+
return s3;
|
|
1602
1601
|
});
|
|
1603
1602
|
} else {
|
|
1604
|
-
set(
|
|
1603
|
+
set(s2, descriptor.value, true);
|
|
1605
1604
|
}
|
|
1606
1605
|
return true;
|
|
1607
1606
|
},
|
|
1608
1607
|
deleteProperty(target, prop2) {
|
|
1609
|
-
var
|
|
1610
|
-
if (
|
|
1608
|
+
var s2 = sources.get(prop2);
|
|
1609
|
+
if (s2 === void 0) {
|
|
1611
1610
|
if (prop2 in target) {
|
|
1612
|
-
const
|
|
1613
|
-
sources.set(prop2,
|
|
1611
|
+
const s3 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
|
|
1612
|
+
sources.set(prop2, s3);
|
|
1614
1613
|
increment(version);
|
|
1615
1614
|
}
|
|
1616
1615
|
} else {
|
|
1617
|
-
set(
|
|
1616
|
+
set(s2, UNINITIALIZED);
|
|
1618
1617
|
increment(version);
|
|
1619
1618
|
}
|
|
1620
1619
|
return true;
|
|
@@ -1624,18 +1623,18 @@ function proxy$1(value) {
|
|
|
1624
1623
|
if (prop2 === STATE_SYMBOL) {
|
|
1625
1624
|
return value;
|
|
1626
1625
|
}
|
|
1627
|
-
var
|
|
1626
|
+
var s2 = sources.get(prop2);
|
|
1628
1627
|
var exists = prop2 in target;
|
|
1629
|
-
if (
|
|
1630
|
-
|
|
1628
|
+
if (s2 === void 0 && (!exists || ((_a2 = get_descriptor(target, prop2)) == null ? void 0 : _a2.writable))) {
|
|
1629
|
+
s2 = with_parent(() => {
|
|
1631
1630
|
var p = proxy$1(exists ? target[prop2] : UNINITIALIZED);
|
|
1632
|
-
var
|
|
1633
|
-
return
|
|
1631
|
+
var s3 = /* @__PURE__ */ state(p);
|
|
1632
|
+
return s3;
|
|
1634
1633
|
});
|
|
1635
|
-
sources.set(prop2,
|
|
1634
|
+
sources.set(prop2, s2);
|
|
1636
1635
|
}
|
|
1637
|
-
if (
|
|
1638
|
-
var v = get$2(
|
|
1636
|
+
if (s2 !== void 0) {
|
|
1637
|
+
var v = get$2(s2);
|
|
1639
1638
|
return v === UNINITIALIZED ? void 0 : v;
|
|
1640
1639
|
}
|
|
1641
1640
|
return Reflect.get(target, prop2, receiver);
|
|
@@ -1643,8 +1642,8 @@ function proxy$1(value) {
|
|
|
1643
1642
|
getOwnPropertyDescriptor(target, prop2) {
|
|
1644
1643
|
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2);
|
|
1645
1644
|
if (descriptor && "value" in descriptor) {
|
|
1646
|
-
var
|
|
1647
|
-
if (
|
|
1645
|
+
var s2 = sources.get(prop2);
|
|
1646
|
+
if (s2) descriptor.value = get$2(s2);
|
|
1648
1647
|
} else if (descriptor === void 0) {
|
|
1649
1648
|
var source2 = sources.get(prop2);
|
|
1650
1649
|
var value2 = source2 == null ? void 0 : source2.v;
|
|
@@ -1664,18 +1663,18 @@ function proxy$1(value) {
|
|
|
1664
1663
|
if (prop2 === STATE_SYMBOL) {
|
|
1665
1664
|
return true;
|
|
1666
1665
|
}
|
|
1667
|
-
var
|
|
1668
|
-
var has =
|
|
1669
|
-
if (
|
|
1670
|
-
if (
|
|
1671
|
-
|
|
1666
|
+
var s2 = sources.get(prop2);
|
|
1667
|
+
var has = s2 !== void 0 && s2.v !== UNINITIALIZED || Reflect.has(target, prop2);
|
|
1668
|
+
if (s2 !== void 0 || active_effect !== null && (!has || ((_a2 = get_descriptor(target, prop2)) == null ? void 0 : _a2.writable))) {
|
|
1669
|
+
if (s2 === void 0) {
|
|
1670
|
+
s2 = with_parent(() => {
|
|
1672
1671
|
var p = has ? proxy$1(target[prop2]) : UNINITIALIZED;
|
|
1673
|
-
var
|
|
1674
|
-
return
|
|
1672
|
+
var s3 = /* @__PURE__ */ state(p);
|
|
1673
|
+
return s3;
|
|
1675
1674
|
});
|
|
1676
|
-
sources.set(prop2,
|
|
1675
|
+
sources.set(prop2, s2);
|
|
1677
1676
|
}
|
|
1678
|
-
var value2 = get$2(
|
|
1677
|
+
var value2 = get$2(s2);
|
|
1679
1678
|
if (value2 === UNINITIALIZED) {
|
|
1680
1679
|
return false;
|
|
1681
1680
|
}
|
|
@@ -1684,30 +1683,30 @@ function proxy$1(value) {
|
|
|
1684
1683
|
},
|
|
1685
1684
|
set(target, prop2, value2, receiver) {
|
|
1686
1685
|
var _a2;
|
|
1687
|
-
var
|
|
1686
|
+
var s2 = sources.get(prop2);
|
|
1688
1687
|
var has = prop2 in target;
|
|
1689
1688
|
if (is_proxied_array && prop2 === "length") {
|
|
1690
|
-
for (var
|
|
1691
|
-
|
|
1692
|
-
var other_s = sources.get(
|
|
1689
|
+
for (var i2 = value2; i2 < /** @type {Source<number>} */
|
|
1690
|
+
s2.v; i2 += 1) {
|
|
1691
|
+
var other_s = sources.get(i2 + "");
|
|
1693
1692
|
if (other_s !== void 0) {
|
|
1694
1693
|
set(other_s, UNINITIALIZED);
|
|
1695
|
-
} else if (
|
|
1694
|
+
} else if (i2 in target) {
|
|
1696
1695
|
other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
|
|
1697
|
-
sources.set(
|
|
1696
|
+
sources.set(i2 + "", other_s);
|
|
1698
1697
|
}
|
|
1699
1698
|
}
|
|
1700
1699
|
}
|
|
1701
|
-
if (
|
|
1700
|
+
if (s2 === void 0) {
|
|
1702
1701
|
if (!has || ((_a2 = get_descriptor(target, prop2)) == null ? void 0 : _a2.writable)) {
|
|
1703
|
-
|
|
1704
|
-
set(
|
|
1705
|
-
sources.set(prop2,
|
|
1702
|
+
s2 = with_parent(() => /* @__PURE__ */ state(void 0));
|
|
1703
|
+
set(s2, proxy$1(value2));
|
|
1704
|
+
sources.set(prop2, s2);
|
|
1706
1705
|
}
|
|
1707
1706
|
} else {
|
|
1708
|
-
has =
|
|
1707
|
+
has = s2.v !== UNINITIALIZED;
|
|
1709
1708
|
var p = with_parent(() => proxy$1(value2));
|
|
1710
|
-
set(
|
|
1709
|
+
set(s2, p);
|
|
1711
1710
|
}
|
|
1712
1711
|
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2);
|
|
1713
1712
|
if (descriptor == null ? void 0 : descriptor.set) {
|
|
@@ -1719,9 +1718,9 @@ function proxy$1(value) {
|
|
|
1719
1718
|
/** @type {Source<number>} */
|
|
1720
1719
|
sources.get("length")
|
|
1721
1720
|
);
|
|
1722
|
-
var
|
|
1723
|
-
if (Number.isInteger(
|
|
1724
|
-
set(ls2,
|
|
1721
|
+
var n2 = Number(prop2);
|
|
1722
|
+
if (Number.isInteger(n2) && n2 >= ls2.v) {
|
|
1723
|
+
set(ls2, n2 + 1);
|
|
1725
1724
|
}
|
|
1726
1725
|
}
|
|
1727
1726
|
increment(version);
|
|
@@ -1852,11 +1851,11 @@ function add_form_reset_listener() {
|
|
|
1852
1851
|
var _a2;
|
|
1853
1852
|
if (!evt.defaultPrevented) {
|
|
1854
1853
|
for (
|
|
1855
|
-
const
|
|
1854
|
+
const e2 of
|
|
1856
1855
|
/**@type {HTMLFormElement} */
|
|
1857
1856
|
evt.target.elements
|
|
1858
1857
|
) {
|
|
1859
|
-
(_a2 =
|
|
1858
|
+
(_a2 = e2.__on_r) == null ? void 0 : _a2.call(e2);
|
|
1860
1859
|
}
|
|
1861
1860
|
}
|
|
1862
1861
|
});
|
|
@@ -1939,30 +1938,30 @@ function create_effect(type, fn, sync, push2 = true) {
|
|
|
1939
1938
|
try {
|
|
1940
1939
|
update_effect(effect2);
|
|
1941
1940
|
effect2.f |= EFFECT_RAN;
|
|
1942
|
-
} catch (
|
|
1941
|
+
} catch (e3) {
|
|
1943
1942
|
destroy_effect(effect2);
|
|
1944
|
-
throw
|
|
1943
|
+
throw e3;
|
|
1945
1944
|
}
|
|
1946
1945
|
} else if (fn !== null) {
|
|
1947
1946
|
schedule_effect(effect2);
|
|
1948
1947
|
}
|
|
1949
1948
|
if (push2) {
|
|
1950
|
-
var
|
|
1951
|
-
if (sync &&
|
|
1952
|
-
(
|
|
1953
|
-
|
|
1949
|
+
var e2 = effect2;
|
|
1950
|
+
if (sync && e2.deps === null && e2.teardown === null && e2.nodes_start === null && e2.first === e2.last && // either `null`, or a singular child
|
|
1951
|
+
(e2.f & EFFECT_PRESERVED) === 0) {
|
|
1952
|
+
e2 = e2.first;
|
|
1954
1953
|
}
|
|
1955
|
-
if (
|
|
1956
|
-
|
|
1954
|
+
if (e2 !== null) {
|
|
1955
|
+
e2.parent = parent;
|
|
1957
1956
|
if (parent !== null) {
|
|
1958
|
-
push_effect(
|
|
1957
|
+
push_effect(e2, parent);
|
|
1959
1958
|
}
|
|
1960
1959
|
if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
|
|
1961
1960
|
var derived2 = (
|
|
1962
1961
|
/** @type {Derived} */
|
|
1963
1962
|
active_reaction
|
|
1964
1963
|
);
|
|
1965
|
-
(derived2.effects ?? (derived2.effects = [])).push(
|
|
1964
|
+
(derived2.effects ?? (derived2.effects = [])).push(e2);
|
|
1966
1965
|
}
|
|
1967
1966
|
}
|
|
1968
1967
|
}
|
|
@@ -2264,7 +2263,7 @@ function is_dirty(reaction) {
|
|
|
2264
2263
|
var dependencies = reaction.deps;
|
|
2265
2264
|
var is_unowned = (flags2 & UNOWNED) !== 0;
|
|
2266
2265
|
if (dependencies !== null) {
|
|
2267
|
-
var
|
|
2266
|
+
var i2;
|
|
2268
2267
|
var dependency;
|
|
2269
2268
|
var is_disconnected = (flags2 & DISCONNECTED) !== 0;
|
|
2270
2269
|
var is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;
|
|
@@ -2275,8 +2274,8 @@ function is_dirty(reaction) {
|
|
|
2275
2274
|
reaction
|
|
2276
2275
|
);
|
|
2277
2276
|
var parent = derived2.parent;
|
|
2278
|
-
for (
|
|
2279
|
-
dependency = dependencies[
|
|
2277
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
2278
|
+
dependency = dependencies[i2];
|
|
2280
2279
|
if (is_disconnected || !((_a2 = dependency == null ? void 0 : dependency.reactions) == null ? void 0 : _a2.includes(derived2))) {
|
|
2281
2280
|
(dependency.reactions ?? (dependency.reactions = [])).push(derived2);
|
|
2282
2281
|
}
|
|
@@ -2288,8 +2287,8 @@ function is_dirty(reaction) {
|
|
|
2288
2287
|
derived2.f ^= UNOWNED;
|
|
2289
2288
|
}
|
|
2290
2289
|
}
|
|
2291
|
-
for (
|
|
2292
|
-
dependency = dependencies[
|
|
2290
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
2291
|
+
dependency = dependencies[i2];
|
|
2293
2292
|
if (is_dirty(
|
|
2294
2293
|
/** @type {Derived} */
|
|
2295
2294
|
dependency
|
|
@@ -2316,8 +2315,8 @@ function schedule_possible_effect_self_invalidation(signal, effect2, root2 = tru
|
|
|
2316
2315
|
if (current_sources == null ? void 0 : current_sources.includes(signal)) {
|
|
2317
2316
|
return;
|
|
2318
2317
|
}
|
|
2319
|
-
for (var
|
|
2320
|
-
var reaction = reactions[
|
|
2318
|
+
for (var i2 = 0; i2 < reactions.length; i2++) {
|
|
2319
|
+
var reaction = reactions[i2];
|
|
2321
2320
|
if ((reaction.f & DERIVED) !== 0) {
|
|
2322
2321
|
schedule_possible_effect_self_invalidation(
|
|
2323
2322
|
/** @type {Derived} */
|
|
@@ -2375,12 +2374,12 @@ function update_reaction(reaction) {
|
|
|
2375
2374
|
var result = fn();
|
|
2376
2375
|
var deps = reaction.deps;
|
|
2377
2376
|
if (new_deps !== null) {
|
|
2378
|
-
var
|
|
2377
|
+
var i2;
|
|
2379
2378
|
remove_reactions(reaction, skipped_deps);
|
|
2380
2379
|
if (deps !== null && skipped_deps > 0) {
|
|
2381
2380
|
deps.length = skipped_deps + new_deps.length;
|
|
2382
|
-
for (
|
|
2383
|
-
deps[skipped_deps +
|
|
2381
|
+
for (i2 = 0; i2 < new_deps.length; i2++) {
|
|
2382
|
+
deps[skipped_deps + i2] = new_deps[i2];
|
|
2384
2383
|
}
|
|
2385
2384
|
} else {
|
|
2386
2385
|
reaction.deps = deps = new_deps;
|
|
@@ -2388,8 +2387,8 @@ function update_reaction(reaction) {
|
|
|
2388
2387
|
if (!skip_reaction || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
2389
2388
|
(flags2 & DERIVED) !== 0 && /** @type {import('#client').Derived} */
|
|
2390
2389
|
reaction.reactions !== null) {
|
|
2391
|
-
for (
|
|
2392
|
-
((_a2 = deps[
|
|
2390
|
+
for (i2 = skipped_deps; i2 < deps.length; i2++) {
|
|
2391
|
+
((_a2 = deps[i2]).reactions ?? (_a2.reactions = [])).push(reaction);
|
|
2393
2392
|
}
|
|
2394
2393
|
}
|
|
2395
2394
|
} else if (deps !== null && skipped_deps < deps.length) {
|
|
@@ -2397,10 +2396,10 @@ function update_reaction(reaction) {
|
|
|
2397
2396
|
deps.length = skipped_deps;
|
|
2398
2397
|
}
|
|
2399
2398
|
if (untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
|
|
2400
|
-
for (
|
|
2401
|
-
untracked_writes.length;
|
|
2399
|
+
for (i2 = 0; i2 < /** @type {Source[]} */
|
|
2400
|
+
untracked_writes.length; i2++) {
|
|
2402
2401
|
schedule_possible_effect_self_invalidation(
|
|
2403
|
-
untracked_writes[
|
|
2402
|
+
untracked_writes[i2],
|
|
2404
2403
|
/** @type {Effect} */
|
|
2405
2404
|
reaction
|
|
2406
2405
|
);
|
|
@@ -2472,8 +2471,8 @@ function remove_reaction(signal, dependency) {
|
|
|
2472
2471
|
function remove_reactions(signal, start_index) {
|
|
2473
2472
|
var dependencies = signal.deps;
|
|
2474
2473
|
if (dependencies === null) return;
|
|
2475
|
-
for (var
|
|
2476
|
-
remove_reaction(signal, dependencies[
|
|
2474
|
+
for (var i2 = start_index; i2 < dependencies.length; i2++) {
|
|
2475
|
+
remove_reaction(signal, dependencies[i2]);
|
|
2477
2476
|
}
|
|
2478
2477
|
}
|
|
2479
2478
|
function update_effect(effect2) {
|
|
@@ -2704,8 +2703,8 @@ function event(event_name, dom, handler, capture2, passive) {
|
|
|
2704
2703
|
}
|
|
2705
2704
|
}
|
|
2706
2705
|
function delegate(events) {
|
|
2707
|
-
for (var
|
|
2708
|
-
all_registered_events.add(events[
|
|
2706
|
+
for (var i2 = 0; i2 < events.length; i2++) {
|
|
2707
|
+
all_registered_events.add(events[i2]);
|
|
2709
2708
|
}
|
|
2710
2709
|
for (var fn of root_event_handles) {
|
|
2711
2710
|
fn(events);
|
|
@@ -2885,9 +2884,9 @@ function from_svg(content, flags2) {
|
|
|
2885
2884
|
}
|
|
2886
2885
|
function text(value = "") {
|
|
2887
2886
|
{
|
|
2888
|
-
var
|
|
2889
|
-
assign_nodes(
|
|
2890
|
-
return
|
|
2887
|
+
var t2 = create_text(value + "");
|
|
2888
|
+
assign_nodes(t2, t2);
|
|
2889
|
+
return t2;
|
|
2891
2890
|
}
|
|
2892
2891
|
}
|
|
2893
2892
|
function comment() {
|
|
@@ -2928,18 +2927,18 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
2928
2927
|
init_operations();
|
|
2929
2928
|
var registered_events = /* @__PURE__ */ new Set();
|
|
2930
2929
|
var event_handle = (events2) => {
|
|
2931
|
-
for (var
|
|
2932
|
-
var event_name = events2[
|
|
2930
|
+
for (var i2 = 0; i2 < events2.length; i2++) {
|
|
2931
|
+
var event_name = events2[i2];
|
|
2933
2932
|
if (registered_events.has(event_name)) continue;
|
|
2934
2933
|
registered_events.add(event_name);
|
|
2935
2934
|
var passive = is_passive_event(event_name);
|
|
2936
2935
|
target.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2937
|
-
var
|
|
2938
|
-
if (
|
|
2936
|
+
var n2 = document_listeners.get(event_name);
|
|
2937
|
+
if (n2 === void 0) {
|
|
2939
2938
|
document.addEventListener(event_name, handle_event_propagation, { passive });
|
|
2940
2939
|
document_listeners.set(event_name, 1);
|
|
2941
2940
|
} else {
|
|
2942
|
-
document_listeners.set(event_name,
|
|
2941
|
+
document_listeners.set(event_name, n2 + 1);
|
|
2943
2942
|
}
|
|
2944
2943
|
}
|
|
2945
2944
|
};
|
|
@@ -2979,15 +2978,15 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
2979
2978
|
var _a2;
|
|
2980
2979
|
for (var event_name of registered_events) {
|
|
2981
2980
|
target.removeEventListener(event_name, handle_event_propagation);
|
|
2982
|
-
var
|
|
2981
|
+
var n2 = (
|
|
2983
2982
|
/** @type {number} */
|
|
2984
2983
|
document_listeners.get(event_name)
|
|
2985
2984
|
);
|
|
2986
|
-
if (--
|
|
2985
|
+
if (--n2 === 0) {
|
|
2987
2986
|
document.removeEventListener(event_name, handle_event_propagation);
|
|
2988
2987
|
document_listeners.delete(event_name);
|
|
2989
2988
|
} else {
|
|
2990
|
-
document_listeners.set(event_name,
|
|
2989
|
+
document_listeners.set(event_name, n2);
|
|
2991
2990
|
}
|
|
2992
2991
|
}
|
|
2993
2992
|
root_event_handles.delete(event_handle);
|
|
@@ -3164,15 +3163,15 @@ function key(node, get_key, render_fn) {
|
|
|
3164
3163
|
});
|
|
3165
3164
|
}
|
|
3166
3165
|
let current_each_item = null;
|
|
3167
|
-
function index(_,
|
|
3168
|
-
return
|
|
3166
|
+
function index(_, i2) {
|
|
3167
|
+
return i2;
|
|
3169
3168
|
}
|
|
3170
3169
|
function pause_effects(state2, items, controlled_anchor) {
|
|
3171
3170
|
var items_map = state2.items;
|
|
3172
3171
|
var transitions = [];
|
|
3173
3172
|
var length = items.length;
|
|
3174
|
-
for (var
|
|
3175
|
-
pause_children(items[
|
|
3173
|
+
for (var i2 = 0; i2 < length; i2++) {
|
|
3174
|
+
pause_children(items[i2].e, transitions, true);
|
|
3176
3175
|
}
|
|
3177
3176
|
var is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null;
|
|
3178
3177
|
if (is_controlled) {
|
|
@@ -3190,8 +3189,8 @@ function pause_effects(state2, items, controlled_anchor) {
|
|
|
3190
3189
|
link(state2, items[0].prev, items[length - 1].next);
|
|
3191
3190
|
}
|
|
3192
3191
|
run_out_transitions(transitions, () => {
|
|
3193
|
-
for (var
|
|
3194
|
-
var item = items[
|
|
3192
|
+
for (var i3 = 0; i3 < length; i3++) {
|
|
3193
|
+
var item = items[i3];
|
|
3195
3194
|
if (!is_controlled) {
|
|
3196
3195
|
items_map.delete(item.k);
|
|
3197
3196
|
link(state2, item.prev, item.next);
|
|
@@ -3256,7 +3255,7 @@ function each(node, flags2, get_collection, get_key, render_fn, fallback_fn = nu
|
|
|
3256
3255
|
return;
|
|
3257
3256
|
}
|
|
3258
3257
|
was_empty = length === 0;
|
|
3259
|
-
var item,
|
|
3258
|
+
var item, i2, value, key2;
|
|
3260
3259
|
{
|
|
3261
3260
|
if (should_defer_append()) {
|
|
3262
3261
|
var keys = /* @__PURE__ */ new Set();
|
|
@@ -3264,13 +3263,13 @@ function each(node, flags2, get_collection, get_key, render_fn, fallback_fn = nu
|
|
|
3264
3263
|
/** @type {Batch} */
|
|
3265
3264
|
current_batch
|
|
3266
3265
|
);
|
|
3267
|
-
for (
|
|
3268
|
-
value = array[
|
|
3269
|
-
key2 = get_key(value,
|
|
3266
|
+
for (i2 = 0; i2 < length; i2 += 1) {
|
|
3267
|
+
value = array[i2];
|
|
3268
|
+
key2 = get_key(value, i2);
|
|
3270
3269
|
var existing = state2.items.get(key2) ?? offscreen_items.get(key2);
|
|
3271
3270
|
if (existing) {
|
|
3272
3271
|
if ((flags2 & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0) {
|
|
3273
|
-
update_item(existing, value,
|
|
3272
|
+
update_item(existing, value, i2, flags2);
|
|
3274
3273
|
}
|
|
3275
3274
|
} else {
|
|
3276
3275
|
item = create_item(
|
|
@@ -3280,7 +3279,7 @@ function each(node, flags2, get_collection, get_key, render_fn, fallback_fn = nu
|
|
|
3280
3279
|
null,
|
|
3281
3280
|
value,
|
|
3282
3281
|
key2,
|
|
3283
|
-
|
|
3282
|
+
i2,
|
|
3284
3283
|
render_fn,
|
|
3285
3284
|
flags2,
|
|
3286
3285
|
get_collection,
|
|
@@ -3319,11 +3318,11 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3319
3318
|
var value;
|
|
3320
3319
|
var key2;
|
|
3321
3320
|
var item;
|
|
3322
|
-
var
|
|
3321
|
+
var i2;
|
|
3323
3322
|
if (is_animated) {
|
|
3324
|
-
for (
|
|
3325
|
-
value = array[
|
|
3326
|
-
key2 = get_key(value,
|
|
3323
|
+
for (i2 = 0; i2 < length; i2 += 1) {
|
|
3324
|
+
value = array[i2];
|
|
3325
|
+
key2 = get_key(value, i2);
|
|
3327
3326
|
item = items.get(key2);
|
|
3328
3327
|
if (item !== void 0) {
|
|
3329
3328
|
(_a2 = item.a) == null ? void 0 : _a2.measure();
|
|
@@ -3331,9 +3330,9 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3331
3330
|
}
|
|
3332
3331
|
}
|
|
3333
3332
|
}
|
|
3334
|
-
for (
|
|
3335
|
-
value = array[
|
|
3336
|
-
key2 = get_key(value,
|
|
3333
|
+
for (i2 = 0; i2 < length; i2 += 1) {
|
|
3334
|
+
value = array[i2];
|
|
3335
|
+
key2 = get_key(value, i2);
|
|
3337
3336
|
item = items.get(key2);
|
|
3338
3337
|
if (item === void 0) {
|
|
3339
3338
|
var pending = offscreen_items.get(key2);
|
|
@@ -3357,7 +3356,7 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3357
3356
|
prev === null ? state2.first : prev.next,
|
|
3358
3357
|
value,
|
|
3359
3358
|
key2,
|
|
3360
|
-
|
|
3359
|
+
i2,
|
|
3361
3360
|
render_fn,
|
|
3362
3361
|
flags2,
|
|
3363
3362
|
get_collection
|
|
@@ -3370,7 +3369,7 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3370
3369
|
continue;
|
|
3371
3370
|
}
|
|
3372
3371
|
if (should_update) {
|
|
3373
|
-
update_item(item, value,
|
|
3372
|
+
update_item(item, value, i2, flags2);
|
|
3374
3373
|
}
|
|
3375
3374
|
if ((item.e.f & INERT) !== 0) {
|
|
3376
3375
|
resume_effect(item.e);
|
|
@@ -3398,7 +3397,7 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3398
3397
|
link(state2, b, start);
|
|
3399
3398
|
current = start;
|
|
3400
3399
|
prev = b;
|
|
3401
|
-
|
|
3400
|
+
i2 -= 1;
|
|
3402
3401
|
matched = [];
|
|
3403
3402
|
stashed = [];
|
|
3404
3403
|
} else {
|
|
@@ -3441,11 +3440,11 @@ function reconcile(each_effect, array, state2, offscreen_items, anchor, render_f
|
|
|
3441
3440
|
if (destroy_length > 0) {
|
|
3442
3441
|
var controlled_anchor = (flags2 & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;
|
|
3443
3442
|
if (is_animated) {
|
|
3444
|
-
for (
|
|
3445
|
-
(_c2 = to_destroy[
|
|
3443
|
+
for (i2 = 0; i2 < destroy_length; i2 += 1) {
|
|
3444
|
+
(_c2 = to_destroy[i2].a) == null ? void 0 : _c2.measure();
|
|
3446
3445
|
}
|
|
3447
|
-
for (
|
|
3448
|
-
(_d2 = to_destroy[
|
|
3446
|
+
for (i2 = 0; i2 < destroy_length; i2 += 1) {
|
|
3447
|
+
(_d2 = to_destroy[i2].a) == null ? void 0 : _d2.fix();
|
|
3449
3448
|
}
|
|
3450
3449
|
}
|
|
3451
3450
|
pause_effects(state2, to_destroy, controlled_anchor);
|
|
@@ -3486,9 +3485,9 @@ function create_item(anchor, state2, prev, next, value, key2, index2, render_fn,
|
|
|
3486
3485
|
var reactive = (flags2 & EACH_ITEM_REACTIVE) !== 0;
|
|
3487
3486
|
var mutable = (flags2 & EACH_ITEM_IMMUTABLE) === 0;
|
|
3488
3487
|
var v = reactive ? mutable ? /* @__PURE__ */ mutable_source(value, false, false) : source(value) : value;
|
|
3489
|
-
var
|
|
3488
|
+
var i2 = (flags2 & EACH_INDEX_REACTIVE) === 0 ? index2 : source(index2);
|
|
3490
3489
|
var item = {
|
|
3491
|
-
i,
|
|
3490
|
+
i: i2,
|
|
3492
3491
|
v,
|
|
3493
3492
|
k: key2,
|
|
3494
3493
|
a: null,
|
|
@@ -3507,7 +3506,7 @@ function create_item(anchor, state2, prev, next, value, key2, index2, render_fn,
|
|
|
3507
3506
|
/** @type {Node} */
|
|
3508
3507
|
anchor,
|
|
3509
3508
|
v,
|
|
3510
|
-
|
|
3509
|
+
i2,
|
|
3511
3510
|
get_collection
|
|
3512
3511
|
), hydrating);
|
|
3513
3512
|
item.e.prev = prev && prev.e;
|
|
@@ -3625,15 +3624,15 @@ function component(node, get_component, render_fn) {
|
|
|
3625
3624
|
}
|
|
3626
3625
|
function attach(node, get_fn) {
|
|
3627
3626
|
var fn = void 0;
|
|
3628
|
-
var
|
|
3627
|
+
var e2;
|
|
3629
3628
|
block(() => {
|
|
3630
3629
|
if (fn !== (fn = get_fn())) {
|
|
3631
|
-
if (
|
|
3632
|
-
destroy_effect(
|
|
3633
|
-
|
|
3630
|
+
if (e2) {
|
|
3631
|
+
destroy_effect(e2);
|
|
3632
|
+
e2 = null;
|
|
3634
3633
|
}
|
|
3635
3634
|
if (fn) {
|
|
3636
|
-
|
|
3635
|
+
e2 = branch(() => {
|
|
3637
3636
|
effect(() => (
|
|
3638
3637
|
/** @type {(node: Element) => void} */
|
|
3639
3638
|
fn(node)
|
|
@@ -3643,18 +3642,18 @@ function attach(node, get_fn) {
|
|
|
3643
3642
|
}
|
|
3644
3643
|
});
|
|
3645
3644
|
}
|
|
3646
|
-
function r(
|
|
3647
|
-
var
|
|
3648
|
-
if ("string" == typeof
|
|
3649
|
-
else if ("object" == typeof
|
|
3650
|
-
var o =
|
|
3651
|
-
for (
|
|
3652
|
-
} else for (f in
|
|
3653
|
-
return
|
|
3645
|
+
function r$1(e2) {
|
|
3646
|
+
var t2, f, n2 = "";
|
|
3647
|
+
if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
|
|
3648
|
+
else if ("object" == typeof e2) if (Array.isArray(e2)) {
|
|
3649
|
+
var o = e2.length;
|
|
3650
|
+
for (t2 = 0; t2 < o; t2++) e2[t2] && (f = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f);
|
|
3651
|
+
} else for (f in e2) e2[f] && (n2 && (n2 += " "), n2 += f);
|
|
3652
|
+
return n2;
|
|
3654
3653
|
}
|
|
3655
3654
|
function clsx$1() {
|
|
3656
|
-
for (var
|
|
3657
|
-
return
|
|
3655
|
+
for (var e2, t2, f = 0, n2 = "", o = arguments.length; f < o; f++) (e2 = arguments[f]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
3656
|
+
return n2;
|
|
3658
3657
|
}
|
|
3659
3658
|
function clsx(value) {
|
|
3660
3659
|
if (typeof value === "object") {
|
|
@@ -3729,17 +3728,17 @@ function to_style(value, styles2) {
|
|
|
3729
3728
|
var start_index = 0;
|
|
3730
3729
|
var name_index = -1;
|
|
3731
3730
|
const len = value.length;
|
|
3732
|
-
for (var
|
|
3733
|
-
var c = value[
|
|
3731
|
+
for (var i2 = 0; i2 < len; i2++) {
|
|
3732
|
+
var c = value[i2];
|
|
3734
3733
|
if (in_comment) {
|
|
3735
|
-
if (c === "/" && value[
|
|
3734
|
+
if (c === "/" && value[i2 - 1] === "*") {
|
|
3736
3735
|
in_comment = false;
|
|
3737
3736
|
}
|
|
3738
3737
|
} else if (in_str) {
|
|
3739
3738
|
if (in_str === c) {
|
|
3740
3739
|
in_str = false;
|
|
3741
3740
|
}
|
|
3742
|
-
} else if (c === "/" && value[
|
|
3741
|
+
} else if (c === "/" && value[i2 + 1] === "*") {
|
|
3743
3742
|
in_comment = true;
|
|
3744
3743
|
} else if (c === '"' || c === "'") {
|
|
3745
3744
|
in_str = c;
|
|
@@ -3750,19 +3749,19 @@ function to_style(value, styles2) {
|
|
|
3750
3749
|
}
|
|
3751
3750
|
if (!in_comment && in_str === false && in_apo === 0) {
|
|
3752
3751
|
if (c === ":" && name_index === -1) {
|
|
3753
|
-
name_index =
|
|
3754
|
-
} else if (c === ";" ||
|
|
3752
|
+
name_index = i2;
|
|
3753
|
+
} else if (c === ";" || i2 === len - 1) {
|
|
3755
3754
|
if (name_index !== -1) {
|
|
3756
3755
|
var name = to_css_name(value.substring(start_index, name_index).trim());
|
|
3757
3756
|
if (!reserved_names.includes(name)) {
|
|
3758
3757
|
if (c !== ";") {
|
|
3759
|
-
|
|
3758
|
+
i2++;
|
|
3760
3759
|
}
|
|
3761
|
-
var property = value.substring(start_index,
|
|
3760
|
+
var property = value.substring(start_index, i2).trim();
|
|
3762
3761
|
new_style += " " + property + ";";
|
|
3763
3762
|
}
|
|
3764
3763
|
}
|
|
3765
|
-
start_index =
|
|
3764
|
+
start_index = i2 + 1;
|
|
3766
3765
|
name_index = -1;
|
|
3767
3766
|
}
|
|
3768
3767
|
}
|
|
@@ -4077,12 +4076,12 @@ function attribute_effect(element, fn, sync = [], async = [], css_hash, should_r
|
|
|
4077
4076
|
if (!next[symbol]) destroy_effect(effects[symbol]);
|
|
4078
4077
|
}
|
|
4079
4078
|
for (let symbol of Object.getOwnPropertySymbols(next)) {
|
|
4080
|
-
var
|
|
4081
|
-
if (symbol.description === ATTACHMENT_KEY && (!prev ||
|
|
4079
|
+
var n2 = next[symbol];
|
|
4080
|
+
if (symbol.description === ATTACHMENT_KEY && (!prev || n2 !== prev[symbol])) {
|
|
4082
4081
|
if (effects[symbol]) destroy_effect(effects[symbol]);
|
|
4083
|
-
effects[symbol] = branch(() => attach(element, () =>
|
|
4082
|
+
effects[symbol] = branch(() => attach(element, () => n2));
|
|
4084
4083
|
}
|
|
4085
|
-
current[symbol] =
|
|
4084
|
+
current[symbol] = n2;
|
|
4086
4085
|
}
|
|
4087
4086
|
prev = current;
|
|
4088
4087
|
});
|
|
@@ -4199,7 +4198,7 @@ function css_to_keyframe(css) {
|
|
|
4199
4198
|
}
|
|
4200
4199
|
return keyframe;
|
|
4201
4200
|
}
|
|
4202
|
-
const linear$1 = (
|
|
4201
|
+
const linear$1 = (t2) => t2;
|
|
4203
4202
|
function animation(element, get_fn, get_params) {
|
|
4204
4203
|
var item = (
|
|
4205
4204
|
/** @type {EachItem} */
|
|
@@ -4322,17 +4321,17 @@ function transition(flags2, element, get_fn, get_params) {
|
|
|
4322
4321
|
outro == null ? void 0 : outro.abort();
|
|
4323
4322
|
}
|
|
4324
4323
|
};
|
|
4325
|
-
var
|
|
4324
|
+
var e2 = (
|
|
4326
4325
|
/** @type {Effect} */
|
|
4327
4326
|
active_effect
|
|
4328
4327
|
);
|
|
4329
|
-
(
|
|
4328
|
+
(e2.transitions ?? (e2.transitions = [])).push(transition2);
|
|
4330
4329
|
if (is_intro && should_intro) {
|
|
4331
4330
|
var run = is_global;
|
|
4332
4331
|
if (!run) {
|
|
4333
4332
|
var block2 = (
|
|
4334
4333
|
/** @type {Effect | null} */
|
|
4335
|
-
|
|
4334
|
+
e2.parent
|
|
4336
4335
|
);
|
|
4337
4336
|
while (block2 && (block2.f & EFFECT_TRANSPARENT) !== 0) {
|
|
4338
4337
|
while (block2 = block2.parent) {
|
|
@@ -4404,10 +4403,10 @@ function animate(element, options, counterpart, t2, on_finish) {
|
|
|
4404
4403
|
if (duration > 0) {
|
|
4405
4404
|
var needs_overflow_hidden = false;
|
|
4406
4405
|
if (css) {
|
|
4407
|
-
var
|
|
4408
|
-
for (var
|
|
4409
|
-
var
|
|
4410
|
-
var styles3 = css_to_keyframe(css(
|
|
4406
|
+
var n2 = Math.ceil(duration / (1e3 / 60));
|
|
4407
|
+
for (var i2 = 0; i2 <= n2; i2 += 1) {
|
|
4408
|
+
var t3 = t1 + delta * easing(i2 / n2);
|
|
4409
|
+
var styles3 = css_to_keyframe(css(t3, 1 - t3));
|
|
4411
4410
|
keyframes2.push(styles3);
|
|
4412
4411
|
needs_overflow_hidden || (needs_overflow_hidden = styles3.overflow === "hidden");
|
|
4413
4412
|
}
|
|
@@ -4426,8 +4425,8 @@ function animate(element, options, counterpart, t2, on_finish) {
|
|
|
4426
4425
|
if (tick2) {
|
|
4427
4426
|
loop(() => {
|
|
4428
4427
|
if (animation2.playState !== "running") return false;
|
|
4429
|
-
var
|
|
4430
|
-
tick2(
|
|
4428
|
+
var t4 = get_t();
|
|
4429
|
+
tick2(t4, 1 - t4);
|
|
4431
4430
|
return true;
|
|
4432
4431
|
});
|
|
4433
4432
|
}
|
|
@@ -4695,17 +4694,17 @@ function rest_props(props, exclude, name) {
|
|
|
4695
4694
|
}
|
|
4696
4695
|
const spread_props_handler = {
|
|
4697
4696
|
get(target, key2) {
|
|
4698
|
-
let
|
|
4699
|
-
while (
|
|
4700
|
-
let p = target.props[
|
|
4697
|
+
let i2 = target.props.length;
|
|
4698
|
+
while (i2--) {
|
|
4699
|
+
let p = target.props[i2];
|
|
4701
4700
|
if (is_function(p)) p = p();
|
|
4702
4701
|
if (typeof p === "object" && p !== null && key2 in p) return p[key2];
|
|
4703
4702
|
}
|
|
4704
4703
|
},
|
|
4705
4704
|
set(target, key2, value) {
|
|
4706
|
-
let
|
|
4707
|
-
while (
|
|
4708
|
-
let p = target.props[
|
|
4705
|
+
let i2 = target.props.length;
|
|
4706
|
+
while (i2--) {
|
|
4707
|
+
let p = target.props[i2];
|
|
4709
4708
|
if (is_function(p)) p = p();
|
|
4710
4709
|
const desc = get_descriptor(p, key2);
|
|
4711
4710
|
if (desc && desc.set) {
|
|
@@ -4716,9 +4715,9 @@ const spread_props_handler = {
|
|
|
4716
4715
|
return false;
|
|
4717
4716
|
},
|
|
4718
4717
|
getOwnPropertyDescriptor(target, key2) {
|
|
4719
|
-
let
|
|
4720
|
-
while (
|
|
4721
|
-
let p = target.props[
|
|
4718
|
+
let i2 = target.props.length;
|
|
4719
|
+
while (i2--) {
|
|
4720
|
+
let p = target.props[i2];
|
|
4722
4721
|
if (is_function(p)) p = p();
|
|
4723
4722
|
if (typeof p === "object" && p !== null && key2 in p) {
|
|
4724
4723
|
const descriptor = get_descriptor(p, key2);
|
|
@@ -4873,6 +4872,1007 @@ function onMount(fn) {
|
|
|
4873
4872
|
});
|
|
4874
4873
|
}
|
|
4875
4874
|
}
|
|
4875
|
+
class ClientResponseError extends Error {
|
|
4876
|
+
constructor(e2) {
|
|
4877
|
+
var _a2, _b2, _c2, _d2;
|
|
4878
|
+
super("ClientResponseError"), this.url = "", this.status = 0, this.response = {}, this.isAbort = false, this.originalError = null, Object.setPrototypeOf(this, ClientResponseError.prototype), null !== e2 && "object" == typeof e2 && (this.url = "string" == typeof e2.url ? e2.url : "", this.status = "number" == typeof e2.status ? e2.status : 0, this.isAbort = !!e2.isAbort, this.originalError = e2.originalError, null !== e2.response && "object" == typeof e2.response ? this.response = e2.response : null !== e2.data && "object" == typeof e2.data ? this.response = e2.data : this.response = {}), this.originalError || e2 instanceof ClientResponseError || (this.originalError = e2), "undefined" != typeof DOMException && e2 instanceof DOMException && (this.isAbort = true), this.name = "ClientResponseError " + this.status, this.message = (_a2 = this.response) == null ? void 0 : _a2.message, this.message || (this.isAbort ? this.message = "The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation." : ((_d2 = (_c2 = (_b2 = this.originalError) == null ? void 0 : _b2.cause) == null ? void 0 : _c2.message) == null ? void 0 : _d2.includes("ECONNREFUSED ::1")) ? this.message = "Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21)." : this.message = "Something went wrong."), this.cause = this.originalError;
|
|
4879
|
+
}
|
|
4880
|
+
get data() {
|
|
4881
|
+
return this.response;
|
|
4882
|
+
}
|
|
4883
|
+
toJSON() {
|
|
4884
|
+
return { ...this };
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4887
|
+
const e = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
4888
|
+
function cookieParse(e2, t2) {
|
|
4889
|
+
const s2 = {};
|
|
4890
|
+
if ("string" != typeof e2) return s2;
|
|
4891
|
+
const i2 = Object.assign({}, {}).decode || defaultDecode;
|
|
4892
|
+
let n2 = 0;
|
|
4893
|
+
for (; n2 < e2.length; ) {
|
|
4894
|
+
const t3 = e2.indexOf("=", n2);
|
|
4895
|
+
if (-1 === t3) break;
|
|
4896
|
+
let r2 = e2.indexOf(";", n2);
|
|
4897
|
+
if (-1 === r2) r2 = e2.length;
|
|
4898
|
+
else if (r2 < t3) {
|
|
4899
|
+
n2 = e2.lastIndexOf(";", t3 - 1) + 1;
|
|
4900
|
+
continue;
|
|
4901
|
+
}
|
|
4902
|
+
const o = e2.slice(n2, t3).trim();
|
|
4903
|
+
if (void 0 === s2[o]) {
|
|
4904
|
+
let n3 = e2.slice(t3 + 1, r2).trim();
|
|
4905
|
+
34 === n3.charCodeAt(0) && (n3 = n3.slice(1, -1));
|
|
4906
|
+
try {
|
|
4907
|
+
s2[o] = i2(n3);
|
|
4908
|
+
} catch (e3) {
|
|
4909
|
+
s2[o] = n3;
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4912
|
+
n2 = r2 + 1;
|
|
4913
|
+
}
|
|
4914
|
+
return s2;
|
|
4915
|
+
}
|
|
4916
|
+
function cookieSerialize(t2, s2, i2) {
|
|
4917
|
+
const n2 = Object.assign({}, i2 || {}), r2 = n2.encode || defaultEncode;
|
|
4918
|
+
if (!e.test(t2)) throw new TypeError("argument name is invalid");
|
|
4919
|
+
const o = r2(s2);
|
|
4920
|
+
if (o && !e.test(o)) throw new TypeError("argument val is invalid");
|
|
4921
|
+
let a = t2 + "=" + o;
|
|
4922
|
+
if (null != n2.maxAge) {
|
|
4923
|
+
const e2 = n2.maxAge - 0;
|
|
4924
|
+
if (isNaN(e2) || !isFinite(e2)) throw new TypeError("option maxAge is invalid");
|
|
4925
|
+
a += "; Max-Age=" + Math.floor(e2);
|
|
4926
|
+
}
|
|
4927
|
+
if (n2.domain) {
|
|
4928
|
+
if (!e.test(n2.domain)) throw new TypeError("option domain is invalid");
|
|
4929
|
+
a += "; Domain=" + n2.domain;
|
|
4930
|
+
}
|
|
4931
|
+
if (n2.path) {
|
|
4932
|
+
if (!e.test(n2.path)) throw new TypeError("option path is invalid");
|
|
4933
|
+
a += "; Path=" + n2.path;
|
|
4934
|
+
}
|
|
4935
|
+
if (n2.expires) {
|
|
4936
|
+
if (!function isDate(e2) {
|
|
4937
|
+
return "[object Date]" === Object.prototype.toString.call(e2) || e2 instanceof Date;
|
|
4938
|
+
}(n2.expires) || isNaN(n2.expires.valueOf())) throw new TypeError("option expires is invalid");
|
|
4939
|
+
a += "; Expires=" + n2.expires.toUTCString();
|
|
4940
|
+
}
|
|
4941
|
+
if (n2.httpOnly && (a += "; HttpOnly"), n2.secure && (a += "; Secure"), n2.priority) {
|
|
4942
|
+
switch ("string" == typeof n2.priority ? n2.priority.toLowerCase() : n2.priority) {
|
|
4943
|
+
case "low":
|
|
4944
|
+
a += "; Priority=Low";
|
|
4945
|
+
break;
|
|
4946
|
+
case "medium":
|
|
4947
|
+
a += "; Priority=Medium";
|
|
4948
|
+
break;
|
|
4949
|
+
case "high":
|
|
4950
|
+
a += "; Priority=High";
|
|
4951
|
+
break;
|
|
4952
|
+
default:
|
|
4953
|
+
throw new TypeError("option priority is invalid");
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
if (n2.sameSite) {
|
|
4957
|
+
switch ("string" == typeof n2.sameSite ? n2.sameSite.toLowerCase() : n2.sameSite) {
|
|
4958
|
+
case true:
|
|
4959
|
+
a += "; SameSite=Strict";
|
|
4960
|
+
break;
|
|
4961
|
+
case "lax":
|
|
4962
|
+
a += "; SameSite=Lax";
|
|
4963
|
+
break;
|
|
4964
|
+
case "strict":
|
|
4965
|
+
a += "; SameSite=Strict";
|
|
4966
|
+
break;
|
|
4967
|
+
case "none":
|
|
4968
|
+
a += "; SameSite=None";
|
|
4969
|
+
break;
|
|
4970
|
+
default:
|
|
4971
|
+
throw new TypeError("option sameSite is invalid");
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
return a;
|
|
4975
|
+
}
|
|
4976
|
+
function defaultDecode(e2) {
|
|
4977
|
+
return -1 !== e2.indexOf("%") ? decodeURIComponent(e2) : e2;
|
|
4978
|
+
}
|
|
4979
|
+
function defaultEncode(e2) {
|
|
4980
|
+
return encodeURIComponent(e2);
|
|
4981
|
+
}
|
|
4982
|
+
const t = "undefined" != typeof navigator && "ReactNative" === navigator.product || "undefined" != typeof global && global.HermesInternal;
|
|
4983
|
+
let s;
|
|
4984
|
+
function getTokenPayload(e2) {
|
|
4985
|
+
if (e2) try {
|
|
4986
|
+
const t2 = decodeURIComponent(s(e2.split(".")[1]).split("").map(function(e3) {
|
|
4987
|
+
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
4988
|
+
}).join(""));
|
|
4989
|
+
return JSON.parse(t2) || {};
|
|
4990
|
+
} catch (e3) {
|
|
4991
|
+
}
|
|
4992
|
+
return {};
|
|
4993
|
+
}
|
|
4994
|
+
function isTokenExpired(e2, t2 = 0) {
|
|
4995
|
+
let s2 = getTokenPayload(e2);
|
|
4996
|
+
return !(Object.keys(s2).length > 0 && (!s2.exp || s2.exp - t2 > Date.now() / 1e3));
|
|
4997
|
+
}
|
|
4998
|
+
s = "function" != typeof atob || t ? (e2) => {
|
|
4999
|
+
let t2 = String(e2).replace(/=+$/, "");
|
|
5000
|
+
if (t2.length % 4 == 1) throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
5001
|
+
for (var s2, i2, n2 = 0, r2 = 0, o = ""; i2 = t2.charAt(r2++); ~i2 && (s2 = n2 % 4 ? 64 * s2 + i2 : i2, n2++ % 4) ? o += String.fromCharCode(255 & s2 >> (-2 * n2 & 6)) : 0) i2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i2);
|
|
5002
|
+
return o;
|
|
5003
|
+
} : atob;
|
|
5004
|
+
const i = "pb_auth";
|
|
5005
|
+
class BaseAuthStore {
|
|
5006
|
+
constructor() {
|
|
5007
|
+
this.baseToken = "", this.baseModel = null, this._onChangeCallbacks = [];
|
|
5008
|
+
}
|
|
5009
|
+
get token() {
|
|
5010
|
+
return this.baseToken;
|
|
5011
|
+
}
|
|
5012
|
+
get record() {
|
|
5013
|
+
return this.baseModel;
|
|
5014
|
+
}
|
|
5015
|
+
get model() {
|
|
5016
|
+
return this.baseModel;
|
|
5017
|
+
}
|
|
5018
|
+
get isValid() {
|
|
5019
|
+
return !isTokenExpired(this.token);
|
|
5020
|
+
}
|
|
5021
|
+
get isSuperuser() {
|
|
5022
|
+
var _a2, _b2;
|
|
5023
|
+
let e2 = getTokenPayload(this.token);
|
|
5024
|
+
return "auth" == e2.type && ("_superusers" == ((_a2 = this.record) == null ? void 0 : _a2.collectionName) || !((_b2 = this.record) == null ? void 0 : _b2.collectionName) && "pbc_3142635823" == e2.collectionId);
|
|
5025
|
+
}
|
|
5026
|
+
get isAdmin() {
|
|
5027
|
+
return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"), this.isSuperuser;
|
|
5028
|
+
}
|
|
5029
|
+
get isAuthRecord() {
|
|
5030
|
+
return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"), "auth" == getTokenPayload(this.token).type && !this.isSuperuser;
|
|
5031
|
+
}
|
|
5032
|
+
save(e2, t2) {
|
|
5033
|
+
this.baseToken = e2 || "", this.baseModel = t2 || null, this.triggerChange();
|
|
5034
|
+
}
|
|
5035
|
+
clear() {
|
|
5036
|
+
this.baseToken = "", this.baseModel = null, this.triggerChange();
|
|
5037
|
+
}
|
|
5038
|
+
loadFromCookie(e2, t2 = i) {
|
|
5039
|
+
const s2 = cookieParse(e2 || "")[t2] || "";
|
|
5040
|
+
let n2 = {};
|
|
5041
|
+
try {
|
|
5042
|
+
n2 = JSON.parse(s2), (null === typeof n2 || "object" != typeof n2 || Array.isArray(n2)) && (n2 = {});
|
|
5043
|
+
} catch (e3) {
|
|
5044
|
+
}
|
|
5045
|
+
this.save(n2.token || "", n2.record || n2.model || null);
|
|
5046
|
+
}
|
|
5047
|
+
exportToCookie(e2, t2 = i) {
|
|
5048
|
+
var _a2, _b2;
|
|
5049
|
+
const s2 = { secure: true, sameSite: true, httpOnly: true, path: "/" }, n2 = getTokenPayload(this.token);
|
|
5050
|
+
s2.expires = (n2 == null ? void 0 : n2.exp) ? new Date(1e3 * n2.exp) : /* @__PURE__ */ new Date("1970-01-01"), e2 = Object.assign({}, s2, e2);
|
|
5051
|
+
const r2 = { token: this.token, record: this.record ? JSON.parse(JSON.stringify(this.record)) : null };
|
|
5052
|
+
let o = cookieSerialize(t2, JSON.stringify(r2), e2);
|
|
5053
|
+
const a = "undefined" != typeof Blob ? new Blob([o]).size : o.length;
|
|
5054
|
+
if (r2.record && a > 4096) {
|
|
5055
|
+
r2.record = { id: (_a2 = r2.record) == null ? void 0 : _a2.id, email: (_b2 = r2.record) == null ? void 0 : _b2.email };
|
|
5056
|
+
const s3 = ["collectionId", "collectionName", "verified"];
|
|
5057
|
+
for (const e3 in this.record) s3.includes(e3) && (r2.record[e3] = this.record[e3]);
|
|
5058
|
+
o = cookieSerialize(t2, JSON.stringify(r2), e2);
|
|
5059
|
+
}
|
|
5060
|
+
return o;
|
|
5061
|
+
}
|
|
5062
|
+
onChange(e2, t2 = false) {
|
|
5063
|
+
return this._onChangeCallbacks.push(e2), t2 && e2(this.token, this.record), () => {
|
|
5064
|
+
for (let t3 = this._onChangeCallbacks.length - 1; t3 >= 0; t3--) if (this._onChangeCallbacks[t3] == e2) return delete this._onChangeCallbacks[t3], void this._onChangeCallbacks.splice(t3, 1);
|
|
5065
|
+
};
|
|
5066
|
+
}
|
|
5067
|
+
triggerChange() {
|
|
5068
|
+
for (const e2 of this._onChangeCallbacks) e2 && e2(this.token, this.record);
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
class LocalAuthStore extends BaseAuthStore {
|
|
5072
|
+
constructor(e2 = "pocketbase_auth") {
|
|
5073
|
+
super(), this.storageFallback = {}, this.storageKey = e2, this._bindStorageEvent();
|
|
5074
|
+
}
|
|
5075
|
+
get token() {
|
|
5076
|
+
return (this._storageGet(this.storageKey) || {}).token || "";
|
|
5077
|
+
}
|
|
5078
|
+
get record() {
|
|
5079
|
+
const e2 = this._storageGet(this.storageKey) || {};
|
|
5080
|
+
return e2.record || e2.model || null;
|
|
5081
|
+
}
|
|
5082
|
+
get model() {
|
|
5083
|
+
return this.record;
|
|
5084
|
+
}
|
|
5085
|
+
save(e2, t2) {
|
|
5086
|
+
this._storageSet(this.storageKey, { token: e2, record: t2 }), super.save(e2, t2);
|
|
5087
|
+
}
|
|
5088
|
+
clear() {
|
|
5089
|
+
this._storageRemove(this.storageKey), super.clear();
|
|
5090
|
+
}
|
|
5091
|
+
_storageGet(e2) {
|
|
5092
|
+
if ("undefined" != typeof window && (window == null ? void 0 : window.localStorage)) {
|
|
5093
|
+
const t2 = window.localStorage.getItem(e2) || "";
|
|
5094
|
+
try {
|
|
5095
|
+
return JSON.parse(t2);
|
|
5096
|
+
} catch (e3) {
|
|
5097
|
+
return t2;
|
|
5098
|
+
}
|
|
5099
|
+
}
|
|
5100
|
+
return this.storageFallback[e2];
|
|
5101
|
+
}
|
|
5102
|
+
_storageSet(e2, t2) {
|
|
5103
|
+
if ("undefined" != typeof window && (window == null ? void 0 : window.localStorage)) {
|
|
5104
|
+
let s2 = t2;
|
|
5105
|
+
"string" != typeof t2 && (s2 = JSON.stringify(t2)), window.localStorage.setItem(e2, s2);
|
|
5106
|
+
} else this.storageFallback[e2] = t2;
|
|
5107
|
+
}
|
|
5108
|
+
_storageRemove(e2) {
|
|
5109
|
+
var _a2;
|
|
5110
|
+
"undefined" != typeof window && (window == null ? void 0 : window.localStorage) && ((_a2 = window.localStorage) == null ? void 0 : _a2.removeItem(e2)), delete this.storageFallback[e2];
|
|
5111
|
+
}
|
|
5112
|
+
_bindStorageEvent() {
|
|
5113
|
+
"undefined" != typeof window && (window == null ? void 0 : window.localStorage) && window.addEventListener && window.addEventListener("storage", (e2) => {
|
|
5114
|
+
if (e2.key != this.storageKey) return;
|
|
5115
|
+
const t2 = this._storageGet(this.storageKey) || {};
|
|
5116
|
+
super.save(t2.token || "", t2.record || t2.model || null);
|
|
5117
|
+
});
|
|
5118
|
+
}
|
|
5119
|
+
}
|
|
5120
|
+
class BaseService {
|
|
5121
|
+
constructor(e2) {
|
|
5122
|
+
this.client = e2;
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
class SettingsService extends BaseService {
|
|
5126
|
+
async getAll(e2) {
|
|
5127
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send("/api/settings", e2);
|
|
5128
|
+
}
|
|
5129
|
+
async update(e2, t2) {
|
|
5130
|
+
return t2 = Object.assign({ method: "PATCH", body: e2 }, t2), this.client.send("/api/settings", t2);
|
|
5131
|
+
}
|
|
5132
|
+
async testS3(e2 = "storage", t2) {
|
|
5133
|
+
return t2 = Object.assign({ method: "POST", body: { filesystem: e2 } }, t2), this.client.send("/api/settings/test/s3", t2).then(() => true);
|
|
5134
|
+
}
|
|
5135
|
+
async testEmail(e2, t2, s2, i2) {
|
|
5136
|
+
return i2 = Object.assign({ method: "POST", body: { email: t2, template: s2, collection: e2 } }, i2), this.client.send("/api/settings/test/email", i2).then(() => true);
|
|
5137
|
+
}
|
|
5138
|
+
async generateAppleClientSecret(e2, t2, s2, i2, n2, r2) {
|
|
5139
|
+
return r2 = Object.assign({ method: "POST", body: { clientId: e2, teamId: t2, keyId: s2, privateKey: i2, duration: n2 } }, r2), this.client.send("/api/settings/apple/generate-client-secret", r2);
|
|
5140
|
+
}
|
|
5141
|
+
}
|
|
5142
|
+
const n = ["requestKey", "$cancelKey", "$autoCancel", "fetch", "headers", "body", "query", "params", "cache", "credentials", "headers", "integrity", "keepalive", "method", "mode", "redirect", "referrer", "referrerPolicy", "signal", "window"];
|
|
5143
|
+
function normalizeUnknownQueryParams(e2) {
|
|
5144
|
+
if (e2) {
|
|
5145
|
+
e2.query = e2.query || {};
|
|
5146
|
+
for (let t2 in e2) n.includes(t2) || (e2.query[t2] = e2[t2], delete e2[t2]);
|
|
5147
|
+
}
|
|
5148
|
+
}
|
|
5149
|
+
function serializeQueryParams(e2) {
|
|
5150
|
+
const t2 = [];
|
|
5151
|
+
for (const s2 in e2) {
|
|
5152
|
+
const i2 = encodeURIComponent(s2), n2 = Array.isArray(e2[s2]) ? e2[s2] : [e2[s2]];
|
|
5153
|
+
for (let e3 of n2) e3 = prepareQueryParamValue(e3), null !== e3 && t2.push(i2 + "=" + e3);
|
|
5154
|
+
}
|
|
5155
|
+
return t2.join("&");
|
|
5156
|
+
}
|
|
5157
|
+
function prepareQueryParamValue(e2) {
|
|
5158
|
+
return null == e2 ? null : e2 instanceof Date ? encodeURIComponent(e2.toISOString().replace("T", " ")) : "object" == typeof e2 ? encodeURIComponent(JSON.stringify(e2)) : encodeURIComponent(e2);
|
|
5159
|
+
}
|
|
5160
|
+
class RealtimeService extends BaseService {
|
|
5161
|
+
constructor() {
|
|
5162
|
+
super(...arguments), this.clientId = "", this.eventSource = null, this.subscriptions = {}, this.lastSentSubscriptions = [], this.maxConnectTimeout = 15e3, this.reconnectAttempts = 0, this.maxReconnectAttempts = 1 / 0, this.predefinedReconnectIntervals = [200, 300, 500, 1e3, 1200, 1500, 2e3], this.pendingConnects = [];
|
|
5163
|
+
}
|
|
5164
|
+
get isConnected() {
|
|
5165
|
+
return !!this.eventSource && !!this.clientId && !this.pendingConnects.length;
|
|
5166
|
+
}
|
|
5167
|
+
async subscribe(e2, t2, s2) {
|
|
5168
|
+
var _a2;
|
|
5169
|
+
if (!e2) throw new Error("topic must be set.");
|
|
5170
|
+
let i2 = e2;
|
|
5171
|
+
if (s2) {
|
|
5172
|
+
normalizeUnknownQueryParams(s2 = Object.assign({}, s2));
|
|
5173
|
+
const e3 = "options=" + encodeURIComponent(JSON.stringify({ query: s2.query, headers: s2.headers }));
|
|
5174
|
+
i2 += (i2.includes("?") ? "&" : "?") + e3;
|
|
5175
|
+
}
|
|
5176
|
+
const listener = function(e3) {
|
|
5177
|
+
const s3 = e3;
|
|
5178
|
+
let i3;
|
|
5179
|
+
try {
|
|
5180
|
+
i3 = JSON.parse(s3 == null ? void 0 : s3.data);
|
|
5181
|
+
} catch {
|
|
5182
|
+
}
|
|
5183
|
+
t2(i3 || {});
|
|
5184
|
+
};
|
|
5185
|
+
return this.subscriptions[i2] || (this.subscriptions[i2] = []), this.subscriptions[i2].push(listener), this.isConnected ? 1 === this.subscriptions[i2].length ? await this.submitSubscriptions() : (_a2 = this.eventSource) == null ? void 0 : _a2.addEventListener(i2, listener) : await this.connect(), async () => this.unsubscribeByTopicAndListener(e2, listener);
|
|
5186
|
+
}
|
|
5187
|
+
async unsubscribe(e2) {
|
|
5188
|
+
var _a2;
|
|
5189
|
+
let t2 = false;
|
|
5190
|
+
if (e2) {
|
|
5191
|
+
const s2 = this.getSubscriptionsByTopic(e2);
|
|
5192
|
+
for (let e3 in s2) if (this.hasSubscriptionListeners(e3)) {
|
|
5193
|
+
for (let t3 of this.subscriptions[e3]) (_a2 = this.eventSource) == null ? void 0 : _a2.removeEventListener(e3, t3);
|
|
5194
|
+
delete this.subscriptions[e3], t2 || (t2 = true);
|
|
5195
|
+
}
|
|
5196
|
+
} else this.subscriptions = {};
|
|
5197
|
+
this.hasSubscriptionListeners() ? t2 && await this.submitSubscriptions() : this.disconnect();
|
|
5198
|
+
}
|
|
5199
|
+
async unsubscribeByPrefix(e2) {
|
|
5200
|
+
var _a2;
|
|
5201
|
+
let t2 = false;
|
|
5202
|
+
for (let s2 in this.subscriptions) if ((s2 + "?").startsWith(e2)) {
|
|
5203
|
+
t2 = true;
|
|
5204
|
+
for (let e3 of this.subscriptions[s2]) (_a2 = this.eventSource) == null ? void 0 : _a2.removeEventListener(s2, e3);
|
|
5205
|
+
delete this.subscriptions[s2];
|
|
5206
|
+
}
|
|
5207
|
+
t2 && (this.hasSubscriptionListeners() ? await this.submitSubscriptions() : this.disconnect());
|
|
5208
|
+
}
|
|
5209
|
+
async unsubscribeByTopicAndListener(e2, t2) {
|
|
5210
|
+
var _a2;
|
|
5211
|
+
let s2 = false;
|
|
5212
|
+
const i2 = this.getSubscriptionsByTopic(e2);
|
|
5213
|
+
for (let e3 in i2) {
|
|
5214
|
+
if (!Array.isArray(this.subscriptions[e3]) || !this.subscriptions[e3].length) continue;
|
|
5215
|
+
let i3 = false;
|
|
5216
|
+
for (let s3 = this.subscriptions[e3].length - 1; s3 >= 0; s3--) this.subscriptions[e3][s3] === t2 && (i3 = true, delete this.subscriptions[e3][s3], this.subscriptions[e3].splice(s3, 1), (_a2 = this.eventSource) == null ? void 0 : _a2.removeEventListener(e3, t2));
|
|
5217
|
+
i3 && (this.subscriptions[e3].length || delete this.subscriptions[e3], s2 || this.hasSubscriptionListeners(e3) || (s2 = true));
|
|
5218
|
+
}
|
|
5219
|
+
this.hasSubscriptionListeners() ? s2 && await this.submitSubscriptions() : this.disconnect();
|
|
5220
|
+
}
|
|
5221
|
+
hasSubscriptionListeners(e2) {
|
|
5222
|
+
var _a2, _b2;
|
|
5223
|
+
if (this.subscriptions = this.subscriptions || {}, e2) return !!((_a2 = this.subscriptions[e2]) == null ? void 0 : _a2.length);
|
|
5224
|
+
for (let e3 in this.subscriptions) if ((_b2 = this.subscriptions[e3]) == null ? void 0 : _b2.length) return true;
|
|
5225
|
+
return false;
|
|
5226
|
+
}
|
|
5227
|
+
async submitSubscriptions() {
|
|
5228
|
+
if (this.clientId) return this.addAllSubscriptionListeners(), this.lastSentSubscriptions = this.getNonEmptySubscriptionKeys(), this.client.send("/api/realtime", { method: "POST", body: { clientId: this.clientId, subscriptions: this.lastSentSubscriptions }, requestKey: this.getSubscriptionsCancelKey() }).catch((e2) => {
|
|
5229
|
+
if (!(e2 == null ? void 0 : e2.isAbort)) throw e2;
|
|
5230
|
+
});
|
|
5231
|
+
}
|
|
5232
|
+
getSubscriptionsCancelKey() {
|
|
5233
|
+
return "realtime_" + this.clientId;
|
|
5234
|
+
}
|
|
5235
|
+
getSubscriptionsByTopic(e2) {
|
|
5236
|
+
const t2 = {};
|
|
5237
|
+
e2 = e2.includes("?") ? e2 : e2 + "?";
|
|
5238
|
+
for (let s2 in this.subscriptions) (s2 + "?").startsWith(e2) && (t2[s2] = this.subscriptions[s2]);
|
|
5239
|
+
return t2;
|
|
5240
|
+
}
|
|
5241
|
+
getNonEmptySubscriptionKeys() {
|
|
5242
|
+
const e2 = [];
|
|
5243
|
+
for (let t2 in this.subscriptions) this.subscriptions[t2].length && e2.push(t2);
|
|
5244
|
+
return e2;
|
|
5245
|
+
}
|
|
5246
|
+
addAllSubscriptionListeners() {
|
|
5247
|
+
if (this.eventSource) {
|
|
5248
|
+
this.removeAllSubscriptionListeners();
|
|
5249
|
+
for (let e2 in this.subscriptions) for (let t2 of this.subscriptions[e2]) this.eventSource.addEventListener(e2, t2);
|
|
5250
|
+
}
|
|
5251
|
+
}
|
|
5252
|
+
removeAllSubscriptionListeners() {
|
|
5253
|
+
if (this.eventSource) for (let e2 in this.subscriptions) for (let t2 of this.subscriptions[e2]) this.eventSource.removeEventListener(e2, t2);
|
|
5254
|
+
}
|
|
5255
|
+
async connect() {
|
|
5256
|
+
if (!(this.reconnectAttempts > 0)) return new Promise((e2, t2) => {
|
|
5257
|
+
this.pendingConnects.push({ resolve: e2, reject: t2 }), this.pendingConnects.length > 1 || this.initConnect();
|
|
5258
|
+
});
|
|
5259
|
+
}
|
|
5260
|
+
initConnect() {
|
|
5261
|
+
this.disconnect(true), clearTimeout(this.connectTimeoutId), this.connectTimeoutId = setTimeout(() => {
|
|
5262
|
+
this.connectErrorHandler(new Error("EventSource connect took too long."));
|
|
5263
|
+
}, this.maxConnectTimeout), this.eventSource = new EventSource(this.client.buildURL("/api/realtime")), this.eventSource.onerror = (e2) => {
|
|
5264
|
+
this.connectErrorHandler(new Error("Failed to establish realtime connection."));
|
|
5265
|
+
}, this.eventSource.addEventListener("PB_CONNECT", (e2) => {
|
|
5266
|
+
const t2 = e2;
|
|
5267
|
+
this.clientId = t2 == null ? void 0 : t2.lastEventId, this.submitSubscriptions().then(async () => {
|
|
5268
|
+
let e3 = 3;
|
|
5269
|
+
for (; this.hasUnsentSubscriptions() && e3 > 0; ) e3--, await this.submitSubscriptions();
|
|
5270
|
+
}).then(() => {
|
|
5271
|
+
for (let e3 of this.pendingConnects) e3.resolve();
|
|
5272
|
+
this.pendingConnects = [], this.reconnectAttempts = 0, clearTimeout(this.reconnectTimeoutId), clearTimeout(this.connectTimeoutId);
|
|
5273
|
+
const t3 = this.getSubscriptionsByTopic("PB_CONNECT");
|
|
5274
|
+
for (let s2 in t3) for (let i2 of t3[s2]) i2(e2);
|
|
5275
|
+
}).catch((e3) => {
|
|
5276
|
+
this.clientId = "", this.connectErrorHandler(e3);
|
|
5277
|
+
});
|
|
5278
|
+
});
|
|
5279
|
+
}
|
|
5280
|
+
hasUnsentSubscriptions() {
|
|
5281
|
+
const e2 = this.getNonEmptySubscriptionKeys();
|
|
5282
|
+
if (e2.length != this.lastSentSubscriptions.length) return true;
|
|
5283
|
+
for (const t2 of e2) if (!this.lastSentSubscriptions.includes(t2)) return true;
|
|
5284
|
+
return false;
|
|
5285
|
+
}
|
|
5286
|
+
connectErrorHandler(e2) {
|
|
5287
|
+
if (clearTimeout(this.connectTimeoutId), clearTimeout(this.reconnectTimeoutId), !this.clientId && !this.reconnectAttempts || this.reconnectAttempts > this.maxReconnectAttempts) {
|
|
5288
|
+
for (let t3 of this.pendingConnects) t3.reject(new ClientResponseError(e2));
|
|
5289
|
+
return this.pendingConnects = [], void this.disconnect();
|
|
5290
|
+
}
|
|
5291
|
+
this.disconnect(true);
|
|
5292
|
+
const t2 = this.predefinedReconnectIntervals[this.reconnectAttempts] || this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length - 1];
|
|
5293
|
+
this.reconnectAttempts++, this.reconnectTimeoutId = setTimeout(() => {
|
|
5294
|
+
this.initConnect();
|
|
5295
|
+
}, t2);
|
|
5296
|
+
}
|
|
5297
|
+
disconnect(e2 = false) {
|
|
5298
|
+
var _a2;
|
|
5299
|
+
if (this.clientId && this.onDisconnect && this.onDisconnect(Object.keys(this.subscriptions)), clearTimeout(this.connectTimeoutId), clearTimeout(this.reconnectTimeoutId), this.removeAllSubscriptionListeners(), this.client.cancelRequest(this.getSubscriptionsCancelKey()), (_a2 = this.eventSource) == null ? void 0 : _a2.close(), this.eventSource = null, this.clientId = "", !e2) {
|
|
5300
|
+
this.reconnectAttempts = 0;
|
|
5301
|
+
for (let e3 of this.pendingConnects) e3.resolve();
|
|
5302
|
+
this.pendingConnects = [];
|
|
5303
|
+
}
|
|
5304
|
+
}
|
|
5305
|
+
}
|
|
5306
|
+
class CrudService extends BaseService {
|
|
5307
|
+
decode(e2) {
|
|
5308
|
+
return e2;
|
|
5309
|
+
}
|
|
5310
|
+
async getFullList(e2, t2) {
|
|
5311
|
+
if ("number" == typeof e2) return this._getFullList(e2, t2);
|
|
5312
|
+
let s2 = 500;
|
|
5313
|
+
return (t2 = Object.assign({}, e2, t2)).batch && (s2 = t2.batch, delete t2.batch), this._getFullList(s2, t2);
|
|
5314
|
+
}
|
|
5315
|
+
async getList(e2 = 1, t2 = 30, s2) {
|
|
5316
|
+
return (s2 = Object.assign({ method: "GET" }, s2)).query = Object.assign({ page: e2, perPage: t2 }, s2.query), this.client.send(this.baseCrudPath, s2).then((e3) => {
|
|
5317
|
+
var _a2;
|
|
5318
|
+
return e3.items = ((_a2 = e3.items) == null ? void 0 : _a2.map((e4) => this.decode(e4))) || [], e3;
|
|
5319
|
+
});
|
|
5320
|
+
}
|
|
5321
|
+
async getFirstListItem(e2, t2) {
|
|
5322
|
+
return (t2 = Object.assign({ requestKey: "one_by_filter_" + this.baseCrudPath + "_" + e2 }, t2)).query = Object.assign({ filter: e2, skipTotal: 1 }, t2.query), this.getList(1, 1, t2).then((e3) => {
|
|
5323
|
+
var _a2;
|
|
5324
|
+
if (!((_a2 = e3 == null ? void 0 : e3.items) == null ? void 0 : _a2.length)) throw new ClientResponseError({ status: 404, response: { code: 404, message: "The requested resource wasn't found.", data: {} } });
|
|
5325
|
+
return e3.items[0];
|
|
5326
|
+
});
|
|
5327
|
+
}
|
|
5328
|
+
async getOne(e2, t2) {
|
|
5329
|
+
if (!e2) throw new ClientResponseError({ url: this.client.buildURL(this.baseCrudPath + "/"), status: 404, response: { code: 404, message: "Missing required record id.", data: {} } });
|
|
5330
|
+
return t2 = Object.assign({ method: "GET" }, t2), this.client.send(this.baseCrudPath + "/" + encodeURIComponent(e2), t2).then((e3) => this.decode(e3));
|
|
5331
|
+
}
|
|
5332
|
+
async create(e2, t2) {
|
|
5333
|
+
return t2 = Object.assign({ method: "POST", body: e2 }, t2), this.client.send(this.baseCrudPath, t2).then((e3) => this.decode(e3));
|
|
5334
|
+
}
|
|
5335
|
+
async update(e2, t2, s2) {
|
|
5336
|
+
return s2 = Object.assign({ method: "PATCH", body: t2 }, s2), this.client.send(this.baseCrudPath + "/" + encodeURIComponent(e2), s2).then((e3) => this.decode(e3));
|
|
5337
|
+
}
|
|
5338
|
+
async delete(e2, t2) {
|
|
5339
|
+
return t2 = Object.assign({ method: "DELETE" }, t2), this.client.send(this.baseCrudPath + "/" + encodeURIComponent(e2), t2).then(() => true);
|
|
5340
|
+
}
|
|
5341
|
+
_getFullList(e2 = 500, t2) {
|
|
5342
|
+
(t2 = t2 || {}).query = Object.assign({ skipTotal: 1 }, t2.query);
|
|
5343
|
+
let s2 = [], request = async (i2) => this.getList(i2, e2 || 500, t2).then((e3) => {
|
|
5344
|
+
const t3 = e3.items;
|
|
5345
|
+
return s2 = s2.concat(t3), t3.length == e3.perPage ? request(i2 + 1) : s2;
|
|
5346
|
+
});
|
|
5347
|
+
return request(1);
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
function normalizeLegacyOptionsArgs(e2, t2, s2, i2) {
|
|
5351
|
+
const n2 = void 0 !== i2;
|
|
5352
|
+
return n2 || void 0 !== s2 ? n2 ? (console.warn(e2), t2.body = Object.assign({}, t2.body, s2), t2.query = Object.assign({}, t2.query, i2), t2) : Object.assign(t2, s2) : t2;
|
|
5353
|
+
}
|
|
5354
|
+
function resetAutoRefresh(e2) {
|
|
5355
|
+
var _a2;
|
|
5356
|
+
(_a2 = e2._resetAutoRefresh) == null ? void 0 : _a2.call(e2);
|
|
5357
|
+
}
|
|
5358
|
+
class RecordService extends CrudService {
|
|
5359
|
+
constructor(e2, t2) {
|
|
5360
|
+
super(e2), this.collectionIdOrName = t2;
|
|
5361
|
+
}
|
|
5362
|
+
get baseCrudPath() {
|
|
5363
|
+
return this.baseCollectionPath + "/records";
|
|
5364
|
+
}
|
|
5365
|
+
get baseCollectionPath() {
|
|
5366
|
+
return "/api/collections/" + encodeURIComponent(this.collectionIdOrName);
|
|
5367
|
+
}
|
|
5368
|
+
get isSuperusers() {
|
|
5369
|
+
return "_superusers" == this.collectionIdOrName || "_pbc_2773867675" == this.collectionIdOrName;
|
|
5370
|
+
}
|
|
5371
|
+
async subscribe(e2, t2, s2) {
|
|
5372
|
+
if (!e2) throw new Error("Missing topic.");
|
|
5373
|
+
if (!t2) throw new Error("Missing subscription callback.");
|
|
5374
|
+
return this.client.realtime.subscribe(this.collectionIdOrName + "/" + e2, t2, s2);
|
|
5375
|
+
}
|
|
5376
|
+
async unsubscribe(e2) {
|
|
5377
|
+
return e2 ? this.client.realtime.unsubscribe(this.collectionIdOrName + "/" + e2) : this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName);
|
|
5378
|
+
}
|
|
5379
|
+
async getFullList(e2, t2) {
|
|
5380
|
+
if ("number" == typeof e2) return super.getFullList(e2, t2);
|
|
5381
|
+
const s2 = Object.assign({}, e2, t2);
|
|
5382
|
+
return super.getFullList(s2);
|
|
5383
|
+
}
|
|
5384
|
+
async getList(e2 = 1, t2 = 30, s2) {
|
|
5385
|
+
return super.getList(e2, t2, s2);
|
|
5386
|
+
}
|
|
5387
|
+
async getFirstListItem(e2, t2) {
|
|
5388
|
+
return super.getFirstListItem(e2, t2);
|
|
5389
|
+
}
|
|
5390
|
+
async getOne(e2, t2) {
|
|
5391
|
+
return super.getOne(e2, t2);
|
|
5392
|
+
}
|
|
5393
|
+
async create(e2, t2) {
|
|
5394
|
+
return super.create(e2, t2);
|
|
5395
|
+
}
|
|
5396
|
+
async update(e2, t2, s2) {
|
|
5397
|
+
return super.update(e2, t2, s2).then((e3) => {
|
|
5398
|
+
var _a2, _b2, _c2;
|
|
5399
|
+
if (((_a2 = this.client.authStore.record) == null ? void 0 : _a2.id) === (e3 == null ? void 0 : e3.id) && (((_b2 = this.client.authStore.record) == null ? void 0 : _b2.collectionId) === this.collectionIdOrName || ((_c2 = this.client.authStore.record) == null ? void 0 : _c2.collectionName) === this.collectionIdOrName)) {
|
|
5400
|
+
let t3 = Object.assign({}, this.client.authStore.record.expand), s3 = Object.assign({}, this.client.authStore.record, e3);
|
|
5401
|
+
t3 && (s3.expand = Object.assign(t3, e3.expand)), this.client.authStore.save(this.client.authStore.token, s3);
|
|
5402
|
+
}
|
|
5403
|
+
return e3;
|
|
5404
|
+
});
|
|
5405
|
+
}
|
|
5406
|
+
async delete(e2, t2) {
|
|
5407
|
+
return super.delete(e2, t2).then((t3) => {
|
|
5408
|
+
var _a2, _b2, _c2;
|
|
5409
|
+
return !t3 || ((_a2 = this.client.authStore.record) == null ? void 0 : _a2.id) !== e2 || ((_b2 = this.client.authStore.record) == null ? void 0 : _b2.collectionId) !== this.collectionIdOrName && ((_c2 = this.client.authStore.record) == null ? void 0 : _c2.collectionName) !== this.collectionIdOrName || this.client.authStore.clear(), t3;
|
|
5410
|
+
});
|
|
5411
|
+
}
|
|
5412
|
+
authResponse(e2) {
|
|
5413
|
+
const t2 = this.decode((e2 == null ? void 0 : e2.record) || {});
|
|
5414
|
+
return this.client.authStore.save(e2 == null ? void 0 : e2.token, t2), Object.assign({}, e2, { token: (e2 == null ? void 0 : e2.token) || "", record: t2 });
|
|
5415
|
+
}
|
|
5416
|
+
async listAuthMethods(e2) {
|
|
5417
|
+
return e2 = Object.assign({ method: "GET", fields: "mfa,otp,password,oauth2" }, e2), this.client.send(this.baseCollectionPath + "/auth-methods", e2);
|
|
5418
|
+
}
|
|
5419
|
+
async authWithPassword(e2, t2, s2) {
|
|
5420
|
+
let i2;
|
|
5421
|
+
s2 = Object.assign({ method: "POST", body: { identity: e2, password: t2 } }, s2), this.isSuperusers && (i2 = s2.autoRefreshThreshold, delete s2.autoRefreshThreshold, s2.autoRefresh || resetAutoRefresh(this.client));
|
|
5422
|
+
let n2 = await this.client.send(this.baseCollectionPath + "/auth-with-password", s2);
|
|
5423
|
+
return n2 = this.authResponse(n2), i2 && this.isSuperusers && function registerAutoRefresh(e3, t3, s3, i3) {
|
|
5424
|
+
resetAutoRefresh(e3);
|
|
5425
|
+
const n3 = e3.beforeSend, r2 = e3.authStore.record, o = e3.authStore.onChange((t4, s4) => {
|
|
5426
|
+
(!t4 || (s4 == null ? void 0 : s4.id) != (r2 == null ? void 0 : r2.id) || ((s4 == null ? void 0 : s4.collectionId) || (r2 == null ? void 0 : r2.collectionId)) && (s4 == null ? void 0 : s4.collectionId) != (r2 == null ? void 0 : r2.collectionId)) && resetAutoRefresh(e3);
|
|
5427
|
+
});
|
|
5428
|
+
e3._resetAutoRefresh = function() {
|
|
5429
|
+
o(), e3.beforeSend = n3, delete e3._resetAutoRefresh;
|
|
5430
|
+
}, e3.beforeSend = async (r3, o2) => {
|
|
5431
|
+
var _a2;
|
|
5432
|
+
const a = e3.authStore.token;
|
|
5433
|
+
if ((_a2 = o2.query) == null ? void 0 : _a2.autoRefresh) return n3 ? n3(r3, o2) : { url: r3, sendOptions: o2 };
|
|
5434
|
+
let c = e3.authStore.isValid;
|
|
5435
|
+
if (c && isTokenExpired(e3.authStore.token, t3)) try {
|
|
5436
|
+
await s3();
|
|
5437
|
+
} catch (e4) {
|
|
5438
|
+
c = false;
|
|
5439
|
+
}
|
|
5440
|
+
c || await i3();
|
|
5441
|
+
const l = o2.headers || {};
|
|
5442
|
+
for (let t4 in l) if ("authorization" == t4.toLowerCase() && a == l[t4] && e3.authStore.token) {
|
|
5443
|
+
l[t4] = e3.authStore.token;
|
|
5444
|
+
break;
|
|
5445
|
+
}
|
|
5446
|
+
return o2.headers = l, n3 ? n3(r3, o2) : { url: r3, sendOptions: o2 };
|
|
5447
|
+
};
|
|
5448
|
+
}(this.client, i2, () => this.authRefresh({ autoRefresh: true }), () => this.authWithPassword(e2, t2, Object.assign({ autoRefresh: true }, s2))), n2;
|
|
5449
|
+
}
|
|
5450
|
+
async authWithOAuth2Code(e2, t2, s2, i2, n2, r2, o) {
|
|
5451
|
+
let a = { method: "POST", body: { provider: e2, code: t2, codeVerifier: s2, redirectURL: i2, createData: n2 } };
|
|
5452
|
+
return a = normalizeLegacyOptionsArgs("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).", a, r2, o), this.client.send(this.baseCollectionPath + "/auth-with-oauth2", a).then((e3) => this.authResponse(e3));
|
|
5453
|
+
}
|
|
5454
|
+
authWithOAuth2(...e2) {
|
|
5455
|
+
if (e2.length > 1 || "string" == typeof (e2 == null ? void 0 : e2[0])) return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."), this.authWithOAuth2Code((e2 == null ? void 0 : e2[0]) || "", (e2 == null ? void 0 : e2[1]) || "", (e2 == null ? void 0 : e2[2]) || "", (e2 == null ? void 0 : e2[3]) || "", (e2 == null ? void 0 : e2[4]) || {}, (e2 == null ? void 0 : e2[5]) || {}, (e2 == null ? void 0 : e2[6]) || {});
|
|
5456
|
+
const t2 = (e2 == null ? void 0 : e2[0]) || {};
|
|
5457
|
+
let s2 = null;
|
|
5458
|
+
t2.urlCallback || (s2 = openBrowserPopup(void 0));
|
|
5459
|
+
const i2 = new RealtimeService(this.client);
|
|
5460
|
+
function cleanup() {
|
|
5461
|
+
s2 == null ? void 0 : s2.close(), i2.unsubscribe();
|
|
5462
|
+
}
|
|
5463
|
+
const n2 = {}, r2 = t2.requestKey;
|
|
5464
|
+
return r2 && (n2.requestKey = r2), this.listAuthMethods(n2).then((e3) => {
|
|
5465
|
+
var _a2;
|
|
5466
|
+
const n3 = e3.oauth2.providers.find((e4) => e4.name === t2.provider);
|
|
5467
|
+
if (!n3) throw new ClientResponseError(new Error(`Missing or invalid provider "${t2.provider}".`));
|
|
5468
|
+
const o = this.client.buildURL("/api/oauth2-redirect"), a = r2 ? (_a2 = this.client.cancelControllers) == null ? void 0 : _a2[r2] : void 0;
|
|
5469
|
+
return a && (a.signal.onabort = () => {
|
|
5470
|
+
cleanup();
|
|
5471
|
+
}), new Promise(async (e4, r3) => {
|
|
5472
|
+
var _a3;
|
|
5473
|
+
try {
|
|
5474
|
+
await i2.subscribe("@oauth2", async (s3) => {
|
|
5475
|
+
var _a4;
|
|
5476
|
+
const c2 = i2.clientId;
|
|
5477
|
+
try {
|
|
5478
|
+
if (!s3.state || c2 !== s3.state) throw new Error("State parameters don't match.");
|
|
5479
|
+
if (s3.error || !s3.code) throw new Error("OAuth2 redirect error or missing code: " + s3.error);
|
|
5480
|
+
const i3 = Object.assign({}, t2);
|
|
5481
|
+
delete i3.provider, delete i3.scopes, delete i3.createData, delete i3.urlCallback, ((_a4 = a == null ? void 0 : a.signal) == null ? void 0 : _a4.onabort) && (a.signal.onabort = null);
|
|
5482
|
+
const r4 = await this.authWithOAuth2Code(n3.name, s3.code, n3.codeVerifier, o, t2.createData, i3);
|
|
5483
|
+
e4(r4);
|
|
5484
|
+
} catch (e5) {
|
|
5485
|
+
r3(new ClientResponseError(e5));
|
|
5486
|
+
}
|
|
5487
|
+
cleanup();
|
|
5488
|
+
});
|
|
5489
|
+
const c = { state: i2.clientId };
|
|
5490
|
+
((_a3 = t2.scopes) == null ? void 0 : _a3.length) && (c.scope = t2.scopes.join(" "));
|
|
5491
|
+
const l = this._replaceQueryParams(n3.authURL + o, c);
|
|
5492
|
+
let h = t2.urlCallback || function(e5) {
|
|
5493
|
+
s2 ? s2.location.href = e5 : s2 = openBrowserPopup(e5);
|
|
5494
|
+
};
|
|
5495
|
+
await h(l);
|
|
5496
|
+
} catch (e5) {
|
|
5497
|
+
cleanup(), r3(new ClientResponseError(e5));
|
|
5498
|
+
}
|
|
5499
|
+
});
|
|
5500
|
+
}).catch((e3) => {
|
|
5501
|
+
throw cleanup(), e3;
|
|
5502
|
+
});
|
|
5503
|
+
}
|
|
5504
|
+
async authRefresh(e2, t2) {
|
|
5505
|
+
let s2 = { method: "POST" };
|
|
5506
|
+
return s2 = normalizeLegacyOptionsArgs("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).", s2, e2, t2), this.client.send(this.baseCollectionPath + "/auth-refresh", s2).then((e3) => this.authResponse(e3));
|
|
5507
|
+
}
|
|
5508
|
+
async requestPasswordReset(e2, t2, s2) {
|
|
5509
|
+
let i2 = { method: "POST", body: { email: e2 } };
|
|
5510
|
+
return i2 = normalizeLegacyOptionsArgs("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).", i2, t2, s2), this.client.send(this.baseCollectionPath + "/request-password-reset", i2).then(() => true);
|
|
5511
|
+
}
|
|
5512
|
+
async confirmPasswordReset(e2, t2, s2, i2, n2) {
|
|
5513
|
+
let r2 = { method: "POST", body: { token: e2, password: t2, passwordConfirm: s2 } };
|
|
5514
|
+
return r2 = normalizeLegacyOptionsArgs("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).", r2, i2, n2), this.client.send(this.baseCollectionPath + "/confirm-password-reset", r2).then(() => true);
|
|
5515
|
+
}
|
|
5516
|
+
async requestVerification(e2, t2, s2) {
|
|
5517
|
+
let i2 = { method: "POST", body: { email: e2 } };
|
|
5518
|
+
return i2 = normalizeLegacyOptionsArgs("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).", i2, t2, s2), this.client.send(this.baseCollectionPath + "/request-verification", i2).then(() => true);
|
|
5519
|
+
}
|
|
5520
|
+
async confirmVerification(e2, t2, s2) {
|
|
5521
|
+
let i2 = { method: "POST", body: { token: e2 } };
|
|
5522
|
+
return i2 = normalizeLegacyOptionsArgs("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).", i2, t2, s2), this.client.send(this.baseCollectionPath + "/confirm-verification", i2).then(() => {
|
|
5523
|
+
const t3 = getTokenPayload(e2), s3 = this.client.authStore.record;
|
|
5524
|
+
return s3 && !s3.verified && s3.id === t3.id && s3.collectionId === t3.collectionId && (s3.verified = true, this.client.authStore.save(this.client.authStore.token, s3)), true;
|
|
5525
|
+
});
|
|
5526
|
+
}
|
|
5527
|
+
async requestEmailChange(e2, t2, s2) {
|
|
5528
|
+
let i2 = { method: "POST", body: { newEmail: e2 } };
|
|
5529
|
+
return i2 = normalizeLegacyOptionsArgs("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).", i2, t2, s2), this.client.send(this.baseCollectionPath + "/request-email-change", i2).then(() => true);
|
|
5530
|
+
}
|
|
5531
|
+
async confirmEmailChange(e2, t2, s2, i2) {
|
|
5532
|
+
let n2 = { method: "POST", body: { token: e2, password: t2 } };
|
|
5533
|
+
return n2 = normalizeLegacyOptionsArgs("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).", n2, s2, i2), this.client.send(this.baseCollectionPath + "/confirm-email-change", n2).then(() => {
|
|
5534
|
+
const t3 = getTokenPayload(e2), s3 = this.client.authStore.record;
|
|
5535
|
+
return s3 && s3.id === t3.id && s3.collectionId === t3.collectionId && this.client.authStore.clear(), true;
|
|
5536
|
+
});
|
|
5537
|
+
}
|
|
5538
|
+
async listExternalAuths(e2, t2) {
|
|
5539
|
+
return this.client.collection("_externalAuths").getFullList(Object.assign({}, t2, { filter: this.client.filter("recordRef = {:id}", { id: e2 }) }));
|
|
5540
|
+
}
|
|
5541
|
+
async unlinkExternalAuth(e2, t2, s2) {
|
|
5542
|
+
const i2 = await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}", { recordId: e2, provider: t2 }));
|
|
5543
|
+
return this.client.collection("_externalAuths").delete(i2.id, s2).then(() => true);
|
|
5544
|
+
}
|
|
5545
|
+
async requestOTP(e2, t2) {
|
|
5546
|
+
return t2 = Object.assign({ method: "POST", body: { email: e2 } }, t2), this.client.send(this.baseCollectionPath + "/request-otp", t2);
|
|
5547
|
+
}
|
|
5548
|
+
async authWithOTP(e2, t2, s2) {
|
|
5549
|
+
return s2 = Object.assign({ method: "POST", body: { otpId: e2, password: t2 } }, s2), this.client.send(this.baseCollectionPath + "/auth-with-otp", s2).then((e3) => this.authResponse(e3));
|
|
5550
|
+
}
|
|
5551
|
+
async impersonate(e2, t2, s2) {
|
|
5552
|
+
(s2 = Object.assign({ method: "POST", body: { duration: t2 } }, s2)).headers = s2.headers || {}, s2.headers.Authorization || (s2.headers.Authorization = this.client.authStore.token);
|
|
5553
|
+
const i2 = new Client(this.client.baseURL, new BaseAuthStore(), this.client.lang), n2 = await i2.send(this.baseCollectionPath + "/impersonate/" + encodeURIComponent(e2), s2);
|
|
5554
|
+
return i2.authStore.save(n2 == null ? void 0 : n2.token, this.decode((n2 == null ? void 0 : n2.record) || {})), i2;
|
|
5555
|
+
}
|
|
5556
|
+
_replaceQueryParams(e2, t2 = {}) {
|
|
5557
|
+
let s2 = e2, i2 = "";
|
|
5558
|
+
e2.indexOf("?") >= 0 && (s2 = e2.substring(0, e2.indexOf("?")), i2 = e2.substring(e2.indexOf("?") + 1));
|
|
5559
|
+
const n2 = {}, r2 = i2.split("&");
|
|
5560
|
+
for (const e3 of r2) {
|
|
5561
|
+
if ("" == e3) continue;
|
|
5562
|
+
const t3 = e3.split("=");
|
|
5563
|
+
n2[decodeURIComponent(t3[0].replace(/\+/g, " "))] = decodeURIComponent((t3[1] || "").replace(/\+/g, " "));
|
|
5564
|
+
}
|
|
5565
|
+
for (let e3 in t2) t2.hasOwnProperty(e3) && (null == t2[e3] ? delete n2[e3] : n2[e3] = t2[e3]);
|
|
5566
|
+
i2 = "";
|
|
5567
|
+
for (let e3 in n2) n2.hasOwnProperty(e3) && ("" != i2 && (i2 += "&"), i2 += encodeURIComponent(e3.replace(/%20/g, "+")) + "=" + encodeURIComponent(n2[e3].replace(/%20/g, "+")));
|
|
5568
|
+
return "" != i2 ? s2 + "?" + i2 : s2;
|
|
5569
|
+
}
|
|
5570
|
+
}
|
|
5571
|
+
function openBrowserPopup(e2) {
|
|
5572
|
+
if ("undefined" == typeof window || !(window == null ? void 0 : window.open)) throw new ClientResponseError(new Error("Not in a browser context - please pass a custom urlCallback function."));
|
|
5573
|
+
let t2 = 1024, s2 = 768, i2 = window.innerWidth, n2 = window.innerHeight;
|
|
5574
|
+
t2 = t2 > i2 ? i2 : t2, s2 = s2 > n2 ? n2 : s2;
|
|
5575
|
+
let r2 = i2 / 2 - t2 / 2, o = n2 / 2 - s2 / 2;
|
|
5576
|
+
return window.open(e2, "popup_window", "width=" + t2 + ",height=" + s2 + ",top=" + o + ",left=" + r2 + ",resizable,menubar=no");
|
|
5577
|
+
}
|
|
5578
|
+
class CollectionService extends CrudService {
|
|
5579
|
+
get baseCrudPath() {
|
|
5580
|
+
return "/api/collections";
|
|
5581
|
+
}
|
|
5582
|
+
async import(e2, t2 = false, s2) {
|
|
5583
|
+
return s2 = Object.assign({ method: "PUT", body: { collections: e2, deleteMissing: t2 } }, s2), this.client.send(this.baseCrudPath + "/import", s2).then(() => true);
|
|
5584
|
+
}
|
|
5585
|
+
async getScaffolds(e2) {
|
|
5586
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send(this.baseCrudPath + "/meta/scaffolds", e2);
|
|
5587
|
+
}
|
|
5588
|
+
async truncate(e2, t2) {
|
|
5589
|
+
return t2 = Object.assign({ method: "DELETE" }, t2), this.client.send(this.baseCrudPath + "/" + encodeURIComponent(e2) + "/truncate", t2).then(() => true);
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
class LogService extends BaseService {
|
|
5593
|
+
async getList(e2 = 1, t2 = 30, s2) {
|
|
5594
|
+
return (s2 = Object.assign({ method: "GET" }, s2)).query = Object.assign({ page: e2, perPage: t2 }, s2.query), this.client.send("/api/logs", s2);
|
|
5595
|
+
}
|
|
5596
|
+
async getOne(e2, t2) {
|
|
5597
|
+
if (!e2) throw new ClientResponseError({ url: this.client.buildURL("/api/logs/"), status: 404, response: { code: 404, message: "Missing required log id.", data: {} } });
|
|
5598
|
+
return t2 = Object.assign({ method: "GET" }, t2), this.client.send("/api/logs/" + encodeURIComponent(e2), t2);
|
|
5599
|
+
}
|
|
5600
|
+
async getStats(e2) {
|
|
5601
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send("/api/logs/stats", e2);
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5604
|
+
class HealthService extends BaseService {
|
|
5605
|
+
async check(e2) {
|
|
5606
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send("/api/health", e2);
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
class FileService extends BaseService {
|
|
5610
|
+
getUrl(e2, t2, s2 = {}) {
|
|
5611
|
+
return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"), this.getURL(e2, t2, s2);
|
|
5612
|
+
}
|
|
5613
|
+
getURL(e2, t2, s2 = {}) {
|
|
5614
|
+
if (!t2 || !(e2 == null ? void 0 : e2.id) || !(e2 == null ? void 0 : e2.collectionId) && !(e2 == null ? void 0 : e2.collectionName)) return "";
|
|
5615
|
+
const i2 = [];
|
|
5616
|
+
i2.push("api"), i2.push("files"), i2.push(encodeURIComponent(e2.collectionId || e2.collectionName)), i2.push(encodeURIComponent(e2.id)), i2.push(encodeURIComponent(t2));
|
|
5617
|
+
let n2 = this.client.buildURL(i2.join("/"));
|
|
5618
|
+
if (Object.keys(s2).length) {
|
|
5619
|
+
false === s2.download && delete s2.download;
|
|
5620
|
+
const e3 = new URLSearchParams(s2);
|
|
5621
|
+
n2 += (n2.includes("?") ? "&" : "?") + e3;
|
|
5622
|
+
}
|
|
5623
|
+
return n2;
|
|
5624
|
+
}
|
|
5625
|
+
async getToken(e2) {
|
|
5626
|
+
return e2 = Object.assign({ method: "POST" }, e2), this.client.send("/api/files/token", e2).then((e3) => (e3 == null ? void 0 : e3.token) || "");
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
class BackupService extends BaseService {
|
|
5630
|
+
async getFullList(e2) {
|
|
5631
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send("/api/backups", e2);
|
|
5632
|
+
}
|
|
5633
|
+
async create(e2, t2) {
|
|
5634
|
+
return t2 = Object.assign({ method: "POST", body: { name: e2 } }, t2), this.client.send("/api/backups", t2).then(() => true);
|
|
5635
|
+
}
|
|
5636
|
+
async upload(e2, t2) {
|
|
5637
|
+
return t2 = Object.assign({ method: "POST", body: e2 }, t2), this.client.send("/api/backups/upload", t2).then(() => true);
|
|
5638
|
+
}
|
|
5639
|
+
async delete(e2, t2) {
|
|
5640
|
+
return t2 = Object.assign({ method: "DELETE" }, t2), this.client.send(`/api/backups/${encodeURIComponent(e2)}`, t2).then(() => true);
|
|
5641
|
+
}
|
|
5642
|
+
async restore(e2, t2) {
|
|
5643
|
+
return t2 = Object.assign({ method: "POST" }, t2), this.client.send(`/api/backups/${encodeURIComponent(e2)}/restore`, t2).then(() => true);
|
|
5644
|
+
}
|
|
5645
|
+
getDownloadUrl(e2, t2) {
|
|
5646
|
+
return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"), this.getDownloadURL(e2, t2);
|
|
5647
|
+
}
|
|
5648
|
+
getDownloadURL(e2, t2) {
|
|
5649
|
+
return this.client.buildURL(`/api/backups/${encodeURIComponent(t2)}?token=${encodeURIComponent(e2)}`);
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
class CronService extends BaseService {
|
|
5653
|
+
async getFullList(e2) {
|
|
5654
|
+
return e2 = Object.assign({ method: "GET" }, e2), this.client.send("/api/crons", e2);
|
|
5655
|
+
}
|
|
5656
|
+
async run(e2, t2) {
|
|
5657
|
+
return t2 = Object.assign({ method: "POST" }, t2), this.client.send(`/api/crons/${encodeURIComponent(e2)}`, t2).then(() => true);
|
|
5658
|
+
}
|
|
5659
|
+
}
|
|
5660
|
+
function isFile(e2) {
|
|
5661
|
+
return "undefined" != typeof Blob && e2 instanceof Blob || "undefined" != typeof File && e2 instanceof File || null !== e2 && "object" == typeof e2 && e2.uri && ("undefined" != typeof navigator && "ReactNative" === navigator.product || "undefined" != typeof global && global.HermesInternal);
|
|
5662
|
+
}
|
|
5663
|
+
function isFormData(e2) {
|
|
5664
|
+
var _a2;
|
|
5665
|
+
return e2 && ("FormData" === ((_a2 = e2.constructor) == null ? void 0 : _a2.name) || "undefined" != typeof FormData && e2 instanceof FormData);
|
|
5666
|
+
}
|
|
5667
|
+
function hasFileField(e2) {
|
|
5668
|
+
for (const t2 in e2) {
|
|
5669
|
+
const s2 = Array.isArray(e2[t2]) ? e2[t2] : [e2[t2]];
|
|
5670
|
+
for (const e3 of s2) if (isFile(e3)) return true;
|
|
5671
|
+
}
|
|
5672
|
+
return false;
|
|
5673
|
+
}
|
|
5674
|
+
const r = /^[\-\.\d]+$/;
|
|
5675
|
+
function inferFormDataValue(e2) {
|
|
5676
|
+
if ("string" != typeof e2) return e2;
|
|
5677
|
+
if ("true" == e2) return true;
|
|
5678
|
+
if ("false" == e2) return false;
|
|
5679
|
+
if (("-" === e2[0] || e2[0] >= "0" && e2[0] <= "9") && r.test(e2)) {
|
|
5680
|
+
let t2 = +e2;
|
|
5681
|
+
if ("" + t2 === e2) return t2;
|
|
5682
|
+
}
|
|
5683
|
+
return e2;
|
|
5684
|
+
}
|
|
5685
|
+
class BatchService extends BaseService {
|
|
5686
|
+
constructor() {
|
|
5687
|
+
super(...arguments), this.requests = [], this.subs = {};
|
|
5688
|
+
}
|
|
5689
|
+
collection(e2) {
|
|
5690
|
+
return this.subs[e2] || (this.subs[e2] = new SubBatchService(this.requests, e2)), this.subs[e2];
|
|
5691
|
+
}
|
|
5692
|
+
async send(e2) {
|
|
5693
|
+
const t2 = new FormData(), s2 = [];
|
|
5694
|
+
for (let e3 = 0; e3 < this.requests.length; e3++) {
|
|
5695
|
+
const i2 = this.requests[e3];
|
|
5696
|
+
if (s2.push({ method: i2.method, url: i2.url, headers: i2.headers, body: i2.json }), i2.files) for (let s3 in i2.files) {
|
|
5697
|
+
const n2 = i2.files[s3] || [];
|
|
5698
|
+
for (let i3 of n2) t2.append("requests." + e3 + "." + s3, i3);
|
|
5699
|
+
}
|
|
5700
|
+
}
|
|
5701
|
+
return t2.append("@jsonPayload", JSON.stringify({ requests: s2 })), e2 = Object.assign({ method: "POST", body: t2 }, e2), this.client.send("/api/batch", e2);
|
|
5702
|
+
}
|
|
5703
|
+
}
|
|
5704
|
+
class SubBatchService {
|
|
5705
|
+
constructor(e2, t2) {
|
|
5706
|
+
this.requests = [], this.requests = e2, this.collectionIdOrName = t2;
|
|
5707
|
+
}
|
|
5708
|
+
upsert(e2, t2) {
|
|
5709
|
+
t2 = Object.assign({ body: e2 || {} }, t2);
|
|
5710
|
+
const s2 = { method: "PUT", url: "/api/collections/" + encodeURIComponent(this.collectionIdOrName) + "/records" };
|
|
5711
|
+
this.prepareRequest(s2, t2), this.requests.push(s2);
|
|
5712
|
+
}
|
|
5713
|
+
create(e2, t2) {
|
|
5714
|
+
t2 = Object.assign({ body: e2 || {} }, t2);
|
|
5715
|
+
const s2 = { method: "POST", url: "/api/collections/" + encodeURIComponent(this.collectionIdOrName) + "/records" };
|
|
5716
|
+
this.prepareRequest(s2, t2), this.requests.push(s2);
|
|
5717
|
+
}
|
|
5718
|
+
update(e2, t2, s2) {
|
|
5719
|
+
s2 = Object.assign({ body: t2 || {} }, s2);
|
|
5720
|
+
const i2 = { method: "PATCH", url: "/api/collections/" + encodeURIComponent(this.collectionIdOrName) + "/records/" + encodeURIComponent(e2) };
|
|
5721
|
+
this.prepareRequest(i2, s2), this.requests.push(i2);
|
|
5722
|
+
}
|
|
5723
|
+
delete(e2, t2) {
|
|
5724
|
+
t2 = Object.assign({}, t2);
|
|
5725
|
+
const s2 = { method: "DELETE", url: "/api/collections/" + encodeURIComponent(this.collectionIdOrName) + "/records/" + encodeURIComponent(e2) };
|
|
5726
|
+
this.prepareRequest(s2, t2), this.requests.push(s2);
|
|
5727
|
+
}
|
|
5728
|
+
prepareRequest(e2, t2) {
|
|
5729
|
+
if (normalizeUnknownQueryParams(t2), e2.headers = t2.headers, e2.json = {}, e2.files = {}, void 0 !== t2.query) {
|
|
5730
|
+
const s3 = serializeQueryParams(t2.query);
|
|
5731
|
+
s3 && (e2.url += (e2.url.includes("?") ? "&" : "?") + s3);
|
|
5732
|
+
}
|
|
5733
|
+
let s2 = t2.body;
|
|
5734
|
+
isFormData(s2) && (s2 = function convertFormDataToObject(e3) {
|
|
5735
|
+
let t3 = {};
|
|
5736
|
+
return e3.forEach((e4, s3) => {
|
|
5737
|
+
if ("@jsonPayload" === s3 && "string" == typeof e4) try {
|
|
5738
|
+
let s4 = JSON.parse(e4);
|
|
5739
|
+
Object.assign(t3, s4);
|
|
5740
|
+
} catch (e5) {
|
|
5741
|
+
console.warn("@jsonPayload error:", e5);
|
|
5742
|
+
}
|
|
5743
|
+
else void 0 !== t3[s3] ? (Array.isArray(t3[s3]) || (t3[s3] = [t3[s3]]), t3[s3].push(inferFormDataValue(e4))) : t3[s3] = inferFormDataValue(e4);
|
|
5744
|
+
}), t3;
|
|
5745
|
+
}(s2));
|
|
5746
|
+
for (const t3 in s2) {
|
|
5747
|
+
const i2 = s2[t3];
|
|
5748
|
+
if (isFile(i2)) e2.files[t3] = e2.files[t3] || [], e2.files[t3].push(i2);
|
|
5749
|
+
else if (Array.isArray(i2)) {
|
|
5750
|
+
const s3 = [], n2 = [];
|
|
5751
|
+
for (const e3 of i2) isFile(e3) ? s3.push(e3) : n2.push(e3);
|
|
5752
|
+
if (s3.length > 0 && s3.length == i2.length) {
|
|
5753
|
+
e2.files[t3] = e2.files[t3] || [];
|
|
5754
|
+
for (let i3 of s3) e2.files[t3].push(i3);
|
|
5755
|
+
} else if (e2.json[t3] = n2, s3.length > 0) {
|
|
5756
|
+
let i3 = t3;
|
|
5757
|
+
t3.startsWith("+") || t3.endsWith("+") || (i3 += "+"), e2.files[i3] = e2.files[i3] || [];
|
|
5758
|
+
for (let t4 of s3) e2.files[i3].push(t4);
|
|
5759
|
+
}
|
|
5760
|
+
} else e2.json[t3] = i2;
|
|
5761
|
+
}
|
|
5762
|
+
}
|
|
5763
|
+
}
|
|
5764
|
+
class Client {
|
|
5765
|
+
get baseUrl() {
|
|
5766
|
+
return this.baseURL;
|
|
5767
|
+
}
|
|
5768
|
+
set baseUrl(e2) {
|
|
5769
|
+
this.baseURL = e2;
|
|
5770
|
+
}
|
|
5771
|
+
constructor(e2 = "/", t2, s2 = "en-US") {
|
|
5772
|
+
this.cancelControllers = {}, this.recordServices = {}, this.enableAutoCancellation = true, this.baseURL = e2, this.lang = s2, t2 ? this.authStore = t2 : "undefined" != typeof window && window.Deno ? this.authStore = new BaseAuthStore() : this.authStore = new LocalAuthStore(), this.collections = new CollectionService(this), this.files = new FileService(this), this.logs = new LogService(this), this.settings = new SettingsService(this), this.realtime = new RealtimeService(this), this.health = new HealthService(this), this.backups = new BackupService(this), this.crons = new CronService(this);
|
|
5773
|
+
}
|
|
5774
|
+
get admins() {
|
|
5775
|
+
return this.collection("_superusers");
|
|
5776
|
+
}
|
|
5777
|
+
createBatch() {
|
|
5778
|
+
return new BatchService(this);
|
|
5779
|
+
}
|
|
5780
|
+
collection(e2) {
|
|
5781
|
+
return this.recordServices[e2] || (this.recordServices[e2] = new RecordService(this, e2)), this.recordServices[e2];
|
|
5782
|
+
}
|
|
5783
|
+
autoCancellation(e2) {
|
|
5784
|
+
return this.enableAutoCancellation = !!e2, this;
|
|
5785
|
+
}
|
|
5786
|
+
cancelRequest(e2) {
|
|
5787
|
+
return this.cancelControllers[e2] && (this.cancelControllers[e2].abort(), delete this.cancelControllers[e2]), this;
|
|
5788
|
+
}
|
|
5789
|
+
cancelAllRequests() {
|
|
5790
|
+
for (let e2 in this.cancelControllers) this.cancelControllers[e2].abort();
|
|
5791
|
+
return this.cancelControllers = {}, this;
|
|
5792
|
+
}
|
|
5793
|
+
filter(e2, t2) {
|
|
5794
|
+
if (!t2) return e2;
|
|
5795
|
+
for (let s2 in t2) {
|
|
5796
|
+
let i2 = t2[s2];
|
|
5797
|
+
switch (typeof i2) {
|
|
5798
|
+
case "boolean":
|
|
5799
|
+
case "number":
|
|
5800
|
+
i2 = "" + i2;
|
|
5801
|
+
break;
|
|
5802
|
+
case "string":
|
|
5803
|
+
i2 = "'" + i2.replace(/'/g, "\\'") + "'";
|
|
5804
|
+
break;
|
|
5805
|
+
default:
|
|
5806
|
+
i2 = null === i2 ? "null" : i2 instanceof Date ? "'" + i2.toISOString().replace("T", " ") + "'" : "'" + JSON.stringify(i2).replace(/'/g, "\\'") + "'";
|
|
5807
|
+
}
|
|
5808
|
+
e2 = e2.replaceAll("{:" + s2 + "}", i2);
|
|
5809
|
+
}
|
|
5810
|
+
return e2;
|
|
5811
|
+
}
|
|
5812
|
+
getFileUrl(e2, t2, s2 = {}) {
|
|
5813
|
+
return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"), this.files.getURL(e2, t2, s2);
|
|
5814
|
+
}
|
|
5815
|
+
buildUrl(e2) {
|
|
5816
|
+
return console.warn("Please replace pb.buildUrl() with pb.buildURL()"), this.buildURL(e2);
|
|
5817
|
+
}
|
|
5818
|
+
buildURL(e2) {
|
|
5819
|
+
var _a2;
|
|
5820
|
+
let t2 = this.baseURL;
|
|
5821
|
+
return "undefined" == typeof window || !window.location || t2.startsWith("https://") || t2.startsWith("http://") || (t2 = ((_a2 = window.location.origin) == null ? void 0 : _a2.endsWith("/")) ? window.location.origin.substring(0, window.location.origin.length - 1) : window.location.origin || "", this.baseURL.startsWith("/") || (t2 += window.location.pathname || "/", t2 += t2.endsWith("/") ? "" : "/"), t2 += this.baseURL), e2 && (t2 += t2.endsWith("/") ? "" : "/", t2 += e2.startsWith("/") ? e2.substring(1) : e2), t2;
|
|
5822
|
+
}
|
|
5823
|
+
async send(e2, t2) {
|
|
5824
|
+
t2 = this.initSendOptions(e2, t2);
|
|
5825
|
+
let s2 = this.buildURL(e2);
|
|
5826
|
+
if (this.beforeSend) {
|
|
5827
|
+
const e3 = Object.assign({}, await this.beforeSend(s2, t2));
|
|
5828
|
+
void 0 !== e3.url || void 0 !== e3.options ? (s2 = e3.url || s2, t2 = e3.options || t2) : Object.keys(e3).length && (t2 = e3, (console == null ? void 0 : console.warn) && console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."));
|
|
5829
|
+
}
|
|
5830
|
+
if (void 0 !== t2.query) {
|
|
5831
|
+
const e3 = serializeQueryParams(t2.query);
|
|
5832
|
+
e3 && (s2 += (s2.includes("?") ? "&" : "?") + e3), delete t2.query;
|
|
5833
|
+
}
|
|
5834
|
+
"application/json" == this.getHeader(t2.headers, "Content-Type") && t2.body && "string" != typeof t2.body && (t2.body = JSON.stringify(t2.body));
|
|
5835
|
+
return (t2.fetch || fetch)(s2, t2).then(async (e3) => {
|
|
5836
|
+
let s3 = {};
|
|
5837
|
+
try {
|
|
5838
|
+
s3 = await e3.json();
|
|
5839
|
+
} catch (e4) {
|
|
5840
|
+
}
|
|
5841
|
+
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400) throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
5842
|
+
return s3;
|
|
5843
|
+
}).catch((e3) => {
|
|
5844
|
+
throw new ClientResponseError(e3);
|
|
5845
|
+
});
|
|
5846
|
+
}
|
|
5847
|
+
initSendOptions(e2, t2) {
|
|
5848
|
+
if ((t2 = Object.assign({ method: "GET" }, t2)).body = function convertToFormDataIfNeeded(e3) {
|
|
5849
|
+
if ("undefined" == typeof FormData || void 0 === e3 || "object" != typeof e3 || null === e3 || isFormData(e3) || !hasFileField(e3)) return e3;
|
|
5850
|
+
const t3 = new FormData();
|
|
5851
|
+
for (const s2 in e3) {
|
|
5852
|
+
const i2 = e3[s2];
|
|
5853
|
+
if (void 0 !== i2) if ("object" != typeof i2 || hasFileField({ data: i2 })) {
|
|
5854
|
+
const e4 = Array.isArray(i2) ? i2 : [i2];
|
|
5855
|
+
for (let i3 of e4) t3.append(s2, i3);
|
|
5856
|
+
} else {
|
|
5857
|
+
let e4 = {};
|
|
5858
|
+
e4[s2] = i2, t3.append("@jsonPayload", JSON.stringify(e4));
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
return t3;
|
|
5862
|
+
}(t2.body), normalizeUnknownQueryParams(t2), t2.query = Object.assign({}, t2.params, t2.query), void 0 === t2.requestKey && (false === t2.$autoCancel || false === t2.query.$autoCancel ? t2.requestKey = null : (t2.$cancelKey || t2.query.$cancelKey) && (t2.requestKey = t2.$cancelKey || t2.query.$cancelKey)), delete t2.$autoCancel, delete t2.query.$autoCancel, delete t2.$cancelKey, delete t2.query.$cancelKey, null !== this.getHeader(t2.headers, "Content-Type") || isFormData(t2.body) || (t2.headers = Object.assign({}, t2.headers, { "Content-Type": "application/json" })), null === this.getHeader(t2.headers, "Accept-Language") && (t2.headers = Object.assign({}, t2.headers, { "Accept-Language": this.lang })), this.authStore.token && null === this.getHeader(t2.headers, "Authorization") && (t2.headers = Object.assign({}, t2.headers, { Authorization: this.authStore.token })), this.enableAutoCancellation && null !== t2.requestKey) {
|
|
5863
|
+
const s2 = t2.requestKey || (t2.method || "GET") + e2;
|
|
5864
|
+
delete t2.requestKey, this.cancelRequest(s2);
|
|
5865
|
+
const i2 = new AbortController();
|
|
5866
|
+
this.cancelControllers[s2] = i2, t2.signal = i2.signal;
|
|
5867
|
+
}
|
|
5868
|
+
return t2;
|
|
5869
|
+
}
|
|
5870
|
+
getHeader(e2, t2) {
|
|
5871
|
+
e2 = e2 || {}, t2 = t2.toLowerCase();
|
|
5872
|
+
for (let s2 in e2) if (s2.toLowerCase() == t2) return e2[s2];
|
|
5873
|
+
return null;
|
|
5874
|
+
}
|
|
5875
|
+
}
|
|
4876
5876
|
const history$1 = [];
|
|
4877
5877
|
const MAX_HISTORY = 1e3;
|
|
4878
5878
|
function addToHistory(module, level, params) {
|
|
@@ -4937,18 +5937,18 @@ const _SvelteMap = class _SvelteMap extends Map {
|
|
|
4937
5937
|
/** @param {K} key */
|
|
4938
5938
|
has(key2) {
|
|
4939
5939
|
var sources = __privateGet(this, _sources);
|
|
4940
|
-
var
|
|
4941
|
-
if (
|
|
5940
|
+
var s2 = sources.get(key2);
|
|
5941
|
+
if (s2 === void 0) {
|
|
4942
5942
|
var ret = super.get(key2);
|
|
4943
5943
|
if (ret !== void 0) {
|
|
4944
|
-
|
|
4945
|
-
sources.set(key2,
|
|
5944
|
+
s2 = __privateMethod(this, _SvelteMap_instances, source_fn).call(this, 0);
|
|
5945
|
+
sources.set(key2, s2);
|
|
4946
5946
|
} else {
|
|
4947
5947
|
get$2(__privateGet(this, _version));
|
|
4948
5948
|
return false;
|
|
4949
5949
|
}
|
|
4950
5950
|
}
|
|
4951
|
-
get$2(
|
|
5951
|
+
get$2(s2);
|
|
4952
5952
|
return true;
|
|
4953
5953
|
}
|
|
4954
5954
|
/**
|
|
@@ -4962,18 +5962,18 @@ const _SvelteMap = class _SvelteMap extends Map {
|
|
|
4962
5962
|
/** @param {K} key */
|
|
4963
5963
|
get(key2) {
|
|
4964
5964
|
var sources = __privateGet(this, _sources);
|
|
4965
|
-
var
|
|
4966
|
-
if (
|
|
5965
|
+
var s2 = sources.get(key2);
|
|
5966
|
+
if (s2 === void 0) {
|
|
4967
5967
|
var ret = super.get(key2);
|
|
4968
5968
|
if (ret !== void 0) {
|
|
4969
|
-
|
|
4970
|
-
sources.set(key2,
|
|
5969
|
+
s2 = __privateMethod(this, _SvelteMap_instances, source_fn).call(this, 0);
|
|
5970
|
+
sources.set(key2, s2);
|
|
4971
5971
|
} else {
|
|
4972
5972
|
get$2(__privateGet(this, _version));
|
|
4973
5973
|
return void 0;
|
|
4974
5974
|
}
|
|
4975
5975
|
}
|
|
4976
|
-
get$2(
|
|
5976
|
+
get$2(s2);
|
|
4977
5977
|
return super.get(key2);
|
|
4978
5978
|
}
|
|
4979
5979
|
/**
|
|
@@ -4983,19 +5983,19 @@ const _SvelteMap = class _SvelteMap extends Map {
|
|
|
4983
5983
|
set(key2, value) {
|
|
4984
5984
|
var _a2;
|
|
4985
5985
|
var sources = __privateGet(this, _sources);
|
|
4986
|
-
var
|
|
5986
|
+
var s2 = sources.get(key2);
|
|
4987
5987
|
var prev_res = super.get(key2);
|
|
4988
5988
|
var res = super.set(key2, value);
|
|
4989
5989
|
var version = __privateGet(this, _version);
|
|
4990
|
-
if (
|
|
4991
|
-
|
|
4992
|
-
sources.set(key2,
|
|
5990
|
+
if (s2 === void 0) {
|
|
5991
|
+
s2 = __privateMethod(this, _SvelteMap_instances, source_fn).call(this, 0);
|
|
5992
|
+
sources.set(key2, s2);
|
|
4993
5993
|
set(__privateGet(this, _size), super.size);
|
|
4994
5994
|
increment(version);
|
|
4995
5995
|
} else if (prev_res !== value) {
|
|
4996
|
-
increment(
|
|
5996
|
+
increment(s2);
|
|
4997
5997
|
var v_reactions = version.reactions === null ? null : new Set(version.reactions);
|
|
4998
|
-
var needs_version_increase = v_reactions === null || !((_a2 =
|
|
5998
|
+
var needs_version_increase = v_reactions === null || !((_a2 = s2.reactions) == null ? void 0 : _a2.every(
|
|
4999
5999
|
(r2) => (
|
|
5000
6000
|
/** @type {NonNullable<typeof v_reactions>} */
|
|
5001
6001
|
v_reactions.has(r2)
|
|
@@ -5010,12 +6010,12 @@ const _SvelteMap = class _SvelteMap extends Map {
|
|
|
5010
6010
|
/** @param {K} key */
|
|
5011
6011
|
delete(key2) {
|
|
5012
6012
|
var sources = __privateGet(this, _sources);
|
|
5013
|
-
var
|
|
6013
|
+
var s2 = sources.get(key2);
|
|
5014
6014
|
var res = super.delete(key2);
|
|
5015
|
-
if (
|
|
6015
|
+
if (s2 !== void 0) {
|
|
5016
6016
|
sources.delete(key2);
|
|
5017
6017
|
set(__privateGet(this, _size), super.size);
|
|
5018
|
-
set(
|
|
6018
|
+
set(s2, -1);
|
|
5019
6019
|
increment(__privateGet(this, _version));
|
|
5020
6020
|
}
|
|
5021
6021
|
return res;
|
|
@@ -5027,8 +6027,8 @@ const _SvelteMap = class _SvelteMap extends Map {
|
|
|
5027
6027
|
super.clear();
|
|
5028
6028
|
var sources = __privateGet(this, _sources);
|
|
5029
6029
|
set(__privateGet(this, _size), 0);
|
|
5030
|
-
for (var
|
|
5031
|
-
set(
|
|
6030
|
+
for (var s2 of sources.values()) {
|
|
6031
|
+
set(s2, -1);
|
|
5032
6032
|
}
|
|
5033
6033
|
increment(__privateGet(this, _version));
|
|
5034
6034
|
sources.clear();
|
|
@@ -5076,13 +6076,13 @@ read_all_fn = function() {
|
|
|
5076
6076
|
if (__privateGet(this, _size).v !== sources.size) {
|
|
5077
6077
|
for (var key2 of __superGet(_SvelteMap.prototype, this, "keys").call(this)) {
|
|
5078
6078
|
if (!sources.has(key2)) {
|
|
5079
|
-
var
|
|
5080
|
-
sources.set(key2,
|
|
6079
|
+
var s2 = __privateMethod(this, _SvelteMap_instances, source_fn).call(this, 0);
|
|
6080
|
+
sources.set(key2, s2);
|
|
5081
6081
|
}
|
|
5082
6082
|
}
|
|
5083
6083
|
}
|
|
5084
|
-
for ([,
|
|
5085
|
-
get$2(
|
|
6084
|
+
for ([, s2] of __privateGet(this, _sources)) {
|
|
6085
|
+
get$2(s2);
|
|
5086
6086
|
}
|
|
5087
6087
|
};
|
|
5088
6088
|
let SvelteMap = _SvelteMap;
|
|
@@ -5377,8 +6377,8 @@ class ScrollState {
|
|
|
5377
6377
|
__privateAdd(this, _onStop, /* @__PURE__ */ user_derived(() => __privateGet(this, _options2).onStop ?? noop$1));
|
|
5378
6378
|
__privateAdd(this, _eventListenerOptions, /* @__PURE__ */ user_derived(() => __privateGet(this, _options2).eventListenerOptions ?? { capture: false, passive: true }));
|
|
5379
6379
|
__privateAdd(this, _behavior, /* @__PURE__ */ user_derived(() => extract(__privateGet(this, _options2).behavior, "auto")));
|
|
5380
|
-
__privateAdd(this, _onError, /* @__PURE__ */ user_derived(() => __privateGet(this, _options2).onError ?? ((
|
|
5381
|
-
console.error(
|
|
6380
|
+
__privateAdd(this, _onError, /* @__PURE__ */ user_derived(() => __privateGet(this, _options2).onError ?? ((e2) => {
|
|
6381
|
+
console.error(e2);
|
|
5382
6382
|
})));
|
|
5383
6383
|
__privateAdd(this, _internalX, /* @__PURE__ */ state(0));
|
|
5384
6384
|
__privateAdd(this, _internalY, /* @__PURE__ */ state(0));
|
|
@@ -5434,26 +6434,26 @@ class ScrollState {
|
|
|
5434
6434
|
this.progress.x = Math.abs(scrollLeft / (width - el.clientWidth) * 100);
|
|
5435
6435
|
this.internalY = scrollTop;
|
|
5436
6436
|
});
|
|
5437
|
-
__privateAdd(this, _onScrollHandler, (
|
|
6437
|
+
__privateAdd(this, _onScrollHandler, (e2) => {
|
|
5438
6438
|
if (!window) return;
|
|
5439
6439
|
this.setArrivedState();
|
|
5440
6440
|
this.isScrolling = true;
|
|
5441
|
-
this.onScrollEndDebounced(
|
|
5442
|
-
this.onScroll(
|
|
6441
|
+
this.onScrollEndDebounced(e2);
|
|
6442
|
+
this.onScroll(e2);
|
|
5443
6443
|
});
|
|
5444
|
-
__publicField(this, "onScrollEnd", (
|
|
6444
|
+
__publicField(this, "onScrollEnd", (e2) => {
|
|
5445
6445
|
if (!this.isScrolling) return;
|
|
5446
6446
|
this.isScrolling = false;
|
|
5447
6447
|
this.directions.left = false;
|
|
5448
6448
|
this.directions.right = false;
|
|
5449
6449
|
this.directions.top = false;
|
|
5450
6450
|
this.directions.bottom = false;
|
|
5451
|
-
this.onStop(
|
|
6451
|
+
this.onStop(e2);
|
|
5452
6452
|
});
|
|
5453
6453
|
__publicField(this, "onScrollEndDebounced", useDebounce(this.onScrollEnd, () => this.idle));
|
|
5454
6454
|
__privateSet(this, _options2, options);
|
|
5455
6455
|
useEventListener(() => this.element, "scroll", __privateGet(this, _onScrollHandler), this.eventListenerOptions);
|
|
5456
|
-
useEventListener(() => this.element, "scrollend", (
|
|
6456
|
+
useEventListener(() => this.element, "scrollend", (e2) => this.onScrollEnd(e2), this.eventListenerOptions);
|
|
5457
6457
|
onMount(() => {
|
|
5458
6458
|
this.setArrivedState();
|
|
5459
6459
|
});
|
|
@@ -5627,7 +6627,7 @@ class Module {
|
|
|
5627
6627
|
data: data ? data : null
|
|
5628
6628
|
});
|
|
5629
6629
|
log$g[type](message, ...data ? [data] : []);
|
|
5630
|
-
} catch (
|
|
6630
|
+
} catch (e2) {
|
|
5631
6631
|
log$g[type](message, ...data ? [data] : []);
|
|
5632
6632
|
}
|
|
5633
6633
|
});
|
|
@@ -5691,7 +6691,7 @@ function catchError(promise) {
|
|
|
5691
6691
|
});
|
|
5692
6692
|
}
|
|
5693
6693
|
function stringToArray(str, separator = ",") {
|
|
5694
|
-
return str ? str.split(separator).map((
|
|
6694
|
+
return str ? str.split(separator).map((s2) => s2.trim()) : [];
|
|
5695
6695
|
}
|
|
5696
6696
|
function parseTimeDifference(timestamp) {
|
|
5697
6697
|
const diff = Date.now() - timestamp.getTime();
|
|
@@ -6034,13 +7034,13 @@ class Keys extends Module {
|
|
|
6034
7034
|
metaKey: false,
|
|
6035
7035
|
altKey: false
|
|
6036
7036
|
})));
|
|
6037
|
-
__publicField(this, "handleKeydown", (
|
|
6038
|
-
const { key: key2, code, ctrlKey, metaKey, altKey } =
|
|
7037
|
+
__publicField(this, "handleKeydown", (e2) => {
|
|
7038
|
+
const { key: key2, code, ctrlKey, metaKey, altKey } = e2;
|
|
6039
7039
|
this.active = { key: key2, code, ctrlKey, metaKey, altKey };
|
|
6040
7040
|
const keyHandlers = this.handlers.get(key2);
|
|
6041
|
-
if (keyHandlers) keyHandlers.forEach((handler) => handler(
|
|
7041
|
+
if (keyHandlers) keyHandlers.forEach((handler) => handler(e2));
|
|
6042
7042
|
});
|
|
6043
|
-
__publicField(this, "handleKeyup", (
|
|
7043
|
+
__publicField(this, "handleKeyup", (e2) => {
|
|
6044
7044
|
this.reset();
|
|
6045
7045
|
});
|
|
6046
7046
|
}
|
|
@@ -6051,8 +7051,8 @@ class Keys extends Module {
|
|
|
6051
7051
|
set(__privateGet(this, _active), value, true);
|
|
6052
7052
|
}
|
|
6053
7053
|
start() {
|
|
6054
|
-
this.modules.events.add("keydown", (
|
|
6055
|
-
this.modules.events.add("keyup", (
|
|
7054
|
+
this.modules.events.add("keydown", (e2) => this.handleKeydown(e2));
|
|
7055
|
+
this.modules.events.add("keyup", (e2) => this.handleKeyup(e2));
|
|
6056
7056
|
}
|
|
6057
7057
|
bind(key2, handler) {
|
|
6058
7058
|
if (!this.handlers.has(key2)) this.handlers.set(key2, /* @__PURE__ */ new Set());
|
|
@@ -6232,8 +7232,8 @@ class Team extends Module {
|
|
|
6232
7232
|
var _a2;
|
|
6233
7233
|
if (!((_a2 = this.current) == null ? void 0 : _a2.id)) return;
|
|
6234
7234
|
if (this.unsubscribe) this.unsubscribe();
|
|
6235
|
-
this.modules.pb.collection("teams").subscribe(this.current.id, async (
|
|
6236
|
-
log$b.info("Team updated via realtime:",
|
|
7235
|
+
this.modules.pb.collection("teams").subscribe(this.current.id, async (e2) => {
|
|
7236
|
+
log$b.info("Team updated via realtime:", e2.action);
|
|
6237
7237
|
await this.fetchTeam();
|
|
6238
7238
|
});
|
|
6239
7239
|
this.unsubscribe = () => {
|
|
@@ -6334,7 +7334,7 @@ class CollectionModule extends Module {
|
|
|
6334
7334
|
this.page = options.page || 1;
|
|
6335
7335
|
this.perPage = options.perPage || 50;
|
|
6336
7336
|
this.collection = this.modules.pb.collection(options.name);
|
|
6337
|
-
this.collection.subscribe("*", (
|
|
7337
|
+
this.collection.subscribe("*", (e2) => {
|
|
6338
7338
|
if (!this.fetchScheduled) {
|
|
6339
7339
|
this.fetchScheduled = true;
|
|
6340
7340
|
setTimeout(
|
|
@@ -6345,7 +7345,7 @@ class CollectionModule extends Module {
|
|
|
6345
7345
|
50
|
|
6346
7346
|
);
|
|
6347
7347
|
}
|
|
6348
|
-
if (options.onChange) options.onChange(
|
|
7348
|
+
if (options.onChange) options.onChange(e2);
|
|
6349
7349
|
});
|
|
6350
7350
|
}
|
|
6351
7351
|
async fetch() {
|
|
@@ -6729,9 +7729,9 @@ function tick_spring(ctx, last_value, current_value, target_value) {
|
|
|
6729
7729
|
}
|
|
6730
7730
|
} else if (Array.isArray(current_value)) {
|
|
6731
7731
|
return current_value.map(
|
|
6732
|
-
(_,
|
|
7732
|
+
(_, i2) => (
|
|
6733
7733
|
// @ts-ignore
|
|
6734
|
-
tick_spring(ctx, last_value[
|
|
7734
|
+
tick_spring(ctx, last_value[i2], current_value[i2], target_value[i2])
|
|
6735
7735
|
)
|
|
6736
7736
|
);
|
|
6737
7737
|
} else if (typeof current_value === "object") {
|
|
@@ -6902,18 +7902,18 @@ update_fn = function(value) {
|
|
|
6902
7902
|
return __privateGet(this, _task).promise;
|
|
6903
7903
|
};
|
|
6904
7904
|
let Spring = _Spring;
|
|
6905
|
-
function clamp$1(
|
|
6906
|
-
return Math.max(min2, Math.min(max2,
|
|
7905
|
+
function clamp$1(n2, min2, max2) {
|
|
7906
|
+
return Math.max(min2, Math.min(max2, n2));
|
|
6907
7907
|
}
|
|
6908
|
-
function cubicIn(
|
|
6909
|
-
return
|
|
7908
|
+
function cubicIn(t2) {
|
|
7909
|
+
return t2 * t2 * t2;
|
|
6910
7910
|
}
|
|
6911
|
-
function cubicOut(
|
|
6912
|
-
const f =
|
|
7911
|
+
function cubicOut(t2) {
|
|
7912
|
+
const f = t2 - 1;
|
|
6913
7913
|
return f * f * f + 1;
|
|
6914
7914
|
}
|
|
6915
|
-
function expoOut(
|
|
6916
|
-
return
|
|
7915
|
+
function expoOut(t2) {
|
|
7916
|
+
return t2 === 1 ? t2 : 1 - Math.pow(2, -10 * t2);
|
|
6917
7917
|
}
|
|
6918
7918
|
const MIDDLE_TO_TOP_TRESHOLD = 50;
|
|
6919
7919
|
const BREAKPOINT_TRESHOLD = 30;
|
|
@@ -6942,22 +7942,22 @@ class Win extends Module {
|
|
|
6942
7942
|
hasMoved: false
|
|
6943
7943
|
})));
|
|
6944
7944
|
__publicField(this, "drag", {
|
|
6945
|
-
start: (
|
|
7945
|
+
start: (e2) => {
|
|
6946
7946
|
if (!this.modules.environment.touch) return;
|
|
6947
|
-
const target =
|
|
7947
|
+
const target = e2.target;
|
|
6948
7948
|
if (target.closest("button, a, input, label, textarea, select")) {
|
|
6949
7949
|
return;
|
|
6950
7950
|
}
|
|
6951
7951
|
this.dragging.hasMoved = false;
|
|
6952
7952
|
this.dragging.active = true;
|
|
6953
|
-
this.dragging.start =
|
|
7953
|
+
this.dragging.start = e2.y;
|
|
6954
7954
|
this.dragging.startHeight = this.getCurrentHeight();
|
|
6955
7955
|
this.dragging.height = this.dragging.startHeight;
|
|
6956
7956
|
},
|
|
6957
|
-
move: (
|
|
7957
|
+
move: (e2) => {
|
|
6958
7958
|
var _a2;
|
|
6959
7959
|
if (!this.dragging.active || !this.modules.environment.touch) return;
|
|
6960
|
-
this.dragging.current =
|
|
7960
|
+
this.dragging.current = e2.y;
|
|
6961
7961
|
this.dragging.difference = this.dragging.current - this.dragging.start;
|
|
6962
7962
|
if (Math.abs(this.dragging.difference) > 2) {
|
|
6963
7963
|
this.dragging.hasMoved = true;
|
|
@@ -6992,11 +7992,11 @@ class Win extends Module {
|
|
|
6992
7992
|
this.dragging.height = this.dragging.startHeight - this.dragging.difference;
|
|
6993
7993
|
this.dragging.direction = this.dragging.difference < 0 ? "up" : "down";
|
|
6994
7994
|
},
|
|
6995
|
-
end: (
|
|
7995
|
+
end: (e2) => {
|
|
6996
7996
|
if (this.dragging.active || this.dragging.hasMoved) {
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7997
|
+
e2.preventDefault();
|
|
7998
|
+
e2.stopPropagation();
|
|
7999
|
+
e2.stopImmediatePropagation();
|
|
7000
8000
|
}
|
|
7001
8001
|
if (!this.dragging.active) return;
|
|
7002
8002
|
if (this.dragging.hasMoved) {
|
|
@@ -7074,19 +8074,19 @@ class Win extends Module {
|
|
|
7074
8074
|
let deciding = true;
|
|
7075
8075
|
this.el.addEventListener(
|
|
7076
8076
|
"touchstart",
|
|
7077
|
-
(
|
|
8077
|
+
(e2) => {
|
|
7078
8078
|
if (!this.opened) return;
|
|
7079
|
-
touchStartY =
|
|
8079
|
+
touchStartY = e2.touches[0].clientY;
|
|
7080
8080
|
deciding = true;
|
|
7081
8081
|
},
|
|
7082
8082
|
{ passive: true }
|
|
7083
8083
|
);
|
|
7084
8084
|
this.el.addEventListener(
|
|
7085
8085
|
"touchmove",
|
|
7086
|
-
(
|
|
8086
|
+
(e2) => {
|
|
7087
8087
|
var _a2;
|
|
7088
8088
|
if (!this.opened || !deciding) return;
|
|
7089
|
-
const touchY =
|
|
8089
|
+
const touchY = e2.touches[0].clientY;
|
|
7090
8090
|
const diff = touchY - touchStartY;
|
|
7091
8091
|
if (Math.abs(diff) > 5) {
|
|
7092
8092
|
const scrollable = (_a2 = this.el) == null ? void 0 : _a2.querySelector(".page-content, .content, [data-scrollable]");
|
|
@@ -7094,7 +8094,7 @@ class Win extends Module {
|
|
|
7094
8094
|
const shouldPreventScroll = this.contentScrollState.y <= 0 && diff > 0 || // At top, dragging down
|
|
7095
8095
|
isAtBottom && diff < 0 && this.currentBreakpoint !== this.breakpoints.top;
|
|
7096
8096
|
if (shouldPreventScroll) {
|
|
7097
|
-
|
|
8097
|
+
e2.preventDefault();
|
|
7098
8098
|
deciding = false;
|
|
7099
8099
|
} else {
|
|
7100
8100
|
deciding = false;
|
|
@@ -7391,8 +8391,8 @@ function HugeiconsIcon($$anchor, $$props) {
|
|
|
7391
8391
|
pop();
|
|
7392
8392
|
}
|
|
7393
8393
|
const linear = (x) => x;
|
|
7394
|
-
function cubic_out(
|
|
7395
|
-
const f =
|
|
8394
|
+
function cubic_out(t2) {
|
|
8395
|
+
const f = t2 - 1;
|
|
7396
8396
|
return f * f * f + 1;
|
|
7397
8397
|
}
|
|
7398
8398
|
function split_css_unit(value) {
|
|
@@ -7409,7 +8409,7 @@ function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {
|
|
|
7409
8409
|
delay,
|
|
7410
8410
|
duration,
|
|
7411
8411
|
easing,
|
|
7412
|
-
css: (
|
|
8412
|
+
css: (t2) => `opacity: ${t2 * o}`
|
|
7413
8413
|
};
|
|
7414
8414
|
}
|
|
7415
8415
|
function fly(node, { delay = 0, duration = 400, easing = cubic_out, x = 0, y = 0, opacity = 0 } = {}) {
|
|
@@ -7423,8 +8423,8 @@ function fly(node, { delay = 0, duration = 400, easing = cubic_out, x = 0, y = 0
|
|
|
7423
8423
|
delay,
|
|
7424
8424
|
duration,
|
|
7425
8425
|
easing,
|
|
7426
|
-
css: (
|
|
7427
|
-
transform: ${transform} translate(${(1 -
|
|
8426
|
+
css: (t2, u) => `
|
|
8427
|
+
transform: ${transform} translate(${(1 - t2) * x_value}${x_unit}, ${(1 - t2) * y_value}${y_unit});
|
|
7428
8428
|
opacity: ${target_opacity - od * u}`
|
|
7429
8429
|
};
|
|
7430
8430
|
}
|
|
@@ -7435,9 +8435,9 @@ function slide(node, { delay = 0, duration = 400, easing = cubic_out, axis = "y"
|
|
|
7435
8435
|
const primary_property_value = parseFloat(style[primary_property]);
|
|
7436
8436
|
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
|
7437
8437
|
const capitalized_secondary_properties = secondary_properties.map(
|
|
7438
|
-
(
|
|
8438
|
+
(e2) => (
|
|
7439
8439
|
/** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */
|
|
7440
|
-
`${
|
|
8440
|
+
`${e2[0].toUpperCase()}${e2.slice(1)}`
|
|
7441
8441
|
)
|
|
7442
8442
|
);
|
|
7443
8443
|
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
|
@@ -7454,7 +8454,7 @@ function slide(node, { delay = 0, duration = 400, easing = cubic_out, axis = "y"
|
|
|
7454
8454
|
delay,
|
|
7455
8455
|
duration,
|
|
7456
8456
|
easing,
|
|
7457
|
-
css: (
|
|
8457
|
+
css: (t2) => `overflow: hidden;opacity: ${Math.min(t2 * 20, 1) * opacity};${primary_property}: ${t2 * primary_property_value}px;padding-${secondary_properties[0]}: ${t2 * padding_start_value}px;padding-${secondary_properties[1]}: ${t2 * padding_end_value}px;margin-${secondary_properties[0]}: ${t2 * margin_start_value}px;margin-${secondary_properties[1]}: ${t2 * margin_end_value}px;border-${secondary_properties[0]}-width: ${t2 * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t2 * border_width_end_value}px;min-${primary_property}: 0`
|
|
7458
8458
|
};
|
|
7459
8459
|
}
|
|
7460
8460
|
function scale(node, { delay = 0, duration = 400, easing = cubic_out, start = 0, opacity = 0 } = {}) {
|
|
@@ -7506,10 +8506,10 @@ function crossfade({ fallback, ...defaults }) {
|
|
|
7506
8506
|
delay,
|
|
7507
8507
|
duration: typeof duration === "function" ? duration(d) : duration,
|
|
7508
8508
|
easing,
|
|
7509
|
-
css: (
|
|
7510
|
-
opacity: ${
|
|
8509
|
+
css: (t2, u) => `
|
|
8510
|
+
opacity: ${t2 * opacity};
|
|
7511
8511
|
transform-origin: top left;
|
|
7512
|
-
transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${
|
|
8512
|
+
transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t2 + (1 - t2) * dw}, ${t2 + (1 - t2) * dh});
|
|
7513
8513
|
`
|
|
7514
8514
|
};
|
|
7515
8515
|
}
|
|
@@ -7765,8 +8765,8 @@ function Login($$anchor, $$props) {
|
|
|
7765
8765
|
const { auth, router } = getModules();
|
|
7766
8766
|
let email = /* @__PURE__ */ state("");
|
|
7767
8767
|
let password = /* @__PURE__ */ state("");
|
|
7768
|
-
const handleLogin = (
|
|
7769
|
-
|
|
8768
|
+
const handleLogin = (e2) => {
|
|
8769
|
+
e2.preventDefault();
|
|
7770
8770
|
auth.login(get$2(email), get$2(password));
|
|
7771
8771
|
};
|
|
7772
8772
|
Page($$anchor, {
|
|
@@ -7842,7 +8842,7 @@ function Login($$anchor, $$props) {
|
|
|
7842
8842
|
$$slots: { default: true }
|
|
7843
8843
|
});
|
|
7844
8844
|
}
|
|
7845
|
-
event("submit", form, (
|
|
8845
|
+
event("submit", form, (e2) => handleLogin(e2));
|
|
7846
8846
|
append($$anchor3, form);
|
|
7847
8847
|
},
|
|
7848
8848
|
$$slots: { default: true }
|
|
@@ -8674,11 +9674,11 @@ function flip$2(node, { from, to }, params = {}) {
|
|
|
8674
9674
|
delay,
|
|
8675
9675
|
duration: typeof duration === "function" ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,
|
|
8676
9676
|
easing,
|
|
8677
|
-
css: (
|
|
9677
|
+
css: (t2, u) => {
|
|
8678
9678
|
var x = u * dx;
|
|
8679
9679
|
var y = u * dy;
|
|
8680
|
-
var sx3 =
|
|
8681
|
-
var sy2 =
|
|
9680
|
+
var sx3 = t2 + u * dsx;
|
|
9681
|
+
var sy2 = t2 + u * dsy;
|
|
8682
9682
|
return `transform: ${transform} translate(${x}px, ${y}px) scale(${sx3}, ${sy2});`;
|
|
8683
9683
|
}
|
|
8684
9684
|
};
|
|
@@ -8877,17 +9877,17 @@ box.readonly = toReadonlyBox;
|
|
|
8877
9877
|
box.isBox = isBox;
|
|
8878
9878
|
box.isWritableBox = isWritableBox;
|
|
8879
9879
|
function composeHandlers(...handlers) {
|
|
8880
|
-
return function(
|
|
9880
|
+
return function(e2) {
|
|
8881
9881
|
var _a2;
|
|
8882
9882
|
for (const handler of handlers) {
|
|
8883
9883
|
if (!handler)
|
|
8884
9884
|
continue;
|
|
8885
|
-
if (
|
|
9885
|
+
if (e2.defaultPrevented)
|
|
8886
9886
|
return;
|
|
8887
9887
|
if (typeof handler === "function") {
|
|
8888
|
-
handler.call(this,
|
|
9888
|
+
handler.call(this, e2);
|
|
8889
9889
|
} else {
|
|
8890
|
-
(_a2 = handler.current) == null ? void 0 : _a2.call(this,
|
|
9890
|
+
(_a2 = handler.current) == null ? void 0 : _a2.call(this, e2);
|
|
8891
9891
|
}
|
|
8892
9892
|
}
|
|
8893
9893
|
};
|
|
@@ -8920,8 +9920,8 @@ var inlineStyleParser = function(style, options) {
|
|
|
8920
9920
|
function updatePosition(str) {
|
|
8921
9921
|
var lines = str.match(NEWLINE_REGEX);
|
|
8922
9922
|
if (lines) lineno += lines.length;
|
|
8923
|
-
var
|
|
8924
|
-
column = ~
|
|
9923
|
+
var i2 = str.lastIndexOf(NEWLINE);
|
|
9924
|
+
column = ~i2 ? str.length - i2 : column + str.length;
|
|
8925
9925
|
}
|
|
8926
9926
|
function position() {
|
|
8927
9927
|
var start = { line: lineno, column };
|
|
@@ -8975,18 +9975,18 @@ var inlineStyleParser = function(style, options) {
|
|
|
8975
9975
|
function comment2() {
|
|
8976
9976
|
var pos = position();
|
|
8977
9977
|
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
|
8978
|
-
var
|
|
8979
|
-
while (EMPTY_STRING != style.charAt(
|
|
8980
|
-
++
|
|
9978
|
+
var i2 = 2;
|
|
9979
|
+
while (EMPTY_STRING != style.charAt(i2) && (ASTERISK != style.charAt(i2) || FORWARD_SLASH != style.charAt(i2 + 1))) {
|
|
9980
|
+
++i2;
|
|
8981
9981
|
}
|
|
8982
|
-
|
|
8983
|
-
if (EMPTY_STRING === style.charAt(
|
|
9982
|
+
i2 += 2;
|
|
9983
|
+
if (EMPTY_STRING === style.charAt(i2 - 1)) {
|
|
8984
9984
|
return error("End of comment missing");
|
|
8985
9985
|
}
|
|
8986
|
-
var str = style.slice(2,
|
|
9986
|
+
var str = style.slice(2, i2 - 2);
|
|
8987
9987
|
column += 2;
|
|
8988
9988
|
updatePosition(str);
|
|
8989
|
-
style = style.slice(
|
|
9989
|
+
style = style.slice(i2);
|
|
8990
9990
|
column += 2;
|
|
8991
9991
|
return pos({
|
|
8992
9992
|
type: TYPE_COMMENT,
|
|
@@ -9264,8 +10264,8 @@ function isEventHandler(key2) {
|
|
|
9264
10264
|
}
|
|
9265
10265
|
function mergeProps(...args) {
|
|
9266
10266
|
const result = { ...args[0] };
|
|
9267
|
-
for (let
|
|
9268
|
-
const props = args[
|
|
10267
|
+
for (let i2 = 1; i2 < args.length; i2++) {
|
|
10268
|
+
const props = args[i2];
|
|
9269
10269
|
if (!props)
|
|
9270
10270
|
continue;
|
|
9271
10271
|
for (const key2 of Object.keys(props)) {
|
|
@@ -9829,7 +10829,7 @@ class RovingFocusGroup {
|
|
|
9829
10829
|
return;
|
|
9830
10830
|
(_a2 = items[0]) == null ? void 0 : _a2.focus();
|
|
9831
10831
|
}
|
|
9832
|
-
handleKeydown(node,
|
|
10832
|
+
handleKeydown(node, e2, both = false) {
|
|
9833
10833
|
var _a2, _b2;
|
|
9834
10834
|
const rootNode = __privateGet(this, _opts).rootNode.current;
|
|
9835
10835
|
if (!rootNode || !node)
|
|
@@ -9853,10 +10853,10 @@ class RovingFocusGroup {
|
|
|
9853
10853
|
keyToIndex[altNextKey] = currentIndex + 1;
|
|
9854
10854
|
keyToIndex[altPrevKey] = currentIndex - 1;
|
|
9855
10855
|
}
|
|
9856
|
-
let itemIndex = keyToIndex[
|
|
10856
|
+
let itemIndex = keyToIndex[e2.key];
|
|
9857
10857
|
if (itemIndex === void 0)
|
|
9858
10858
|
return;
|
|
9859
|
-
|
|
10859
|
+
e2.preventDefault();
|
|
9860
10860
|
if (itemIndex < 0 && loop2) {
|
|
9861
10861
|
itemIndex = items.length - 1;
|
|
9862
10862
|
} else if (itemIndex === items.length && loop2) {
|
|
@@ -10185,15 +11185,15 @@ const _DialogTriggerState = class _DialogTriggerState {
|
|
|
10185
11185
|
static create(opts) {
|
|
10186
11186
|
return new _DialogTriggerState(opts, DialogRootContext.get());
|
|
10187
11187
|
}
|
|
10188
|
-
onclick(
|
|
11188
|
+
onclick(e2) {
|
|
10189
11189
|
if (this.opts.disabled.current) return;
|
|
10190
|
-
if (
|
|
11190
|
+
if (e2.button > 0) return;
|
|
10191
11191
|
this.root.handleOpen();
|
|
10192
11192
|
}
|
|
10193
|
-
onkeydown(
|
|
11193
|
+
onkeydown(e2) {
|
|
10194
11194
|
if (this.opts.disabled.current) return;
|
|
10195
|
-
if (
|
|
10196
|
-
|
|
11195
|
+
if (e2.key === SPACE || e2.key === ENTER) {
|
|
11196
|
+
e2.preventDefault();
|
|
10197
11197
|
this.root.handleOpen();
|
|
10198
11198
|
}
|
|
10199
11199
|
}
|
|
@@ -10723,9 +11723,9 @@ var isDetailsWithSummary = function isDetailsWithSummary2(node) {
|
|
|
10723
11723
|
return r2;
|
|
10724
11724
|
};
|
|
10725
11725
|
var getCheckedRadio = function getCheckedRadio2(nodes, form) {
|
|
10726
|
-
for (var
|
|
10727
|
-
if (nodes[
|
|
10728
|
-
return nodes[
|
|
11726
|
+
for (var i2 = 0; i2 < nodes.length; i2++) {
|
|
11727
|
+
if (nodes[i2].checked && nodes[i2].form === form) {
|
|
11728
|
+
return nodes[i2];
|
|
10729
11729
|
}
|
|
10730
11730
|
}
|
|
10731
11731
|
};
|
|
@@ -10822,8 +11822,8 @@ var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
|
|
|
10822
11822
|
var parentNode = node.parentElement;
|
|
10823
11823
|
while (parentNode) {
|
|
10824
11824
|
if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
|
|
10825
|
-
for (var
|
|
10826
|
-
var child2 = parentNode.children.item(
|
|
11825
|
+
for (var i2 = 0; i2 < parentNode.children.length; i2++) {
|
|
11826
|
+
var child2 = parentNode.children.item(i2);
|
|
10827
11827
|
if (child2.tagName === "LEGEND") {
|
|
10828
11828
|
return matches.call(parentNode, "fieldset[disabled] *") ? true : !child2.contains(node);
|
|
10829
11829
|
}
|
|
@@ -10861,7 +11861,7 @@ var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNo
|
|
|
10861
11861
|
var sortByOrder = function sortByOrder2(candidates) {
|
|
10862
11862
|
var regularTabbables = [];
|
|
10863
11863
|
var orderedTabbables = [];
|
|
10864
|
-
candidates.forEach(function(item,
|
|
11864
|
+
candidates.forEach(function(item, i2) {
|
|
10865
11865
|
var isScope = !!item.scopeParent;
|
|
10866
11866
|
var element = isScope ? item.scopeParent : item;
|
|
10867
11867
|
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
@@ -10870,7 +11870,7 @@ var sortByOrder = function sortByOrder2(candidates) {
|
|
|
10870
11870
|
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
10871
11871
|
} else {
|
|
10872
11872
|
orderedTabbables.push({
|
|
10873
|
-
documentOrder:
|
|
11873
|
+
documentOrder: i2,
|
|
10874
11874
|
tabIndex: candidateTabindex,
|
|
10875
11875
|
item,
|
|
10876
11876
|
isScope,
|
|
@@ -11097,21 +12097,21 @@ class GraceArea {
|
|
|
11097
12097
|
}));
|
|
11098
12098
|
watch([opts.triggerNode, opts.contentNode, opts.enabled], ([triggerNode, contentNode, enabled]) => {
|
|
11099
12099
|
if (!triggerNode || !contentNode || !enabled) return;
|
|
11100
|
-
const handleTriggerLeave = (
|
|
11101
|
-
__privateMethod(this, _GraceArea_instances, createGraceArea_fn).call(this,
|
|
12100
|
+
const handleTriggerLeave = (e2) => {
|
|
12101
|
+
__privateMethod(this, _GraceArea_instances, createGraceArea_fn).call(this, e2, contentNode);
|
|
11102
12102
|
};
|
|
11103
|
-
const handleContentLeave = (
|
|
11104
|
-
__privateMethod(this, _GraceArea_instances, createGraceArea_fn).call(this,
|
|
12103
|
+
const handleContentLeave = (e2) => {
|
|
12104
|
+
__privateMethod(this, _GraceArea_instances, createGraceArea_fn).call(this, e2, triggerNode);
|
|
11105
12105
|
};
|
|
11106
12106
|
return executeCallbacks(on(triggerNode, "pointerleave", handleTriggerLeave), on(contentNode, "pointerleave", handleContentLeave));
|
|
11107
12107
|
});
|
|
11108
12108
|
watch(() => get$2(__privateGet(this, _pointerGraceArea)), () => {
|
|
11109
|
-
const handleTrackPointerGrace = (
|
|
12109
|
+
const handleTrackPointerGrace = (e2) => {
|
|
11110
12110
|
var _a2, _b2;
|
|
11111
12111
|
if (!get$2(__privateGet(this, _pointerGraceArea))) return;
|
|
11112
|
-
const target =
|
|
12112
|
+
const target = e2.target;
|
|
11113
12113
|
if (!isElement$1(target)) return;
|
|
11114
|
-
const pointerPosition = { x:
|
|
12114
|
+
const pointerPosition = { x: e2.clientX, y: e2.clientY };
|
|
11115
12115
|
const hasEnteredTarget = ((_a2 = opts.triggerNode()) == null ? void 0 : _a2.contains(target)) || ((_b2 = opts.contentNode()) == null ? void 0 : _b2.contains(target));
|
|
11116
12116
|
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, get$2(__privateGet(this, _pointerGraceArea)));
|
|
11117
12117
|
if (hasEnteredTarget) {
|
|
@@ -11136,10 +12136,10 @@ removeGraceArea_fn = function() {
|
|
|
11136
12136
|
set(__privateGet(this, _pointerGraceArea), null);
|
|
11137
12137
|
__privateGet(this, _isPointerInTransit).current = false;
|
|
11138
12138
|
};
|
|
11139
|
-
createGraceArea_fn = function(
|
|
11140
|
-
const currentTarget =
|
|
12139
|
+
createGraceArea_fn = function(e2, hoverTarget) {
|
|
12140
|
+
const currentTarget = e2.currentTarget;
|
|
11141
12141
|
if (!isHTMLElement$1(currentTarget)) return;
|
|
11142
|
-
const exitPoint = { x:
|
|
12142
|
+
const exitPoint = { x: e2.clientX, y: e2.clientY };
|
|
11143
12143
|
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
11144
12144
|
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
11145
12145
|
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
@@ -11206,9 +12206,9 @@ function getPointsFromRect(rect) {
|
|
|
11206
12206
|
function isPointInPolygon(point, polygon) {
|
|
11207
12207
|
const { x, y } = point;
|
|
11208
12208
|
let inside = false;
|
|
11209
|
-
for (let
|
|
11210
|
-
const xi = polygon[
|
|
11211
|
-
const yi = polygon[
|
|
12209
|
+
for (let i2 = 0, j = polygon.length - 1; i2 < polygon.length; j = i2++) {
|
|
12210
|
+
const xi = polygon[i2].x;
|
|
12211
|
+
const yi = polygon[i2].y;
|
|
11212
12212
|
const xj = polygon[j].x;
|
|
11213
12213
|
const yj = polygon[j].y;
|
|
11214
12214
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
@@ -11230,8 +12230,8 @@ function getHull(points) {
|
|
|
11230
12230
|
function getHullPresorted(points) {
|
|
11231
12231
|
if (points.length <= 1) return points.slice();
|
|
11232
12232
|
const upperHull = [];
|
|
11233
|
-
for (let
|
|
11234
|
-
const p = points[
|
|
12233
|
+
for (let i2 = 0; i2 < points.length; i2++) {
|
|
12234
|
+
const p = points[i2];
|
|
11235
12235
|
while (upperHull.length >= 2) {
|
|
11236
12236
|
const q = upperHull[upperHull.length - 1];
|
|
11237
12237
|
const r2 = upperHull[upperHull.length - 2];
|
|
@@ -11242,8 +12242,8 @@ function getHullPresorted(points) {
|
|
|
11242
12242
|
}
|
|
11243
12243
|
upperHull.pop();
|
|
11244
12244
|
const lowerHull = [];
|
|
11245
|
-
for (let
|
|
11246
|
-
const p = points[
|
|
12245
|
+
for (let i2 = points.length - 1; i2 >= 0; i2--) {
|
|
12246
|
+
const p = points[i2];
|
|
11247
12247
|
while (lowerHull.length >= 2) {
|
|
11248
12248
|
const q = lowerHull[lowerHull.length - 1];
|
|
11249
12249
|
const r2 = lowerHull[lowerHull.length - 2];
|
|
@@ -11378,12 +12378,12 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11378
12378
|
__privateAdd(this, _handleTypeaheadSearch);
|
|
11379
12379
|
__privateAdd(this, _mounted, /* @__PURE__ */ state(false));
|
|
11380
12380
|
__privateAdd(this, _isSub);
|
|
11381
|
-
__publicField(this, "onCloseAutoFocus", (
|
|
12381
|
+
__publicField(this, "onCloseAutoFocus", (e2) => {
|
|
11382
12382
|
var _a2, _b2;
|
|
11383
|
-
(_b2 = (_a2 = this.opts.onCloseAutoFocus).current) == null ? void 0 : _b2.call(_a2,
|
|
11384
|
-
if (
|
|
12383
|
+
(_b2 = (_a2 = this.opts.onCloseAutoFocus).current) == null ? void 0 : _b2.call(_a2, e2);
|
|
12384
|
+
if (e2.defaultPrevented || __privateGet(this, _isSub)) return;
|
|
11385
12385
|
if (this.parentMenu.triggerNode && isTabbable(this.parentMenu.triggerNode)) {
|
|
11386
|
-
|
|
12386
|
+
e2.preventDefault();
|
|
11387
12387
|
this.parentMenu.triggerNode.focus();
|
|
11388
12388
|
}
|
|
11389
12389
|
});
|
|
@@ -11401,7 +12401,7 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11401
12401
|
style: { pointerEvents: "auto" },
|
|
11402
12402
|
...this.attachment
|
|
11403
12403
|
})));
|
|
11404
|
-
__publicField(this, "popperProps", { onCloseAutoFocus: (
|
|
12404
|
+
__publicField(this, "popperProps", { onCloseAutoFocus: (e2) => this.onCloseAutoFocus(e2) });
|
|
11405
12405
|
this.opts = opts;
|
|
11406
12406
|
this.parentMenu = parentMenu;
|
|
11407
12407
|
this.domContext = new DOMContext(opts.ref);
|
|
@@ -11471,14 +12471,14 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11471
12471
|
set mounted(value) {
|
|
11472
12472
|
set(__privateGet(this, _mounted), value, true);
|
|
11473
12473
|
}
|
|
11474
|
-
handleTabKeyDown(
|
|
12474
|
+
handleTabKeyDown(e2) {
|
|
11475
12475
|
let rootMenu = this.parentMenu;
|
|
11476
12476
|
while (rootMenu.parentMenu !== null) {
|
|
11477
12477
|
rootMenu = rootMenu.parentMenu;
|
|
11478
12478
|
}
|
|
11479
12479
|
if (!rootMenu.triggerNode) return;
|
|
11480
|
-
|
|
11481
|
-
const nodeToFocus = getTabbableFrom(rootMenu.triggerNode,
|
|
12480
|
+
e2.preventDefault();
|
|
12481
|
+
const nodeToFocus = getTabbableFrom(rootMenu.triggerNode, e2.shiftKey ? "prev" : "next");
|
|
11482
12482
|
if (nodeToFocus) {
|
|
11483
12483
|
this.parentMenu.root.ignoreCloseAutoFocus = true;
|
|
11484
12484
|
rootMenu.onClose();
|
|
@@ -11492,41 +12492,41 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11492
12492
|
this.domContext.getDocument().body.focus();
|
|
11493
12493
|
}
|
|
11494
12494
|
}
|
|
11495
|
-
onkeydown(
|
|
12495
|
+
onkeydown(e2) {
|
|
11496
12496
|
var _a2, _b2;
|
|
11497
|
-
if (
|
|
11498
|
-
if (
|
|
11499
|
-
this.handleTabKeyDown(
|
|
12497
|
+
if (e2.defaultPrevented) return;
|
|
12498
|
+
if (e2.key === TAB) {
|
|
12499
|
+
this.handleTabKeyDown(e2);
|
|
11500
12500
|
return;
|
|
11501
12501
|
}
|
|
11502
|
-
const target =
|
|
11503
|
-
const currentTarget =
|
|
12502
|
+
const target = e2.target;
|
|
12503
|
+
const currentTarget = e2.currentTarget;
|
|
11504
12504
|
if (!isHTMLElement$1(target) || !isHTMLElement$1(currentTarget)) return;
|
|
11505
12505
|
const isKeydownInside = ((_a2 = target.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)) == null ? void 0 : _a2.id) === this.parentMenu.contentId.current;
|
|
11506
|
-
const isModifierKey =
|
|
11507
|
-
const isCharacterKey =
|
|
11508
|
-
const kbdFocusedEl = this.rovingFocusGroup.handleKeydown(target,
|
|
12506
|
+
const isModifierKey = e2.ctrlKey || e2.altKey || e2.metaKey;
|
|
12507
|
+
const isCharacterKey = e2.key.length === 1;
|
|
12508
|
+
const kbdFocusedEl = this.rovingFocusGroup.handleKeydown(target, e2);
|
|
11509
12509
|
if (kbdFocusedEl) return;
|
|
11510
|
-
if (
|
|
12510
|
+
if (e2.code === "Space") return;
|
|
11511
12511
|
const candidateNodes = __privateMethod(this, _MenuContentState_instances, getCandidateNodes_fn).call(this);
|
|
11512
12512
|
if (isKeydownInside) {
|
|
11513
12513
|
if (!isModifierKey && isCharacterKey) {
|
|
11514
|
-
__privateGet(this, _handleTypeaheadSearch).call(this,
|
|
12514
|
+
__privateGet(this, _handleTypeaheadSearch).call(this, e2.key, candidateNodes);
|
|
11515
12515
|
}
|
|
11516
12516
|
}
|
|
11517
|
-
if (((_b2 =
|
|
11518
|
-
if (!FIRST_LAST_KEYS.includes(
|
|
11519
|
-
|
|
11520
|
-
if (LAST_KEYS.includes(
|
|
12517
|
+
if (((_b2 = e2.target) == null ? void 0 : _b2.id) !== this.parentMenu.contentId.current) return;
|
|
12518
|
+
if (!FIRST_LAST_KEYS.includes(e2.key)) return;
|
|
12519
|
+
e2.preventDefault();
|
|
12520
|
+
if (LAST_KEYS.includes(e2.key)) {
|
|
11521
12521
|
candidateNodes.reverse();
|
|
11522
12522
|
}
|
|
11523
12523
|
focusFirst(candidateNodes, { select: false }, () => this.domContext.getActiveElement());
|
|
11524
12524
|
}
|
|
11525
|
-
onblur(
|
|
12525
|
+
onblur(e2) {
|
|
11526
12526
|
var _a2, _b2;
|
|
11527
|
-
if (!isElement$1(
|
|
11528
|
-
if (!isElement$1(
|
|
11529
|
-
if (!((_b2 = (_a2 =
|
|
12527
|
+
if (!isElement$1(e2.currentTarget)) return;
|
|
12528
|
+
if (!isElement$1(e2.target)) return;
|
|
12529
|
+
if (!((_b2 = (_a2 = e2.currentTarget).contains) == null ? void 0 : _b2.call(_a2, e2.target))) {
|
|
11530
12530
|
this.domContext.getWindow().clearTimeout(__privateGet(this, _timer));
|
|
11531
12531
|
this.search = "";
|
|
11532
12532
|
}
|
|
@@ -11538,8 +12538,8 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11538
12538
|
onItemEnter() {
|
|
11539
12539
|
return __privateMethod(this, _MenuContentState_instances, isPointerMovingToSubmenu_fn).call(this);
|
|
11540
12540
|
}
|
|
11541
|
-
onItemLeave(
|
|
11542
|
-
if (
|
|
12541
|
+
onItemLeave(e2) {
|
|
12542
|
+
if (e2.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))) return;
|
|
11543
12543
|
if (__privateMethod(this, _MenuContentState_instances, isPointerMovingToSubmenu_fn).call(this) || this.parentMenu.root.isUsingKeyboard.current) return;
|
|
11544
12544
|
const contentNode = this.parentMenu.contentNode;
|
|
11545
12545
|
contentNode == null ? void 0 : contentNode.focus();
|
|
@@ -11549,16 +12549,16 @@ const _MenuContentState = class _MenuContentState {
|
|
|
11549
12549
|
if (__privateMethod(this, _MenuContentState_instances, isPointerMovingToSubmenu_fn).call(this)) return true;
|
|
11550
12550
|
return false;
|
|
11551
12551
|
}
|
|
11552
|
-
handleInteractOutside(
|
|
12552
|
+
handleInteractOutside(e2) {
|
|
11553
12553
|
var _a2;
|
|
11554
|
-
if (!isElementOrSVGElement(
|
|
12554
|
+
if (!isElementOrSVGElement(e2.target)) return;
|
|
11555
12555
|
const triggerId = (_a2 = this.parentMenu.triggerNode) == null ? void 0 : _a2.id;
|
|
11556
|
-
if (
|
|
11557
|
-
|
|
12556
|
+
if (e2.target.id === triggerId) {
|
|
12557
|
+
e2.preventDefault();
|
|
11558
12558
|
return;
|
|
11559
12559
|
}
|
|
11560
|
-
if (
|
|
11561
|
-
|
|
12560
|
+
if (e2.target.closest(`#${triggerId}`)) {
|
|
12561
|
+
e2.preventDefault();
|
|
11562
12562
|
}
|
|
11563
12563
|
}
|
|
11564
12564
|
get shouldRender() {
|
|
@@ -11624,33 +12624,33 @@ class MenuItemSharedState {
|
|
|
11624
12624
|
this.onfocus = this.onfocus.bind(this);
|
|
11625
12625
|
this.onblur = this.onblur.bind(this);
|
|
11626
12626
|
}
|
|
11627
|
-
onpointermove(
|
|
11628
|
-
if (
|
|
11629
|
-
if (!isMouseEvent(
|
|
12627
|
+
onpointermove(e2) {
|
|
12628
|
+
if (e2.defaultPrevented) return;
|
|
12629
|
+
if (!isMouseEvent(e2)) return;
|
|
11630
12630
|
if (this.opts.disabled.current) {
|
|
11631
|
-
this.content.onItemLeave(
|
|
12631
|
+
this.content.onItemLeave(e2);
|
|
11632
12632
|
} else {
|
|
11633
12633
|
const defaultPrevented = this.content.onItemEnter();
|
|
11634
12634
|
if (defaultPrevented) return;
|
|
11635
|
-
const item =
|
|
12635
|
+
const item = e2.currentTarget;
|
|
11636
12636
|
if (!isHTMLElement$1(item)) return;
|
|
11637
12637
|
item.focus();
|
|
11638
12638
|
}
|
|
11639
12639
|
}
|
|
11640
|
-
onpointerleave(
|
|
11641
|
-
if (
|
|
11642
|
-
if (!isMouseEvent(
|
|
11643
|
-
this.content.onItemLeave(
|
|
12640
|
+
onpointerleave(e2) {
|
|
12641
|
+
if (e2.defaultPrevented) return;
|
|
12642
|
+
if (!isMouseEvent(e2)) return;
|
|
12643
|
+
this.content.onItemLeave(e2);
|
|
11644
12644
|
}
|
|
11645
|
-
onfocus(
|
|
12645
|
+
onfocus(e2) {
|
|
11646
12646
|
afterTick(() => {
|
|
11647
|
-
if (
|
|
12647
|
+
if (e2.defaultPrevented || this.opts.disabled.current) return;
|
|
11648
12648
|
set(__privateGet(this, _isFocused), true);
|
|
11649
12649
|
});
|
|
11650
12650
|
}
|
|
11651
|
-
onblur(
|
|
12651
|
+
onblur(e2) {
|
|
11652
12652
|
afterTick(() => {
|
|
11653
|
-
if (
|
|
12653
|
+
if (e2.defaultPrevented) return;
|
|
11654
12654
|
set(__privateGet(this, _isFocused), false);
|
|
11655
12655
|
});
|
|
11656
12656
|
}
|
|
@@ -11688,25 +12688,25 @@ const _MenuItemState = class _MenuItemState {
|
|
|
11688
12688
|
const item = new MenuItemSharedState(opts, MenuContentContext.get());
|
|
11689
12689
|
return new _MenuItemState(opts, item);
|
|
11690
12690
|
}
|
|
11691
|
-
onkeydown(
|
|
12691
|
+
onkeydown(e2) {
|
|
11692
12692
|
const isTypingAhead = this.item.content.search !== "";
|
|
11693
|
-
if (this.item.opts.disabled.current || isTypingAhead &&
|
|
11694
|
-
if (SELECTION_KEYS.includes(
|
|
11695
|
-
if (!isHTMLElement$1(
|
|
11696
|
-
|
|
11697
|
-
|
|
12693
|
+
if (this.item.opts.disabled.current || isTypingAhead && e2.key === SPACE) return;
|
|
12694
|
+
if (SELECTION_KEYS.includes(e2.key)) {
|
|
12695
|
+
if (!isHTMLElement$1(e2.currentTarget)) return;
|
|
12696
|
+
e2.currentTarget.click();
|
|
12697
|
+
e2.preventDefault();
|
|
11698
12698
|
}
|
|
11699
12699
|
}
|
|
11700
12700
|
onclick(_) {
|
|
11701
12701
|
if (this.item.opts.disabled.current) return;
|
|
11702
12702
|
__privateMethod(this, _MenuItemState_instances, handleSelect_fn).call(this);
|
|
11703
12703
|
}
|
|
11704
|
-
onpointerup(
|
|
12704
|
+
onpointerup(e2) {
|
|
11705
12705
|
var _a2;
|
|
11706
|
-
if (
|
|
12706
|
+
if (e2.defaultPrevented) return;
|
|
11707
12707
|
if (!__privateGet(this, _isPointerDown)) {
|
|
11708
|
-
if (!isHTMLElement$1(
|
|
11709
|
-
(_a2 =
|
|
12708
|
+
if (!isHTMLElement$1(e2.currentTarget)) return;
|
|
12709
|
+
(_a2 = e2.currentTarget) == null ? void 0 : _a2.click();
|
|
11710
12710
|
}
|
|
11711
12711
|
}
|
|
11712
12712
|
onpointerdown(_) {
|
|
@@ -11740,36 +12740,36 @@ const _DropdownMenuTriggerState = class _DropdownMenuTriggerState {
|
|
|
11740
12740
|
__publicField(this, "opts");
|
|
11741
12741
|
__publicField(this, "parentMenu");
|
|
11742
12742
|
__publicField(this, "attachment");
|
|
11743
|
-
__publicField(this, "onclick", (
|
|
11744
|
-
if (this.opts.disabled.current ||
|
|
12743
|
+
__publicField(this, "onclick", (e2) => {
|
|
12744
|
+
if (this.opts.disabled.current || e2.detail !== 0) return;
|
|
11745
12745
|
this.parentMenu.toggleOpen();
|
|
11746
|
-
|
|
12746
|
+
e2.preventDefault();
|
|
11747
12747
|
});
|
|
11748
|
-
__publicField(this, "onpointerdown", (
|
|
12748
|
+
__publicField(this, "onpointerdown", (e2) => {
|
|
11749
12749
|
if (this.opts.disabled.current) return;
|
|
11750
|
-
if (
|
|
11751
|
-
if (
|
|
12750
|
+
if (e2.pointerType === "touch") return e2.preventDefault();
|
|
12751
|
+
if (e2.button === 0 && e2.ctrlKey === false) {
|
|
11752
12752
|
this.parentMenu.toggleOpen();
|
|
11753
|
-
if (!this.parentMenu.opts.open.current)
|
|
12753
|
+
if (!this.parentMenu.opts.open.current) e2.preventDefault();
|
|
11754
12754
|
}
|
|
11755
12755
|
});
|
|
11756
|
-
__publicField(this, "onpointerup", (
|
|
12756
|
+
__publicField(this, "onpointerup", (e2) => {
|
|
11757
12757
|
if (this.opts.disabled.current) return;
|
|
11758
|
-
if (
|
|
11759
|
-
|
|
12758
|
+
if (e2.pointerType === "touch") {
|
|
12759
|
+
e2.preventDefault();
|
|
11760
12760
|
this.parentMenu.toggleOpen();
|
|
11761
12761
|
}
|
|
11762
12762
|
});
|
|
11763
|
-
__publicField(this, "onkeydown", (
|
|
12763
|
+
__publicField(this, "onkeydown", (e2) => {
|
|
11764
12764
|
if (this.opts.disabled.current) return;
|
|
11765
|
-
if (
|
|
12765
|
+
if (e2.key === SPACE || e2.key === ENTER) {
|
|
11766
12766
|
this.parentMenu.toggleOpen();
|
|
11767
|
-
|
|
12767
|
+
e2.preventDefault();
|
|
11768
12768
|
return;
|
|
11769
12769
|
}
|
|
11770
|
-
if (
|
|
12770
|
+
if (e2.key === ARROW_DOWN) {
|
|
11771
12771
|
this.parentMenu.onOpen();
|
|
11772
|
-
|
|
12772
|
+
e2.preventDefault();
|
|
11773
12773
|
}
|
|
11774
12774
|
});
|
|
11775
12775
|
__privateAdd(this, _ariaControls, /* @__PURE__ */ user_derived(() => {
|
|
@@ -11833,25 +12833,25 @@ const _DismissibleLayerState = class _DismissibleLayerState {
|
|
|
11833
12833
|
}
|
|
11834
12834
|
});
|
|
11835
12835
|
});
|
|
11836
|
-
__privateAdd(this, _handleDismiss, (
|
|
11837
|
-
let event2 =
|
|
12836
|
+
__privateAdd(this, _handleDismiss, (e2) => {
|
|
12837
|
+
let event2 = e2;
|
|
11838
12838
|
if (event2.defaultPrevented) {
|
|
11839
|
-
event2 = createWrappedEvent(
|
|
12839
|
+
event2 = createWrappedEvent(e2);
|
|
11840
12840
|
}
|
|
11841
|
-
__privateGet(this, _interactOutsideProp).current(
|
|
12841
|
+
__privateGet(this, _interactOutsideProp).current(e2);
|
|
11842
12842
|
});
|
|
11843
12843
|
__privateAdd(this, _handleInteractOutside, debounce(
|
|
11844
|
-
(
|
|
12844
|
+
(e2) => {
|
|
11845
12845
|
if (!this.opts.ref.current) {
|
|
11846
12846
|
__privateGet(this, _unsubClickListener).call(this);
|
|
11847
12847
|
return;
|
|
11848
12848
|
}
|
|
11849
|
-
const isEventValid = this.opts.isValidEvent.current(
|
|
12849
|
+
const isEventValid = this.opts.isValidEvent.current(e2, this.opts.ref.current) || isValidEvent(e2, this.opts.ref.current);
|
|
11850
12850
|
if (!__privateGet(this, _isResponsibleLayer) || __privateMethod(this, _DismissibleLayerState_instances, isAnyEventIntercepted_fn).call(this) || !isEventValid) {
|
|
11851
12851
|
__privateGet(this, _unsubClickListener).call(this);
|
|
11852
12852
|
return;
|
|
11853
12853
|
}
|
|
11854
|
-
let event2 =
|
|
12854
|
+
let event2 = e2;
|
|
11855
12855
|
if (event2.defaultPrevented) {
|
|
11856
12856
|
event2 = createWrappedEvent(event2);
|
|
11857
12857
|
}
|
|
@@ -11859,7 +12859,7 @@ const _DismissibleLayerState = class _DismissibleLayerState {
|
|
|
11859
12859
|
__privateGet(this, _unsubClickListener).call(this);
|
|
11860
12860
|
return;
|
|
11861
12861
|
}
|
|
11862
|
-
if (
|
|
12862
|
+
if (e2.pointerType === "touch") {
|
|
11863
12863
|
__privateGet(this, _unsubClickListener).call(this);
|
|
11864
12864
|
__privateSet(this, _unsubClickListener, on(__privateGet(this, _documentObj), "click", __privateGet(this, _handleDismiss), { once: true }));
|
|
11865
12865
|
} else {
|
|
@@ -11868,11 +12868,11 @@ const _DismissibleLayerState = class _DismissibleLayerState {
|
|
|
11868
12868
|
},
|
|
11869
12869
|
10
|
|
11870
12870
|
));
|
|
11871
|
-
__privateAdd(this, _markInterceptedEvent, (
|
|
11872
|
-
__privateGet(this, _interceptedEvents)[
|
|
12871
|
+
__privateAdd(this, _markInterceptedEvent, (e2) => {
|
|
12872
|
+
__privateGet(this, _interceptedEvents)[e2.type] = true;
|
|
11873
12873
|
});
|
|
11874
|
-
__privateAdd(this, _markNonInterceptedEvent, (
|
|
11875
|
-
__privateGet(this, _interceptedEvents)[
|
|
12874
|
+
__privateAdd(this, _markNonInterceptedEvent, (e2) => {
|
|
12875
|
+
__privateGet(this, _interceptedEvents)[e2.type] = false;
|
|
11876
12876
|
});
|
|
11877
12877
|
__privateAdd(this, _markResponsibleLayer, () => {
|
|
11878
12878
|
if (!this.opts.ref.current) return;
|
|
@@ -11977,8 +12977,8 @@ _markResponsibleLayer = new WeakMap();
|
|
|
11977
12977
|
_isTargetWithinLayer = new WeakMap();
|
|
11978
12978
|
_resetState = new WeakMap();
|
|
11979
12979
|
isAnyEventIntercepted_fn = function() {
|
|
11980
|
-
const
|
|
11981
|
-
return
|
|
12980
|
+
const i2 = Object.values(__privateGet(this, _interceptedEvents)).some(Boolean);
|
|
12981
|
+
return i2;
|
|
11982
12982
|
};
|
|
11983
12983
|
_onfocuscapture = new WeakMap();
|
|
11984
12984
|
_onblurcapture = new WeakMap();
|
|
@@ -11993,26 +12993,26 @@ function isResponsibleLayer(node) {
|
|
|
11993
12993
|
const [firstLayerNode] = layersArr[0];
|
|
11994
12994
|
return firstLayerNode.opts.ref.current === node;
|
|
11995
12995
|
}
|
|
11996
|
-
function isValidEvent(
|
|
11997
|
-
const target =
|
|
12996
|
+
function isValidEvent(e2, node) {
|
|
12997
|
+
const target = e2.target;
|
|
11998
12998
|
if (!isElementOrSVGElement(target)) return false;
|
|
11999
12999
|
const targetIsContextMenuTrigger = Boolean(target.closest(`[${CONTEXT_MENU_TRIGGER_ATTR}]`));
|
|
12000
|
-
if ("button" in
|
|
12001
|
-
if ("button" in
|
|
13000
|
+
if ("button" in e2 && e2.button > 0 && !targetIsContextMenuTrigger) return false;
|
|
13001
|
+
if ("button" in e2 && e2.button === 0 && targetIsContextMenuTrigger) return true;
|
|
12002
13002
|
const nodeIsContextMenu = Boolean(node.closest(`[${CONTEXT_MENU_CONTENT_ATTR}]`));
|
|
12003
13003
|
if (targetIsContextMenuTrigger && nodeIsContextMenu) return false;
|
|
12004
13004
|
const ownerDocument = getOwnerDocument(target);
|
|
12005
|
-
const isValid = ownerDocument.documentElement.contains(target) && !isOrContainsTarget(node, target) && isClickTrulyOutside(
|
|
13005
|
+
const isValid = ownerDocument.documentElement.contains(target) && !isOrContainsTarget(node, target) && isClickTrulyOutside(e2, node);
|
|
12006
13006
|
return isValid;
|
|
12007
13007
|
}
|
|
12008
|
-
function createWrappedEvent(
|
|
12009
|
-
const capturedCurrentTarget =
|
|
12010
|
-
const capturedTarget =
|
|
13008
|
+
function createWrappedEvent(e2) {
|
|
13009
|
+
const capturedCurrentTarget = e2.currentTarget;
|
|
13010
|
+
const capturedTarget = e2.target;
|
|
12011
13011
|
let newEvent;
|
|
12012
|
-
if (
|
|
12013
|
-
newEvent = new PointerEvent(
|
|
13012
|
+
if (e2 instanceof PointerEvent) {
|
|
13013
|
+
newEvent = new PointerEvent(e2.type, e2);
|
|
12014
13014
|
} else {
|
|
12015
|
-
newEvent = new PointerEvent("pointerdown",
|
|
13015
|
+
newEvent = new PointerEvent("pointerdown", e2);
|
|
12016
13016
|
}
|
|
12017
13017
|
let isPrevented = false;
|
|
12018
13018
|
const wrappedEvent = new Proxy(newEvent, {
|
|
@@ -12037,7 +13037,7 @@ function createWrappedEvent(e) {
|
|
|
12037
13037
|
if (prop2 in target) {
|
|
12038
13038
|
return target[prop2];
|
|
12039
13039
|
}
|
|
12040
|
-
return
|
|
13040
|
+
return e2[prop2];
|
|
12041
13041
|
}
|
|
12042
13042
|
});
|
|
12043
13043
|
return wrappedEvent;
|
|
@@ -12068,10 +13068,10 @@ const _EscapeLayerState = class _EscapeLayerState {
|
|
|
12068
13068
|
__privateAdd(this, _addEventListener, () => {
|
|
12069
13069
|
return on(this.domContext.getDocument(), "keydown", __privateGet(this, _onkeydown), { passive: false });
|
|
12070
13070
|
});
|
|
12071
|
-
__privateAdd(this, _onkeydown, (
|
|
12072
|
-
if (
|
|
12073
|
-
const clonedEvent = new KeyboardEvent(
|
|
12074
|
-
|
|
13071
|
+
__privateAdd(this, _onkeydown, (e2) => {
|
|
13072
|
+
if (e2.key !== ESCAPE || !isResponsibleEscapeLayer(this)) return;
|
|
13073
|
+
const clonedEvent = new KeyboardEvent(e2.type, e2);
|
|
13074
|
+
e2.preventDefault();
|
|
12075
13075
|
const behaviorType = this.opts.escapeKeydownBehavior.current;
|
|
12076
13076
|
if (behaviorType !== "close" && behaviorType !== "defer-otherwise-close") return;
|
|
12077
13077
|
this.opts.onEscapeKeydown.current(clonedEvent);
|
|
@@ -12140,11 +13140,11 @@ const _FocusScopeManager = class _FocusScopeManager {
|
|
|
12140
13140
|
if (activeElement && activeElement !== document.body) {
|
|
12141
13141
|
__privateGet(this, _preFocusHistory).set(scope, activeElement);
|
|
12142
13142
|
}
|
|
12143
|
-
__privateGet(this, _scopeStack).current = __privateGet(this, _scopeStack).current.filter((
|
|
13143
|
+
__privateGet(this, _scopeStack).current = __privateGet(this, _scopeStack).current.filter((s2) => s2 !== scope);
|
|
12144
13144
|
__privateGet(this, _scopeStack).current.unshift(scope);
|
|
12145
13145
|
}
|
|
12146
13146
|
unregister(scope) {
|
|
12147
|
-
__privateGet(this, _scopeStack).current = __privateGet(this, _scopeStack).current.filter((
|
|
13147
|
+
__privateGet(this, _scopeStack).current = __privateGet(this, _scopeStack).current.filter((s2) => s2 !== scope);
|
|
12148
13148
|
const next = this.getActive();
|
|
12149
13149
|
if (next) {
|
|
12150
13150
|
next.resume();
|
|
@@ -12284,9 +13284,9 @@ setupEventListeners_fn = function() {
|
|
|
12284
13284
|
if (!__privateGet(this, _container) || !__privateGet(this, _opts6).trap.current) return;
|
|
12285
13285
|
const container = __privateGet(this, _container);
|
|
12286
13286
|
const doc = container.ownerDocument;
|
|
12287
|
-
const handleFocus = (
|
|
13287
|
+
const handleFocus = (e2) => {
|
|
12288
13288
|
if (__privateGet(this, _paused) || !__privateGet(this, _manager).isActiveScope(this)) return;
|
|
12289
|
-
const target =
|
|
13289
|
+
const target = e2.target;
|
|
12290
13290
|
if (!target) return;
|
|
12291
13291
|
const isInside = container.contains(target);
|
|
12292
13292
|
if (isInside) {
|
|
@@ -12294,7 +13294,7 @@ setupEventListeners_fn = function() {
|
|
|
12294
13294
|
} else {
|
|
12295
13295
|
const lastFocused = __privateGet(this, _manager).getFocusMemory(this);
|
|
12296
13296
|
if (lastFocused && container.contains(lastFocused) && isFocusable(lastFocused)) {
|
|
12297
|
-
|
|
13297
|
+
e2.preventDefault();
|
|
12298
13298
|
lastFocused.focus();
|
|
12299
13299
|
} else {
|
|
12300
13300
|
const firstTabbable = __privateMethod(this, _FocusScope_instances, getFirstTabbable_fn).call(this);
|
|
@@ -12303,18 +13303,18 @@ setupEventListeners_fn = function() {
|
|
|
12303
13303
|
}
|
|
12304
13304
|
}
|
|
12305
13305
|
};
|
|
12306
|
-
const handleKeydown = (
|
|
12307
|
-
if (!__privateGet(this, _opts6).loop || __privateGet(this, _paused) ||
|
|
13306
|
+
const handleKeydown = (e2) => {
|
|
13307
|
+
if (!__privateGet(this, _opts6).loop || __privateGet(this, _paused) || e2.key !== "Tab") return;
|
|
12308
13308
|
if (!__privateGet(this, _manager).isActiveScope(this)) return;
|
|
12309
13309
|
const tabbables = __privateMethod(this, _FocusScope_instances, getTabbables_fn).call(this);
|
|
12310
13310
|
if (tabbables.length < 2) return;
|
|
12311
13311
|
const first = tabbables[0];
|
|
12312
13312
|
const last = tabbables[tabbables.length - 1];
|
|
12313
|
-
if (!
|
|
12314
|
-
|
|
13313
|
+
if (!e2.shiftKey && doc.activeElement === last) {
|
|
13314
|
+
e2.preventDefault();
|
|
12315
13315
|
first.focus();
|
|
12316
|
-
} else if (
|
|
12317
|
-
|
|
13316
|
+
} else if (e2.shiftKey && doc.activeElement === first) {
|
|
13317
|
+
e2.preventDefault();
|
|
12318
13318
|
last.focus();
|
|
12319
13319
|
}
|
|
12320
13320
|
};
|
|
@@ -12373,13 +13373,13 @@ const _TextSelectionLayerState = class _TextSelectionLayerState {
|
|
|
12373
13373
|
__publicField(this, "opts");
|
|
12374
13374
|
__publicField(this, "domContext");
|
|
12375
13375
|
__privateAdd(this, _unsubSelectionLock, noop);
|
|
12376
|
-
__privateAdd(this, _pointerdown, (
|
|
13376
|
+
__privateAdd(this, _pointerdown, (e2) => {
|
|
12377
13377
|
const node = this.opts.ref.current;
|
|
12378
|
-
const target =
|
|
13378
|
+
const target = e2.target;
|
|
12379
13379
|
if (!isHTMLElement$1(node) || !isHTMLElement$1(target) || !this.opts.enabled.current) return;
|
|
12380
13380
|
if (!isHighestLayer(this) || !contains(node, target)) return;
|
|
12381
|
-
this.opts.onPointerDown.current(
|
|
12382
|
-
if (
|
|
13381
|
+
this.opts.onPointerDown.current(e2);
|
|
13382
|
+
if (e2.defaultPrevented) return;
|
|
12383
13383
|
__privateSet(this, _unsubSelectionLock, preventTextSelectionOverflow(node, this.domContext.getDocument().body));
|
|
12384
13384
|
});
|
|
12385
13385
|
__privateAdd(this, _resetSelectionLock, () => {
|
|
@@ -12562,10 +13562,10 @@ const bodyLockStackCount = new SharedState(() => {
|
|
|
12562
13562
|
stopTouchMoveListener = on(
|
|
12563
13563
|
document,
|
|
12564
13564
|
"touchmove",
|
|
12565
|
-
(
|
|
12566
|
-
if (
|
|
12567
|
-
if (
|
|
12568
|
-
|
|
13565
|
+
(e2) => {
|
|
13566
|
+
if (e2.target !== document.documentElement) return;
|
|
13567
|
+
if (e2.touches.length > 1) return;
|
|
13568
|
+
e2.preventDefault();
|
|
12569
13569
|
},
|
|
12570
13570
|
{ passive: false }
|
|
12571
13571
|
);
|
|
@@ -12984,11 +13984,11 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
12984
13984
|
let statefulPlacement = placement;
|
|
12985
13985
|
let middlewareData = {};
|
|
12986
13986
|
let resetCount = 0;
|
|
12987
|
-
for (let
|
|
13987
|
+
for (let i2 = 0; i2 < validMiddleware.length; i2++) {
|
|
12988
13988
|
const {
|
|
12989
13989
|
name,
|
|
12990
13990
|
fn
|
|
12991
|
-
} = validMiddleware[
|
|
13991
|
+
} = validMiddleware[i2];
|
|
12992
13992
|
const {
|
|
12993
13993
|
x: nextX,
|
|
12994
13994
|
y: nextY,
|
|
@@ -13035,7 +14035,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
13035
14035
|
y
|
|
13036
14036
|
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
13037
14037
|
}
|
|
13038
|
-
|
|
14038
|
+
i2 = -1;
|
|
13039
14039
|
}
|
|
13040
14040
|
}
|
|
13041
14041
|
return {
|
|
@@ -15676,25 +16676,25 @@ const _PopoverContentState = class _PopoverContentState {
|
|
|
15676
16676
|
__publicField(this, "opts");
|
|
15677
16677
|
__publicField(this, "root");
|
|
15678
16678
|
__publicField(this, "attachment");
|
|
15679
|
-
__publicField(this, "onInteractOutside", (
|
|
15680
|
-
this.opts.onInteractOutside.current(
|
|
15681
|
-
if (
|
|
15682
|
-
if (!isElement$1(
|
|
15683
|
-
const closestTrigger =
|
|
16679
|
+
__publicField(this, "onInteractOutside", (e2) => {
|
|
16680
|
+
this.opts.onInteractOutside.current(e2);
|
|
16681
|
+
if (e2.defaultPrevented) return;
|
|
16682
|
+
if (!isElement$1(e2.target)) return;
|
|
16683
|
+
const closestTrigger = e2.target.closest(popoverAttrs.selector("trigger"));
|
|
15684
16684
|
if (closestTrigger && closestTrigger === this.root.triggerNode) return;
|
|
15685
16685
|
if (this.opts.customAnchor.current) {
|
|
15686
16686
|
if (isElement$1(this.opts.customAnchor.current)) {
|
|
15687
|
-
if (this.opts.customAnchor.current.contains(
|
|
16687
|
+
if (this.opts.customAnchor.current.contains(e2.target)) return;
|
|
15688
16688
|
} else if (typeof this.opts.customAnchor.current === "string") {
|
|
15689
16689
|
const el = document.querySelector(this.opts.customAnchor.current);
|
|
15690
|
-
if (el && el.contains(
|
|
16690
|
+
if (el && el.contains(e2.target)) return;
|
|
15691
16691
|
}
|
|
15692
16692
|
}
|
|
15693
16693
|
this.root.handleClose();
|
|
15694
16694
|
});
|
|
15695
|
-
__publicField(this, "onEscapeKeydown", (
|
|
15696
|
-
this.opts.onEscapeKeydown.current(
|
|
15697
|
-
if (
|
|
16695
|
+
__publicField(this, "onEscapeKeydown", (e2) => {
|
|
16696
|
+
this.opts.onEscapeKeydown.current(e2);
|
|
16697
|
+
if (e2.defaultPrevented) return;
|
|
15698
16698
|
this.root.handleClose();
|
|
15699
16699
|
});
|
|
15700
16700
|
__privateAdd(this, _snippetProps4, /* @__PURE__ */ user_derived(() => ({ open: this.root.opts.open.current })));
|
|
@@ -15988,9 +16988,9 @@ function Dialog_content($$anchor, $$props) {
|
|
|
15988
16988
|
get ref() {
|
|
15989
16989
|
return contentState.opts.ref;
|
|
15990
16990
|
},
|
|
15991
|
-
onEscapeKeydown: (
|
|
15992
|
-
onEscapeKeydown()(
|
|
15993
|
-
if (
|
|
16991
|
+
onEscapeKeydown: (e2) => {
|
|
16992
|
+
onEscapeKeydown()(e2);
|
|
16993
|
+
if (e2.defaultPrevented) return;
|
|
15994
16994
|
contentState.root.handleClose();
|
|
15995
16995
|
},
|
|
15996
16996
|
children: ($$anchor4, $$slotProps) => {
|
|
@@ -16001,9 +17001,9 @@ function Dialog_content($$anchor, $$props) {
|
|
|
16001
17001
|
get enabled() {
|
|
16002
17002
|
return contentState.root.opts.open.current;
|
|
16003
17003
|
},
|
|
16004
|
-
onInteractOutside: (
|
|
16005
|
-
onInteractOutside()(
|
|
16006
|
-
if (
|
|
17004
|
+
onInteractOutside: (e2) => {
|
|
17005
|
+
onInteractOutside()(e2);
|
|
17006
|
+
if (e2.defaultPrevented) return;
|
|
16007
17007
|
contentState.root.handleClose();
|
|
16008
17008
|
},
|
|
16009
17009
|
children: ($$anchor5, $$slotProps2) => {
|
|
@@ -16164,20 +17164,20 @@ function Dropdown_menu_content($$anchor, $$props) {
|
|
|
16164
17164
|
onCloseAutoFocus: boxWith(() => onCloseAutoFocus())
|
|
16165
17165
|
});
|
|
16166
17166
|
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, contentState.props));
|
|
16167
|
-
function handleInteractOutside(
|
|
16168
|
-
contentState.handleInteractOutside(
|
|
16169
|
-
if (
|
|
16170
|
-
onInteractOutside()(
|
|
16171
|
-
if (
|
|
16172
|
-
if (
|
|
17167
|
+
function handleInteractOutside(e2) {
|
|
17168
|
+
contentState.handleInteractOutside(e2);
|
|
17169
|
+
if (e2.defaultPrevented) return;
|
|
17170
|
+
onInteractOutside()(e2);
|
|
17171
|
+
if (e2.defaultPrevented) return;
|
|
17172
|
+
if (e2.target && e2.target instanceof Element) {
|
|
16173
17173
|
const subContentSelector = `[${contentState.parentMenu.root.getBitsAttr("sub-content")}]`;
|
|
16174
|
-
if (
|
|
17174
|
+
if (e2.target.closest(subContentSelector)) return;
|
|
16175
17175
|
}
|
|
16176
17176
|
contentState.parentMenu.onClose();
|
|
16177
17177
|
}
|
|
16178
|
-
function handleEscapeKeydown(
|
|
16179
|
-
onEscapeKeydown()(
|
|
16180
|
-
if (
|
|
17178
|
+
function handleEscapeKeydown(e2) {
|
|
17179
|
+
onEscapeKeydown()(e2);
|
|
17180
|
+
if (e2.defaultPrevented) return;
|
|
16181
17181
|
contentState.parentMenu.onClose();
|
|
16182
17182
|
}
|
|
16183
17183
|
var fragment = comment();
|
|
@@ -16691,9 +17691,9 @@ const _TooltipTriggerState = class _TooltipTriggerState {
|
|
|
16691
17691
|
{ once: true }
|
|
16692
17692
|
);
|
|
16693
17693
|
});
|
|
16694
|
-
__privateAdd(this, _onpointerenter, (
|
|
17694
|
+
__privateAdd(this, _onpointerenter, (e2) => {
|
|
16695
17695
|
if (get$2(__privateGet(this, _isDisabled))) return;
|
|
16696
|
-
if (
|
|
17696
|
+
if (e2.pointerType === "touch") return;
|
|
16697
17697
|
if (this.root.provider.isPointerInTransit.current) {
|
|
16698
17698
|
__privateGet(this, _clearTransitCheck).call(this);
|
|
16699
17699
|
__privateSet(this, _transitCheckTimeout, window.setTimeout(
|
|
@@ -16711,9 +17711,9 @@ const _TooltipTriggerState = class _TooltipTriggerState {
|
|
|
16711
17711
|
this.root.onTriggerEnter();
|
|
16712
17712
|
set(__privateGet(this, _hasPointerMoveOpened), true);
|
|
16713
17713
|
});
|
|
16714
|
-
__privateAdd(this, _onpointermove, (
|
|
17714
|
+
__privateAdd(this, _onpointermove, (e2) => {
|
|
16715
17715
|
if (get$2(__privateGet(this, _isDisabled))) return;
|
|
16716
|
-
if (
|
|
17716
|
+
if (e2.pointerType === "touch") return;
|
|
16717
17717
|
if (get$2(__privateGet(this, _hasPointerMoveOpened))) return;
|
|
16718
17718
|
__privateGet(this, _clearTransitCheck).call(this);
|
|
16719
17719
|
this.root.provider.isPointerInTransit.current = false;
|
|
@@ -16726,9 +17726,9 @@ const _TooltipTriggerState = class _TooltipTriggerState {
|
|
|
16726
17726
|
this.root.onTriggerLeave();
|
|
16727
17727
|
set(__privateGet(this, _hasPointerMoveOpened), false);
|
|
16728
17728
|
});
|
|
16729
|
-
__privateAdd(this, _onfocus, (
|
|
17729
|
+
__privateAdd(this, _onfocus, (e2) => {
|
|
16730
17730
|
if (__privateGet(this, _isPointerDown2).current || get$2(__privateGet(this, _isDisabled))) return;
|
|
16731
|
-
if (this.root.ignoreNonKeyboardFocus && !isFocusVisible(
|
|
17731
|
+
if (this.root.ignoreNonKeyboardFocus && !isFocusVisible(e2.currentTarget)) return;
|
|
16732
17732
|
this.root.handleOpen();
|
|
16733
17733
|
});
|
|
16734
17734
|
__privateAdd(this, _onblur, () => {
|
|
@@ -16796,27 +17796,27 @@ const _TooltipContentState = class _TooltipContentState {
|
|
|
16796
17796
|
__publicField(this, "opts");
|
|
16797
17797
|
__publicField(this, "root");
|
|
16798
17798
|
__publicField(this, "attachment");
|
|
16799
|
-
__publicField(this, "onInteractOutside", (
|
|
17799
|
+
__publicField(this, "onInteractOutside", (e2) => {
|
|
16800
17800
|
var _a2;
|
|
16801
|
-
if (isElement$1(
|
|
16802
|
-
|
|
17801
|
+
if (isElement$1(e2.target) && ((_a2 = this.root.triggerNode) == null ? void 0 : _a2.contains(e2.target)) && this.root.disableCloseOnTriggerClick) {
|
|
17802
|
+
e2.preventDefault();
|
|
16803
17803
|
return;
|
|
16804
17804
|
}
|
|
16805
|
-
this.opts.onInteractOutside.current(
|
|
16806
|
-
if (
|
|
17805
|
+
this.opts.onInteractOutside.current(e2);
|
|
17806
|
+
if (e2.defaultPrevented) return;
|
|
16807
17807
|
this.root.handleClose();
|
|
16808
17808
|
});
|
|
16809
|
-
__publicField(this, "onEscapeKeydown", (
|
|
17809
|
+
__publicField(this, "onEscapeKeydown", (e2) => {
|
|
16810
17810
|
var _a2, _b2;
|
|
16811
|
-
(_b2 = (_a2 = this.opts.onEscapeKeydown).current) == null ? void 0 : _b2.call(_a2,
|
|
16812
|
-
if (
|
|
17811
|
+
(_b2 = (_a2 = this.opts.onEscapeKeydown).current) == null ? void 0 : _b2.call(_a2, e2);
|
|
17812
|
+
if (e2.defaultPrevented) return;
|
|
16813
17813
|
this.root.handleClose();
|
|
16814
17814
|
});
|
|
16815
|
-
__publicField(this, "onOpenAutoFocus", (
|
|
16816
|
-
|
|
17815
|
+
__publicField(this, "onOpenAutoFocus", (e2) => {
|
|
17816
|
+
e2.preventDefault();
|
|
16817
17817
|
});
|
|
16818
|
-
__publicField(this, "onCloseAutoFocus", (
|
|
16819
|
-
|
|
17818
|
+
__publicField(this, "onCloseAutoFocus", (e2) => {
|
|
17819
|
+
e2.preventDefault();
|
|
16820
17820
|
});
|
|
16821
17821
|
__privateAdd(this, _snippetProps5, /* @__PURE__ */ user_derived(() => ({ open: this.root.opts.open.current })));
|
|
16822
17822
|
__privateAdd(this, _props14, /* @__PURE__ */ user_derived(() => ({
|
|
@@ -16850,8 +17850,8 @@ const _TooltipContentState = class _TooltipContentState {
|
|
|
16850
17850
|
},
|
|
16851
17851
|
transitTimeout: this.root.provider.opts.skipDelayDuration.current
|
|
16852
17852
|
});
|
|
16853
|
-
onMountEffect(() => on(window, "scroll", (
|
|
16854
|
-
const target =
|
|
17853
|
+
onMountEffect(() => on(window, "scroll", (e2) => {
|
|
17854
|
+
const target = e2.target;
|
|
16855
17855
|
if (!target) return;
|
|
16856
17856
|
if (target.contains(this.root.triggerNode)) {
|
|
16857
17857
|
this.root.handleClose();
|
|
@@ -17809,16 +18809,16 @@ function CommentMenu($$anchor, $$props) {
|
|
|
17809
18809
|
append($$anchor, fragment);
|
|
17810
18810
|
pop();
|
|
17811
18811
|
}
|
|
17812
|
-
var on_change$1 = (
|
|
18812
|
+
var on_change$1 = (e2, handleChange2) => handleChange2(e2);
|
|
17813
18813
|
var root$h = /* @__PURE__ */ from_html(`<label class="flex-center size-24 touch:size-32 relative cursor-pointer" data-fubi-done-button=""><input type="checkbox"/> <span class="sr-only">Add High Priority</span> <!></label>`);
|
|
17814
18814
|
function CommentDone($$anchor, $$props) {
|
|
17815
18815
|
push($$props, true);
|
|
17816
18816
|
let checked = prop($$props, "checked", 7, false);
|
|
17817
18817
|
const { comments } = getModules();
|
|
17818
18818
|
const log2 = logger("done");
|
|
17819
|
-
const handleChange2 = (
|
|
18819
|
+
const handleChange2 = (e2) => {
|
|
17820
18820
|
__haptic();
|
|
17821
|
-
const target =
|
|
18821
|
+
const target = e2.target;
|
|
17822
18822
|
log2.info("Changed done for comment", $$props.id, "to", target.checked);
|
|
17823
18823
|
comments.setDone($$props.id, target.checked);
|
|
17824
18824
|
};
|
|
@@ -17854,16 +18854,16 @@ function CommentDone($$anchor, $$props) {
|
|
|
17854
18854
|
pop();
|
|
17855
18855
|
}
|
|
17856
18856
|
delegate(["change"]);
|
|
17857
|
-
var on_change = (
|
|
18857
|
+
var on_change = (e2, handleChange2) => handleChange2(e2);
|
|
17858
18858
|
var root$g = /* @__PURE__ */ from_html(`<label class="flex-center size-24 touch:size-32 relative cursor-pointer" data-fubi-priority-button=""><input type="checkbox"/> <span class="sr-only">Add High Priority</span> <!></label>`);
|
|
17859
18859
|
function CommentPriority($$anchor, $$props) {
|
|
17860
18860
|
push($$props, true);
|
|
17861
18861
|
let checked = prop($$props, "checked", 7, false);
|
|
17862
18862
|
const { comments } = getModules();
|
|
17863
18863
|
const log2 = logger("priority");
|
|
17864
|
-
const handleChange2 = (
|
|
18864
|
+
const handleChange2 = (e2) => {
|
|
17865
18865
|
__haptic();
|
|
17866
|
-
const target =
|
|
18866
|
+
const target = e2.target;
|
|
17867
18867
|
log2.info("Changed priority for comment", $$props.id, "to", target.checked);
|
|
17868
18868
|
comments.setPriority($$props.id, target.checked);
|
|
17869
18869
|
};
|
|
@@ -18058,8 +19058,8 @@ var root$d = /* @__PURE__ */ from_html(`<form class="flex flex-center flex-col r
|
|
|
18058
19058
|
function RegisterPage($$anchor, $$props) {
|
|
18059
19059
|
push($$props, true);
|
|
18060
19060
|
const { pages } = getModules();
|
|
18061
|
-
const handleSubmit = (
|
|
18062
|
-
|
|
19061
|
+
const handleSubmit = (e2) => {
|
|
19062
|
+
e2.preventDefault();
|
|
18063
19063
|
pages.registerCurrent();
|
|
18064
19064
|
};
|
|
18065
19065
|
var form = root$d();
|
|
@@ -18107,7 +19107,7 @@ function RegisterPage($$anchor, $$props) {
|
|
|
18107
19107
|
},
|
|
18108
19108
|
$$slots: { default: true }
|
|
18109
19109
|
});
|
|
18110
|
-
event("submit", form, (
|
|
19110
|
+
event("submit", form, (e2) => handleSubmit(e2));
|
|
18111
19111
|
transition(3, form, () => scale, () => ({ start: 0.8, duration: 500, easing: cubicOut }));
|
|
18112
19112
|
append($$anchor, form);
|
|
18113
19113
|
pop();
|
|
@@ -18859,13 +19859,13 @@ class Hover extends Module {
|
|
|
18859
19859
|
this.modules.keys.bind("c", () => {
|
|
18860
19860
|
if (!hasFocus()) this.toggle();
|
|
18861
19861
|
});
|
|
18862
|
-
this.modules.events.add("mousemove", (
|
|
18863
|
-
this.modules.events.add("mouseover", (
|
|
19862
|
+
this.modules.events.add("mousemove", (e2) => this.handleMouseMove(e2));
|
|
19863
|
+
this.modules.events.add("mouseover", (e2) => this.handleMouseOver(e2));
|
|
18864
19864
|
this.modules.events.add("scrollstart", () => this.handleScrollStart());
|
|
18865
19865
|
this.modules.events.add("scroll", () => this.handleScroll());
|
|
18866
|
-
this.modules.events.add("mousedown", (
|
|
18867
|
-
this.modules.events.add("click", (
|
|
18868
|
-
this.modules.events.add("mouseout", (
|
|
19866
|
+
this.modules.events.add("mousedown", (e2) => this.handleMouseDown(e2));
|
|
19867
|
+
this.modules.events.add("click", (e2) => this.handleClick(e2));
|
|
19868
|
+
this.modules.events.add("mouseout", (e2) => this.handleMouseOut(e2), { target: document.documentElement });
|
|
18869
19869
|
this.on("message:escape", () => this.isolated = false);
|
|
18870
19870
|
this.on("auth:login", () => {
|
|
18871
19871
|
if (this.enabled) this.enable();
|
|
@@ -18940,16 +19940,16 @@ class Hover extends Module {
|
|
|
18940
19940
|
if (!this.enabled) return;
|
|
18941
19941
|
this.scroll = { x: window.scrollX, y: window.scrollY };
|
|
18942
19942
|
}
|
|
18943
|
-
handleMouseDown(
|
|
19943
|
+
handleMouseDown(e2) {
|
|
18944
19944
|
if (!this.enabled) return;
|
|
18945
|
-
const actualTarget =
|
|
19945
|
+
const actualTarget = e2.composedPath()[0];
|
|
18946
19946
|
this.ignoreNextClick = this.shouldIgnore(actualTarget);
|
|
18947
19947
|
if (this.ignoreNextClick) {
|
|
18948
19948
|
log$5.info("Mouse down inside ignored element, skipping.");
|
|
18949
19949
|
return;
|
|
18950
19950
|
}
|
|
18951
|
-
|
|
18952
|
-
|
|
19951
|
+
e2.preventDefault();
|
|
19952
|
+
e2.stopPropagation();
|
|
18953
19953
|
}
|
|
18954
19954
|
resetIsolation() {
|
|
18955
19955
|
this.isolated = false;
|
|
@@ -18959,7 +19959,7 @@ class Hover extends Module {
|
|
|
18959
19959
|
log$5.info("Element un-isolated:", this.current);
|
|
18960
19960
|
this.emit("hover:reset");
|
|
18961
19961
|
}
|
|
18962
|
-
handleClick(
|
|
19962
|
+
handleClick(e2) {
|
|
18963
19963
|
if (!this.enabled) return;
|
|
18964
19964
|
if (!this.current) return;
|
|
18965
19965
|
if (this.ignoreNextClick) {
|
|
@@ -18967,11 +19967,11 @@ class Hover extends Module {
|
|
|
18967
19967
|
this.ignoreNextClick = false;
|
|
18968
19968
|
return;
|
|
18969
19969
|
}
|
|
18970
|
-
|
|
18971
|
-
|
|
19970
|
+
e2.preventDefault();
|
|
19971
|
+
e2.stopPropagation();
|
|
18972
19972
|
if (this.isolated) {
|
|
18973
19973
|
this.resetIsolation();
|
|
18974
|
-
this.mouse = { x:
|
|
19974
|
+
this.mouse = { x: e2.clientX, y: e2.clientY };
|
|
18975
19975
|
return;
|
|
18976
19976
|
}
|
|
18977
19977
|
if (this.emptyHover) {
|
|
@@ -18987,11 +19987,11 @@ class Hover extends Module {
|
|
|
18987
19987
|
log$5.info("Element isolated:", this.current);
|
|
18988
19988
|
this.emit("hover:isolated", { el: this.current, info: this.info });
|
|
18989
19989
|
}
|
|
18990
|
-
handleMouseMove(
|
|
18991
|
-
this.mouse = { x:
|
|
19990
|
+
handleMouseMove(e2) {
|
|
19991
|
+
this.mouse = { x: e2.clientX, y: e2.clientY };
|
|
18992
19992
|
if (!this.enabled) return;
|
|
18993
19993
|
if (this.isolated) return;
|
|
18994
|
-
const target =
|
|
19994
|
+
const target = e2.composedPath()[0];
|
|
18995
19995
|
if (this.shouldIgnore(target) || this.modules.elements.isInsideFubi(target) || this.modules.elements.isInsideMessage(target) || this.modules.elements.isInsidePicker(target)) {
|
|
18996
19996
|
this.insideFubi = true;
|
|
18997
19997
|
this.clearHoverTimeout();
|
|
@@ -19003,10 +20003,10 @@ class Hover extends Module {
|
|
|
19003
20003
|
this.showHighlight();
|
|
19004
20004
|
}
|
|
19005
20005
|
}
|
|
19006
|
-
handleMouseOut(
|
|
20006
|
+
handleMouseOut(e2) {
|
|
19007
20007
|
if (!this.enabled) return;
|
|
19008
20008
|
if (this.isolated) return;
|
|
19009
|
-
const relatedTarget =
|
|
20009
|
+
const relatedTarget = e2.relatedTarget;
|
|
19010
20010
|
if (!relatedTarget || !document.documentElement.contains(relatedTarget)) {
|
|
19011
20011
|
this.clearHoverTimeout();
|
|
19012
20012
|
this.setHoverState(null, false);
|
|
@@ -19070,10 +20070,10 @@ class Hover extends Module {
|
|
|
19070
20070
|
timeout
|
|
19071
20071
|
);
|
|
19072
20072
|
}
|
|
19073
|
-
handleMouseOver(
|
|
20073
|
+
handleMouseOver(e2) {
|
|
19074
20074
|
if (!this.enabled) return;
|
|
19075
20075
|
if (this.isolated) return;
|
|
19076
|
-
const target =
|
|
20076
|
+
const target = e2.composedPath()[0];
|
|
19077
20077
|
if (this.shouldIgnore(target)) return;
|
|
19078
20078
|
this.handleHoverElement(target);
|
|
19079
20079
|
}
|
|
@@ -19105,10 +20105,10 @@ class Comments extends CollectionModule {
|
|
|
19105
20105
|
__privateAdd(this, _threads, /* @__PURE__ */ user_derived(() => this.data.filter((c) => !c.parent)));
|
|
19106
20106
|
__privateAdd(this, _grouped, /* @__PURE__ */ user_derived(() => {
|
|
19107
20107
|
const map = /* @__PURE__ */ new Map();
|
|
19108
|
-
this.threads.forEach((
|
|
19109
|
-
const key2 =
|
|
20108
|
+
this.threads.forEach((t2) => {
|
|
20109
|
+
const key2 = t2.selector;
|
|
19110
20110
|
if (!map.has(key2)) map.set(key2, []);
|
|
19111
|
-
map.get(key2).push(
|
|
20111
|
+
map.get(key2).push(t2);
|
|
19112
20112
|
});
|
|
19113
20113
|
return map;
|
|
19114
20114
|
}));
|
|
@@ -19116,7 +20116,7 @@ class Comments extends CollectionModule {
|
|
|
19116
20116
|
const activeSelector = this.modules.hover.path ?? null;
|
|
19117
20117
|
const isolated = this.modules.hover.isolated;
|
|
19118
20118
|
if (!isolated || !activeSelector) return this.threads;
|
|
19119
|
-
return this.threads.filter((
|
|
20119
|
+
return this.threads.filter((t2) => t2.selector === activeSelector);
|
|
19120
20120
|
}));
|
|
19121
20121
|
__privateAdd(this, _bindings, /* @__PURE__ */ user_derived(() => {
|
|
19122
20122
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -19546,11 +20546,11 @@ let Message$1 = (_g = class extends Module {
|
|
|
19546
20546
|
if (this.focused) this.reset();
|
|
19547
20547
|
this.emit("message:escape");
|
|
19548
20548
|
});
|
|
19549
|
-
this.modules.keys.bind("Enter", (
|
|
20549
|
+
this.modules.keys.bind("Enter", (e2) => {
|
|
19550
20550
|
if (!this.focused) return;
|
|
19551
20551
|
if (this.modules.picker.open) return;
|
|
19552
|
-
if (
|
|
19553
|
-
|
|
20552
|
+
if (e2.shiftKey) return;
|
|
20553
|
+
e2.preventDefault();
|
|
19554
20554
|
this.handleSendComment();
|
|
19555
20555
|
});
|
|
19556
20556
|
this.on("comments:created", () => {
|
|
@@ -19586,8 +20586,8 @@ let Message$1 = (_g = class extends Module {
|
|
|
19586
20586
|
document.execCommand("insertText", false, char);
|
|
19587
20587
|
this.html = this.element.innerHTML;
|
|
19588
20588
|
}
|
|
19589
|
-
handleInput(
|
|
19590
|
-
const target =
|
|
20589
|
+
handleInput(e2) {
|
|
20590
|
+
const target = e2.currentTarget;
|
|
19591
20591
|
this.html = target.innerHTML;
|
|
19592
20592
|
this.checkForTriggers();
|
|
19593
20593
|
}
|
|
@@ -19805,24 +20805,24 @@ let Picker$1 = (_h = class extends Module {
|
|
|
19805
20805
|
set(__privateGet(this, _items), value, true);
|
|
19806
20806
|
}
|
|
19807
20807
|
start() {
|
|
19808
|
-
this.modules.keys.bind("ArrowDown", (
|
|
20808
|
+
this.modules.keys.bind("ArrowDown", (e2) => {
|
|
19809
20809
|
if (!this.open || this.items.length === 0) return;
|
|
19810
|
-
|
|
20810
|
+
e2.preventDefault();
|
|
19811
20811
|
this.selectedIndex = Math.min(this.selectedIndex + 1, this.items.length - 1);
|
|
19812
20812
|
});
|
|
19813
|
-
this.modules.keys.bind("ArrowUp", (
|
|
20813
|
+
this.modules.keys.bind("ArrowUp", (e2) => {
|
|
19814
20814
|
if (!this.open || this.items.length === 0) return;
|
|
19815
|
-
|
|
20815
|
+
e2.preventDefault();
|
|
19816
20816
|
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
19817
20817
|
});
|
|
19818
|
-
this.modules.keys.bind("Enter", (
|
|
20818
|
+
this.modules.keys.bind("Enter", (e2) => {
|
|
19819
20819
|
if (!this.open || !this.items[this.selectedIndex]) return;
|
|
19820
|
-
|
|
20820
|
+
e2.preventDefault();
|
|
19821
20821
|
this.confirm(this.items[this.selectedIndex]);
|
|
19822
20822
|
});
|
|
19823
|
-
this.modules.keys.bind("Escape", (
|
|
20823
|
+
this.modules.keys.bind("Escape", (e2) => {
|
|
19824
20824
|
if (!this.open) return;
|
|
19825
|
-
|
|
20825
|
+
e2.preventDefault();
|
|
19826
20826
|
this.cancel();
|
|
19827
20827
|
});
|
|
19828
20828
|
}
|
|
@@ -20137,7 +21137,7 @@ const log = logger("app");
|
|
|
20137
21137
|
const createApp = (params) => {
|
|
20138
21138
|
const { projectId, wrapper } = params;
|
|
20139
21139
|
const modules = {
|
|
20140
|
-
pb: new
|
|
21140
|
+
pb: new Client(pocketbaseUrl),
|
|
20141
21141
|
project: new Project(projectId),
|
|
20142
21142
|
team: new Team(),
|
|
20143
21143
|
elements: new Elements(),
|
|
@@ -20355,9 +21355,9 @@ function Window($$anchor, $$props) {
|
|
|
20355
21355
|
// styles for desktop
|
|
20356
21356
|
// when dragging the window
|
|
20357
21357
|
// when window opened or closed
|
|
20358
|
-
(
|
|
20359
|
-
div.__pointerup = (
|
|
20360
|
-
div.__pointermove = (
|
|
21358
|
+
(e2) => win.drag.start(e2);
|
|
21359
|
+
div.__pointerup = (e2) => win.drag.end(e2);
|
|
21360
|
+
div.__pointermove = (e2) => win.drag.move(e2);
|
|
20361
21361
|
var div_1 = child(div);
|
|
20362
21362
|
set_class(div_1, 1, clsx([
|
|
20363
21363
|
"pointer-events-none rounded-full absolute left-1/2 -translate-x-1/2 z-[1001] mouse:hidden",
|
|
@@ -20396,7 +21396,7 @@ function Window($$anchor, $$props) {
|
|
|
20396
21396
|
]));
|
|
20397
21397
|
set_style(div, `max-height: ${win.dragging.active ? win.dragging.height : win.opened ? win.currentBreakpoint : 0}px;`);
|
|
20398
21398
|
});
|
|
20399
|
-
event("pointercancel", div, (
|
|
21399
|
+
event("pointercancel", div, (e2) => win.drag.end(e2));
|
|
20400
21400
|
append($$anchor, fragment);
|
|
20401
21401
|
pop();
|
|
20402
21402
|
}
|
|
@@ -20508,10 +21508,10 @@ function Layout($$anchor, $$props) {
|
|
|
20508
21508
|
append($$anchor, div);
|
|
20509
21509
|
pop();
|
|
20510
21510
|
}
|
|
20511
|
-
const handleChange = (
|
|
21511
|
+
const handleChange = (e2, checked, $$props) => {
|
|
20512
21512
|
var _a2;
|
|
20513
21513
|
__haptic();
|
|
20514
|
-
const newValue =
|
|
21514
|
+
const newValue = e2.target.checked;
|
|
20515
21515
|
checked(newValue);
|
|
20516
21516
|
(_a2 = $$props.onchange) == null ? void 0 : _a2.call($$props, newValue);
|
|
20517
21517
|
};
|
|
@@ -20570,7 +21570,7 @@ function ToolbarMenu($$anchor, $$props) {
|
|
|
20570
21570
|
get icon() {
|
|
20571
21571
|
return CU;
|
|
20572
21572
|
},
|
|
20573
|
-
subtitle: "1.0.0-beta.
|
|
21573
|
+
subtitle: "1.0.0-beta.6"
|
|
20574
21574
|
});
|
|
20575
21575
|
var node_1 = sibling(node, 2);
|
|
20576
21576
|
{
|
|
@@ -20754,7 +21754,7 @@ function Message($$anchor, $$props) {
|
|
|
20754
21754
|
var div = root$3();
|
|
20755
21755
|
var div_1 = child(div);
|
|
20756
21756
|
var div_2 = child(div_1);
|
|
20757
|
-
div_2.__input = (
|
|
21757
|
+
div_2.__input = (e2) => message.handleInput(e2);
|
|
20758
21758
|
bind_this(div_2, ($$value) => message.element = $$value, () => message == null ? void 0 : message.element);
|
|
20759
21759
|
var div_3 = sibling(div_2, 2);
|
|
20760
21760
|
var div_4 = child(div_3);
|
|
@@ -21058,8 +22058,8 @@ function Picker($$anchor, $$props) {
|
|
|
21058
22058
|
class: "fubi-picker z-[102] w-[276px] rounded-12 bg-neutral-800 backdrop-blur-sm glass-shadow rounded-[12px] p-4 superellipse shadow-xl",
|
|
21059
22059
|
sideOffset: 8,
|
|
21060
22060
|
align: "start",
|
|
21061
|
-
onOpenAutoFocus: (
|
|
21062
|
-
onCloseAutoFocus: (
|
|
22061
|
+
onOpenAutoFocus: (e2) => e2.preventDefault(),
|
|
22062
|
+
onCloseAutoFocus: (e2) => e2.preventDefault(),
|
|
21063
22063
|
children: ($$anchor8, $$slotProps3) => {
|
|
21064
22064
|
var fragment_4 = comment();
|
|
21065
22065
|
var node_4 = first_child(fragment_4);
|