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GACb,CACT,CACA,GAAA,IAAO,GACL,MAAO,GAAG,KAAK,QAAQ,KAAK,UAAU,IACxC,CACA,OAAA,CAAQ,GACN,OAAO,EAAI,WAAW,KAAK,KAC7B,CACA,IAAA,CAAK,KAAY,GACf,MAAM,EAAY,KAAK,MACjB,EAAU,KAAK,IACrB,OAAO,KAAK,OAAO,CACjB,KAAA,GACE,OAAO,EAAU,MAAiB,MAAX,EAAkB,EAAU,KAAM,EAC3D,EACA,GAAA,GACE,OAAO,EAAQ,MAAM,KAAM,EAC7B,GAEJ,CACA,MAAA,CAAO,GAGL,MAAM,UAAU,KAAK,aAErB,OADA,OAAO,OAAO,EAAE,UAAW,MACpB,IAAI,EAAE,EAAQ,MAAO,EAC9B,EAIF,UAAY,SACZ,MAEE,GAAwB,oBAAb,UAA4B,SAAS,YAAa,CAC3D,MAAM,EAAU,UAAU,UAAU,IACpC,UAAU,UAAU,IAAM,YAAa,GAGrC,OAFwB,MAAxB,SAAS,aAAuB,SAAS,YAAY,MACrD,KAAK,UAAU,IAAM,EACd,EAAQ,KAAK,QAAS,EAC/B,CACF,CACD,EAVD,GAWA,MAAM,mBAAqB,SAE3B,OAAO,OAAS,OAAO,QAAoC,SAAgB,EAAI,GAC7E,OAAO,OAAO,UAAU,eAAe,KAAK,EAAI,EAClD,EAEA,QAAQ,IAAM,UACd,QAAQ,WAAa,iBACrB,QAAQ,SAAW,SACnB,QAAQ,OAAS,OACjB,QAAQ,YAAc,YACtB,QAAQ,mBAAqB,mBAC7B,QAAQ,WAAa,WACrB,QAAQ,MAAQ,MAChB,QAAQ,MAAQ,YAChB,QAAQ,OAAS,aACjB,QAAQ,OAAS,OACjB,QAAQ,iBAAmB","file":"/npm/@data-client/endpoint@0.15.7/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@data-client/endpoint@0.15.7/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\n/**\n * Helpers to enable Immutable compatibility *without* bringing in\n * the 'immutable' package as a dependency.\n */\n\n/**\n * Check if an object is immutable by checking if it has a key specific\n * to the immutable library.\n *\n * @param  {any} object\n * @return {bool}\n */\nfunction isImmutable(object) {\n  return !!(typeof object.hasOwnProperty === 'function' && (Object.hasOwnProperty.call(object, '__ownerID') ||\n  // Immutable.Map\n  object._map && Object.hasOwnProperty.call(object._map, '__ownerID'))); // Immutable.Record\n}\n\n/**\n * Denormalize an immutable entity.\n *\n * @param  {Schema} schema\n * @param  {Immutable.Map|Immutable.Record} input\n * @param  {function} unvisit\n * @param  {function} getDenormalizedEntity\n * @return {Immutable.Map|Immutable.Record}\n */\nfunction denormalizeImmutable(schema, input, unvisit) {\n  let deleted;\n  const value = Object.keys(schema).reduce((object, key) => {\n    // Immutable maps cast keys to strings on write so we need to ensure\n    // we're accessing them using string keys.\n    const stringKey = `${key}`;\n    const item = unvisit(schema[stringKey], object.get(stringKey));\n    if (typeof item === 'symbol') {\n      deleted = item;\n    }\n    if (object.has(stringKey)) {\n      return object.set(stringKey, item);\n    } else {\n      return object;\n    }\n  }, input);\n  return deleted != null ? deleted : value;\n}\n\nclass PolymorphicSchema {\n  schema;\n  constructor(definition, schemaAttribute) {\n    if (schemaAttribute) {\n      this._schemaAttribute = typeof schemaAttribute === 'string' ? input => input[schemaAttribute] : schemaAttribute;\n    }\n    this.define(definition);\n  }\n  get isSingleSchema() {\n    return !this._schemaAttribute;\n  }\n  define(definition) {\n    // Only Union opts into hoisting (_hoistable = true)\n    // This prevents Array(Array(...)), Values(Array(...)), Array(Invalidate(...)) issues\n    if (definition._hoistable && !this._schemaAttribute) {\n      this.schema = definition.schema;\n      this._schemaAttribute = definition._schemaAttribute;\n    } else {\n      this.schema = definition;\n    }\n  }\n  getSchemaAttribute(input, parent, key) {\n    return !this.isSingleSchema && this._schemaAttribute(input, parent, key);\n  }\n  inferSchema(input, parent, key) {\n    if (this.isSingleSchema) {\n      return this.schema;\n    }\n    const attr = this.getSchemaAttribute(input, parent, key);\n    return this.schema[attr];\n  }\n  schemaKey() {\n    if (this.isSingleSchema) {\n      return this.schema.key;\n    }\n    return Object.values(this.schema).join(';');\n  }\n  normalizeValue(value, parent, key, args, visit) {\n    if (!value) return value;\n    const isSingle = this.isSingleSchema;\n    const schema = isSingle ? this.schema : this.schema[this._schemaAttribute(value, parent, key)];\n    if (!schema) {\n      /* istanbul ignore else */\n      if (process.env.NODE_ENV !== 'production') {\n        const attr = this._schemaAttribute(value, parent, key);\n        console.warn(`Schema attribute ${JSON.stringify(attr, undefined, 2)} is not expected.\nExpected one of: ${Object.keys(this.schema).map(k => `\"${k}\"`).join(', ')}\n\nValue: ${JSON.stringify(value, undefined, 2)}`);\n      }\n      return value;\n    }\n    const normalizedValue = visit(schema, value, parent, key, args);\n    return isSingle || normalizedValue === undefined || normalizedValue === null ? normalizedValue : {\n      id: normalizedValue,\n      schema: this._schemaAttribute(value, parent, key)\n    };\n  }\n\n  // value is guaranteed by caller to not be null\n  denormalizeValue(value, unvisit) {\n    const isSingle = this.isSingleSchema;\n    const schemaKey = !isSingle && value && (isImmutable(value) ? value.get('schema') : value.schema);\n    if (!isSingle && !schemaKey) {\n      // denormalize should also handle 'passthrough' values (not normalized) and still\n      // construct the correct Entity instance\n      if (typeof value === 'object' && value !== null) {\n        const schema = this.inferSchema(value, undefined, undefined);\n        if (schema) return unvisit(schema, value);\n      }\n      /* istanbul ignore else */\n      if (process.env.NODE_ENV !== 'production' && value) {\n        console.warn(`TypeError: Unable to determine schema for ${this.constructor.name}\nValue: ${JSON.stringify(value, undefined, 2)}.`);\n      }\n      return value;\n    }\n    const id = isSingle ? undefined : isImmutable(value) ? value.get('id') : value.id;\n    const schema = isSingle ? this.schema : this.schema[schemaKey];\n    return unvisit(schema, id || value);\n  }\n}\n\n/**\n * Represents polymorphic values.\n * @see https://dataclient.io/rest/api/Union\n */\nclass UnionSchema extends PolymorphicSchema {\n  // Union is designed to be transparent; allow hoisting into wrappers (Array, Values)\n  _hoistable = true;\n  constructor(definition, schemaAttribute) {\n    if (!schemaAttribute) {\n      throw new Error('Expected option \"schemaAttribute\" not found on UnionSchema.');\n    }\n    super(definition, schemaAttribute);\n  }\n  normalize(input, parent, key, args, visit) {\n    return this.normalizeValue(input, parent, key, args, visit);\n  }\n  denormalize(input, args, unvisit) {\n    return this.denormalizeValue(input, unvisit);\n  }\n  queryKey(args, unvisit) {\n    if (!args[0]) return;\n    // Often we have sufficient information in the first arg like { id, type }\n    const schema = this.getSchemaAttribute(args[0], undefined, '');\n    const discriminatedSchema = this.schema[schema];\n\n    // Fast case - args include type discriminator\n    if (discriminatedSchema) {\n      const id = unvisit(discriminatedSchema, args);\n      if (id === undefined) return;\n      return {\n        id,\n        schema\n      };\n    }\n\n    // Fallback to trying every possible schema if it cannot be determined\n    for (const key in this.schema) {\n      const id = unvisit(this.schema[key], args);\n      if (id !== undefined) {\n        return {\n          id,\n          schema: key\n        };\n      }\n    }\n  }\n}\n\n/**\n * Represents variably sized objects\n * @see https://dataclient.io/rest/api/Values\n */\nclass ValuesSchema extends PolymorphicSchema {\n  normalize(input, parent, key, args, visit, snapshot) {\n    const output = {};\n    const keys = Object.keys(input);\n    for (let i = 0; i < keys.length; i++) {\n      const k = keys[i];\n      const value = input[k];\n      if (value !== undefined && value !== null) {\n        output[k] = this.normalizeValue(value, input, k, args, visit);\n      }\n    }\n    return output;\n  }\n  denormalize(input, args, unvisit) {\n    const output = {};\n    const keys = Object.keys(input);\n    for (let i = 0; i < keys.length; i++) {\n      const k = keys[i];\n      const entityOrId = input[k];\n      const value = this.denormalizeValue(entityOrId, unvisit);\n\n      // remove empty or deleted values\n      if (value && typeof value !== 'symbol') {\n        output[k] = value;\n      }\n    }\n    return output;\n  }\n  queryKey(args, unvisit, delegate) {\n    return undefined;\n  }\n}\n\nconst getValues = input => Array.isArray(input) ? input : Object.keys(input).map(key => input[key]);\nconst filterEmpty = item => item !== undefined && typeof item !== 'symbol';\n\n/**\n * Represents arrays\n * @see https://dataclient.io/rest/api/Array\n */\nclass ArraySchema extends PolymorphicSchema {\n  normalize(input, parent, key, args, visit) {\n    const values = getValues(input);\n    return values.map(value => this.normalizeValue(value, parent, key, args, visit));\n  }\n  denormalize(input, args, unvisit) {\n    return input.map ? input.map(entityOrId => this.denormalizeValue(entityOrId, unvisit)).filter(filterEmpty) : input;\n  }\n  queryKey(args, unvisit, delegate) {\n    return undefined;\n  }\n  toJSON() {\n    return [this.schema];\n  }\n}\n\n/**\n * Retrieves all entities in cache\n *\n * @see https://dataclient.io/rest/api/All\n */\nclass AllSchema extends ArraySchema {\n  constructor(definition, schemaAttribute) {\n    super(definition, schemaAttribute);\n  }\n  normalize(input, parent, key, args, visit) {\n    // we return undefined so we always 'query'\n    super.normalize(input, parent, key, args, visit);\n  }\n  queryKey(args, unvisit, delegate) {\n    if (this.isSingleSchema) {\n      const entities = delegate.getEntities(this.schema.key);\n      if (!entities) return delegate.INVALID;\n      return [...entities.keys()];\n    }\n    let found = false;\n    const list = Object.values(this.schema).flatMap(schema => {\n      const entities = delegate.getEntities(schema.key);\n      if (!entities) return [];\n      found = true;\n      const normEntities = [];\n      for (const [key, entity] of entities.entries()) {\n        if (!entity || typeof entity === 'symbol') continue;\n        normEntities.push({\n          id: schema.pk(entity, undefined, key, []),\n          schema: this.getSchemaAttribute(entity, undefined, key)\n        });\n      }\n      return normEntities;\n    });\n    // we need at least one table entry of the Union for this to count as Valid.\n    if (!found) return delegate.INVALID;\n    return list;\n  }\n}\n\nconst normalize = (schema, input, parent, key, args, visit) => {\n  const object = {\n    ...input\n  };\n  const keys = Object.keys(schema);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    const value = visit(schema[key], input[key], input, key, args);\n    if (value === undefined) {\n      delete object[key];\n    } else {\n      object[key] = value;\n    }\n  }\n  return object;\n};\nfunction denormalize$1(schema, input, args, unvisit) {\n  if (isImmutable(input)) {\n    return denormalizeImmutable(schema, input, unvisit);\n  }\n  const object = {\n    ...input\n  };\n  const keys = Object.keys(schema);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    const item = unvisit(schema[key], object[key]);\n    if (object[key] !== undefined) {\n      object[key] = item;\n    }\n    if (typeof item === 'symbol') {\n      return item;\n    }\n  }\n  return object;\n}\nfunction objectQueryKey(schema, args, unvisit) {\n  const resultObject = {};\n  const keys = Object.keys(schema);\n  for (let i = 0; i < keys.length; i++) {\n    const k = keys[i];\n    resultObject[k] = unvisit(schema[k], args);\n  }\n  return resultObject;\n}\n/**\n * Represents objects with statically known members\n * @see https://dataclient.io/rest/api/Object\n */\nclass ObjectSchema {\n  schema;\n  constructor(definition) {\n    this.define(definition);\n  }\n  define(definition) {\n    this.schema = Object.keys(definition).reduce((entitySchema, key) => {\n      const schema = definition[key];\n      return {\n        ...entitySchema,\n        [key]: schema\n      };\n    }, this.schema || {});\n  }\n  normalize(...args) {\n    return normalize(this.schema, ...args);\n  }\n  denormalize(input, args, unvisit) {\n    return denormalize$1(this.schema, input, args, unvisit);\n  }\n  queryKey(args, unvisit) {\n    return objectQueryKey(this.schema, args, unvisit);\n  }\n}\n\n/** Structural type for hoistable polymorphic schemas like Union */\n\n/**\n * Marks entity as Invalid.\n *\n * This triggers suspense for all endpoints requiring it.\n * Optional (like variable sized Array and Values) will simply remove the item.\n * @see https://dataclient.io/rest/api/Invalidate\n */\nclass Invalidate extends PolymorphicSchema {\n  /**\n   * Marks entity as Invalid.\n   *\n   * This triggers suspense for all endpoints requiring it.\n   * Optional (like variable sized Array and Values) will simply remove the item.\n   * @see https://dataclient.io/rest/api/Invalidate\n   */\n  constructor(entity, schemaAttribute) {\n    if (process.env.NODE_ENV !== 'production' && !entity) {\n      throw new Error('Invalidate schema requires \"entity\" option.');\n    }\n    super(entity, schemaAttribute);\n  }\n  get key() {\n    return this.schemaKey();\n  }\n  normalize(input, parent, key, args, visit, delegate) {\n    const entitySchema = this.inferSchema(input, parent, key);\n    if (!entitySchema) return input;\n\n    // Handle string/number input (already processed pk)\n    // Note: This branch is typically not reached through public API as getVisit\n    // handles primitives before calling schema.normalize()\n    let pk;\n    /* istanbul ignore if */\n    if (typeof input === 'string' || typeof input === 'number') {\n      pk = input;\n    } else {\n      // Must call process() to get correct pk\n      const processedEntity = entitySchema.process(input, parent, key, args);\n      pk = entitySchema.pk(processedEntity != null ? processedEntity : input, parent, key, args);\n      if (process.env.NODE_ENV !== 'production' && (pk === undefined || pk === '' || pk === 'undefined')) {\n        const error = new Error(`Missing usable primary key when normalizing response.\n\n  This is likely due to a malformed response.\n  Try inspecting the network response or fetch() return value.\n  Or use debugging tools: https://dataclient.io/docs/getting-started/debugging\n  Learn more about schemas: https://dataclient.io/docs/api/schema\n\n  Invalidate(Entity): Invalidate(${entitySchema.key})\n  Value (processed): ${input && JSON.stringify(input, null, 2)}\n  `);\n        error.status = 400;\n        throw error;\n      }\n    }\n    pk = `${pk}`; // ensure pk is a string\n\n    // any queued updates are meaningless with delete, so we should just set it\n    // and creates will have a different pk\n    delegate.invalidate(entitySchema, pk);\n    return this.isSingleSchema ? pk : {\n      id: pk,\n      schema: this.getSchemaAttribute(input, parent, key)\n    };\n  }\n  queryKey(_args, _unvisit, _delegate) {\n    return undefined;\n  }\n  denormalize(id, args, unvisit) {\n    // denormalizeValue handles both single entity and polymorphic cases\n    return this.denormalizeValue(id, unvisit);\n  }\n\n  /* istanbul ignore next */\n  _denormalizeNullable() {\n    return {};\n  }\n\n  /* istanbul ignore next */\n  _normalizeNullable() {\n    return {};\n  }\n}\n\n/** This serializes in consistent way even if members are added in differnet orders */\nfunction consistentSerialize(obj) {\n  const keys = Object.keys(obj).sort();\n  const sortedObj = {};\n  for (const key of keys) {\n    sortedObj[key] = obj[key];\n  }\n  return JSON.stringify(sortedObj);\n}\n\nconst pushMerge = (existing, incoming) => {\n  return [...existing, ...incoming];\n};\nconst unshiftMerge = (existing, incoming) => {\n  return [...incoming, ...existing];\n};\nconst valuesMerge = (existing, incoming) => {\n  return {\n    ...existing,\n    ...incoming\n  };\n};\nconst isShallowEqual = (a, b) => {\n  // TODO: make this extensible in the child's schema\n  if (typeof a === 'object' && typeof b === 'object') {\n    return a.id === b.id && a.schema === b.schema;\n  }\n  return a === b;\n};\nconst removeMerge = (existing, incoming) => existing.filter(item => !incoming.some(inc => isShallowEqual(item, inc)));\nconst valuesRemoveMerge = (existing, incoming) => {\n  const incomingValues = Object.values(incoming);\n  const result = {};\n  for (const [key, value] of Object.entries(existing)) {\n    if (!incomingValues.some(iv => isShallowEqual(value, iv))) {\n      result[key] = value;\n    }\n  }\n  return result;\n};\nconst createArray = value => [...value];\nconst createValue = value => ({\n  ...value\n});\n\n/**\n * Entities but for Arrays instead of classes\n * @see https://dataclient.io/rest/api/Collection\n */\nclass CollectionSchema {\n  addWith(merge, createCollectionFilter) {\n    return CreateAdder(this, merge, createCollectionFilter);\n  }\n\n  // this adds to any list *in store* that has same members as the urlParams\n  // so fetch(create, { userId: 'bob', completed: true }, data)\n  // would possibly add to {}, {userId: 'bob'}, {completed: true}, {userId: 'bob', completed: true } - but only those already in the store\n  // it ignores keys that start with sort as those are presumed to not filter results\n  createCollectionFilter(...args) {\n    return collectionKey => Object.entries(collectionKey).every(([key, value]) => {\n      var _args$;\n      return this.nonFilterArgumentKeys(key) ||\n      // strings are canonical form. See pk() above for value transformation\n      `${args[0][key]}` === value || `${(_args$ = args[1]) == null ? void 0 : _args$[key]}` === value;\n    });\n  }\n  nonFilterArgumentKeys(key) {\n    return key.startsWith('order');\n  }\n  constructor(schema, options) {\n    this.schema = Array.isArray(schema) ? new ArraySchema(schema[0]) : schema;\n    if (!options) {\n      this.argsKey = params => ({\n        ...params\n      });\n    } else {\n      if ('nestKey' in options) {\n        this.nestKey = options.nestKey;\n      } else if ('argsKey' in options) {\n        this.argsKey = options.argsKey;\n      } else {\n        this.argsKey = params => ({\n          ...params\n        });\n      }\n    }\n    this.key = keyFromSchema(this.schema);\n    if (options != null && options.nonFilterArgumentKeys) {\n      const {\n        nonFilterArgumentKeys\n      } = options;\n      if (typeof nonFilterArgumentKeys === 'function') {\n        this.nonFilterArgumentKeys = nonFilterArgumentKeys;\n      } else if (nonFilterArgumentKeys instanceof RegExp) {\n        this.nonFilterArgumentKeys = key => nonFilterArgumentKeys.test(key);\n      } else {\n        this.nonFilterArgumentKeys = key => nonFilterArgumentKeys.includes(key);\n      }\n    } else if (options != null && options.createCollectionFilter)\n      // TODO(breaking): rename to filterCollections\n      this.createCollectionFilter = options.createCollectionFilter.bind(this);\n\n    // >>>>>>>>>>>>>>CREATION<<<<<<<<<<<<<<\n    if (this.schema instanceof ArraySchema) {\n      this.createIfValid = createArray;\n      this.push = CreateAdder(this, pushMerge);\n      this.unshift = CreateAdder(this, unshiftMerge);\n      this.remove = CreateAdder(this, removeMerge);\n      this.move = CreateMover(this, pushMerge, removeMerge);\n    } else if (schema instanceof ValuesSchema) {\n      this.createIfValid = createValue;\n      this.assign = CreateAdder(this, valuesMerge);\n      this.remove = CreateAdder(this, valuesRemoveMerge);\n      this.move = CreateMover(this, valuesMerge, valuesRemoveMerge);\n    }\n  }\n  get cacheWith() {\n    return this.schema.schema;\n  }\n  toString() {\n    return this.key;\n  }\n  toJSON() {\n    return {\n      key: this.key,\n      schema: this.schema.schema\n    };\n  }\n  pk(value, parent, key, args) {\n    const obj = this.argsKey ? this.argsKey(...args) : this.nestKey(parent, key);\n    for (const key in obj) {\n      if (['number', 'boolean'].includes(typeof obj[key])) obj[key] = `${obj[key]}`;\n    }\n    return consistentSerialize(obj);\n  }\n\n  // >>>>>>>>>>>>>>NORMALIZE<<<<<<<<<<<<<<\n\n  normalize(input, parent, key, args, visit, delegate) {\n    const normalizedValue = this.schema.normalize(input, parent, key, args, visit, delegate);\n    const id = this.pk(normalizedValue, parent, key, args);\n    delegate.mergeEntity(this, id, normalizedValue);\n    return id;\n  }\n\n  // always replace\n  merge(existing, incoming) {\n    return incoming;\n  }\n  shouldReorder(existingMeta, incomingMeta, existing, incoming) {\n    return incomingMeta.fetchedAt < existingMeta.fetchedAt;\n  }\n  mergeWithStore(existingMeta, incomingMeta, existing, incoming) {\n    return this.shouldReorder(existingMeta, incomingMeta, existing, incoming) ? this.merge(incoming, existing) : this.merge(existing, incoming);\n  }\n  mergeMetaWithStore(existingMeta, incomingMeta, existing, incoming) {\n    return this.shouldReorder(existingMeta, incomingMeta, existing, incoming) ? existingMeta : incomingMeta;\n  }\n\n  // >>>>>>>>>>>>>>DENORMALIZE<<<<<<<<<<<<<<\n\n  queryKey(args, unvisit, delegate) {\n    if (this.argsKey) {\n      const pk = this.pk(undefined, undefined, '', args);\n      // ensure this actually has entity or we shouldn't try to use it in our query\n      if (delegate.getEntity(this.key, pk)) return pk;\n    }\n  }\n  denormalize(input, args, unvisit) {\n    return this.schema.denormalize(input, args, unvisit);\n  }\n}\nfunction derivedProperties(collection, merge, normalizeFn) {\n  const properties = {\n    merge: {\n      value: merge\n    },\n    normalize: {\n      value: normalizeFn\n    },\n    queryKey: {\n      value: queryKeyCreate\n    }\n  };\n  if (collection.schema instanceof ArraySchema) {\n    properties.createIfValid = {\n      value: createIfValid\n    };\n    properties.denormalize = {\n      value: denormalize\n    };\n  }\n  return properties;\n}\nfunction CreateAdder(collection, merge, createCollectionFilter) {\n  const properties = derivedProperties(collection, merge, normalizeCreate);\n  if (createCollectionFilter) {\n    properties.createCollectionFilter = {\n      value: createCollectionFilter\n    };\n  }\n  return Object.create(collection, properties);\n}\nfunction queryKeyCreate() {}\nfunction normalizeCreate(input, parent, key, args, visit, delegate) {\n  if (process.env.NODE_ENV !== 'production') {\n    // means 'this is a creation endpoint' - so real PKs are not required\n    // this is used by Entity.normalize() to determine whether to allow empty pks\n    // visit instances are created on each normalize call so this will safely be reset\n    visit.creating = true;\n  }\n  const normalizedValue = this.schema.normalize(!(this.schema instanceof ArraySchema) || Array.isArray(input) ? input : [input], parent, key, args, visit, delegate);\n  // parent is args when not nested\n  const filterCollections = this.createCollectionFilter(...args);\n  // add to any collections that match this\n  const entities = delegate.getEntities(this.key);\n  if (entities) for (const collectionKey of entities.keys()) {\n    if (!filterCollections(JSON.parse(collectionKey))) continue;\n    delegate.mergeEntity(this, collectionKey, normalizedValue);\n  }\n  return normalizedValue;\n}\nfunction CreateMover(collection, addMerge, removeMerge) {\n  return Object.create(collection, derivedProperties(collection, addMerge, function (input, parent, key, args, visit, delegate) {\n    return normalizeMove.call(this, addMerge, removeMerge, input, parent, key, args, visit, delegate);\n  }));\n}\nfunction normalizeMove(addMerge, removeMergeFunc, input, parent, key, args, visit, delegate) {\n  const isArray = this.schema instanceof ArraySchema;\n  const entitySchema = this.schema.schema;\n\n  // Snapshot existing entity state before normalization overwrites it\n  const items = isArray && Array.isArray(input) ? input : [input];\n  const existingEntities = items.map(item => {\n    const processed = entitySchema.process(item, parent, key, args);\n    const pk = `${entitySchema.pk(processed, parent, key, args)}`;\n    return {\n      pk,\n      processed,\n      existingEntity: pk ? delegate.getEntity(entitySchema.key, pk) : undefined\n    };\n  });\n\n  // Normalize full input (updates entities in store)\n  const toNormalize = isArray ? Array.isArray(input) ? input : [input] : existingEntities[0].pk ? {\n    [existingEntities[0].pk]: input\n  } : input;\n  const normalizedValue = this.schema.normalize(toNormalize, parent, key, args, visit, delegate);\n  const lastArg = args[args.length - 1];\n  const addSchema = Object.create(this, {\n    merge: {\n      value: addMerge\n    }\n  });\n  const removeSchema = Object.create(this, {\n    merge: {\n      value: removeMergeFunc\n    }\n  });\n  const collections = delegate.getEntities(this.key);\n\n  // Process each entity's collection membership individually\n  if (collections) {\n    for (let i = 0; i < existingEntities.length; i++) {\n      const {\n        processed,\n        existingEntity\n      } = existingEntities[i];\n      const value = isArray ? [normalizedValue[i]] : normalizedValue;\n      // For arrays, per-entity fields determine membership;\n      // lastArg fills in shared path params not on the entity\n      const newValues = isArray ? {\n        ...lastArg,\n        ...processed\n      } : lastArg;\n      const mergedValues = existingEntity ? {\n        ...existingEntity,\n        ...newValues\n      } : newValues;\n      const removeFilter = existingEntity ? this.createCollectionFilter({\n        ...args[0],\n        ...existingEntity\n      }, existingEntity) : undefined;\n      const addFilter = this.createCollectionFilter({\n        ...args[0],\n        ...newValues\n      }, mergedValues);\n      for (const collectionKey of collections.keys()) {\n        const parsed = JSON.parse(collectionKey);\n        const shouldRemove = removeFilter == null ? void 0 : removeFilter(parsed);\n        const shouldAdd = addFilter(parsed);\n        if (shouldRemove && !shouldAdd) {\n          delegate.mergeEntity(removeSchema, collectionKey, value);\n        } else if (shouldAdd && !shouldRemove) {\n          delegate.mergeEntity(addSchema, collectionKey, value);\n        }\n      }\n    }\n  }\n  return normalizedValue;\n}\nfunction createIfValid(value) {\n  return Array.isArray(value) ? [...value] : {\n    ...value\n  };\n}\n\n// only for arrays\nfunction denormalize(input, args, unvisit) {\n  return Array.isArray(input) ? this.schema.denormalize(input, args, unvisit) : this.schema.denormalize([input], args, unvisit)[0];\n}\n/**\n * We call schema.denormalize and schema.normalize directly\n * instead of visit/unvisit as we are not operating on new data\n * so the additional checks in those methods are redundant\n */\n\nfunction keyFromSchema(schema) {\n  if (schema instanceof ArraySchema) {\n    // this assumes the definition of Array/Values is Entity\n    return `[${schema.schemaKey()}]`;\n  } else if (schema instanceof ValuesSchema) {\n    return `{${schema.schemaKey()}}`;\n  }\n  return `(${schema.schemaKey()})`;\n}\n\n/**\n * Turns any class into an Entity.\n * @see https://dataclient.io/rest/api/EntityMixin\n */\n\n// id is in Instance, so we default to that as pk\n\n// pk was specified in options, so we don't need to redefine\n\nfunction EntityMixin(Base, options = {}) {\n  /**\n   * Entity defines a single (globally) unique object.\n   * @see https://dataclient.io/rest/api/Entity\n   */\n  class EntityMixin extends Base {\n    static toString() {\n      return this.key;\n    }\n    static toJSON() {\n      return {\n        key: this.key,\n        schema: this.schema\n      };\n    }\n\n    /** Defines nested entities */\n\n    /**\n     * A unique identifier for each Entity\n     *\n     * @see https://dataclient.io/rest/api/Entity#pk\n     * @param [parent] When normalizing, the object which included the entity\n     * @param [key] When normalizing, the key where this entity was found\n     * @param [args] ...args sent to Endpoint\n     */\n\n    /** Returns the globally unique identifier for the static Entity */\n\n    // default implementation in class static block at bottom of definition\n\n    /** Defines indexes to enable lookup by */\n\n    /**\n     * A unique identifier for each Entity\n     *\n     * @see https://dataclient.io/rest/api/Entity#pk\n     * @param [value] POJO of the entity or subset used\n     * @param [parent] When normalizing, the object which included the entity\n     * @param [key] When normalizing, the key where this entity was found\n     * @param [args] ...args sent to Endpoint\n     */\n    static pk(value, parent, key, args) {\n      return this.prototype.pk.call(value, parent, key, args);\n    }\n\n    /** Return true to merge incoming data; false keeps existing entity\n     *\n     * @see https://dataclient.io/rest/api/Entity#shouldUpdate\n     */\n    static shouldUpdate(existingMeta, incomingMeta, existing, incoming) {\n      return true;\n    }\n\n    /** Determines the order of incoming entity vs entity already in store\\\n     *\n     * @see https://dataclient.io/rest/api/Entity#shouldReorder\n     * @returns true if incoming entity should be first argument of merge()\n     */\n    static shouldReorder(existingMeta, incomingMeta, existing, incoming) {\n      return incomingMeta.fetchedAt < existingMeta.fetchedAt;\n    }\n\n    /** Creates new instance copying over defined values of arguments\n     *\n     * @see https://dataclient.io/rest/api/Entity#merge\n     */\n    static merge(existing, incoming) {\n      return {\n        ...existing,\n        ...incoming\n      };\n    }\n\n    /** Run when an existing entity is found in the store\n     *\n     * @see https://dataclient.io/rest/api/Entity#mergeWithStore\n     */\n    static mergeWithStore(existingMeta, incomingMeta, existing, incoming) {\n      const shouldUpdate = this.shouldUpdate(existingMeta, incomingMeta, existing, incoming);\n      if (shouldUpdate) {\n        // distinct types are not mergeable (like delete symbol), so just replace\n        if (typeof incoming !== typeof existing) {\n          return incoming;\n        } else {\n          return this.shouldReorder(existingMeta, incomingMeta, existing, incoming) ? this.merge(incoming, existing) : this.merge(existing, incoming);\n        }\n      } else {\n        return existing;\n      }\n    }\n\n    /** Run when an existing entity is found in the store\n     *\n     * @see https://dataclient.io/rest/api/Entity#mergeMetaWithStore\n     */\n    static mergeMetaWithStore(existingMeta, incomingMeta, existing, incoming) {\n      return this.shouldReorder(existingMeta, incomingMeta, existing, incoming) ? existingMeta : incomingMeta;\n    }\n\n    /** Factory method to convert from Plain JS Objects.\n     *\n     * @param [props] Plain Object of properties to assign.\n     */\n    static fromJS(\n    // TODO: this should only accept members that are not functions\n    props = {}) {\n      // we type guarded abstract case above, so ok to force typescript to allow constructor call\n      const instance = new this(props);\n      // we can't rely on constructors and override the defaults provided as property assignments\n      // all occur after the constructor\n      Object.assign(instance, props);\n      return instance;\n    }\n\n    /** Called when denormalizing an entity to create an instance when 'valid'\n     *\n     * @see https://dataclient.io/rest/api/Entity#createIfValid\n     * @param [props] Plain Object of properties to assign.\n     */\n    static createIfValid(\n    // TODO: this should only accept members that are not functions\n    props) {\n      if (this.validate(props)) {\n        return undefined;\n      }\n      return this.fromJS(props);\n    }\n\n    /** Do any transformations when first receiving input\n     *\n     * @see https://dataclient.io/rest/api/Entity#process\n     */\n    static process(input, parent, key, args) {\n      return {\n        ...input\n      };\n    }\n    static normalize(input, parent, key, args, visit, delegate) {\n      const processedEntity = this.process(input, parent, key, args);\n      let id;\n      if (typeof processedEntity === 'undefined') {\n        id = `${this.pk(input, parent, key, args)}`;\n        // TODO: add undefined id check\n\n        delegate.invalidate(this, id);\n        return id;\n      }\n      id = this.pk(processedEntity, parent, key, args);\n      if (id === undefined || id === '' || id === 'undefined') {\n        // 'creates' conceptually should allow missing PK to make optimistic creates easy\n        if (process.env.NODE_ENV !== 'production' && !visit.creating) {\n          let why;\n          if (!('pk' in options) && EntityMixin.prototype.pk === this.prototype.pk && !('id' in processedEntity)) {\n            why = `'id' missing but needed for default pk(). Try defining pk() for your Entity.`;\n          } else {\n            why = `This is likely due to a malformed response.\n  Try inspecting the network response or fetch() return value.\n  Or use debugging tools: https://dataclient.io/docs/getting-started/debugging`;\n          }\n          const error = new Error(`Missing usable primary key when normalizing response.\n\n  ${why}\n  Learn more about primary keys: https://dataclient.io/rest/api/Entity#pk\n\n  Entity: ${this.key}\n  Value (processed): ${processedEntity && JSON.stringify(processedEntity, null, 2)}\n`);\n          error.status = 400;\n          throw error;\n        }\n        // create a random id if a valid one cannot be computed\n        // this is useful for optimistic creates that don't need real ids - just something to hold their place\n        id = `MISS-${Math.random()}`;\n      } else {\n        id = `${id}`;\n      }\n\n      /* Circular reference short-circuiter */\n      if (delegate.checkLoop(this.key, id, input)) return id;\n      const errorMessage = this.validate(processedEntity);\n      throwValidationError(errorMessage);\n      const schemaKeys = Object.keys(this.schema);\n      for (let i = 0; i < schemaKeys.length; i++) {\n        const key = schemaKeys[i];\n        if (Object.hasOwn(processedEntity, key)) {\n          processedEntity[key] = visit(this.schema[key], processedEntity[key], processedEntity, key, args);\n        }\n      }\n      delegate.mergeEntity(this, id, processedEntity);\n      return id;\n    }\n    static validate(processedEntity) {\n      return;\n    }\n    static queryKey(args, unvisit, delegate) {\n      if (!args[0]) return;\n      const pk = queryKeyCandidate(this, args, delegate);\n      // ensure this actually has entity or we shouldn't try to use it in our query\n      if (pk && delegate.getEntity(this.key, pk)) return pk;\n    }\n    static denormalize(input, args, unvisit) {\n      if (typeof input === 'symbol') {\n        return input;\n      }\n\n      // note: iteration order must be stable\n      for (const key of Object.keys(this.schema)) {\n        const schema = this.schema[key];\n        const value = unvisit(schema, input[key]);\n        if (typeof value === 'symbol') {\n          // if default is not 'falsy', then this is required, so propagate INVALID symbol\n          if (this.defaults[key]) {\n            return value;\n          }\n          input[key] = undefined;\n        } else {\n          input[key] = value;\n        }\n      }\n      return input;\n    }\n\n    /** All instance defaults set */\n    static get defaults() {\n      // we use hasOwn because we don't want to use a parents' defaults\n      if (!Object.hasOwn(this, '__defaults')) Object.defineProperty(this, '__defaults', {\n        value: new this(),\n        writable: true,\n        configurable: true\n      });\n      return this.__defaults;\n    }\n  }\n  const {\n    pk,\n    schema,\n    key,\n    ...staticProps\n  } = options;\n  // remaining options\n  Object.assign(EntityMixin, staticProps);\n  if ('schema' in options) {\n    EntityMixin.schema = options.schema;\n  } else if (!Base.schema) {\n    EntityMixin.schema = {};\n  }\n  if ('pk' in options) {\n    if (typeof options.pk === 'function') {\n      EntityMixin.prototype.pk = function (parent, key) {\n        return options.pk(this, parent, key);\n      };\n    } else {\n      EntityMixin.prototype.pk = function () {\n        return this[options.pk];\n      };\n    }\n    // default to 'id' field if the base class doesn't have a pk\n  } else if (typeof Base.prototype.pk !== 'function') {\n    EntityMixin.prototype.pk = function () {\n      return this.id;\n    };\n  }\n  if ('key' in options) {\n    Object.defineProperty(EntityMixin, 'key', {\n      value: options.key,\n      configurable: true,\n      writable: true,\n      enumerable: true\n    });\n  } else if (!('key' in Base)) {\n    function set(value) {\n      Object.defineProperty(this, 'key', {\n        value,\n        writable: true,\n        enumerable: true,\n        configurable: true\n      });\n    }\n    const baseGet = function () {\n      const name = this.name === 'EntityMixin' ? Base.name : this.name;\n      /* istanbul ignore next */\n      if (process.env.NODE_ENV !== 'production' && (name === '' || name === 'EntityMixin' || name === '_temp')) throw new Error('Entity classes without a name must define `static key`\\nSee: https://dataclient.io/rest/api/Entity#key');\n      return name;\n    };\n    const get = /* istanbul ignore if */\n    typeof document !== 'undefined' && document.CLS_MANGLE ? /* istanbul ignore next */function () {\n      document.CLS_MANGLE == null || document.CLS_MANGLE(this);\n      Object.defineProperty(EntityMixin, 'key', {\n        get: baseGet,\n        set,\n        enumerable: true,\n        configurable: true\n      });\n      return baseGet.call(this);\n    } : baseGet;\n    Object.defineProperty(EntityMixin, 'key', {\n      get,\n      set,\n      enumerable: true,\n      configurable: true\n    });\n  }\n  return EntityMixin;\n}\nfunction indexFromParams(params, indexes) {\n  if (!indexes) return undefined;\n  return indexes.find(index => Object.hasOwn(params, index));\n}\n\n// part of the reason for pulling this out is that all functions that throw are deoptimized\nfunction throwValidationError(errorMessage) {\n  if (errorMessage) {\n    const error = new Error(errorMessage);\n    error.status = 400;\n    throw error;\n  }\n}\nfunction queryKeyCandidate(schema, args, delegate) {\n  if (['string', 'number'].includes(typeof args[0])) {\n    return `${args[0]}`;\n  }\n  const id = schema.pk(args[0], undefined, '', args);\n  // Was able to infer the entity's primary key from params\n  if (id !== undefined && id !== '') return id;\n  // now attempt lookup in indexes\n  const field = indexFromParams(args[0], schema.indexes);\n  if (!field) return;\n  const value = args[0][field];\n  return delegate.getIndex(schema.key, field, value);\n}\n\n/**\n * Programmatic cache reading\n *\n * @see https://dataclient.io/rest/api/Query\n */\nclass Query {\n  /**\n   * Programmatic cache reading\n   *\n   * @see https://dataclient.io/rest/api/Query\n   */\n  constructor(schema, process) {\n    this.schema = schema;\n    this.process = process;\n  }\n  normalize(...args) {\n    return this.schema.normalize(...args);\n  }\n  denormalize(input, args, unvisit) {\n    const value = unvisit(this.schema, input);\n    return typeof value === 'symbol' ? value : this.process(value, ...args);\n  }\n  queryKey(args, unvisit) {\n    return unvisit(this.schema, args);\n  }\n}\n\n/* istanbul ignore file */\n\nvar schema = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  All: AllSchema,\n  Array: ArraySchema,\n  Collection: CollectionSchema,\n  Entity: EntityMixin,\n  EntityMixin: EntityMixin,\n  Invalidate: Invalidate,\n  Object: ObjectSchema,\n  Query: Query,\n  Union: UnionSchema,\n  Values: ValuesSchema\n});\n\nconst EmptyBase = class {};\n\n/**\n * Entity defines a single (globally) unique object.\n * @see https://dataclient.io/rest/api/Entity\n */\nclass Entity extends EntityMixin(EmptyBase) {\n  /** Control how automatic schema validation is handled\n   *\n   * `undefined`: Defaults - throw error in worst offense\n   * 'warn': only ever warn\n   * 'silent': Don't bother with processing at all\n   *\n   * Note: this only applies to non-nested members.\n   */\n\n  /** Factory method to convert from Plain JS Objects.\n   *\n   * @see https://dataclient.io/rest/api/Entity#fromJS\n   * @param [props] Plain Object of properties to assign.\n   */\n\n  /**\n   * A unique identifier for each Entity\n   *\n   * @see https://dataclient.io/rest/api/Entity#pk\n   * @param [value] POJO of the entity or subset used\n   * @param [parent] When normalizing, the object which included the entity\n   * @param [key] When normalizing, the key where this entity was found\n   * @param [args] ...args sent to Endpoint\n   */\n\n  /** Do any transformations when first receiving input\n   *\n   * @see https://dataclient.io/rest/api/Entity#process\n   */\n  static process(input, parent, key, args) {\n    /* istanbul ignore else */\n    if (process.env.NODE_ENV !== 'production' && this.automaticValidation !== 'silent') {\n      if (Array.isArray(input)) {\n        const errorMessage = `Attempted to initialize ${this.name} with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://dataclient.io/docs/getting-started/debugging\nLearn more about schemas: https://dataclient.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nFirst three members: ${JSON.stringify(input.slice(0, 3), null, 2)}`;\n        if (this.automaticValidation !== 'warn') {\n          const error = new Error(errorMessage);\n          error.status = 400;\n          throw error;\n        }\n        console.warn(errorMessage);\n      }\n    }\n    return super.process(input, parent, key, args);\n  }\n}\n\nfunction validateRequired(processedEntity, requiredDefaults) {\n  let missingKey = '';\n  if (Object.keys(requiredDefaults).some(key => {\n    if (!Object.hasOwn(processedEntity, key)) {\n      missingKey = key;\n      return true;\n    }\n    return false;\n  })) {\n    return `Missing key ${missingKey}`;\n  }\n}\n\nvar _document$querySelect;\n/* istanbul ignore file */\nconst isBrowser = typeof document !== 'undefined';\nlet CSP = isBrowser && !((_document$querySelect = document.querySelector(\"meta[http-equiv='Content-Security-Policy']\")) != null && _document$querySelect.getAttribute('content'));\ntry {\n  if (!CSP) Function();\n} catch (e) {\n  CSP = true;\n  // TODO: figure out how to supress the error log instead of tell people it's okay\n  if (isBrowser) {\n    console.error('Content Security Policy: The previous CSP log can be safely ignored - @data-client/endpoint will use setPrototypeOf instead');\n  }\n}\n\nvar _Endpoint;\n\n/**\n * Defines an async data source.\n * @see https://dataclient.io/docs/api/Endpoint\n */\nclass Endpoint extends Function {\n  constructor(fetchFunction, options) {\n    let self;\n    if (CSP) {\n      self = (...args) => self.fetch(...args);\n      Object.setPrototypeOf(self, new.target.prototype);\n    } else {\n      super('return arguments.callee.fetch.apply(arguments.callee, arguments)');\n      self = this;\n    }\n    if (fetchFunction) self.fetch = fetchFunction;\n\n    /** Name propery block\n     *\n     * To make things callable, we force every instance to be constructed as a function\n     * Because of this the name property will be autoset\n     * To create a usable naming inheritance pattern, we use __name as a proxy.\n     * Every instance then overrides the name property.\n     *\n     * For protocol specific extensions that wish to customize default naming\n     * behavior, be sure to add your own `Object.defineProperty(self, 'name'`\n     * in your constructor to override this one.\n     */\n    let autoName;\n    if (!(options && 'name' in options) && fetchFunction && fetchFunction.name && fetchFunction.name !== 'anonymous') {\n      autoName = fetchFunction.name;\n    }\n    Object.defineProperty(self, 'name', {\n      get() {\n        if (/* istanbul ignore else */process.env.NODE_ENV !== 'production' && self.key === Endpoint.prototype.key && !(autoName || this.__name)) {\n          console.error('Endpoint: Autonaming failure.\\n\\nEndpoint initialized with anonymous function.\\nPlease add `name` option or hoist the function definition. https://dataclient.io/rest/api/Endpoint#name');\n        }\n        return autoName || this.__name;\n      },\n      set(v) {\n        this.__name = v;\n      }\n    });\n    /** End name property block */\n\n    Object.assign(self, options);\n    return self;\n  }\n  key(...args) {\n    return `${this.name} ${JSON.stringify(args)}`;\n  }\n  testKey(key) {\n    return key.startsWith(this.name);\n  }\n  bind(thisArg, ...args) {\n    const fetchFunc = this.fetch;\n    const keyFunc = this.key;\n    return this.extend({\n      fetch() {\n        return fetchFunc.apply(thisArg != null ? thisArg : this, args);\n      },\n      key() {\n        return keyFunc.apply(this, args);\n      }\n    });\n  }\n  extend(options) {\n    // make a constructor/prototype based off this\n    // extend from it and init with options sent\n    class E extends this.constructor {}\n    Object.assign(E.prototype, this);\n    return new E(options.fetch, options);\n  }\n\n  /* istanbul ignore next */\n}\n_Endpoint = Endpoint;\n(() => {\n  /* istanbul ignore if */\n  if (typeof document !== 'undefined' && document.FUNC_MANGLE) {\n    const baseKey = _Endpoint.prototype.key;\n    _Endpoint.prototype.key = function (...args) {\n      document.FUNC_MANGLE == null || document.FUNC_MANGLE(this);\n      this.prototype.key = baseKey;\n      return baseKey.call(this, ...args);\n    };\n  }\n})();\nconst ExtendableEndpoint = Endpoint;\n\nObject.hasOwn = Object.hasOwn || /* istanbul ignore next */function hasOwn(it, key) {\n  return Object.prototype.hasOwnProperty.call(it, key);\n};\n\nexports.All = AllSchema;\nexports.Collection = CollectionSchema;\nexports.Endpoint = Endpoint;\nexports.Entity = Entity;\nexports.EntityMixin = EntityMixin;\nexports.ExtendableEndpoint = ExtendableEndpoint;\nexports.Invalidate = Invalidate;\nexports.Query = Query;\nexports.Union = UnionSchema;\nexports.Values = ValuesSchema;\nexports.schema = schema;\nexports.validateRequired = validateRequired;\n"]}