{"version":3,"file":"common.cjs","names":["t","Chain","NumberFromString","BooleanFromString","BigIntFromString","PathReporter","t","t","PathReporter"],"sources":["../lib/common/integers.ts","../lib/common/types.ts","../lib/common/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\n// import { Buffer } from 'buffer';\n\nimport { Chain, isLeft } from 'fp-ts/Either';\nimport * as t from 'io-ts';\nimport { PathReporter } from 'io-ts/PathReporter';\nimport {\n  BigIntFromString,\n  BooleanFromString,\n  fromNullable,\n  fromRefinement,\n  NumberFromString,\n} from 'io-ts-types';\n\nconst stringConverter =\n  <C extends t.Mixed, V extends t.Type<any, string>>(converter: V) =>\n  (codec: C): t.Type<t.TypeOf<V>> =>\n    new t.Type(\n      codec.name,\n      codec.is,\n      (u, c) =>\n        typeof u === 'string'\n          ? Chain.chain(converter.validate(u, c), n => codec.validate(n, c))\n          : codec.validate(u, c),\n      codec.encode\n    );\n\nconst numberFromStringConverter = stringConverter(NumberFromString);\n\nconst booleanFromStringConverter = stringConverter(BooleanFromString);\n\nexport const Numeric = numberFromStringConverter(t.number);\n\nexport const Bool = booleanFromStringConverter(t.boolean);\n\nexport const UInt8 = numberFromStringConverter(\n  fromRefinement(\n    'UInt8',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= 0 && n < 256\n  )\n);\nexport const Int8 = numberFromStringConverter(\n  fromRefinement(\n    'Int8',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= -128 && n < 128\n  )\n);\nexport const UInt16 = numberFromStringConverter(\n  fromRefinement(\n    'UInt16',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= 0 && n < 0x10000\n  )\n);\nexport const Int16 = numberFromStringConverter(\n  fromRefinement(\n    'Int16',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= -32768 && n < 32768\n  )\n);\nexport const UInt32 = numberFromStringConverter(\n  fromRefinement(\n    'UInt32',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= 0 && n <= 4294967295\n  )\n);\nexport const Int32 = numberFromStringConverter(\n  fromRefinement(\n    'Int32',\n    (n): n is number => t.number.is(n) && Number.isInteger(n) && n >= -2147483648 && n < 2147483648\n  )\n);\n\nexport const UInt64 = stringConverter(BigIntFromString)(t.bigint);\n\n/*\nexport interface UInt8Brand {\n  readonly UInt8: symbol;\n}\n\nexport const UInt8 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, UInt8Brand> => Number.isInteger(n) && n >= 0 && n < 256,\n  'UInt8'\n);\n\nexport type UInt8 = number & UInt8Brand;\n\nexport interface Int8Brand {\n  readonly Int8: symbol;\n}\n\nexport const Int8 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, Int8Brand> => Number.isInteger(n) && n >= -128 && n < 128,\n  'Int8'\n);\n\nexport type Int8 = number & Int8Brand;\n\nexport interface UInt16Brand {\n  readonly UInt16: symbol;\n}\n\nexport const UInt16 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, UInt16Brand> => Number.isInteger(n) && n >= 0 && n < 0x10000,\n  'UInt16'\n);\n\nexport type UInt16 = t.TypeOf<typeof UInt16>;\n\nexport interface Int16Brand {\n  readonly Int16: symbol;\n}\n\nexport const Int16 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, Int16Brand> => Number.isInteger(n) && n >= -32768 && n < 32768,\n  'Int16'\n);\n\nexport type Int16 = number & Int16Brand;\n\nexport interface UInt32Brand {\n  readonly UInt32: symbol;\n}\n\nexport const UInt32 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, UInt32Brand> => Number.isInteger(n) && n >= 0 && n <= 4294967295,\n  'UInt32'\n);\n\nexport type UInt32 = number & UInt32Brand;\n\nexport interface Int32Brand {\n  readonly Int32: symbol;\n}\n\nexport const Int32 = t.brand(\n  t.number,\n  (n): n is t.Branded<number, Int32Brand> =>\n    Number.isInteger(n) && n >= -2147483648 && n < 2147483648,\n  'Int32'\n);\n\nexport type Int32 = number & Int32Brand;\n\n*/\n\nexport function withDefault<C extends t.Mixed>(\n  codec: C,\n  defaultValue: t.TypeOf<C> | t.OutputOf<C>\n): C {\n  let value = defaultValue;\n  if (!codec.is(value)) {\n    const validation = codec.decode(value);\n    if (isLeft(validation)) throw new TypeError(PathReporter.report(validation).join('\\n'));\n    value = validation.right;\n  }\n  return fromNullable(codec, value);\n}\n\nexport class BufferFromBase64 extends t.Type<Uint8Array, string> {\n  constructor(name: string, length?: number, strict = false) {\n    super(\n      name,\n      (u): u is Uint8Array => u instanceof Uint8Array && (!length || u.length === length),\n      (i, c) => {\n        if (\n          typeof i === 'string' &&\n          /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i)\n        ) {\n          const buffer = Uint8Array.from(atob(i), ch => ch.charCodeAt(0)) // Buffer.from(i, 'base64');\n          if (\n            !length ||\n            (buffer.length === length && strict) ||\n            (buffer.length >= length && !strict)\n          ) {\n            return t.success(buffer);\n          }\n          t.failure(buffer, c, `Invalid length: expected ${length} but got ${buffer.length}`);\n        }\n        return t.failure(i, c, 'Invalid base64');\n      },\n      b => btoa(String.fromCharCode.apply(null, [...b])),\n    );\n  }\n}\n\nexport const Base64 = new BufferFromBase64('Base64');\nexport type Base64 = t.TypeOf<typeof Base64>;\n","/* Automatically generated */\nimport * as t from 'io-ts';\nimport MaxValue from '../../generated/MaxValue';\nimport {\n  Bool,\n  BufferFromBase64,\n  Int32,\n  Int8,\n  Numeric,\n  UInt16,\n  UInt8,\n  withDefault,\n} from './integers';\n\nexport const string_empty = withDefault(t.string, '');\nexport const Int32_0 = withDefault(Int32, 0);\nexport const UInt16_0 = withDefault(UInt16, 0);\nexport const UInt8_0 = withDefault(UInt8, 0);\nexport const Bool_false = withDefault(Bool, false);\nexport const Int32_3 = withDefault(Int32, 3);\nexport const Int32_2650 = withDefault(Int32, 2650);\nexport const UInt8_7 = withDefault(UInt8, 7);\nexport const UInt8_1 = withDefault(UInt8, 1);\nexport const UInt8_3 = withDefault(UInt8, 3);\nexport const UInt16_32569 = withDefault(UInt16, 32569);\nexport const UInt16_62465 = withDefault(UInt16, 62465);\nexport const UInt16_58369 = withDefault(UInt16, 58369);\nexport const UInt16_30976 = withDefault(UInt16, 30976);\nexport const UInt8_32 = withDefault(UInt8, 32);\nexport const Bool_true = withDefault(Bool, true);\nexport const UInt8_15 = withDefault(UInt8, 15);\nexport const UInt8_31 = withDefault(UInt8, 31);\nexport const UInt8_23 = withDefault(UInt8, 23);\nexport const UInt16_1 = withDefault(UInt16, 1);\nexport const UInt8_28 = withDefault(UInt8, 28);\nexport const Int32_1 = withDefault(Int32, 1);\nexport const UInt16_61440 = withDefault(UInt16, 61440);\nexport const UInt16_8673 = withDefault(UInt16, 8673);\nexport const UInt16_3822 = withDefault(UInt16, 3822);\nexport const UInt8_5 = withDefault(UInt8, 5);\nexport const UInt16_4096 = withDefault(UInt16, 4096);\nexport const UInt16_16384 = withDefault(UInt16, 16384);\nexport const UInt16_508 = withDefault(UInt16, 508);\nexport const UInt16_15872 = withDefault(UInt16, 15872);\nexport const Int32_15 = withDefault(Int32, 15);\nexport const Int32_60 = withDefault(Int32, 60);\nexport const UInt8_2 = withDefault(UInt8, 2);\nexport const buffer_8 = new BufferFromBase64('buffer_8', 8);\nexport const buffer_6 = new BufferFromBase64('buffer_6', 6);\nexport const UInt16_8048 = withDefault(UInt16, 8048);\nexport const UInt16_31615 = withDefault(UInt16, 31615);\nexport const UInt16_18183 = withDefault(UInt16, 18183);\nexport const UInt16_256 = withDefault(UInt16, 256);\nexport const Int32_4 = withDefault(Int32, 4);\nexport const UInt16_7936 = withDefault(UInt16, 7936);\nexport const Int32_5 = withDefault(Int32, 5);\nexport const Int32_64 = withDefault(Int32, 64);\nexport const Numeric_1 = withDefault(Numeric, 1);\nexport const UInt8_8 = withDefault(UInt8, 8);\nexport const Int32_128 = withDefault(Int32, 128);\nexport const Int32_7 = withDefault(Int32, 7);\nexport const Int32_13 = withDefault(Int32, 13);\nexport const Int32_32 = withDefault(Int32, 32);\nexport const Int32_14 = withDefault(Int32, 14);\nexport const Int32_256 = withDefault(Int32, 256);\nexport const Int32_191 = withDefault(Int32, 191);\nexport const Int32_16 = withDefault(Int32, 16);\nexport const UInt16_65474 = withDefault(UInt16, 65474);\nexport const UInt16_30818 = withDefault(UInt16, 30818);\nexport const UInt16_28770 = withDefault(UInt16, 28770);\nexport const UInt16_26722 = withDefault(UInt16, 26722);\nexport const UInt16_3841 = withDefault(UInt16, 3841);\nexport const UInt16_63 = withDefault(UInt16, 63);\nexport const Int32_48 = withDefault(Int32, 48);\nexport const Int32_47 = withDefault(Int32, 47);\nexport const UInt8_10 = withDefault(UInt8, 10);\nexport const Int32_10 = withDefault(Int32, 10);\nexport const Int32_25 = withDefault(Int32, 25);\nexport const Int32_137 = withDefault(Int32, 137);\nexport const Int32_140 = withDefault(Int32, 140);\nexport const Int32_3300 = withDefault(Int32, 3300);\nexport const Int32_8 = withDefault(Int32, 8);\nexport const UInt8_4 = withDefault(UInt8, 4);\nexport const Int32_11 = withDefault(Int32, 11);\nexport const Int32_2 = withDefault(Int32, 2);\nexport const UInt8_29 = withDefault(UInt8, 29);\nexport const Int32_77 = withDefault(Int32, 77);\nexport const UInt16_185 = withDefault(UInt16, 185);\nexport const UInt8_12 = withDefault(UInt8, 12);\nexport const UInt16_128 = withDefault(UInt16, 128);\nexport const UInt16_85 = withDefault(UInt16, 85);\nexport const UInt16_341 = withDefault(UInt16, 341);\nexport const UInt16_543 = withDefault(UInt16, 543);\nexport const UInt16_799 = withDefault(UInt16, 799);\nexport const UInt16_1027 = withDefault(UInt16, 1027);\nexport const UInt16_1292 = withDefault(UInt16, 1292);\nexport const UInt16_1538 = withDefault(UInt16, 1538);\nexport const UInt16_1824 = withDefault(UInt16, 1824);\nexport const UInt16_2080 = withDefault(UInt16, 2080);\nexport const UInt16_2312 = withDefault(UInt16, 2312);\nexport const UInt16_2568 = withDefault(UInt16, 2568);\nexport const UInt16_2944 = withDefault(UInt16, 2944);\nexport const UInt16_3073 = withDefault(UInt16, 3073);\nexport const UInt16_3329 = withDefault(UInt16, 3329);\nexport const UInt16_3588 = withDefault(UInt16, 3588);\nexport const UInt16_4226 = withDefault(UInt16, 4226);\nexport const UInt16_4385 = withDefault(UInt16, 4385);\nexport const UInt16_4609 = withDefault(UInt16, 4609);\nexport const UInt16_5120 = withDefault(UInt16, 5120);\nexport const UInt16_5376 = withDefault(UInt16, 5376);\nexport const UInt16_5632 = withDefault(UInt16, 5632);\nexport const UInt16_6128 = withDefault(UInt16, 6128);\nexport const UInt16_6175 = withDefault(UInt16, 6175);\nexport const UInt16_6400 = withDefault(UInt16, 6400);\nexport const UInt16_6687 = withDefault(UInt16, 6687);\nexport const UInt16_6928 = withDefault(UInt16, 6928);\nexport const UInt16_7376 = withDefault(UInt16, 7376);\nexport const UInt16_7434 = withDefault(UInt16, 7434);\nexport const UInt16_7746 = withDefault(UInt16, 7746);\nexport const UInt16_7940 = withDefault(UInt16, 7940);\nexport const UInt16_8200 = withDefault(UInt16, 8200);\nexport const UInt16_8449 = withDefault(UInt16, 8449);\nexport const UInt16_8732 = withDefault(UInt16, 8732);\nexport const UInt16_28672 = withDefault(UInt16, 28672);\nexport const UInt16_28928 = withDefault(UInt16, 28928);\nexport const UInt16_29184 = withDefault(UInt16, 29184);\nexport const UInt16_29440 = withDefault(UInt16, 29440);\nexport const UInt16_29696 = withDefault(UInt16, 29696);\nexport const UInt16_61696 = withDefault(UInt16, 61696);\nexport const UInt16_61952 = withDefault(UInt16, 61952);\nexport const UInt16_62208 = withDefault(UInt16, 62208);\nexport const UInt16_62464 = withDefault(UInt16, 62464);\nexport const UInt16_62720 = withDefault(UInt16, 62720);\nexport const UInt16_8960 = withDefault(UInt16, 8960);\nexport const Int32_238 = withDefault(Int32, 238);\nexport const Int32_34 = withDefault(Int32, 34);\nexport const Int32_12 = withDefault(Int32, 12);\nexport const UInt8_16 = withDefault(UInt8, 16);\nexport const UInt16_23 = withDefault(UInt16, 23);\nexport const Int32_6 = withDefault(Int32, 6);\nexport const UInt16_60543 = withDefault(UInt16, 60543);\nexport const Int32_21 = withDefault(Int32, 21);\nexport const buffer_2048 = new BufferFromBase64('buffer_2048', 2048);\nexport const Numeric_0 = withDefault(Numeric, 0);\nexport const Numeric_28 = withDefault(Numeric, 2.8);\nexport const Int32_4559 = withDefault(Int32, 4559);\nexport const Int32_1000 = withDefault(Int32, 1000);\nexport const Int8_0 = withDefault(Int8, 0);\nexport const UInt16_65535 = withDefault(UInt16, 65535);\nexport const UInt8_64 = withDefault(UInt8, 64);\nexport const UInt16_3 = withDefault(UInt16, 3);\nexport const UInt16_11267 = withDefault(UInt16, 11267);\nexport const UInt16_1023 = withDefault(UInt16, 1023);\nexport const UInt16_3072 = withDefault(UInt16, 3072);\nexport const UInt16_16899 = withDefault(UInt16, 16899);\nexport const UInt16_11 = withDefault(UInt16, 11);\nexport const UInt16_64929 = withDefault(UInt16, 64929);\nexport const UInt16_16387 = withDefault(UInt16, 16387);\nexport const Int32_196 = withDefault(Int32, 196);\nexport const UInt16_125 = withDefault(UInt16, 125);\nexport const UInt16_41728 = withDefault(UInt16, 41728);\nexport const UInt16_44932 = withDefault(UInt16, 44932);\nexport const UInt16_65337 = withDefault(UInt16, 65337);\nexport const Int32_35 = withDefault(Int32, 35);\nexport const Int32_42 = withDefault(Int32, 42);\nexport const UInt16_29951 = withDefault(UInt16, 29951);\nexport const UInt8_56 = withDefault(UInt8, 56);\nexport const UInt16_7168 = withDefault(UInt16, 7168);\nexport const Int32_49 = withDefault(Int32, 49);\nexport const UInt8_255 = withDefault(UInt8, 255);\nexport const buffer_96 = new BufferFromBase64('buffer_96', 96);\nexport const UInt16_1024 = withDefault(UInt16, 1024);\nexport const UInt16_768 = withDefault(UInt16, 768);\nexport const string_20 = withDefault(t.string, '2.0');\nexport const buffer_MAX_MODULEDATAGROUP = new BufferFromBase64(\n  'buffer_MAX_MODULEDATAGROUP',\n  MaxValue.MAX_MODULEDATAGROUP\n);\nexport const buffer_MAX_SCAN = new BufferFromBase64('buffer_MAX_SCAN', MaxValue.MAX_SCAN);\nexport const buffer_MAX_SCAN_NEW = new BufferFromBase64(\n  'buffer_MAX_SCAN_NEW',\n  MaxValue.MAX_SCAN_NEW\n);\nexport const buffer_MAX_SCANSPECIAL = new BufferFromBase64(\n  'buffer_MAX_SCANSPECIAL',\n  MaxValue.MAX_SCANSPECIAL\n);\nexport const buffer_COLOR_COUNT = new BufferFromBase64('buffer_COLOR_COUNT', MaxValue.COLOR_COUNT);\nexport const buffer_256 = new BufferFromBase64('buffer_256', 256);\nexport const buffer_2 = new BufferFromBase64('buffer_2', 2);\nexport const Int32_100 = withDefault(Int32, 100);\nexport const Int32_300 = withDefault(Int32, 300);\nexport const buffer_GAMMAVALUE_COUNT = new BufferFromBase64(\n  'buffer_GAMMAVALUE_COUNT',\n  MaxValue.GAMMAVALUE_COUNT\n);\nexport const buffer_MAX_MULTIPLE_CHIP_TABLELEN = new BufferFromBase64(\n  'buffer_MAX_MULTIPLE_CHIP_TABLELEN',\n  MaxValue.MAX_MULTIPLE_CHIP_TABLELEN\n);\nexport const buffer_MAX_SCANNER_DATAGROUP = new BufferFromBase64(\n  'buffer_MAX_SCANNER_DATAGROUP',\n  MaxValue.MAX_SCANNER_DATAGROUP\n);\nexport const Int32_255 = withDefault(Int32, 255);\nexport const UInt8_50 = withDefault(UInt8, 50);\nexport const UInt16_2048 = withDefault(UInt16, 2048);\nexport const UInt8_100 = withDefault(UInt8, 100);\nexport const UInt16_32 = withDefault(UInt16, 32);\nexport const UInt16_400 = withDefault(UInt16, 400);\n","import { chain, isLeft } from 'fp-ts/Either';\nimport { pipe } from 'fp-ts/function';\nimport * as t from 'io-ts';\nimport { PathReporter } from 'io-ts/PathReporter';\n\nexport * from './integers';\nexport * from './types';\n\nconst Point = t.type({\n  x: t.number,\n  y: t.number,\n});\n\nexport type Point = t.TypeOf<typeof Point>;\n\nexport const PointFromString = new t.Type<Point, `${bigint}, ${bigint}`>(\n  'Point',\n  (u): u is Point => Point.is(u),\n  (u, c) => {\n    if (typeof u === 'string') {\n      const values = u.split(',');\n      if (values.length === 2) {\n        const [x, y] = values.map(Number);\n        if (Number.isInteger(x) && Number.isInteger(y))\n          return t.success({\n            x,\n            y,\n          });\n      }\n    } else if (Point.is(u)) return t.success(u);\n    return t.failure(u, c, `Invalid Point: ${typeof u}, ${JSON.stringify(u)}`);\n  },\n  a => `${BigInt(a.x)}, ${BigInt(a.y)}`\n);\n\nconst toArray = <T>(value: T | T[]): T[] => (Array.isArray(value) ? value : [value]);\n\nconst capitalizeFirstLetter = <T extends string>(str: T): Capitalize<T> =>\n  `${str.charAt(0).toUpperCase()}${str.slice(1)}` as Capitalize<T>;\n\nexport const XMLArray = <C extends t.Mixed>(item: C, itemTypeName: string): t.ArrayC<C> =>\n  new t.ArrayType(\n    `${capitalizeFirstLetter(itemTypeName)}Array`,\n    (u): u is Array<t.TypeOf<C>> => t.UnknownArray.is(u) && u.every(item.is),\n    (u, c) =>\n      !u\n        ? t.success([])\n        : pipe(\n            t\n              .array(item)\n              .validate(\n                toArray(\n                  Object.prototype.hasOwnProperty.call(u, itemTypeName)\n                    ? (u as Record<string, unknown>)[itemTypeName]\n                    : u\n                ),\n                c\n              ),\n            chain(a => t.success(a))\n          ),\n    item.encode === t.identity ? t.identity : a => a.map(item.encode),\n    item\n  );\ntype Mix<A, B> = {\n  [P in keyof (A | B)]: A[P] | B[P];\n};\ntype FilterFlags<Base, Condition> = {\n  [Key in keyof Base]: Base[Key] extends Condition ? Key : never;\n};\ntype ExcludeFlags<Base, Condition> = {\n  [Key in keyof Base]: Base[Key] extends Condition ? never : Key;\n};\ntype AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base];\ntype ExcludeNames<Base, Condition> = ExcludeFlags<Base, Condition>[keyof Base];\nexport type SubType<Base, Condition> = Pick<Base, AllowedNames<Base, Condition>>;\ntype RequiredKeys<T> = {\n  [K in keyof T]-?: T[K] extends Exclude<T[K], undefined> ? K : never;\n}[keyof T];\nexport type Id<T> = {} & { [P in keyof T]: T[P] };\n\n// type DeepPartial<T> = {\n//   [P in keyof T]?: DeepPartial<T[P]>;\n// };\n\nexport function makeStruct<C extends t.Mixed, I extends Mix<t.TypeOf<C>, t.OutputOf<C>>>(\n  codec: C,\n  initializer: Partial<I>\n): Id<\n  Required<Pick<t.TypeOf<C>, RequiredKeys<I>>> & Pick<t.TypeOf<C>, ExcludeNames<I, undefined>>\n> {\n  const v = codec.decode(initializer);\n  if (isLeft(v)) throw new TypeError(`Invalid value: ${PathReporter.report(v)}`);\n  return v.right;\n}\n\nfunction getProps<T extends t.HasProps>(codec: T): t.Props {\n  // eslint-disable-next-line no-underscore-dangle\n  switch (codec._tag) {\n    case 'RefinementType':\n    case 'ReadonlyType':\n      return getProps(codec.type);\n    case 'InterfaceType':\n    case 'StrictType':\n    case 'PartialType':\n      return codec.props;\n    case 'IntersectionType':\n      return codec.types.reduce<t.TypeOf<T>>(\n        (props, type) => Object.assign(props, getProps(type)),\n        {}\n      );\n    default:\n      throw new TypeError('Invalid codec');\n  }\n}\n\nexport const omit = <C extends t.HasProps, O extends keyof t.TypeOf<C>>(codec: C, k: O) => {\n  const { [k]: prop, ...props } = getProps(codec);\n  return t.type(props);\n};\n"],"mappings":";;;;;;;;;;;AAeA,MAAM,mBAC+C,eAClD,UACC,IAAIA,MAAE,KACJ,MAAM,MACN,MAAM,KACL,GAAG,MACF,OAAO,MAAM,WACTC,0BAAM,MAAM,UAAU,SAAS,GAAG,CAAC,IAAG,MAAK,MAAM,SAAS,GAAG,CAAC,CAAC,IAC/D,MAAM,SAAS,GAAG,CAAC,GACzB,MAAM,MACR;AAEJ,MAAM,4BAA4B,gBAAgBC,4BAAgB;AAElE,MAAM,6BAA6B,gBAAgBC,6BAAiB;AAEpE,MAAa,UAAU,0BAA0BH,MAAE,MAAM;AAEzD,MAAa,OAAO,2BAA2BA,MAAE,OAAO;AAExD,MAAa,QAAQ,0DAEjB,UACC,MAAmBA,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