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gDAE5C,OAAO,KAAK,UAAU,GAAI,EAAI,KAAM,MACtC,EAMA,KAAK,UAAU,UAAY,SAAoB,GAC7C,OAAO,KAAK,UAAU,KAAK,QAAQ,GACrC,EAQA,KAAK,UAAU,eAAiB,eAA8B,GAC5D,OAAO,KAAK,gBAAgB,KAAK,aAAa,GAChD,EAMA,KAAK,UAAU,YAAc,SAAsB,GACjD,GAAmB,iBAAR,EACT,MAAM,IAAI,MAAM,kCAAkC,GAEpD,OAAO,KAAK,UAAU,KAAK,MAAM,GACnC,EAEA,KAAK,UAAU,eAAiB,KAGhC,KAAK,UAAU,MAAQ,KAAK,UAAU,YACtC,KAAK,UAAU,UAAY,KAAK,UAAU,UAC1C,KAAK,UAAU,eAAiB,KAAK,UAAU,eAE/C,QAAQ,UAAY,IAAI,KAExB,IAAK,IAAI,KAAQ,QAAQ,UAEgB,mBAA5B,QAAQ,UAAU,GAC3B,QAAQ,GAAQ,QAAQ,UAAU,GAAM,KAAK,SAE7C,QAAQ,GAAQ,QAAQ,UAAU,GAItC,QAAQ,KAAO,IACK,GAAE","file":"/npm/kvin@9.0.0/kvin.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/kvin@9.0.0/kvin.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n *  @file       kvin.js                A general-purpose library for marshaling and serializing\n *                                      ES objects.  This library is a functional superset of JSON\n *                                      and relies on JSON for speed, adding:\n *                                      - Typed Arrays with efficient spare representation\n *                                      - Sparse arrays\n *                                      - Arrays with enumerable properties\n *                                      - Object graphs with cycles\n *                                      - Boxed primitives\n *                                      - Functions (including enumerable properties, global scope)\n *                                      - Regular Expressions\n *                                      - undefined\n *                                      - simple objects made with constructors\n *                                        - objects will re-constructed with no constructor arguments\n *                                          during deserialization\n *                                        - enumerable properties will be copied on after construction\n *                                      - opt-in list of supported constructors (kvin.constructorAllowList)\n *\n *                                      This library is safe to use on user-supplied data.\n *\n *                                      The basic implementation strategy is to marshal to an intermediate\n *                                      format, called a 'prepared object', that can be used to recreate\n *                                      the original object, but can also be serialized with JSON. We\n *                                      track a list objects we have seen and their initial appearance in\n *                                      the object graph.  We rely on the /de-facto/ enumeration order of\n *                                      properties in vanilla objects that has been present in all popular\n *                                      browsers since the dawn of time; namely, that enumeration order is\n *                                      object insertion order.  This could cause bugs with objects with\n *                                      cycles in less-common interpreters, such as Rhino and (especially)\n *                                      the NJS/NGS ES3 platform by Brian Basset.\n *\n *  *note* -    This module free of external dependencies, and can be loaded as either a Node module,\n *              a BravoJS module, or as a script tag in the browser.\n *\n *  *bugs* -    There are known or suspected issues in the following areas:\n *              - Arrays which contain the same object more than once\n *              - Arrays which mix numeric and non-numeric properties, especially if they are objects\n *              - Sparse Arrays\n *\n *  @author     Wes Garland, wes@kingsds.network\n *  @date       June 2018\n *\n */\n\n\"use strict\";\n\n{/* This prologue allows a CJS2 module's exports to be loaded with eval(readFileSync(filename)) */\n  var module;\n  let moduleSystemType;\n  let realModule = module;\n\n  if (typeof __webpack_require__ !== 'undefined')\n    moduleSystemType = 'webpack';\n  else if (typeof module !== 'undefined' && typeof module.declare !== 'undefined')\n    moduleSystemType = 'cjs2';\n  else if (typeof module !== 'undefined' && typeof require === 'function' && typeof exports !== 'undefined' && module.exports === exports)\n    moduleSystemType = 'nodejs';\n  else if (typeof exports !== 'undefined' && typeof require === 'function')\n    moduleSystemType = 'cjs1';\n  else\n    moduleSystemType = 'none';\n\n  module = Object.assign({}, realModule);\n\n  if (moduleSystemType === 'nodejs' || moduleSystemType === 'webpack' || moduleSystemType === 'cjs1') {\n    module.declare = function kvin$$cjs1$$moduleDeclare(deps, factory) {\n      factory(null, exports, null);\n      module = realModule;\n      return exports;\n    };\n  } else if (moduleSystemType === 'cjs2') {\n    module = realModule;\n  } else if (moduleSystemType === 'none') {\n    module.declare = function kvin$$cjs1$$moduleDeclare(deps, factory) {\n      let exports = {};\n      factory(null, exports, null);\n      module = realModule;\n\n      if (typeof window === 'object')\n        window.KVIN = exports;\n      if (typeof globalThis === 'object')\n        globalThis.KVIN = exports;\n\n      return exports;\n    };\n  }\n/* Now initialize the module by invoking module.declare per CommonJS Modules/2.0-draft8 */\n\n/* eslint-disable indent */ module.declare([], function (require, exports, module) {\n\n/**\n * @constructor to create an alternate KVIN context. This allows us to recogonize instance of\n *              the standard classes from a different JS context or have different tuning parameters.\n * @param ctors list or object of standard constructors\n */\nfunction KVIN(ctors)\n{\n  // We always need to initialize the standardObjects. It is used for comparisons for primitive types etc\n  this.standardObjects = {};\n  for (let ctor of KVIN.prototype.ctors) {\n    if (!ctor)\n      continue;\n    this.standardObjects[ctor.name] = ctor;\n  }\n\n  this.ctors = [].concat(KVIN.prototype.ctors);\n\n  if (!ctors)\n    return;\n\n  if (Array.isArray(ctors))\n  {\n    for (let ctor of ctors)\n    {\n      if (!ctor)\n        continue;\n      this[ctor.name] = ctor\n      for (let i=0; i < this.ctors.length; i++)\n      {\n        if (this.ctors[i].name === ctor.name)\n          this.ctors[i] = ctor;\n      }\n    }\n  }\n  else\n  {\n    for (let entry of Object.entries(ctors))\n    {\n      for (let i=0; i < this.ctors.length; i++)\n      {\n        let [ name, ctor ] = entry;\n        if (!ctor)\n          continue;\n        if (this.ctors[i].name === name)\n          this.ctors[i] = ctor;\n          this.standardObjects[name] = ctor;\n      }\n    }\n  }\n}\n/*\n * Set exports.makeFunctions = true to allow deserializer to make functions.\n * If the deserializer can make functions, it is equivalent to eval() from a\n * security POV.  Otherwise, the deserializer will turn functions into boxed\n * strings containing the function's source code, having a name property that\n * matches the original function.\n */\nKVIN.prototype.makeFunctions = false\n\n/* More bytes in a TypedArray than typedArrayPackThreshold will trigger\n * the code to prepare these into strings rather than arrays.\n */\nKVIN.prototype.typedArrayPackThreshold = 8\n\n/* Arrays of primitives which are >= the threshold in length are scrutinized\n * for further optimization, e.g. by run-length encoding\n */\nKVIN.prototype.scanArrayThreshold = 8\n\n\n/** Maxmimum number of arguments we can pass to a function in this engine.\n * @todo this needs to be detected at startup based on environment\n */\nKVIN.prototype.maxFunArgs = 30000;\n/** Maximumum number of times we will repeat a re-match instead of unbounded */\nKVIN.prototype.maxReRepeat = 5000;\n\nconst littleEndian = (function () {\n  let ui16 = new Uint16Array(1)\n  let ui8\n\n  ui16[0] = 0xffef\n  ui8 = new Uint8Array(ui16.buffer, ui16.byteOffset, ui16.byteLength)\n\n  if (ui8[0] === 0x0ff)\n    throw new Error('KVIN: Detected big-endian platform');\n\n  return true\n})()\n\n/** Pre-defined constructors, used to compact payload */\nKVIN.prototype.ctors = [\n  Object,\n  Int8Array,\n  Uint8Array,\n  Uint8ClampedArray,\n  Int16Array,\n  Uint16Array,\n  Int32Array,\n  Uint32Array,\n  Float32Array,\n  Float64Array,\n  RegExp,\n  Number,\n  String,\n  Boolean,\n  Array,\n  Function,\n  Error,\n  Promise,\n  typeof URL !== 'undefined' ? URL : undefined, /* not part of ES => feature-test */\n  Date,\n  Set,\n];\n\nKVIN.prototype.userCtors = {}; /**< name: implementation for user-defined constructors that are not props of global */\n\n/** Take a 'prepared object' (which can be represented by JSON) and turn it\n *  into an object which resembles the object it was created from.\n *\n *  @param      seen            An array objects we have already seen in this\n *                              object graph; used to track cycles.\n *  @param      po              A prepared object representing a value or a primitive\n *  @param      position        A string respresenting our position within\n *                              the graph. Used only for error messages.\n *  @returns    the value encoded by po\n */\nKVIN.prototype.unprepare = function unprepare (seen, po, position) {\n  switch (typeof po) {\n    case 'boolean':\n    case 'number':\n    case 'string':\n      return po;\n  }\n  if (po.hasOwnProperty('ctr')) {\n    switch (typeof po.ctr) {\n    case 'string':\n      if (!po.ctr.match(/^[A-Za-z_0-9$][A-Za-z_0-9$]*$/)) {\n        if (this.constructorAllowlist && this.constructorAllowlist.indexOf(po.ctr) === -1) {\n          throw new Error('Allowlist does not include constructor ' + po.ctr)\n        }\n        throw new Error('Invalid constructor name: ' + po.ctr)\n      }\n      break\n    case 'number':\n      if (!(po.ctr >= 0 && po.ctr < this.ctors.length)) {\n        throw new Error('Invalid constructor number: ' + po.ctr)\n      }\n      break\n    default:\n      throw new Error('Invalid constructor label type ' + typeof po.ctr)\n    }\n  }\n  if (po.hasOwnProperty('raw')) {\n    if (typeof po.raw === 'object' && po.raw !== null && !Array.isArray(po.raw))\n    {\n      if (!po.used)\n        po.used = true;\n      else\n        return JSON.parse(JSON.stringify(po.raw));\n      return Object.assign(new this.standardObjects.Object(), po.raw);\n    }\n    return po.raw;\n  }\n  if (po.hasOwnProperty('ptv')) {\n    return po.ptv; /* deprecated: only created by v3-6 */\n  }\n  if (po.hasOwnProperty('number')) {\n    return unprepare$number(po.number);\n  }\n  if (po.hasOwnProperty('bigint')) {\n    return unprepare$bigint(po.bigint);\n  }\n  if (po.hasOwnProperty('fnName')) {\n    return this.unprepare$function(seen, po, position)\n  }\n  if (po.hasOwnProperty('mapKeys') || po.hasOwnProperty('mapVals')) {\n    return this.unprepare$Map(seen, po, position)\n  }\n  if (po.hasOwnProperty('ab16') || po.hasOwnProperty('isl16')) {\n    return this.unprepare$ArrayBuffer16(seen, po, position)\n  }\n  if (po.hasOwnProperty('ab8') || po.hasOwnProperty('isl8')) {\n    return this.unprepare$ArrayBuffer8(seen, po, position)\n  }\n  if (po.hasOwnProperty('arr')) {\n    return this.unprepare$Array(seen, po, position)\n  }\n  if (po.hasOwnProperty('ctr')) {\n    return this.unprepare$object(seen, po, position)\n  }\n  if (po.hasOwnProperty('set'))\n    return this.unprepare$Set(seen, po, position);\n  if (po.hasOwnProperty('json')) {\n    return JSON.parse(po.json)\n  }\n  if (po.hasOwnProperty('undefined')) {\n    return undefined\n  }\n  if (po.hasOwnProperty('symbol'))\n    return unprepare$symbol(seen, po);\n\n  /* Promise resolutions/rejections are prepared after settling when using marshalAsync, then\n   * synthesized during unmarshal.\n   */\n  if (po.hasOwnProperty('resolve'))\n    return Promise.resolve(this.unprepare(seen, po.resolve, position));\n  if (po.hasOwnProperty('reject'))\n    return Promise.reject(this.unprepare(seen, po.reject, position));\n\n  if (po.hasOwnProperty('seen')) {\n    if (!seen.hasOwnProperty(po.seen)) {\n      throw new Error('Seen-list corruption detected at index ' + po.seen)\n    }\n    return seen[po.seen]\n  }\n\n  /* KVIN 1.2.18 and older can bury marshaled objects inside marshaled objects. */\n  if (po.hasOwnProperty('_serializeVerId'))\n  {\n    seen.push(po);\n    return this.unmarshal(po);\n  }\n\n  throw new TypeError('Invalid preparation formula at ' + position)\n}\n\nKVIN.prototype.unprepare$object = function unprepare$object (seen, po, position) {\n  let o\n  let constructor;\n\n  function construct(thisCtor, args)\n  {\n    function fun()\n    {\n      return thisCtor.apply(this, args);\n    }\n    fun.prototype = thisCtor.prototype;\n    return new fun();\n  }\n\n  if (typeof po.ctr === 'string' && !po.ctr.match(/^[1-9][0-9]*$/)) {\n    if (this.userCtors.hasOwnProperty(po.ctr))\n      constructor = this.userCtors[po.ctr];\n    else\n      constructor = eval(po.ctr) /* pre-validated! */ // eslint-disable-line\n  } else {\n    constructor = this.ctors[po.ctr]\n  }\n\n  if (po.hasOwnProperty('args'))\n    o = construct(constructor, po.args);\n  else if (po.hasOwnProperty('arg'))\n    o = new constructor(po.arg);\n  else\n    o = new constructor(); // eslint-disable-line\n\n  if (po.ctr === 'Error')\n  {\n    delete o.stack;\n    delete o.lineNumber;\n    delete o.fileName;\n  }\n\n  seen.push(o)\n\n  if (po.hasOwnProperty('ps')) {\n    for (let prop in po.ps) {\n      if (po.ps.hasOwnProperty(prop)) {\n        o[prop] = this.unprepare(seen, po.ps[prop], position + '.' + prop)\n      }\n    }\n  }\n\n  return o\n}\n\nKVIN.prototype.unprepare$function = function unprepare$function (seen, po, position) {\n  let obj, fn\n  let fnName = po.fnName\n\n  /* A function is basically a callable object */\n  po.ctr = this.ctors.indexOf(Object)\n  delete po.fnName\n  obj = this.unprepare(seen, po, position)\n\n  if (!this.makeFunctions) {\n    obj.name = fnName\n    return obj\n  }\n\n  fn = (new Function('return ' + po.arg))()  // eslint-disable-line\n  if (po.hasOwnProperty('ps')) {\n    for (let prop in po.ps) {\n      fn[prop] = obj[prop]\n    }\n  }\n\n  return fn\n}\n\nKVIN.prototype.unprepare$Map = function unprepare$Map (seen, po, position) {\n\n  let m = new Map();\n\n  seen.push(m)\n\n  let mapKeyArr = this.unprepare$Array(seen, po.mapKeys, position);\n  let mapValArr = this.unprepare$Array(seen, po.mapVals, position);\n\n  for (let i = 0; i < mapKeyArr.length; i++)\n  {\n    m.set(mapKeyArr[i], mapValArr[i]);\n  }\n\n  if (po.hasOwnProperty('ps')) {\n    for (let prop in po.ps) {\n      if (po.ps.hasOwnProperty(prop)) {\n        m[prop] = this.unprepare(seen, po.ps[prop], position + '.' + prop)\n      }\n    }\n  }\n\n  return m;\n}\n\nfunction unprepare$symbol(seen, po)\n{\n  const symbol = Symbol(po.symbol);\n  seen.push(symbol);\n  return symbol;\n}\n\nfunction unprepare$bigint(arg) {\n  return BigInt(arg);\n}\n\nfunction unprepare$number(arg) {\n  return parseFloat(arg);\n}\n\n/**\n * arr:[] - Array of primitives of prepared objects\n * lst:N - repeat last element N times\n * ps:[] - property list\n */\nKVIN.prototype.unprepare$Array = function unprepare$Array (seen, po, position) {\n  let a = []\n  let last\n\n  seen.push(a)\n\n  for (let i = 0; i < po.arr.length; i++) {\n    if (typeof po.arr[i] === 'object') {\n      if (po.arr[i].lst) {\n        for (let j = 0; j < po.arr[i].lst; j++) {\n          a.push(this.unprepare(seen, last, position + '.' + (i + j)))\n        }\n        continue\n      }\n      a.push(this.unprepare(seen, po.arr[i], position + '.' + i))\n      last = po.arr[i]\n    } else {\n      a.push(po.arr[i])\n      last = prepare$primitive(a[a.length-1], 'unprepare$Array')\n    }\n  }\n\n  if (po.hasOwnProperty('isl')) {\n    for (let prop in po.isl) {\n      let island = po.isl[prop]\n      let els = Array.isArray(island.arr) ? island.arr : this.unprepare$Array(seen, island.arr, [ position, 'isl', prop ].join('.'))\n\n      if (els.length - 3 <= this.stackLimit || this.maxFunArgs) {\n        if (els.length && (a.length < island['@'] + els.length)) {\n          a.length = island['@'] + els.length\n        }\n        a.splice.apply(a, [island['@'], els.length].concat(els))\n      } else {\n        for (let i=0; i < els.length; i++) {\n          a[i + +island['@']] = els[i]\n        }\n      }\n    }\n  }\n\n  if (po.hasOwnProperty('ps')) {\n    for (let prop in po.ps) {\n      if (typeof po.ps[prop] === 'object') {\n        a[prop] = this.unprepare(seen, po.ps[prop], position + '.' + prop)\n      } else {\n        a[prop] = po.ps[prop]\n      }\n    }\n  }\n\n  if (po.len) {\n    a.length = po.len\n  }\n\n  return a\n}\n\n/** The ab8 (array buffer 8 bit) encoding encodes TypedArrays and related types by\n *  converting them to Latin-1 strings full of binary data in 8-bit words.\n *\n *  The isl8 (islands) encoding is almost the same, except that it encodes only\n *  sequences of mostly-non-zero sections of the string.\n */\nKVIN.prototype.unprepare$ArrayBuffer8 = function unprepare$ArrayBuffer8 (seen, po, position) {\n  let i8\n  let bytes\n  let constructor;\n\n  if (typeof po.ctr === 'string' && !po.ctr.match(/^[1-9][0-9]*$/)) {\n    constructor = eval(po.ctr) /* pre-validated! */ // eslint-disable-line\n  } else {\n    constructor = this.ctors[po.ctr]\n  }\n\n  if (po.hasOwnProperty('ab8')) {\n    bytes = po.ab8.length\n  } else {\n    bytes = po.len\n  }\n  i8 = new Int8Array(bytes)\n  if (po.hasOwnProperty('ab8')) {\n    for (let i = 0; i < po.ab8.length; i++) {\n      i8[i] = po.ab8.charCodeAt(i)\n    }\n  } else {\n    for (let j = 0; j < po.isl8.length; j++) {\n      for (let i = 0; i < po.isl8[j][0].length; i++) {\n        i8[po.isl8[j]['@'] + i] = po.isl8[j][0].charCodeAt(i)\n      }\n    }\n  }\n  let o;\n\n  if (constructor !== globalThis.Buffer)\n    o = new constructor(i8.buffer, i8.byteOffset) // eslint-disable-line;\n  else\n  {\n    /* work around nodejs deprecation warning */\n    o = Buffer.from(i8.buffer, i8.byteOffset);\n  }\n\n  seen.push(o)\n  return o;\n}\n\n/** The ab16 (array buffer 16 bit) encoding encodes TypedArrays and related types by\n *  converting them to strings full of binary data in 16-bit words. Buffers\n *  with an odd number of bytes encode an extra byte 'eb' at the end by itself.\n *\n *  The isl16 (islands) encoding is almost the same, except that it encodes only\n *  sequences of mostly-non-zero sections of the string.\n */\n KVIN.prototype.unprepare$ArrayBuffer16 = function unprepare$ArrayBuffer16 (seen, po, position) {\n  let i16, i8, words\n  let bytes\n  let constructor;\n\n  if (typeof po.ctr === 'string' && !po.ctr.match(/^[1-9][0-9]*$/)) {\n    constructor = eval(po.ctr) /* pre-validated! */ // eslint-disable-line\n  } else {\n    constructor = this.ctors[po.ctr]\n  }\n\n  if (po.hasOwnProperty('ab16')) {\n    bytes = po.ab16.length * 2\n    if (po.hasOwnProperty('eb')) {\n      bytes++\n    }\n  } else {\n    bytes = po.len\n  }\n\n  words = Math.floor(bytes / 2) + (bytes % 2)\n  i16 = new Int16Array(words)\n  if (po.hasOwnProperty('ab16')) {\n    for (let i = 0; i < po.ab16.length; i++) {\n      i16[i] = po.ab16.charCodeAt(i)\n    }\n  } else {\n    for (let j = 0; j < po.isl16.length; j++) {\n      for (let i = 0; i < po.isl16[j][0].length; i++) {\n        i16[po.isl16[j]['@'] + i] = po.isl16[j][0].charCodeAt(i)\n      }\n    }\n  }\n  i8 = new Int8Array(i16.buffer, i16.byteOffset, bytes)\n  if (po.hasOwnProperty('eb')) {\n    i8[i8.byteLength - 1] = po.eb.charCodeAt(0)\n  }\n\n  if (!littleEndian) {\n    for (let i = 0; i < i8.length; i += 2) {\n      i8[(i * 2) + 0] = i8[(i * 2) + 0] ^ i8[(i * 2) + 1]\n      i8[(i * 2) + 1] = i8[(i * 2) + 1] ^ i8[(i * 2) + 0]\n      i8[(i * 2) + 0] = i8[(i * 2) + 0] ^ i8[(i * 2) + 1]\n    }\n  }\n  let o = new constructor(i8.buffer, i8.byteOffset) // eslint-disable-line\n  seen.push(o)\n  return o\n}\n\n/* Primitives and primitive-like objects do not have any special\n * marshaling requirements -- specifically, we don't need to\n * iterate over their properties in order to serialize them; we\n * can let JSON.stringify() do any heavy lifting.\n */\nKVIN.prototype.isPrimitiveLike = function isPrimitiveLike (o, seen) {\n  if (o === null || typeof o === 'string' || typeof o === 'boolean')\n    return true;\n\n  if (typeof o === 'number')\n    return Number.isFinite(o);\n\n  if (typeof o !== 'object')\n    return false;\n\n  if (o.constructor === this.standardObjects.Object && Object.keys(o).length === 0)\n    return true;\n\n  if (o.constructor === this.standardObjects.Array && o.length === 0 && Object.keys(o).length === 0)\n    return true;\n\n  if (o.constructor !== this.standardObjects.Object && o.constructor !== this.standardObjects.Array)\n    return false;\n\n  if (Array.isArray(o)) {\n    if (Object.keys(o).length !== o.length) {\n      return false /* sparse array or named props */\n    }\n  }\n\n  seen = seen.concat(o);\n  for (let prop in o) {\n    if (!o.hasOwnProperty(prop))\n      return false;\n    if (seen.indexOf(o[prop]) !== -1)\n      return false;\n    if (!this.isPrimitiveLike(o[prop], seen))\n      return false;\n  }\n\n  return true\n}\n\n/**\n * Serialize an instance of Error, preserving standard-ish non-enumerable properties\n */\nfunction prepare$Error(o)\n{\n  let ret = {\n    ctr: 'Error',\n    ps: {},\n    arg: o.message\n  };\n\n  for (let prop of ['code', 'stack', 'lineNumber', 'fileName'])\n    if (o.hasOwnProperty(prop))\n      ret.ps[prop] = o[prop];\n  for (let prop in o)\n    if (o.hasOwnProperty(prop))\n      ret.ps[prop] = o[prop];\n\n  return ret;\n}\n\n/** Take an arbitrary object and turn it into a 'prepared object'.\n *  A prepared object can always be represented with JSON.\n *\n *  @param      seen    An array objects we have already seen in this\n *                      object graph; used to track cycles.\n *  @param      o       The object that the prepared object reflects\n *  @returns            A prepared object\n */\nKVIN.prototype.prepare =  function prepare (seen, o, where) {\n  let i, ret\n  let po = {}\n\n  if (typeof o === 'number') {\n    return prepare$number(o)\n  }\n  if (typeof o === 'bigint') {\n    return prepare$bigint(o)\n  }\n  if (typeof o === 'symbol')\n    return prepare$symbol(o, seen);\n\n  if (this.isPrimitiveLike(o, seen)) {\n    if (!Array.isArray(o) || o.length < this.scanArrayThreshold)\n      return prepare$primitive(o, where)\n  }\n  if (typeof o === 'undefined') {\n    return prepare$undefined(o)\n  }\n  /* value types below here can be used as targets of cycles */\n  if ((i = seen.indexOf(o)) === -1) {\n    seen.push(o)\n  } else {\n    return { seen: i }\n  }\n  if (Array.isArray(o)) {\n    return this.prepare$Array(seen, o, where)\n  }\n  if (ArrayBuffer.isView(o)) {\n    return this.prepare$ArrayBuffer(o)\n  }\n  if (o.constructor === Map) {\n    return this.prepare$Map(seen, o, where)\n  }\n  if (o.constructor === WeakMap) {\n    return this.prepare$WeakMap(o)\n  }\n  if (o.constructor === String || o.constructor === Number || o.constructor === Boolean) {\n    return this.prepare$boxedPrimitive(o)\n  }\n  if (o.constructor === RegExp) {\n    return this.prepare$RegExp(o)\n  }\n  if (o.constructor === Set)\n    return this.prepare$Set(seen, o, where);\n\n  if (o instanceof Promise || o instanceof this.standardObjects.Promise)\n    return this.prepare$Promise(seen, o, where);\n\n  if (o instanceof Error || o instanceof this.standardObjects.Error) {\n    /* special-case Error to get non-enumerable properties */\n    return prepare$Error(o);\n  }\n\n  if (typeof o.constructor === 'undefined') {\n    console && console.warn('KVIN Warning: ' + where + ' is missing .constructor -- skipping')\n    return prepare$undefined(o)\n  }\n\n  ret = { ctr: this.ctors.indexOf(o.constructor), ps: po };\n  if (ret.ctr === -1)\n    ret.ctr = o.constructor.name || this.ctors.indexOf(this.standardObjects.Object);\n\n  if (typeof o === 'function') {\n    ret.fnName = o.name\n  }\n\n  if (typeof o.toKVIN === 'function')\n    return Object.assign(ret, o.toKVIN(o, this));\n  else if (typeof o.toJSON === 'function')\n    ret.arg = o.toJSON();\n  else if (o.toString !== this.standardObjects.Object.prototype.toString)\n    ret.arg = o.toString();\n\n  if (typeof o.hasOwnProperty === 'undefined') {\n    return ret;\n  }\n\n  /* Iterate over the properties and prepare each in turn, recursing\n   * with a depth-first traversal of the object graph. Iteration order\n   * must match unprepare()!\n   */\n  for (let prop in o) {\n    if (!o.hasOwnProperty(prop)) {\n      continue\n    }\n\n    switch (typeof o[prop]) {\n      case 'number':\n        po[prop] = prepare$number(o[prop]);\n        break;\n      case 'bigint':\n        po[prop] = prepare$bigint(o[prop]);\n        break;\n      case 'function':\n      case 'object':\n        if (o[prop] !== null) {\n          if (typeof o[prop].constructor !== 'undefined'\n              && o[prop].constructor !== this.standardObjects.Object && o[prop].constructor.constructor !== this.standardObjects.Object\n              && o[prop].constructor !== this.standardObjects.Function && o[prop].constructor.constructor !== this.standardObjects.Function\n              && o[prop].constructor !== this.standardObjects.Function && o[prop].constructor.constructor.name !== \"Function\" /* vm context issue /wg aug 2020 */\n            ) {\n            throw new Error(`Cannot serialize property ${where}.${prop} - multiple inheritance is not supported.`);\n          }\n          if ((i = seen.indexOf(o[prop])) === -1) {\n            po[prop] = this.prepare(seen, o[prop], where + '.' + prop)\n          } else {\n            po[prop] = { seen: i }\n          }\n          break\n        } /* else fallthrough null -> primitive */\n      case 'boolean':\n      case 'string':\n        po[prop] = prepare$primitive(o[prop], where + '.' + prop)\n        break\n      case 'symbol':\n        po[prop] = prepare$symbol(o[prop], seen);\n        break;\n      case 'undefined':\n        po[prop] = prepare$undefined(o[prop])\n        break\n      default:\n        throw new TypeError('Cannot serialize property ' + prop + ' which is a ' + typeof o[prop])\n    }\n  }\n\n  return ret\n}\n\n/** Prepare an Array.  Sparse arrays and arrays with properties\n *  are supported, and represented reasonably efficiently, as are\n *  arrays of repeated values.\n *\n *  @param   seen   The current seen list for this marshal - things pointers point to\n *  @param   o      The array we are preparing\n *  @param   where  Human description of where we are in the object, for debugging purposes\n */\n KVIN.prototype.prepare$Array = function prepare$Array (seen, o, where) {\n  let pa = { arr: [] }\n  let keys = Object.keys(o)\n  let lastJson = NaN\n  let json\n  let lstTotal = 0\n\n  for (let i = 0; i < o.length; i++) {\n    if (!o.hasOwnProperty(i)) {\n      break /* sparse array */\n    }\n    if (typeof o[i] !== 'object' && this.isPrimitiveLike(o[i], seen)) {\n      pa.arr.push(o[i])\n    } else {\n      pa.arr.push(this.prepare(seen, o[i], where + '.' + i))\n    }\n\n    json = JSON.stringify(pa.arr[pa.arr.length - 1])\n    if (json === lastJson) {\n      if (pa.arr[pa.arr.length - 2].lst) {\n        pa.arr[pa.arr.length - 2].lst++\n        pa.arr.length--\n        lstTotal++\n      } else {\n        pa.arr[pa.arr.length - 1] = {lst: 1}\n      }\n    } else {\n      lastJson = json\n    }\n  }\n\n  if (keys.length !== o.length) {\n    /* sparse array or array with own properties - difference between sparse entry and value=undefined preserved */\n    for (let j = 0; j < keys.length; j++) {\n      let key = keys[j]\n      let idx = +key\n      if (idx < j && pa.arr.hasOwnProperty(idx)) { /* test order for speed */\n        continue\n      }\n      if (typeof idx === 'number' && o.hasOwnProperty(idx + 1)) {\n        let island = { '@':idx, arr:[] }\n        /* island of data inside sparse array */\n        if (!pa.isl) {\n          pa.isl = []\n        }\n        for (let k = idx; o.hasOwnProperty(k); k++) {\n          island.arr.push(o[k])\n        }\n        j += island.arr.length - 1\n        if (island.arr.length >= this.scanArrayThreshold) {\n          let tmp = this.prepare(seen, island.arr, where + '.' + 'isl@' + (j - island.arr.length))\n          if (tmp.hasOwnProperty('arr')) {\n            island.arr = tmp\n          } else {\n            pa.isl.push(island)\n          }\n        }\n        pa.isl.push(island)\n        continue\n      }\n      if (!pa.hasOwnProperty('ps')) {\n        pa.ps = {}\n      }\n      if (typeof o[key] !== 'object' && this.isPrimitiveLike(o[key], seen)) {\n        pa.ps[key] = o[key]\n      } else {\n        pa.ps[key] = this.prepare(seen, o[key], where + '.' + key)\n      }\n    }\n  }\n\n  if (pa.arr.length + lstTotal !== o.length) {\n    pa.len = o.length\n  }\n  return pa\n}\n\n/** Prepare a Map.  This can be robustly handled with the existing array preparation, as\n *  long as we differentiate it from normal arrays and treat keys and values separately.\n *\n *  @param   seen   The current seen list for this marshal - things pointers point to\n *  @param   o      The Map we are preparing\n *  @param   where  Human description of where we are in the object, for debugging purposes\n */\n KVIN.prototype.prepare$Map = function prepare$Map (seen, o, where) {\n\n  let pm = { mapKeys: [], mapVals: [] }\n\n  let mapKeyArr = Array.from(o.keys());\n  pm.mapKeys = this.prepare$Array(seen, mapKeyArr, where);\n\n  let mapValArr = Array.from(o.values());\n  pm.mapVals = this.prepare$Array(seen, mapValArr, where);\n\n  let keys = Object.keys(o)\n  if (keys.length !== o.length) {\n    for (let j = 0; j < keys.length; j++) {\n      let key = keys[j]\n      if (!pm.hasOwnProperty('ps')) {\n        pm.ps = {}\n      }\n      if (typeof o[key] !== 'object' && this.isPrimitiveLike(o[key])) {\n        pm.ps[key] = o[key]\n      } else {\n        pm.ps[key] = this.prepare(seen, o[key], where + '.' + key)\n      }\n    }\n  }\n\n  return pm;\n}\n\n/** Prepare a WeakMap. The closest to correct behaviour for a WeakMap serialized over\n *  a network is for the resulting WeakMap to be empty, since the WeakMap keys are\n *  by design never directly referenced or retained, and cannot be iterated on.\n *  This is why we pass an empty array to the constructor.\n *\n *  @param   o      The WeakMap we are preparing\n */\n KVIN.prototype.prepare$WeakMap = function prepare$WeakMap (o) {\n  return { ctr: this.ctors.indexOf(o.constructor), arg: [] }\n}\n\n/** Detect JavaScript strings which contain ill-formed UTF-16 sequences */\nfunction notUnicode(s) {\n  if (/[\\ud800-\\udbff][^\\udc00-\\udfff]/.test(s)) {\n    return true /* high-surrogate without low-surrogate */\n  }\n\n  if (/[^\\ud800-\\udbff][\\udc00-\\udfff]/.test(s)) {\n    return true /* low-surrogate without high-surrogate */\n  }\n\n  return false\n}\n/** Prepare an ArrayBuffer into UCS-2, returning null when we cannot guarantee\n *  that the UCS-2 is also composed of valid UTF-16 code points\n *\n *  @see unprepare$ArrayBuffer16\n */\nKVIN.prototype.prepare$ArrayBuffer16 = function prepare$ArrayBuffer16 (o) {\n  let ret = { ctr: this.ctors.indexOf(o.constructor) }\n  let nWords = Math.floor(o.byteLength / 2)\n  let s = ''\n\n  if (ret.ctr === -1)\n    ret.ctr = o.constructor.name\n\n  if (littleEndian) {\n    let ui16 = new Uint16Array(o.buffer, o.byteOffset, nWords)\n    for (let i = 0; i < nWords; i++) {\n      s += String.fromCharCode(ui16[i])\n    }\n  } else {\n    let ui8 = new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n    for (let i = 0; i < nWords; i++) {\n      s += String.fromCharCode((ui8[0 + (2 * i)] << 8) + (ui8[1 + (2 * i)]))\n    }\n  }\n\n  let manyZeroes = '\\u0000\\u0000\\u0000\\u0000'\n  if (s.indexOf(manyZeroes) === -1) {\n    ret.ab16 = s\n  } else {\n    /* String looks zero-busy: represent via islands of mostly non-zero (sparse string). */\n    // let re = /([^\\u0000]+/g\n    let re = /([^\\u0000]+(.{0,3}([^\\u0000]|$))*)+/g\n    let island\n\n    ret.isl16 = []\n    ret.len = o.byteLength\n    while ((island = re.exec(s))) {\n      ret.isl16.push({0: island[0].replace(/\\u0000*$/, ''), '@': island.index})\n    }\n  }\n  if ((2 * nWords) !== o.byteLength) {\n    let ui8 = new Uint8Array(o.buffer, o.byteOffset + o.byteLength - 1, 1)\n    ret.eb = ui8[0]\n  }\n\n  if (ret.ab16 && notUnicode(ret.ab16)) {\n    return null\n  } else  if (ret.isl16) {\n    for (let i = 0; i < ret.isl16.length; i++) {\n      if (notUnicode(ret.isl16[i])) {\n        return null\n      }\n    }\n  }\n  return ret\n}\n\n/** Encode an ArrayBuffer (TypedArray) into a string composed solely of Latin-1 characters.\n *  Strings with many zeroes will be represented as sparse-string objects.\n */\nKVIN.prototype.prepare$ArrayBuffer8 = function prepare$ArrayBuffer8 (o) {\n  let ret = { ctr: this.ctors.indexOf(o.constructor) }\n\n  if (ret.ctr === -1)\n    ret.ctr = o.constructor.name\n\n  const mss = this.stackLimit || this.maxFunArgs - 1;\n  let ui8 = new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n  let segments = []\n  let s\n\n  for (let i=0; i < ui8.length / mss; i++) {\n    segments.push(String.fromCharCode.apply(null, ui8.slice(i * mss, (i + 1) * mss)))\n  }\n  s = segments.join('')\n\n  let manyZeroes = '\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000'\n  if (s.indexOf(manyZeroes) === -1)\n    ret.ab8 = s;\n  else\n  {\n    try\n    {\n      /* String looks zero-busy: represent via islands of mostly non-zero (sparse string). */\n      const re = new RegExp(`([^\\u0000]+(.{0,3}([^\\u0000]|$)){0,${this.maxReRepeat}})+`, 'g');\n      const isl8 = [];\n      let island;\n      while ((island = re.exec(s)))\n        isl8.push({0: island[0].replace(/\\u0000*$/, ''), '@': island.index});\n\n      ret.isl8 = isl8;\n      ret.len = o.byteLength;\n    }\n    catch(error)\n    {\n      /* fallback to ab8 encoding if the RegExp exceeds the call stack size */\n      if (error.name !== 'RangeError')\n        throw error;\n      ret.ab8 = s;\n    }\n  }\n\n  return ret\n}\n\n/** Encode an ArrayBuffer (TypedArray) into a string, trying multiple methods to determine\n *  optimimum size/performance.  The this.tune variable affects the behaviour of this code this:\n *\n *  \"speed\" - only do naive encoding: floats get represented as byte-per-digit strings\n *  \"size\" - try the naive, ab8, and ab16 encodings; pick the smallest\n *  neither - try the naive encoding if under typedArrayPackThreshold and use if smaller than\n *            ab8; otherwise, use ab8\n */\nKVIN.prototype.prepare$ArrayBuffer = function prepare$ArrayBuffer (o) {\n  let naive, naiveJSONLen;\n  let ab8, ab8JSONLen;\n  let ab16, ab16JSONLen;\n\n  if (this.tune === \"speed\" || this.tune === \"size\" || (o.byteLength < this.typedArrayPackThreshold)) {\n    naive = { ctr: this.ctors.indexOf(o.constructor), arg: Array.prototype.slice.call(o) }\n    if (this.tune === \"speed\") {\n      return naive\n    }\n  }\n\n  naiveJSONLen = naive ? JSON.stringify(naive).length : Infinity\n\n  ab8 = this.prepare$ArrayBuffer8(o)\n  if (this.tune !== \"size\") {\n    if (naive && naive.length < ab8.length) {\n      return naive\n    }\n    return ab8\n  }\n\n  ab16 = this.prepare$ArrayBuffer16(o)\n  ab8JSONLen = JSON.stringify(ab8).length;\n  ab16JSONLen = ab16 ? JSON.stringify(ab16).length : Infinity\n\n  if (ab16JSONLen < ab8JSONLen && ab16JSONLen < naiveJSONLen) {\n    return ab16\n  }\n  if (naiveJSONLen < ab8JSONLen) {\n    return naive\n  }\n\n  return ab8;\n}\n\nKVIN.prototype.prepare$RegExp = function prepare$RegExp (o) {\n  return {\n    ctr: this.ctors.indexOf(o.constructor),\n    args: [ o.source, o.flags ],\n  };\n}\n\n/**\n * Prepare a Set. Effectively wraps prepare$Array .\n *  @param   seen   The current seen list for this marshal - things pointers point to\n *  @param   set    The set we are preparing\n *  @param   where  Human description of where we are in the object, for debugging purposes\n */\nKVIN.prototype.prepare$Set = function prepare$Set (seen, set, where) {\n  const elements = this.prepare$Array(seen, Array.from(set.values()), where);\n  return {\n    set: elements,\n  };\n}\n\nKVIN.prototype.unprepare$Set = function prepare$Set (seen, po, position) {\n  const arr = this.unprepare$Array(seen, po.set, position);\n  return new Set(arr);\n}\n\nKVIN.prototype.prepare$Promise = function prepare$Promise(seen, promise, where)\n{\n  if (!seen.promises)\n    throw new Error(`synchronous invocation cannot marshal Promise ${where}`);\n  const ret = { /* placeholder */ };\n  promise\n    .catch(error => ret.reject  = this.prepare(seen, error, where + '$reject'))\n    .then (value => ret.resolve = this.prepare(seen, value, where + '$resolve'));\n  seen.promises.push(promise);\n  return ret;\n}\n\nKVIN.prototype.prepare$boxedPrimitive = function prepare$boxedPrimitive (o) {\n  return { ctr: this.ctors.indexOf(o.constructor), arg: o.toString() }\n}\n\nfunction prepare$bigint (n) {\n  return { bigint: n.toString() }\n}\n\nfunction prepare$number (n) {\n  if (!Number.isFinite(n))\n    return { number: n + '' };\n\n  if (1/n === -Infinity)\n    return { json: \"-0\" };\n\n  return n;\n}\n\n/* Store primitives and sort-of-primitives (like object literals) directly */\nfunction prepare$primitive (primitive, where) {\n  switch (typeof po) {\n    case 'boolean':\n    case 'number': /* not all cases, see prepare$number */\n    case 'string':\n      return primitive;\n  }\n  return { raw: primitive };\n}\n\nfunction prepare$undefined (o) {\n  return { undefined: true }\n}\n\nfunction prepare$symbol(o, seen)\n{\n  var i;\n  if ((i = seen.indexOf(o)) !== -1)\n    return { seen: i };\n  else\n  {\n    seen.push(o);\n    return { symbol: o.description };\n  }\n}\n\n/** Prepare a value for serialization\n *  @param      what any (supported) js value\n *  @param {Array}    __seen     list of objects and functions that were seen during traversal.\n *  @returns    an object which can be serialized with json\n */\nKVIN.prototype.marshal = function serialize$$marshal (what, __seen = []) {\n  return {_serializeVerId: this.serializeVerId, what: this.prepare(__seen, what, 'top')}\n}\n\n/**\n * Prepare a value that is a Promise or contains a Promise for serialization.\n *\n * Removes cycles in objects to enable stringification using `JSON.stringify`.\n *\n * @param   {*} value A supported js value that can be marshalled\n * @returns {Promise<object>} An object which can be serialized with\n * `JSON.stringify`\n */\nKVIN.prototype.marshalAsync = async function serialize$$marshalAsync(value)\n{\n  const seen = [];\n  seen.promises = [];\n\n  const marshalledObject = this.marshal(value, seen);\n  await Promise.allSettled(seen.promises);\n  return marshalledObject;\n}\n\n/** Turn a marshaled (prepared) value back into its original form\n *  @param      obj     a prepared object - the output of this.marshal()\n *  @returns    object  an object resembling the object originally passed to this.marshal()\n */\nKVIN.prototype.unmarshal = function serialize$$unmarshal (obj) {\n  if (typeof obj !== 'object' || obj === null) {\n    throw new Error(`Cannot unmarshal type ${typeof obj} or null.`)\n  }\n  if (!obj.hasOwnProperty('_serializeVerId')) {\n    throw new Error('Invalid serialization format (not KVIN)');\n  }\n  switch (obj._serializeVerId) {\n    case 'v4':\n    case 'v5':\n    case 'v6':\n    case 'v7':\n    case 'v8':\n    case 'v9':\n      break\n    default:\n      throw new Error(`Cannot unmarshal ${obj._serializeVerId} objects - please update Kvin`)\n  }\n  return this.unprepare([], obj.what, 'top')\n}\n\n/** Serialize a value.\n *  @param      what    The value to serialize\n *  @returns    The JSON serialization of the prepared object representing what.\n */\nKVIN.prototype.serialize = function serialize (what) {\n  return JSON.stringify(this.marshal(what))\n}\n\n/**\n * Serialize a value that is a Promise or contains Promises.\n *\n * @param   {*} value The value to serialize\n * @returns {Promise<string>} A JSON serialization representing the value\n */\nKVIN.prototype.serializeAsync = async function serializeAsync(value) {\n  return JSON.stringify(await this.marshalAsync(value))\n}\n\n/** Deserialize a value.\n *  @param      str     The JSON serialization of the prepared object representing the value.\n *  @returns    The deserialized value\n */\nKVIN.prototype.deserialize = function deserialize (str) {\n  if (typeof str !== 'string') {\n    throw new Error(`Cannot deserialize type ${typeof str}`)\n  }\n  return this.unmarshal(JSON.parse(str))\n}\n\nKVIN.prototype.serializeVerId = 'v9';\n\n/* JSON-like interface */\nKVIN.prototype.parse = KVIN.prototype.deserialize;\nKVIN.prototype.stringify = KVIN.prototype.serialize;\nKVIN.prototype.stringifyAsync = KVIN.prototype.serializeAsync;\n\nexports.base_kvin = new KVIN();\n\nfor (let prop in exports.base_kvin)\n{\n  if (typeof exports.base_kvin[prop] === 'function')\n    exports[prop] = exports.base_kvin[prop].bind(exports);\n  else {\n    exports[prop] = exports.base_kvin[prop]\n  }\n}\n\nexports.KVIN = KVIN;\n/* end of module */ })}\n"]}