@agendize/vue-tools 0.0.0 → 0.0.1
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.d.ts +2 -0
- package/dist/vue-tools.es.js +756 -1
- package/dist/vue-tools.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/vue-tools.es.js
CHANGED
|
@@ -4,6 +4,761 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
+
function makeMap(str, expectsLowerCase) {
|
|
8
|
+
const map = /* @__PURE__ */ Object.create(null);
|
|
9
|
+
const list = str.split(",");
|
|
10
|
+
for (let i = 0; i < list.length; i++) {
|
|
11
|
+
map[list[i]] = true;
|
|
12
|
+
}
|
|
13
|
+
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
14
|
+
}
|
|
15
|
+
const NO = () => false;
|
|
16
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
17
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
18
|
+
const isArray = Array.isArray;
|
|
19
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
20
|
+
const isFunction = (val) => typeof val === "function";
|
|
21
|
+
const isString = (val) => typeof val === "string";
|
|
22
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
23
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
24
|
+
const isPromise = (val) => {
|
|
25
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
26
|
+
};
|
|
27
|
+
const objectToString = Object.prototype.toString;
|
|
28
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
29
|
+
const toRawType = (value) => {
|
|
30
|
+
return toTypeString(value).slice(8, -1);
|
|
31
|
+
};
|
|
32
|
+
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
33
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
34
|
+
const createDep = (effects) => {
|
|
35
|
+
const dep = new Set(effects);
|
|
36
|
+
dep.w = 0;
|
|
37
|
+
dep.n = 0;
|
|
38
|
+
return dep;
|
|
39
|
+
};
|
|
40
|
+
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
41
|
+
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
42
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
43
|
+
let trackOpBit = 1;
|
|
44
|
+
let activeEffect;
|
|
45
|
+
const ITERATE_KEY = Symbol("");
|
|
46
|
+
const MAP_KEY_ITERATE_KEY = Symbol("");
|
|
47
|
+
let shouldTrack = true;
|
|
48
|
+
const trackStack = [];
|
|
49
|
+
function pauseTracking() {
|
|
50
|
+
trackStack.push(shouldTrack);
|
|
51
|
+
shouldTrack = false;
|
|
52
|
+
}
|
|
53
|
+
function resetTracking() {
|
|
54
|
+
const last = trackStack.pop();
|
|
55
|
+
shouldTrack = last === void 0 ? true : last;
|
|
56
|
+
}
|
|
57
|
+
function track(target, type, key) {
|
|
58
|
+
if (shouldTrack && activeEffect) {
|
|
59
|
+
let depsMap = targetMap.get(target);
|
|
60
|
+
if (!depsMap) {
|
|
61
|
+
targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
|
|
62
|
+
}
|
|
63
|
+
let dep = depsMap.get(key);
|
|
64
|
+
if (!dep) {
|
|
65
|
+
depsMap.set(key, dep = createDep());
|
|
66
|
+
}
|
|
67
|
+
trackEffects(dep);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
71
|
+
let shouldTrack2 = false;
|
|
72
|
+
{
|
|
73
|
+
if (!newTracked(dep)) {
|
|
74
|
+
dep.n |= trackOpBit;
|
|
75
|
+
shouldTrack2 = !wasTracked(dep);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (shouldTrack2) {
|
|
79
|
+
dep.add(activeEffect);
|
|
80
|
+
activeEffect.deps.push(dep);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
84
|
+
const depsMap = targetMap.get(target);
|
|
85
|
+
if (!depsMap) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let deps = [];
|
|
89
|
+
if (type === "clear") {
|
|
90
|
+
deps = [...depsMap.values()];
|
|
91
|
+
} else if (key === "length" && isArray(target)) {
|
|
92
|
+
depsMap.forEach((dep, key2) => {
|
|
93
|
+
if (key2 === "length" || key2 >= newValue) {
|
|
94
|
+
deps.push(dep);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
if (key !== void 0) {
|
|
99
|
+
deps.push(depsMap.get(key));
|
|
100
|
+
}
|
|
101
|
+
switch (type) {
|
|
102
|
+
case "add":
|
|
103
|
+
if (!isArray(target)) {
|
|
104
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
105
|
+
if (isMap(target)) {
|
|
106
|
+
deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
107
|
+
}
|
|
108
|
+
} else if (isIntegerKey(key)) {
|
|
109
|
+
deps.push(depsMap.get("length"));
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case "delete":
|
|
113
|
+
if (!isArray(target)) {
|
|
114
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
115
|
+
if (isMap(target)) {
|
|
116
|
+
deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case "set":
|
|
121
|
+
if (isMap(target)) {
|
|
122
|
+
deps.push(depsMap.get(ITERATE_KEY));
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (deps.length === 1) {
|
|
128
|
+
if (deps[0]) {
|
|
129
|
+
{
|
|
130
|
+
triggerEffects(deps[0]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
const effects = [];
|
|
135
|
+
for (const dep of deps) {
|
|
136
|
+
if (dep) {
|
|
137
|
+
effects.push(...dep);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
{
|
|
141
|
+
triggerEffects(createDep(effects));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
146
|
+
const effects = isArray(dep) ? dep : [...dep];
|
|
147
|
+
for (const effect of effects) {
|
|
148
|
+
if (effect.computed) {
|
|
149
|
+
triggerEffect(effect);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
for (const effect of effects) {
|
|
153
|
+
if (!effect.computed) {
|
|
154
|
+
triggerEffect(effect);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function triggerEffect(effect, debuggerEventExtraInfo) {
|
|
159
|
+
if (effect !== activeEffect || effect.allowRecurse) {
|
|
160
|
+
if (effect.scheduler) {
|
|
161
|
+
effect.scheduler();
|
|
162
|
+
} else {
|
|
163
|
+
effect.run();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
168
|
+
const builtInSymbols = new Set(
|
|
169
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
170
|
+
);
|
|
171
|
+
const get = /* @__PURE__ */ createGetter();
|
|
172
|
+
const readonlyGet = /* @__PURE__ */ createGetter(true);
|
|
173
|
+
const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
|
|
174
|
+
function createArrayInstrumentations() {
|
|
175
|
+
const instrumentations = {};
|
|
176
|
+
["includes", "indexOf", "lastIndexOf"].forEach((key) => {
|
|
177
|
+
instrumentations[key] = function(...args) {
|
|
178
|
+
const arr = toRaw(this);
|
|
179
|
+
for (let i = 0, l = this.length; i < l; i++) {
|
|
180
|
+
track(arr, "get", i + "");
|
|
181
|
+
}
|
|
182
|
+
const res = arr[key](...args);
|
|
183
|
+
if (res === -1 || res === false) {
|
|
184
|
+
return arr[key](...args.map(toRaw));
|
|
185
|
+
} else {
|
|
186
|
+
return res;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
191
|
+
instrumentations[key] = function(...args) {
|
|
192
|
+
pauseTracking();
|
|
193
|
+
const res = toRaw(this)[key].apply(this, args);
|
|
194
|
+
resetTracking();
|
|
195
|
+
return res;
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
return instrumentations;
|
|
199
|
+
}
|
|
200
|
+
function createGetter(isReadonly2 = false, shallow = false) {
|
|
201
|
+
return function get2(target, key, receiver) {
|
|
202
|
+
if (key === "__v_isReactive") {
|
|
203
|
+
return !isReadonly2;
|
|
204
|
+
} else if (key === "__v_isReadonly") {
|
|
205
|
+
return isReadonly2;
|
|
206
|
+
} else if (key === "__v_isShallow") {
|
|
207
|
+
return shallow;
|
|
208
|
+
} else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
|
|
209
|
+
return target;
|
|
210
|
+
}
|
|
211
|
+
const targetIsArray = isArray(target);
|
|
212
|
+
if (!isReadonly2 && targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
213
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
214
|
+
}
|
|
215
|
+
const res = Reflect.get(target, key, receiver);
|
|
216
|
+
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
217
|
+
return res;
|
|
218
|
+
}
|
|
219
|
+
if (!isReadonly2) {
|
|
220
|
+
track(target, "get", key);
|
|
221
|
+
}
|
|
222
|
+
if (shallow) {
|
|
223
|
+
return res;
|
|
224
|
+
}
|
|
225
|
+
if (isRef(res)) {
|
|
226
|
+
return targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
227
|
+
}
|
|
228
|
+
if (isObject(res)) {
|
|
229
|
+
return isReadonly2 ? readonly(res) : reactive(res);
|
|
230
|
+
}
|
|
231
|
+
return res;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const set = /* @__PURE__ */ createSetter();
|
|
235
|
+
function createSetter(shallow = false) {
|
|
236
|
+
return function set2(target, key, value, receiver) {
|
|
237
|
+
let oldValue = target[key];
|
|
238
|
+
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
if (!shallow) {
|
|
242
|
+
if (!isShallow(value) && !isReadonly(value)) {
|
|
243
|
+
oldValue = toRaw(oldValue);
|
|
244
|
+
value = toRaw(value);
|
|
245
|
+
}
|
|
246
|
+
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
247
|
+
oldValue.value = value;
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
252
|
+
const result = Reflect.set(target, key, value, receiver);
|
|
253
|
+
if (target === toRaw(receiver)) {
|
|
254
|
+
if (!hadKey) {
|
|
255
|
+
trigger(target, "add", key, value);
|
|
256
|
+
} else if (hasChanged(value, oldValue)) {
|
|
257
|
+
trigger(target, "set", key, value);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function deleteProperty(target, key) {
|
|
264
|
+
const hadKey = hasOwn(target, key);
|
|
265
|
+
target[key];
|
|
266
|
+
const result = Reflect.deleteProperty(target, key);
|
|
267
|
+
if (result && hadKey) {
|
|
268
|
+
trigger(target, "delete", key, void 0);
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
function has(target, key) {
|
|
273
|
+
const result = Reflect.has(target, key);
|
|
274
|
+
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
275
|
+
track(target, "has", key);
|
|
276
|
+
}
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
function ownKeys(target) {
|
|
280
|
+
track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
|
|
281
|
+
return Reflect.ownKeys(target);
|
|
282
|
+
}
|
|
283
|
+
const mutableHandlers = {
|
|
284
|
+
get,
|
|
285
|
+
set,
|
|
286
|
+
deleteProperty,
|
|
287
|
+
has,
|
|
288
|
+
ownKeys
|
|
289
|
+
};
|
|
290
|
+
const readonlyHandlers = {
|
|
291
|
+
get: readonlyGet,
|
|
292
|
+
set(target, key) {
|
|
293
|
+
return true;
|
|
294
|
+
},
|
|
295
|
+
deleteProperty(target, key) {
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const toShallow = (value) => value;
|
|
300
|
+
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
301
|
+
function get$1(target, key, isReadonly2 = false, isShallow2 = false) {
|
|
302
|
+
target = target["__v_raw"];
|
|
303
|
+
const rawTarget = toRaw(target);
|
|
304
|
+
const rawKey = toRaw(key);
|
|
305
|
+
if (!isReadonly2) {
|
|
306
|
+
if (key !== rawKey) {
|
|
307
|
+
track(rawTarget, "get", key);
|
|
308
|
+
}
|
|
309
|
+
track(rawTarget, "get", rawKey);
|
|
310
|
+
}
|
|
311
|
+
const { has: has2 } = getProto(rawTarget);
|
|
312
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
313
|
+
if (has2.call(rawTarget, key)) {
|
|
314
|
+
return wrap(target.get(key));
|
|
315
|
+
} else if (has2.call(rawTarget, rawKey)) {
|
|
316
|
+
return wrap(target.get(rawKey));
|
|
317
|
+
} else if (target !== rawTarget) {
|
|
318
|
+
target.get(key);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function has$1(key, isReadonly2 = false) {
|
|
322
|
+
const target = this["__v_raw"];
|
|
323
|
+
const rawTarget = toRaw(target);
|
|
324
|
+
const rawKey = toRaw(key);
|
|
325
|
+
if (!isReadonly2) {
|
|
326
|
+
if (key !== rawKey) {
|
|
327
|
+
track(rawTarget, "has", key);
|
|
328
|
+
}
|
|
329
|
+
track(rawTarget, "has", rawKey);
|
|
330
|
+
}
|
|
331
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
332
|
+
}
|
|
333
|
+
function size(target, isReadonly2 = false) {
|
|
334
|
+
target = target["__v_raw"];
|
|
335
|
+
!isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
336
|
+
return Reflect.get(target, "size", target);
|
|
337
|
+
}
|
|
338
|
+
function add(value) {
|
|
339
|
+
value = toRaw(value);
|
|
340
|
+
const target = toRaw(this);
|
|
341
|
+
const proto = getProto(target);
|
|
342
|
+
const hadKey = proto.has.call(target, value);
|
|
343
|
+
if (!hadKey) {
|
|
344
|
+
target.add(value);
|
|
345
|
+
trigger(target, "add", value, value);
|
|
346
|
+
}
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
349
|
+
function set$1(key, value) {
|
|
350
|
+
value = toRaw(value);
|
|
351
|
+
const target = toRaw(this);
|
|
352
|
+
const { has: has2, get: get2 } = getProto(target);
|
|
353
|
+
let hadKey = has2.call(target, key);
|
|
354
|
+
if (!hadKey) {
|
|
355
|
+
key = toRaw(key);
|
|
356
|
+
hadKey = has2.call(target, key);
|
|
357
|
+
}
|
|
358
|
+
const oldValue = get2.call(target, key);
|
|
359
|
+
target.set(key, value);
|
|
360
|
+
if (!hadKey) {
|
|
361
|
+
trigger(target, "add", key, value);
|
|
362
|
+
} else if (hasChanged(value, oldValue)) {
|
|
363
|
+
trigger(target, "set", key, value);
|
|
364
|
+
}
|
|
365
|
+
return this;
|
|
366
|
+
}
|
|
367
|
+
function deleteEntry(key) {
|
|
368
|
+
const target = toRaw(this);
|
|
369
|
+
const { has: has2, get: get2 } = getProto(target);
|
|
370
|
+
let hadKey = has2.call(target, key);
|
|
371
|
+
if (!hadKey) {
|
|
372
|
+
key = toRaw(key);
|
|
373
|
+
hadKey = has2.call(target, key);
|
|
374
|
+
}
|
|
375
|
+
get2 ? get2.call(target, key) : void 0;
|
|
376
|
+
const result = target.delete(key);
|
|
377
|
+
if (hadKey) {
|
|
378
|
+
trigger(target, "delete", key, void 0);
|
|
379
|
+
}
|
|
380
|
+
return result;
|
|
381
|
+
}
|
|
382
|
+
function clear() {
|
|
383
|
+
const target = toRaw(this);
|
|
384
|
+
const hadItems = target.size !== 0;
|
|
385
|
+
const result = target.clear();
|
|
386
|
+
if (hadItems) {
|
|
387
|
+
trigger(target, "clear", void 0, void 0);
|
|
388
|
+
}
|
|
389
|
+
return result;
|
|
390
|
+
}
|
|
391
|
+
function createForEach(isReadonly2, isShallow2) {
|
|
392
|
+
return function forEach(callback, thisArg) {
|
|
393
|
+
const observed = this;
|
|
394
|
+
const target = observed["__v_raw"];
|
|
395
|
+
const rawTarget = toRaw(target);
|
|
396
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
397
|
+
!isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
398
|
+
return target.forEach((value, key) => {
|
|
399
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
404
|
+
return function(...args) {
|
|
405
|
+
const target = this["__v_raw"];
|
|
406
|
+
const rawTarget = toRaw(target);
|
|
407
|
+
const targetIsMap = isMap(rawTarget);
|
|
408
|
+
const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
|
|
409
|
+
const isKeyOnly = method === "keys" && targetIsMap;
|
|
410
|
+
const innerIterator = target[method](...args);
|
|
411
|
+
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
412
|
+
!isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
|
|
413
|
+
return {
|
|
414
|
+
next() {
|
|
415
|
+
const { value, done } = innerIterator.next();
|
|
416
|
+
return done ? { value, done } : {
|
|
417
|
+
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
|
418
|
+
done
|
|
419
|
+
};
|
|
420
|
+
},
|
|
421
|
+
[Symbol.iterator]() {
|
|
422
|
+
return this;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function createReadonlyMethod(type) {
|
|
428
|
+
return function(...args) {
|
|
429
|
+
return type === "delete" ? false : this;
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function createInstrumentations() {
|
|
433
|
+
const mutableInstrumentations2 = {
|
|
434
|
+
get(key) {
|
|
435
|
+
return get$1(this, key);
|
|
436
|
+
},
|
|
437
|
+
get size() {
|
|
438
|
+
return size(this);
|
|
439
|
+
},
|
|
440
|
+
has: has$1,
|
|
441
|
+
add,
|
|
442
|
+
set: set$1,
|
|
443
|
+
delete: deleteEntry,
|
|
444
|
+
clear,
|
|
445
|
+
forEach: createForEach(false, false)
|
|
446
|
+
};
|
|
447
|
+
const shallowInstrumentations2 = {
|
|
448
|
+
get(key) {
|
|
449
|
+
return get$1(this, key, false, true);
|
|
450
|
+
},
|
|
451
|
+
get size() {
|
|
452
|
+
return size(this);
|
|
453
|
+
},
|
|
454
|
+
has: has$1,
|
|
455
|
+
add,
|
|
456
|
+
set: set$1,
|
|
457
|
+
delete: deleteEntry,
|
|
458
|
+
clear,
|
|
459
|
+
forEach: createForEach(false, true)
|
|
460
|
+
};
|
|
461
|
+
const readonlyInstrumentations2 = {
|
|
462
|
+
get(key) {
|
|
463
|
+
return get$1(this, key, true);
|
|
464
|
+
},
|
|
465
|
+
get size() {
|
|
466
|
+
return size(this, true);
|
|
467
|
+
},
|
|
468
|
+
has(key) {
|
|
469
|
+
return has$1.call(this, key, true);
|
|
470
|
+
},
|
|
471
|
+
add: createReadonlyMethod("add"),
|
|
472
|
+
set: createReadonlyMethod("set"),
|
|
473
|
+
delete: createReadonlyMethod("delete"),
|
|
474
|
+
clear: createReadonlyMethod("clear"),
|
|
475
|
+
forEach: createForEach(true, false)
|
|
476
|
+
};
|
|
477
|
+
const shallowReadonlyInstrumentations2 = {
|
|
478
|
+
get(key) {
|
|
479
|
+
return get$1(this, key, true, true);
|
|
480
|
+
},
|
|
481
|
+
get size() {
|
|
482
|
+
return size(this, true);
|
|
483
|
+
},
|
|
484
|
+
has(key) {
|
|
485
|
+
return has$1.call(this, key, true);
|
|
486
|
+
},
|
|
487
|
+
add: createReadonlyMethod("add"),
|
|
488
|
+
set: createReadonlyMethod("set"),
|
|
489
|
+
delete: createReadonlyMethod("delete"),
|
|
490
|
+
clear: createReadonlyMethod("clear"),
|
|
491
|
+
forEach: createForEach(true, true)
|
|
492
|
+
};
|
|
493
|
+
const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
|
|
494
|
+
iteratorMethods.forEach((method) => {
|
|
495
|
+
mutableInstrumentations2[method] = createIterableMethod(method, false, false);
|
|
496
|
+
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
497
|
+
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
498
|
+
shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
|
|
499
|
+
});
|
|
500
|
+
return [
|
|
501
|
+
mutableInstrumentations2,
|
|
502
|
+
readonlyInstrumentations2,
|
|
503
|
+
shallowInstrumentations2,
|
|
504
|
+
shallowReadonlyInstrumentations2
|
|
505
|
+
];
|
|
506
|
+
}
|
|
507
|
+
const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
|
|
508
|
+
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
509
|
+
const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
|
|
510
|
+
return (target, key, receiver) => {
|
|
511
|
+
if (key === "__v_isReactive") {
|
|
512
|
+
return !isReadonly2;
|
|
513
|
+
} else if (key === "__v_isReadonly") {
|
|
514
|
+
return isReadonly2;
|
|
515
|
+
} else if (key === "__v_raw") {
|
|
516
|
+
return target;
|
|
517
|
+
}
|
|
518
|
+
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
const mutableCollectionHandlers = {
|
|
522
|
+
get: /* @__PURE__ */ createInstrumentationGetter(false, false)
|
|
523
|
+
};
|
|
524
|
+
const readonlyCollectionHandlers = {
|
|
525
|
+
get: /* @__PURE__ */ createInstrumentationGetter(true, false)
|
|
526
|
+
};
|
|
527
|
+
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
528
|
+
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
529
|
+
const readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
530
|
+
const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
|
|
531
|
+
function targetTypeMap(rawType) {
|
|
532
|
+
switch (rawType) {
|
|
533
|
+
case "Object":
|
|
534
|
+
case "Array":
|
|
535
|
+
return 1;
|
|
536
|
+
case "Map":
|
|
537
|
+
case "Set":
|
|
538
|
+
case "WeakMap":
|
|
539
|
+
case "WeakSet":
|
|
540
|
+
return 2;
|
|
541
|
+
default:
|
|
542
|
+
return 0;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function getTargetType(value) {
|
|
546
|
+
return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
|
|
547
|
+
}
|
|
548
|
+
function reactive(target) {
|
|
549
|
+
if (isReadonly(target)) {
|
|
550
|
+
return target;
|
|
551
|
+
}
|
|
552
|
+
return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
|
|
553
|
+
}
|
|
554
|
+
function readonly(target) {
|
|
555
|
+
return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
|
|
556
|
+
}
|
|
557
|
+
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
558
|
+
if (!isObject(target)) {
|
|
559
|
+
return target;
|
|
560
|
+
}
|
|
561
|
+
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
562
|
+
return target;
|
|
563
|
+
}
|
|
564
|
+
const existingProxy = proxyMap.get(target);
|
|
565
|
+
if (existingProxy) {
|
|
566
|
+
return existingProxy;
|
|
567
|
+
}
|
|
568
|
+
const targetType = getTargetType(target);
|
|
569
|
+
if (targetType === 0) {
|
|
570
|
+
return target;
|
|
571
|
+
}
|
|
572
|
+
const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
|
|
573
|
+
proxyMap.set(target, proxy);
|
|
574
|
+
return proxy;
|
|
575
|
+
}
|
|
576
|
+
function isReadonly(value) {
|
|
577
|
+
return !!(value && value["__v_isReadonly"]);
|
|
578
|
+
}
|
|
579
|
+
function isShallow(value) {
|
|
580
|
+
return !!(value && value["__v_isShallow"]);
|
|
581
|
+
}
|
|
582
|
+
function toRaw(observed) {
|
|
583
|
+
const raw = observed && observed["__v_raw"];
|
|
584
|
+
return raw ? toRaw(raw) : observed;
|
|
585
|
+
}
|
|
586
|
+
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
587
|
+
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
588
|
+
function trackRefValue(ref2) {
|
|
589
|
+
if (shouldTrack && activeEffect) {
|
|
590
|
+
ref2 = toRaw(ref2);
|
|
591
|
+
{
|
|
592
|
+
trackEffects(ref2.dep || (ref2.dep = createDep()));
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function triggerRefValue(ref2, newVal) {
|
|
597
|
+
ref2 = toRaw(ref2);
|
|
598
|
+
if (ref2.dep) {
|
|
599
|
+
{
|
|
600
|
+
triggerEffects(ref2.dep);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function isRef(r) {
|
|
605
|
+
return !!(r && r.__v_isRef === true);
|
|
606
|
+
}
|
|
607
|
+
function ref(value) {
|
|
608
|
+
return createRef(value, false);
|
|
609
|
+
}
|
|
610
|
+
function createRef(rawValue, shallow) {
|
|
611
|
+
if (isRef(rawValue)) {
|
|
612
|
+
return rawValue;
|
|
613
|
+
}
|
|
614
|
+
return new RefImpl(rawValue, shallow);
|
|
615
|
+
}
|
|
616
|
+
class RefImpl {
|
|
617
|
+
constructor(value, __v_isShallow) {
|
|
618
|
+
this.__v_isShallow = __v_isShallow;
|
|
619
|
+
this.dep = void 0;
|
|
620
|
+
this.__v_isRef = true;
|
|
621
|
+
this._rawValue = __v_isShallow ? value : toRaw(value);
|
|
622
|
+
this._value = __v_isShallow ? value : toReactive(value);
|
|
623
|
+
}
|
|
624
|
+
get value() {
|
|
625
|
+
trackRefValue(this);
|
|
626
|
+
return this._value;
|
|
627
|
+
}
|
|
628
|
+
set value(newVal) {
|
|
629
|
+
const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
|
|
630
|
+
newVal = useDirectValue ? newVal : toRaw(newVal);
|
|
631
|
+
if (hasChanged(newVal, this._rawValue)) {
|
|
632
|
+
this._rawValue = newVal;
|
|
633
|
+
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
634
|
+
triggerRefValue(this);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function callWithErrorHandling(fn, instance, type, args) {
|
|
639
|
+
let res;
|
|
640
|
+
try {
|
|
641
|
+
res = args ? fn(...args) : fn();
|
|
642
|
+
} catch (err) {
|
|
643
|
+
handleError(err, instance, type);
|
|
644
|
+
}
|
|
645
|
+
return res;
|
|
646
|
+
}
|
|
647
|
+
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
648
|
+
if (isFunction(fn)) {
|
|
649
|
+
const res = callWithErrorHandling(fn, instance, type, args);
|
|
650
|
+
if (res && isPromise(res)) {
|
|
651
|
+
res.catch((err) => {
|
|
652
|
+
handleError(err, instance, type);
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
return res;
|
|
656
|
+
}
|
|
657
|
+
const values = [];
|
|
658
|
+
for (let i = 0; i < fn.length; i++) {
|
|
659
|
+
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
660
|
+
}
|
|
661
|
+
return values;
|
|
662
|
+
}
|
|
663
|
+
function handleError(err, instance, type, throwInDev = true) {
|
|
664
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
665
|
+
if (instance) {
|
|
666
|
+
let cur = instance.parent;
|
|
667
|
+
const exposedInstance = instance.proxy;
|
|
668
|
+
const errorInfo = type;
|
|
669
|
+
while (cur) {
|
|
670
|
+
const errorCapturedHooks = cur.ec;
|
|
671
|
+
if (errorCapturedHooks) {
|
|
672
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
673
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
cur = cur.parent;
|
|
679
|
+
}
|
|
680
|
+
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
681
|
+
if (appErrorHandler) {
|
|
682
|
+
callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
logError(err, type, contextVNode, throwInDev);
|
|
687
|
+
}
|
|
688
|
+
function logError(err, type, contextVNode, throwInDev = true) {
|
|
689
|
+
{
|
|
690
|
+
console.error(err);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
694
|
+
if (target) {
|
|
695
|
+
const hooks = target[type] || (target[type] = []);
|
|
696
|
+
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
697
|
+
if (target.isUnmounted) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
pauseTracking();
|
|
701
|
+
setCurrentInstance(target);
|
|
702
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
703
|
+
unsetCurrentInstance();
|
|
704
|
+
resetTracking();
|
|
705
|
+
return res;
|
|
706
|
+
});
|
|
707
|
+
if (prepend) {
|
|
708
|
+
hooks.unshift(wrappedHook);
|
|
709
|
+
} else {
|
|
710
|
+
hooks.push(wrappedHook);
|
|
711
|
+
}
|
|
712
|
+
return wrappedHook;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
const createHook = (lifecycle) => (hook, target = currentInstance) => injectHook(lifecycle, hook, target);
|
|
716
|
+
const onMounted = createHook("m");
|
|
717
|
+
const onUnmounted = createHook("um");
|
|
718
|
+
function createAppContext() {
|
|
719
|
+
return {
|
|
720
|
+
app: null,
|
|
721
|
+
config: {
|
|
722
|
+
isNativeTag: NO,
|
|
723
|
+
performance: false,
|
|
724
|
+
globalProperties: {},
|
|
725
|
+
optionMergeStrategies: {},
|
|
726
|
+
errorHandler: void 0,
|
|
727
|
+
warnHandler: void 0,
|
|
728
|
+
compilerOptions: {}
|
|
729
|
+
},
|
|
730
|
+
mixins: [],
|
|
731
|
+
components: {},
|
|
732
|
+
directives: {},
|
|
733
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
734
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
735
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
736
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
createAppContext();
|
|
740
|
+
let currentInstance = null;
|
|
741
|
+
const setCurrentInstance = (instance) => {
|
|
742
|
+
currentInstance = instance;
|
|
743
|
+
instance.scope.on();
|
|
744
|
+
};
|
|
745
|
+
const unsetCurrentInstance = () => {
|
|
746
|
+
currentInstance && currentInstance.scope.off();
|
|
747
|
+
currentInstance = null;
|
|
748
|
+
};
|
|
749
|
+
function useBlocState(bloc) {
|
|
750
|
+
const state = ref(bloc.state);
|
|
751
|
+
const stateSubscription = (newState) => {
|
|
752
|
+
state.value = newState;
|
|
753
|
+
};
|
|
754
|
+
onMounted(() => {
|
|
755
|
+
bloc.subscribe(stateSubscription);
|
|
756
|
+
});
|
|
757
|
+
onUnmounted(() => {
|
|
758
|
+
bloc.unsubscribe(stateSubscription);
|
|
759
|
+
});
|
|
760
|
+
return readonly(state);
|
|
761
|
+
}
|
|
7
762
|
class Bloc {
|
|
8
763
|
constructor(initialState) {
|
|
9
764
|
__publicField(this, "internalState");
|
|
@@ -29,4 +784,4 @@ class Bloc {
|
|
|
29
784
|
}
|
|
30
785
|
}
|
|
31
786
|
}
|
|
32
|
-
export { Bloc };
|
|
787
|
+
export { Bloc, useBlocState };
|
package/dist/vue-tools.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(u,l){typeof exports=="object"&&typeof module!="undefined"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(u=typeof globalThis!="undefined"?globalThis:u||self,l((u.agendize=u.agendize||{},u.agendize.tools={})))})(this,function(u){"use strict";var ae=Object.defineProperty;var ue=(u,l,b)=>l in u?ae(u,l,{enumerable:!0,configurable:!0,writable:!0,value:b}):u[l]=b;var J=(u,l,b)=>(ue(u,typeof l!="symbol"?l+"":l,b),b);function l(t,e){const n=Object.create(null),r=t.split(",");for(let s=0;s<r.length;s++)n[r[s]]=!0;return e?s=>!!n[s.toLowerCase()]:s=>!!n[s]}const b=()=>!1,mt=Object.prototype.hasOwnProperty,O=(t,e)=>mt.call(t,e),_=Array.isArray,x=t=>Q(t)==="[object Map]",z=t=>typeof t=="function",Et=t=>typeof t=="string",N=t=>typeof t=="symbol",I=t=>t!==null&&typeof t=="object",St=t=>I(t)&&z(t.then)&&z(t.catch),It=Object.prototype.toString,Q=t=>It.call(t),Mt=t=>Q(t).slice(8,-1),B=t=>Et(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,D=(t,e)=>!Object.is(t,e),G=t=>{const e=new Set(t);return e.w=0,e.n=0,e},Tt=t=>(t.w&Y)>0,Rt=t=>(t.n&Y)>0,V=new WeakMap;let Y=1,M;const m=Symbol(""),$=Symbol("");let T=!0;const X=[];function Z(){X.push(T),T=!1}function k(){const t=X.pop();T=t===void 0?!0:t}function d(t,e,n){if(T&&M){let r=V.get(t);r||V.set(t,r=new Map);let s=r.get(n);s||r.set(n,s=G()),tt(s)}}function tt(t,e){let n=!1;Rt(t)||(t.n|=Y,n=!Tt(t)),n&&(t.add(M),M.deps.push(t))}function g(t,e,n,r,s,o){const i=V.get(t);if(!i)return;let c=[];if(e==="clear")c=[...i.values()];else if(n==="length"&&_(t))i.forEach((f,h)=>{(h==="length"||h>=r)&&c.push(f)});else switch(n!==void 0&&c.push(i.get(n)),e){case"add":_(t)?B(n)&&c.push(i.get("length")):(c.push(i.get(m)),x(t)&&c.push(i.get($)));break;case"delete":_(t)||(c.push(i.get(m)),x(t)&&c.push(i.get($)));break;case"set":x(t)&&c.push(i.get(m));break}if(c.length===1)c[0]&&F(c[0]);else{const f=[];for(const h of c)h&&f.push(...h);F(G(f))}}function F(t,e){const n=_(t)?t:[...t];for(const r of n)r.computed&&et(r);for(const r of n)r.computed||et(r)}function et(t,e){(t!==M||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}const Ot=l("__proto__,__v_isRef,__isVue"),nt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(N)),xt=rt(),jt=rt(!0),st=vt();function vt(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const r=a(this);for(let o=0,i=this.length;o<i;o++)d(r,"get",o+"");const s=r[e](...n);return s===-1||s===!1?r[e](...n.map(a)):s}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...n){Z();const r=a(this)[e].apply(this,n);return k(),r}}),t}function rt(t=!1,e=!1){return function(r,s,o){if(s==="__v_isReactive")return!t;if(s==="__v_isReadonly")return t;if(s==="__v_isShallow")return e;if(s==="__v_raw"&&o===(t?e?Ut:lt:e?Ft:ft).get(r))return r;const i=_(r);if(!t&&i&&O(st,s))return Reflect.get(st,s,o);const c=Reflect.get(r,s,o);return(N(s)?nt.has(s):Ot(s))||(t||d(r,"get",s),e)?c:E(c)?i&&B(s)?c:c.value:I(c)?t?L(c):ht(c):c}}const Kt=Pt();function Pt(t=!1){return function(n,r,s,o){let i=n[r];if(W(i)&&E(i)&&!E(s))return!1;if(!t&&(!pt(s)&&!W(s)&&(i=a(i),s=a(s)),!_(n)&&E(i)&&!E(s)))return i.value=s,!0;const c=_(n)&&B(r)?Number(r)<n.length:O(n,r),f=Reflect.set(n,r,s,o);return n===a(o)&&(c?D(s,i)&&g(n,"set",r,s):g(n,"add",r,s)),f}}function Ht(t,e){const n=O(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&n&&g(t,"delete",e,void 0),r}function Ct(t,e){const n=Reflect.has(t,e);return(!N(e)||!nt.has(e))&&d(t,"has",e),n}function Wt(t){return d(t,"iterate",_(t)?"length":m),Reflect.ownKeys(t)}const At={get:xt,set:Kt,deleteProperty:Ht,has:Ct,ownKeys:Wt},zt={get:jt,set(t,e){return!0},deleteProperty(t,e){return!0}},U=t=>t,j=t=>Reflect.getPrototypeOf(t);function v(t,e,n=!1,r=!1){t=t.__v_raw;const s=a(t),o=a(e);n||(e!==o&&d(s,"get",e),d(s,"get",o));const{has:i}=j(s),c=r?U:n?q:R;if(i.call(s,e))return c(t.get(e));if(i.call(s,o))return c(t.get(o));t!==s&&t.get(e)}function K(t,e=!1){const n=this.__v_raw,r=a(n),s=a(t);return e||(t!==s&&d(r,"has",t),d(r,"has",s)),t===s?n.has(t):n.has(t)||n.has(s)}function P(t,e=!1){return t=t.__v_raw,!e&&d(a(t),"iterate",m),Reflect.get(t,"size",t)}function ot(t){t=a(t);const e=a(this);return j(e).has.call(e,t)||(e.add(t),g(e,"add",t,t)),this}function it(t,e){e=a(e);const n=a(this),{has:r,get:s}=j(n);let o=r.call(n,t);o||(t=a(t),o=r.call(n,t));const i=s.call(n,t);return n.set(t,e),o?D(e,i)&&g(n,"set",t,e):g(n,"add",t,e),this}function ct(t){const e=a(this),{has:n,get:r}=j(e);let s=n.call(e,t);s||(t=a(t),s=n.call(e,t)),r&&r.call(e,t);const o=e.delete(t);return s&&g(e,"delete",t,void 0),o}function at(){const t=a(this),e=t.size!==0,n=t.clear();return e&&g(t,"clear",void 0,void 0),n}function H(t,e){return function(r,s){const o=this,i=o.__v_raw,c=a(i),f=e?U:t?q:R;return!t&&d(c,"iterate",m),i.forEach((h,p)=>r.call(s,f(h),f(p),o))}}function C(t,e,n){return function(...r){const s=this.__v_raw,o=a(s),i=x(o),c=t==="entries"||t===Symbol.iterator&&i,f=t==="keys"&&i,h=s[t](...r),p=n?U:e?q:R;return!e&&d(o,"iterate",f?$:m),{next(){const{value:A,done:y}=h.next();return y?{value:A,done:y}:{value:c?[p(A[0]),p(A[1])]:p(A),done:y}},[Symbol.iterator](){return this}}}}function w(t){return function(...e){return t==="delete"?!1:this}}function Nt(){const t={get(o){return v(this,o)},get size(){return P(this)},has:K,add:ot,set:it,delete:ct,clear:at,forEach:H(!1,!1)},e={get(o){return v(this,o,!1,!0)},get size(){return P(this)},has:K,add:ot,set:it,delete:ct,clear:at,forEach:H(!1,!0)},n={get(o){return v(this,o,!0)},get size(){return P(this,!0)},has(o){return K.call(this,o,!0)},add:w("add"),set:w("set"),delete:w("delete"),clear:w("clear"),forEach:H(!0,!1)},r={get(o){return v(this,o,!0,!0)},get size(){return P(this,!0)},has(o){return K.call(this,o,!0)},add:w("add"),set:w("set"),delete:w("delete"),clear:w("clear"),forEach:H(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=C(o,!1,!1),n[o]=C(o,!0,!1),e[o]=C(o,!1,!0),r[o]=C(o,!0,!0)}),[t,n,e,r]}const[Bt,Dt,Gt,Vt]=Nt();function ut(t,e){const n=e?t?Vt:Gt:t?Dt:Bt;return(r,s,o)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?r:Reflect.get(O(n,s)&&s in r?n:r,s,o)}const Yt={get:ut(!1,!1)},$t={get:ut(!0,!1)},ft=new WeakMap,Ft=new WeakMap,lt=new WeakMap,Ut=new WeakMap;function Lt(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qt(t){return t.__v_skip||!Object.isExtensible(t)?0:Lt(Mt(t))}function ht(t){return W(t)?t:dt(t,!1,At,Yt,ft)}function L(t){return dt(t,!0,zt,$t,lt)}function dt(t,e,n,r,s){if(!I(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=s.get(t);if(o)return o;const i=qt(t);if(i===0)return t;const c=new Proxy(t,i===2?r:n);return s.set(t,c),c}function W(t){return!!(t&&t.__v_isReadonly)}function pt(t){return!!(t&&t.__v_isShallow)}function a(t){const e=t&&t.__v_raw;return e?a(e):t}const R=t=>I(t)?ht(t):t,q=t=>I(t)?L(t):t;function yt(t){T&&M&&(t=a(t),tt(t.dep||(t.dep=G())))}function Jt(t,e){t=a(t),t.dep&&F(t.dep)}function E(t){return!!(t&&t.__v_isRef===!0)}function Qt(t){return Xt(t,!1)}function Xt(t,e){return E(t)?t:new Zt(t,e)}class Zt{constructor(e,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?e:a(e),this._value=n?e:R(e)}get value(){return yt(this),this._value}set value(e){const n=this.__v_isShallow||pt(e)||W(e);e=n?e:a(e),D(e,this._rawValue)&&(this._rawValue=e,this._value=n?e:R(e),Jt(this))}}function _t(t,e,n,r){let s;try{s=r?t(...r):t()}catch(o){wt(o,e,n)}return s}function gt(t,e,n,r){if(z(t)){const o=_t(t,e,n,r);return o&&St(o)&&o.catch(i=>{wt(i,e,n)}),o}const s=[];for(let o=0;o<t.length;o++)s.push(gt(t[o],e,n,r));return s}function wt(t,e,n,r=!0){const s=e?e.vnode:null;if(e){let o=e.parent;const i=e.proxy,c=n;for(;o;){const h=o.ec;if(h){for(let p=0;p<h.length;p++)if(h[p](t,i,c)===!1)return}o=o.parent}const f=e.appContext.config.errorHandler;if(f){_t(f,null,10,[t,i,c]);return}}kt(t,n,s,r)}function kt(t,e,n,r=!0){console.error(t)}function te(t,e,n=S,r=!1){if(n){const s=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...i)=>{if(n.isUnmounted)return;Z(),re(n);const c=gt(e,n,t,i);return oe(),k(),c});return r?s.unshift(o):s.push(o),o}}const bt=t=>(e,n=S)=>te(t,e,n),ee=bt("m"),ne=bt("um");function se(){return{app:null,config:{isNativeTag:b,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}se();let S=null;const re=t=>{S=t,t.scope.on()},oe=()=>{S&&S.scope.off(),S=null};function ie(t){const e=Qt(t.state),n=r=>{e.value=r};return ee(()=>{t.subscribe(n)}),ne(()=>{t.unsubscribe(n)}),L(e)}class ce{constructor(e){J(this,"internalState");J(this,"listeners",[]);this.internalState=e}get state(){return this.internalState}changeState(e){this.internalState=e,this.listeners.length>0&&this.listeners.forEach(n=>n(this.state))}subscribe(e){this.listeners.push(e)}unsubscribe(e){const n=this.listeners.indexOf(e);n>-1&&this.listeners.splice(n,1)}}u.Bloc=ce,u.useBlocState=ie,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|