{"version":3,"sources":["jsdelivr-header.js","/npm/react-lifecycles-compat@3.0.4/react-lifecycles-compat.cjs.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAWA,SAAS,qBAEP,IAAI,EAAQ,KAAK,YAAY,yBAAyB,KAAK,MAAO,KAAK,OACnE,SACF,KAAK,SAAS,EAElB,CAEA,SAAS,0BAA0B,GAQjC,KAAK,SALL,SAAiB,GACf,IAAI,EAAQ,KAAK,YAAY,yBAAyB,EAAW,GACjE,OAAO,QAAwC,EAAQ,IACzD,EAEsB,KAAK,MAC7B,CAEA,SAAS,oBAAoB,EAAW,GACtC,IACE,IAAI,EAAY,KAAK,MACjB,EAAY,KAAK,MACrB,KAAK,MAAQ,EACb,KAAK,MAAQ,EACb,KAAK,6BAA8B,EACnC,KAAK,wBAA0B,KAAK,wBAClC,EACA,EAEJ,CAAE,QACA,KAAK,MAAQ,EACb,KAAK,MAAQ,CACf,CACF,CAQA,SAAS,SAAS,GAChB,IAAI,EAAY,EAAU,UAE1B,IAAK,IAAc,EAAU,iBAC3B,MAAM,IAAI,MAAM,sCAGlB,GACgD,mBAAvC,EAAU,0BAC4B,mBAAtC,EAAU,wBAEjB,OAAO,EAMT,IAAI,EAAqB,KACrB,EAA4B,KAC5B,EAAsB,KAgB1B,GAf4C,mBAAjC,EAAU,mBACnB,EAAqB,qBACmC,mBAAxC,EAAU,4BAC1B,EAAqB,6BAE4B,mBAAxC,EAAU,0BACnB,EAA4B,4BACmC,mBAA/C,EAAU,mCAC1B,EAA4B,oCAEe,mBAAlC,EAAU,oBACnB,EAAsB,sBACmC,mBAAzC,EAAU,6BAC1B,EAAsB,8BAGC,OAAvB,GAC8B,OAA9B,GACwB,OAAxB,EACA,CACA,IAAI,EAAgB,EAAU,aAAe,EAAU,KACnD,EAC4C,mBAAvC,EAAU,yBACb,6BACA,4BAEN,MAAM,MACJ,2FACE,EACA,SACA,EACA,uDACwB,OAAvB,EAA8B,OAAS,EAAqB,KAC9B,OAA9B,EACG,OAAS,EACT,KACqB,OAAxB,EAA+B,OAAS,EAAsB,IATjE,uIAaJ,CAaA,GARkD,mBAAvC,EAAU,2BACnB,EAAU,mBAAqB,mBAC/B,EAAU,0BAA4B,2BAMS,mBAAtC,EAAU,wBAAwC,CAC3D,GAA4C,mBAAjC,EAAU,mBACnB,MAAM,IAAI,MACR,qHAIJ,EAAU,oBAAsB,oBAEhC,IAAI,EAAqB,EAAU,mBAEnC,EAAU,mBAAqB,SAC7B,EACA,EACA,GAUA,IAAI,EAAW,KAAK,4BAChB,KAAK,wBACL,EAEJ,EAAmB,KAAK,KAAM,EAAW,EAAW,EACtD,CACF,CAEA,OAAO,CACT,CA7JA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IA+CtD,mBAAmB,8BAA+B,EAClD,0BAA0B,8BAA+B,EACzD,oBAAoB,8BAA+B,EA8GnD,QAAQ,SAAW","file":"/npm/react-lifecycles-compat@3.0.4/react-lifecycles-compat.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-lifecycles-compat@3.0.4/react-lifecycles-compat.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n  // Call this.constructor.gDSFP to support sub-classes.\n  var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n  if (state !== null && state !== undefined) {\n    this.setState(state);\n  }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n  // Call this.constructor.gDSFP to support sub-classes.\n  // Use the setState() updater to ensure state isn't stale in certain edge cases.\n  function updater(prevState) {\n    var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n    return state !== null && state !== undefined ? state : null;\n  }\n  // Binding \"this\" is important for shallow renderer support.\n  this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n  try {\n    var prevProps = this.props;\n    var prevState = this.state;\n    this.props = nextProps;\n    this.state = nextState;\n    this.__reactInternalSnapshotFlag = true;\n    this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n      prevProps,\n      prevState\n    );\n  } finally {\n    this.props = prevProps;\n    this.state = prevState;\n  }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n  var prototype = Component.prototype;\n\n  if (!prototype || !prototype.isReactComponent) {\n    throw new Error('Can only polyfill class components');\n  }\n\n  if (\n    typeof Component.getDerivedStateFromProps !== 'function' &&\n    typeof prototype.getSnapshotBeforeUpdate !== 'function'\n  ) {\n    return Component;\n  }\n\n  // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n  // Error if any of these lifecycles are present,\n  // Because they would work differently between older and newer (16.3+) versions of React.\n  var foundWillMountName = null;\n  var foundWillReceivePropsName = null;\n  var foundWillUpdateName = null;\n  if (typeof prototype.componentWillMount === 'function') {\n    foundWillMountName = 'componentWillMount';\n  } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n    foundWillMountName = 'UNSAFE_componentWillMount';\n  }\n  if (typeof prototype.componentWillReceiveProps === 'function') {\n    foundWillReceivePropsName = 'componentWillReceiveProps';\n  } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n    foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n  }\n  if (typeof prototype.componentWillUpdate === 'function') {\n    foundWillUpdateName = 'componentWillUpdate';\n  } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n    foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n  }\n  if (\n    foundWillMountName !== null ||\n    foundWillReceivePropsName !== null ||\n    foundWillUpdateName !== null\n  ) {\n    var componentName = Component.displayName || Component.name;\n    var newApiName =\n      typeof Component.getDerivedStateFromProps === 'function'\n        ? 'getDerivedStateFromProps()'\n        : 'getSnapshotBeforeUpdate()';\n\n    throw Error(\n      'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n        componentName +\n        ' uses ' +\n        newApiName +\n        ' but also contains the following legacy lifecycles:' +\n        (foundWillMountName !== null ? '\\n  ' + foundWillMountName : '') +\n        (foundWillReceivePropsName !== null\n          ? '\\n  ' + foundWillReceivePropsName\n          : '') +\n        (foundWillUpdateName !== null ? '\\n  ' + foundWillUpdateName : '') +\n        '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n        'https://fb.me/react-async-component-lifecycle-hooks'\n    );\n  }\n\n  // React <= 16.2 does not support static getDerivedStateFromProps.\n  // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n  // Newer versions of React will ignore these lifecycles if gDSFP exists.\n  if (typeof Component.getDerivedStateFromProps === 'function') {\n    prototype.componentWillMount = componentWillMount;\n    prototype.componentWillReceiveProps = componentWillReceiveProps;\n  }\n\n  // React <= 16.2 does not support getSnapshotBeforeUpdate.\n  // As a workaround, use cWU to invoke the new lifecycle.\n  // Newer versions of React will ignore that lifecycle if gSBU exists.\n  if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n    if (typeof prototype.componentDidUpdate !== 'function') {\n      throw new Error(\n        'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n      );\n    }\n\n    prototype.componentWillUpdate = componentWillUpdate;\n\n    var componentDidUpdate = prototype.componentDidUpdate;\n\n    prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n      prevProps,\n      prevState,\n      maybeSnapshot\n    ) {\n      // 16.3+ will not execute our will-update method;\n      // It will pass a snapshot value to did-update though.\n      // Older versions will require our polyfilled will-update value.\n      // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n      // Because for <= 15.x versions this might be a \"prevContext\" object.\n      // We also can't just check \"__reactInternalSnapshot\",\n      // Because get-snapshot might return a falsy value.\n      // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n      var snapshot = this.__reactInternalSnapshotFlag\n        ? this.__reactInternalSnapshot\n        : maybeSnapshot;\n\n      componentDidUpdate.call(this, prevProps, prevState, snapshot);\n    };\n  }\n\n  return Component;\n}\n\nexports.polyfill = polyfill;\n"]}