@raphy-js/raph 1.0.1-dev.20 → 1.0.1-dev.25
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/{core-CyilRD7s.js → core-CClhT8WR.js} +389 -400
- package/dist/core-cPQWYD4K.cjs +1 -0
- package/dist/debug/api/Raph.cjs +1 -1
- package/dist/debug/api/Raph.js +46 -47
- package/dist/debug/api/RaphFacadeSession.cjs +1 -1
- package/dist/debug/api/RaphFacadeSession.js +85 -89
- package/dist/debug/api/RaphReactivityInstance.cjs +1 -1
- package/dist/debug/api/RaphReactivityInstance.js +27 -30
- package/dist/debug/path/DataPath.cjs +1 -1
- package/dist/debug/path/DataPath.js +198 -202
- package/dist/debug/path/PathRouter.cjs +1 -1
- package/dist/debug/path/PathRouter.js +44 -50
- package/dist/debug/path/RaphKernel.cjs +1 -1
- package/dist/debug/path/RaphKernel.js +257 -228
- package/dist/debug/path/data-path.utils.cjs +1 -1
- package/dist/debug/path/data-path.utils.js +41 -41
- package/dist/debug/path/derived/DerivedRegistry.cjs +1 -1
- package/dist/debug/path/derived/DerivedRegistry.js +52 -66
- package/dist/debug/path/derived/RaphDerivedHandle.cjs +1 -1
- package/dist/debug/path/derived/RaphDerivedHandle.js +19 -22
- package/dist/debug/path/derived/derived-collection.utils.cjs +1 -1
- package/dist/debug/path/derived/derived-collection.utils.js +70 -70
- package/dist/debug/path/meta/MetaController.cjs +1 -1
- package/dist/debug/path/meta/MetaController.js +57 -65
- package/dist/debug/path/meta/RaphMeta.cjs +1 -1
- package/dist/debug/path/meta/RaphMeta.js +26 -32
- package/dist/debug/path/meta/RaphMetaStore.cjs +1 -1
- package/dist/debug/path/meta/RaphMetaStore.js +24 -30
- package/dist/debug/path/storage/AdapterPathStore.cjs +1 -1
- package/dist/debug/path/storage/AdapterPathStore.js +49 -54
- package/dist/debug/path/storage/DefaultDataAdapter.cjs +1 -1
- package/dist/debug/path/storage/DefaultDataAdapter.js +46 -56
- package/dist/debug/path/storage/PathEventHub.cjs +1 -1
- package/dist/debug/path/storage/PathEventHub.js +74 -61
- package/dist/debug/path/storage/PathStore.cjs +1 -1
- package/dist/debug/path/storage/PathStore.js +89 -99
- package/dist/debug/path/storage/createDataDraft.cjs +1 -1
- package/dist/debug/path/storage/createDataDraft.js +24 -28
- package/dist/debug/reactivity/disposal.cjs +1 -0
- package/dist/debug/reactivity/disposal.js +32 -0
- package/dist/debug/reactivity/engine.cjs +1 -1
- package/dist/debug/reactivity/engine.js +787 -392
- package/dist/debug/reactivity/reactive-object.cjs +1 -1
- package/dist/debug/reactivity/reactive-object.js +81 -96
- package/dist/debug/reactivity/scope.cjs +1 -1
- package/dist/debug/reactivity/scope.js +221 -117
- package/dist/debug/reactivity/watch.cjs +1 -1
- package/dist/debug/reactivity/watch.js +1 -1
- package/dist/debug/runtime/RaphRuntime.cjs +1 -1
- package/dist/debug/runtime/RaphRuntime.js +764 -411
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -1
- package/dist/debug/runtime/diagnostics/RaphDebug.js +90 -100
- package/dist/debug/runtime/ownership/RaphEffectScope.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphEffectScope.js +215 -82
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphNode.js +595 -136
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphScope.js +203 -68
- package/dist/debug/runtime/phases/RaphFrameLoop.cjs +1 -1
- package/dist/debug/runtime/phases/RaphFrameLoop.js +13 -17
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -1
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +618 -357
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.cjs +1 -0
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.js +176 -0
- package/dist/debug/runtime/phases/RaphPhaseWatch.cjs +1 -0
- package/dist/debug/runtime/phases/RaphPhaseWatch.js +20 -0
- package/dist/debug/runtime/reactivity/PathHandle.cjs +1 -1
- package/dist/debug/runtime/reactivity/PathHandle.js +50 -60
- package/dist/debug/runtime/reactivity/RaphMetaSource.cjs +1 -1
- package/dist/debug/runtime/reactivity/RaphMetaSource.js +28 -32
- package/dist/debug/runtime/reactivity/RaphSelector.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphSelector.js +503 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.cjs +1 -1
- package/dist/debug/runtime/reactivity/RaphWorkGraph.js +541 -379
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -1
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +484 -90
- package/dist/debug/runtime/reactivity/RuntimeWatch.cjs +1 -1
- package/dist/debug/runtime/reactivity/RuntimeWatch.js +33 -44
- package/dist/debug/runtime/reactivity/disposal-sweep.utils.cjs +1 -0
- package/dist/debug/runtime/reactivity/disposal-sweep.utils.js +42 -0
- package/dist/entrypoints/runtime.d.ts +2 -1
- package/dist/machine-testing.cjs +1 -1
- package/dist/machine-testing.js +1 -1
- package/dist/machine.cjs +1 -1
- package/dist/machine.js +216 -231
- package/dist/path/RaphKernel.d.ts +24 -0
- package/dist/path/storage/PathEventHub.d.ts +14 -0
- package/dist/path/storage/PathStore.d.ts +4 -4
- package/dist/reactivity/disposal.d.ts +14 -0
- package/dist/reactivity/engine.d.ts +177 -4
- package/dist/reactivity/scope.d.ts +108 -30
- package/dist/runtime/RaphRuntime.d.ts +236 -17
- package/dist/runtime/ownership/RaphEffectScope.d.ts +70 -1
- package/dist/runtime/ownership/RaphNode.d.ts +276 -6
- package/dist/runtime/ownership/RaphScope.d.ts +144 -14
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +202 -28
- package/dist/runtime/phases/RaphPhaseTaskRecord.d.ts +195 -0
- package/dist/runtime/phases/RaphPhaseWatch.d.ts +22 -0
- package/dist/runtime/phases/phase.types.d.ts +83 -4
- package/dist/runtime/reactivity/RaphSelector.d.ts +338 -0
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +163 -25
- package/dist/runtime/reactivity/RuntimeReactivity.d.ts +258 -10
- package/dist/runtime/reactivity/RuntimeWatch.d.ts +8 -8
- package/dist/runtime/reactivity/disposal-sweep.utils.d.ts +19 -0
- package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +48 -3
- package/package.json +9 -1
- package/dist/core-ugchZNqC.cjs +0 -1
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { parseDataPath as p } from "./data-path.utils.js";
|
|
2
|
+
import { DataPath as B } from "./DataPath.js";
|
|
3
|
+
import { validateFullFilter as I, cloneMaterializedValue as M, validateFullCollection as E, collectionIndex as w, collectionError as D, indexesAreStale as x, validateIncrementalCollection as F, collectionKeys as b, keyedPath as C, filterError as R, validateIncrementalFilter as K } from "./derived/derived-collection.utils.js";
|
|
4
|
+
import { DerivedRegistry as O } from "./derived/DerivedRegistry.js";
|
|
5
|
+
import { RaphDerivedHandle as S, RaphDerivedTargetWriteError as T } from "./derived/RaphDerivedHandle.js";
|
|
6
|
+
import { MetaController as W } from "./meta/MetaController.js";
|
|
7
|
+
import { AdapterPathStore as z } from "./storage/AdapterPathStore.js";
|
|
8
|
+
import { DefaultDataAdapter as q } from "./storage/DefaultDataAdapter.js";
|
|
9
|
+
import { PathStore as N } from "./storage/PathStore.js";
|
|
10
|
+
class P {
|
|
11
|
+
// Формирует локальный id для Kernel без явно заданного имени.
|
|
12
|
+
static _kernelCounter = 0;
|
|
13
|
+
// Публикует стабильную identity data/meta owner.
|
|
14
|
+
id;
|
|
15
|
+
// Лениво создают независимые data, derived, runtime и metadata controllers.
|
|
16
|
+
_paths;
|
|
17
|
+
_derivedController;
|
|
18
|
+
_runtimes;
|
|
19
|
+
_metaController;
|
|
20
|
+
// Что читает `_openSoleRuntimeBatch()`: единственный присоединённый Runtime
|
|
21
|
+
// и владелец batch boundary встроенного store. Первое пусто, пока Runtime
|
|
22
|
+
// нет либо их несколько; второе — у store над adapter и после dispose.
|
|
23
|
+
_soleRuntime;
|
|
24
|
+
_pathBatch;
|
|
25
|
+
// Защищают batch stabilization и записи в derived targets.
|
|
26
|
+
_batchDepth = 0;
|
|
27
|
+
_runtimeMutationDepth = 0;
|
|
28
|
+
_stabilizing = !1;
|
|
29
|
+
_derivedWriteDepth = 0;
|
|
14
30
|
/**
|
|
15
31
|
* Создаёт data/meta owner с независимым lifecycle и derived registry.
|
|
16
32
|
*/
|
|
17
33
|
constructor(e = {}) {
|
|
18
|
-
|
|
19
|
-
y(this, "id");
|
|
20
|
-
// Лениво создают независимые data, derived, runtime и metadata controllers.
|
|
21
|
-
y(this, "_paths");
|
|
22
|
-
y(this, "_derivedController");
|
|
23
|
-
y(this, "_runtimes");
|
|
24
|
-
y(this, "_metaController");
|
|
25
|
-
// Защищают batch stabilization и записи в derived targets.
|
|
26
|
-
y(this, "_batchDepth", 0);
|
|
27
|
-
y(this, "_runtimeMutationDepth", 0);
|
|
28
|
-
y(this, "_stabilizing", !1);
|
|
29
|
-
y(this, "_derivedWriteDepth", 0);
|
|
30
|
-
if (this.id = e.id ?? `kernel-${M._kernelCounter++}`, e.adapter !== void 0) {
|
|
34
|
+
if (this.id = e.id ?? `kernel-${P._kernelCounter++}`, e.adapter !== void 0) {
|
|
31
35
|
if (e.initial !== void 0 || e.adapterOptions !== void 0)
|
|
32
36
|
throw new TypeError("[Raph] A custom adapter cannot be combined with initial or adapterOptions.");
|
|
33
|
-
this._paths = new
|
|
37
|
+
this._paths = new z(e.adapter);
|
|
34
38
|
} else if (e.adapterOptions !== void 0)
|
|
35
|
-
this._paths = new
|
|
39
|
+
this._paths = new z(new q(
|
|
36
40
|
e.initial,
|
|
37
41
|
e.adapterOptions
|
|
38
42
|
));
|
|
39
43
|
else {
|
|
40
|
-
const t = this._paths = new
|
|
41
|
-
e.initial !== void 0 && t.set("", e.initial);
|
|
44
|
+
const t = this._paths = new N();
|
|
45
|
+
this._pathBatch = t._batchHub, e.initial !== void 0 && t.set("", e.initial);
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
@@ -51,12 +55,11 @@ const M = class M {
|
|
|
51
55
|
* Формирует диагностический снимок materialized derived registry.
|
|
52
56
|
*/
|
|
53
57
|
getDerivedSnapshot() {
|
|
54
|
-
var t;
|
|
55
58
|
const e = this._derivedController;
|
|
56
59
|
return {
|
|
57
|
-
registrations:
|
|
58
|
-
errors: [...
|
|
59
|
-
pending:
|
|
60
|
+
registrations: e?.size ?? 0,
|
|
61
|
+
errors: [...e?.values() ?? []].filter((t) => t.status === "error").length,
|
|
62
|
+
pending: e?.pending?.size ?? 0,
|
|
60
63
|
stabilizing: this._stabilizing
|
|
61
64
|
};
|
|
62
65
|
}
|
|
@@ -82,14 +85,13 @@ const M = class M {
|
|
|
82
85
|
* Записывает значение и публикует соответствующее изменение.
|
|
83
86
|
*/
|
|
84
87
|
set(e, t, r) {
|
|
85
|
-
var s;
|
|
86
88
|
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
87
89
|
this._withAttachedRuntimeBoundary(() => this.set(e, t, r));
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
92
|
this._assertWritablePath("set", e, t, r);
|
|
91
93
|
const i = this._store;
|
|
92
|
-
if ((
|
|
94
|
+
if ((this._metaController?.size ?? 0) === 0) {
|
|
93
95
|
if (this._derivedController === void 0) {
|
|
94
96
|
i.set(e, t, r);
|
|
95
97
|
return;
|
|
@@ -105,14 +107,13 @@ const M = class M {
|
|
|
105
107
|
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
106
108
|
*/
|
|
107
109
|
merge(e, t, r) {
|
|
108
|
-
var s;
|
|
109
110
|
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
110
111
|
this._withAttachedRuntimeBoundary(() => this.merge(e, t, r));
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
this._assertWritablePath("merge", e, t, r);
|
|
114
115
|
const i = this._store;
|
|
115
|
-
if ((
|
|
116
|
+
if ((this._metaController?.size ?? 0) === 0) {
|
|
116
117
|
if (this._derivedController === void 0) {
|
|
117
118
|
i.merge(e, t, r);
|
|
118
119
|
return;
|
|
@@ -128,14 +129,13 @@ const M = class M {
|
|
|
128
129
|
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
129
130
|
*/
|
|
130
131
|
delete(e, t) {
|
|
131
|
-
var i;
|
|
132
132
|
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
133
133
|
this._withAttachedRuntimeBoundary(() => this.delete(e, t));
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
this._assertWritablePath("delete", e, void 0, t);
|
|
137
137
|
const r = this._store;
|
|
138
|
-
if ((
|
|
138
|
+
if ((this._metaController?.size ?? 0) === 0) {
|
|
139
139
|
if (this._derivedController === void 0) {
|
|
140
140
|
r.delete(e, t);
|
|
141
141
|
return;
|
|
@@ -145,30 +145,72 @@ const M = class M {
|
|
|
145
145
|
}
|
|
146
146
|
r.has(e, t) && this._mutateWithMetaLifecycle(() => {
|
|
147
147
|
this._derivedController === void 0 ? r.delete(e, t) : this._mutateDerived(r, "delete", e, void 0, t);
|
|
148
|
-
const
|
|
149
|
-
this._metaController.deleteSubtree(
|
|
148
|
+
const i = this._metaPath(e, t);
|
|
149
|
+
this._metaController.deleteSubtree(i, "owner-delete"), this._pruneMissingMetaOwners(i, "owner-delete");
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Выполняет операцию в общей синхронной batch boundary.
|
|
154
154
|
*/
|
|
155
155
|
batch(e) {
|
|
156
|
-
var o;
|
|
157
156
|
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0)
|
|
158
157
|
return this._withAttachedRuntimeBoundary(() => this.batch(e));
|
|
159
158
|
const t = this._store;
|
|
160
|
-
if (this._derivedController === void 0 && !
|
|
159
|
+
if (this._derivedController === void 0 && !this._metaController?.hasWatchers)
|
|
161
160
|
return t.batch(e);
|
|
162
161
|
let r, i, s = !1;
|
|
163
162
|
try {
|
|
164
163
|
r = t.batch(() => this._runDerivedBatch(e));
|
|
165
|
-
} catch (
|
|
166
|
-
s = !0, i =
|
|
164
|
+
} catch (o) {
|
|
165
|
+
s = !0, i = o;
|
|
167
166
|
}
|
|
168
167
|
if (s)
|
|
169
168
|
throw i;
|
|
170
169
|
return r;
|
|
171
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Открывает то же, что `batch()`, для единственного присоединённого Runtime
|
|
173
|
+
* без closure операции и без массивов: границу этого Runtime и path batch.
|
|
174
|
+
* Возвращает владельца path batch, которого вызывающий передаёт в
|
|
175
|
+
* `_closeSoleRuntimeBatch()` после операции.
|
|
176
|
+
*
|
|
177
|
+
* Возвращает `undefined` и ничего не открывает в любом другом состоянии:
|
|
178
|
+
* Kernel разделяют несколько Runtime, граница Runtime уже открыта, есть
|
|
179
|
+
* derived handles либо metadata watchers, store построен над adapter. Тогда
|
|
180
|
+
* вызывающий исполняет `batch()`. Состояние читается при входе, как в
|
|
181
|
+
* `batch()`: то, что появилось во время операции, выход не меняет.
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
_openSoleRuntimeBatch(e) {
|
|
185
|
+
const t = this._pathBatch;
|
|
186
|
+
if (!(this._soleRuntime !== e || t === void 0 || this._runtimeMutationDepth !== 0 || this._derivedController !== void 0 || this._metaController?.hasWatchers === !0))
|
|
187
|
+
return this._runtimeMutationDepth++, e._beginKernelBatch?.(), t._openBatch(), t;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Закрывает границу, открытую `_openSoleRuntimeBatch()`, в порядке `batch()`:
|
|
191
|
+
* публикация path events, затем граница Runtime. Бросает то же, что бросил бы
|
|
192
|
+
* `batch()` с этой операцией; после успешного выхода возвращает управление.
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
_closeSoleRuntimeBatch(e, t, r, i) {
|
|
196
|
+
let s = r, o = i;
|
|
197
|
+
try {
|
|
198
|
+
t._closeBatch(r, i);
|
|
199
|
+
} catch (n) {
|
|
200
|
+
s = !0, o = n;
|
|
201
|
+
}
|
|
202
|
+
this._runtimeMutationDepth--;
|
|
203
|
+
try {
|
|
204
|
+
e._endKernelBatch?.();
|
|
205
|
+
} catch (n) {
|
|
206
|
+
throw s ? new AggregateError(
|
|
207
|
+
[o, n],
|
|
208
|
+
"[Raph] Kernel mutation and Runtime publication failed."
|
|
209
|
+
) : n;
|
|
210
|
+
}
|
|
211
|
+
if (s)
|
|
212
|
+
throw o;
|
|
213
|
+
}
|
|
172
214
|
/**
|
|
173
215
|
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
174
216
|
*/
|
|
@@ -179,15 +221,13 @@ const M = class M {
|
|
|
179
221
|
* Возвращает metadata указанного data-owner.
|
|
180
222
|
*/
|
|
181
223
|
getMeta(e, t, r) {
|
|
182
|
-
|
|
183
|
-
return this._store, t !== void 0 && this._assertMetaNamespace(t), (i = this._metaController) == null ? void 0 : i.get(this._metaPath(e, r), t);
|
|
224
|
+
return this._store, t !== void 0 && this._assertMetaNamespace(t), this._metaController?.get(this._metaPath(e, r), t);
|
|
184
225
|
}
|
|
185
226
|
/**
|
|
186
227
|
* Проверяет наличие metadata у указанного data-owner.
|
|
187
228
|
*/
|
|
188
229
|
hasMeta(e, t, r) {
|
|
189
|
-
|
|
190
|
-
return this._store, t !== void 0 && this._assertMetaNamespace(t), ((i = this._metaController) == null ? void 0 : i.has(this._metaPath(e, r), t)) ?? !1;
|
|
230
|
+
return this._store, t !== void 0 && this._assertMetaNamespace(t), this._metaController?.has(this._metaPath(e, r), t) ?? !1;
|
|
191
231
|
}
|
|
192
232
|
/**
|
|
193
233
|
* Записывает metadata указанного data-owner.
|
|
@@ -217,14 +257,13 @@ const M = class M {
|
|
|
217
257
|
* Удаляет metadata указанного data-owner.
|
|
218
258
|
*/
|
|
219
259
|
deleteMeta(e, t, r) {
|
|
220
|
-
var s;
|
|
221
260
|
if (this._runtimeMutationDepth === 0 && this._runtimes !== void 0) {
|
|
222
261
|
this._withAttachedRuntimeBoundary(() => this.deleteMeta(e, t, r));
|
|
223
262
|
return;
|
|
224
263
|
}
|
|
225
264
|
t !== void 0 && this._assertMetaNamespace(t);
|
|
226
265
|
const i = this._exactMetaPath(e, r);
|
|
227
|
-
|
|
266
|
+
this._metaController?.delete(i, t, r);
|
|
228
267
|
}
|
|
229
268
|
/**
|
|
230
269
|
* Подписывает runtime adapter на metadata-события Kernel.
|
|
@@ -237,33 +276,34 @@ const M = class M {
|
|
|
237
276
|
* Создаёт управляемое derived-представление source path в target path.
|
|
238
277
|
*/
|
|
239
278
|
derive(e) {
|
|
240
|
-
var d, u, m;
|
|
241
279
|
if (this._store, e.strategy !== void 0 && e.strategy.kind !== "full" && e.strategy.kind !== "collection-by-key" && e.strategy.kind !== "filter-by-key")
|
|
242
280
|
throw new Error(`[Raph] Unsupported derived strategy "${String(e.strategy.kind)}".`);
|
|
243
|
-
if (e.id !== void 0 &&
|
|
281
|
+
if (e.id !== void 0 && this._derivedController?.has(e.id))
|
|
244
282
|
throw new Error(`[Raph] Duplicate derived id "${e.id}".`);
|
|
245
|
-
const t =
|
|
246
|
-
if (
|
|
283
|
+
const t = p(e.from), r = p(e.to);
|
|
284
|
+
if (A(t, r))
|
|
247
285
|
throw new Error("[Raph] Derived source and target must not overlap.");
|
|
248
|
-
const i = this._derivedController ?? new
|
|
286
|
+
const i = this._derivedController ?? new O(), s = e.id ?? i.nextId(), o = {
|
|
249
287
|
...e,
|
|
250
288
|
from: t.canonical,
|
|
251
289
|
to: r.canonical
|
|
252
|
-
},
|
|
253
|
-
this._derivedController = i, i.register(
|
|
290
|
+
}, n = new S(this, s, o), c = e.strategy?.kind === "collection-by-key" || e.strategy?.kind === "filter-by-key" ? e.strategy : void 0;
|
|
291
|
+
this._derivedController = i, i.register(n, t, c);
|
|
254
292
|
try {
|
|
255
|
-
e.immediate !== !1 &&
|
|
256
|
-
} catch (
|
|
257
|
-
throw this._removeDerived(
|
|
293
|
+
e.immediate !== !1 && n.recompute();
|
|
294
|
+
} catch (l) {
|
|
295
|
+
throw this._removeDerived(n), n._disposeFromKernel(), l;
|
|
258
296
|
}
|
|
259
|
-
return
|
|
297
|
+
return n;
|
|
260
298
|
}
|
|
261
299
|
/**
|
|
262
300
|
* Регистрирует runtime, разделяющий этот Kernel.
|
|
263
301
|
* @internal
|
|
264
302
|
*/
|
|
265
303
|
_attachRuntime(e) {
|
|
266
|
-
this._store
|
|
304
|
+
this._store;
|
|
305
|
+
const t = this._runtimes ??= /* @__PURE__ */ new Set();
|
|
306
|
+
t.add(e), this._soleRuntime = t.size === 1 ? e : void 0;
|
|
267
307
|
}
|
|
268
308
|
/**
|
|
269
309
|
* Удаляет runtime из shared Kernel registry.
|
|
@@ -271,24 +311,23 @@ const M = class M {
|
|
|
271
311
|
*/
|
|
272
312
|
_detachRuntime(e) {
|
|
273
313
|
const t = this._runtimes;
|
|
274
|
-
t !== void 0 && (t.delete(e), t.size === 0 && (this._runtimes = void 0));
|
|
314
|
+
t !== void 0 && (t.delete(e), t.size === 0 && (this._runtimes = void 0), this._soleRuntime = t.size === 1 ? t.values().next().value : void 0);
|
|
275
315
|
}
|
|
276
316
|
/**
|
|
277
317
|
* Освобождает shared runtimes, derived handles и data/meta state Kernel.
|
|
278
318
|
*/
|
|
279
319
|
dispose() {
|
|
280
|
-
var t, r;
|
|
281
320
|
if (this._paths === void 0)
|
|
282
321
|
return;
|
|
283
322
|
const e = [];
|
|
284
323
|
if (this._runtimes !== void 0)
|
|
285
|
-
for (const
|
|
324
|
+
for (const t of [...this._runtimes])
|
|
286
325
|
try {
|
|
287
|
-
|
|
288
|
-
} catch (
|
|
289
|
-
e.push(
|
|
326
|
+
t.dispose();
|
|
327
|
+
} catch (r) {
|
|
328
|
+
e.push(r);
|
|
290
329
|
}
|
|
291
|
-
if (this._runtimes = void 0,
|
|
330
|
+
if (this._runtimes = void 0, this._soleRuntime = void 0, this._derivedController?.dispose(), this._derivedController = void 0, this._metaController?.dispose(), this._metaController = void 0, this._paths = void 0, this._pathBatch = void 0, e.length === 1)
|
|
292
331
|
throw e[0];
|
|
293
332
|
if (e.length > 1)
|
|
294
333
|
throw new AggregateError(e, `[Raph] Kernel "${this.id}" disposal failed.`);
|
|
@@ -320,15 +359,14 @@ const M = class M {
|
|
|
320
359
|
throw new Error(`[Raph] Kernel "${this.id}" is disposed.`);
|
|
321
360
|
}
|
|
322
361
|
get _metadata() {
|
|
323
|
-
return this._store, this._metaController
|
|
362
|
+
return this._store, this._metaController ??= new W(
|
|
324
363
|
this,
|
|
325
364
|
(e) => this.has(e),
|
|
326
365
|
() => this._batchDepth !== 0 || this._stabilizing
|
|
327
|
-
)
|
|
366
|
+
);
|
|
328
367
|
}
|
|
329
368
|
/** Keeps every attached Runtime quiescent until one Kernel publication completes. */
|
|
330
369
|
_withAttachedRuntimeBoundary(e) {
|
|
331
|
-
var h, l, d;
|
|
332
370
|
const t = this._runtimes === void 0 ? [] : [...this._runtimes];
|
|
333
371
|
if (t.length === 0)
|
|
334
372
|
return e();
|
|
@@ -336,22 +374,22 @@ const M = class M {
|
|
|
336
374
|
let s, o = !1;
|
|
337
375
|
this._runtimeMutationDepth++;
|
|
338
376
|
try {
|
|
339
|
-
for (const
|
|
340
|
-
|
|
377
|
+
for (const n of t)
|
|
378
|
+
n._beginKernelBatch?.(), r.push(n);
|
|
341
379
|
try {
|
|
342
380
|
s = e();
|
|
343
|
-
} catch (
|
|
344
|
-
o = !0, i.push(
|
|
381
|
+
} catch (n) {
|
|
382
|
+
o = !0, i.push(n);
|
|
345
383
|
}
|
|
346
|
-
} catch (
|
|
347
|
-
o = !0, i.push(
|
|
384
|
+
} catch (n) {
|
|
385
|
+
o = !0, i.push(n);
|
|
348
386
|
} finally {
|
|
349
387
|
this._runtimeMutationDepth--;
|
|
350
|
-
for (let
|
|
388
|
+
for (let n = r.length - 1; n >= 0; n--)
|
|
351
389
|
try {
|
|
352
|
-
|
|
353
|
-
} catch (
|
|
354
|
-
i.push(
|
|
390
|
+
r[n]._endKernelBatch?.();
|
|
391
|
+
} catch (c) {
|
|
392
|
+
i.push(c);
|
|
355
393
|
}
|
|
356
394
|
}
|
|
357
395
|
if (i.length === 1)
|
|
@@ -367,14 +405,14 @@ const M = class M {
|
|
|
367
405
|
const s = this._derivedController;
|
|
368
406
|
if (s === void 0 || this._derivedWriteDepth !== 0)
|
|
369
407
|
return;
|
|
370
|
-
const o =
|
|
371
|
-
for (const
|
|
372
|
-
const
|
|
373
|
-
if (!
|
|
408
|
+
const o = p(t, i);
|
|
409
|
+
for (const n of s.values()) {
|
|
410
|
+
const c = p(n.options.to);
|
|
411
|
+
if (!A(o, c))
|
|
374
412
|
continue;
|
|
375
|
-
const
|
|
376
|
-
if (!(e === "merge" &&
|
|
377
|
-
throw new
|
|
413
|
+
const l = o.segments.length < c.segments.length;
|
|
414
|
+
if (!(e === "merge" && l && !$(r, c.segments[o.segments.length])))
|
|
415
|
+
throw new T(o.canonical);
|
|
378
416
|
}
|
|
379
417
|
}
|
|
380
418
|
_writeDerivedTarget(e, t) {
|
|
@@ -386,17 +424,16 @@ const M = class M {
|
|
|
386
424
|
}
|
|
387
425
|
}
|
|
388
426
|
_mutateDerived(e, t, r, i, s) {
|
|
389
|
-
const o =
|
|
427
|
+
const o = p(r, s);
|
|
390
428
|
t === "delete" && !e.has(r, s) || e.batch(() => {
|
|
391
429
|
t === "set" ? e.set(r, i, s) : t === "merge" ? e.merge(r, i, s) : e.delete(r, s), this._queueDerived(o), this._batchDepth === 0 && !this._stabilizing && this._stabilizeDerived();
|
|
392
430
|
});
|
|
393
431
|
}
|
|
394
432
|
_runDerivedBatch(e) {
|
|
395
|
-
|
|
396
|
-
let t = !1, r, i = !1, s, o = !1, h, l;
|
|
433
|
+
let t = !1, r, i = !1, s, o = !1, n, c;
|
|
397
434
|
this._batchDepth++;
|
|
398
435
|
try {
|
|
399
|
-
|
|
436
|
+
c = e();
|
|
400
437
|
} catch (m) {
|
|
401
438
|
t = !0, r = m;
|
|
402
439
|
} finally {
|
|
@@ -408,21 +445,21 @@ const M = class M {
|
|
|
408
445
|
i = !0, s = m;
|
|
409
446
|
}
|
|
410
447
|
try {
|
|
411
|
-
|
|
448
|
+
this._metaController?.publish();
|
|
412
449
|
} catch (m) {
|
|
413
|
-
o = !0,
|
|
450
|
+
o = !0, n = m;
|
|
414
451
|
}
|
|
415
452
|
}
|
|
416
453
|
}
|
|
417
|
-
const
|
|
418
|
-
if (t &&
|
|
454
|
+
const l = [];
|
|
455
|
+
if (t && l.push(r), i && l.push(s), o && l.push(n), l.length > 1)
|
|
419
456
|
throw new AggregateError(
|
|
420
|
-
|
|
457
|
+
l,
|
|
421
458
|
"[Raph] Kernel batch publication failed."
|
|
422
459
|
);
|
|
423
|
-
if (
|
|
424
|
-
throw
|
|
425
|
-
return
|
|
460
|
+
if (l.length === 1)
|
|
461
|
+
throw l[0];
|
|
462
|
+
return c;
|
|
426
463
|
}
|
|
427
464
|
_mutateWithMetaLifecycle(e) {
|
|
428
465
|
if (this._batchDepth !== 0 || this._stabilizing) {
|
|
@@ -432,11 +469,10 @@ const M = class M {
|
|
|
432
469
|
this.batch(e);
|
|
433
470
|
}
|
|
434
471
|
_pruneMissingMetaOwners(e, t, r) {
|
|
435
|
-
|
|
436
|
-
(i = this._metaController) == null || i.pruneMissing(this._metaPath(e, r), t);
|
|
472
|
+
this._metaController?.pruneMissing(this._metaPath(e, r), t);
|
|
437
473
|
}
|
|
438
474
|
_metaPath(e, t) {
|
|
439
|
-
return
|
|
475
|
+
return B.from(e, t);
|
|
440
476
|
}
|
|
441
477
|
_exactMetaPath(e, t) {
|
|
442
478
|
const r = this._metaPath(e, t);
|
|
@@ -453,19 +489,17 @@ const M = class M {
|
|
|
453
489
|
throw new Error(`[RaphMeta] Owner data path does not exist: "${e}".`);
|
|
454
490
|
}
|
|
455
491
|
_queueDerived(e) {
|
|
456
|
-
|
|
457
|
-
(t = this._derivedController) == null || t.queue(e);
|
|
492
|
+
this._derivedController?.queue(e);
|
|
458
493
|
}
|
|
459
494
|
_queueDerivedReplacement(e, t) {
|
|
460
|
-
|
|
461
|
-
(r = this._derivedController) == null || r.queueReplacement(e, t);
|
|
495
|
+
this._derivedController?.queueReplacement(e, t);
|
|
462
496
|
}
|
|
463
497
|
_replaceDerivedTarget(e, t, r) {
|
|
464
|
-
const i =
|
|
498
|
+
const i = p(e);
|
|
465
499
|
this._store.set(i.canonical, t), this._queueDerivedReplacement(i, r);
|
|
466
500
|
}
|
|
467
501
|
_stabilizeDerived() {
|
|
468
|
-
const e = this._derivedController, t = e
|
|
502
|
+
const e = this._derivedController, t = e?.pending;
|
|
469
503
|
if (t === void 0 || t.size === 0)
|
|
470
504
|
return;
|
|
471
505
|
this._stabilizing = !0;
|
|
@@ -486,12 +520,11 @@ const M = class M {
|
|
|
486
520
|
} catch (i) {
|
|
487
521
|
throw t.clear(), i;
|
|
488
522
|
} finally {
|
|
489
|
-
this._stabilizing = !1, e
|
|
523
|
+
this._stabilizing = !1, e?.clearPendingIfEmpty();
|
|
490
524
|
}
|
|
491
525
|
}
|
|
492
526
|
_recomputePendingDerived(e) {
|
|
493
|
-
|
|
494
|
-
const t = (r = this._derivedController) == null ? void 0 : r.state(e);
|
|
527
|
+
const t = this._derivedController?.state(e);
|
|
495
528
|
if (t === void 0 || !t.initialized || t.full) {
|
|
496
529
|
this._recomputeDerivedFull(e);
|
|
497
530
|
return;
|
|
@@ -499,61 +532,60 @@ const M = class M {
|
|
|
499
532
|
t.kind === "filter-by-key" ? this._recomputeDerivedFilter(e, t) : this._recomputeDerivedCollection(e, t);
|
|
500
533
|
}
|
|
501
534
|
_recomputeDerivedFull(e) {
|
|
502
|
-
|
|
503
|
-
const t = (l = this._derivedController) == null ? void 0 : l.state(e);
|
|
535
|
+
const t = this._derivedController?.state(e);
|
|
504
536
|
t !== void 0 && (t.full = !0);
|
|
505
537
|
const r = this.get(e.options.from), i = e.options.compute(r);
|
|
506
|
-
let s = i, o,
|
|
507
|
-
t !== void 0 && (r === void 0 && (i === void 0 || Array.isArray(i) && i.length === 0) ? (o = /* @__PURE__ */ new Map(),
|
|
538
|
+
let s = i, o, n;
|
|
539
|
+
t !== void 0 && (r === void 0 && (i === void 0 || Array.isArray(i) && i.length === 0) ? (o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map()) : (t.kind === "filter-by-key" ? (I(e.id, t.key, r, i), s = M(i)) : E(e.id, t.key, r, i), o = w(r, t.key, "source"), n = w(s, t.key, "output"))), this._writeDerivedTarget(e.options.to, s), t !== void 0 && (t.sourceIndex = o, t.targetIndex = n, t.initialized = !0, t.full = !1, t.keys.clear());
|
|
508
540
|
}
|
|
509
541
|
_recomputeDerivedCollection(e, t) {
|
|
510
542
|
t.full = !0;
|
|
511
543
|
const r = this.get(e.options.from), i = this.get(e.options.to);
|
|
512
544
|
if (!Array.isArray(r) || !Array.isArray(i))
|
|
513
|
-
throw
|
|
514
|
-
(t.sourceIndex === void 0 ||
|
|
545
|
+
throw D(e.id, "requires array source and target");
|
|
546
|
+
(t.sourceIndex === void 0 || x(r, t.key, t.sourceIndex, t.keys)) && (t.sourceIndex = w(r, t.key, "source"));
|
|
515
547
|
const s = t.targetIndex;
|
|
516
548
|
if (s === void 0)
|
|
517
|
-
throw
|
|
518
|
-
const o = [],
|
|
519
|
-
for (const
|
|
520
|
-
const
|
|
521
|
-
|
|
549
|
+
throw D(e.id, "has no materialized target index");
|
|
550
|
+
const o = [], n = [];
|
|
551
|
+
for (const h of t.keys) {
|
|
552
|
+
const _ = t.sourceIndex.get(h);
|
|
553
|
+
_ === void 0 ? n.push(h) : o.push({ key: h, index: _, item: r[_] });
|
|
522
554
|
}
|
|
523
|
-
o.sort((
|
|
524
|
-
const
|
|
525
|
-
|
|
555
|
+
o.sort((h, _) => h.index - _.index);
|
|
556
|
+
const c = o.map((h) => h.item), l = c.length === 0 ? [] : e.options.compute(c);
|
|
557
|
+
F(
|
|
526
558
|
e.id,
|
|
527
559
|
t.key,
|
|
528
|
-
o.map((
|
|
529
|
-
|
|
560
|
+
o.map((h) => h.key),
|
|
561
|
+
l
|
|
530
562
|
);
|
|
531
|
-
const
|
|
532
|
-
if (
|
|
533
|
-
const
|
|
534
|
-
for (let
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
for (const [
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
for (let
|
|
542
|
-
const v =
|
|
563
|
+
const m = l;
|
|
564
|
+
if (n.length !== 0 || o.some((h) => !s.has(h.key))) {
|
|
565
|
+
const h = /* @__PURE__ */ new Map();
|
|
566
|
+
for (let u = 0; u < o.length; u++)
|
|
567
|
+
h.set(o[u].key, m[u]);
|
|
568
|
+
const _ = /* @__PURE__ */ new Map();
|
|
569
|
+
for (const [u, v] of s)
|
|
570
|
+
_.set(u, i[v]);
|
|
571
|
+
const a = b(r, t.key, "source"), d = [];
|
|
572
|
+
d.length = a.length;
|
|
573
|
+
for (let u = 0; u < a.length; u++) {
|
|
574
|
+
const v = a[u];
|
|
543
575
|
if (v === void 0)
|
|
544
576
|
continue;
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
547
|
-
throw
|
|
548
|
-
|
|
577
|
+
const k = h.has(v) ? h.get(v) : _.get(v);
|
|
578
|
+
if (k === void 0)
|
|
579
|
+
throw D(e.id, `is missing target item for key "${String(v)}"`);
|
|
580
|
+
d[u] = k;
|
|
549
581
|
}
|
|
550
|
-
const
|
|
551
|
-
this._replaceDerivedTarget(e.options.to,
|
|
582
|
+
const g = w(d, t.key, "target");
|
|
583
|
+
this._replaceDerivedTarget(e.options.to, d, t.keys), t.targetIndex = g;
|
|
552
584
|
} else
|
|
553
|
-
for (let
|
|
585
|
+
for (let h = 0; h < o.length; h++)
|
|
554
586
|
this._writeDerivedTarget(
|
|
555
|
-
|
|
556
|
-
|
|
587
|
+
C(e.options.to, t.key, o[h].key),
|
|
588
|
+
m[h]
|
|
557
589
|
);
|
|
558
590
|
t.keys.clear(), t.full = !1;
|
|
559
591
|
}
|
|
@@ -561,127 +593,124 @@ const M = class M {
|
|
|
561
593
|
t.full = !0;
|
|
562
594
|
const r = this.get(e.options.from), i = this.get(e.options.to);
|
|
563
595
|
if (!Array.isArray(r) || !Array.isArray(i))
|
|
564
|
-
throw
|
|
565
|
-
(t.sourceIndex === void 0 ||
|
|
596
|
+
throw R(e.id, "requires array source and target");
|
|
597
|
+
(t.sourceIndex === void 0 || x(r, t.key, t.sourceIndex, t.keys)) && (t.sourceIndex = w(r, t.key, "source"));
|
|
566
598
|
const s = t.targetIndex;
|
|
567
599
|
if (s === void 0)
|
|
568
|
-
throw
|
|
600
|
+
throw R(e.id, "has no materialized target index");
|
|
569
601
|
const o = [];
|
|
570
|
-
for (const
|
|
571
|
-
const
|
|
572
|
-
|
|
602
|
+
for (const a of t.keys) {
|
|
603
|
+
const d = t.sourceIndex.get(a);
|
|
604
|
+
d !== void 0 && o.push({ key: a, index: d, item: r[d] });
|
|
573
605
|
}
|
|
574
|
-
o.sort((
|
|
575
|
-
const
|
|
606
|
+
o.sort((a, d) => a.index - d.index);
|
|
607
|
+
const n = o.map((a) => a.item), c = n.length === 0 ? [] : e.options.compute(n);
|
|
576
608
|
K(
|
|
577
609
|
e.id,
|
|
578
610
|
t.key,
|
|
579
|
-
o.map((
|
|
580
|
-
|
|
611
|
+
o.map((a) => a.key),
|
|
612
|
+
c
|
|
581
613
|
);
|
|
582
|
-
const
|
|
583
|
-
for (let
|
|
584
|
-
const
|
|
585
|
-
|
|
614
|
+
const l = /* @__PURE__ */ new Map(), m = c, y = b(m, t.key, "output");
|
|
615
|
+
for (let a = 0; a < y.length; a++) {
|
|
616
|
+
const d = y[a];
|
|
617
|
+
d !== void 0 && l.set(d, M(m[a]));
|
|
586
618
|
}
|
|
587
|
-
const
|
|
588
|
-
let
|
|
589
|
-
for (const
|
|
590
|
-
const
|
|
591
|
-
!
|
|
619
|
+
const h = /* @__PURE__ */ new Set();
|
|
620
|
+
let _ = !1;
|
|
621
|
+
for (const a of t.keys) {
|
|
622
|
+
const d = s.has(a), g = l.has(a);
|
|
623
|
+
!d && !g || (h.add(a), d !== g && (_ = !0));
|
|
592
624
|
}
|
|
593
|
-
if (
|
|
625
|
+
if (_ && t.keys.size === 1 && i.length === s.size && this._patchSingleFilterMembership(
|
|
594
626
|
e,
|
|
595
627
|
t,
|
|
596
628
|
i,
|
|
597
629
|
s,
|
|
598
|
-
|
|
599
|
-
|
|
630
|
+
l,
|
|
631
|
+
h
|
|
600
632
|
)) {
|
|
601
633
|
t.keys.clear(), t.full = !1;
|
|
602
634
|
return;
|
|
603
635
|
}
|
|
604
|
-
if (
|
|
605
|
-
const
|
|
606
|
-
for (const [
|
|
607
|
-
|
|
608
|
-
const
|
|
609
|
-
for (const
|
|
610
|
-
if (
|
|
611
|
-
if (t.keys.has(
|
|
612
|
-
|
|
636
|
+
if (_) {
|
|
637
|
+
const a = /* @__PURE__ */ new Map();
|
|
638
|
+
for (const [u, v] of s)
|
|
639
|
+
a.set(u, i[v]);
|
|
640
|
+
const d = [];
|
|
641
|
+
for (const u of b(r, t.key, "source"))
|
|
642
|
+
if (u !== void 0) {
|
|
643
|
+
if (t.keys.has(u)) {
|
|
644
|
+
l.has(u) && d.push(l.get(u));
|
|
613
645
|
continue;
|
|
614
646
|
}
|
|
615
|
-
|
|
647
|
+
a.has(u) && d.push(a.get(u));
|
|
616
648
|
}
|
|
617
|
-
const
|
|
618
|
-
this._replaceDerivedTarget(e.options.to,
|
|
649
|
+
const g = w(d, t.key, "target");
|
|
650
|
+
this._replaceDerivedTarget(e.options.to, d, h), t.targetIndex = g;
|
|
619
651
|
} else
|
|
620
|
-
for (const [
|
|
621
|
-
this._writeDerivedTarget(
|
|
652
|
+
for (const [a, d] of l)
|
|
653
|
+
this._writeDerivedTarget(C(e.options.to, t.key, a), d);
|
|
622
654
|
t.keys.clear(), t.full = !1;
|
|
623
655
|
}
|
|
624
656
|
_patchSingleFilterMembership(e, t, r, i, s, o) {
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
657
|
+
const n = t.sourceIndex;
|
|
658
|
+
if (n === void 0)
|
|
627
659
|
return !1;
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
660
|
+
const c = t.keys.values().next().value;
|
|
661
|
+
if (c === void 0)
|
|
630
662
|
return !1;
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
663
|
+
const l = i.get(c), m = s.has(c);
|
|
664
|
+
if (l !== void 0 === m)
|
|
633
665
|
return !1;
|
|
634
|
-
const
|
|
635
|
-
let
|
|
636
|
-
if (
|
|
637
|
-
|
|
666
|
+
const y = r.slice();
|
|
667
|
+
let h;
|
|
668
|
+
if (l !== void 0)
|
|
669
|
+
h = l, y.splice(h, 1);
|
|
638
670
|
else {
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
671
|
+
const _ = n.get(c);
|
|
672
|
+
if (_ === void 0)
|
|
641
673
|
return !1;
|
|
642
|
-
let
|
|
643
|
-
for (;
|
|
644
|
-
const
|
|
645
|
-
if (typeof
|
|
674
|
+
let a = 0, d = y.length;
|
|
675
|
+
for (; a < d; ) {
|
|
676
|
+
const g = a + d >>> 1, u = y[g];
|
|
677
|
+
if (typeof u != "object" || u === null || Array.isArray(u))
|
|
646
678
|
return !1;
|
|
647
|
-
const v =
|
|
679
|
+
const v = u[t.key];
|
|
648
680
|
if (typeof v != "string" && typeof v != "number")
|
|
649
681
|
return !1;
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
682
|
+
const k = n.get(v);
|
|
683
|
+
if (k === void 0)
|
|
652
684
|
return !1;
|
|
653
|
-
|
|
685
|
+
k < _ ? a = g + 1 : d = g;
|
|
654
686
|
}
|
|
655
|
-
|
|
687
|
+
h = a, y.splice(h, 0, s.get(c));
|
|
656
688
|
}
|
|
657
|
-
if (this._replaceDerivedTarget(e.options.to,
|
|
658
|
-
i.delete(
|
|
659
|
-
for (const [
|
|
660
|
-
|
|
689
|
+
if (this._replaceDerivedTarget(e.options.to, y, o), l !== void 0) {
|
|
690
|
+
i.delete(c);
|
|
691
|
+
for (const [_, a] of i)
|
|
692
|
+
a > h && i.set(_, a - 1);
|
|
661
693
|
} else {
|
|
662
|
-
for (const [
|
|
663
|
-
|
|
664
|
-
i.set(
|
|
694
|
+
for (const [_, a] of i)
|
|
695
|
+
a >= h && i.set(_, a + 1);
|
|
696
|
+
i.set(c, h);
|
|
665
697
|
}
|
|
666
698
|
return !0;
|
|
667
699
|
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
let I = M;
|
|
672
|
-
function E(_, e) {
|
|
673
|
-
const t = Math.min(_.segments.length, e.segments.length);
|
|
700
|
+
}
|
|
701
|
+
function A(f, e) {
|
|
702
|
+
const t = Math.min(f.segments.length, e.segments.length);
|
|
674
703
|
for (let r = 0; r < t; r++)
|
|
675
|
-
if (!
|
|
704
|
+
if (!j(f.segments[r], e.segments[r]))
|
|
676
705
|
return !1;
|
|
677
706
|
return !0;
|
|
678
707
|
}
|
|
679
|
-
function
|
|
680
|
-
return typeof
|
|
708
|
+
function $(f, e) {
|
|
709
|
+
return typeof f != "object" || f === null || Array.isArray(f) || e.kind !== "key" ? !0 : Object.hasOwn(f, e.key);
|
|
681
710
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
711
|
+
function j(f, e) {
|
|
712
|
+
return f.kind !== e.kind ? !1 : f.kind === "key" && e.kind === "key" ? f.key === e.key : f.kind === "index" && e.kind === "index" ? f.index === e.index : f.kind === "selector" && e.kind === "selector" && f.key === e.key && Object.is(f.value, e.value);
|
|
684
713
|
}
|
|
685
714
|
export {
|
|
686
|
-
|
|
715
|
+
P as RaphKernel
|
|
687
716
|
};
|