@rpgjs/client 5.0.0-alpha.2 → 5.0.0-alpha.20
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/Game/AnimationManager.d.ts +8 -0
- package/dist/Game/Map.d.ts +7 -1
- package/dist/Gui/Gui.d.ts +128 -5
- package/dist/RpgClient.d.ts +217 -59
- package/dist/RpgClientEngine.d.ts +345 -6
- package/dist/Sound.d.ts +199 -0
- package/dist/components/animations/index.d.ts +4 -0
- package/dist/components/dynamics/parse-value.d.ts +1 -0
- package/dist/components/gui/index.d.ts +3 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/components/prebuilt/index.d.ts +18 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.js +149 -4
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +21 -7
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +6 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +11 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +8 -40
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +187 -180
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +104 -7
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +82 -372
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +361 -26
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +46 -20
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +683 -32
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +5 -2417
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +383 -97
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +41 -104
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +21 -67
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +2632 -20
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +107 -34
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +69 -3
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +17 -318
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +24 -22
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +92 -8
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +68 -8
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +37 -7
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +18 -168
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +3 -499
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +332 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +24 -4400
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +6 -311
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +8 -88
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +182 -56
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +500 -16
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +10 -18
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +23 -5
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +7 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.js +3690 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +77 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +6 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +20 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +146 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +12 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +113 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +136 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +137 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +2 -1
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +112 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +141 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +9 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +54 -0
- package/dist/index53.js.map +1 -0
- package/dist/index6.js +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +11 -3
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +68 -7
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +230 -15
- package/dist/index9.js.map +1 -1
- package/dist/presets/animation.d.ts +31 -0
- package/dist/presets/faceset.d.ts +30 -0
- package/dist/presets/index.d.ts +103 -0
- package/dist/presets/lpc.d.ts +89 -0
- package/dist/services/loadMap.d.ts +123 -2
- package/dist/services/mmorpg.d.ts +9 -4
- package/dist/services/standalone.d.ts +51 -2
- package/package.json +22 -18
- package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
- package/src/Game/Map.ts +20 -2
- package/src/Game/Object.ts +163 -9
- package/src/Gui/Gui.ts +300 -17
- package/src/RpgClient.ts +222 -58
- package/src/RpgClientEngine.ts +804 -36
- package/src/Sound.ts +253 -0
- package/src/components/{effects → animations}/animation.ce +3 -6
- package/src/components/{effects → animations}/index.ts +1 -1
- package/src/components/character.ce +165 -37
- package/src/components/dynamics/parse-value.ts +80 -0
- package/src/components/dynamics/text.ce +183 -0
- package/src/components/gui/box.ce +17 -0
- package/src/components/gui/dialogbox/index.ce +73 -35
- package/src/components/gui/dialogbox/selection.ce +16 -1
- package/src/components/gui/index.ts +3 -4
- package/src/components/index.ts +5 -1
- package/src/components/prebuilt/hp-bar.ce +255 -0
- package/src/components/prebuilt/index.ts +21 -0
- package/src/components/scenes/draw-map.ce +6 -23
- package/src/components/scenes/event-layer.ce +9 -3
- package/src/core/setup.ts +2 -0
- package/src/index.ts +5 -2
- package/src/module.ts +72 -6
- package/src/presets/animation.ts +46 -0
- package/src/presets/faceset.ts +60 -0
- package/src/presets/index.ts +7 -1
- package/src/presets/lpc.ts +108 -0
- package/src/services/loadMap.ts +132 -3
- package/src/services/mmorpg.ts +27 -5
- package/src/services/standalone.ts +68 -6
- package/tsconfig.json +1 -1
- package/vite.config.ts +1 -1
- package/dist/Game/EffectManager.d.ts +0 -5
- package/dist/components/effects/index.d.ts +0 -4
- package/src/components/scenes/element-map.ce +0 -23
- /package/src/components/{effects → animations}/hit.ce +0 -0
package/dist/index21.js
CHANGED
|
@@ -1,114 +1,400 @@
|
|
|
1
|
-
import { __name } from './
|
|
2
|
-
import {
|
|
3
|
-
import { PartySocket } from './index31.js';
|
|
4
|
-
import './index32.js';
|
|
1
|
+
import { __name } from './index32.js';
|
|
2
|
+
import { isSignal, isComputed, isObjectSubject, isArraySubject } from './index33.js';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
// src/utils.ts
|
|
5
|
+
function isFunction(val) {
|
|
6
|
+
return {}.toString.call(val) === "[object Function]";
|
|
7
|
+
}
|
|
8
|
+
__name(isFunction, "isFunction");
|
|
9
|
+
function isClass(obj) {
|
|
10
|
+
return typeof obj === "function" && obj.prototype && obj.prototype.constructor === obj;
|
|
11
|
+
}
|
|
12
|
+
__name(isClass, "isClass");
|
|
13
|
+
var isObject = /* @__PURE__ */ __name((item) => item && typeof item === "object" && !Array.isArray(item) && item !== null, "isObject");
|
|
14
|
+
function isInstanceOfClass(value) {
|
|
15
|
+
if (value === null || typeof value !== "object" || value === void 0 || Array.isArray(value)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return Object.getPrototypeOf(value) !== Object.prototype;
|
|
19
|
+
}
|
|
20
|
+
__name(isInstanceOfClass, "isInstanceOfClass");
|
|
21
|
+
function generateShortUUID() {
|
|
22
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
23
|
+
let uuid = "";
|
|
24
|
+
for (let i = 0; i < 8; i++) {
|
|
25
|
+
const randomIndex = Math.floor(Math.random() * chars.length);
|
|
26
|
+
uuid += chars[randomIndex];
|
|
27
|
+
}
|
|
28
|
+
return uuid;
|
|
29
|
+
}
|
|
30
|
+
__name(generateShortUUID, "generateShortUUID");
|
|
31
|
+
|
|
32
|
+
// src/core.ts
|
|
33
|
+
var DELETE_TOKEN = "$delete";
|
|
34
|
+
var syncClass = /* @__PURE__ */ __name((instance, options = {}) => {
|
|
35
|
+
const cacheSync = /* @__PURE__ */ new Map();
|
|
36
|
+
const cachePersist = /* @__PURE__ */ new Map();
|
|
37
|
+
instance.$valuesChanges = {
|
|
38
|
+
set: /* @__PURE__ */ __name((path, value) => {
|
|
39
|
+
cacheSync.set(path, value);
|
|
40
|
+
options.onSync?.(cacheSync);
|
|
41
|
+
}, "set"),
|
|
42
|
+
setPersist: /* @__PURE__ */ __name((path, value) => {
|
|
43
|
+
if (path == "") path = ".";
|
|
44
|
+
cachePersist.set(path, value);
|
|
45
|
+
options.onPersist?.(cachePersist);
|
|
46
|
+
}, "setPersist"),
|
|
47
|
+
has: /* @__PURE__ */ __name((path) => {
|
|
48
|
+
return cacheSync.has(path);
|
|
49
|
+
}, "has"),
|
|
50
|
+
get: /* @__PURE__ */ __name((path) => {
|
|
51
|
+
return cacheSync.get(path);
|
|
52
|
+
}, "get")
|
|
53
|
+
};
|
|
54
|
+
createSyncClass(instance);
|
|
55
|
+
}, "syncClass");
|
|
56
|
+
function createStatesSnapshot(instance) {
|
|
57
|
+
let persistObject = {};
|
|
58
|
+
if (instance?.$snapshot) {
|
|
59
|
+
for (const key of instance.$snapshot.keys()) {
|
|
60
|
+
const signal = instance.$snapshot.get(key);
|
|
61
|
+
const persist2 = signal.options.persist ?? true;
|
|
62
|
+
let value = signal();
|
|
63
|
+
if (isObject(value) || Array.isArray(value)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (persist2) {
|
|
67
|
+
persistObject[key] = value;
|
|
68
|
+
}
|
|
14
69
|
}
|
|
15
|
-
}
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
70
|
+
}
|
|
71
|
+
return persistObject;
|
|
72
|
+
}
|
|
73
|
+
__name(createStatesSnapshot, "createStatesSnapshot");
|
|
74
|
+
function setMetadata(target, key, value) {
|
|
75
|
+
const meta = target.constructor._propertyMetadata;
|
|
76
|
+
const propId = meta?.get(key);
|
|
77
|
+
if (propId) {
|
|
78
|
+
if (isSignal(target[propId])) {
|
|
79
|
+
target[propId].set(value);
|
|
80
|
+
} else {
|
|
81
|
+
target[propId] = value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
__name(setMetadata, "setMetadata");
|
|
86
|
+
var createSyncClass = /* @__PURE__ */ __name((currentClass, parentKey = null, parentClass = null, path = "") => {
|
|
87
|
+
currentClass.$path = path;
|
|
88
|
+
if (parentClass) {
|
|
89
|
+
currentClass.$valuesChanges = parentClass.$valuesChanges;
|
|
90
|
+
}
|
|
91
|
+
if (parentKey) {
|
|
92
|
+
setMetadata(currentClass, "id", parentKey);
|
|
93
|
+
}
|
|
94
|
+
if (currentClass.$snapshot) {
|
|
95
|
+
for (const key of currentClass.$snapshot.keys()) {
|
|
96
|
+
const signal = currentClass.$snapshot.get(key);
|
|
97
|
+
const syncToClient = signal.options?.syncToClient ?? true;
|
|
98
|
+
const persist2 = signal.options?.persist ?? true;
|
|
99
|
+
const transform = signal.options?.transform;
|
|
100
|
+
let signalValue = signal();
|
|
101
|
+
if (transform) {
|
|
102
|
+
signalValue = transform(signalValue);
|
|
103
|
+
}
|
|
104
|
+
if (isObject(signalValue) || Array.isArray(signalValue)) {
|
|
105
|
+
signalValue = {
|
|
106
|
+
...signalValue
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const transformedValue = signalValue;
|
|
110
|
+
const newPath = (path ? path + "." : "") + key;
|
|
111
|
+
if (syncToClient) {
|
|
112
|
+
currentClass.$valuesChanges.set(newPath, transformedValue);
|
|
113
|
+
}
|
|
114
|
+
if (persist2) {
|
|
115
|
+
if (parentClass) currentClass.$valuesChanges.setPersist(path, transformedValue);
|
|
116
|
+
}
|
|
117
|
+
if (isComputed(signal)) {
|
|
118
|
+
signal.observable.subscribe((newValue) => {
|
|
119
|
+
if (syncToClient) {
|
|
120
|
+
const transformedNewValue = transform ? transform(newValue) : newValue;
|
|
121
|
+
currentClass.$valuesChanges.set(newPath, transformedNewValue);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, "createSyncClass");
|
|
128
|
+
var type = /* @__PURE__ */ __name((_signal, path, options = {}, currentInstance) => {
|
|
129
|
+
const { syncToClient = true, persist: persist2 = true, transform } = options;
|
|
130
|
+
let init = true;
|
|
131
|
+
const handleObjectSubject = /* @__PURE__ */ __name((value, propPath) => {
|
|
132
|
+
const newPath = `${propPath}${value.key ? `.${value.key}` : ""}`;
|
|
133
|
+
if ([
|
|
134
|
+
"add",
|
|
135
|
+
"reset",
|
|
136
|
+
"update"
|
|
137
|
+
].includes(value.type)) {
|
|
138
|
+
if (isInstanceOfClass(value.value)) {
|
|
139
|
+
createSyncClass(value.value, value.key, currentInstance, newPath);
|
|
140
|
+
} else if (value.type === "update" && (isObject(value.value) || Array.isArray(value.value))) {
|
|
141
|
+
createSyncClass(value.value, value.key, currentInstance, newPath);
|
|
142
|
+
} else {
|
|
143
|
+
savePath(newPath, value.value);
|
|
144
|
+
}
|
|
145
|
+
} else if (value.type === "remove") {
|
|
146
|
+
savePath(newPath, DELETE_TOKEN);
|
|
147
|
+
}
|
|
148
|
+
}, "handleObjectSubject");
|
|
149
|
+
const handleArraySubject = /* @__PURE__ */ __name((value, propPath) => {
|
|
150
|
+
if (value.type === "reset" && Array.isArray(value.items)) {
|
|
151
|
+
value.items.forEach((item, index) => {
|
|
152
|
+
const newPath2 = `${propPath}.${index}`;
|
|
153
|
+
if (isInstanceOfClass(item)) {
|
|
154
|
+
createSyncClass(item, value.key, currentInstance, newPath2);
|
|
155
|
+
} else {
|
|
156
|
+
savePath(newPath2, item);
|
|
28
157
|
}
|
|
29
158
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const newPath = `${propPath}.${value.index}`;
|
|
162
|
+
const firstItem = value.items?.[0];
|
|
163
|
+
if ([
|
|
164
|
+
"add",
|
|
165
|
+
"update"
|
|
166
|
+
].includes(value.type) && firstItem !== void 0) {
|
|
167
|
+
if (isInstanceOfClass(firstItem)) {
|
|
168
|
+
createSyncClass(firstItem, value.key, currentInstance, newPath);
|
|
169
|
+
} else if (value.type === "update" && (isObject(firstItem) || Array.isArray(firstItem))) {
|
|
170
|
+
createSyncClass(firstItem, value.key, currentInstance, newPath);
|
|
171
|
+
} else {
|
|
172
|
+
savePath(newPath, firstItem);
|
|
173
|
+
}
|
|
174
|
+
} else if (value.type === "remove") {
|
|
175
|
+
savePath(newPath, DELETE_TOKEN);
|
|
176
|
+
}
|
|
177
|
+
}, "handleArraySubject");
|
|
178
|
+
const savePath = /* @__PURE__ */ __name((propPath, value) => {
|
|
179
|
+
const transformedValue = transform && value !== DELETE_TOKEN ? transform(value) : value;
|
|
180
|
+
if (syncToClient) {
|
|
181
|
+
currentInstance.$valuesChanges.set(propPath, transformedValue);
|
|
182
|
+
}
|
|
183
|
+
if (persist2 && currentInstance.$path !== void 0) {
|
|
184
|
+
currentInstance.$valuesChanges.setPersist(transformedValue == DELETE_TOKEN ? propPath : currentInstance.$path, transformedValue);
|
|
185
|
+
}
|
|
186
|
+
}, "savePath");
|
|
187
|
+
const setupSubscription = /* @__PURE__ */ __name((signal, signalPath) => {
|
|
188
|
+
if (!isSignal(signal)) return;
|
|
189
|
+
if (syncToClient && currentInstance.$valuesChanges) {
|
|
190
|
+
const initialValue = signal();
|
|
191
|
+
const transformedInitialValue = transform ? transform(initialValue) : initialValue;
|
|
192
|
+
currentInstance.$valuesChanges.set(signalPath, transformedInitialValue);
|
|
193
|
+
}
|
|
194
|
+
signal.options = options;
|
|
195
|
+
signal.observable.subscribe((value) => {
|
|
196
|
+
if (init) return;
|
|
197
|
+
if (currentInstance.$path !== void 0) {
|
|
198
|
+
const fullPath = `${currentInstance.$path ? currentInstance.$path + "." : ""}${signalPath}`;
|
|
199
|
+
if (isComputed(signal)) {
|
|
200
|
+
savePath(fullPath, value);
|
|
201
|
+
} else if (isObjectSubject(signal._subject)) {
|
|
202
|
+
handleObjectSubject(value, fullPath);
|
|
203
|
+
} else if (isArraySubject(signal._subject)) {
|
|
204
|
+
handleArraySubject(value, fullPath);
|
|
205
|
+
} else {
|
|
206
|
+
savePath(fullPath, value);
|
|
36
207
|
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
if (!currentInstance.$snapshot) {
|
|
211
|
+
currentInstance.$snapshot = /* @__PURE__ */ new Map();
|
|
212
|
+
}
|
|
213
|
+
currentInstance.$snapshot.set(path, signal);
|
|
214
|
+
}, "setupSubscription");
|
|
215
|
+
if (!isSignal(_signal)) {
|
|
216
|
+
if (_signal && typeof _signal === "object" && !Array.isArray(_signal)) {
|
|
217
|
+
for (const key in _signal) {
|
|
218
|
+
if (Object.prototype.hasOwnProperty.call(_signal, key)) {
|
|
219
|
+
const value = _signal[key];
|
|
220
|
+
const propertyPath = `${path}.${key}`;
|
|
221
|
+
if (isSignal(value)) {
|
|
222
|
+
setupSubscription(value, propertyPath);
|
|
223
|
+
} else if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
224
|
+
type(value, propertyPath, options, currentInstance);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
init = false;
|
|
229
|
+
}
|
|
230
|
+
return _signal;
|
|
231
|
+
}
|
|
232
|
+
setupSubscription(_signal, path);
|
|
233
|
+
init = false;
|
|
234
|
+
return _signal;
|
|
235
|
+
}, "type");
|
|
236
|
+
|
|
237
|
+
// src/decorators.ts
|
|
238
|
+
function sync(options) {
|
|
239
|
+
let classType;
|
|
240
|
+
let persist2 = true;
|
|
241
|
+
let syncToClient = true;
|
|
242
|
+
let transform;
|
|
243
|
+
if (typeof options === "function") {
|
|
244
|
+
classType = options;
|
|
245
|
+
} else if (typeof options === "object") {
|
|
246
|
+
classType = options.classType;
|
|
247
|
+
if (options.hasOwnProperty("persist")) {
|
|
248
|
+
persist2 = options.persist;
|
|
249
|
+
}
|
|
250
|
+
if (options.hasOwnProperty("syncToClient")) {
|
|
251
|
+
syncToClient = options.syncToClient;
|
|
252
|
+
}
|
|
253
|
+
if (options.hasOwnProperty("transform")) {
|
|
254
|
+
transform = options.transform;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return function(target, propertyKey) {
|
|
258
|
+
const privatePropertyKey = `__${propertyKey}`;
|
|
259
|
+
const getter = /* @__PURE__ */ __name(function() {
|
|
260
|
+
return this[privatePropertyKey];
|
|
261
|
+
}, "getter");
|
|
262
|
+
const setter = /* @__PURE__ */ __name(function(newVal) {
|
|
263
|
+
this[privatePropertyKey] = type(newVal, propertyKey, {
|
|
264
|
+
classType,
|
|
265
|
+
persist: persist2,
|
|
266
|
+
syncToClient,
|
|
267
|
+
transform
|
|
268
|
+
}, this);
|
|
269
|
+
}, "setter");
|
|
270
|
+
Object.defineProperty(target, propertyKey, {
|
|
271
|
+
get: getter,
|
|
272
|
+
set: setter,
|
|
273
|
+
enumerable: true,
|
|
274
|
+
configurable: true
|
|
275
|
+
});
|
|
41
276
|
};
|
|
42
277
|
}
|
|
43
|
-
__name(
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const result = createConnection({
|
|
51
|
-
...options,
|
|
52
|
-
party: "shard",
|
|
53
|
-
room: shardInfo.url
|
|
54
|
-
}, roomInstance);
|
|
55
|
-
return {
|
|
56
|
-
...result,
|
|
57
|
-
shardInfo
|
|
278
|
+
__name(sync, "sync");
|
|
279
|
+
function id() {
|
|
280
|
+
return function(target, propertyKey) {
|
|
281
|
+
if (!target.constructor._propertyMetadata) {
|
|
282
|
+
target.constructor._propertyMetadata = /* @__PURE__ */ new Map();
|
|
283
|
+
}
|
|
284
|
+
target.constructor._propertyMetadata.set("id", propertyKey);
|
|
58
285
|
};
|
|
59
286
|
}
|
|
60
|
-
__name(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
287
|
+
__name(id, "id");
|
|
288
|
+
function users(options) {
|
|
289
|
+
return function(target, propertyKey) {
|
|
290
|
+
if (!target.constructor._propertyMetadata) {
|
|
291
|
+
target.constructor._propertyMetadata = /* @__PURE__ */ new Map();
|
|
292
|
+
}
|
|
293
|
+
target.constructor._propertyMetadata.set("users", propertyKey);
|
|
294
|
+
sync(options)(target, propertyKey);
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
__name(users, "users");
|
|
298
|
+
function persist() {
|
|
299
|
+
return sync({
|
|
300
|
+
persist: true,
|
|
301
|
+
syncToClient: false
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
__name(persist, "persist");
|
|
305
|
+
function connected() {
|
|
306
|
+
return function(target, propertyKey) {
|
|
307
|
+
if (!target.constructor._propertyMetadata) {
|
|
308
|
+
target.constructor._propertyMetadata = /* @__PURE__ */ new Map();
|
|
309
|
+
}
|
|
310
|
+
target.constructor._propertyMetadata.set("connected", propertyKey);
|
|
311
|
+
sync({
|
|
312
|
+
persist: false
|
|
313
|
+
})(target, propertyKey);
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
__name(connected, "connected");
|
|
317
|
+
function load(rootInstance, values, valueIsObject) {
|
|
318
|
+
if (valueIsObject) {
|
|
319
|
+
loadFromObject(rootInstance, values);
|
|
320
|
+
} else {
|
|
321
|
+
loadFromPaths(rootInstance, values);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
__name(load, "load");
|
|
325
|
+
function loadFromPaths(rootInstance, values) {
|
|
326
|
+
for (const [path, value] of Object.entries(values)) {
|
|
327
|
+
const parts = path.split(".");
|
|
328
|
+
loadValue(rootInstance, parts, value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
__name(loadFromPaths, "loadFromPaths");
|
|
332
|
+
function loadFromObject(rootInstance, values, currentPath = "") {
|
|
333
|
+
for (let key in values) {
|
|
334
|
+
const value = values[key];
|
|
335
|
+
const newPath = currentPath ? `${currentPath}.${key}` : key;
|
|
336
|
+
if (typeof value === "object" && !Array.isArray(value) && value !== null) {
|
|
337
|
+
loadFromObject(rootInstance, value, newPath);
|
|
338
|
+
} else {
|
|
339
|
+
const parts = newPath.split(".");
|
|
340
|
+
loadValue(rootInstance, parts, value);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
__name(loadFromObject, "loadFromObject");
|
|
345
|
+
function loadValue(rootInstance, parts, value) {
|
|
346
|
+
let current = rootInstance;
|
|
347
|
+
for (let i = 0; i < parts.length; i++) {
|
|
348
|
+
const part = parts[i];
|
|
349
|
+
if (i === parts.length - 1) {
|
|
350
|
+
if (value == DELETE_TOKEN) {
|
|
351
|
+
if (isSignal(current)) {
|
|
352
|
+
current = current();
|
|
353
|
+
}
|
|
354
|
+
Reflect.deleteProperty(current, part);
|
|
355
|
+
} else if (current[part]?._subject) {
|
|
356
|
+
current[part].set(value);
|
|
357
|
+
} else if (isSignal(current) && Array.isArray(current()) && !isNaN(Number(part))) {
|
|
358
|
+
current()[Number(part)] = value;
|
|
359
|
+
} else {
|
|
360
|
+
current[part] = value;
|
|
91
361
|
}
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
|
|
362
|
+
} else {
|
|
363
|
+
if (isSignal(current)) {
|
|
364
|
+
current = current();
|
|
95
365
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
366
|
+
const currentValue = current[part];
|
|
367
|
+
if (currentValue === void 0) {
|
|
368
|
+
const parentInstance = getByPath(rootInstance, parts.slice(0, i).join("."));
|
|
369
|
+
const classType = parentInstance?.options?.classType;
|
|
370
|
+
if (classType) {
|
|
371
|
+
current[part] = !isClass(classType) ? classType(part) : new classType();
|
|
372
|
+
setMetadata(current[part], "id", part);
|
|
373
|
+
} else {
|
|
374
|
+
current[part] = {};
|
|
375
|
+
}
|
|
104
376
|
}
|
|
105
|
-
|
|
106
|
-
|
|
377
|
+
current = current[part];
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
__name(loadValue, "loadValue");
|
|
382
|
+
function getByPath(root, path) {
|
|
383
|
+
const parts = path.split(".");
|
|
384
|
+
let current = root;
|
|
385
|
+
for (const part of parts) {
|
|
386
|
+
if (isSignal(current)) {
|
|
387
|
+
current = current();
|
|
388
|
+
}
|
|
389
|
+
if (current[part]) {
|
|
390
|
+
current = current[part];
|
|
391
|
+
} else {
|
|
392
|
+
return void 0;
|
|
107
393
|
}
|
|
108
394
|
}
|
|
109
|
-
|
|
395
|
+
return current;
|
|
110
396
|
}
|
|
111
|
-
__name(
|
|
397
|
+
__name(getByPath, "getByPath");
|
|
112
398
|
|
|
113
|
-
export {
|
|
399
|
+
export { DELETE_TOKEN, connected, createStatesSnapshot, createSyncClass, generateShortUUID, getByPath, id, isClass, isFunction, isInstanceOfClass, isObject, load, persist, setMetadata, sync, syncClass, type, users };
|
|
114
400
|
//# sourceMappingURL=index21.js.map
|
package/dist/index21.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index21.js","sources":["../../../node_modules/.pnpm/@signe+sync@2.3.3/node_modules/@signe/sync/dist/client/index.js"],"sourcesContent":["import {\n __name\n} from \"../chunk-7QVYU63E.js\";\n\n// src/client/index.ts\nimport { load } from \"@signe/sync\";\nimport PartySocket from \"partysocket\";\nfunction createConnection(options, roomInstance) {\n const conn = new PartySocket(options);\n conn.addEventListener(\"message\", (event) => {\n const object = JSON.parse(event.data);\n switch (object.type) {\n case \"sync\":\n load(roomInstance, object.value, true);\n break;\n }\n });\n return {\n emit: /* @__PURE__ */ __name((key, value) => {\n conn.send(JSON.stringify({\n action: key,\n value\n }));\n }, \"emit\"),\n on: /* @__PURE__ */ __name((key, cb) => {\n conn.addEventListener(\"message\", (event) => {\n const object = JSON.parse(event.data);\n if (object.type === key) {\n cb(object.value);\n }\n });\n }, \"on\"),\n off: /* @__PURE__ */ __name((key, cb) => {\n conn.removeEventListener(\"message\", (event) => {\n const object = JSON.parse(event.data);\n if (object.type === key) {\n cb(object.value);\n }\n });\n }, \"off\"),\n close: /* @__PURE__ */ __name(() => conn.close(), \"close\"),\n conn\n };\n}\n__name(createConnection, \"createConnection\");\nasync function connectionRoom(options, roomInstance) {\n return createConnection(options, roomInstance);\n}\n__name(connectionRoom, \"connectionRoom\");\nasync function connectionWorld(options, roomInstance) {\n const shardInfo = await getOptimalShard(options);\n const result = createConnection({\n ...options,\n party: \"shard\",\n room: shardInfo.url\n }, roomInstance);\n return {\n ...result,\n shardInfo\n };\n}\n__name(connectionWorld, \"connectionWorld\");\nasync function getOptimalShard(worldOptions) {\n const {\n host,\n room,\n worldId = \"world-default\",\n retryCount = 3,\n retryDelay = 1e3,\n autoCreate = true\n // Default to true for auto-creation\n } = worldOptions;\n let attempts = 0;\n const url = new URL(`${host}/parties/world/${encodeURIComponent(worldId)}/connect`);\n const requestUrl = url.toString();\n while (attempts < retryCount) {\n try {\n const response = await fetch(requestUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n roomId: room,\n autoCreate\n })\n });\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({\n error: \"Unknown error\"\n }));\n throw new Error(`World service returned ${response.status}: ${errorData.error || \"Unknown error\"}`);\n }\n const data = await response.json();\n if (!data.url || !data.shardId) {\n throw new Error(\"Invalid response from World service: missing url or shardId\");\n }\n return {\n shardId: data.shardId,\n url: data.url\n };\n } catch (error) {\n attempts++;\n if (attempts >= retryCount) {\n throw error;\n }\n console.warn(`Failed to get shard (attempt ${attempts}/${retryCount}). Retrying in ${retryDelay}ms...`);\n await new Promise((resolve) => setTimeout(resolve, retryDelay));\n }\n }\n throw new Error(\"Failed to get shard after all retry attempts\");\n}\n__name(getOptimalShard, \"getOptimalShard\");\nexport {\n PartySocket,\n connectionRoom,\n connectionWorld\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;AAOA,SAAS,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE;AACjD,EAAE,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC;AACvC,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,KAAK;AAC9C,IAAI,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;AACzC,IAAI,QAAQ,MAAM,CAAC,IAAI;AACvB,MAAM,KAAK,MAAM;AACjB,QAAQ,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;AAC9C,QAAQ;AACR;AACA,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,IAAI,kBAAkB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK;AACjD,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,S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E,CAAC,KAAK,CAAC,OAAO;AAC7D,UAAU,KAAK,EAAE;AACjB,SAAS,CAAC,CAAC;AACX,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC;AAC3G;AACA,MAAM,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE;AACxC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACtC,QAAQ,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;AACtF;AACA,MAAM,OAAO;AACb,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO;AAC7B,QAAQ,GAAG,EAAE,IAAI,CAAC;AAClB,OAAO;AACP,KAAK,CAAC,OAAO,KAAK,EAAE;AACpB,MAAM,QAAQ,EAAE;AAChB,MAAM,IAAI,QAAQ,IAAI,UAAU,EAAE;AAClC,QAAQ,MAAM,KAAK;AACnB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,6BAA6B,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,eAAe,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AAC7G,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACrE;AACA;AACA,EAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC;AACjE;AACA,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index21.js","sources":["../../../node_modules/.pnpm/@signe+sync@2.5.1/node_modules/@signe/sync/dist/index.js"],"sourcesContent":["import {\n __name\n} from \"./chunk-7QVYU63E.js\";\n\n// src/core.ts\nimport { isArraySubject, isObjectSubject, isSignal, isComputed } from \"@signe/reactive\";\n\n// src/utils.ts\nfunction isFunction(val) {\n return {}.toString.call(val) === \"[object Function]\";\n}\n__name(isFunction, \"isFunction\");\nfunction isClass(obj) {\n return typeof obj === \"function\" && obj.prototype && obj.prototype.constructor === obj;\n}\n__name(isClass, \"isClass\");\nvar isObject = /* @__PURE__ */ __name((item) => item && typeof item === \"object\" && !Array.isArray(item) && item !== null, \"isObject\");\nfunction isInstanceOfClass(value) {\n if (value === null || typeof value !== \"object\" || value === void 0 || Array.isArray(value)) {\n return false;\n }\n return Object.getPrototypeOf(value) !== Object.prototype;\n}\n__name(isInstanceOfClass, \"isInstanceOfClass\");\nfunction generateShortUUID() {\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let uuid = \"\";\n for (let i = 0; i < 8; i++) {\n const randomIndex = Math.floor(Math.random() * chars.length);\n uuid += chars[randomIndex];\n }\n return uuid;\n}\n__name(generateShortUUID, \"generateShortUUID\");\n\n// src/core.ts\nvar DELETE_TOKEN = \"$delete\";\nvar syncClass = /* @__PURE__ */ __name((instance, options = {}) => {\n const cacheSync = /* @__PURE__ */ new Map();\n const cachePersist = /* @__PURE__ */ new Map();\n instance.$valuesChanges = {\n set: /* @__PURE__ */ __name((path, value) => {\n cacheSync.set(path, value);\n options.onSync?.(cacheSync);\n }, \"set\"),\n setPersist: /* @__PURE__ */ __name((path, value) => {\n if (path == \"\") path = \".\";\n cachePersist.set(path, value);\n options.onPersist?.(cachePersist);\n }, \"setPersist\"),\n has: /* @__PURE__ */ __name((path) => {\n return cacheSync.has(path);\n }, \"has\"),\n get: /* @__PURE__ */ __name((path) => {\n return cacheSync.get(path);\n }, \"get\")\n };\n createSyncClass(instance);\n}, \"syncClass\");\nfunction createStatesSnapshot(instance) {\n let persistObject = {};\n if (instance?.$snapshot) {\n for (const key of instance.$snapshot.keys()) {\n const signal = instance.$snapshot.get(key);\n const persist2 = signal.options.persist ?? true;\n let value = signal();\n if (isObject(value) || Array.isArray(value)) {\n continue;\n }\n if (persist2) {\n persistObject[key] = value;\n }\n }\n }\n return persistObject;\n}\n__name(createStatesSnapshot, \"createStatesSnapshot\");\nfunction setMetadata(target, key, value) {\n const meta = target.constructor._propertyMetadata;\n const propId = meta?.get(key);\n if (propId) {\n if (isSignal(target[propId])) {\n target[propId].set(value);\n } else {\n target[propId] = value;\n }\n }\n}\n__name(setMetadata, \"setMetadata\");\nvar createSyncClass = /* @__PURE__ */ __name((currentClass, parentKey = null, parentClass = null, path = \"\") => {\n currentClass.$path = path;\n if (parentClass) {\n currentClass.$valuesChanges = parentClass.$valuesChanges;\n }\n if (parentKey) {\n setMetadata(currentClass, \"id\", parentKey);\n }\n if (currentClass.$snapshot) {\n for (const key of currentClass.$snapshot.keys()) {\n const signal = currentClass.$snapshot.get(key);\n const syncToClient = signal.options?.syncToClient ?? true;\n const persist2 = signal.options?.persist ?? true;\n const transform = signal.options?.transform;\n let signalValue = signal();\n if (transform) {\n signalValue = transform(signalValue);\n }\n if (isObject(signalValue) || Array.isArray(signalValue)) {\n signalValue = {\n ...signalValue\n };\n }\n const transformedValue = signalValue;\n const newPath = (path ? path + \".\" : \"\") + key;\n if (syncToClient) {\n currentClass.$valuesChanges.set(newPath, transformedValue);\n }\n if (persist2) {\n if (parentClass) currentClass.$valuesChanges.setPersist(path, transformedValue);\n }\n if (isComputed(signal)) {\n signal.observable.subscribe((newValue) => {\n if (syncToClient) {\n const transformedNewValue = transform ? transform(newValue) : newValue;\n currentClass.$valuesChanges.set(newPath, transformedNewValue);\n }\n });\n }\n }\n }\n}, \"createSyncClass\");\nvar type = /* @__PURE__ */ __name((_signal, path, options = {}, currentInstance) => {\n const { syncToClient = true, persist: persist2 = true, transform } = options;\n let init = true;\n const handleObjectSubject = /* @__PURE__ */ __name((value, propPath) => {\n const newPath = `${propPath}${value.key ? `.${value.key}` : \"\"}`;\n if ([\n \"add\",\n \"reset\",\n \"update\"\n ].includes(value.type)) {\n if (isInstanceOfClass(value.value)) {\n createSyncClass(value.value, value.key, currentInstance, newPath);\n } else if (value.type === \"update\" && (isObject(value.value) || Array.isArray(value.value))) {\n createSyncClass(value.value, value.key, currentInstance, newPath);\n } else {\n savePath(newPath, value.value);\n }\n } else if (value.type === \"remove\") {\n savePath(newPath, DELETE_TOKEN);\n }\n }, \"handleObjectSubject\");\n const handleArraySubject = /* @__PURE__ */ __name((value, propPath) => {\n if (value.type === \"reset\" && Array.isArray(value.items)) {\n value.items.forEach((item, index) => {\n const newPath2 = `${propPath}.${index}`;\n if (isInstanceOfClass(item)) {\n createSyncClass(item, value.key, currentInstance, newPath2);\n } else {\n savePath(newPath2, item);\n }\n });\n return;\n }\n const newPath = `${propPath}.${value.index}`;\n const firstItem = value.items?.[0];\n if ([\n \"add\",\n \"update\"\n ].includes(value.type) && firstItem !== void 0) {\n if (isInstanceOfClass(firstItem)) {\n createSyncClass(firstItem, value.key, currentInstance, newPath);\n } else if (value.type === \"update\" && (isObject(firstItem) || Array.isArray(firstItem))) {\n createSyncClass(firstItem, value.key, currentInstance, newPath);\n } else {\n savePath(newPath, firstItem);\n }\n } else if (value.type === \"remove\") {\n savePath(newPath, DELETE_TOKEN);\n }\n }, \"handleArraySubject\");\n const savePath = /* @__PURE__ */ __name((propPath, value) => {\n const transformedValue = transform && value !== DELETE_TOKEN ? transform(value) : value;\n if (syncToClient) {\n currentInstance.$valuesChanges.set(propPath, transformedValue);\n }\n if (persist2 && currentInstance.$path !== void 0) {\n currentInstance.$valuesChanges.setPersist(transformedValue == DELETE_TOKEN ? propPath : currentInstance.$path, transformedValue);\n }\n }, \"savePath\");\n const setupSubscription = /* @__PURE__ */ __name((signal, signalPath) => {\n if (!isSignal(signal)) return;\n if (syncToClient && currentInstance.$valuesChanges) {\n const initialValue = signal();\n const transformedInitialValue = transform ? transform(initialValue) : initialValue;\n currentInstance.$valuesChanges.set(signalPath, transformedInitialValue);\n }\n signal.options = options;\n signal.observable.subscribe((value) => {\n if (init) return;\n if (currentInstance.$path !== void 0) {\n const fullPath = `${currentInstance.$path ? currentInstance.$path + \".\" : \"\"}${signalPath}`;\n if (isComputed(signal)) {\n savePath(fullPath, value);\n } else if (isObjectSubject(signal._subject)) {\n handleObjectSubject(value, fullPath);\n } else if (isArraySubject(signal._subject)) {\n handleArraySubject(value, fullPath);\n } else {\n savePath(fullPath, value);\n }\n }\n });\n if (!currentInstance.$snapshot) {\n currentInstance.$snapshot = /* @__PURE__ */ new Map();\n }\n currentInstance.$snapshot.set(path, signal);\n }, \"setupSubscription\");\n if (!isSignal(_signal)) {\n if (_signal && typeof _signal === \"object\" && !Array.isArray(_signal)) {\n for (const key in _signal) {\n if (Object.prototype.hasOwnProperty.call(_signal, key)) {\n const value = _signal[key];\n const propertyPath = `${path}.${key}`;\n if (isSignal(value)) {\n setupSubscription(value, propertyPath);\n } else if (value && typeof value === \"object\" && !Array.isArray(value)) {\n type(value, propertyPath, options, currentInstance);\n }\n }\n }\n init = false;\n }\n return _signal;\n }\n setupSubscription(_signal, path);\n init = false;\n return _signal;\n}, \"type\");\n\n// src/decorators.ts\nfunction sync(options) {\n let classType;\n let persist2 = true;\n let syncToClient = true;\n let transform;\n if (typeof options === \"function\") {\n classType = options;\n } else if (typeof options === \"object\") {\n classType = options.classType;\n if (options.hasOwnProperty(\"persist\")) {\n persist2 = options.persist;\n }\n if (options.hasOwnProperty(\"syncToClient\")) {\n syncToClient = options.syncToClient;\n }\n if (options.hasOwnProperty(\"transform\")) {\n transform = options.transform;\n }\n }\n return function(target, propertyKey) {\n const privatePropertyKey = `__${propertyKey}`;\n const getter = /* @__PURE__ */ __name(function() {\n return this[privatePropertyKey];\n }, \"getter\");\n const setter = /* @__PURE__ */ __name(function(newVal) {\n this[privatePropertyKey] = type(newVal, propertyKey, {\n classType,\n persist: persist2,\n syncToClient,\n transform\n }, this);\n }, \"setter\");\n Object.defineProperty(target, propertyKey, {\n get: getter,\n set: setter,\n enumerable: true,\n configurable: true\n });\n };\n}\n__name(sync, \"sync\");\nfunction id() {\n return function(target, propertyKey) {\n if (!target.constructor._propertyMetadata) {\n target.constructor._propertyMetadata = /* @__PURE__ */ new Map();\n }\n target.constructor._propertyMetadata.set(\"id\", propertyKey);\n };\n}\n__name(id, \"id\");\nfunction users(options) {\n return function(target, propertyKey) {\n if (!target.constructor._propertyMetadata) {\n target.constructor._propertyMetadata = /* @__PURE__ */ new Map();\n }\n target.constructor._propertyMetadata.set(\"users\", propertyKey);\n sync(options)(target, propertyKey);\n };\n}\n__name(users, \"users\");\nfunction persist() {\n return sync({\n persist: true,\n syncToClient: false\n });\n}\n__name(persist, \"persist\");\nfunction connected() {\n return function(target, propertyKey) {\n if (!target.constructor._propertyMetadata) {\n target.constructor._propertyMetadata = /* @__PURE__ */ new Map();\n }\n target.constructor._propertyMetadata.set(\"connected\", propertyKey);\n sync({\n persist: false\n })(target, propertyKey);\n };\n}\n__name(connected, \"connected\");\n\n// src/load.ts\nimport { isSignal as isSignal2 } from \"@signe/reactive\";\nfunction load(rootInstance, values, valueIsObject) {\n if (valueIsObject) {\n loadFromObject(rootInstance, values);\n } else {\n loadFromPaths(rootInstance, values);\n }\n}\n__name(load, \"load\");\nfunction loadFromPaths(rootInstance, values) {\n for (const [path, value] of Object.entries(values)) {\n const parts = path.split(\".\");\n loadValue(rootInstance, parts, value);\n }\n}\n__name(loadFromPaths, \"loadFromPaths\");\nfunction loadFromObject(rootInstance, values, currentPath = \"\") {\n for (let key in values) {\n const value = values[key];\n const newPath = currentPath ? `${currentPath}.${key}` : key;\n if (typeof value === \"object\" && !Array.isArray(value) && value !== null) {\n loadFromObject(rootInstance, value, newPath);\n } else {\n const parts = newPath.split(\".\");\n loadValue(rootInstance, parts, value);\n }\n }\n}\n__name(loadFromObject, \"loadFromObject\");\nfunction loadValue(rootInstance, parts, value) {\n let current = rootInstance;\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n if (i === parts.length - 1) {\n if (value == DELETE_TOKEN) {\n if (isSignal2(current)) {\n current = current();\n }\n Reflect.deleteProperty(current, part);\n } else if (current[part]?._subject) {\n current[part].set(value);\n } else if (isSignal2(current) && Array.isArray(current()) && !isNaN(Number(part))) {\n current()[Number(part)] = value;\n } else {\n current[part] = value;\n }\n } else {\n if (isSignal2(current)) {\n current = current();\n }\n const currentValue = current[part];\n if (currentValue === void 0) {\n const parentInstance = getByPath(rootInstance, parts.slice(0, i).join(\".\"));\n const classType = parentInstance?.options?.classType;\n if (classType) {\n current[part] = !isClass(classType) ? classType(part) : new classType();\n setMetadata(current[part], \"id\", part);\n } else {\n current[part] = {};\n }\n }\n current = current[part];\n }\n }\n}\n__name(loadValue, \"loadValue\");\nfunction getByPath(root, path) {\n const parts = path.split(\".\");\n let current = root;\n for (const part of parts) {\n if (isSignal2(current)) {\n current = current();\n }\n if (current[part]) {\n current = current[part];\n } else {\n return void 0;\n }\n }\n return current;\n}\n__name(getByPath, \"getByPath\");\nexport {\n DELETE_TOKEN,\n connected,\n createStatesSnapshot,\n createSyncClass,\n generateShortUUID,\n getByPath,\n id,\n isClass,\n isFunction,\n isInstanceOfClass,\n isObject,\n load,\n persist,\n setMetadata,\n sync,\n syncClass,\n type,\n users\n};\n//# sourceMappingURL=index.js.map"],"names":["isSignal2"],"mappings":";;;AAOA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,mBAAmB;AACtD;AACA,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC;AAChC,SAAS,OAAO,CAAC,GAAG,EAAE;AACtB,EAAE,OAAO,OAAO,GAAG,KAAK,UAAU,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,SAAS,CAAC,WAAW,KAAK,GAAG;AACxF;AACA,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC;AACvB,IAAC,QAAQ,mBAAmB,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK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