//#region ../../node_modules/@ungap/structured-clone/esm/deserialize.js
var e = typeof self == "object" ? self : globalThis, t = (t, n) => {
	let r = (e, n) => (t.set(n, e), e), i = (a) => {
		if (t.has(a)) return t.get(a);
		let [o, s] = n[a];
		switch (o) {
			case 0:
			case -1: return r(s, a);
			case 1: {
				let e = r([], a);
				for (let t of s) e.push(i(t));
				return e;
			}
			case 2: {
				let e = r({}, a);
				for (let [t, n] of s) e[i(t)] = i(n);
				return e;
			}
			case 3: return r(new Date(s), a);
			case 4: {
				let { source: e, flags: t } = s;
				return r(new RegExp(e, t), a);
			}
			case 5: {
				let e = r(/* @__PURE__ */ new Map(), a);
				for (let [t, n] of s) e.set(i(t), i(n));
				return e;
			}
			case 6: {
				let e = r(/* @__PURE__ */ new Set(), a);
				for (let t of s) e.add(i(t));
				return e;
			}
			case 7: {
				let { name: t, message: n } = s;
				return r(new e[t](n), a);
			}
			case 8: return r(BigInt(s), a);
			case "BigInt": return r(Object(BigInt(s)), a);
			case "ArrayBuffer": return r(new Uint8Array(s).buffer, s);
			case "DataView": {
				let { buffer: e } = new Uint8Array(s);
				return r(new DataView(e), s);
			}
		}
		return r(new e[o](s), a);
	};
	return i;
}, n = (e) => t(/* @__PURE__ */ new Map(), e)(0);
//#endregion
export { n as deserialize };
