{"version":3,"sources":["../../src/invariant.ts","../node_modules/ts-invariant/process/index.js"],"names":["genericMessage","Object","setPrototypeOf","obj","proto","__proto__","message","framesToPop","name","InvariantError","prototype","Error","invariant","condition","verbosityLevels","verbosityLevel","indexOf","wrapConsoleMethod","method","console","log","apply","arguments","debug","warn","error","maybe","thunk","_","safeGlobal","globalThis","window","self","global","constructor","needToRemove","remove","process","defineProperty","value","env","NODE_ENV","configurable","enumerable","writable"],"mappings":"uLAAMA,EAAiB,sBAErB,EAIEC,OADD,eAHDC,OAAc,IAAG,WAAUC,EAAUC,GAEnC,OADAD,EAAIE,UAAYD,EACTD,GACR,EAGH,cAGE,WAAYG,QAAA,IAAAA,MAAA,GAAZ,MACE,YACqB,kBAAZA,EACAN,EAAc,KAAKM,EAAO,6DAC7BA,IACL,K,OAPH,EAAAC,YAAc,EACd,EAAAC,KAAOR,EAOLE,EAAe,EAAMO,EAAeC,W,EAExC,OAXoC,iBAWpC,EAXA,CAAoCC,OAa9B,SAAUC,EACdC,EACAP,GAEA,IAAKO,EACH,MAAM,IAAIJ,EAAeH,GAI7B,IAAMQ,EAAkB,CAAC,QAAS,MAAO,OAAQ,QAAS,UAGtDC,EAAiBD,EAAgBE,QAAQ,OAE7C,SAASC,EAA+CT,GACtD,OAAO,WACL,GAAIM,EAAgBE,QAAQR,IAASO,EAAgB,CAGnD,IAAMG,EAASC,QAAQX,IAASW,QAAQC,IACxC,OAAOF,EAAOG,MAAMF,QAASG,cAKnC,SAAiBV,GACF,EAAAW,MAAQN,EAAkB,SAC1B,EAAAG,IAAMH,EAAkB,OACxB,EAAAO,KAAOP,EAAkB,QACzB,EAAAQ,MAAQR,EAAkB,SAJzC,CAAiBL,MAAS,M,kCC9C1B,uBAASc,EAAMC,GACb,IAAM,OAAOA,IAAU,MAAOC,KADhC,kCAIA,IAAIC,EACFH,GAAM,WAAa,OAAOI,eAC1BJ,GAAM,WAAa,OAAOK,WAC1BL,GAAM,WAAa,OAAOM,SAC1BN,GAAM,WAAa,OAAOO,MAO1BP,GAAM,WAAa,OAAOA,EAAMQ,YAAY,cAAlBR,MAGxBS,GAAe,EA4BZ,SAASC,IACVD,WACKN,EAAWQ,QAClBF,GAAe,IA5BbN,GACCH,GAAM,WAAa,MAAOW,iBAC1BX,GAAM,WAAa,OAAOW,OAC7BpC,OAAOqC,eAAeT,EAAY,UAAW,CAC3CU,MAAO,CACLC,IAAK,CAIHC,SAAU,eAKdC,cAAc,EACdC,YAAY,EACZC,UAAU,IAEZT,GAAe,K","file":"static/js/ts-invariant.52b63688.chunk.js","sourcesContent":["const genericMessage = \"Invariant Violation\";\nconst {\n setPrototypeOf = function (obj: any, proto: any) {\n obj.__proto__ = proto;\n return obj;\n },\n} = Object as any;\n\nexport class InvariantError extends Error {\n framesToPop = 1;\n name = genericMessage;\n constructor(message: string | number = genericMessage) {\n super(\n typeof message === \"number\"\n ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n : message\n );\n setPrototypeOf(this, InvariantError.prototype);\n }\n}\n\nexport function invariant(\n condition: any,\n message?: string | number,\n): asserts condition {\n if (!condition) {\n throw new InvariantError(message);\n }\n}\n\nconst verbosityLevels = [\"debug\", \"log\", \"warn\", \"error\", \"silent\"] as const;\nexport type VerbosityLevel = (typeof verbosityLevels)[number];\nexport type ConsoleMethodName = Exclude;\nlet verbosityLevel = verbosityLevels.indexOf(\"log\");\n\nfunction wrapConsoleMethod(name: M) {\n return function () {\n if (verbosityLevels.indexOf(name) >= verbosityLevel) {\n // Default to console.log if this host environment happens not to provide\n // all the console.* methods we need.\n const method = console[name] || console.log;\n return method.apply(console, arguments as any);\n }\n } as (typeof console)[M];\n}\n\nexport namespace invariant {\n export const debug = wrapConsoleMethod(\"debug\");\n export const log = wrapConsoleMethod(\"log\");\n export const warn = wrapConsoleMethod(\"warn\");\n export const error = wrapConsoleMethod(\"error\");\n}\n\nexport function setVerbosity(level: VerbosityLevel): VerbosityLevel {\n const old = verbosityLevels[verbosityLevel];\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n return old;\n}\n\nexport default invariant;\n","function maybe(thunk) {\n try { return thunk() } catch (_) {}\n}\n\nvar safeGlobal = (\n maybe(function() { return globalThis }) ||\n maybe(function() { return window }) ||\n maybe(function() { return self }) ||\n maybe(function() { return global }) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function() { return maybe.constructor(\"return this\")() })\n);\n\nvar needToRemove = false;\n\nexport function install() {\n if (safeGlobal &&\n !maybe(function() { return process.env.NODE_ENV }) &&\n !maybe(function() { return process })) {\n Object.defineProperty(safeGlobal, \"process\", {\n value: {\n env: {\n // This default needs to be \"production\" instead of \"development\", to\n // avoid the problem https://github.com/graphql/graphql-js/pull/2894\n // will eventually solve, once merged and released.\n NODE_ENV: \"production\",\n },\n },\n // Let anyone else change global.process as they see fit, but hide it from\n // Object.keys(global) enumeration.\n configurable: true,\n enumerable: false,\n writable: true,\n });\n needToRemove = true;\n }\n}\n\n// Call install() at least once, when this module is imported.\ninstall();\n\nexport function remove() {\n if (needToRemove) {\n delete safeGlobal.process;\n needToRemove = false;\n }\n}\n"],"sourceRoot":""}