"use strict";var d=Object.defineProperty;var f=(t,r)=>d(t,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./packem_shared/copyArrayLoose-ukX__AC4.cjs"),S=require("./packem_shared/copyArrayBuffer-CErFt6r1.cjs"),j=require("./packem_shared/copyBlob-CCIQ88PB.cjs"),E=require("./packem_shared/copyDataView-C9SuIdXo.cjs"),w=require("./packem_shared/copyDate-CfZZ3WAO.cjs"),h=require("./packem_shared/copyError-DGbUXsSU.cjs"),p=require("./packem_shared/copyMapLoose-CuTK-fBO.cjs"),u=require("./packem_shared/copyObjectLoose-CbVJDz5e.cjs"),l=require("./packem_shared/copyRegExpLoose-DzJvEX_n.cjs"),b=require("./packem_shared/copySetLoose-v1Cjaq91.cjs");var M=Object.defineProperty,c=f((t,r)=>M(t,"name",{value:r,configurable:!0}),"t");const s=c(t=>typeof t=="object"&&t!==null||typeof t=="function","canValueHaveProperties"),B={Array:y.copyArrayLoose,ArrayBuffer:S,Blob:j,DataView:E,Date:w,Error:h,Function:c((t,r)=>t,"Function"),Map:p.copyMapLoose,Object:u.copyObjectLoose,Promise:c(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"Promise"),RegExp:l.copyRegExpLoose,Set:b.copySetLoose,SharedArrayBuffer:c((t,r)=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"SharedArrayBuffer"),WeakMap:c(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"WeakMap"),WeakSet:c(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"WeakSet")},g=c((t,r)=>{if(!s(t))return t;const n={...B,...r?.strict?{Array:y.copyArrayStrict,Map:p.copyMapStrict,Object:u.copyObjectStrict,RegExp:l.copyRegExpStrict,Set:b.copySetStrict}:{},...r?.handler};let a=new WeakMap;const i=c((e,o)=>{if(!s(e))return e;if(o.cache.has(e))return o.cache.get(e);if(Array.isArray(e))return n.Array(e,o);if(typeof e=="object"&&e.constructor===Object&&e.nodeType===void 0)return n.Object(e,o);if(e.nodeType!==void 0&&e.cloneNode!==void 0)return e.cloneNode(!0);if(e instanceof Date)return n.Date(e,o);if(e instanceof RegExp)return n.RegExp(e,o);if(e instanceof Map)return n.Map(e,o);if(e instanceof Set)return n.Set(e,o);if(e instanceof Error)return n.Error(e,o);if(e instanceof ArrayBuffer||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array)return n.ArrayBuffer(e,o);if(e instanceof Blob)return n.Blob(e,o);if(e instanceof DataView)return n.DataView(e,o);if(e instanceof SharedArrayBuffer)return n.SharedArrayBuffer(e,o);if(e instanceof Promise)return n.Promise(e,o);if(e instanceof WeakMap)return n.WeakMap(e,o);if(e instanceof WeakSet)return n.WeakSet(e,o);if(e instanceof Function)return n.Function(e,o);if(typeof e=="object")return n.Object(e,o);throw new TypeError(`Type of ${typeof e} cannot be cloned`,e)},"clone"),A=i(t,{cache:a,clone:i});return a=null,A},"deepClone");exports.deepClone=g;