pinia-react 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +508 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +106 -0
- package/dist/index.d.ts +44 -8
- package/dist/index.js +169 -94
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
createPinia: () => createPinia,
|
|
24
|
+
defineStore: () => defineStore,
|
|
25
|
+
getActivePinia: () => getActivePinia,
|
|
26
|
+
setActivePinia: () => setActivePinia
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/rootStore.ts
|
|
31
|
+
var activePinia;
|
|
32
|
+
function setActivePinia(pinia) {
|
|
33
|
+
activePinia = pinia;
|
|
34
|
+
}
|
|
35
|
+
function getActivePinia() {
|
|
36
|
+
if (!activePinia) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
"[pinia-react] getActivePinia was called with no active Pinia. Did you forget to install pinia?\nconst pinia = createPinia() or createPinia() first.\n"
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return activePinia;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/createPinia.ts
|
|
45
|
+
function createPinia() {
|
|
46
|
+
const state = {};
|
|
47
|
+
const _p = [];
|
|
48
|
+
const _s = /* @__PURE__ */ new Map();
|
|
49
|
+
const _scopes = /* @__PURE__ */ new Map();
|
|
50
|
+
const _m = /* @__PURE__ */ new Set();
|
|
51
|
+
const pinia = {
|
|
52
|
+
use(plugin) {
|
|
53
|
+
if (_s.size > 0) {
|
|
54
|
+
console.warn(
|
|
55
|
+
"[pinia-react] A plugin was registered after stores were created. The new plugin will not be applied to the stores that already exist."
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
_p.push(plugin);
|
|
59
|
+
return this;
|
|
60
|
+
},
|
|
61
|
+
onMutation(listener) {
|
|
62
|
+
_m.add(listener);
|
|
63
|
+
return () => _m.delete(listener);
|
|
64
|
+
},
|
|
65
|
+
_p,
|
|
66
|
+
_s,
|
|
67
|
+
_scopes,
|
|
68
|
+
_m,
|
|
69
|
+
state
|
|
70
|
+
};
|
|
71
|
+
setActivePinia(pinia);
|
|
72
|
+
return pinia;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/store.ts
|
|
76
|
+
var import_immer = require("immer");
|
|
77
|
+
var import_react = require("react");
|
|
78
|
+
(0, import_immer.enablePatches)();
|
|
79
|
+
var immer = new import_immer.Immer({ autoFreeze: false });
|
|
80
|
+
var activeListenerId = null;
|
|
81
|
+
var activeGetterKey = null;
|
|
82
|
+
var storeDefinitionByPinia = /* @__PURE__ */ new WeakMap();
|
|
83
|
+
function isAffected(patches, trackedPaths) {
|
|
84
|
+
if (trackedPaths.size === 0) return false;
|
|
85
|
+
const tracked = Array.from(trackedPaths);
|
|
86
|
+
for (const patch of patches) {
|
|
87
|
+
const patchPath = patch.path.map(String);
|
|
88
|
+
for (const trackedPath of tracked) {
|
|
89
|
+
const len = Math.min(patchPath.length, trackedPath.length);
|
|
90
|
+
let isPrefixMatch = true;
|
|
91
|
+
for (let i = 0; i < len; i++) {
|
|
92
|
+
if (patchPath[i] !== trackedPath[i]) {
|
|
93
|
+
isPrefixMatch = false;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (isPrefixMatch) return true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
function isPlainObjectOrArray(value) {
|
|
103
|
+
if (Array.isArray(value)) return true;
|
|
104
|
+
if (value === null || typeof value !== "object") return false;
|
|
105
|
+
const proto = Object.getPrototypeOf(value);
|
|
106
|
+
return proto === Object.prototype || proto === null;
|
|
107
|
+
}
|
|
108
|
+
function defineStore(id, options) {
|
|
109
|
+
const getters = options.getters || {};
|
|
110
|
+
function ensureStoreInstance(pinia) {
|
|
111
|
+
if (pinia._s.has(id)) {
|
|
112
|
+
if (storeDefinitionByPinia.get(pinia)?.get(id) === options) return;
|
|
113
|
+
console.warn(
|
|
114
|
+
`[pinia-react] Duplicate store id "${id}" detected. The new definition replaces the previous store with the same id.`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
createStoreInstance();
|
|
118
|
+
}
|
|
119
|
+
function resolveGetterDependencies(getterName, getterDepsMap, visited = /* @__PURE__ */ new Set()) {
|
|
120
|
+
if (visited.has(getterName)) {
|
|
121
|
+
console.warn(`[pinia-react] Circular dependency in getters detected involving: ${getterName}`);
|
|
122
|
+
return /* @__PURE__ */ new Set();
|
|
123
|
+
}
|
|
124
|
+
visited.add(getterName);
|
|
125
|
+
const finalDeps = /* @__PURE__ */ new Set();
|
|
126
|
+
const directDeps = getterDepsMap.get(getterName);
|
|
127
|
+
if (!directDeps) return finalDeps;
|
|
128
|
+
for (const dep of directDeps) {
|
|
129
|
+
const getterKey = dep.length === 1 ? dep[0] : void 0;
|
|
130
|
+
if (getterKey && getterKey in getters) {
|
|
131
|
+
const nestedDeps = resolveGetterDependencies(getterKey, getterDepsMap, visited);
|
|
132
|
+
nestedDeps.forEach((d) => finalDeps.add(d));
|
|
133
|
+
} else {
|
|
134
|
+
finalDeps.add(dep);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return finalDeps;
|
|
138
|
+
}
|
|
139
|
+
function createStoreInstance() {
|
|
140
|
+
const pinia = getActivePinia();
|
|
141
|
+
const initialState = options.state();
|
|
142
|
+
let storePublicApi;
|
|
143
|
+
const localScope = {
|
|
144
|
+
currentState: initialState,
|
|
145
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
146
|
+
getterResultCache: /* @__PURE__ */ new Map(),
|
|
147
|
+
getterDependencies: /* @__PURE__ */ new Map(),
|
|
148
|
+
subscribers: /* @__PURE__ */ new Map(),
|
|
149
|
+
createStoreProxy: (_onAccess) => storePublicApi
|
|
150
|
+
};
|
|
151
|
+
pinia._scopes.set(id, localScope);
|
|
152
|
+
let definitionsById = storeDefinitionByPinia.get(pinia);
|
|
153
|
+
if (!definitionsById) {
|
|
154
|
+
definitionsById = /* @__PURE__ */ new Map();
|
|
155
|
+
storeDefinitionByPinia.set(pinia, definitionsById);
|
|
156
|
+
}
|
|
157
|
+
definitionsById.set(id, options);
|
|
158
|
+
const isGetterComputing = /* @__PURE__ */ new Set();
|
|
159
|
+
const emit = (nextState, oldState, patches) => {
|
|
160
|
+
localScope.listeners.forEach((fn) => fn(nextState, oldState, patches));
|
|
161
|
+
localScope.subscribers.forEach((getterKeys, storeId) => {
|
|
162
|
+
const subscriberScope = pinia._scopes.get(storeId);
|
|
163
|
+
if (!subscriberScope) return;
|
|
164
|
+
let shouldNotify = false;
|
|
165
|
+
getterKeys.forEach((key) => {
|
|
166
|
+
if (subscriberScope.getterResultCache.has(key)) {
|
|
167
|
+
subscriberScope.getterResultCache.delete(key);
|
|
168
|
+
shouldNotify = true;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
if (shouldNotify) {
|
|
172
|
+
const oldSubState = subscriberScope.currentState;
|
|
173
|
+
const newSubState = { ...oldSubState };
|
|
174
|
+
subscriberScope.currentState = newSubState;
|
|
175
|
+
pinia.state[storeId] = newSubState;
|
|
176
|
+
subscriberScope.listeners.forEach((fn) => fn(newSubState, oldSubState, []));
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
const internalPatch = (updater, meta) => {
|
|
181
|
+
const oldState = localScope.currentState;
|
|
182
|
+
let patches = [];
|
|
183
|
+
const nextState = immer.produce(oldState, updater, (p) => {
|
|
184
|
+
patches = p;
|
|
185
|
+
});
|
|
186
|
+
if (patches.length > 0 || meta.type === "reset") {
|
|
187
|
+
localScope.currentState = nextState;
|
|
188
|
+
pinia.state[id] = nextState;
|
|
189
|
+
emit(nextState, oldState, patches);
|
|
190
|
+
const event = {
|
|
191
|
+
storeId: id,
|
|
192
|
+
store: storePublicApi,
|
|
193
|
+
state: nextState,
|
|
194
|
+
prevState: oldState,
|
|
195
|
+
patches,
|
|
196
|
+
meta
|
|
197
|
+
};
|
|
198
|
+
pinia._m.forEach((listener) => listener(event));
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const $patch = (updater) => {
|
|
202
|
+
internalPatch(
|
|
203
|
+
(draft) => {
|
|
204
|
+
updater(draft);
|
|
205
|
+
},
|
|
206
|
+
{ type: "patch" }
|
|
207
|
+
);
|
|
208
|
+
};
|
|
209
|
+
const $reset = () => internalPatch(() => options.state(), { type: "reset" });
|
|
210
|
+
const restoreState = (state, options2 = {}) => {
|
|
211
|
+
internalPatch(() => state, {
|
|
212
|
+
type: options2.type ?? "restore",
|
|
213
|
+
origin: options2.origin
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
const $subscribe = (callback) => {
|
|
217
|
+
const listener = (state, prev) => callback(state, prev);
|
|
218
|
+
localScope.listeners.add(listener);
|
|
219
|
+
return () => localScope.listeners.delete(listener);
|
|
220
|
+
};
|
|
221
|
+
const getterInvalidationListener = (_state, _prevState, patches) => {
|
|
222
|
+
localScope.getterDependencies.forEach((_deps, getterName) => {
|
|
223
|
+
const resolvedDeps = resolveGetterDependencies(getterName, localScope.getterDependencies);
|
|
224
|
+
if (isAffected(patches, resolvedDeps)) {
|
|
225
|
+
localScope.getterResultCache.delete(getterName);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
localScope.listeners.add(getterInvalidationListener);
|
|
230
|
+
const originalActions = options.actions || {};
|
|
231
|
+
const wrappedActions = {};
|
|
232
|
+
const proxyTarget = {};
|
|
233
|
+
const readonlyStateProxyCache = /* @__PURE__ */ new WeakMap();
|
|
234
|
+
const readonlyWarning = () => {
|
|
235
|
+
console.warn(`[${id}] Store is read-only. Use actions for mutations.`);
|
|
236
|
+
throw new TypeError(`[${id}] Store is read-only. Use actions for mutations.`);
|
|
237
|
+
};
|
|
238
|
+
const createReadonlyStateProxy = (stateTarget) => {
|
|
239
|
+
const cached = readonlyStateProxyCache.get(stateTarget);
|
|
240
|
+
if (cached) return cached;
|
|
241
|
+
const proxy = new Proxy(stateTarget, {
|
|
242
|
+
get(obj, key) {
|
|
243
|
+
const value = Reflect.get(obj, key);
|
|
244
|
+
if (isPlainObjectOrArray(value)) return createReadonlyStateProxy(value);
|
|
245
|
+
return value;
|
|
246
|
+
},
|
|
247
|
+
set: readonlyWarning,
|
|
248
|
+
deleteProperty: readonlyWarning
|
|
249
|
+
});
|
|
250
|
+
readonlyStateProxyCache.set(stateTarget, proxy);
|
|
251
|
+
return proxy;
|
|
252
|
+
};
|
|
253
|
+
const getAtPath = (path) => {
|
|
254
|
+
let value = localScope.currentState;
|
|
255
|
+
for (const key of path) value = value[key];
|
|
256
|
+
return value;
|
|
257
|
+
};
|
|
258
|
+
const setAtPath = (draft, path, value) => {
|
|
259
|
+
let target = draft;
|
|
260
|
+
for (let i = 0; i < path.length - 1; i++) target = target[path[i]];
|
|
261
|
+
target[path[path.length - 1]] = value;
|
|
262
|
+
};
|
|
263
|
+
const deleteAtPath = (draft, path) => {
|
|
264
|
+
let target = draft;
|
|
265
|
+
for (let i = 0; i < path.length - 1; i++) target = target[path[i]];
|
|
266
|
+
delete target[path[path.length - 1]];
|
|
267
|
+
};
|
|
268
|
+
const createActionStateProxy = (path, meta) => {
|
|
269
|
+
return new Proxy(Array.isArray(getAtPath(path)) ? [] : {}, {
|
|
270
|
+
get(_target, key, receiver) {
|
|
271
|
+
const current = getAtPath(path);
|
|
272
|
+
const value = Reflect.get(current, key, receiver);
|
|
273
|
+
if (typeof key === "symbol" || !isPlainObjectOrArray(value)) return value;
|
|
274
|
+
return createActionStateProxy([...path, String(key)], meta);
|
|
275
|
+
},
|
|
276
|
+
set(_target, key, value) {
|
|
277
|
+
internalPatch((draft) => setAtPath(draft, [...path, String(key)], value), meta);
|
|
278
|
+
return true;
|
|
279
|
+
},
|
|
280
|
+
deleteProperty(_target, key) {
|
|
281
|
+
internalPatch((draft) => deleteAtPath(draft, [...path, String(key)]), meta);
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
function createStoreProxy(onAccess) {
|
|
287
|
+
const createStateProxy = (stateTarget, path, onDeepAccess, trackObjectAccess = false) => {
|
|
288
|
+
return new Proxy(stateTarget, {
|
|
289
|
+
get(obj, key) {
|
|
290
|
+
if (typeof key === "symbol") return Reflect.get(obj, key);
|
|
291
|
+
const currentPath = [...path, String(key)];
|
|
292
|
+
const value = Reflect.get(obj, key);
|
|
293
|
+
if (isPlainObjectOrArray(value)) {
|
|
294
|
+
if (trackObjectAccess) onDeepAccess?.(currentPath);
|
|
295
|
+
return createStateProxy(value, currentPath, onDeepAccess, trackObjectAccess);
|
|
296
|
+
}
|
|
297
|
+
onDeepAccess?.(currentPath);
|
|
298
|
+
return value;
|
|
299
|
+
},
|
|
300
|
+
set: readonlyWarning,
|
|
301
|
+
deleteProperty: readonlyWarning
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
return new Proxy(proxyTarget, {
|
|
305
|
+
get(_target, key, receiver) {
|
|
306
|
+
const strKey = String(key);
|
|
307
|
+
if (strKey === "$state") {
|
|
308
|
+
onAccess?.(["$state"]);
|
|
309
|
+
return createReadonlyStateProxy(localScope.currentState);
|
|
310
|
+
}
|
|
311
|
+
if (strKey === "$id") return id;
|
|
312
|
+
if (strKey === "$patch") return $patch;
|
|
313
|
+
if (strKey === "$reset") return $reset;
|
|
314
|
+
if (strKey === "$subscribe") return $subscribe;
|
|
315
|
+
const state = localScope.currentState;
|
|
316
|
+
if (strKey in state) {
|
|
317
|
+
const value = state[strKey];
|
|
318
|
+
if (isPlainObjectOrArray(value)) {
|
|
319
|
+
return createStateProxy(value, [strKey], onAccess);
|
|
320
|
+
}
|
|
321
|
+
onAccess?.([strKey]);
|
|
322
|
+
return value;
|
|
323
|
+
}
|
|
324
|
+
if (strKey in getters) {
|
|
325
|
+
onAccess?.([strKey]);
|
|
326
|
+
if (localScope.getterResultCache.has(strKey)) return localScope.getterResultCache.get(strKey);
|
|
327
|
+
if (isGetterComputing.has(strKey)) {
|
|
328
|
+
console.warn(`[pinia-react] Circular dependency detected in getter "${strKey}"`);
|
|
329
|
+
return void 0;
|
|
330
|
+
}
|
|
331
|
+
isGetterComputing.add(strKey);
|
|
332
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
333
|
+
const prevListenerId = activeListenerId;
|
|
334
|
+
const prevGetterKey = activeGetterKey;
|
|
335
|
+
activeListenerId = id;
|
|
336
|
+
activeGetterKey = strKey;
|
|
337
|
+
try {
|
|
338
|
+
const onGetterAccess = (path) => {
|
|
339
|
+
dependencies.add(path);
|
|
340
|
+
};
|
|
341
|
+
const trackingProxyForThis = createStoreProxy(onGetterAccess);
|
|
342
|
+
const trackingStateProxy = createStateProxy(state, [], onGetterAccess, true);
|
|
343
|
+
const result = getters[strKey].call(trackingProxyForThis, trackingStateProxy);
|
|
344
|
+
localScope.getterDependencies.set(strKey, dependencies);
|
|
345
|
+
localScope.getterResultCache.set(strKey, result);
|
|
346
|
+
return result;
|
|
347
|
+
} finally {
|
|
348
|
+
activeListenerId = prevListenerId;
|
|
349
|
+
activeGetterKey = prevGetterKey;
|
|
350
|
+
isGetterComputing.delete(strKey);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (strKey in wrappedActions) {
|
|
354
|
+
return wrappedActions[strKey];
|
|
355
|
+
}
|
|
356
|
+
return Reflect.get(_target, key, receiver);
|
|
357
|
+
},
|
|
358
|
+
set(_target, key, value, receiver) {
|
|
359
|
+
const strKey = String(key);
|
|
360
|
+
if (strKey === "$state") {
|
|
361
|
+
console.warn(`[${id}] Do not replace "$state" directly. Use "$patch()" to replace the whole state.`);
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
if (strKey === "$id") return readonlyWarning();
|
|
365
|
+
if (strKey in localScope.currentState || strKey in getters || strKey in wrappedActions) {
|
|
366
|
+
return readonlyWarning();
|
|
367
|
+
}
|
|
368
|
+
return Reflect.set(_target, key, value, receiver);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
storePublicApi = createStoreProxy();
|
|
373
|
+
Object.keys(originalActions).forEach((actionName) => {
|
|
374
|
+
const originalAction = originalActions[actionName];
|
|
375
|
+
wrappedActions[actionName] = (...args) => {
|
|
376
|
+
let returnValue;
|
|
377
|
+
let draftActive = true;
|
|
378
|
+
const meta = { type: "action", action: actionName, args };
|
|
379
|
+
const recipe = (draft) => {
|
|
380
|
+
const actionContextProxy = new Proxy({}, {
|
|
381
|
+
get(_, key) {
|
|
382
|
+
const strKey = String(key);
|
|
383
|
+
if (draftActive && Reflect.has(draft, strKey)) return draft[strKey];
|
|
384
|
+
if (!draftActive && Reflect.has(localScope.currentState, strKey)) {
|
|
385
|
+
const value = localScope.currentState[strKey];
|
|
386
|
+
if (value !== null && typeof value === "object") return createActionStateProxy([strKey], meta);
|
|
387
|
+
return value;
|
|
388
|
+
}
|
|
389
|
+
if (strKey in getters) {
|
|
390
|
+
if (draftActive) return getters[strKey].call(actionContextProxy, draft);
|
|
391
|
+
return Reflect.get(storePublicApi, key, storePublicApi);
|
|
392
|
+
}
|
|
393
|
+
return Reflect.get(storePublicApi, key, storePublicApi);
|
|
394
|
+
},
|
|
395
|
+
set(_, key, value) {
|
|
396
|
+
const path = [String(key)];
|
|
397
|
+
if (draftActive) draft[path[0]] = value;
|
|
398
|
+
else internalPatch((currentDraft) => setAtPath(currentDraft, path, value), meta);
|
|
399
|
+
return true;
|
|
400
|
+
},
|
|
401
|
+
deleteProperty(_, key) {
|
|
402
|
+
const path = [String(key)];
|
|
403
|
+
if (draftActive) delete draft[path[0]];
|
|
404
|
+
else internalPatch((currentDraft) => deleteAtPath(currentDraft, path), meta);
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
returnValue = originalAction.apply(actionContextProxy, args);
|
|
409
|
+
};
|
|
410
|
+
internalPatch(recipe, meta);
|
|
411
|
+
draftActive = false;
|
|
412
|
+
return returnValue;
|
|
413
|
+
};
|
|
414
|
+
});
|
|
415
|
+
localScope.createStoreProxy = createStoreProxy;
|
|
416
|
+
pinia._p.forEach((plugin) => {
|
|
417
|
+
const pluginResult = plugin({
|
|
418
|
+
id,
|
|
419
|
+
store: storePublicApi,
|
|
420
|
+
options,
|
|
421
|
+
pinia,
|
|
422
|
+
restoreState
|
|
423
|
+
});
|
|
424
|
+
if (pluginResult) {
|
|
425
|
+
Object.defineProperties(proxyTarget, Object.getOwnPropertyDescriptors(pluginResult));
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
pinia._s.set(id, storePublicApi);
|
|
429
|
+
return storePublicApi;
|
|
430
|
+
}
|
|
431
|
+
function getStore() {
|
|
432
|
+
const pinia = getActivePinia();
|
|
433
|
+
ensureStoreInstance(pinia);
|
|
434
|
+
if (activeListenerId && activeGetterKey && activeListenerId !== id) {
|
|
435
|
+
const accessedStoreScope = pinia._scopes.get(id);
|
|
436
|
+
if (accessedStoreScope) {
|
|
437
|
+
let subscribers = accessedStoreScope.subscribers.get(activeListenerId);
|
|
438
|
+
if (!subscribers) {
|
|
439
|
+
subscribers = /* @__PURE__ */ new Set();
|
|
440
|
+
accessedStoreScope.subscribers.set(activeListenerId, subscribers);
|
|
441
|
+
}
|
|
442
|
+
subscribers.add(activeGetterKey);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return pinia._s.get(id);
|
|
446
|
+
}
|
|
447
|
+
function useStore() {
|
|
448
|
+
const pinia = getActivePinia();
|
|
449
|
+
ensureStoreInstance(pinia);
|
|
450
|
+
const currentScope = pinia._scopes.get(id);
|
|
451
|
+
const trackedPaths = (0, import_react.useRef)(/* @__PURE__ */ new Set());
|
|
452
|
+
trackedPaths.current.clear();
|
|
453
|
+
const subscribe = (0, import_react.useCallback)(
|
|
454
|
+
(onStoreChange) => {
|
|
455
|
+
const listener = (_state, _prevState, patches) => {
|
|
456
|
+
let shouldUpdate = false;
|
|
457
|
+
for (const path of trackedPaths.current) {
|
|
458
|
+
if (path.length === 1 && path[0] === "$state") {
|
|
459
|
+
shouldUpdate = patches.length > 0;
|
|
460
|
+
if (shouldUpdate) break;
|
|
461
|
+
}
|
|
462
|
+
const topKey = path[0];
|
|
463
|
+
if (path.length === 1 && topKey in getters) {
|
|
464
|
+
if (!currentScope.getterResultCache.has(topKey)) {
|
|
465
|
+
shouldUpdate = true;
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
} else {
|
|
469
|
+
if (patches.length > 0 && isAffected(patches, /* @__PURE__ */ new Set([path]))) {
|
|
470
|
+
shouldUpdate = true;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (shouldUpdate) {
|
|
476
|
+
onStoreChange();
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
currentScope.listeners.add(listener);
|
|
480
|
+
return () => currentScope.listeners.delete(listener);
|
|
481
|
+
},
|
|
482
|
+
[currentScope]
|
|
483
|
+
);
|
|
484
|
+
const getSnapshot = (0, import_react.useCallback)(() => currentScope.currentState, [currentScope]);
|
|
485
|
+
(0, import_react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
486
|
+
const trackingProxy = currentScope.createStoreProxy((path) => {
|
|
487
|
+
trackedPaths.current.add(path);
|
|
488
|
+
});
|
|
489
|
+
return trackingProxy;
|
|
490
|
+
}
|
|
491
|
+
const storeName = id.charAt(0).toUpperCase() + id.slice(1);
|
|
492
|
+
const definition = Object.assign(
|
|
493
|
+
{ useStore, getStore },
|
|
494
|
+
{
|
|
495
|
+
[`use${storeName}Store`]: useStore,
|
|
496
|
+
[`get${storeName}Store`]: getStore
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
return definition;
|
|
500
|
+
}
|
|
501
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
502
|
+
0 && (module.exports = {
|
|
503
|
+
createPinia,
|
|
504
|
+
defineStore,
|
|
505
|
+
getActivePinia,
|
|
506
|
+
setActivePinia
|
|
507
|
+
});
|
|
508
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/rootStore.ts","../src/createPinia.ts","../src/store.ts"],"sourcesContent":["export { createPinia } from './createPinia'\nexport { getActivePinia, setActivePinia } from './rootStore'\nexport { defineStore } from './store'\n\nexport type {\n DeepReadonly,\n DefineStoreOptions,\n DefineStoreOptionsBase,\n MutationEvent,\n MutationListener,\n MutationMeta,\n MutationType,\n Pinia,\n PiniaCustomProperties,\n PiniaPlugin,\n PiniaPluginContext,\n RestoreStateOptions,\n StatePath,\n StateTree,\n Store,\n StoreDefinition,\n StoreGeneric,\n SubscriptionCallback\n} from './types'\n","import type { Pinia } from './types'\n\nexport let activePinia: Pinia | undefined\n\nexport function setActivePinia(pinia: Pinia) {\n activePinia = pinia\n}\n\nexport function getActivePinia(): Pinia {\n if (!activePinia) {\n throw new Error(\n '[pinia-react] getActivePinia was called with no active Pinia. Did you forget to install pinia?\\n' +\n 'const pinia = createPinia() or createPinia() first.\\n'\n )\n }\n return activePinia\n}\n","import { setActivePinia } from './rootStore'\nimport type { MutationListener, Pinia, StateTree, StoreGeneric } from './types'\n\nexport function createPinia(): Pinia {\n const state: Record<string, StateTree> = {}\n const _p: Pinia['_p'] = []\n const _s = new Map<string, StoreGeneric>()\n const _scopes = new Map()\n const _m = new Set<MutationListener>()\n\n const pinia: Pinia = {\n use(plugin) {\n if (_s.size > 0) {\n console.warn(\n '[pinia-react] A plugin was registered after stores were created. ' +\n 'The new plugin will not be applied to the stores that already exist.'\n )\n }\n _p.push(plugin)\n return this\n },\n onMutation(listener) {\n _m.add(listener)\n return () => _m.delete(listener)\n },\n _p,\n _s,\n _scopes,\n _m,\n state\n }\n\n setActivePinia(pinia)\n\n return pinia\n}\n","import { type Draft, enablePatches, Immer, type Patch } from 'immer'\nimport { useCallback, useRef, useSyncExternalStore } from 'react'\nimport { getActivePinia } from './rootStore'\nimport type {\n DefineStoreOptions,\n MutationEvent,\n MutationMeta,\n Pinia,\n PiniaPluginContext,\n RestoreStateOptions,\n StatePath,\n StateTree,\n Store,\n StoreDefinitionWithNames,\n StoreScope,\n SubscriptionCallback,\n TransformActions\n} from './types'\n\nenablePatches()\n\n// Isolated Immer instance: keeps `autoFreeze: false` out of the host app's global Immer config.\nconst immer = new Immer({ autoFreeze: false })\n\nlet activeListenerId: string | null = null\nlet activeGetterKey: string | null = null\n\nconst storeDefinitionByPinia = new WeakMap<Pinia, Map<string, unknown>>()\n\nfunction isAffected(patches: Patch[], trackedPaths: Set<StatePath>): boolean {\n if (trackedPaths.size === 0) return false\n const tracked = Array.from(trackedPaths)\n\n for (const patch of patches) {\n const patchPath = patch.path.map(String)\n for (const trackedPath of tracked) {\n const len = Math.min(patchPath.length, trackedPath.length)\n let isPrefixMatch = true\n for (let i = 0; i < len; i++) {\n if (patchPath[i] !== trackedPath[i]) {\n isPrefixMatch = false\n break\n }\n }\n if (isPrefixMatch) return true\n }\n }\n return false\n}\n\n// Only plain objects and arrays are safe to wrap in a proxy; Date/Map/Set break their internal slots.\nfunction isPlainObjectOrArray(value: unknown): value is object {\n if (Array.isArray(value)) return true\n if (value === null || typeof value !== 'object') return false\n const proto = Object.getPrototypeOf(value)\n return proto === Object.prototype || proto === null\n}\n\nexport function defineStore<\n Id extends string,\n S extends StateTree,\n G extends Record<string, any> = {},\n A extends Record<string, any> = {}\n>(id: Id, options: DefineStoreOptions<S, G, A>): StoreDefinitionWithNames<Id, S, G, A> {\n const getters = options.getters || ({} as G)\n\n function ensureStoreInstance(pinia: Pinia) {\n if (pinia._s.has(id)) {\n if (storeDefinitionByPinia.get(pinia)?.get(id) === options) return\n console.warn(\n `[pinia-react] Duplicate store id \"${id}\" detected. The new definition replaces the previous store with the same id.`\n )\n }\n createStoreInstance()\n }\n\n function resolveGetterDependencies(\n getterName: string,\n getterDepsMap: Map<string, Set<StatePath>>,\n visited = new Set<string>()\n ): Set<StatePath> {\n if (visited.has(getterName)) {\n console.warn(`[pinia-react] Circular dependency in getters detected involving: ${getterName}`)\n return new Set()\n }\n visited.add(getterName)\n\n const finalDeps = new Set<StatePath>()\n const directDeps = getterDepsMap.get(getterName)\n\n if (!directDeps) return finalDeps\n\n for (const dep of directDeps) {\n const getterKey = dep.length === 1 ? dep[0] : undefined\n if (getterKey && getterKey in getters) {\n const nestedDeps = resolveGetterDependencies(getterKey, getterDepsMap, visited)\n nestedDeps.forEach((d) => finalDeps.add(d))\n } else {\n finalDeps.add(dep)\n }\n }\n return finalDeps\n }\n\n function createStoreInstance(): Store<Id, S, G, A> {\n const pinia = getActivePinia()\n const initialState = options.state()\n\n let storePublicApi: Store<Id, S, G, A>\n\n const localScope: StoreScope = {\n currentState: initialState,\n listeners: new Set(),\n getterResultCache: new Map(),\n getterDependencies: new Map(),\n subscribers: new Map(),\n createStoreProxy: (_onAccess?: (path: StatePath) => void) => storePublicApi as any\n }\n pinia._scopes.set(id, localScope)\n\n let definitionsById = storeDefinitionByPinia.get(pinia)\n if (!definitionsById) {\n definitionsById = new Map()\n storeDefinitionByPinia.set(pinia, definitionsById)\n }\n definitionsById.set(id, options)\n\n const isGetterComputing = new Set<string>()\n\n const emit = (nextState: S, oldState: S, patches: Patch[]) => {\n localScope.listeners.forEach((fn) => fn(nextState, oldState, patches))\n\n localScope.subscribers.forEach((getterKeys, storeId) => {\n const subscriberScope = pinia._scopes.get(storeId)\n if (!subscriberScope) return\n let shouldNotify = false\n getterKeys.forEach((key) => {\n if (subscriberScope.getterResultCache.has(key)) {\n subscriberScope.getterResultCache.delete(key)\n shouldNotify = true\n }\n })\n if (shouldNotify) {\n const oldSubState = subscriberScope.currentState\n const newSubState = { ...oldSubState }\n subscriberScope.currentState = newSubState\n pinia.state[storeId] = newSubState\n\n subscriberScope.listeners.forEach((fn) => fn(newSubState, oldSubState, []))\n }\n })\n }\n\n const internalPatch = (updater: (draft: Draft<S>) => void | S, meta: MutationMeta) => {\n const oldState = localScope.currentState as S\n let patches: Patch[] = []\n\n const nextState = immer.produce(oldState, updater as any, (p) => {\n patches = p\n }) as S\n\n if (patches.length > 0 || meta.type === 'reset') {\n localScope.currentState = nextState\n pinia.state[id] = nextState\n emit(nextState, oldState, patches)\n const event: MutationEvent<S> = {\n storeId: id,\n store: storePublicApi as any,\n state: nextState,\n prevState: oldState,\n patches,\n meta\n }\n pinia._m.forEach((listener) => listener(event))\n }\n }\n\n const $patch = (updater: (draft: Draft<S>) => void) => {\n internalPatch(\n (draft) => {\n updater(draft)\n },\n { type: 'patch' }\n )\n }\n\n const $reset = () => internalPatch(() => options.state(), { type: 'reset' })\n\n const restoreState = (state: S, options: RestoreStateOptions = {}) => {\n internalPatch(() => state, {\n type: options.type ?? 'restore',\n origin: options.origin\n })\n }\n\n const $subscribe = (callback: SubscriptionCallback<S>) => {\n const listener = (state: S, prev: S) => callback(state, prev)\n localScope.listeners.add(listener as any)\n return () => localScope.listeners.delete(listener as any)\n }\n\n const getterInvalidationListener = (_state: S, _prevState: S, patches: Patch[]) => {\n localScope.getterDependencies.forEach((_deps, getterName) => {\n const resolvedDeps = resolveGetterDependencies(getterName, localScope.getterDependencies)\n if (isAffected(patches, resolvedDeps)) {\n localScope.getterResultCache.delete(getterName)\n }\n })\n }\n localScope.listeners.add(getterInvalidationListener as any)\n\n const originalActions = options.actions || ({} as A)\n const wrappedActions = {} as TransformActions<A>\n const proxyTarget = {}\n const readonlyStateProxyCache = new WeakMap<object, object>()\n\n const readonlyWarning = () => {\n console.warn(`[${id}] Store is read-only. Use actions for mutations.`)\n throw new TypeError(`[${id}] Store is read-only. Use actions for mutations.`)\n }\n\n const createReadonlyStateProxy = (stateTarget: any): any => {\n const cached = readonlyStateProxyCache.get(stateTarget)\n if (cached) return cached\n\n const proxy = new Proxy(stateTarget, {\n get(obj, key) {\n const value = Reflect.get(obj, key)\n if (isPlainObjectOrArray(value)) return createReadonlyStateProxy(value)\n return value\n },\n set: readonlyWarning,\n deleteProperty: readonlyWarning\n })\n readonlyStateProxyCache.set(stateTarget, proxy)\n return proxy\n }\n\n const getAtPath = (path: StatePath) => {\n let value: any = localScope.currentState\n for (const key of path) value = value[key]\n return value\n }\n\n const setAtPath = (draft: Draft<S>, path: StatePath, value: unknown) => {\n let target: any = draft\n for (let i = 0; i < path.length - 1; i++) target = target[path[i]]\n target[path[path.length - 1]] = value\n }\n\n const deleteAtPath = (draft: Draft<S>, path: StatePath) => {\n let target: any = draft\n for (let i = 0; i < path.length - 1; i++) target = target[path[i]]\n delete target[path[path.length - 1]]\n }\n\n const createActionStateProxy = (path: StatePath, meta: MutationMeta): any => {\n return new Proxy(Array.isArray(getAtPath(path)) ? [] : {}, {\n get(_target, key, receiver) {\n const current = getAtPath(path)\n const value = Reflect.get(current, key, receiver)\n if (typeof key === 'symbol' || !isPlainObjectOrArray(value)) return value\n return createActionStateProxy([...path, String(key)], meta)\n },\n set(_target, key, value) {\n internalPatch((draft) => setAtPath(draft, [...path, String(key)], value), meta)\n return true\n },\n deleteProperty(_target, key) {\n internalPatch((draft) => deleteAtPath(draft, [...path, String(key)]), meta)\n return true\n }\n })\n }\n\n function createStoreProxy(onAccess?: (path: StatePath) => void): Store<Id, S, G, A> {\n const createStateProxy = (\n stateTarget: any,\n path: StatePath,\n onDeepAccess?: (path: StatePath) => void,\n trackObjectAccess = false\n ): any => {\n return new Proxy(stateTarget, {\n get(obj, key) {\n if (typeof key === 'symbol') return Reflect.get(obj, key)\n const currentPath = [...path, String(key)]\n const value = Reflect.get(obj, key)\n if (isPlainObjectOrArray(value)) {\n if (trackObjectAccess) onDeepAccess?.(currentPath)\n return createStateProxy(value, currentPath, onDeepAccess, trackObjectAccess)\n }\n onDeepAccess?.(currentPath)\n return value\n },\n set: readonlyWarning,\n deleteProperty: readonlyWarning\n })\n }\n\n return new Proxy(proxyTarget as any, {\n get(_target, key, receiver) {\n const strKey = String(key)\n\n if (strKey === '$state') {\n onAccess?.(['$state'])\n return createReadonlyStateProxy(localScope.currentState)\n }\n if (strKey === '$id') return id\n if (strKey === '$patch') return $patch\n if (strKey === '$reset') return $reset\n if (strKey === '$subscribe') return $subscribe\n\n const state = localScope.currentState\n if (strKey in state) {\n const value = state[strKey]\n if (isPlainObjectOrArray(value)) {\n return createStateProxy(value, [strKey], onAccess)\n }\n onAccess?.([strKey])\n return value\n }\n\n if (strKey in getters) {\n onAccess?.([strKey])\n if (localScope.getterResultCache.has(strKey)) return localScope.getterResultCache.get(strKey)\n if (isGetterComputing.has(strKey)) {\n console.warn(`[pinia-react] Circular dependency detected in getter \"${strKey}\"`)\n return undefined\n }\n\n isGetterComputing.add(strKey)\n const dependencies = new Set<StatePath>()\n const prevListenerId = activeListenerId\n const prevGetterKey = activeGetterKey\n activeListenerId = id\n activeGetterKey = strKey\n\n try {\n const onGetterAccess = (path: StatePath) => {\n dependencies.add(path)\n }\n const trackingProxyForThis = createStoreProxy(onGetterAccess)\n const trackingStateProxy = createStateProxy(state, [], onGetterAccess, true)\n const result = (getters as any)[strKey].call(trackingProxyForThis, trackingStateProxy)\n\n localScope.getterDependencies.set(strKey, dependencies)\n localScope.getterResultCache.set(strKey, result)\n return result\n } finally {\n activeListenerId = prevListenerId\n activeGetterKey = prevGetterKey\n isGetterComputing.delete(strKey)\n }\n }\n\n if (strKey in wrappedActions) {\n return (wrappedActions as any)[strKey]\n }\n\n return Reflect.get(_target, key, receiver)\n },\n set(_target, key, value, receiver) {\n const strKey = String(key)\n if (strKey === '$state') {\n console.warn(`[${id}] Do not replace \"$state\" directly. Use \"$patch()\" to replace the whole state.`)\n return false\n }\n if (strKey === '$id') return readonlyWarning()\n if (strKey in localScope.currentState || strKey in getters || strKey in wrappedActions) {\n return readonlyWarning()\n }\n return Reflect.set(_target, key, value, receiver)\n }\n }) as Store<Id, S, G, A>\n }\n\n storePublicApi = createStoreProxy()\n\n Object.keys(originalActions).forEach((actionName) => {\n const originalAction = (originalActions as any)[actionName]\n ;(wrappedActions as any)[actionName] = (...args: any[]) => {\n let returnValue: any\n let draftActive = true\n const meta: MutationMeta = { type: 'action', action: actionName, args }\n const recipe = (draft: Draft<S>) => {\n const actionContextProxy = new Proxy({} as any, {\n get(_, key) {\n const strKey = String(key)\n if (draftActive && Reflect.has(draft, strKey)) return (draft as any)[strKey]\n if (!draftActive && Reflect.has(localScope.currentState, strKey)) {\n const value = (localScope.currentState as any)[strKey]\n if (value !== null && typeof value === 'object') return createActionStateProxy([strKey], meta)\n return value\n }\n if (strKey in getters) {\n if (draftActive) return (getters as any)[strKey].call(actionContextProxy, draft)\n return Reflect.get(storePublicApi, key, storePublicApi)\n }\n return Reflect.get(storePublicApi, key, storePublicApi)\n },\n set(_, key, value) {\n const path = [String(key)]\n if (draftActive) (draft as any)[path[0]] = value\n else internalPatch((currentDraft) => setAtPath(currentDraft, path, value), meta)\n return true\n },\n deleteProperty(_, key) {\n const path = [String(key)]\n if (draftActive) delete (draft as any)[path[0]]\n else internalPatch((currentDraft) => deleteAtPath(currentDraft, path), meta)\n return true\n }\n })\n returnValue = originalAction.apply(actionContextProxy, args)\n }\n internalPatch(recipe, meta)\n draftActive = false\n return returnValue\n }\n })\n\n localScope.createStoreProxy = createStoreProxy as any\n\n pinia._p.forEach((plugin) => {\n const pluginResult = plugin({\n id,\n store: storePublicApi,\n options,\n pinia,\n restoreState\n } as PiniaPluginContext)\n if (pluginResult) {\n Object.defineProperties(proxyTarget, Object.getOwnPropertyDescriptors(pluginResult))\n }\n })\n\n pinia._s.set(id, storePublicApi as any)\n\n return storePublicApi\n }\n\n function getStore(): Store<Id, S, G, A> {\n const pinia = getActivePinia()\n ensureStoreInstance(pinia)\n\n if (activeListenerId && activeGetterKey && activeListenerId !== id) {\n const accessedStoreScope = pinia._scopes.get(id)\n if (accessedStoreScope) {\n let subscribers = accessedStoreScope.subscribers.get(activeListenerId)\n if (!subscribers) {\n subscribers = new Set()\n accessedStoreScope.subscribers.set(activeListenerId, subscribers)\n }\n subscribers.add(activeGetterKey)\n }\n }\n\n return pinia._s.get(id) as Store<Id, S, G, A>\n }\n\n function useStore(): Store<Id, S, G, A> {\n const pinia = getActivePinia()\n ensureStoreInstance(pinia)\n const currentScope = pinia._scopes.get(id)!\n\n const trackedPaths = useRef(new Set<StatePath>())\n trackedPaths.current.clear()\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => {\n const listener = (_state: S, _prevState: S, patches: Patch[]) => {\n let shouldUpdate = false\n for (const path of trackedPaths.current) {\n if (path.length === 1 && path[0] === '$state') {\n shouldUpdate = patches.length > 0\n if (shouldUpdate) break\n }\n const topKey = path[0]\n if (path.length === 1 && topKey in getters) {\n if (!currentScope.getterResultCache.has(topKey)) {\n shouldUpdate = true\n break\n }\n } else {\n if (patches.length > 0 && isAffected(patches, new Set([path]))) {\n shouldUpdate = true\n break\n }\n }\n }\n if (shouldUpdate) {\n onStoreChange()\n }\n }\n currentScope.listeners.add(listener as any)\n return () => currentScope.listeners.delete(listener as any)\n },\n [currentScope]\n )\n\n const getSnapshot = useCallback(() => currentScope.currentState, [currentScope])\n\n useSyncExternalStore(subscribe, getSnapshot, getSnapshot)\n\n const trackingProxy = currentScope.createStoreProxy((path) => {\n trackedPaths.current.add(path)\n })\n\n return trackingProxy as Store<Id, S, G, A>\n }\n\n const storeName = (id.charAt(0).toUpperCase() + id.slice(1)) as Capitalize<Id>\n\n const definition: StoreDefinitionWithNames<Id, S, G, A> = Object.assign(\n { useStore, getStore },\n {\n [`use${storeName}Store`]: useStore,\n [`get${storeName}Store`]: getStore\n }\n ) as unknown as StoreDefinitionWithNames<Id, S, G, A>\n\n return definition\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAI;AAEJ,SAAS,eAAe,OAAc;AAC3C,gBAAc;AAChB;AAEO,SAAS,iBAAwB;AACtC,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,SAAO;AACT;;;ACbO,SAAS,cAAqB;AACnC,QAAM,QAAmC,CAAC;AAC1C,QAAM,KAAkB,CAAC;AACzB,QAAM,KAAK,oBAAI,IAA0B;AACzC,QAAM,UAAU,oBAAI,IAAI;AACxB,QAAM,KAAK,oBAAI,IAAsB;AAErC,QAAM,QAAe;AAAA,IACnB,IAAI,QAAQ;AACV,UAAI,GAAG,OAAO,GAAG;AACf,gBAAQ;AAAA,UACN;AAAA,QAEF;AAAA,MACF;AACA,SAAG,KAAK,MAAM;AACd,aAAO;AAAA,IACT;AAAA,IACA,WAAW,UAAU;AACnB,SAAG,IAAI,QAAQ;AACf,aAAO,MAAM,GAAG,OAAO,QAA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