isomorfeus-preact 10.6.11 → 10.6.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/browser/event.rb +2 -0
  3. data/lib/isomorfeus/preact_view_helper.rb +3 -2
  4. data/lib/isomorfeus/props/validate_hash_proxy.rb +1 -1
  5. data/lib/isomorfeus/props/validator.rb +6 -4
  6. data/lib/isomorfeus-preact.rb +3 -3
  7. data/lib/isomorfeus_preact/lucid_component/api.rb +1 -1
  8. data/lib/isomorfeus_preact/lucid_component/initializer.rb +2 -2
  9. data/lib/isomorfeus_preact/lucid_func/initializer.rb +1 -1
  10. data/lib/isomorfeus_preact/preact/function_component/initializer.rb +1 -1
  11. data/lib/preact/component/api.rb +1 -1
  12. data/lib/preact/component/callbacks.rb +6 -6
  13. data/lib/preact/component/initializer.rb +2 -2
  14. data/lib/preact/component/native_component_constructor.rb +1 -1
  15. data/lib/preact/props.rb +51 -0
  16. data/lib/preact/state.rb +67 -0
  17. data/lib/preact/version.rb +1 -1
  18. data/lib/preact.rb +2 -2
  19. data/node_modules/.package-lock.json +3 -3
  20. data/node_modules/preact/LICENSE +21 -21
  21. data/node_modules/preact/README.md +187 -187
  22. data/node_modules/preact/compat/dist/compat.js +1 -1
  23. data/node_modules/preact/compat/dist/compat.js.map +1 -1
  24. data/node_modules/preact/compat/dist/compat.mjs +1 -1
  25. data/node_modules/preact/compat/dist/compat.module.js +1 -1
  26. data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
  27. data/node_modules/preact/compat/dist/compat.umd.js +1 -1
  28. data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
  29. data/node_modules/preact/compat/jsx-dev-runtime.js +1 -1
  30. data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -1
  31. data/node_modules/preact/compat/jsx-runtime.js +1 -1
  32. data/node_modules/preact/compat/jsx-runtime.mjs +1 -1
  33. data/node_modules/preact/compat/package.json +19 -19
  34. data/node_modules/preact/compat/scheduler.js +15 -15
  35. data/node_modules/preact/compat/scheduler.mjs +23 -23
  36. data/node_modules/preact/compat/server.js +15 -15
  37. data/node_modules/preact/compat/server.mjs +4 -4
  38. data/node_modules/preact/compat/src/Children.js +21 -21
  39. data/node_modules/preact/compat/src/PureComponent.js +15 -15
  40. data/node_modules/preact/compat/src/forwardRef.js +51 -51
  41. data/node_modules/preact/compat/src/index.d.ts +141 -141
  42. data/node_modules/preact/compat/src/index.js +187 -187
  43. data/node_modules/preact/compat/src/internal.d.ts +47 -47
  44. data/node_modules/preact/compat/src/memo.js +34 -34
  45. data/node_modules/preact/compat/src/portals.js +80 -80
  46. data/node_modules/preact/compat/src/render.js +229 -230
  47. data/node_modules/preact/compat/src/suspense-list.d.ts +14 -14
  48. data/node_modules/preact/compat/src/suspense-list.js +126 -126
  49. data/node_modules/preact/compat/src/suspense.d.ts +15 -15
  50. data/node_modules/preact/compat/src/suspense.js +270 -270
  51. data/node_modules/preact/compat/src/util.js +28 -28
  52. data/node_modules/preact/compat/test-utils.js +1 -1
  53. data/node_modules/preact/debug/dist/debug.js.map +1 -1
  54. data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
  55. data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
  56. data/node_modules/preact/debug/package.json +18 -18
  57. data/node_modules/preact/debug/src/check-props.js +54 -54
  58. data/node_modules/preact/debug/src/component-stack.js +146 -146
  59. data/node_modules/preact/debug/src/constants.js +3 -3
  60. data/node_modules/preact/debug/src/debug.js +442 -442
  61. data/node_modules/preact/debug/src/index.js +6 -6
  62. data/node_modules/preact/debug/src/internal.d.ts +82 -82
  63. data/node_modules/preact/debug/src/util.js +11 -11
  64. data/node_modules/preact/devtools/dist/devtools.js +1 -1
  65. data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
  66. data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
  67. data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
  68. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
  69. data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
  70. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
  71. data/node_modules/preact/devtools/package.json +16 -16
  72. data/node_modules/preact/devtools/src/devtools.js +10 -10
  73. data/node_modules/preact/devtools/src/index.d.ts +8 -8
  74. data/node_modules/preact/devtools/src/index.js +15 -15
  75. data/node_modules/preact/dist/preact.js.map +1 -1
  76. data/node_modules/preact/dist/preact.min.js.map +1 -1
  77. data/node_modules/preact/dist/preact.module.js.map +1 -1
  78. data/node_modules/preact/dist/preact.umd.js.map +1 -1
  79. data/node_modules/preact/hooks/dist/hooks.js +1 -1
  80. data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
  81. data/node_modules/preact/hooks/dist/hooks.mjs +1 -1
  82. data/node_modules/preact/hooks/dist/hooks.module.js +1 -1
  83. data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
  84. data/node_modules/preact/hooks/dist/hooks.umd.js +1 -1
  85. data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
  86. data/node_modules/preact/hooks/package.json +26 -26
  87. data/node_modules/preact/hooks/src/index.d.ts +139 -139
  88. data/node_modules/preact/hooks/src/index.js +386 -388
  89. data/node_modules/preact/hooks/src/internal.d.ts +75 -75
  90. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  91. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  92. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  93. data/node_modules/preact/jsx-runtime/package.json +19 -19
  94. data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -50
  95. data/node_modules/preact/jsx-runtime/src/index.js +77 -77
  96. data/node_modules/preact/package.json +291 -287
  97. data/node_modules/preact/src/cjs.js +3 -3
  98. data/node_modules/preact/src/clone-element.js +34 -34
  99. data/node_modules/preact/src/component.js +225 -225
  100. data/node_modules/preact/src/constants.js +3 -3
  101. data/node_modules/preact/src/create-context.js +68 -68
  102. data/node_modules/preact/src/create-element.js +98 -98
  103. data/node_modules/preact/src/diff/catch-error.js +38 -38
  104. data/node_modules/preact/src/diff/children.js +335 -335
  105. data/node_modules/preact/src/diff/index.js +516 -516
  106. data/node_modules/preact/src/diff/props.js +158 -158
  107. data/node_modules/preact/src/index.d.ts +310 -310
  108. data/node_modules/preact/src/index.js +13 -13
  109. data/node_modules/preact/src/internal.d.ts +146 -146
  110. data/node_modules/preact/src/jsx.d.ts +1005 -1005
  111. data/node_modules/preact/src/options.js +16 -16
  112. data/node_modules/preact/src/render.js +75 -75
  113. data/node_modules/preact/src/util.js +27 -27
  114. data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -1
  115. data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -1
  116. data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  117. data/node_modules/preact/test-utils/package.json +19 -19
  118. data/node_modules/preact/test-utils/src/index.d.ts +3 -3
  119. data/node_modules/preact/test-utils/src/index.js +117 -117
  120. data/package.json +1 -1
  121. metadata +8 -8
  122. data/lib/preact/component/props.rb +0 -55
  123. data/lib/preact/component/state.rb +0 -58
@@ -1 +1 @@
1
- {"version":3,"file":"debug.js","sources":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\r\n\r\nlet loggedTypeFailures = {};\r\n\r\n/**\r\n * Reset the history of which prop type warnings have been logged.\r\n */\r\nexport function resetPropWarnings() {\r\n\tloggedTypeFailures = {};\r\n}\r\n\r\n/**\r\n * Assert that the values match with the type specs.\r\n * Error messages are memorized and will only be shown once.\r\n *\r\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\r\n *\r\n * @param {object} typeSpecs Map of name to a ReactPropType\r\n * @param {object} values Runtime values that need to be type-checked\r\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\r\n * @param {string} componentName Name of the component for error messages.\r\n * @param {?Function} getStack Returns the component stack.\r\n */\r\nexport function checkPropTypes(\r\n\ttypeSpecs,\r\n\tvalues,\r\n\tlocation,\r\n\tcomponentName,\r\n\tgetStack\r\n) {\r\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\r\n\t\tlet error;\r\n\t\ttry {\r\n\t\t\terror = typeSpecs[typeSpecName](\r\n\t\t\t\tvalues,\r\n\t\t\t\ttypeSpecName,\r\n\t\t\t\tcomponentName,\r\n\t\t\t\tlocation,\r\n\t\t\t\tnull,\r\n\t\t\t\tReactPropTypesSecret\r\n\t\t\t);\r\n\t\t} catch (e) {\r\n\t\t\terror = e;\r\n\t\t}\r\n\t\tif (error && !(error.message in loggedTypeFailures)) {\r\n\t\t\tloggedTypeFailures[error.message] = true;\r\n\t\t\tconsole.error(\r\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\r\n\t\t\t\t\t`\\n${getStack()}`) ||\r\n\t\t\t\t\t''}`\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n}\r\n","import { options, Fragment } from 'preact';\r\n\r\n/**\r\n * Get human readable name of the component/dom node\r\n * @param {import('./internal').VNode} vnode\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getDisplayName(vnode) {\r\n\tif (vnode.type === Fragment) {\r\n\t\treturn 'Fragment';\r\n\t} else if (typeof vnode.type == 'function') {\r\n\t\treturn vnode.type.displayName || vnode.type.name;\r\n\t} else if (typeof vnode.type == 'string') {\r\n\t\treturn vnode.type;\r\n\t}\r\n\r\n\treturn '#text';\r\n}\r\n\r\n/**\r\n * Used to keep track of the currently rendered `vnode` and print it\r\n * in debug messages.\r\n */\r\nlet renderStack = [];\r\n\r\n/**\r\n * Keep track of the current owners. An owner describes a component\r\n * which was responsible to render a specific `vnode`. This exclude\r\n * children that are passed via `props.children`, because they belong\r\n * to the parent owner.\r\n *\r\n * ```jsx\r\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\r\n * const Bar = props => {\r\n * return (\r\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\r\n * )\r\n * }\r\n * ```\r\n *\r\n * Note: A `vnode` may be hoisted to the root scope due to compiler\r\n * optimiztions. In these cases the `_owner` will be different.\r\n */\r\nlet ownerStack = [];\r\n\r\n/**\r\n * Get the currently rendered `vnode`\r\n * @returns {import('./internal').VNode | null}\r\n */\r\nexport function getCurrentVNode() {\r\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\r\n}\r\n\r\n/**\r\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\r\n * somewhere in his tool chain we can't print the filename and source\r\n * location of a component. In that case we just omit that, but we'll\r\n * print a helpful message to the console, notifying the user of it.\r\n */\r\nlet hasBabelPlugin = false;\r\n\r\n/**\r\n * Check if a `vnode` is a possible owner.\r\n * @param {import('./internal').VNode} vnode\r\n */\r\nfunction isPossibleOwner(vnode) {\r\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\r\n}\r\n\r\n/**\r\n * Return the component stack that was captured up to this point.\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getOwnerStack(vnode) {\r\n\tconst stack = [vnode];\r\n\tlet next = vnode;\r\n\twhile (next._owner != null) {\r\n\t\tstack.push(next._owner);\r\n\t\tnext = next._owner;\r\n\t}\r\n\r\n\treturn stack.reduce((acc, owner) => {\r\n\t\tacc += ` in ${getDisplayName(owner)}`;\r\n\r\n\t\tconst source = owner.__source;\r\n\t\tif (source) {\r\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\r\n\t\t} else if (!hasBabelPlugin) {\r\n\t\t\thasBabelPlugin = true;\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (acc += '\\n');\r\n\t}, '');\r\n}\r\n\r\n/**\r\n * Setup code to capture the component trace while rendering. Note that\r\n * we cannot simply traverse `vnode._parent` upwards, because we have some\r\n * debug messages for `this.setState` where the `vnode` is `undefined`.\r\n */\r\nexport function setupComponentStack() {\r\n\tlet oldDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldRoot = options._root;\r\n\tlet oldVNode = options.vnode;\r\n\tlet oldRender = options._render;\r\n\r\n\toptions.diffed = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.pop();\r\n\t\t}\r\n\t\trenderStack.pop();\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\trenderStack.push(vnode);\r\n\t\t}\r\n\t\tif (oldDiff) oldDiff(vnode);\r\n\t};\r\n\r\n\toptions._root = (vnode, parent) => {\r\n\t\townerStack = [];\r\n\t\tif (oldRoot) oldRoot(vnode, parent);\r\n\t};\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tvnode._owner =\r\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\r\n\t\tif (oldVNode) oldVNode(vnode);\r\n\t};\r\n\r\n\toptions._render = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.push(vnode);\r\n\t\t}\r\n\r\n\t\tif (oldRender) oldRender(vnode);\r\n\t};\r\n}\r\n","import { checkPropTypes } from './check-props';\r\nimport { options, Component } from 'preact';\r\nimport {\r\n\tELEMENT_NODE,\r\n\tDOCUMENT_NODE,\r\n\tDOCUMENT_FRAGMENT_NODE\r\n} from './constants';\r\nimport {\r\n\tgetOwnerStack,\r\n\tsetupComponentStack,\r\n\tgetCurrentVNode,\r\n\tgetDisplayName\r\n} from './component-stack';\r\nimport { assign } from './util';\r\n\r\nconst isWeakMapSupported = typeof WeakMap == 'function';\r\n\r\nfunction getClosestDomNodeParent(parent) {\r\n\tif (!parent) return {};\r\n\tif (typeof parent.type == 'function') {\r\n\t\treturn getClosestDomNodeParent(parent._parent);\r\n\t}\r\n\treturn parent;\r\n}\r\n\r\nexport function initDebug() {\r\n\tsetupComponentStack();\r\n\r\n\tlet hooksAllowed = false;\r\n\r\n\t/* eslint-disable no-console */\r\n\tlet oldBeforeDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldVnode = options.vnode;\r\n\tlet oldCatchError = options._catchError;\r\n\tlet oldRoot = options._root;\r\n\tlet oldHook = options._hook;\r\n\tconst warnedComponents = !isWeakMapSupported\r\n\t\t? null\r\n\t\t: {\r\n\t\t\t\tuseEffect: new WeakMap(),\r\n\t\t\t\tuseLayoutEffect: new WeakMap(),\r\n\t\t\t\tlazyPropTypes: new WeakMap()\r\n\t\t };\r\n\tconst deprecations = [];\r\n\r\n\toptions._catchError = (error, vnode, oldVNode) => {\r\n\t\tlet component = vnode && vnode._component;\r\n\t\tif (component && typeof error.then == 'function') {\r\n\t\t\tconst promise = error;\r\n\t\t\terror = new Error(\r\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\r\n\t\t\t);\r\n\r\n\t\t\tlet parent = vnode;\r\n\t\t\tfor (; parent; parent = parent._parent) {\r\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\r\n\t\t\t\t\terror = promise;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// We haven't recovered and we know at this point that there is no\r\n\t\t\t// Suspense component higher up in the tree\r\n\t\t\tif (error instanceof Error) {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\toldCatchError(error, vnode, oldVNode);\r\n\r\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\r\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\r\n\t\t\t// and thus make the Next.js dev overlay work.\r\n\t\t\tif (typeof error.then != 'function') {\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t};\r\n\r\n\toptions._root = (vnode, parentNode) => {\r\n\t\tif (!parentNode) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\r\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tlet isValid;\r\n\t\tswitch (parentNode.nodeType) {\r\n\t\t\tcase ELEMENT_NODE:\r\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\r\n\t\t\tcase DOCUMENT_NODE:\r\n\t\t\t\tisValid = true;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tisValid = false;\r\n\t\t}\r\n\r\n\t\tif (!isValid) {\r\n\t\t\tlet componentName = getDisplayName(vnode);\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tlet { type, _parent: parent } = vnode;\r\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\r\n\r\n\t\thooksAllowed = true;\r\n\r\n\t\tif (type === undefined) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\r\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type != null && typeof type == 'object') {\r\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\r\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\r\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\r\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\r\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\r\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Invalid type passed to createElement(): ' +\r\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (\r\n\t\t\ttype === 'tr' &&\r\n\t\t\tparentVNode.type !== 'thead' &&\r\n\t\t\tparentVNode.type !== 'tfoot' &&\r\n\t\t\tparentVNode.type !== 'tbody' &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tvnode.ref !== undefined &&\r\n\t\t\ttypeof vnode.ref != 'function' &&\r\n\t\t\ttypeof vnode.ref != 'object' &&\r\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\r\n\t\t) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\r\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (typeof vnode.type == 'string') {\r\n\t\t\tfor (const key in vnode.props) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tkey[0] === 'o' &&\r\n\t\t\t\t\tkey[1] === 'n' &&\r\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\r\n\t\t\t\t\tvnode.props[key] != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\r\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check prop-types if available\r\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\r\n\t\t\tif (\r\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\r\n\t\t\t\twarnedComponents &&\r\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\r\n\t\t\t) {\r\n\t\t\t\tconst m =\r\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst lazyVNode = vnode.type();\r\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t} catch (promise) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet values = vnode.props;\r\n\t\t\tif (vnode.type._forwarded) {\r\n\t\t\t\tvalues = assign({}, values);\r\n\t\t\t\tdelete values.ref;\r\n\t\t\t}\r\n\r\n\t\t\tcheckPropTypes(\r\n\t\t\t\tvnode.type.propTypes,\r\n\t\t\t\tvalues,\r\n\t\t\t\t'prop',\r\n\t\t\t\tgetDisplayName(vnode),\r\n\t\t\t\t() => getOwnerStack(vnode)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\r\n\t};\r\n\r\n\toptions._hook = (comp, index, type) => {\r\n\t\tif (!comp || !hooksAllowed) {\r\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\r\n\t\t}\r\n\r\n\t\tif (oldHook) oldHook(comp, index, type);\r\n\t};\r\n\r\n\t// Ideally we'd want to print a warning once per component, but we\r\n\t// don't have access to the vnode that triggered it here. As a\r\n\t// compromise and to avoid flooding the console with warnings we\r\n\t// print each deprecation warning only once.\r\n\tconst warn = (property, message) => ({\r\n\t\tget() {\r\n\t\t\tconst key = 'get' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tset() {\r\n\t\t\tconst key = 'set' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tconst deprecatedAttributes = {\r\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\r\n\t\tattributes: warn('attributes', 'use vnode.props'),\r\n\t\tchildren: warn('children', 'use vnode.props.children')\r\n\t};\r\n\r\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tconst props = vnode.props;\r\n\t\tif (\r\n\t\t\tvnode.type !== null &&\r\n\t\t\tprops != null &&\r\n\t\t\t('__source' in props || '__self' in props)\r\n\t\t) {\r\n\t\t\tconst newProps = (vnode.props = {});\r\n\t\t\tfor (let i in props) {\r\n\t\t\t\tconst v = props[i];\r\n\t\t\t\tif (i === '__source') vnode.__source = v;\r\n\t\t\t\telse if (i === '__self') vnode.__self = v;\r\n\t\t\t\telse newProps[i] = v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line\r\n\t\tvnode.__proto__ = deprecatedProto;\r\n\t\tif (oldVnode) oldVnode(vnode);\r\n\t};\r\n\r\n\toptions.diffed = vnode => {\r\n\t\t// Check if the user passed plain objects as children. Note that we cannot\r\n\t\t// move this check into `options.vnode` because components can receive\r\n\t\t// children in any shape they want (e.g.\r\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\r\n\t\t// Putting this check in `options.diffed` ensures that\r\n\t\t// `vnode._children` is set and that we only validate the children\r\n\t\t// that were actually rendered.\r\n\t\tif (vnode._children) {\r\n\t\t\tvnode._children.forEach(child => {\r\n\t\t\t\tif (child && child.type === undefined) {\r\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\r\n\t\t\t\t\tdelete child._parent;\r\n\t\t\t\t\tdelete child._depth;\r\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\thooksAllowed = false;\r\n\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\r\n\t\tif (vnode._children != null) {\r\n\t\t\tconst keys = [];\r\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\r\n\t\t\t\tconst child = vnode._children[i];\r\n\t\t\t\tif (!child || child.key == null) continue;\r\n\r\n\t\t\t\tconst key = child.key;\r\n\t\t\t\tif (keys.indexOf(key) !== -1) {\r\n\t\t\t\t\tconsole.error(\r\n\t\t\t\t\t\t'Following component has two or more children with the ' +\r\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\r\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t// Break early to not spam the console\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.push(key);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nconst setState = Component.prototype.setState;\r\nComponent.prototype.setState = function(update, callback) {\r\n\tif (this._vnode == null) {\r\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\r\n\t\t// is perfectly valid to call `setState` during cWM. So we\r\n\t\t// need an additional check to verify that we are dealing with a\r\n\t\t// call inside constructor.\r\n\t\tif (this.state == null) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\r\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\r\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\r\n\t\t\t);\r\n\t\t}\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\r\n\treturn setState.call(this, update, callback);\r\n};\r\n\r\nconst forceUpdate = Component.prototype.forceUpdate;\r\nComponent.prototype.forceUpdate = function(callback) {\r\n\tif (this._vnode == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\r\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\r\n\t\t\t\t\tgetCurrentVNode()\r\n\t\t\t\t)}`\r\n\t\t);\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\treturn forceUpdate.call(this, callback);\r\n};\r\n\r\n/**\r\n * Serialize a vnode tree to a string\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function serializeVNode(vnode) {\r\n\tlet { props } = vnode;\r\n\tlet name = getDisplayName(vnode);\r\n\r\n\tlet attrs = '';\r\n\tfor (let prop in props) {\r\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\r\n\t\t\tlet value = props[prop];\r\n\r\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\r\n\t\t\tif (typeof value == 'function') {\r\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\r\n\t\t\t}\r\n\r\n\t\t\tvalue =\r\n\t\t\t\tObject(value) === value && !value.toString\r\n\t\t\t\t\t? Object.prototype.toString.call(value)\r\n\t\t\t\t\t: value + '';\r\n\r\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\r\n\t\t}\r\n\t}\r\n\r\n\tlet children = props.children;\r\n\treturn `<${name}${attrs}${\r\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\r\n\t}`;\r\n}\r\n","export const ELEMENT_NODE = 1;\r\nexport const DOCUMENT_NODE = 9;\r\nexport const DOCUMENT_FRAGMENT_NODE = 11;\r\n","/**\r\n * Assign properties from `props` to `obj`\r\n * @template O, P The obj and props types\r\n * @param {O} obj The object to copy properties to\r\n * @param {P} props The object to copy properties from\r\n * @returns {O & P}\r\n */\r\nexport function assign(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn /** @type {O & P} */ (obj);\r\n}\r\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"mDAAA,IAEIA,EAAqB,GCMlB,SAASC,EAAeC,UAC1BA,EAAMC,OAASC,WACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMjB,SAAgBC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,WAQlD,SAASS,EAAcX,WACvBY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,OACND,EAAME,KAAKD,OACXA,EAAOA,aAGDD,EAAMG,OAAO,SAACC,EAAKC,GACzBD,WAAejB,EAAekB,OAExBC,EAASD,EAAME,gBACjBD,EACHF,WAAeE,EAAOE,aAAYF,EAAOG,eAC9BZ,IACXA,GAAiB,EACjBa,QAAQC,KACP,mLAIMP,EAAO,MACb,IClFJ,IAAMQ,EAAuC,mBAAXC,QA4V5BC,EAAWC,YAAUC,UAAUF,SACrCC,YAAUC,UAAUF,SAAW,SAASG,EAAQC,UAC5B,MAAfC,SAKe,MAAdA,KAAKC,OACRV,QAAQC,KACP,gKAEmCZ,EAAcJ,MAGtB,MAAnBwB,UACVT,QAAQC,KACP,8NAGQZ,EAAcoB,WAIjBL,EAASO,KAAKF,KAAMF,EAAQC,IAGpC,IAAMI,EAAcP,YAAUC,UAAUM,YAyBjC,SAASC,EAAenC,OACxBoC,EAAUpC,EAAVoC,MACFhC,EAAOL,EAAeC,GAEtBqC,EAAQ,OACP,IAAIC,KAAQF,KACZA,EAAMG,eAAeD,IAAkB,aAATA,EAAqB,KAClDE,EAAQJ,EAAME,GAGE,mB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AGxB+C,UAAQE,OAAS,SAAAjD,MAQZA,OACHA,MAAgBgG,QAAQ,SAAAkB,MACnBA,QAAwBpC,IAAfoC,EAAMjH,KAAoB,QAE/BiH,YACAA,UACDnB,EAAOtD,OAAOsD,KAAKmB,GAAOC,KAAK,WAC/B,IAAI9C,MACT,0EAA0E0B,WAClEpF,EAAcX,OAM1BwD,GAAe,EAEXR,GAAWA,EAAUhD,GAEF,MAAnBA,cACG+F,EAAO,GACJL,EAAI,EAAGA,EAAI1F,MAAgBQ,OAAQkF,IAAK,KAC1CwB,EAAQlH,MAAgB0F,MACzBwB,GAAsB,MAAbA,EAAMhC,SAEdA,EAAMgC,EAAMhC,QACS,IAAvBa,EAAKS,QAAQtB,GAAa,CAC7B5D,QAAQ4C,MACP,8EACyBgB,qFAExB/C,EAAenC,UACRW,EAAcX,UAOxB+F,EAAKjF,KAAKoE,mCF9Vd,WACCpF,EAAqB"}
1
+ {"version":3,"file":"debug.js","sources":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nlet loggedTypeFailures = {};\n\n/**\n * Reset the history of which prop type warnings have been logged.\n */\nexport function resetPropWarnings() {\n\tloggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n */\nexport function checkPropTypes(\n\ttypeSpecs,\n\tvalues,\n\tlocation,\n\tcomponentName,\n\tgetStack\n) {\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\n\t\t\t\t\t`\\n${getStack()}`) ||\n\t\t\t\t\t''}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\n * const Bar = props => {\n * return (\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet hasBabelPlugin = false;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (!hasBabelPlugin) {\n\t\t\thasBabelPlugin = true;\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\nfunction getClosestDomNodeParent(parent) {\n\tif (!parent) return {};\n\tif (typeof parent.type == 'function') {\n\t\treturn getClosestDomNodeParent(parent._parent);\n\t}\n\treturn parent;\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t };\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\toldCatchError(error, vnode, oldVNode);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type, _parent: parent } = vnode;\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (\n\t\t\ttype === 'tr' &&\n\t\t\tparentVNode.type !== 'thead' &&\n\t\t\tparentVNode.type !== 'tfoot' &&\n\t\t\tparentVNode.type !== 'tbody' &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (child && child.type === undefined) {\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\n\t\t\t\t\tdelete child._parent;\n\t\t\t\t\tdelete child._depth;\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function(update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\n\t}`;\n}\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"mDAAA,IAEIA,EAAqB,GCMlB,SAASC,EAAeC,UAC1BA,EAAMC,OAASC,WACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMjB,SAAgBC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,WAQlD,SA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qFAExB/C,EAAenC,UACRW,EAAcX,UAOxB+F,EAAKjF,KAAKoE,mCF9Vd,WACCpF,EAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"debug.module.js","sources":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\r\n\r\nlet loggedTypeFailures = {};\r\n\r\n/**\r\n * Reset the history of which prop type warnings have been logged.\r\n */\r\nexport function resetPropWarnings() {\r\n\tloggedTypeFailures = {};\r\n}\r\n\r\n/**\r\n * Assert that the values match with the type specs.\r\n * Error messages are memorized and will only be shown once.\r\n *\r\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\r\n *\r\n * @param {object} typeSpecs Map of name to a ReactPropType\r\n * @param {object} values Runtime values that need to be type-checked\r\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\r\n * @param {string} componentName Name of the component for error messages.\r\n * @param {?Function} getStack Returns the component stack.\r\n */\r\nexport function checkPropTypes(\r\n\ttypeSpecs,\r\n\tvalues,\r\n\tlocation,\r\n\tcomponentName,\r\n\tgetStack\r\n) {\r\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\r\n\t\tlet error;\r\n\t\ttry {\r\n\t\t\terror = typeSpecs[typeSpecName](\r\n\t\t\t\tvalues,\r\n\t\t\t\ttypeSpecName,\r\n\t\t\t\tcomponentName,\r\n\t\t\t\tlocation,\r\n\t\t\t\tnull,\r\n\t\t\t\tReactPropTypesSecret\r\n\t\t\t);\r\n\t\t} catch (e) {\r\n\t\t\terror = e;\r\n\t\t}\r\n\t\tif (error && !(error.message in loggedTypeFailures)) {\r\n\t\t\tloggedTypeFailures[error.message] = true;\r\n\t\t\tconsole.error(\r\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\r\n\t\t\t\t\t`\\n${getStack()}`) ||\r\n\t\t\t\t\t''}`\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n}\r\n","import { options, Fragment } from 'preact';\r\n\r\n/**\r\n * Get human readable name of the component/dom node\r\n * @param {import('./internal').VNode} vnode\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getDisplayName(vnode) {\r\n\tif (vnode.type === Fragment) {\r\n\t\treturn 'Fragment';\r\n\t} else if (typeof vnode.type == 'function') {\r\n\t\treturn vnode.type.displayName || vnode.type.name;\r\n\t} else if (typeof vnode.type == 'string') {\r\n\t\treturn vnode.type;\r\n\t}\r\n\r\n\treturn '#text';\r\n}\r\n\r\n/**\r\n * Used to keep track of the currently rendered `vnode` and print it\r\n * in debug messages.\r\n */\r\nlet renderStack = [];\r\n\r\n/**\r\n * Keep track of the current owners. An owner describes a component\r\n * which was responsible to render a specific `vnode`. This exclude\r\n * children that are passed via `props.children`, because they belong\r\n * to the parent owner.\r\n *\r\n * ```jsx\r\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\r\n * const Bar = props => {\r\n * return (\r\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\r\n * )\r\n * }\r\n * ```\r\n *\r\n * Note: A `vnode` may be hoisted to the root scope due to compiler\r\n * optimiztions. In these cases the `_owner` will be different.\r\n */\r\nlet ownerStack = [];\r\n\r\n/**\r\n * Get the currently rendered `vnode`\r\n * @returns {import('./internal').VNode | null}\r\n */\r\nexport function getCurrentVNode() {\r\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\r\n}\r\n\r\n/**\r\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\r\n * somewhere in his tool chain we can't print the filename and source\r\n * location of a component. In that case we just omit that, but we'll\r\n * print a helpful message to the console, notifying the user of it.\r\n */\r\nlet hasBabelPlugin = false;\r\n\r\n/**\r\n * Check if a `vnode` is a possible owner.\r\n * @param {import('./internal').VNode} vnode\r\n */\r\nfunction isPossibleOwner(vnode) {\r\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\r\n}\r\n\r\n/**\r\n * Return the component stack that was captured up to this point.\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getOwnerStack(vnode) {\r\n\tconst stack = [vnode];\r\n\tlet next = vnode;\r\n\twhile (next._owner != null) {\r\n\t\tstack.push(next._owner);\r\n\t\tnext = next._owner;\r\n\t}\r\n\r\n\treturn stack.reduce((acc, owner) => {\r\n\t\tacc += ` in ${getDisplayName(owner)}`;\r\n\r\n\t\tconst source = owner.__source;\r\n\t\tif (source) {\r\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\r\n\t\t} else if (!hasBabelPlugin) {\r\n\t\t\thasBabelPlugin = true;\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (acc += '\\n');\r\n\t}, '');\r\n}\r\n\r\n/**\r\n * Setup code to capture the component trace while rendering. Note that\r\n * we cannot simply traverse `vnode._parent` upwards, because we have some\r\n * debug messages for `this.setState` where the `vnode` is `undefined`.\r\n */\r\nexport function setupComponentStack() {\r\n\tlet oldDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldRoot = options._root;\r\n\tlet oldVNode = options.vnode;\r\n\tlet oldRender = options._render;\r\n\r\n\toptions.diffed = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.pop();\r\n\t\t}\r\n\t\trenderStack.pop();\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\trenderStack.push(vnode);\r\n\t\t}\r\n\t\tif (oldDiff) oldDiff(vnode);\r\n\t};\r\n\r\n\toptions._root = (vnode, parent) => {\r\n\t\townerStack = [];\r\n\t\tif (oldRoot) oldRoot(vnode, parent);\r\n\t};\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tvnode._owner =\r\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\r\n\t\tif (oldVNode) oldVNode(vnode);\r\n\t};\r\n\r\n\toptions._render = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.push(vnode);\r\n\t\t}\r\n\r\n\t\tif (oldRender) oldRender(vnode);\r\n\t};\r\n}\r\n","import { checkPropTypes } from './check-props';\r\nimport { options, Component } from 'preact';\r\nimport {\r\n\tELEMENT_NODE,\r\n\tDOCUMENT_NODE,\r\n\tDOCUMENT_FRAGMENT_NODE\r\n} from './constants';\r\nimport {\r\n\tgetOwnerStack,\r\n\tsetupComponentStack,\r\n\tgetCurrentVNode,\r\n\tgetDisplayName\r\n} from './component-stack';\r\nimport { assign } from './util';\r\n\r\nconst isWeakMapSupported = typeof WeakMap == 'function';\r\n\r\nfunction getClosestDomNodeParent(parent) {\r\n\tif (!parent) return {};\r\n\tif (typeof parent.type == 'function') {\r\n\t\treturn getClosestDomNodeParent(parent._parent);\r\n\t}\r\n\treturn parent;\r\n}\r\n\r\nexport function initDebug() {\r\n\tsetupComponentStack();\r\n\r\n\tlet hooksAllowed = false;\r\n\r\n\t/* eslint-disable no-console */\r\n\tlet oldBeforeDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldVnode = options.vnode;\r\n\tlet oldCatchError = options._catchError;\r\n\tlet oldRoot = options._root;\r\n\tlet oldHook = options._hook;\r\n\tconst warnedComponents = !isWeakMapSupported\r\n\t\t? null\r\n\t\t: {\r\n\t\t\t\tuseEffect: new WeakMap(),\r\n\t\t\t\tuseLayoutEffect: new WeakMap(),\r\n\t\t\t\tlazyPropTypes: new WeakMap()\r\n\t\t };\r\n\tconst deprecations = [];\r\n\r\n\toptions._catchError = (error, vnode, oldVNode) => {\r\n\t\tlet component = vnode && vnode._component;\r\n\t\tif (component && typeof error.then == 'function') {\r\n\t\t\tconst promise = error;\r\n\t\t\terror = new Error(\r\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\r\n\t\t\t);\r\n\r\n\t\t\tlet parent = vnode;\r\n\t\t\tfor (; parent; parent = parent._parent) {\r\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\r\n\t\t\t\t\terror = promise;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// We haven't recovered and we know at this point that there is no\r\n\t\t\t// Suspense component higher up in the tree\r\n\t\t\tif (error instanceof Error) {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\toldCatchError(error, vnode, oldVNode);\r\n\r\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\r\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\r\n\t\t\t// and thus make the Next.js dev overlay work.\r\n\t\t\tif (typeof error.then != 'function') {\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t};\r\n\r\n\toptions._root = (vnode, parentNode) => {\r\n\t\tif (!parentNode) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\r\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tlet isValid;\r\n\t\tswitch (parentNode.nodeType) {\r\n\t\t\tcase ELEMENT_NODE:\r\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\r\n\t\t\tcase DOCUMENT_NODE:\r\n\t\t\t\tisValid = true;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tisValid = false;\r\n\t\t}\r\n\r\n\t\tif (!isValid) {\r\n\t\t\tlet componentName = getDisplayName(vnode);\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tlet { type, _parent: parent } = vnode;\r\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\r\n\r\n\t\thooksAllowed = true;\r\n\r\n\t\tif (type === undefined) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\r\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type != null && typeof type == 'object') {\r\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\r\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\r\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\r\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\r\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\r\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Invalid type passed to createElement(): ' +\r\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (\r\n\t\t\ttype === 'tr' &&\r\n\t\t\tparentVNode.type !== 'thead' &&\r\n\t\t\tparentVNode.type !== 'tfoot' &&\r\n\t\t\tparentVNode.type !== 'tbody' &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tvnode.ref !== undefined &&\r\n\t\t\ttypeof vnode.ref != 'function' &&\r\n\t\t\ttypeof vnode.ref != 'object' &&\r\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\r\n\t\t) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\r\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (typeof vnode.type == 'string') {\r\n\t\t\tfor (const key in vnode.props) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tkey[0] === 'o' &&\r\n\t\t\t\t\tkey[1] === 'n' &&\r\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\r\n\t\t\t\t\tvnode.props[key] != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\r\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check prop-types if available\r\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\r\n\t\t\tif (\r\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\r\n\t\t\t\twarnedComponents &&\r\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\r\n\t\t\t) {\r\n\t\t\t\tconst m =\r\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst lazyVNode = vnode.type();\r\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t} catch (promise) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet values = vnode.props;\r\n\t\t\tif (vnode.type._forwarded) {\r\n\t\t\t\tvalues = assign({}, values);\r\n\t\t\t\tdelete values.ref;\r\n\t\t\t}\r\n\r\n\t\t\tcheckPropTypes(\r\n\t\t\t\tvnode.type.propTypes,\r\n\t\t\t\tvalues,\r\n\t\t\t\t'prop',\r\n\t\t\t\tgetDisplayName(vnode),\r\n\t\t\t\t() => getOwnerStack(vnode)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\r\n\t};\r\n\r\n\toptions._hook = (comp, index, type) => {\r\n\t\tif (!comp || !hooksAllowed) {\r\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\r\n\t\t}\r\n\r\n\t\tif (oldHook) oldHook(comp, index, type);\r\n\t};\r\n\r\n\t// Ideally we'd want to print a warning once per component, but we\r\n\t// don't have access to the vnode that triggered it here. As a\r\n\t// compromise and to avoid flooding the console with warnings we\r\n\t// print each deprecation warning only once.\r\n\tconst warn = (property, message) => ({\r\n\t\tget() {\r\n\t\t\tconst key = 'get' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tset() {\r\n\t\t\tconst key = 'set' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tconst deprecatedAttributes = {\r\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\r\n\t\tattributes: warn('attributes', 'use vnode.props'),\r\n\t\tchildren: warn('children', 'use vnode.props.children')\r\n\t};\r\n\r\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tconst props = vnode.props;\r\n\t\tif (\r\n\t\t\tvnode.type !== null &&\r\n\t\t\tprops != null &&\r\n\t\t\t('__source' in props || '__self' in props)\r\n\t\t) {\r\n\t\t\tconst newProps = (vnode.props = {});\r\n\t\t\tfor (let i in props) {\r\n\t\t\t\tconst v = props[i];\r\n\t\t\t\tif (i === '__source') vnode.__source = v;\r\n\t\t\t\telse if (i === '__self') vnode.__self = v;\r\n\t\t\t\telse newProps[i] = v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line\r\n\t\tvnode.__proto__ = deprecatedProto;\r\n\t\tif (oldVnode) oldVnode(vnode);\r\n\t};\r\n\r\n\toptions.diffed = vnode => {\r\n\t\t// Check if the user passed plain objects as children. Note that we cannot\r\n\t\t// move this check into `options.vnode` because components can receive\r\n\t\t// children in any shape they want (e.g.\r\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\r\n\t\t// Putting this check in `options.diffed` ensures that\r\n\t\t// `vnode._children` is set and that we only validate the children\r\n\t\t// that were actually rendered.\r\n\t\tif (vnode._children) {\r\n\t\t\tvnode._children.forEach(child => {\r\n\t\t\t\tif (child && child.type === undefined) {\r\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\r\n\t\t\t\t\tdelete child._parent;\r\n\t\t\t\t\tdelete child._depth;\r\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\thooksAllowed = false;\r\n\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\r\n\t\tif (vnode._children != null) {\r\n\t\t\tconst keys = [];\r\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\r\n\t\t\t\tconst child = vnode._children[i];\r\n\t\t\t\tif (!child || child.key == null) continue;\r\n\r\n\t\t\t\tconst key = child.key;\r\n\t\t\t\tif (keys.indexOf(key) !== -1) {\r\n\t\t\t\t\tconsole.error(\r\n\t\t\t\t\t\t'Following component has two or more children with the ' +\r\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\r\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t// Break early to not spam the console\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.push(key);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nconst setState = Component.prototype.setState;\r\nComponent.prototype.setState = function(update, callback) {\r\n\tif (this._vnode == null) {\r\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\r\n\t\t// is perfectly valid to call `setState` during cWM. So we\r\n\t\t// need an additional check to verify that we are dealing with a\r\n\t\t// call inside constructor.\r\n\t\tif (this.state == null) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\r\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\r\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\r\n\t\t\t);\r\n\t\t}\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\r\n\treturn setState.call(this, update, callback);\r\n};\r\n\r\nconst forceUpdate = Component.prototype.forceUpdate;\r\nComponent.prototype.forceUpdate = function(callback) {\r\n\tif (this._vnode == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\r\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\r\n\t\t\t\t\tgetCurrentVNode()\r\n\t\t\t\t)}`\r\n\t\t);\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\treturn forceUpdate.call(this, callback);\r\n};\r\n\r\n/**\r\n * Serialize a vnode tree to a string\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function serializeVNode(vnode) {\r\n\tlet { props } = vnode;\r\n\tlet name = getDisplayName(vnode);\r\n\r\n\tlet attrs = '';\r\n\tfor (let prop in props) {\r\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\r\n\t\t\tlet value = props[prop];\r\n\r\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\r\n\t\t\tif (typeof value == 'function') {\r\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\r\n\t\t\t}\r\n\r\n\t\t\tvalue =\r\n\t\t\t\tObject(value) === value && !value.toString\r\n\t\t\t\t\t? Object.prototype.toString.call(value)\r\n\t\t\t\t\t: value + '';\r\n\r\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\r\n\t\t}\r\n\t}\r\n\r\n\tlet children = props.children;\r\n\treturn `<${name}${attrs}${\r\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\r\n\t}`;\r\n}\r\n","export const ELEMENT_NODE = 1;\r\nexport const DOCUMENT_NODE = 9;\r\nexport const DOCUMENT_FRAGMENT_NODE = 11;\r\n","/**\r\n * Assign properties from `props` to `obj`\r\n * @template O, P The obj and props types\r\n * @param {O} obj The object to copy properties to\r\n * @param {P} props The object to copy properties from\r\n * @returns {O & P}\r\n */\r\nexport function assign(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn /** @type {O & P} */ (obj);\r\n}\r\n"],"names":["loggedTypeFailures","resetPropWarnings","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"sFAAA,IAEIA,EAAqB,GAKzB,SAAgBC,IACfD,EAAqB,GCAf,SAASE,EAAeC,UAC1BA,EAAMC,OAASC,EACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMjB,SAAgBC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,EAQlD,SAASS,EAAcX,WACvBY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,OACND,EAAME,KAAKD,OACXA,EAAO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":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nlet loggedTypeFailures = {};\n\n/**\n * Reset the history of which prop type warnings have been logged.\n */\nexport function resetPropWarnings() {\n\tloggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n */\nexport function checkPropTypes(\n\ttypeSpecs,\n\tvalues,\n\tlocation,\n\tcomponentName,\n\tgetStack\n) {\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\n\t\t\t\t\t`\\n${getStack()}`) ||\n\t\t\t\t\t''}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\n * const Bar = props => {\n * return (\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet hasBabelPlugin = false;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (!hasBabelPlugin) {\n\t\t\thasBabelPlugin = true;\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\nfunction getClosestDomNodeParent(parent) {\n\tif (!parent) return {};\n\tif (typeof parent.type == 'function') {\n\t\treturn getClosestDomNodeParent(parent._parent);\n\t}\n\treturn parent;\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t };\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\toldCatchError(error, vnode, oldVNode);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type, _parent: parent } = vnode;\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (\n\t\t\ttype === 'tr' &&\n\t\t\tparentVNode.type !== 'thead' &&\n\t\t\tparentVNode.type !== 'tfoot' &&\n\t\t\tparentVNode.type !== 'tbody' &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (child && child.type === undefined) {\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\n\t\t\t\t\tdelete child._parent;\n\t\t\t\t\tdelete child._depth;\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function(update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\n\t}`;\n}\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n"],"names":["loggedTypeFailures","resetPropWarnings","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"sFAAA,IAEIA,EAAqB,GAKzB,SAAgBC,IACfD,EAAqB,GCAf,SAASE,EAAeC,UAC1BA,EAAMC,OAASC,EACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMjB,SAAgBC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,EAQlD,SAASS,EAAcX,WACvBY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,OACND,EAAME,KAAKD,OACXA,EAAOA,aAGDD,EAAMG,OAAO,SAACC,EAAKC,GACzBD,WAAejB,EAAekB,OAExBC,EAASD,EAAME,gBACjBD,EACHF,WAAeE,EAAOE,aAAYF,EAAOG,eAC9BZ,IACXA,GAAiB,EACjBa,QAAQC,KACP,mLAIMP,EAAO,MACb,IClFJ,IAAMQ,EAAuC,mBAAXC,QA4V5BC,EAAWC,EAAUC,UAAUF,SACrCC,EAAUC,UAAUF,SAAW,SAASG,EAAQC,UAC5B,MAAfC,SAKe,MAAdA,KAAKC,OACRV,QAAQC,KACP,gKAEmCZ,EAAcJ,MAGtB,MAAnBwB,UACVT,QAAQC,KACP,8NAGQZ,EAAcoB,WAIjBL,EAASO,KAAKF,KAAMF,EAAQC,IAGpC,IAAMI,EAAcP,EA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D,KAAKtD,EAAO,KACd2E,EAAI3E,EAAMsD,GACN,aAANA,EAAkB1F,EAAMmB,SAAW4F,EACxB,WAANrB,EAAgB1F,EAAMgH,OAASD,EACnCD,EAASpB,GAAKqB,GAKrB/G,EAAMiH,UAAYL,EACdlD,GAAUA,EAAS1D,IAGxB+C,EAAQE,OAAS,SAAAjD,MAQZA,OACHA,MAAgBgG,QAAQ,SAAAkB,MACnBA,QAAwBpC,IAAfoC,EAAMjH,KAAoB,QAE/BiH,YACAA,UACDnB,EAAOtD,OAAOsD,KAAKmB,GAAOC,KAAK,WAC/B,IAAI9C,MACT,0EAA0E0B,WAClEpF,EAAcX,OAM1BwD,GAAe,EAEXR,GAAWA,EAAUhD,GAEF,MAAnBA,cACG+F,EAAO,GACJL,EAAI,EAAGA,EAAI1F,MAAgBQ,OAAQkF,IAAK,KAC1CwB,EAAQlH,MAAgB0F,MACzBwB,GAAsB,MAAbA,EAAMhC,SAEdA,EAAMgC,EAAMhC,QACS,IAAvBa,EAAKS,QAAQtB,GAAa,CAC7B5D,QAAQ4C,MACP,8EACyBgB,qFAExB/C,EAAenC,UACRW,EAAcX,UAOxB+F,EAAKjF,KAAKoE"}
@@ -1 +1 @@
1
- {"version":3,"file":"debug.umd.js","sources":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\r\n\r\nlet loggedTypeFailures = {};\r\n\r\n/**\r\n * Reset the history of which prop type warnings have been logged.\r\n */\r\nexport function resetPropWarnings() {\r\n\tloggedTypeFailures = {};\r\n}\r\n\r\n/**\r\n * Assert that the values match with the type specs.\r\n * Error messages are memorized and will only be shown once.\r\n *\r\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\r\n *\r\n * @param {object} typeSpecs Map of name to a ReactPropType\r\n * @param {object} values Runtime values that need to be type-checked\r\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\r\n * @param {string} componentName Name of the component for error messages.\r\n * @param {?Function} getStack Returns the component stack.\r\n */\r\nexport function checkPropTypes(\r\n\ttypeSpecs,\r\n\tvalues,\r\n\tlocation,\r\n\tcomponentName,\r\n\tgetStack\r\n) {\r\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\r\n\t\tlet error;\r\n\t\ttry {\r\n\t\t\terror = typeSpecs[typeSpecName](\r\n\t\t\t\tvalues,\r\n\t\t\t\ttypeSpecName,\r\n\t\t\t\tcomponentName,\r\n\t\t\t\tlocation,\r\n\t\t\t\tnull,\r\n\t\t\t\tReactPropTypesSecret\r\n\t\t\t);\r\n\t\t} catch (e) {\r\n\t\t\terror = e;\r\n\t\t}\r\n\t\tif (error && !(error.message in loggedTypeFailures)) {\r\n\t\t\tloggedTypeFailures[error.message] = true;\r\n\t\t\tconsole.error(\r\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\r\n\t\t\t\t\t`\\n${getStack()}`) ||\r\n\t\t\t\t\t''}`\r\n\t\t\t);\r\n\t\t}\r\n\t});\r\n}\r\n","import { options, Fragment } from 'preact';\r\n\r\n/**\r\n * Get human readable name of the component/dom node\r\n * @param {import('./internal').VNode} vnode\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getDisplayName(vnode) {\r\n\tif (vnode.type === Fragment) {\r\n\t\treturn 'Fragment';\r\n\t} else if (typeof vnode.type == 'function') {\r\n\t\treturn vnode.type.displayName || vnode.type.name;\r\n\t} else if (typeof vnode.type == 'string') {\r\n\t\treturn vnode.type;\r\n\t}\r\n\r\n\treturn '#text';\r\n}\r\n\r\n/**\r\n * Used to keep track of the currently rendered `vnode` and print it\r\n * in debug messages.\r\n */\r\nlet renderStack = [];\r\n\r\n/**\r\n * Keep track of the current owners. An owner describes a component\r\n * which was responsible to render a specific `vnode`. This exclude\r\n * children that are passed via `props.children`, because they belong\r\n * to the parent owner.\r\n *\r\n * ```jsx\r\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\r\n * const Bar = props => {\r\n * return (\r\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\r\n * )\r\n * }\r\n * ```\r\n *\r\n * Note: A `vnode` may be hoisted to the root scope due to compiler\r\n * optimiztions. In these cases the `_owner` will be different.\r\n */\r\nlet ownerStack = [];\r\n\r\n/**\r\n * Get the currently rendered `vnode`\r\n * @returns {import('./internal').VNode | null}\r\n */\r\nexport function getCurrentVNode() {\r\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\r\n}\r\n\r\n/**\r\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\r\n * somewhere in his tool chain we can't print the filename and source\r\n * location of a component. In that case we just omit that, but we'll\r\n * print a helpful message to the console, notifying the user of it.\r\n */\r\nlet hasBabelPlugin = false;\r\n\r\n/**\r\n * Check if a `vnode` is a possible owner.\r\n * @param {import('./internal').VNode} vnode\r\n */\r\nfunction isPossibleOwner(vnode) {\r\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\r\n}\r\n\r\n/**\r\n * Return the component stack that was captured up to this point.\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function getOwnerStack(vnode) {\r\n\tconst stack = [vnode];\r\n\tlet next = vnode;\r\n\twhile (next._owner != null) {\r\n\t\tstack.push(next._owner);\r\n\t\tnext = next._owner;\r\n\t}\r\n\r\n\treturn stack.reduce((acc, owner) => {\r\n\t\tacc += ` in ${getDisplayName(owner)}`;\r\n\r\n\t\tconst source = owner.__source;\r\n\t\tif (source) {\r\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\r\n\t\t} else if (!hasBabelPlugin) {\r\n\t\t\thasBabelPlugin = true;\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (acc += '\\n');\r\n\t}, '');\r\n}\r\n\r\n/**\r\n * Setup code to capture the component trace while rendering. Note that\r\n * we cannot simply traverse `vnode._parent` upwards, because we have some\r\n * debug messages for `this.setState` where the `vnode` is `undefined`.\r\n */\r\nexport function setupComponentStack() {\r\n\tlet oldDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldRoot = options._root;\r\n\tlet oldVNode = options.vnode;\r\n\tlet oldRender = options._render;\r\n\r\n\toptions.diffed = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.pop();\r\n\t\t}\r\n\t\trenderStack.pop();\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\trenderStack.push(vnode);\r\n\t\t}\r\n\t\tif (oldDiff) oldDiff(vnode);\r\n\t};\r\n\r\n\toptions._root = (vnode, parent) => {\r\n\t\townerStack = [];\r\n\t\tif (oldRoot) oldRoot(vnode, parent);\r\n\t};\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tvnode._owner =\r\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\r\n\t\tif (oldVNode) oldVNode(vnode);\r\n\t};\r\n\r\n\toptions._render = vnode => {\r\n\t\tif (isPossibleOwner(vnode)) {\r\n\t\t\townerStack.push(vnode);\r\n\t\t}\r\n\r\n\t\tif (oldRender) oldRender(vnode);\r\n\t};\r\n}\r\n","import { checkPropTypes } from './check-props';\r\nimport { options, Component } from 'preact';\r\nimport {\r\n\tELEMENT_NODE,\r\n\tDOCUMENT_NODE,\r\n\tDOCUMENT_FRAGMENT_NODE\r\n} from './constants';\r\nimport {\r\n\tgetOwnerStack,\r\n\tsetupComponentStack,\r\n\tgetCurrentVNode,\r\n\tgetDisplayName\r\n} from './component-stack';\r\nimport { assign } from './util';\r\n\r\nconst isWeakMapSupported = typeof WeakMap == 'function';\r\n\r\nfunction getClosestDomNodeParent(parent) {\r\n\tif (!parent) return {};\r\n\tif (typeof parent.type == 'function') {\r\n\t\treturn getClosestDomNodeParent(parent._parent);\r\n\t}\r\n\treturn parent;\r\n}\r\n\r\nexport function initDebug() {\r\n\tsetupComponentStack();\r\n\r\n\tlet hooksAllowed = false;\r\n\r\n\t/* eslint-disable no-console */\r\n\tlet oldBeforeDiff = options._diff;\r\n\tlet oldDiffed = options.diffed;\r\n\tlet oldVnode = options.vnode;\r\n\tlet oldCatchError = options._catchError;\r\n\tlet oldRoot = options._root;\r\n\tlet oldHook = options._hook;\r\n\tconst warnedComponents = !isWeakMapSupported\r\n\t\t? null\r\n\t\t: {\r\n\t\t\t\tuseEffect: new WeakMap(),\r\n\t\t\t\tuseLayoutEffect: new WeakMap(),\r\n\t\t\t\tlazyPropTypes: new WeakMap()\r\n\t\t };\r\n\tconst deprecations = [];\r\n\r\n\toptions._catchError = (error, vnode, oldVNode) => {\r\n\t\tlet component = vnode && vnode._component;\r\n\t\tif (component && typeof error.then == 'function') {\r\n\t\t\tconst promise = error;\r\n\t\t\terror = new Error(\r\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\r\n\t\t\t);\r\n\r\n\t\t\tlet parent = vnode;\r\n\t\t\tfor (; parent; parent = parent._parent) {\r\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\r\n\t\t\t\t\terror = promise;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// We haven't recovered and we know at this point that there is no\r\n\t\t\t// Suspense component higher up in the tree\r\n\t\t\tif (error instanceof Error) {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\toldCatchError(error, vnode, oldVNode);\r\n\r\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\r\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\r\n\t\t\t// and thus make the Next.js dev overlay work.\r\n\t\t\tif (typeof error.then != 'function') {\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t};\r\n\r\n\toptions._root = (vnode, parentNode) => {\r\n\t\tif (!parentNode) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\r\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tlet isValid;\r\n\t\tswitch (parentNode.nodeType) {\r\n\t\t\tcase ELEMENT_NODE:\r\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\r\n\t\t\tcase DOCUMENT_NODE:\r\n\t\t\t\tisValid = true;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tisValid = false;\r\n\t\t}\r\n\r\n\t\tif (!isValid) {\r\n\t\t\tlet componentName = getDisplayName(vnode);\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\r\n\t};\r\n\r\n\toptions._diff = vnode => {\r\n\t\tlet { type, _parent: parent } = vnode;\r\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\r\n\r\n\t\thooksAllowed = true;\r\n\r\n\t\tif (type === undefined) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\r\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type != null && typeof type == 'object') {\r\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\r\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\r\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\r\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\r\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\r\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tthrow new Error(\r\n\t\t\t\t'Invalid type passed to createElement(): ' +\r\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (\r\n\t\t\ttype === 'tr' &&\r\n\t\t\tparentVNode.type !== 'thead' &&\r\n\t\t\tparentVNode.type !== 'tfoot' &&\r\n\t\t\tparentVNode.type !== 'tbody' &&\r\n\t\t\tparentVNode.type !== 'table'\r\n\t\t) {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\r\n\t\t\tconsole.error(\r\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tvnode.ref !== undefined &&\r\n\t\t\ttypeof vnode.ref != 'function' &&\r\n\t\t\ttypeof vnode.ref != 'object' &&\r\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\r\n\t\t) {\r\n\t\t\tthrow new Error(\r\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\r\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\r\n\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (typeof vnode.type == 'string') {\r\n\t\t\tfor (const key in vnode.props) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tkey[0] === 'o' &&\r\n\t\t\t\t\tkey[1] === 'n' &&\r\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\r\n\t\t\t\t\tvnode.props[key] != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\r\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Check prop-types if available\r\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\r\n\t\t\tif (\r\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\r\n\t\t\t\twarnedComponents &&\r\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\r\n\t\t\t) {\r\n\t\t\t\tconst m =\r\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst lazyVNode = vnode.type();\r\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t} catch (promise) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet values = vnode.props;\r\n\t\t\tif (vnode.type._forwarded) {\r\n\t\t\t\tvalues = assign({}, values);\r\n\t\t\t\tdelete values.ref;\r\n\t\t\t}\r\n\r\n\t\t\tcheckPropTypes(\r\n\t\t\t\tvnode.type.propTypes,\r\n\t\t\t\tvalues,\r\n\t\t\t\t'prop',\r\n\t\t\t\tgetDisplayName(vnode),\r\n\t\t\t\t() => getOwnerStack(vnode)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\r\n\t};\r\n\r\n\toptions._hook = (comp, index, type) => {\r\n\t\tif (!comp || !hooksAllowed) {\r\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\r\n\t\t}\r\n\r\n\t\tif (oldHook) oldHook(comp, index, type);\r\n\t};\r\n\r\n\t// Ideally we'd want to print a warning once per component, but we\r\n\t// don't have access to the vnode that triggered it here. As a\r\n\t// compromise and to avoid flooding the console with warnings we\r\n\t// print each deprecation warning only once.\r\n\tconst warn = (property, message) => ({\r\n\t\tget() {\r\n\t\t\tconst key = 'get' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tset() {\r\n\t\t\tconst key = 'set' + property + message;\r\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\r\n\t\t\t\tdeprecations.push(key);\r\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tconst deprecatedAttributes = {\r\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\r\n\t\tattributes: warn('attributes', 'use vnode.props'),\r\n\t\tchildren: warn('children', 'use vnode.props.children')\r\n\t};\r\n\r\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\r\n\r\n\toptions.vnode = vnode => {\r\n\t\tconst props = vnode.props;\r\n\t\tif (\r\n\t\t\tvnode.type !== null &&\r\n\t\t\tprops != null &&\r\n\t\t\t('__source' in props || '__self' in props)\r\n\t\t) {\r\n\t\t\tconst newProps = (vnode.props = {});\r\n\t\t\tfor (let i in props) {\r\n\t\t\t\tconst v = props[i];\r\n\t\t\t\tif (i === '__source') vnode.__source = v;\r\n\t\t\t\telse if (i === '__self') vnode.__self = v;\r\n\t\t\t\telse newProps[i] = v;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line\r\n\t\tvnode.__proto__ = deprecatedProto;\r\n\t\tif (oldVnode) oldVnode(vnode);\r\n\t};\r\n\r\n\toptions.diffed = vnode => {\r\n\t\t// Check if the user passed plain objects as children. Note that we cannot\r\n\t\t// move this check into `options.vnode` because components can receive\r\n\t\t// children in any shape they want (e.g.\r\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\r\n\t\t// Putting this check in `options.diffed` ensures that\r\n\t\t// `vnode._children` is set and that we only validate the children\r\n\t\t// that were actually rendered.\r\n\t\tif (vnode._children) {\r\n\t\t\tvnode._children.forEach(child => {\r\n\t\t\t\tif (child && child.type === undefined) {\r\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\r\n\t\t\t\t\tdelete child._parent;\r\n\t\t\t\t\tdelete child._depth;\r\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\thooksAllowed = false;\r\n\r\n\t\tif (oldDiffed) oldDiffed(vnode);\r\n\r\n\t\tif (vnode._children != null) {\r\n\t\t\tconst keys = [];\r\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\r\n\t\t\t\tconst child = vnode._children[i];\r\n\t\t\t\tif (!child || child.key == null) continue;\r\n\r\n\t\t\t\tconst key = child.key;\r\n\t\t\t\tif (keys.indexOf(key) !== -1) {\r\n\t\t\t\t\tconsole.error(\r\n\t\t\t\t\t\t'Following component has two or more children with the ' +\r\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\r\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\r\n\t\t\t\t\t\t\tserializeVNode(vnode) +\r\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t// Break early to not spam the console\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.push(key);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\nconst setState = Component.prototype.setState;\r\nComponent.prototype.setState = function(update, callback) {\r\n\tif (this._vnode == null) {\r\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\r\n\t\t// is perfectly valid to call `setState` during cWM. So we\r\n\t\t// need an additional check to verify that we are dealing with a\r\n\t\t// call inside constructor.\r\n\t\tif (this.state == null) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\r\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\r\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\r\n\t\t\t);\r\n\t\t}\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\r\n\treturn setState.call(this, update, callback);\r\n};\r\n\r\nconst forceUpdate = Component.prototype.forceUpdate;\r\nComponent.prototype.forceUpdate = function(callback) {\r\n\tif (this._vnode == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\r\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\r\n\t\t\t\t\tgetCurrentVNode()\r\n\t\t\t\t)}`\r\n\t\t);\r\n\t} else if (this._parentDom == null) {\r\n\t\tconsole.warn(\r\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\r\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\r\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\r\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\r\n\t\t);\r\n\t}\r\n\treturn forceUpdate.call(this, callback);\r\n};\r\n\r\n/**\r\n * Serialize a vnode tree to a string\r\n * @param {import('./internal').VNode} vnode\r\n * @returns {string}\r\n */\r\nexport function serializeVNode(vnode) {\r\n\tlet { props } = vnode;\r\n\tlet name = getDisplayName(vnode);\r\n\r\n\tlet attrs = '';\r\n\tfor (let prop in props) {\r\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\r\n\t\t\tlet value = props[prop];\r\n\r\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\r\n\t\t\tif (typeof value == 'function') {\r\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\r\n\t\t\t}\r\n\r\n\t\t\tvalue =\r\n\t\t\t\tObject(value) === value && !value.toString\r\n\t\t\t\t\t? Object.prototype.toString.call(value)\r\n\t\t\t\t\t: value + '';\r\n\r\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\r\n\t\t}\r\n\t}\r\n\r\n\tlet children = props.children;\r\n\treturn `<${name}${attrs}${\r\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\r\n\t}`;\r\n}\r\n","export const ELEMENT_NODE = 1;\r\nexport const DOCUMENT_NODE = 9;\r\nexport const DOCUMENT_FRAGMENT_NODE = 11;\r\n","/**\r\n * Assign properties from `props` to `obj`\r\n * @template O, P The obj and props types\r\n * @param {O} obj The object to copy properties to\r\n * @param {P} props The object to copy properties from\r\n * @returns {O & P}\r\n */\r\nexport function assign(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i];\r\n\treturn /** @type {O & P} */ (obj);\r\n}\r\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"oQAAA,IAEIA,EAAqB,GCMlB,SAASC,EAAeC,UAC1BA,EAAMC,OAASC,WACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMV,SAASC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,EAAMC,MAAQC,WAQlD,SAASS,EAAcX,WACvBY,EAAQ,CAACZ,GACXa,EAAOb,EACW,MAAfa,OACND,EAAME,KAAKD,OACXA,EAAOA,aAGDD,EAAMG,OAAO,SAACC,EAAKC,GACzBD,WAAejB,EAAekB,OAExBC,EAASD,EAAME,gBACjBD,EACHF,WAAeE,EAAOE,aAAYF,EAAOG,eAC9BZ,IACXA,GAAiB,EACjBa,QAAQC,KACP,mLAIMP,EAAO,MACb,IClFJ,IAAMQ,EAAuC,mBAAXC,QA4V5BC,EAAWC,YAAUC,UAAUF,qBAC3BE,UAAUF,SAAW,SAASG,EAAQC,UAC5B,MAAfC,SAKe,MAAdA,KAAKC,OACRV,QAAQC,KACP,gKAEmCZ,EAAcJ,MAGtB,MAAnBwB,UACVT,QAAQC,KACP,8NAGQZ,EAAcoB,WAIjBL,EAASO,KAAKF,KAAMF,EAAQC,IAGpC,IAAMI,EAAcP,YAAUC,UAAUM,YAyBjC,SAASC,EAAenC,OACxBoC,EAAUpC,EAAVoC,MACFhC,EAAOL,EAAeC,GAEtBqC,EAAQ,OACP,IAAIC,KAAQF,KACZA,EAAMG,eAAeD,IAAkB,aAATA,EAAqB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,EACdlD,GAAUA,EAAS1D,IAGxB+C,UAAQE,OAAS,SAAAjD,MAQZA,OACHA,MAAgBgG,QAAQ,SAAAkB,MACnBA,QAAwBpC,IAAfoC,EAAMjH,KAAoB,QAE/BiH,YACAA,UACDnB,EAAOtD,OAAOsD,KAAKmB,GAAOC,KAAK,WAC/B,IAAI9C,MACT,0EAA0E0B,WAClEpF,EAAcX,OAM1BwD,GAAe,EAEXR,GAAWA,EAAUhD,GAEF,MAAnBA,cACG+F,EAAO,GACJL,EAAI,EAAGA,EAAI1F,MAAgBQ,OAAQkF,IAAK,KAC1CwB,EAAQlH,MAAgB0F,MACzBwB,GAAsB,MAAbA,EAAMhC,SAEdA,EAAMgC,EAAMhC,QACS,IAAvBa,EAAKS,QAAQtB,GAAa,CAC7B5D,QAAQ4C,MACP,8EACyBgB,qFAExB/C,EAAenC,UACRW,EAAcX,UAOxB+F,EAAKjF,KAAKoE,6BF9VP,WACNpF,EAAqB"}
1
+ {"version":3,"file":"debug.umd.js","sources":["../src/check-props.js","../src/component-stack.js","../src/debug.js","../src/constants.js","../src/util.js"],"sourcesContent":["const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nlet loggedTypeFailures = {};\n\n/**\n * Reset the history of which prop type warnings have been logged.\n */\nexport function resetPropWarnings() {\n\tloggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n */\nexport function checkPropTypes(\n\ttypeSpecs,\n\tvalues,\n\tlocation,\n\tcomponentName,\n\tgetStack\n) {\n\tObject.keys(typeSpecs).forEach(typeSpecName => {\n\t\tlet error;\n\t\ttry {\n\t\t\terror = typeSpecs[typeSpecName](\n\t\t\t\tvalues,\n\t\t\t\ttypeSpecName,\n\t\t\t\tcomponentName,\n\t\t\t\tlocation,\n\t\t\t\tnull,\n\t\t\t\tReactPropTypesSecret\n\t\t\t);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\t\tif (error && !(error.message in loggedTypeFailures)) {\n\t\t\tloggedTypeFailures[error.message] = true;\n\t\t\tconsole.error(\n\t\t\t\t`Failed ${location} type: ${error.message}${(getStack &&\n\t\t\t\t\t`\\n${getStack()}`) ||\n\t\t\t\t\t''}`\n\t\t\t);\n\t\t}\n\t});\n}\n","import { options, Fragment } from 'preact';\n\n/**\n * Get human readable name of the component/dom node\n * @param {import('./internal').VNode} vnode\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getDisplayName(vnode) {\n\tif (vnode.type === Fragment) {\n\t\treturn 'Fragment';\n\t} else if (typeof vnode.type == 'function') {\n\t\treturn vnode.type.displayName || vnode.type.name;\n\t} else if (typeof vnode.type == 'string') {\n\t\treturn vnode.type;\n\t}\n\n\treturn '#text';\n}\n\n/**\n * Used to keep track of the currently rendered `vnode` and print it\n * in debug messages.\n */\nlet renderStack = [];\n\n/**\n * Keep track of the current owners. An owner describes a component\n * which was responsible to render a specific `vnode`. This exclude\n * children that are passed via `props.children`, because they belong\n * to the parent owner.\n *\n * ```jsx\n * const Foo = props => <div>{props.children}</div> // div's owner is Foo\n * const Bar = props => {\n * return (\n * <Foo><span /></Foo> // Foo's owner is Bar, span's owner is Bar\n * )\n * }\n * ```\n *\n * Note: A `vnode` may be hoisted to the root scope due to compiler\n * optimiztions. In these cases the `_owner` will be different.\n */\nlet ownerStack = [];\n\n/**\n * Get the currently rendered `vnode`\n * @returns {import('./internal').VNode | null}\n */\nexport function getCurrentVNode() {\n\treturn renderStack.length > 0 ? renderStack[renderStack.length - 1] : null;\n}\n\n/**\n * If the user doesn't have `@babel/plugin-transform-react-jsx-source`\n * somewhere in his tool chain we can't print the filename and source\n * location of a component. In that case we just omit that, but we'll\n * print a helpful message to the console, notifying the user of it.\n */\nlet hasBabelPlugin = false;\n\n/**\n * Check if a `vnode` is a possible owner.\n * @param {import('./internal').VNode} vnode\n */\nfunction isPossibleOwner(vnode) {\n\treturn typeof vnode.type == 'function' && vnode.type != Fragment;\n}\n\n/**\n * Return the component stack that was captured up to this point.\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function getOwnerStack(vnode) {\n\tconst stack = [vnode];\n\tlet next = vnode;\n\twhile (next._owner != null) {\n\t\tstack.push(next._owner);\n\t\tnext = next._owner;\n\t}\n\n\treturn stack.reduce((acc, owner) => {\n\t\tacc += ` in ${getDisplayName(owner)}`;\n\n\t\tconst source = owner.__source;\n\t\tif (source) {\n\t\t\tacc += ` (at ${source.fileName}:${source.lineNumber})`;\n\t\t} else if (!hasBabelPlugin) {\n\t\t\thasBabelPlugin = true;\n\t\t\tconsole.warn(\n\t\t\t\t'Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.'\n\t\t\t);\n\t\t}\n\n\t\treturn (acc += '\\n');\n\t}, '');\n}\n\n/**\n * Setup code to capture the component trace while rendering. Note that\n * we cannot simply traverse `vnode._parent` upwards, because we have some\n * debug messages for `this.setState` where the `vnode` is `undefined`.\n */\nexport function setupComponentStack() {\n\tlet oldDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldRoot = options._root;\n\tlet oldVNode = options.vnode;\n\tlet oldRender = options._render;\n\n\toptions.diffed = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.pop();\n\t\t}\n\t\trenderStack.pop();\n\t\tif (oldDiffed) oldDiffed(vnode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\trenderStack.push(vnode);\n\t\t}\n\t\tif (oldDiff) oldDiff(vnode);\n\t};\n\n\toptions._root = (vnode, parent) => {\n\t\townerStack = [];\n\t\tif (oldRoot) oldRoot(vnode, parent);\n\t};\n\n\toptions.vnode = vnode => {\n\t\tvnode._owner =\n\t\t\townerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;\n\t\tif (oldVNode) oldVNode(vnode);\n\t};\n\n\toptions._render = vnode => {\n\t\tif (isPossibleOwner(vnode)) {\n\t\t\townerStack.push(vnode);\n\t\t}\n\n\t\tif (oldRender) oldRender(vnode);\n\t};\n}\n","import { checkPropTypes } from './check-props';\nimport { options, Component } from 'preact';\nimport {\n\tELEMENT_NODE,\n\tDOCUMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE\n} from './constants';\nimport {\n\tgetOwnerStack,\n\tsetupComponentStack,\n\tgetCurrentVNode,\n\tgetDisplayName\n} from './component-stack';\nimport { assign } from './util';\n\nconst isWeakMapSupported = typeof WeakMap == 'function';\n\nfunction getClosestDomNodeParent(parent) {\n\tif (!parent) return {};\n\tif (typeof parent.type == 'function') {\n\t\treturn getClosestDomNodeParent(parent._parent);\n\t}\n\treturn parent;\n}\n\nexport function initDebug() {\n\tsetupComponentStack();\n\n\tlet hooksAllowed = false;\n\n\t/* eslint-disable no-console */\n\tlet oldBeforeDiff = options._diff;\n\tlet oldDiffed = options.diffed;\n\tlet oldVnode = options.vnode;\n\tlet oldCatchError = options._catchError;\n\tlet oldRoot = options._root;\n\tlet oldHook = options._hook;\n\tconst warnedComponents = !isWeakMapSupported\n\t\t? null\n\t\t: {\n\t\t\t\tuseEffect: new WeakMap(),\n\t\t\t\tuseLayoutEffect: new WeakMap(),\n\t\t\t\tlazyPropTypes: new WeakMap()\n\t\t };\n\tconst deprecations = [];\n\n\toptions._catchError = (error, vnode, oldVNode) => {\n\t\tlet component = vnode && vnode._component;\n\t\tif (component && typeof error.then == 'function') {\n\t\t\tconst promise = error;\n\t\t\terror = new Error(\n\t\t\t\t`Missing Suspense. The throwing component was: ${getDisplayName(vnode)}`\n\t\t\t);\n\n\t\t\tlet parent = vnode;\n\t\t\tfor (; parent; parent = parent._parent) {\n\t\t\t\tif (parent._component && parent._component._childDidSuspend) {\n\t\t\t\t\terror = promise;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We haven't recovered and we know at this point that there is no\n\t\t\t// Suspense component higher up in the tree\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\toldCatchError(error, vnode, oldVNode);\n\n\t\t\t// when an error was handled by an ErrorBoundary we will nontheless emit an error\n\t\t\t// event on the window object. This is to make up for react compatibility in dev mode\n\t\t\t// and thus make the Next.js dev overlay work.\n\t\t\tif (typeof error.then != 'function') {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthrow e;\n\t\t}\n\t};\n\n\toptions._root = (vnode, parentNode) => {\n\t\tif (!parentNode) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined parent passed to render(), this is the second argument.\\n' +\n\t\t\t\t\t'Check if the element is available in the DOM/has the correct id.'\n\t\t\t);\n\t\t}\n\n\t\tlet isValid;\n\t\tswitch (parentNode.nodeType) {\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tcase DOCUMENT_NODE:\n\t\t\t\tisValid = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tisValid = false;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\tlet componentName = getDisplayName(vnode);\n\t\t\tthrow new Error(\n\t\t\t\t`Expected a valid HTML node as a second argument to render.\tReceived ${parentNode} instead: render(<${componentName} />, ${parentNode});`\n\t\t\t);\n\t\t}\n\n\t\tif (oldRoot) oldRoot(vnode, parentNode);\n\t};\n\n\toptions._diff = vnode => {\n\t\tlet { type, _parent: parent } = vnode;\n\t\tlet parentVNode = getClosestDomNodeParent(parent);\n\n\t\thooksAllowed = true;\n\n\t\tif (type === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t'Undefined component passed to createElement()\\n\\n' +\n\t\t\t\t\t'You likely forgot to export your component or might have mixed up default and named imports' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type != null && typeof type == 'object') {\n\t\t\tif (type._children !== undefined && type._dom !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid type passed to createElement(): ${type}\\n\\n` +\n\t\t\t\t\t\t'Did you accidentally pass a JSX literal as JSX twice?\\n\\n' +\n\t\t\t\t\t\t` let My${getDisplayName(vnode)} = ${serializeVNode(type)};\\n` +\n\t\t\t\t\t\t` let vnode = <My${getDisplayName(vnode)} />;\\n\\n` +\n\t\t\t\t\t\t'This usually happens when you export a JSX literal and not the component.' +\n\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t'Invalid type passed to createElement(): ' +\n\t\t\t\t\t(Array.isArray(type) ? 'array' : type)\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t(type === 'thead' || type === 'tfoot' || type === 'tbody') &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (\n\t\t\ttype === 'tr' &&\n\t\t\tparentVNode.type !== 'thead' &&\n\t\t\tparentVNode.type !== 'tfoot' &&\n\t\t\tparentVNode.type !== 'tbody' &&\n\t\t\tparentVNode.type !== 'table'\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'td' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <td> should have a <tr> parent.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t} else if (type === 'th' && parentVNode.type !== 'tr') {\n\t\t\tconsole.error(\n\t\t\t\t'Improper nesting of table. Your <th> should have a <tr>.' +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\tvnode.ref !== undefined &&\n\t\t\ttypeof vnode.ref != 'function' &&\n\t\t\ttypeof vnode.ref != 'object' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function, or an object created ` +\n\t\t\t\t\t`by createRef(), but got [${typeof vnode.ref}] instead\\n` +\n\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t);\n\t\t}\n\n\t\tif (typeof vnode.type == 'string') {\n\t\t\tfor (const key in vnode.props) {\n\t\t\t\tif (\n\t\t\t\t\tkey[0] === 'o' &&\n\t\t\t\t\tkey[1] === 'n' &&\n\t\t\t\t\ttypeof vnode.props[key] != 'function' &&\n\t\t\t\t\tvnode.props[key] != null\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Component's \"${key}\" property should be a function, ` +\n\t\t\t\t\t\t\t`but got [${typeof vnode.props[key]}] instead\\n` +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check prop-types if available\n\t\tif (typeof vnode.type == 'function' && vnode.type.propTypes) {\n\t\t\tif (\n\t\t\t\tvnode.type.displayName === 'Lazy' &&\n\t\t\t\twarnedComponents &&\n\t\t\t\t!warnedComponents.lazyPropTypes.has(vnode.type)\n\t\t\t) {\n\t\t\t\tconst m =\n\t\t\t\t\t'PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ';\n\t\t\t\ttry {\n\t\t\t\t\tconst lazyVNode = vnode.type();\n\t\t\t\t\twarnedComponents.lazyPropTypes.set(vnode.type, true);\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + `Component wrapped in lazy() is ${getDisplayName(lazyVNode)}`\n\t\t\t\t\t);\n\t\t\t\t} catch (promise) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\tm + \"We will log the wrapped component's name once it is loaded.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet values = vnode.props;\n\t\t\tif (vnode.type._forwarded) {\n\t\t\t\tvalues = assign({}, values);\n\t\t\t\tdelete values.ref;\n\t\t\t}\n\n\t\t\tcheckPropTypes(\n\t\t\t\tvnode.type.propTypes,\n\t\t\t\tvalues,\n\t\t\t\t'prop',\n\t\t\t\tgetDisplayName(vnode),\n\t\t\t\t() => getOwnerStack(vnode)\n\t\t\t);\n\t\t}\n\n\t\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n\t};\n\n\toptions._hook = (comp, index, type) => {\n\t\tif (!comp || !hooksAllowed) {\n\t\t\tthrow new Error('Hook can only be invoked from render methods.');\n\t\t}\n\n\t\tif (oldHook) oldHook(comp, index, type);\n\t};\n\n\t// Ideally we'd want to print a warning once per component, but we\n\t// don't have access to the vnode that triggered it here. As a\n\t// compromise and to avoid flooding the console with warnings we\n\t// print each deprecation warning only once.\n\tconst warn = (property, message) => ({\n\t\tget() {\n\t\t\tconst key = 'get' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`getting vnode.${property} is deprecated, ${message}`);\n\t\t\t}\n\t\t},\n\t\tset() {\n\t\t\tconst key = 'set' + property + message;\n\t\t\tif (deprecations && deprecations.indexOf(key) < 0) {\n\t\t\t\tdeprecations.push(key);\n\t\t\t\tconsole.warn(`setting vnode.${property} is not allowed, ${message}`);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst deprecatedAttributes = {\n\t\tnodeName: warn('nodeName', 'use vnode.type'),\n\t\tattributes: warn('attributes', 'use vnode.props'),\n\t\tchildren: warn('children', 'use vnode.props.children')\n\t};\n\n\tconst deprecatedProto = Object.create({}, deprecatedAttributes);\n\n\toptions.vnode = vnode => {\n\t\tconst props = vnode.props;\n\t\tif (\n\t\t\tvnode.type !== null &&\n\t\t\tprops != null &&\n\t\t\t('__source' in props || '__self' in props)\n\t\t) {\n\t\t\tconst newProps = (vnode.props = {});\n\t\t\tfor (let i in props) {\n\t\t\t\tconst v = props[i];\n\t\t\t\tif (i === '__source') vnode.__source = v;\n\t\t\t\telse if (i === '__self') vnode.__self = v;\n\t\t\t\telse newProps[i] = v;\n\t\t\t}\n\t\t}\n\n\t\t// eslint-disable-next-line\n\t\tvnode.__proto__ = deprecatedProto;\n\t\tif (oldVnode) oldVnode(vnode);\n\t};\n\n\toptions.diffed = vnode => {\n\t\t// Check if the user passed plain objects as children. Note that we cannot\n\t\t// move this check into `options.vnode` because components can receive\n\t\t// children in any shape they want (e.g.\n\t\t// `<MyJSONFormatter>{{ foo: 123, bar: \"abc\" }}</MyJSONFormatter>`).\n\t\t// Putting this check in `options.diffed` ensures that\n\t\t// `vnode._children` is set and that we only validate the children\n\t\t// that were actually rendered.\n\t\tif (vnode._children) {\n\t\t\tvnode._children.forEach(child => {\n\t\t\t\tif (child && child.type === undefined) {\n\t\t\t\t\t// Remove internal vnode keys that will always be patched\n\t\t\t\t\tdelete child._parent;\n\t\t\t\t\tdelete child._depth;\n\t\t\t\t\tconst keys = Object.keys(child).join(',');\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Objects are not valid as a child. Encountered an object with the keys {${keys}}.` +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\thooksAllowed = false;\n\n\t\tif (oldDiffed) oldDiffed(vnode);\n\n\t\tif (vnode._children != null) {\n\t\t\tconst keys = [];\n\t\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\t\tconst child = vnode._children[i];\n\t\t\t\tif (!child || child.key == null) continue;\n\n\t\t\t\tconst key = child.key;\n\t\t\t\tif (keys.indexOf(key) !== -1) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t\t`same key attribute: \"${key}\". This may cause glitches and misbehavior ` +\n\t\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\t\tserializeVNode(vnode) +\n\t\t\t\t\t\t\t`\\n\\n${getOwnerStack(vnode)}`\n\t\t\t\t\t);\n\n\t\t\t\t\t// Break early to not spam the console\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tkeys.push(key);\n\t\t\t}\n\t\t}\n\t};\n}\n\nconst setState = Component.prototype.setState;\nComponent.prototype.setState = function(update, callback) {\n\tif (this._vnode == null) {\n\t\t// `this._vnode` will be `null` during componentWillMount. But it\n\t\t// is perfectly valid to call `setState` during cWM. So we\n\t\t// need an additional check to verify that we are dealing with a\n\t\t// call inside constructor.\n\t\tif (this.state == null) {\n\t\t\tconsole.warn(\n\t\t\t\t`Calling \"this.setState\" inside the constructor of a component is a ` +\n\t\t\t\t\t`no-op and might be a bug in your application. Instead, set ` +\n\t\t\t\t\t`\"this.state = {}\" directly.\\n\\n${getOwnerStack(getCurrentVNode())}`\n\t\t\t);\n\t\t}\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.setState\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\n\treturn setState.call(this, update, callback);\n};\n\nconst forceUpdate = Component.prototype.forceUpdate;\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode == null) {\n\t\tconsole.warn(\n\t\t\t`Calling \"this.forceUpdate\" inside the constructor of a component is a ` +\n\t\t\t\t`no-op and might be a bug in your application.\\n\\n${getOwnerStack(\n\t\t\t\t\tgetCurrentVNode()\n\t\t\t\t)}`\n\t\t);\n\t} else if (this._parentDom == null) {\n\t\tconsole.warn(\n\t\t\t`Can't call \"this.forceUpdate\" on an unmounted component. This is a no-op, ` +\n\t\t\t\t`but it indicates a memory leak in your application. To fix, cancel all ` +\n\t\t\t\t`subscriptions and asynchronous tasks in the componentWillUnmount method.` +\n\t\t\t\t`\\n\\n${getOwnerStack(this._vnode)}`\n\t\t);\n\t}\n\treturn forceUpdate.call(this, callback);\n};\n\n/**\n * Serialize a vnode tree to a string\n * @param {import('./internal').VNode} vnode\n * @returns {string}\n */\nexport function serializeVNode(vnode) {\n\tlet { props } = vnode;\n\tlet name = getDisplayName(vnode);\n\n\tlet attrs = '';\n\tfor (let prop in props) {\n\t\tif (props.hasOwnProperty(prop) && prop !== 'children') {\n\t\t\tlet value = props[prop];\n\n\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\tif (typeof value == 'function') {\n\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t}\n\n\t\t\tvalue =\n\t\t\t\tObject(value) === value && !value.toString\n\t\t\t\t\t? Object.prototype.toString.call(value)\n\t\t\t\t\t: value + '';\n\n\t\t\tattrs += ` ${prop}=${JSON.stringify(value)}`;\n\t\t}\n\t}\n\n\tlet children = props.children;\n\treturn `<${name}${attrs}${\n\t\tchildren && children.length ? '>..</' + name + '>' : ' />'\n\t}`;\n}\n","export const ELEMENT_NODE = 1;\nexport const DOCUMENT_NODE = 9;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n"],"names":["loggedTypeFailures","getDisplayName","vnode","type","Fragment","displayName","name","renderStack","ownerStack","getCurrentVNode","length","hasBabelPlugin","isPossibleOwner","getOwnerStack","stack","next","push","reduce","acc","owner","source","__source","fileName","lineNumber","console","warn","isWeakMapSupported","WeakMap","setState","Component","prototype","update","callback","this","state","call","forceUpdate","serializeVNode","props","attrs","prop","hasOwnProperty","value","Object","toString","JSON","stringify","children","oldDiff","options","oldDiffed","diffed","oldRoot","oldVNode","oldRender","pop","parent","setupComponentStack","hooksAllowed","oldBeforeDiff","oldVnode","oldCatchError","oldHook","warnedComponents","useEffect","useLayoutEffect","lazyPropTypes","deprecations","error","then","promise","Error","setTimeout","e","parentNode","isValid","nodeType","componentName","parentVNode","getClosestDomNodeParent","undefined","Array","isArray","ref","key","propTypes","has","m","lazyVNode","set","values","obj","i","assign","typeSpecs","location","getStack","keys","forEach","typeSpecName","message","checkPropTypes","comp","index","property","get","indexOf","deprecatedAttributes","nodeName","attributes","deprecatedProto","create","newProps","v","__self","__proto__","child","join"],"mappings":"oQAAA,IAEIA,EAAqB,GCMlB,SAASC,EAAeC,UAC1BA,EAAMC,OAASC,WACX,WACwB,mBAAdF,EAAMC,KAChBD,EAAMC,KAAKE,aAAeH,EAAMC,KAAKG,KACb,iBAAdJ,EAAMC,KAChBD,EAAMC,KAGP,QAOR,IAAII,EAAc,GAoBdC,EAAa,GAMV,SAASC,WACRF,EAAYG,OAAS,EAAIH,EAAYA,EAAYG,OAAS,GAAK,KASvE,IAAIC,GAAiB,EAMrB,SAASC,EAAgBV,SACI,mBAAdA,EAAMC,MAAsBD,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ACP,8EACyBgB,qFAExB/C,EAAenC,UACRW,EAAcX,UAOxB+F,EAAKjF,KAAKoE,6BF9VP,WACNpF,EAAqB"}
@@ -1,18 +1,18 @@
1
- {
2
- "name": "preact-debug",
3
- "amdName": "preactDebug",
4
- "version": "1.0.0",
5
- "private": true,
6
- "description": "Preact extensions for development",
7
- "main": "dist/debug.js",
8
- "module": "dist/debug.module.js",
9
- "umd:main": "dist/debug.umd.js",
10
- "source": "src/index.js",
11
- "license": "MIT",
12
- "mangle": {
13
- "regex": "^(?!_renderer)^_"
14
- },
15
- "peerDependencies": {
16
- "preact": "^10.0.0"
17
- }
18
- }
1
+ {
2
+ "name": "preact-debug",
3
+ "amdName": "preactDebug",
4
+ "version": "1.0.0",
5
+ "private": true,
6
+ "description": "Preact extensions for development",
7
+ "main": "dist/debug.js",
8
+ "module": "dist/debug.module.js",
9
+ "umd:main": "dist/debug.umd.js",
10
+ "source": "src/index.js",
11
+ "license": "MIT",
12
+ "mangle": {
13
+ "regex": "^(?!_renderer)^_"
14
+ },
15
+ "peerDependencies": {
16
+ "preact": "^10.0.0"
17
+ }
18
+ }
@@ -1,54 +1,54 @@
1
- const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2
-
3
- let loggedTypeFailures = {};
4
-
5
- /**
6
- * Reset the history of which prop type warnings have been logged.
7
- */
8
- export function resetPropWarnings() {
9
- loggedTypeFailures = {};
10
- }
11
-
12
- /**
13
- * Assert that the values match with the type specs.
14
- * Error messages are memorized and will only be shown once.
15
- *
16
- * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js
17
- *
18
- * @param {object} typeSpecs Map of name to a ReactPropType
19
- * @param {object} values Runtime values that need to be type-checked
20
- * @param {string} location e.g. "prop", "context", "child context"
21
- * @param {string} componentName Name of the component for error messages.
22
- * @param {?Function} getStack Returns the component stack.
23
- */
24
- export function checkPropTypes(
25
- typeSpecs,
26
- values,
27
- location,
28
- componentName,
29
- getStack
30
- ) {
31
- Object.keys(typeSpecs).forEach(typeSpecName => {
32
- let error;
33
- try {
34
- error = typeSpecs[typeSpecName](
35
- values,
36
- typeSpecName,
37
- componentName,
38
- location,
39
- null,
40
- ReactPropTypesSecret
41
- );
42
- } catch (e) {
43
- error = e;
44
- }
45
- if (error && !(error.message in loggedTypeFailures)) {
46
- loggedTypeFailures[error.message] = true;
47
- console.error(
48
- `Failed ${location} type: ${error.message}${(getStack &&
49
- `\n${getStack()}`) ||
50
- ''}`
51
- );
52
- }
53
- });
54
- }
1
+ const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2
+
3
+ let loggedTypeFailures = {};
4
+
5
+ /**
6
+ * Reset the history of which prop type warnings have been logged.
7
+ */
8
+ export function resetPropWarnings() {
9
+ loggedTypeFailures = {};
10
+ }
11
+
12
+ /**
13
+ * Assert that the values match with the type specs.
14
+ * Error messages are memorized and will only be shown once.
15
+ *
16
+ * Adapted from https://github.com/facebook/prop-types/blob/master/checkPropTypes.js
17
+ *
18
+ * @param {object} typeSpecs Map of name to a ReactPropType
19
+ * @param {object} values Runtime values that need to be type-checked
20
+ * @param {string} location e.g. "prop", "context", "child context"
21
+ * @param {string} componentName Name of the component for error messages.
22
+ * @param {?Function} getStack Returns the component stack.
23
+ */
24
+ export function checkPropTypes(
25
+ typeSpecs,
26
+ values,
27
+ location,
28
+ componentName,
29
+ getStack
30
+ ) {
31
+ Object.keys(typeSpecs).forEach(typeSpecName => {
32
+ let error;
33
+ try {
34
+ error = typeSpecs[typeSpecName](
35
+ values,
36
+ typeSpecName,
37
+ componentName,
38
+ location,
39
+ null,
40
+ ReactPropTypesSecret
41
+ );
42
+ } catch (e) {
43
+ error = e;
44
+ }
45
+ if (error && !(error.message in loggedTypeFailures)) {
46
+ loggedTypeFailures[error.message] = true;
47
+ console.error(
48
+ `Failed ${location} type: ${error.message}${(getStack &&
49
+ `\n${getStack()}`) ||
50
+ ''}`
51
+ );
52
+ }
53
+ });
54
+ }