diff --git a/asset-manifest.json b/asset-manifest.json index 892858f35..978730185 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "/static/css/main.6ef0c5a4.css", - "main.js": "/static/js/main.dda15700.js", + "main.js": "/static/js/main.4ffb1c37.js", "static/css/281.c7b2c18c.chunk.css": "/static/css/281.c7b2c18c.chunk.css", "static/js/281.4df7504b.chunk.js": "/static/js/281.4df7504b.chunk.js", "static/js/113.31e40c6e.chunk.js": "/static/js/113.31e40c6e.chunk.js", @@ -41,7 +41,7 @@ "static/js/996.e499943e.chunk.js": "/static/js/996.e499943e.chunk.js", "static/js/852.6f6cb68f.chunk.js": "/static/js/852.6f6cb68f.chunk.js", "static/js/469.7af4a86a.chunk.js": "/static/js/469.7af4a86a.chunk.js", - "static/js/624.784913d1.chunk.js": "/static/js/624.784913d1.chunk.js", + "static/js/624.8049ee84.chunk.js": "/static/js/624.8049ee84.chunk.js", "static/js/458.f14d221b.chunk.js": "/static/js/458.f14d221b.chunk.js", "static/js/982.61d56819.chunk.js": "/static/js/982.61d56819.chunk.js", "static/js/107.466b97f5.chunk.js": "/static/js/107.466b97f5.chunk.js", @@ -55,7 +55,7 @@ "index.html": "/index.html", "static/media/home.svg": "/static/media/home.7d51f25c64fe597ec540c3e724748f4e.svg", "main.6ef0c5a4.css.map": "/static/css/main.6ef0c5a4.css.map", - "main.dda15700.js.map": "/static/js/main.dda15700.js.map", + "main.4ffb1c37.js.map": "/static/js/main.4ffb1c37.js.map", "281.c7b2c18c.chunk.css.map": "/static/css/281.c7b2c18c.chunk.css.map", "281.4df7504b.chunk.js.map": "/static/js/281.4df7504b.chunk.js.map", "113.31e40c6e.chunk.js.map": "/static/js/113.31e40c6e.chunk.js.map", @@ -95,7 +95,7 @@ "996.e499943e.chunk.js.map": "/static/js/996.e499943e.chunk.js.map", "852.6f6cb68f.chunk.js.map": "/static/js/852.6f6cb68f.chunk.js.map", "469.7af4a86a.chunk.js.map": "/static/js/469.7af4a86a.chunk.js.map", - "624.784913d1.chunk.js.map": "/static/js/624.784913d1.chunk.js.map", + "624.8049ee84.chunk.js.map": "/static/js/624.8049ee84.chunk.js.map", "458.f14d221b.chunk.js.map": "/static/js/458.f14d221b.chunk.js.map", "982.61d56819.chunk.js.map": "/static/js/982.61d56819.chunk.js.map", "107.466b97f5.chunk.js.map": "/static/js/107.466b97f5.chunk.js.map", @@ -110,6 +110,6 @@ "entrypoints": [ "static/js/react-vendor.e1575b27.js", "static/css/main.6ef0c5a4.css", - "static/js/main.dda15700.js" + "static/js/main.4ffb1c37.js" ] } \ No newline at end of file diff --git a/coverage/badges.svg b/coverage/badges.svg index 4354a36ca..90d324f03 100644 --- a/coverage/badges.svg +++ b/coverage/badges.svg @@ -1,20 +1,20 @@ - - coverage: 100% + + coverage: 99.71% - + - - + + \ No newline at end of file diff --git a/coverage/coverage-summary.json b/coverage/coverage-summary.json index 5185d221f..9cfea13b4 100644 --- a/coverage/coverage-summary.json +++ b/coverage/coverage-summary.json @@ -1,4 +1,4 @@ -{"total": {"lines":{"total":657,"covered":657,"skipped":0,"pct":100},"statements":{"total":702,"covered":702,"skipped":0,"pct":100},"functions":{"total":166,"covered":166,"skipped":0,"pct":100},"branches":{"total":637,"covered":625,"skipped":0,"pct":98.11},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} +{"total": {"lines":{"total":661,"covered":660,"skipped":0,"pct":99.84},"statements":{"total":707,"covered":705,"skipped":0,"pct":99.71},"functions":{"total":167,"covered":167,"skipped":0,"pct":100},"branches":{"total":643,"covered":629,"skipped":0,"pct":97.82},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/react-color/react-color/packages/color-alpha/src/Pointer.tsx": {"lines":{"total":4,"covered":4,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":4,"covered":4,"skipped":0,"pct":100},"branches":{"total":4,"covered":4,"skipped":0,"pct":100}} ,"/home/runner/work/react-color/react-color/packages/color-alpha/src/index.tsx": {"lines":{"total":15,"covered":15,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":15,"covered":15,"skipped":0,"pct":100},"branches":{"total":23,"covered":21,"skipped":0,"pct":91.3}} ,"/home/runner/work/react-color/react-color/packages/color-block/src/index.tsx": {"lines":{"total":17,"covered":17,"skipped":0,"pct":100},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":17,"covered":17,"skipped":0,"pct":100},"branches":{"total":17,"covered":17,"skipped":0,"pct":100}} @@ -20,7 +20,7 @@ ,"/home/runner/work/react-color/react-color/packages/color-material/src/index.tsx": {"lines":{"total":18,"covered":18,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":18,"covered":18,"skipped":0,"pct":100},"branches":{"total":20,"covered":20,"skipped":0,"pct":100}} ,"/home/runner/work/react-color/react-color/packages/color-name/src/index.tsx": {"lines":{"total":8,"covered":8,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":8,"covered":8,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/react-color/react-color/packages/color-saturation/src/Pointer.tsx": {"lines":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}} -,"/home/runner/work/react-color/react-color/packages/color-saturation/src/index.tsx": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":10,"covered":8,"skipped":0,"pct":80}} +,"/home/runner/work/react-color/react-color/packages/color-saturation/src/index.tsx": {"lines":{"total":13,"covered":12,"skipped":0,"pct":92.3},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":14,"covered":12,"skipped":0,"pct":85.71},"branches":{"total":16,"covered":12,"skipped":0,"pct":75}} ,"/home/runner/work/react-color/react-color/packages/color-shade-slider/src/index.tsx": {"lines":{"total":6,"covered":6,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":6,"covered":6,"skipped":0,"pct":100},"branches":{"total":10,"covered":10,"skipped":0,"pct":100}} ,"/home/runner/work/react-color/react-color/packages/color-sketch/src/index.tsx": {"lines":{"total":30,"covered":30,"skipped":0,"pct":100},"functions":{"total":12,"covered":12,"skipped":0,"pct":100},"statements":{"total":32,"covered":32,"skipped":0,"pct":100},"branches":{"total":31,"covered":30,"skipped":0,"pct":96.77}} ,"/home/runner/work/react-color/react-color/packages/color-slider/src/index.tsx": {"lines":{"total":12,"covered":12,"skipped":0,"pct":100},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":12,"covered":12,"skipped":0,"pct":100},"branches":{"total":14,"covered":14,"skipped":0,"pct":100}} diff --git a/coverage/lcov-report/color-alpha/src/Pointer.tsx.html b/coverage/lcov-report/color-alpha/src/Pointer.tsx.html index 6f62ea69b..5ded8cf2d 100644 --- a/coverage/lcov-report/color-alpha/src/Pointer.tsx.html +++ b/coverage/lcov-report/color-alpha/src/Pointer.tsx.html @@ -163,7 +163,7 @@

All files / color-alpha/
\ No newline at end of file +Color picker component for React.
\ No newline at end of file diff --git a/static/js/624.784913d1.chunk.js b/static/js/624.784913d1.chunk.js deleted file mode 100644 index f5eb4a8de..000000000 --- a/static/js/624.784913d1.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[624],{4624:function(e,t,r){r.r(t),t.default={components:{20:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,n=function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!==typeof t)return{default:t};var n=a(r);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var c=i?Object.getOwnPropertyDescriptor(t,u):null;c&&(c.get||c.set)?Object.defineProperty(o,u,c):o[u]=t[u]}o.default=t,n&&n.set(t,o);return o}(r(8573)),o=(t=r(6319))&&t.__esModule?t:{default:t};function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function Demo() {\n var _useState = (0, _react.useState)({\n h: 0,\n s: 0,\n v: 68,\n a: 1\n }),\n _useState2 = _slicedToArray(_useState, 2),\n hsva = _useState2[0],\n setHsva = _useState2[1];\n return /*#__PURE__*/_react["default"].createElement(_reactColorSaturation["default"], {\n hsva: hsva,\n onChange: function onChange(newColor) {\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\n a: hsva.a\n }));\n }\n });\n};',language:"jsx",value:"import React, { useState } from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\n return (\n {\n setHsva({ ...hsva, ...newColor, a: hsva.a });\n }}\n />\n );\n}"}},source:"React Color Saturation\n===\n\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-color-saturation)](https://bundlephobia.com/package/@uiw/react-color-saturation) [![npm version](https://img.shields.io/npm/v/@uiw/react-color-saturation.svg)](https://www.npmjs.com/package/@uiw/react-color-saturation) [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-color-saturation/file/README.md)\n\nSaturation Component is a subcomponent of [**`@react-color`**](https://uiwjs.github.io/react-color).\n\n\x3c!--rehype:ignore:start--\x3e\n[![react-color-saturation](https://user-images.githubusercontent.com/1680273/125951532-ee5bb5df-1d1f-43ed-a4be-e7e8818bf897.png)](https://uiwjs.github.io/react-color/#/saturation)\n\x3c!--rehype:ignore:end--\x3e\n\n## Install\n\n```bash\nnpm i @uiw/react-color-saturation\n```\n\n## Usage\n\n```jsx mdx:preview\nimport React, { useState } from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\n return (\n {\n setHsva({ ...hsva, ...newColor, a: hsva.a });\n }}\n />\n );\n}\n```\n\n## Props\n\n```ts\nimport React from 'react';\nimport { HsvaColor } from '@uiw/color-convert';\nimport { PointerProps } from './Pointer';\nexport interface SaturationProps extends Omit, 'onChange'> {\n prefixCls?: string;\n /** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */\n hsva: HsvaColor;\n radius?: React.CSSProperties['borderRadius'];\n /** React Component, Custom pointer component */\n pointer?: ({ prefixCls, left, top, color }: PointerProps) => JSX.Element;\n onChange?: (newColor: HsvaColor) => void;\n}\ndeclare const Saturation: React.ForwardRefExoticComponent>;\nexport default Saturation;\n```\n\n\x3c!--footer-dividing--\x3e\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\n \n\n\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nLicensed under the MIT License.\n",headings:[]}}}]); -//# sourceMappingURL=624.784913d1.chunk.js.map \ No newline at end of file diff --git a/static/js/624.784913d1.chunk.js.map b/static/js/624.784913d1.chunk.js.map deleted file mode 100644 index 33579f653..000000000 --- a/static/js/624.784913d1.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"static/js/624.784913d1.chunk.js","mappings":"8GACA,WACIA,WAAY,CAAE,GAAI,WAEtB,SAASC,EAAQC,GAAgC,OAAOD,EAAU,mBAAqBE,QAAU,iBAAmBA,OAAOC,SAAW,SAAUF,GAAK,cAAcA,CAAG,EAAI,SAAUA,GAAK,OAAOA,GAAK,mBAAqBC,QAAUD,EAAEG,cAAgBF,QAAUD,IAAMC,OAAOG,UAAY,gBAAkBJ,CAAG,EAAGD,EAAQC,EAAI,CAC7T,IAEgCK,EAF5BC,EAIJ,SAAiCD,EAAKE,GAAe,IAAKA,GAAeF,GAAOA,EAAIG,WAAc,OAAOH,EAAO,GAAY,OAARA,GAAiC,WAAjBN,EAAQM,IAAoC,oBAARA,EAAsB,MAAO,CAAE,QAAWA,GAAS,IAAII,EAAQC,EAAyBH,GAAc,GAAIE,GAASA,EAAME,IAAIN,GAAQ,OAAOI,EAAMG,IAAIP,GAAQ,IAAIQ,EAAS,CAAC,EAAOC,EAAwBC,OAAOC,gBAAkBD,OAAOE,yBAA0B,IAAK,IAAIC,KAAOb,EAAO,GAAY,YAARa,GAAqBH,OAAOX,UAAUe,eAAeC,KAAKf,EAAKa,GAAM,CAAE,IAAIG,EAAOP,EAAwBC,OAAOE,yBAAyBZ,EAAKa,GAAO,KAAUG,IAASA,EAAKT,KAAOS,EAAKC,KAAQP,OAAOC,eAAeH,EAAQK,EAAKG,GAAgBR,EAAOK,GAAOb,EAAIa,EAAQ,CAAIL,EAAgB,QAAIR,EAASI,GAASA,EAAMa,IAAIjB,EAAKQ,GAAW,OAAOA,CAAQ,CAJ7xBU,CAAwB,EAAQ,OACzCC,GAC4BnB,EADmB,EAAQ,QACNA,EAAIG,WAAaH,EAAM,CAAE,QAAWA,GACzF,SAASK,EAAyBH,GAAe,GAAuB,oBAAZkB,QAAwB,OAAO,KAAM,IAAIC,EAAoB,IAAID,QAAeE,EAAmB,IAAIF,QAAW,OAAQf,EAA2B,SAAkCH,GAAe,OAAOA,EAAcoB,EAAmBD,CAAmB,GAAGnB,EAAc,CAE9U,SAASqB,EAAQC,EAAGC,GAAK,IAAIC,EAAIhB,OAAOiB,KAAKH,GAAI,GAAId,OAAOkB,sBAAuB,CAAE,IAAIjC,EAAIe,OAAOkB,sBAAsBJ,GAAIC,IAAM9B,EAAIA,EAAEkC,QAAO,SAAUJ,GAAK,OAAOf,OAAOE,yBAAyBY,EAAGC,GAAGK,UAAY,KAAKJ,EAAEK,KAAKC,MAAMN,EAAG/B,EAAI,CAAE,OAAO+B,CAAG,CAC9P,SAASO,EAAcT,GAAK,IAAK,IAAIC,EAAI,EAAGA,EAAIS,UAAUC,OAAQV,IAAK,CAAE,IAAIC,EAAI,MAAQQ,UAAUT,GAAKS,UAAUT,GAAK,CAAC,EAAGA,EAAI,EAAIF,EAAQb,OAAOgB,IAAI,GAAIU,SAAQ,SAAUX,GAAKY,EAAgBb,EAAGC,EAAGC,EAAED,GAAK,IAAKf,OAAO4B,0BAA4B5B,OAAO6B,iBAAiBf,EAAGd,OAAO4B,0BAA0BZ,IAAMH,EAAQb,OAAOgB,IAAIU,SAAQ,SAAUX,GAAKf,OAAOC,eAAea,EAAGC,EAAGf,OAAOE,yBAAyBc,EAAGD,GAAK,GAAI,CAAE,OAAOD,CAAG,CACtb,SAASa,EAAgBrC,EAAKa,EAAK2B,GAA4L,OAAnL3B,EAC5C,SAAwB4B,GAAO,IAAI5B,EACnC,SAAsB6B,EAAOC,GAAQ,GAAuB,WAAnBjD,EAAQgD,IAAiC,OAAVA,EAAgB,OAAOA,EAAO,IAAIE,EAAOF,EAAM9C,OAAOiD,aAAc,QAAaC,IAATF,EAAoB,CAAE,IAAIG,EAAMH,EAAK7B,KAAK2B,EAAOC,GAAQ,WAAY,GAAqB,WAAjBjD,EAAQqD,GAAmB,OAAOA,EAAK,MAAM,IAAIC,UAAU,+CAAiD,CAAE,OAAiB,WAATL,EAAoBM,OAASC,QAAQR,EAAQ,CADnVS,CAAaV,EAAK,UAAW,MAAwB,WAAjB/C,EAAQmB,GAAoBA,EAAMoC,OAAOpC,EAAM,CAD1EuC,CAAevC,MAAiBb,EAAOU,OAAOC,eAAeX,EAAKa,EAAK,CAAE2B,MAAOA,EAAOV,YAAY,EAAMuB,cAAc,EAAMC,UAAU,IAAkBtD,EAAIa,GAAO2B,EAAgBxC,CAAK,CAG3O,SAASuD,EAAeC,EAAKC,GAAK,OAKlC,SAAyBD,GAAO,GAAIE,MAAMC,QAAQH,GAAM,OAAOA,CAAK,CAL3BI,CAAgBJ,IAIzD,SAA+B/B,EAAGoC,GAAK,IAAInC,EAAI,MAAQD,EAAI,KAAO,oBAAsB7B,QAAU6B,EAAE7B,OAAOC,WAAa4B,EAAE,cAAe,GAAI,MAAQC,EAAG,CAAE,IAAIF,EAAGsC,EAAGL,EAAGM,EAAGC,EAAI,GAAIC,GAAI,EAAItE,GAAI,EAAI,IAAM,GAAI8D,GAAK/B,EAAIA,EAAEX,KAAKU,IAAIyC,KAAM,IAAML,EAAG,CAAE,GAAInD,OAAOgB,KAAOA,EAAG,OAAQuC,GAAI,CAAI,MAAO,OAASA,GAAKzC,EAAIiC,EAAE1C,KAAKW,IAAIyC,QAAUH,EAAEjC,KAAKP,EAAEgB,OAAQwB,EAAE7B,SAAW0B,GAAII,GAAI,GAAK,CAAE,MAAOxC,GAAK9B,GAAI,EAAImE,EAAIrC,CAAG,CAAE,QAAU,IAAM,IAAKwC,GAAK,MAAQvC,EAAU,SAAMqC,EAAIrC,EAAU,SAAKhB,OAAOqD,KAAOA,GAAI,MAAQ,CAAE,QAAU,GAAIpE,EAAG,MAAMmE,CAAG,CAAE,CAAE,OAAOE,CAAG,CAAE,CAJxdI,CAAsBZ,EAAKC,IAE5F,SAAqC9D,EAAG0E,GAAU,IAAK1E,EAAG,OAAQ,GAAiB,kBAANA,EAAgB,OAAO2E,EAAkB3E,EAAG0E,GAAS,IAAIP,EAAIpD,OAAOX,UAAUwE,SAASxD,KAAKpB,GAAG6E,MAAM,GAAI,GAAc,WAANV,GAAkBnE,EAAEG,cAAagE,EAAInE,EAAEG,YAAY2E,MAAM,GAAU,QAANX,GAAqB,QAANA,EAAa,OAAOJ,MAAMgB,KAAK/E,GAAI,GAAU,cAANmE,GAAqB,2CAA2Ca,KAAKb,GAAI,OAAOQ,EAAkB3E,EAAG0E,EAAS,CAF7TO,CAA4BpB,EAAKC,IACnI,WAA8B,MAAM,IAAIT,UAAU,4IAA8I,CADvD6B,EAAoB,CAG7J,SAASP,EAAkBd,EAAKsB,IAAkB,MAAPA,GAAeA,EAAMtB,EAAIrB,UAAQ2C,EAAMtB,EAAIrB,QAAQ,IAAK,IAAIsB,EAAI,EAAGsB,EAAO,IAAIrB,MAAMoB,GAAMrB,EAAIqB,EAAKrB,IAAKsB,EAAKtB,GAAKD,EAAIC,GAAI,OAAOsB,CAAM,CAGlL,OAAO,WACL,IAMEC,EAAazB,GANC,EAAItD,EAAOgF,UAAU,CACjCC,EAAG,EACHC,EAAG,EACHC,EAAG,GACHpB,EAAG,IAEkC,GACvCqB,EAAOL,EAAW,GAClBM,EAAUN,EAAW,GACvB,OAAoB/E,EAAgB,QAAEsF,cAAcpE,EAA+B,QAAG,CACpFkE,KAAMA,EACNG,SAAU,SAAkBC,GAC1BH,EAAQrD,EAAcA,EAAcA,EAAc,CAAC,EAAGoD,GAAOI,GAAW,CAAC,EAAG,CAC1EzB,EAAGqB,EAAKrB,IAEZ,GAEJ,CAAI,CArCkB,IAsClB0B,KAAM,CACR,GAAM,CACJ,KAAQ,GACR,KAAQ,CAAC,EACT,KAAQ,spKACR,SAAY,MACZ,MAAS,6WAGTC,OAAQ,m2EACRC,SAAS,G","sources":["../../packages/color-saturation/README.md"],"sourcesContent":["\nexport default {\n components: { 20: (function() { \"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _react = _interopRequireWildcard(require(\"react\"));\nvar _reactColorSaturation = _interopRequireDefault(require(\"@uiw/react-color-saturation\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function Demo() {\n var _useState = (0, _react.useState)({\n h: 0,\n s: 0,\n v: 68,\n a: 1\n }),\n _useState2 = _slicedToArray(_useState, 2),\n hsva = _useState2[0],\n setHsva = _useState2[1];\n return /*#__PURE__*/_react[\"default\"].createElement(_reactColorSaturation[\"default\"], {\n hsva: hsva,\n onChange: function onChange(newColor) {\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\n a: hsva.a\n }));\n }\n });\n}; })(), },\n data: {\n \"20\": {\n \"name\": 20,\n \"meta\": {},\n \"code\": \"\\\"use strict\\\";\\n\\nfunction _typeof(o) { \\\"@babel/helpers - typeof\\\"; return _typeof = \\\"function\\\" == typeof Symbol && \\\"symbol\\\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \\\"function\\\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \\\"symbol\\\" : typeof o; }, _typeof(o); }\\nvar _react = _interopRequireWildcard(require(\\\"react\\\"));\\nvar _reactColorSaturation = _interopRequireDefault(require(\\\"@uiw/react-color-saturation\\\"));\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \\\"default\\\": obj }; }\\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \\\"function\\\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \\\"object\\\" && typeof obj !== \\\"function\\\") { return { \\\"default\\\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \\\"default\\\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\\\"default\\\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \\\"string\\\"); return _typeof(key) === \\\"symbol\\\" ? key : String(key); }\\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \\\"object\\\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \\\"default\\\"); if (_typeof(res) !== \\\"object\\\") return res; throw new TypeError(\\\"@@toPrimitive must return a primitive value.\\\"); } return (hint === \\\"string\\\" ? String : Number)(input); }\\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\\nfunction _nonIterableRest() { throw new TypeError(\\\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\\"); }\\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \\\"string\\\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \\\"Object\\\" && o.constructor) n = o.constructor.name; if (n === \\\"Map\\\" || n === \\\"Set\\\") return Array.from(o); if (n === \\\"Arguments\\\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \\\"undefined\\\" != typeof Symbol && r[Symbol.iterator] || r[\\\"@@iterator\\\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\\\"return\\\"] && (u = t[\\\"return\\\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\\nreturn function Demo() {\\n var _useState = (0, _react.useState)({\\n h: 0,\\n s: 0,\\n v: 68,\\n a: 1\\n }),\\n _useState2 = _slicedToArray(_useState, 2),\\n hsva = _useState2[0],\\n setHsva = _useState2[1];\\n return /*#__PURE__*/_react[\\\"default\\\"].createElement(_reactColorSaturation[\\\"default\\\"], {\\n hsva: hsva,\\n onChange: function onChange(newColor) {\\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\\n a: hsva.a\\n }));\\n }\\n });\\n};\",\n \"language\": \"jsx\",\n \"value\": \"import React, { useState } from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\\n return (\\n {\\n setHsva({ ...hsva, ...newColor, a: hsva.a });\\n }}\\n />\\n );\\n}\"\n }\n},\n source: \"React Color Saturation\\n===\\n\\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-color-saturation)](https://bundlephobia.com/package/@uiw/react-color-saturation) [![npm version](https://img.shields.io/npm/v/@uiw/react-color-saturation.svg)](https://www.npmjs.com/package/@uiw/react-color-saturation) [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-color-saturation/file/README.md)\\n\\nSaturation Component is a subcomponent of [**`@react-color`**](https://uiwjs.github.io/react-color).\\n\\n\\n[![react-color-saturation](https://user-images.githubusercontent.com/1680273/125951532-ee5bb5df-1d1f-43ed-a4be-e7e8818bf897.png)](https://uiwjs.github.io/react-color/#/saturation)\\n\\n\\n## Install\\n\\n```bash\\nnpm i @uiw/react-color-saturation\\n```\\n\\n## Usage\\n\\n```jsx mdx:preview\\nimport React, { useState } from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\\n return (\\n {\\n setHsva({ ...hsva, ...newColor, a: hsva.a });\\n }}\\n />\\n );\\n}\\n```\\n\\n## Props\\n\\n```ts\\nimport React from 'react';\\nimport { HsvaColor } from '@uiw/color-convert';\\nimport { PointerProps } from './Pointer';\\nexport interface SaturationProps extends Omit, 'onChange'> {\\n prefixCls?: string;\\n /** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */\\n hsva: HsvaColor;\\n radius?: React.CSSProperties['borderRadius'];\\n /** React Component, Custom pointer component */\\n pointer?: ({ prefixCls, left, top, color }: PointerProps) => JSX.Element;\\n onChange?: (newColor: HsvaColor) => void;\\n}\\ndeclare const Saturation: React.ForwardRefExoticComponent>;\\nexport default Saturation;\\n```\\n\\n\\n\\n## Contributors\\n\\nAs always, thanks to our amazing contributors!\\n\\n\\n \\n\\n\\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\\n\\n## License\\n\\nLicensed under the MIT License.\\n\",\n headings:[]\n }"],"names":["components","_typeof","o","Symbol","iterator","constructor","prototype","obj","_react","nodeInterop","__esModule","cache","_getRequireWildcardCache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","hasOwnProperty","call","desc","set","_interopRequireWildcard","_reactColorSaturation","WeakMap","cacheBabelInterop","cacheNodeInterop","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","_toPrimitive","_toPropertyKey","configurable","writable","_slicedToArray","arr","i","Array","isArray","_arrayWithHoles","l","n","u","a","f","next","done","_iterableToArrayLimit","minLen","_arrayLikeToArray","toString","slice","name","from","test","_unsupportedIterableToArray","_nonIterableRest","len","arr2","_useState2","useState","h","s","v","hsva","setHsva","createElement","onChange","newColor","data","source","headings"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/624.8049ee84.chunk.js b/static/js/624.8049ee84.chunk.js new file mode 100644 index 000000000..78dd61466 --- /dev/null +++ b/static/js/624.8049ee84.chunk.js @@ -0,0 +1,2 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[624],{4624:function(e,t,r){r.r(t),t.default={components:{20:function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t,n=function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!==typeof t)return{default:t};var n=a(r);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var c=i?Object.getOwnPropertyDescriptor(t,u):null;c&&(c.get||c.set)?Object.defineProperty(o,u,c):o[u]=t[u]}o.default=t,n&&n.set(t,o);return o}(r(8573)),o=(t=r(6319))&&t.__esModule?t:{default:t};function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function Demo() {\n var _useState = (0, _react.useState)({\n h: 0,\n s: 0,\n v: 68,\n a: 1\n }),\n _useState2 = _slicedToArray(_useState, 2),\n hsva = _useState2[0],\n setHsva = _useState2[1];\n return /*#__PURE__*/_react["default"].createElement(_reactColorSaturation["default"], {\n hsva: hsva,\n onChange: function onChange(newColor) {\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\n a: hsva.a\n }));\n }\n });\n};',language:"jsx",value:"import React, { useState } from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\n return (\n {\n setHsva({ ...hsva, ...newColor, a: hsva.a });\n }}\n />\n );\n}"},39:{name:39,meta:{},code:'"use strict";\n\nvar _react = _interopRequireDefault(require("react"));\nvar _reactColorSaturation = _interopRequireDefault(require("@uiw/react-color-saturation"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }\nreturn function Demo() {\n return /*#__PURE__*/_react["default"].createElement("div", {\n style: {\n display: \'flex\',\n gap: 10\n }\n }, /*#__PURE__*/_react["default"].createElement(_reactColorSaturation["default"], {\n hue: 122\n }), /*#__PURE__*/_react["default"].createElement(_reactColorSaturation["default"], {\n hue: 210\n }), /*#__PURE__*/_react["default"].createElement(_reactColorSaturation["default"], {\n hue: 23\n }));\n};',language:"jsx",value:"import React from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n return (\n
\n \n \n \n
\n );\n}"}},source:"React Color Saturation\n===\n\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-color-saturation)](https://bundlephobia.com/package/@uiw/react-color-saturation) [![npm version](https://img.shields.io/npm/v/@uiw/react-color-saturation.svg)](https://www.npmjs.com/package/@uiw/react-color-saturation) [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-color-saturation/file/README.md)\n\nSaturation Component is a subcomponent of [**`@react-color`**](https://uiwjs.github.io/react-color).\n\n\x3c!--rehype:ignore:start--\x3e\n[![react-color-saturation](https://user-images.githubusercontent.com/1680273/125951532-ee5bb5df-1d1f-43ed-a4be-e7e8818bf897.png)](https://uiwjs.github.io/react-color/#/saturation)\n\x3c!--rehype:ignore:end--\x3e\n\n## Install\n\n```bash\nnpm i @uiw/react-color-saturation\n```\n\n## Usage\n\n```jsx mdx:preview\nimport React, { useState } from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\n return (\n {\n setHsva({ ...hsva, ...newColor, a: hsva.a });\n }}\n />\n );\n}\n```\n\nThe value of `hsva` does not exist\n\n```jsx mdx:preview\nimport React from 'react';\nimport Saturation from '@uiw/react-color-saturation';\n\nexport default function Demo() {\n return (\n
\n \n \n \n
\n );\n}\n```\n## Props\n\n```ts\nimport React from 'react';\nimport { HsvaColor } from '@uiw/color-convert';\nimport { PointerProps } from './Pointer';\nexport interface SaturationProps extends Omit, 'onChange'> {\n prefixCls?: string;\n /** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */\n hsva: HsvaColor;\n radius?: React.CSSProperties['borderRadius'];\n /** React Component, Custom pointer component */\n pointer?: ({ prefixCls, left, top, color }: PointerProps) => JSX.Element;\n onChange?: (newColor: HsvaColor) => void;\n}\ndeclare const Saturation: React.ForwardRefExoticComponent>;\nexport default Saturation;\n```\n\n\x3c!--footer-dividing--\x3e\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\n \n\n\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nLicensed under the MIT License.\n",headings:[]}}}]); +//# sourceMappingURL=624.8049ee84.chunk.js.map \ No newline at end of file diff --git a/static/js/624.8049ee84.chunk.js.map b/static/js/624.8049ee84.chunk.js.map new file mode 100644 index 000000000..140dad0d3 --- /dev/null +++ b/static/js/624.8049ee84.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/624.8049ee84.chunk.js","mappings":"8GACA,WACIA,WAAY,CAAE,GAAI,WAEtB,SAASC,EAAQC,GAAgC,OAAOD,EAAU,mBAAqBE,QAAU,iBAAmBA,OAAOC,SAAW,SAAUF,GAAK,cAAcA,CAAG,EAAI,SAAUA,GAAK,OAAOA,GAAK,mBAAqBC,QAAUD,EAAEG,cAAgBF,QAAUD,IAAMC,OAAOG,UAAY,gBAAkBJ,CAAG,EAAGD,EAAQC,EAAI,CAC7T,IAEgCK,EAF5BC,EAIJ,SAAiCD,EAAKE,GAAe,IAAKA,GAAeF,GAAOA,EAAIG,WAAc,OAAOH,EAAO,GAAY,OAARA,GAAiC,WAAjBN,EAAQM,IAAoC,oBAARA,EAAsB,MAAO,CAAE,QAAWA,GAAS,IAAII,EAAQC,EAAyBH,GAAc,GAAIE,GAASA,EAAME,IAAIN,GAAQ,OAAOI,EAAMG,IAAIP,GAAQ,IAAIQ,EAAS,CAAC,EAAOC,EAAwBC,OAAOC,gBAAkBD,OAAOE,yBAA0B,IAAK,IAAIC,KAAOb,EAAO,GAAY,YAARa,GAAqBH,OAAOX,UAAUe,eAAeC,KAAKf,EAAKa,GAAM,CAAE,IAAIG,EAAOP,EAAwBC,OAAOE,yBAAyBZ,EAAKa,GAAO,KAAUG,IAASA,EAAKT,KAAOS,EAAKC,KAAQP,OAAOC,eAAeH,EAAQK,EAAKG,GAAgBR,EAAOK,GAAOb,EAAIa,EAAQ,CAAIL,EAAgB,QAAIR,EAASI,GAASA,EAAMa,IAAIjB,EAAKQ,GAAW,OAAOA,CAAQ,CAJ7xBU,CAAwB,EAAQ,OACzCC,GAC4BnB,EADmB,EAAQ,QACNA,EAAIG,WAAaH,EAAM,CAAE,QAAWA,GACzF,SAASK,EAAyBH,GAAe,GAAuB,oBAAZkB,QAAwB,OAAO,KAAM,IAAIC,EAAoB,IAAID,QAAeE,EAAmB,IAAIF,QAAW,OAAQf,EAA2B,SAAkCH,GAAe,OAAOA,EAAcoB,EAAmBD,CAAmB,GAAGnB,EAAc,CAE9U,SAASqB,EAAQC,EAAGC,GAAK,IAAIC,EAAIhB,OAAOiB,KAAKH,GAAI,GAAId,OAAOkB,sBAAuB,CAAE,IAAIjC,EAAIe,OAAOkB,sBAAsBJ,GAAIC,IAAM9B,EAAIA,EAAEkC,QAAO,SAAUJ,GAAK,OAAOf,OAAOE,yBAAyBY,EAAGC,GAAGK,UAAY,KAAKJ,EAAEK,KAAKC,MAAMN,EAAG/B,EAAI,CAAE,OAAO+B,CAAG,CAC9P,SAASO,EAAcT,GAAK,IAAK,IAAIC,EAAI,EAAGA,EAAIS,UAAUC,OAAQV,IAAK,CAAE,IAAIC,EAAI,MAAQQ,UAAUT,GAAKS,UAAUT,GAAK,CAAC,EAAGA,EAAI,EAAIF,EAAQb,OAAOgB,IAAI,GAAIU,SAAQ,SAAUX,GAAKY,EAAgBb,EAAGC,EAAGC,EAAED,GAAK,IAAKf,OAAO4B,0BAA4B5B,OAAO6B,iBAAiBf,EAAGd,OAAO4B,0BAA0BZ,IAAMH,EAAQb,OAAOgB,IAAIU,SAAQ,SAAUX,GAAKf,OAAOC,eAAea,EAAGC,EAAGf,OAAOE,yBAAyBc,EAAGD,GAAK,GAAI,CAAE,OAAOD,CAAG,CACtb,SAASa,EAAgBrC,EAAKa,EAAK2B,GAA4L,OAAnL3B,EAC5C,SAAwB4B,GAAO,IAAI5B,EACnC,SAAsB6B,EAAOC,GAAQ,GAAuB,WAAnBjD,EAAQgD,IAAiC,OAAVA,EAAgB,OAAOA,EAAO,IAAIE,EAAOF,EAAM9C,OAAOiD,aAAc,QAAaC,IAATF,EAAoB,CAAE,IAAIG,EAAMH,EAAK7B,KAAK2B,EAAOC,GAAQ,WAAY,GAAqB,WAAjBjD,EAAQqD,GAAmB,OAAOA,EAAK,MAAM,IAAIC,UAAU,+CAAiD,CAAE,OAAiB,WAATL,EAAoBM,OAASC,QAAQR,EAAQ,CADnVS,CAAaV,EAAK,UAAW,MAAwB,WAAjB/C,EAAQmB,GAAoBA,EAAMoC,OAAOpC,EAAM,CAD1EuC,CAAevC,MAAiBb,EAAOU,OAAOC,eAAeX,EAAKa,EAAK,CAAE2B,MAAOA,EAAOV,YAAY,EAAMuB,cAAc,EAAMC,UAAU,IAAkBtD,EAAIa,GAAO2B,EAAgBxC,CAAK,CAG3O,SAASuD,EAAeC,EAAKC,GAAK,OAKlC,SAAyBD,GAAO,GAAIE,MAAMC,QAAQH,GAAM,OAAOA,CAAK,CAL3BI,CAAgBJ,IAIzD,SAA+B/B,EAAGoC,GAAK,IAAInC,EAAI,MAAQD,EAAI,KAAO,oBAAsB7B,QAAU6B,EAAE7B,OAAOC,WAAa4B,EAAE,cAAe,GAAI,MAAQC,EAAG,CAAE,IAAIF,EAAGsC,EAAGL,EAAGM,EAAGC,EAAI,GAAIC,GAAI,EAAItE,GAAI,EAAI,IAAM,GAAI8D,GAAK/B,EAAIA,EAAEX,KAAKU,IAAIyC,KAAM,IAAML,EAAG,CAAE,GAAInD,OAAOgB,KAAOA,EAAG,OAAQuC,GAAI,CAAI,MAAO,OAASA,GAAKzC,EAAIiC,EAAE1C,KAAKW,IAAIyC,QAAUH,EAAEjC,KAAKP,EAAEgB,OAAQwB,EAAE7B,SAAW0B,GAAII,GAAI,GAAK,CAAE,MAAOxC,GAAK9B,GAAI,EAAImE,EAAIrC,CAAG,CAAE,QAAU,IAAM,IAAKwC,GAAK,MAAQvC,EAAU,SAAMqC,EAAIrC,EAAU,SAAKhB,OAAOqD,KAAOA,GAAI,MAAQ,CAAE,QAAU,GAAIpE,EAAG,MAAMmE,CAAG,CAAE,CAAE,OAAOE,CAAG,CAAE,CAJxdI,CAAsBZ,EAAKC,IAE5F,SAAqC9D,EAAG0E,GAAU,IAAK1E,EAAG,OAAQ,GAAiB,kBAANA,EAAgB,OAAO2E,EAAkB3E,EAAG0E,GAAS,IAAIP,EAAIpD,OAAOX,UAAUwE,SAASxD,KAAKpB,GAAG6E,MAAM,GAAI,GAAc,WAANV,GAAkBnE,EAAEG,cAAagE,EAAInE,EAAEG,YAAY2E,MAAM,GAAU,QAANX,GAAqB,QAANA,EAAa,OAAOJ,MAAMgB,KAAK/E,GAAI,GAAU,cAANmE,GAAqB,2CAA2Ca,KAAKb,GAAI,OAAOQ,EAAkB3E,EAAG0E,EAAS,CAF7TO,CAA4BpB,EAAKC,IACnI,WAA8B,MAAM,IAAIT,UAAU,4IAA8I,CADvD6B,EAAoB,CAG7J,SAASP,EAAkBd,EAAKsB,IAAkB,MAAPA,GAAeA,EAAMtB,EAAIrB,UAAQ2C,EAAMtB,EAAIrB,QAAQ,IAAK,IAAIsB,EAAI,EAAGsB,EAAO,IAAIrB,MAAMoB,GAAMrB,EAAIqB,EAAKrB,IAAKsB,EAAKtB,GAAKD,EAAIC,GAAI,OAAOsB,CAAM,CAGlL,OAAO,WACL,IAMEC,EAAazB,GANC,EAAItD,EAAOgF,UAAU,CACjCC,EAAG,EACHC,EAAG,EACHC,EAAG,GACHpB,EAAG,IAEkC,GACvCqB,EAAOL,EAAW,GAClBM,EAAUN,EAAW,GACvB,OAAoB/E,EAAgB,QAAEsF,cAAcpE,EAA+B,QAAG,CACpFkE,KAAMA,EACNG,SAAU,SAAkBC,GAC1BH,EAAQrD,EAAcA,EAAcA,EAAc,CAAC,EAAGoD,GAAOI,GAAW,CAAC,EAAG,CAC1EzB,EAAGqB,EAAKrB,IAEZ,GAEJ,CAAI,CArCkB,GAqCd,GAAI,WAEZ,IAAI/D,EAASyF,EAAuB,EAAQ,OACxCvE,EAAwBuE,EAAuB,EAAQ,OAC3D,SAASA,EAAuB1F,GAAO,OAAOA,GAAOA,EAAIG,WAAaH,EAAM,CAAE,QAAWA,EAAO,CAChG,OAAO,WACL,OAAoBC,EAAgB,QAAEsF,cAAc,MAAO,CACzDI,MAAO,CACLC,QAAS,OACTC,IAAK,KAEO5F,EAAgB,QAAEsF,cAAcpE,EAA+B,QAAG,CAChF2E,IAAK,MACU7F,EAAgB,QAAEsF,cAAcpE,EAA+B,QAAG,CACjF2E,IAAK,MACU7F,EAAgB,QAAEsF,cAAcpE,EAA+B,QAAG,CACjF2E,IAAK,KAET,CAAI,CAlBQ,IAmBRC,KAAM,CACR,GAAM,CACJ,KAAQ,GACR,KAAQ,CAAC,EACT,KAAQ,spKACR,SAAY,MACZ,MAAS,4WAEX,GAAM,CACJ,KAAQ,GACR,KAAQ,CAAC,EACT,KAAQ,8tBACR,SAAY,MACZ,MAAS,0SAGTC,OAAQ,ysFACRC,SAAS,G","sources":["../../packages/color-saturation/README.md"],"sourcesContent":["\nexport default {\n components: { 20: (function() { \"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _react = _interopRequireWildcard(require(\"react\"));\nvar _reactColorSaturation = _interopRequireDefault(require(\"@uiw/react-color-saturation\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nreturn function Demo() {\n var _useState = (0, _react.useState)({\n h: 0,\n s: 0,\n v: 68,\n a: 1\n }),\n _useState2 = _slicedToArray(_useState, 2),\n hsva = _useState2[0],\n setHsva = _useState2[1];\n return /*#__PURE__*/_react[\"default\"].createElement(_reactColorSaturation[\"default\"], {\n hsva: hsva,\n onChange: function onChange(newColor) {\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\n a: hsva.a\n }));\n }\n });\n}; })(),39: (function() { \"use strict\";\n\nvar _react = _interopRequireDefault(require(\"react\"));\nvar _reactColorSaturation = _interopRequireDefault(require(\"@uiw/react-color-saturation\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nreturn function Demo() {\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n style: {\n display: 'flex',\n gap: 10\n }\n }, /*#__PURE__*/_react[\"default\"].createElement(_reactColorSaturation[\"default\"], {\n hue: 122\n }), /*#__PURE__*/_react[\"default\"].createElement(_reactColorSaturation[\"default\"], {\n hue: 210\n }), /*#__PURE__*/_react[\"default\"].createElement(_reactColorSaturation[\"default\"], {\n hue: 23\n }));\n}; })(), },\n data: {\n \"20\": {\n \"name\": 20,\n \"meta\": {},\n \"code\": \"\\\"use strict\\\";\\n\\nfunction _typeof(o) { \\\"@babel/helpers - typeof\\\"; return _typeof = \\\"function\\\" == typeof Symbol && \\\"symbol\\\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \\\"function\\\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \\\"symbol\\\" : typeof o; }, _typeof(o); }\\nvar _react = _interopRequireWildcard(require(\\\"react\\\"));\\nvar _reactColorSaturation = _interopRequireDefault(require(\\\"@uiw/react-color-saturation\\\"));\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \\\"default\\\": obj }; }\\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \\\"function\\\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \\\"object\\\" && typeof obj !== \\\"function\\\") { return { \\\"default\\\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \\\"default\\\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\\\"default\\\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \\\"string\\\"); return _typeof(key) === \\\"symbol\\\" ? key : String(key); }\\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \\\"object\\\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \\\"default\\\"); if (_typeof(res) !== \\\"object\\\") return res; throw new TypeError(\\\"@@toPrimitive must return a primitive value.\\\"); } return (hint === \\\"string\\\" ? String : Number)(input); }\\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\\nfunction _nonIterableRest() { throw new TypeError(\\\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\\"); }\\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \\\"string\\\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \\\"Object\\\" && o.constructor) n = o.constructor.name; if (n === \\\"Map\\\" || n === \\\"Set\\\") return Array.from(o); if (n === \\\"Arguments\\\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \\\"undefined\\\" != typeof Symbol && r[Symbol.iterator] || r[\\\"@@iterator\\\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\\\"return\\\"] && (u = t[\\\"return\\\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\\nreturn function Demo() {\\n var _useState = (0, _react.useState)({\\n h: 0,\\n s: 0,\\n v: 68,\\n a: 1\\n }),\\n _useState2 = _slicedToArray(_useState, 2),\\n hsva = _useState2[0],\\n setHsva = _useState2[1];\\n return /*#__PURE__*/_react[\\\"default\\\"].createElement(_reactColorSaturation[\\\"default\\\"], {\\n hsva: hsva,\\n onChange: function onChange(newColor) {\\n setHsva(_objectSpread(_objectSpread(_objectSpread({}, hsva), newColor), {}, {\\n a: hsva.a\\n }));\\n }\\n });\\n};\",\n \"language\": \"jsx\",\n \"value\": \"import React, { useState } from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\\n return (\\n {\\n setHsva({ ...hsva, ...newColor, a: hsva.a });\\n }}\\n />\\n );\\n}\"\n },\n \"39\": {\n \"name\": 39,\n \"meta\": {},\n \"code\": \"\\\"use strict\\\";\\n\\nvar _react = _interopRequireDefault(require(\\\"react\\\"));\\nvar _reactColorSaturation = _interopRequireDefault(require(\\\"@uiw/react-color-saturation\\\"));\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \\\"default\\\": obj }; }\\nreturn function Demo() {\\n return /*#__PURE__*/_react[\\\"default\\\"].createElement(\\\"div\\\", {\\n style: {\\n display: 'flex',\\n gap: 10\\n }\\n }, /*#__PURE__*/_react[\\\"default\\\"].createElement(_reactColorSaturation[\\\"default\\\"], {\\n hue: 122\\n }), /*#__PURE__*/_react[\\\"default\\\"].createElement(_reactColorSaturation[\\\"default\\\"], {\\n hue: 210\\n }), /*#__PURE__*/_react[\\\"default\\\"].createElement(_reactColorSaturation[\\\"default\\\"], {\\n hue: 23\\n }));\\n};\",\n \"language\": \"jsx\",\n \"value\": \"import React from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n return (\\n
\\n \\n \\n \\n
\\n );\\n}\"\n }\n},\n source: \"React Color Saturation\\n===\\n\\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@uiw/react-color-saturation)](https://bundlephobia.com/package/@uiw/react-color-saturation) [![npm version](https://img.shields.io/npm/v/@uiw/react-color-saturation.svg)](https://www.npmjs.com/package/@uiw/react-color-saturation) [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-color-saturation/file/README.md)\\n\\nSaturation Component is a subcomponent of [**`@react-color`**](https://uiwjs.github.io/react-color).\\n\\n\\n[![react-color-saturation](https://user-images.githubusercontent.com/1680273/125951532-ee5bb5df-1d1f-43ed-a4be-e7e8818bf897.png)](https://uiwjs.github.io/react-color/#/saturation)\\n\\n\\n## Install\\n\\n```bash\\nnpm i @uiw/react-color-saturation\\n```\\n\\n## Usage\\n\\n```jsx mdx:preview\\nimport React, { useState } from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n const [hsva, setHsva] = useState({ h: 0, s: 0, v: 68, a: 1 });\\n return (\\n {\\n setHsva({ ...hsva, ...newColor, a: hsva.a });\\n }}\\n />\\n );\\n}\\n```\\n\\nThe value of `hsva` does not exist\\n\\n```jsx mdx:preview\\nimport React from 'react';\\nimport Saturation from '@uiw/react-color-saturation';\\n\\nexport default function Demo() {\\n return (\\n
\\n \\n \\n \\n
\\n );\\n}\\n```\\n## Props\\n\\n```ts\\nimport React from 'react';\\nimport { HsvaColor } from '@uiw/color-convert';\\nimport { PointerProps } from './Pointer';\\nexport interface SaturationProps extends Omit, 'onChange'> {\\n prefixCls?: string;\\n /** hsva => `{ h: 0, s: 75, v: 82, a: 1 }` */\\n hsva: HsvaColor;\\n radius?: React.CSSProperties['borderRadius'];\\n /** React Component, Custom pointer component */\\n pointer?: ({ prefixCls, left, top, color }: PointerProps) => JSX.Element;\\n onChange?: (newColor: HsvaColor) => void;\\n}\\ndeclare const Saturation: React.ForwardRefExoticComponent>;\\nexport default Saturation;\\n```\\n\\n\\n\\n## Contributors\\n\\nAs always, thanks to our amazing contributors!\\n\\n\\n \\n\\n\\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\\n\\n## License\\n\\nLicensed under the MIT License.\\n\",\n headings:[]\n }"],"names":["components","_typeof","o","Symbol","iterator","constructor","prototype","obj","_react","nodeInterop","__esModule","cache","_getRequireWildcardCache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","hasOwnProperty","call","desc","set","_interopRequireWildcard","_reactColorSaturation","WeakMap","cacheBabelInterop","cacheNodeInterop","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","Number","_toPrimitive","_toPropertyKey","configurable","writable","_slicedToArray","arr","i","Array","isArray","_arrayWithHoles","l","n","u","a","f","next","done","_iterableToArrayLimit","minLen","_arrayLikeToArray","toString","slice","name","from","test","_unsupportedIterableToArray","_nonIterableRest","len","arr2","_useState2","useState","h","s","v","hsva","setHsva","createElement","onChange","newColor","_interopRequireDefault","style","display","gap","hue","data","source","headings"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.dda15700.js b/static/js/main.4ffb1c37.js similarity index 83% rename from static/js/main.dda15700.js rename to static/js/main.4ffb1c37.js index 813874934..4d0ca45e7 100644 --- a/static/js/main.dda15700.js +++ b/static/js/main.4ffb1c37.js @@ -1,3 +1,3 @@ -/*! For license information please see main.dda15700.js.LICENSE.txt */ -!function(){var e={7905:function(e,t,r){"use strict";r.d(t,{I6:function(){return s},Of:function(){return a},_y:function(){return i}});var n=r(189),o=r(8573),a={hsva:{h:214,s:43,v:90,a:1}},i=o.createContext(a);function s(e,t){return(0,n.Z)((0,n.Z)({},e),t)}},2296:function(e,t,r){"use strict";var n=r(8650),o=r(189),a=r(1026),i=r(669),s=r(5773),u=r(808),c=r(8573),l=r.t(c,2),f=r(649),d=r(2951),h=r(1976),p=r(7591),v=r(9616),m=r(7373),g=document.createElement("template");g.innerHTML='\n\n\n';var b=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){var e;return(0,d.Z)(this,r),(e=t.call(this)).right="0",e.shadow=e.attachShadow({mode:"open"}),e.shadow.appendChild(e.ownerDocument.importNode(g.content,!0)),e.update(),e}return(0,h.Z)(r,[{key:"setAttr",value:function(e,t){var r=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?r.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?r.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?r.style[e]=t:r.setAttribute(e,t)}},{key:"update",value:function(){var e=this;[].concat((0,f.Z)(this.getAttributeNames()),["right"]).forEach((function(t){var r=e.getAttribute(t)||e[t]||"";e.setAttr(t,r)}))}},{key:"attributeChangedCallback",value:function(e,t,r){t!==r&&this.setAttr(e,r)}}],[{key:"observedAttributes",get:function(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}}]),r}((0,m.Z)(HTMLElement));customElements.define("github-corners",b);var y=r(4760),x=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function w(e){var t=e.size,r=void 0===t?80:t,n=e.fixed,o=void 0!==n&&n,a=e.bottom,i=e.zIndex,c=e.style,l=e.bgColor,f=void 0===l?"#151513":l,d=e.color,h=void 0===d?"#fff":d,p=e.position,v=void 0===p?"right":p,m=(0,u.Z)(e,x),g="left"===v?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return a?(g.bottom=0,g.top="initial",g.transform="left"===v?"scale(-1, -1)":"scale(1, -1)"):(g.bottom="initial",g.top=0),(0,y.jsx)("github-corners",(0,s.Z)({target:"__blank",width:r,height:r,href:e.href,position:o?"fixed":"absolute","z-index":i,style:c,fill:f,color:h},g,m))}var S=r(7240),E=r(3940);function C(){C=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),s=new A(n||[]);return o(i,"_invoke",{value:R(e,r,s)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",v="completed",m={};function g(){}function b(){}function y(){}var x={};c(x,i,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(D([])));S&&S!==r&&n.call(S,i)&&(x=S);var k=y.prototype=g.prototype=Object.create(x);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(o,a,i,s){var u=f(e[o],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==(0,E.Z)(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(l).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function R(t,r,n){var o=d;return function(a,i){if(o===p)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?v:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function k(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){k(a,n,o,i,s,"next",e)}function s(e){k(a,n,o,i,s,"throw",e)}i(void 0)}))}}var O,R=r(4649),P=r(2173),j=r(4013);function T(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=(0,j.Z)(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function F(e,t,r,n){void 0===n&&(n={});var o=n,a=o.window,i=void 0===a?document.defaultView:a,s=o.v5Compat,u=void 0!==s&&s,c=i.history,l=O.Pop,f=null,d=h();function h(){return(c.state||{idx:null}).idx}function p(){l=O.Pop;var e=h(),t=null==e?null:e-d;d=e,f&&f({action:l,location:m.location,delta:t})}function v(e){var t="null"!==i.location.origin?i.location.origin:i.location.href,r="string"===typeof e?e:B(e);return Z(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==d&&(d=0,c.replaceState(A({},c.state,{idx:d}),""));var m={get action(){return l},get location(){return e(i,c)},listen:function(e){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(L,p),f=e,function(){i.removeEventListener(L,p),f=null}},createHref:function(e){return t(i,e)},createURL:v,encodeLocation:function(e){var t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=O.Push;var n=I(m.location,e,t);r&&r(n,e);var o=M(n,d=h()+1),a=m.createHref(n);try{c.pushState(o,"",a)}catch(s){if(s instanceof DOMException&&"DataCloneError"===s.name)throw s;i.location.assign(a)}u&&f&&f({action:l,location:m.location,delta:1})},replace:function(e,t){l=O.Replace;var n=I(m.location,e,t);r&&r(n,e);var o=M(n,d=h()),a=m.createHref(n);c.replaceState(o,"",a),u&&f&&f({action:l,location:m.location,delta:0})},go:function(e){return c.go(e)}};return m}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(D||(D={}));var H=new Set(["lazy","caseSensitive","path","id","index","children"]);function z(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((function(e,o){var a=[].concat((0,f.Z)(r),[o]),i="string"===typeof e.id?e.id:a.join("-");if(Z(!0!==e.index||!e.children,"Cannot specify children on an index route"),Z(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){var s=A({},e,t(e),{id:i});return n[i]=s,s}var u=A({},e,t(e),{id:i,children:void 0});return n[i]=u,e.children&&(u.children=z(e.children,t,a,n)),u}))}function W(e,t,r){void 0===r&&(r="/");var n=oe(("string"===typeof t?U(t):t).pathname||"/",r);if(null==n)return null;var o=$(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var r=e.length===t.length&&e.slice(0,-1).every((function(e,r){return e===t[r]}));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(o);for(var a=null,i=0;null==a&&i0&&(Z(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),$(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:ee(s,e.index),routesMeta:u})};return e.forEach((function(e,t){var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?")){var n,a=T(K(e.path));try{for(a.s();!(n=a.n()).done;){var i=n.value;o(e,t,i)}}catch(s){a.e(s)}finally{a.f()}}else o(e,t)})),t}function K(e){var t=e.split("/");if(0===t.length)return[];var r=(0,P.Z)(t),n=r[0],o=r.slice(1),a=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===o.length)return a?[i,""]:[i];var s=K(o.join("/")),u=[];return u.push.apply(u,(0,f.Z)(s.map((function(e){return""===e?i:[i,e].join("/")})))),a&&u.push.apply(u,(0,f.Z)(s)),u.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}var G=/^:\w+$/,Y=3,q=2,V=1,J=10,X=-2,Q=function(e){return"*"===e};function ee(e,t){var r=e.split("/"),n=r.length;return r.some(Q)&&(n+=X),t&&(n+=q),r.filter((function(e){return!Q(e)})).reduce((function(e,t){return e+(G.test(t)?Y:""===t?V:J)}),n)}function te(e,t){for(var r=e.routesMeta,n={},o="/",a=[],i=0;i and the router will parse it for you.'}function ie(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function se(e,t,r,n){var o;void 0===n&&(n=!1),"string"===typeof e?o=U(e):(Z(!(o=A({},e)).pathname||!o.pathname.includes("?"),ae("?","pathname","search",o)),Z(!o.pathname||!o.pathname.includes("#"),ae("#","pathname","hash",o)),Z(!o.search||!o.search.includes("#"),ae("#","search","hash",o)));var a,i=""===e||""===o.pathname,s=i?"/":o.pathname;if(n||null==s)a=r;else{var u=t.length-1;if(s.startsWith("..")){for(var c=s.split("/");".."===c[0];)c.shift(),u-=1;o.pathname=c.join("/")}a=u>=0?t[u]:"/"}var l=function(e,t){void 0===t&&(t="/");var r="string"===typeof e?U(e):e,n=r.pathname,o=r.search,a=void 0===o?"":o,i=r.hash,s=void 0===i?"":i,u=n?n.startsWith("/")?n:function(e,t){var r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(n,t):t;return{pathname:u,search:le(a),hash:fe(s)}}(o,a),f=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!f&&!d||(l.pathname+="/"),l}var ue=function(e){return e.join("/").replace(/\/\/+/g,"/")},ce=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},le=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},fe=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},de=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,d.Z)(this,r),t.apply(this,arguments)}return(0,h.Z)(r)}((0,m.Z)(Error));var he=(0,h.Z)((function e(t,r,n,o){(0,d.Z)(this,e),void 0===o&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}));function pe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var ve=["post","put","patch","delete"],me=new Set(ve),ge=["get"].concat(ve),be=new Set(ge),ye=new Set([301,302,303,307,308]),xe=new Set([307,308]),we={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Se={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ee={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ke=function(e){return{hasErrorBoundary:Boolean(e.hasErrorBoundary)}};function _e(e){var t,r=e.window?e.window:"undefined"!==typeof window?window:void 0,n="undefined"!==typeof r&&"undefined"!==typeof r.document&&"undefined"!==typeof r.document.createElement,o=!n;if(Z(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){var i=e.detectErrorBoundary;t=function(e){return{hasErrorBoundary:i(e)}}}else t=ke;var s,u={},c=z(e.routes,t,void 0,u),l=e.basename||"/",d=A({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,p=new Set,v=null,m=null,g=null,b=null!=e.hydrationData,y=W(c,e.history.location,l),x=null;if(null==y){var w=$e(404,{pathname:e.history.location.pathname}),S=We(c),E=S.matches,k=S.route;y=E,x=(0,R.Z)({},k.id,w)}var P,j,L=!y.some((function(e){return e.route.lazy}))&&(!y.some((function(e){return e.route.loader}))||null!=e.hydrationData),M={historyAction:e.history.action,location:e.history.location,matches:y,initialized:L,navigation:we,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},B=O.Pop,U=!1,F=!1,H=!1,$=[],K=[],G=new Map,Y=0,q=-1,V=new Map,J=new Set,X=new Map,Q=new Map,ee=new Map,te=!1;function re(e){M=A({},M,e),p.forEach((function(e){return e(M)}))}function ne(t,r){var n,o,a,i=null!=M.actionData&&null!=M.navigation.formMethod&&tt(M.navigation.formMethod)&&"loading"===M.navigation.state&&!0!==(null==(n=t.state)?void 0:n._isRedirect);a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:i?M.actionData:null;var u=r.loaderData?He(M.loaderData,r.loaderData,r.matches||[],r.errors):M.loaderData,l=M.blockers;l.size>0&&(l=new Map(l)).forEach((function(e,t){return l.set(t,Ee)}));var f=!0===U||null!=M.navigation.formMethod&&tt(M.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s&&(c=s,s=void 0),F||B===O.Pop||(B===O.Push?e.history.push(t,t.state):B===O.Replace&&e.history.replace(t,t.state)),re(A({},r,{actionData:a,loaderData:u,historyAction:B,location:t,initialized:!0,navigation:we,revalidation:"idle",restoreScrollPosition:et(t,r.matches||M.matches),preventScrollReset:f,blockers:l})),B=O.Pop,U=!1,F=!1,H=!1,$=[],K=[]}function ae(e,t){return ie.apply(this,arguments)}function ie(){return ie=_(C().mark((function t(r,n){var o,a,i,s,u,c,f,h,p,v,m;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("number"!==typeof r){t.next=3;break}return e.history.go(r),t.abrupt("return");case 3:if(o=Oe(M.location,M.matches,l,d.v7_prependBasename,r,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),a=Re(d.v7_normalizeFormMethod,!1,o,n),i=a.path,s=a.submission,u=a.error,c=M.location,f=A({},f=I(M.location,i,n&&n.state),e.history.encodeLocation(f)),h=n&&null!=n.replace?n.replace:void 0,p=O.Push,!0===h?p=O.Replace:!1===h||null!=s&&tt(s.formMethod)&&s.formAction===M.location.pathname+M.location.search&&(p=O.Replace),v=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,!(m=Ue({currentLocation:c,nextLocation:f,historyAction:p}))){t.next=16;break}return Be(m,{state:"blocked",location:f,proceed:function(){Be(m,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),ae(r,n)},reset:function(){var e=new Map(M.blockers);e.set(m,Ee),re({blockers:e})}}),t.abrupt("return");case 16:return t.next=18,se(p,f,{submission:s,pendingError:u,preventScrollReset:v,replace:n&&n.replace});case 18:return t.abrupt("return",t.sent);case 19:case"end":return t.stop()}}),t)}))),ie.apply(this,arguments)}function se(e,t,r){return ue.apply(this,arguments)}function ue(){return ue=_(C().mark((function t(r,n,o){var a,i,u,f,d,h,p,v,m,g,b,y,x,w,S;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j&&j.abort(),j=null,B=r,F=!0===(o&&o.startUninterruptedRevalidation),Qe(M.location,M.matches),U=!0===(o&&o.preventScrollReset),a=s||c,i=o&&o.overrideNavigation,u=W(a,n,l)){t.next=15;break}return f=$e(404,{pathname:n.pathname}),d=We(a),h=d.matches,p=d.route,Ge(),ne(n,{matches:h,loaderData:{},errors:(0,R.Z)({},p.id,f)}),t.abrupt("return");case 15:if(!M.initialized||H||!Ye(M.location,n)||o&&o.submission&&tt(o.submission.formMethod)){t.next=18;break}return ne(n,{matches:u}),t.abrupt("return");case 18:if(j=new AbortController,v=Me(e.history,n,j.signal,o&&o.submission),!o||!o.pendingError){t.next=24;break}g=(0,R.Z)({},ze(u).route.id,o.pendingError),t.next=34;break;case 24:if(!(o&&o.submission&&tt(o.submission.formMethod))){t.next=34;break}return t.next=27,ce(v,n,o.submission,u,{replace:o.replace});case 27:if(!(b=t.sent).shortCircuited){t.next=30;break}return t.abrupt("return");case 30:m=b.pendingActionData,g=b.pendingActionError,i=ct(n,o.submission),v=new Request(v.url,{signal:v.signal});case 34:return t.next=36,fe(v,n,u,i,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,m,g);case 36:if(y=t.sent,x=y.shortCircuited,w=y.loaderData,S=y.errors,!x){t.next=42;break}return t.abrupt("return");case 42:j=null,ne(n,A({matches:u},m?{actionData:m}:{},{loaderData:w,errors:S}));case 44:case"end":return t.stop()}}),t)}))),ue.apply(this,arguments)}function ce(e,t,r,n,o){return le.apply(this,arguments)}function le(){return le=_(C().mark((function e(r,n,o,a,i){var s,c,f,d;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===i&&(i={}),_e(),re({navigation:lt(n,o)}),(c=st(a,n)).route.action||c.route.lazy){e.next=9;break}s={type:D.error,error:$e(405,{method:r.method,pathname:n.pathname,routeId:c.route.id})},e.next=14;break;case 9:return e.next=11,Ze("action",r,c,a,u,t,l);case 11:if(s=e.sent,!r.signal.aborted){e.next=14;break}return e.abrupt("return",{shortCircuited:!0});case 14:if(!Je(s)){e.next=19;break}return f=i&&null!=i.replace?i.replace:s.location===M.location.pathname+M.location.search,e.next=18,me(M,s,{submission:o,replace:f});case 18:return e.abrupt("return",{shortCircuited:!0});case 19:if(!Ve(s)){e.next=23;break}return d=ze(a,c.route.id),!0!==(i&&i.replace)&&(B=O.Push),e.abrupt("return",{pendingActionData:{},pendingActionError:(0,R.Z)({},d.route.id,s.error)});case 23:if(!qe(s)){e.next=25;break}throw $e(400,{type:"defer-action"});case 25:return e.abrupt("return",{pendingActionData:(0,R.Z)({},c.route.id,s.data)});case 26:case"end":return e.stop()}}),e)}))),le.apply(this,arguments)}function fe(e,t,r,n,o,a,i,s,u){return de.apply(this,arguments)}function de(){return de=_(C().mark((function t(r,n,o,i,u,f,d,h,p){var v,m,g,b,y,x,w,S,E,k,_,O,R,P,T,D,L,Z,N,I,B,U;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=i||ct(n,u),m=u||f||ut(v),g=s||c,b=je(e.history,M,o,m,n,H,$,K,X,J,g,l,h,p),y=(0,a.Z)(b,2),x=y[0],w=y[1],Ge((function(e){return!(o&&o.some((function(t){return t.route.id===e})))||x&&x.some((function(t){return t.route.id===e}))})),q=++Y,0!==x.length||0!==w.length){t.next=10;break}return S=Le(),ne(n,A({matches:o,loaderData:{},errors:p||null},h?{actionData:h}:{},S?{fetchers:new Map(M.fetchers)}:{})),t.abrupt("return",{shortCircuited:!0});case 10:return F||(w.forEach((function(e){var t=M.fetchers.get(e.key),r=ft(void 0,t?t.data:void 0);M.fetchers.set(e.key,r)})),E=h||M.actionData,re(A({navigation:v},E?0===Object.keys(E).length?{actionData:null}:{actionData:E}:{},w.length>0?{fetchers:new Map(M.fetchers)}:{}))),w.forEach((function(e){G.has(e.key)&&Ae(e.key),e.controller&&G.set(e.key,e.controller)})),k=function(){return w.forEach((function(e){return Ae(e.key)}))},j&&j.signal.addEventListener("abort",k),t.next=16,be(M.matches,o,x,w,r);case 16:if(_=t.sent,O=_.results,R=_.loaderResults,P=_.fetcherResults,!r.signal.aborted){t.next=22;break}return t.abrupt("return",{shortCircuited:!0});case 22:if(j&&j.signal.removeEventListener("abort",k),w.forEach((function(e){return G.delete(e.key)})),!(T=Ke(O))){t.next=30;break}return T.idx>=x.length&&(D=w[T.idx-x.length].key,J.add(D)),t.next=29,me(M,T.result,{replace:d});case 29:return t.abrupt("return",{shortCircuited:!0});case 30:return L=Fe(M,o,x,R,p,w,P,Q),Z=L.loaderData,N=L.errors,Q.forEach((function(e,t){e.subscribe((function(r){(r||e.done)&&Q.delete(t)}))})),I=Le(),B=Ne(q),U=I||B||w.length>0,t.abrupt("return",A({loaderData:Z,errors:N},U?{fetchers:new Map(M.fetchers)}:{}));case 36:case"end":return t.stop()}}),t)}))),de.apply(this,arguments)}function he(e){return M.fetchers.get(e)||Se}function pe(){return pe=_(C().mark((function r(n,o,i,f,d,h){var p,v,m,g,b,y,x,w,S,E,k,_,O,P,T,D,L,N,I,U,F,z,ee,te,oe,ae,ie,se,ue,ce,le;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_e(),X.delete(n),f.route.action||f.route.lazy){r.next=6;break}return p=$e(405,{method:h.formMethod,pathname:i,routeId:o}),Pe(n,o,p),r.abrupt("return");case 6:return v=M.fetchers.get(n),m=dt(h,v),M.fetchers.set(n,m),re({fetchers:new Map(M.fetchers)}),g=new AbortController,b=Me(e.history,i,g.signal,h),G.set(n,g),y=Y,r.next=16,Ze("action",b,f,d,u,t,l);case 16:if(x=r.sent,!b.signal.aborted){r.next=20;break}return G.get(n)===g&&G.delete(n),r.abrupt("return");case 20:if(!Je(x)){r.next=34;break}if(G.delete(n),!(q>y)){r.next=29;break}return w=ht(void 0),M.fetchers.set(n,w),re({fetchers:new Map(M.fetchers)}),r.abrupt("return");case 29:return J.add(n),S=ft(h),M.fetchers.set(n,S),re({fetchers:new Map(M.fetchers)}),r.abrupt("return",me(M,x,{submission:h,isFetchActionRedirect:!0}));case 34:if(!Ve(x)){r.next=37;break}return Pe(n,o,x.error),r.abrupt("return");case 37:if(!qe(x)){r.next=39;break}throw $e(400,{type:"defer-action"});case 39:return E=M.navigation.location||M.location,k=Me(e.history,E,g.signal),_=s||c,Z(O="idle"!==M.navigation.state?W(_,M.navigation.location,l):M.matches,"Didn't find any matches after fetcher action"),P=++Y,V.set(n,P),T=ft(h,x.data),M.fetchers.set(n,T),D=je(e.history,M,O,h,E,H,$,K,X,J,_,l,(0,R.Z)({},f.route.id,x.data),void 0),L=(0,a.Z)(D,2),N=L[0],(I=L[1]).filter((function(e){return e.key!==n})).forEach((function(e){var t=e.key,r=M.fetchers.get(t),n=ft(void 0,r?r.data:void 0);M.fetchers.set(t,n),G.has(t)&&Ae(t),e.controller&&G.set(t,e.controller)})),re({fetchers:new Map(M.fetchers)}),U=function(){return I.forEach((function(e){return Ae(e.key)}))},g.signal.addEventListener("abort",U),r.next=55,be(M.matches,O,N,I,k);case 55:if(F=r.sent,z=F.results,ee=F.loaderResults,te=F.fetcherResults,!g.signal.aborted){r.next=61;break}return r.abrupt("return");case 61:if(g.signal.removeEventListener("abort",U),V.delete(n),G.delete(n),I.forEach((function(e){return G.delete(e.key)})),!(oe=Ke(z))){r.next=69;break}return oe.idx>=N.length&&(ae=I[oe.idx-N.length].key,J.add(ae)),r.abrupt("return",me(M,oe.result));case 69:ie=Fe(M,M.matches,N,ee,void 0,I,te,Q),se=ie.loaderData,ue=ie.errors,M.fetchers.has(n)&&(ce=ht(x.data),M.fetchers.set(n,ce)),le=Ne(P),"loading"===M.navigation.state&&P>q?(Z(B,"Expected pending action"),j&&j.abort(),ne(M.navigation.location,{matches:O,loaderData:se,errors:ue,fetchers:new Map(M.fetchers)})):(re(A({errors:ue,loaderData:He(M.loaderData,se,O,ue)},le||I.length>0?{fetchers:new Map(M.fetchers)}:{})),H=!1);case 73:case"end":return r.stop()}}),r)}))),pe.apply(this,arguments)}function ve(){return ve=_(C().mark((function r(n,o,a,i,s,c){var f,d,h,p,v,m,g,b,y;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return f=M.fetchers.get(n),d=ft(c,f?f.data:void 0),M.fetchers.set(n,d),re({fetchers:new Map(M.fetchers)}),h=new AbortController,p=Me(e.history,a,h.signal),G.set(n,h),v=Y,r.next=10,Ze("loader",p,i,s,u,t,l);case 10:if(!qe(m=r.sent)){r.next=18;break}return r.next=14,ot(m,p.signal,!0);case 14:if(r.t0=r.sent,r.t0){r.next=17;break}r.t0=m;case 17:m=r.t0;case 18:if(G.get(n)===h&&G.delete(n),!p.signal.aborted){r.next=21;break}return r.abrupt("return");case 21:if(!Je(m)){r.next=33;break}if(!(q>v)){r.next=29;break}return g=ht(void 0),M.fetchers.set(n,g),re({fetchers:new Map(M.fetchers)}),r.abrupt("return");case 29:return J.add(n),r.next=32,me(M,m);case 32:return r.abrupt("return");case 33:if(!Ve(m)){r.next=38;break}return b=ze(M.matches,o),M.fetchers.delete(n),re({fetchers:new Map(M.fetchers),errors:(0,R.Z)({},b.route.id,m.error)}),r.abrupt("return");case 38:Z(!qe(m),"Unhandled fetcher deferred data"),y=ht(m.data),M.fetchers.set(n,y),re({fetchers:new Map(M.fetchers)});case 42:case"end":return r.stop()}}),r)}))),ve.apply(this,arguments)}function me(e,t,r){return ge.apply(this,arguments)}function ge(){return ge=_(C().mark((function t(o,a,i){var s,u,c,f,d,h,p,v,m,g;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=(s=void 0===i?{}:i).submission,c=s.replace,f=s.isFetchActionRedirect,a.revalidate&&(H=!0),Z(d=I(o.location,a.location,A({_isRedirect:!0},f?{_isFetchActionRedirect:!0}:{})),"Expected a location on the redirect navigation"),!Ce.test(a.location)||!n){t.next=10;break}if(h=e.history.createURL(a.location),p=null==oe(h.pathname,l),r.location.origin===h.origin&&!p){t.next=10;break}return c?r.location.replace(a.location):r.location.assign(a.location),t.abrupt("return");case 10:if(j=null,v=!0===c?O.Replace:O.Push,m=u||ut(o.navigation),!(xe.has(a.status)&&m&&tt(m.formMethod))){t.next=18;break}return t.next=16,se(v,d,{submission:A({},m,{formAction:a.location}),preventScrollReset:U});case 16:case 21:t.next=26;break;case 18:if(!f){t.next=23;break}return t.next=21,se(v,d,{overrideNavigation:ct(d),fetcherSubmission:m,preventScrollReset:U});case 23:return g=ct(d,m),t.next=26,se(v,d,{overrideNavigation:g,preventScrollReset:U});case 26:case"end":return t.stop()}}),t)}))),ge.apply(this,arguments)}function be(e,t,r,n,o){return ye.apply(this,arguments)}function ye(){return ye=_(C().mark((function r(n,o,a,i,s){var c,d,h;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([].concat((0,f.Z)(a.map((function(e){return Ze("loader",s,e,o,u,t,l)}))),(0,f.Z)(i.map((function(r){return r.matches&&r.match&&r.controller?Ze("loader",Me(e.history,r.path,r.controller.signal),r.match,r.matches,u,t,l):{type:D.error,error:$e(404,{pathname:r.path})}})))));case 2:return c=r.sent,d=c.slice(0,a.length),h=c.slice(a.length),r.next=7,Promise.all([rt(n,a,d,d.map((function(){return s.signal})),!1,M.loaderData),rt(n,i.map((function(e){return e.match})),h,i.map((function(e){return e.controller?e.controller.signal:null})),!0)]);case 7:return r.abrupt("return",{results:c,loaderResults:d,fetcherResults:h});case 8:case"end":return r.stop()}}),r)}))),ye.apply(this,arguments)}function _e(){var e;H=!0,(e=$).push.apply(e,(0,f.Z)(Ge())),X.forEach((function(e,t){G.has(t)&&(K.push(t),Ae(t))}))}function Pe(e,t,r){var n=ze(M.matches,t);Te(e),re({errors:(0,R.Z)({},n.route.id,r),fetchers:new Map(M.fetchers)})}function Te(e){var t=M.fetchers.get(e);!G.has(e)||t&&"loading"===t.state&&V.has(e)||Ae(e),X.delete(e),V.delete(e),J.delete(e),M.fetchers.delete(e)}function Ae(e){var t=G.get(e);Z(t,"Expected fetch controller: "+e),t.abort(),G.delete(e)}function De(e){var t,r=T(e);try{for(r.s();!(t=r.n()).done;){var n=t.value,o=ht(he(n).data);M.fetchers.set(n,o)}}catch(a){r.e(a)}finally{r.f()}}function Le(){var e,t=[],r=!1,n=T(J);try{for(n.s();!(e=n.n()).done;){var o=e.value,a=M.fetchers.get(o);Z(a,"Expected fetcher: "+o),"loading"===a.state&&(J.delete(o),t.push(o),r=!0)}}catch(i){n.e(i)}finally{n.f()}return De(t),r}function Ne(e){var t,r=[],n=T(V);try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0];if(o[1]0}function Ie(e){M.blockers.delete(e),ee.delete(e)}function Be(e,t){var r=M.blockers.get(e)||Ee;Z("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);var n=new Map(M.blockers);n.set(e,t),re({blockers:n})}function Ue(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==ee.size){ee.size>1&&N(!1,"A router only supports one blocker at a time");var o=Array.from(ee.entries()),i=(0,a.Z)(o[o.length-1],2),s=i[0],u=i[1],c=M.blockers.get(s);if(!c||"proceeding"!==c.state)return u({currentLocation:t,nextLocation:r,historyAction:n})?s:void 0}}function Ge(e){var t=[];return Q.forEach((function(r,n){e&&!e(n)||(r.cancel(),t.push(n),Q.delete(n))})),t}function Xe(e,t){if(m){var r=m(e,t.map((function(e){return function(e,t){var r=e.route,n=e.pathname,o=e.params;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,M.loaderData)})));return r||e.key}return e.key}function Qe(e,t){if(v&&g){var r=Xe(e,t);v[r]=g()}}function et(e,t){if(v){var r=Xe(e,t),n=v[r];if("number"===typeof n)return n}return null}return P={get basename(){return l},get state(){return M},get routes(){return c},initialize:function(){return h=e.history.listen((function(t){var r=t.action,n=t.location,o=t.delta;if(!te){N(0===ee.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");var a=Ue({currentLocation:M.location,nextLocation:n,historyAction:r});return a&&null!=o?(te=!0,e.history.go(-1*o),void Be(a,{state:"blocked",location:n,proceed:function(){Be(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset:function(){var e=new Map(M.blockers);e.set(a,Ee),re({blockers:e})}})):se(r,n)}te=!1})),M.initialized||se(O.Pop,M.location),P},subscribe:function(e){return p.add(e),function(){return p.delete(e)}},enableScrollRestoration:function(e,t,r){if(v=e,g=t,m=r||null,!b&&M.navigation===we){b=!0;var n=et(M.location,M.matches);null!=n&&re({restoreScrollPosition:n})}return function(){v=null,g=null,m=null}},navigate:ae,fetch:function(e,t,r,n){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");G.has(e)&&Ae(e);var a=s||c,i=Oe(M.location,M.matches,l,d.v7_prependBasename,r,t,null==n?void 0:n.relative),u=W(a,i,l);if(u){var f=Re(d.v7_normalizeFormMethod,!0,i,n),h=f.path,p=f.submission,v=f.error;if(v)Pe(e,t,v);else{var m=st(u,h);U=!0===(n&&n.preventScrollReset),p&&tt(p.formMethod)?function(e,t,r,n,o,a){pe.apply(this,arguments)}(e,t,h,m,u,p):(X.set(e,{routeId:t,path:h}),function(e,t,r,n,o,a){ve.apply(this,arguments)}(e,t,h,m,u,p))}}else Pe(e,t,$e(404,{pathname:i}))},revalidate:function(){_e(),re({revalidation:"loading"}),"submitting"!==M.navigation.state&&("idle"!==M.navigation.state?se(B||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation}):se(M.historyAction,M.location,{startUninterruptedRevalidation:!0}))},createHref:function(t){return e.history.createHref(t)},encodeLocation:function(t){return e.history.encodeLocation(t)},getFetcher:he,deleteFetcher:Te,dispose:function(){h&&h(),p.clear(),j&&j.abort(),M.fetchers.forEach((function(e,t){return Te(t)})),M.blockers.forEach((function(e,t){return Ie(t)}))},getBlocker:function(e,t){var r=M.blockers.get(e)||Ee;return ee.get(e)!==t&&ee.set(e,t),r},deleteBlocker:Ie,_internalFetchControllers:G,_internalActiveDeferreds:Q,_internalSetRoutes:function(e){s=z(e,t,void 0,u={})}},P}Symbol("deferred");function Oe(e,t,r,n,o,a,i){var s,u;if(null!=a&&"path"!==i){s=[];var c,l=T(t);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(s.push(f),f.route.id===a){u=f;break}}}catch(h){l.e(h)}finally{l.f()}}else s=t,u=t[t.length-1];var d=se(o||".",ie(s).map((function(e){return e.pathnameBase})),oe(e.pathname,r)||e.pathname,"path"===i);return null==o&&(d.search=e.search,d.hash=e.hash),null!=o&&""!==o&&"."!==o||!u||!u.route.index||it(d.search)||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(d.pathname="/"===d.pathname?r:ue([r,d.pathname])),B(d)}function Re(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!et(n.formMethod))return{path:r,error:$e(405,{method:n.formMethod})};var o,i,s=function(){return{path:r,error:$e(400,{type:"invalid-body"})}},u=n.formMethod||"get",c=e?u.toUpperCase():u.toLowerCase(),l=Ge(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!tt(c))return s();var f="string"===typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((function(e,t){var r=(0,a.Z)(t,2);return""+e+r[0]+"="+r[1]+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}if("application/json"===n.formEncType){if(!tt(c))return s();try{var d="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch(v){return s()}}}if(Z("function"===typeof FormData,"FormData is not available in this environment"),n.formData)o=Ie(n.formData),i=n.formData;else if(n.body instanceof FormData)o=Ie(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=Be(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{i=Be(o=new URLSearchParams(n.body))}catch(v){return s()}var h={formMethod:c,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(tt(h.formMethod))return{path:r,submission:h};var p=U(r);return t&&p.search&&it(p.search)&&o.append("index",""),p.search="?"+o,{path:B(p),submission:h}}function Pe(e,t){var r=e;if(t){var n=e.findIndex((function(e){return e.route.id===t}));n>=0&&(r=e.slice(0,n))}return r}function je(e,t,r,n,o,a,i,s,u,c,l,f,d,h){var p=h?Object.values(h)[0]:d?Object.values(d)[0]:void 0,v=e.createURL(t.location),m=e.createURL(o),g=h?Object.keys(h)[0]:void 0,b=Pe(r,g).filter((function(e,r){if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){var n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||i.some((function(t){return t===e.route.id})))return!0;var o=t.matches[r],s=e;return Ae(e,A({currentUrl:v,currentParams:o.params,nextUrl:m,nextParams:s.params},n,{actionResult:p,defaultShouldRevalidate:a||v.pathname+v.search===m.pathname+m.search||v.search!==m.search||Te(o,s)}))})),y=[];return u.forEach((function(e,o){if(r.some((function(t){return t.route.id===e.routeId}))){var i=W(l,e.path,f);if(i){var u=t.fetchers.get(o),d=st(i,e.path);!c.has(o)&&(!!s.includes(o)||(u&&"idle"!==u.state&&void 0===u.data?a:Ae(d,A({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a}))))&&y.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})}else y.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null})}})),[b,y]}function Te(e,t){var r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ae(e,t){if(e.route.shouldRevalidate){var r=e.route.shouldRevalidate(t);if("boolean"===typeof r)return r}return t.defaultShouldRevalidate}function De(e,t,r){return Le.apply(this,arguments)}function Le(){return Le=_(C().mark((function e(t,r,n){var o,a,i,s,u,c;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.lazy){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.lazy();case 4:if(o=e.sent,t.lazy){e.next=7;break}return e.abrupt("return");case 7:for(s in Z(a=n[t.id],"No route found in manifest"),i={},o)u=a[s],N(!(c=void 0!==u&&"hasErrorBoundary"!==s),'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+s+'" will be ignored.'),c||H.has(s)||(i[s]=o[s]);Object.assign(a,i),Object.assign(a,A({},r(a),{lazy:void 0}));case 13:case"end":return e.stop()}}),e)}))),Le.apply(this,arguments)}function Ze(e,t,r,n,o,a,i,s){return Ne.apply(this,arguments)}function Ne(){return Ne=_(C().mark((function e(t,r,n,o,a,i,s,u){var c,l,f,d,h,p,v,m,g,b,y,x,w,S,E,k,_,O;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===u&&(u={}),d=function(e){var t,o=new Promise((function(e,r){return t=r}));return f=function(){return t()},r.signal.addEventListener("abort",f),Promise.race([e({request:r,params:n.params,context:u.requestContext}),o])},e.prev=2,h=n.route[t],!n.route.lazy){e.next=30;break}if(!h){e.next=12;break}return e.next=8,Promise.all([d(h),De(n.route,i,a)]);case 8:p=e.sent,l=p[0],e.next=28;break;case 12:return e.next=14,De(n.route,i,a);case 14:if(!(h=n.route[t])){e.next=21;break}return e.next=18,d(h);case 18:l=e.sent,e.next=28;break;case 21:if("action"!==t){e.next=27;break}throw v=new URL(r.url),m=v.pathname+v.search,$e(405,{method:r.method,pathname:m,routeId:n.route.id});case 27:return e.abrupt("return",{type:D.data,data:void 0});case 28:e.next=39;break;case 30:if(h){e.next=36;break}throw g=new URL(r.url),$e(404,{pathname:g.pathname+g.search});case 36:return e.next=38,d(h);case 38:l=e.sent;case 39:Z(void 0!==l,"You defined "+("action"===t?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+t+"` function. Please return a value or `null`."),e.next=46;break;case 42:e.prev=42,e.t0=e.catch(2),c=D.error,l=e.t0;case 46:return e.prev=46,f&&r.signal.removeEventListener("abort",f),e.finish(46);case 49:if(!Qe(l)){e.next=74;break}if(b=l.status,!ye.has(b)){e.next=59;break}if(Z(y=l.headers.get("Location"),"Redirects returned/thrown from loaders/actions must have a Location header"),Ce.test(y)?u.isStaticRequest||(x=new URL(r.url),w=y.startsWith("//")?new URL(x.protocol+y):new URL(y),S=null!=oe(w.pathname,s),w.origin===x.origin&&S&&(y=w.pathname+w.search+w.hash)):y=Oe(new URL(r.url),o.slice(0,o.indexOf(n)+1),s,!0,y),!u.isStaticRequest){e.next=58;break}throw l.headers.set("Location",y),l;case 58:return e.abrupt("return",{type:D.redirect,status:b,location:y,revalidate:null!==l.headers.get("X-Remix-Revalidate")});case 59:if(!u.isRouteRequest){e.next=61;break}throw{type:c||D.data,response:l};case 61:if(!(k=l.headers.get("Content-Type"))||!/\bapplication\/json\b/.test(k)){e.next=68;break}return e.next=65,l.json();case 65:E=e.sent,e.next=71;break;case 68:return e.next=70,l.text();case 70:E=e.sent;case 71:if(c!==D.error){e.next=73;break}return e.abrupt("return",{type:c,error:new he(b,l.statusText,E),headers:l.headers});case 73:return e.abrupt("return",{type:D.data,data:E,statusCode:l.status,headers:l.headers});case 74:if(c!==D.error){e.next=76;break}return e.abrupt("return",{type:c,error:l});case 76:if(!Xe(l)){e.next=78;break}return e.abrupt("return",{type:D.deferred,deferredData:l,statusCode:null==(_=l.init)?void 0:_.status,headers:(null==(O=l.init)?void 0:O.headers)&&new Headers(l.init.headers)});case 78:return e.abrupt("return",{type:D.data,data:l});case 79:case"end":return e.stop()}}),e,null,[[2,42,46,49]])}))),Ne.apply(this,arguments)}function Me(e,t,r,n){var o=e.createURL(Ge(t)).toString(),a={signal:r};if(n&&tt(n.formMethod)){var i=n.formMethod,s=n.formEncType;a.method=i.toUpperCase(),"application/json"===s?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(n.json)):"text/plain"===s?a.body=n.text:"application/x-www-form-urlencoded"===s&&n.formData?a.body=Ie(n.formData):a.body=n.formData}return new Request(o,a)}function Ie(e){var t,r=new URLSearchParams,n=T(e.entries());try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0],s=o[1];r.append(i,"string"===typeof s?s:s.name)}}catch(u){n.e(u)}finally{n.f()}return r}function Be(e){var t,r=new FormData,n=T(e.entries());try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0],s=o[1];r.append(i,s)}}catch(u){n.e(u)}finally{n.f()}return r}function Ue(e,t,r,n,o){var a,i={},s=null,u=!1,c={};return r.forEach((function(r,l){var f=t[l].route.id;if(Z(!Je(r),"Cannot handle redirect results in processLoaderData"),Ve(r)){var d=ze(e,f),h=r.error;n&&(h=Object.values(n)[0],n=void 0),null==(s=s||{})[d.route.id]&&(s[d.route.id]=h),i[f]=void 0,u||(u=!0,a=pe(r.error)?r.error.status:500),r.headers&&(c[f]=r.headers)}else qe(r)?(o.set(f,r.deferredData),i[f]=r.deferredData.data):i[f]=r.data,null==r.statusCode||200===r.statusCode||u||(a=r.statusCode),r.headers&&(c[f]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function Fe(e,t,r,n,o,a,i,s){for(var u=Ue(t,r,n,o,s),c=u.loaderData,l=u.errors,f=0;f=0;t--){var r=e[t];if(Je(r))return{result:r,idx:t}}}function Ge(e){return B(A({},"string"===typeof e?U(e):e,{hash:""}))}function Ye(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}function qe(e){return e.type===D.deferred}function Ve(e){return e.type===D.error}function Je(e){return(e&&e.type)===D.redirect}function Xe(e){var t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}function Qe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function et(e){return be.has(e.toLowerCase())}function tt(e){return me.has(e.toLowerCase())}function rt(e,t,r,n,o,a){return nt.apply(this,arguments)}function nt(){return(nt=_(C().mark((function e(t,r,n,o,a,i){var s,u;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=C().mark((function e(s){var u,c,l,f,d;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=n[s],c=r[s]){e.next=4;break}return e.abrupt("return",1);case 4:if(l=t.find((function(e){return e.route.id===c.route.id})),f=null!=l&&!Te(l,c)&&void 0!==(i&&i[c.route.id]),!qe(u)||!a&&!f){e.next=11;break}return Z(d=o[s],"Expected an AbortSignal for revalidating fetcher deferred result"),e.next=11,ot(u,d,a).then((function(e){e&&(n[s]=e||n[s])}));case 11:case"end":return e.stop()}}),e)})),u=0;case 2:if(!(u=0||Z(!1),a=a.slice(0,Math.min(a.length,s+1))}return a.reduceRight((function(e,n,o){var s=n.route.id?null==i?void 0:i[n.route.id]:null,u=null;r&&(u=n.route.errorElement||At);var l=t.concat(a.slice(0,o+1)),f=function(){var t;return t=s?u:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(Lt,{match:n,routeContext:{outlet:e,matches:l,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?c.createElement(Dt,{location:r.location,revalidation:r.revalidation,component:u,error:s,children:f(),routeContext:{outlet:null,matches:l,isDataRoute:!0}}):f()}),null)}function Nt(e){var t=c.useContext(vt);return t||Z(!1),t}function Mt(e){var t=c.useContext(mt);return t||Z(!1),t}function It(e){var t=function(e){var t=c.useContext(xt);return t||Z(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||Z(!1),r.route.id}function Bt(){var e,t=c.useContext(wt),r=Mt(Tt.UseRouteError),n=It(Tt.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(jt||(jt={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(Tt||(Tt={}));var Ut,Ft=l.startTransition;function Ht(e){var t=e.fallbackElement,r=e.router,n=e.future,o=c.useState(r.state),i=(0,a.Z)(o,2),s=i[0],u=i[1],l=(n||{}).v7_startTransition,f=c.useCallback((function(e){l&&Ft?Ft((function(){return u(e)})):u(e)}),[u,l]);c.useLayoutEffect((function(){return r.subscribe(f)}),[r,f]);var d=c.useMemo((function(){return{createHref:r.createHref,encodeLocation:r.encodeLocation,go:function(e){return r.navigate(e)},push:function(e,t,n){return r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})},replace:function(e,t,n){return r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})}}}),[r]),h=r.basename||"/",p=c.useMemo((function(){return{router:r,navigator:d,static:!1,basename:h}}),[r,d,h]);return c.createElement(c.Fragment,null,c.createElement(vt.Provider,{value:p},c.createElement(mt.Provider,{value:s},c.createElement($t,{basename:h,location:s.location,navigationType:s.historyAction,navigator:d},s.initialized?c.createElement(zt,{routes:r.routes,state:s}):t))),null)}function zt(e){return Rt(e.routes,void 0,e.state)}function Wt(e){return function(e){var t=c.useContext(xt).outlet;return t?c.createElement(_t.Provider,{value:e},t):t}(e.context)}function $t(e){var t=e.basename,r=void 0===t?"/":t,n=e.children,o=void 0===n?null:n,a=e.location,i=e.navigationType,s=void 0===i?O.Pop:i,u=e.navigator,l=e.static,f=void 0!==l&&l;St()&&Z(!1);var d=r.replace(/^\/*/,"/"),h=c.useMemo((function(){return{basename:d,navigator:u,static:f}}),[d,u,f]);"string"===typeof a&&(a=U(a));var p=a,v=p.pathname,m=void 0===v?"/":v,g=p.search,b=void 0===g?"":g,y=p.hash,x=void 0===y?"":y,w=p.state,S=void 0===w?null:w,E=p.key,C=void 0===E?"default":E,k=c.useMemo((function(){var e=oe(m,d);return null==e?null:{location:{pathname:e,search:b,hash:x,state:S,key:C},navigationType:s}}),[d,m,b,x,S,C,s]);return null==k?null:c.createElement(bt.Provider,{value:h},c.createElement(yt.Provider,{children:o,value:k}))}!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Ut||(Ut={}));var Kt=new Promise((function(){}));c.Component;function Gt(e){var t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:c.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:c.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[r]=e[r]);return o}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);var Vt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Jt=["aria-current","caseSensitive","className","end","style","to","children"];function Xt(){var e,t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Yt({},t,{errors:Qt(t.errors)})),t}function Qt(e){if(!e)return null;for(var t={},r=0,n=Object.entries(e);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function yr(e,t){var r=e.title,n=e.titleId,o=br(e,mr);return c.createElement("svg",gr({viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:14,height:14,ref:t,"aria-labelledby":n},o),r?c.createElement("title",{id:n},r):null,fr||(fr=c.createElement("path",{d:"M971.6736 445.2352L594.8416 53.3504a122.2656 122.2656 0 0 0-176.5376 0L41.5744 445.2352c-38.912 40.96-33.8944 75.4688-27.5456 90.0096a65.536 65.536 0 0 0 64.6144 38.912h55.296v301.4656c0 68.4032 49.152 133.12 119.0912 133.12h160.3584V689.4592c0-34.2016-5.12-53.248 29.7984-53.248h126.7712c35.0208 0 29.7984 19.0464 29.7984 53.248v319.0784h160.4608c69.8368 0 119.0912-64.512 119.0912-133.12V574.1568h55.1936a65.536 65.536 0 0 0 64.6144-38.912c6.4512-14.5408 11.4688-49.5616-27.4432-90.0096z",fill:"currentColor"})))}var xr,wr,Sr,Er,Cr,kr=c.forwardRef(yr),_r=(r.p,hr.ZP.div(xr||(xr=(0,i.Z)(["\n text-align: center;\n max-width: 560px;\n margin: 0 auto;\n > span {\n background-color: var(--color-theme-bg);\n padding: 0 5px;\n }\n"])))),Or=hr.ZP.div(wr||(wr=(0,i.Z)(["\n text-align: center;\n font-size: 124px;\n padding: 100px 0 32px 0;\n"]))),Rr=hr.ZP.header(Sr||(Sr=(0,i.Z)(["\n max-width: 860px;\n margin: 0 auto;\n padding: 21px 0;\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n a {\n margin: 6px 10px;\n padding: 5px 10px;\n background-color: #e6e6e6;\n box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px;\n border-radius: 5px;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: #333;\n transition: background-color 0.3s;\n &.comps {\n background: #10b316;\n color: white !important;\n }\n &.active {\n color: white;\n background: #333 !important;\n }\n svg {\n margin-right: 5px;\n }\n }\n"]))),Pr=function(){var e=(0,c.useContext)(pr._y),t=e.hsva,r=e.dispatch;return(0,y.jsx)(vr.default,{color:t,style:{margin:"20px auto 0 auto"},onChange:function(e){r({hsva:(0,o.Z)((0,o.Z)({},t),e.hsva)})}})};function jr(e){var t=e.menus;return(0,y.jsxs)("div",{children:[(0,y.jsx)(Or,{children:"\ud83c\udfa8"}),(0,y.jsxs)(_r,{children:[(0,y.jsxs)("span",{children:[(0,y.jsx)("b",{children:"react-color"})," is a tiny color picker widget component for react apps. These components can be installed and used separately."]}),(0,y.jsx)(Pr,{})]}),(0,y.jsx)(Rr,{children:t.map((function(e,t){return e.path?(0,y.jsxs)(nr,{to:e.path,className:e.isComp?"comps":"",children:["/"===e.path&&(0,y.jsx)(kr,{}),(0,y.jsx)("span",{children:e.label})]},t):null}))})]})}var Tr=hr.ZP.div(Er||(Er=(0,i.Z)(["\n transition: background-color 0.3s ease 0s;\n min-height: 100vh;\n dark-mode {\n font-size: 18px;\n position: fixed;\n top: 10px;\n left: 10px;\n }\n"]))),Ar=hr.ZP.div(Cr||(Cr=(0,i.Z)(["\n position: fixed;\n left: 88px;\n top: 12px;\n background: var(--color-theme-bg);\n border-radius: 3px;\n padding: 0px 6px;\n"])));function Dr(e,t){if(null==e)return{};var r,n,o=(0,u.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Lr=["children"],Zr={path:"/",Component:function(){var e=(0,c.useReducer)(pr.I6,pr.Of),t=(0,a.Z)(e,2),r=t[0],n=t[1];(0,c.useEffect)((function(){document.body.style.background="url(".concat(S.BACKGROUND_IMG,") left center"),document.body.style.backgroundAttachment="fixed"}),[]);var i=r.hsva;return(0,c.useEffect)((function(){document.documentElement.style.backgroundColor=(0,dr.hsvaToHslaString)(i)}),[i]),(0,y.jsx)(pr._y.Provider,{value:(0,o.Z)((0,o.Z)({},r),{},{dispatch:n}),children:(0,y.jsxs)(Tr,{style:{backgroundColor:(0,dr.hsvaToHslaString)(r.hsva)},children:[(0,y.jsx)("dark-mode",{permanent:!0,light:"Dark",dark:"Light"}),(0,y.jsxs)(Ar,{children:["v","1.3.4"]}),(0,y.jsx)(w,{fixed:!0,zIndex:99,size:60,target:"__blank",href:"https://github.com/uiwjs/react-color"}),(0,y.jsx)(jr,{menus:Zr.children||[]}),(0,y.jsx)(Wt,{}),(0,y.jsx)(ir,{})]})})},ErrorBoundary:(0,c.forwardRef)((function(e,t){e.children;var r=Dr(e,Lr),n=Bt();return(0,y.jsxs)("div",(0,o.Z)((0,o.Z)({id:"error-page"},r),{},{ref:t,children:[(0,y.jsx)("h1",{children:"Oops!"}),(0,y.jsx)("p",{children:"\u62b1\u6b49\uff0c\u53d1\u751f\u4e86\u610f\u5916\u9519\u8bef\u3002"}),(0,y.jsxs)("p",{children:[(null===n||void 0===n?void 0:n.status)&&(0,y.jsx)("em",{children:null===n||void 0===n?void 0:n.status}),(null===n||void 0===n?void 0:n.statusText)&&(0,y.jsx)("i",{children:decodeURI((null===n||void 0===n?void 0:n.statusText)||"")})]})]}))})),children:[{path:"/",label:"Home",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(31),r.e(281)]).then(r.bind(r,1281))}},{path:"/colorful",label:"Colorful",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(113)]).then(r.bind(r,5782))}},{path:"/sketch",label:"Sketch",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(308)]).then(r.bind(r,7711))}},{path:"/block",label:"Block",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(494)]).then(r.bind(r,5545))}},{path:"/circle",label:"Circle",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(785)]).then(r.bind(r,308))}},{path:"/compact",label:"Compact",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(952)]).then(r.bind(r,7216))}},{path:"/wheel",label:"Wheel",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(919)]).then(r.bind(r,9014))}},{path:"/github",label:"Github",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(781)]).then(r.bind(r,1956))}},{path:"/material",label:"Material",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(955)]).then(r.bind(r,3100))}},{path:"/chrome",label:"Chrome",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(31),r.e(446)]).then(r.bind(r,9446))}},{path:"/alpha",label:"Alpha",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(546)]).then(r.bind(r,9522))}},{path:"/editable-input",label:"EditableInput",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(756)]).then(r.bind(r,737))}},{path:"/editable-input-hsla",label:"EditableInputHsla",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(569)]).then(r.bind(r,6419))}},{path:"/editable-input-rgba",label:"EditableInputRgba",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(309)]).then(r.bind(r,2943))}},{path:"/hue",label:"Hue",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(297)]).then(r.bind(r,1144))}},{path:"/name",label:"Name",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(466)]).then(r.bind(r,8982))}},{path:"/saturation",label:"Saturation",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(649)]).then(r.bind(r,710))}},{path:"/shade-slider",label:"ShadeSlider",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(620)]).then(r.bind(r,3743))}},{path:"/slider",label:"Slider",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(875)]).then(r.bind(r,1983))}},{path:"/swatch",label:"Swatch",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(118)]).then(r.bind(r,8865))}},{path:"/drag-event-interactive",label:"Interactive",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(94)]).then(r.bind(r,5991))}},{path:"/convert",label:"Convert",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(721)]).then(r.bind(r,704))}}]},Nr=["children","style"],Mr={display:"flex",alignItems:"center",justifyContent:"center",gap:"1rem",left:0,right:0,top:0,bottom:0,position:"absolute",zIndex:9999},Ir=function(e){var t=e.children,r=e.style,n=Dr(e,Nr);return(0,y.jsxs)("div",(0,o.Z)((0,o.Z)({},n),{},{style:(0,o.Z)((0,o.Z)({},Mr),r),children:[(0,y.jsxs)("svg",{width:"25",height:"30",viewBox:"0 0 135 140",fill:"currentColor",children:[(0,y.jsxs)("rect",{y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"60",width:"15",height:"140",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]})]}),(0,y.jsx)("div",{children:t||"Loading..."})]}))},Br=document.getElementById("root");(0,n.s)(Br).render((0,y.jsx)(Ht,{router:function(e,t){return _e({basename:null==t?void 0:t.basename,future:Yt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),F((function(e,t){var r=U(e.location.hash.substr(1)),n=r.pathname,o=void 0===n?"/":n,a=r.search,i=void 0===a?"":a,s=r.hash;return I("",{pathname:o,search:i,hash:void 0===s?"":s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){var r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){var o=e.location.href,a=o.indexOf("#");n=-1===a?o:o.slice(0,a)}return n+"#"+("string"===typeof t?t:B(t))}),(function(e,t){N("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||Xt(),routes:e,mapRouteProperties:Gt}).initialize();var r}([Zr]),fallbackElement:(0,y.jsx)(Ir,{})}))},6155:function(e,t,r){var n=r(8983).default,o=r(2081).default,a=r(7266).default,i=r(8724).default,s=r(670).default,u=r(9952).default,c=r(3231).default,l=document,f="_dark_mode_theme_",d="permanent",h="colorschemechange",p="light",v="dark",m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){var e=this.getAttribute(t);return null===e?"":e},set:function(e){this.setAttribute(t,e)}})},g=function(e){"use strict";i(r,e);var t=s(r);function r(){var e;return n(this,r),e=t.call(this),c(a(e),"LOCAL_NANE",f),e.t(),e}return o(r,[{key:"connectedCallback",value:function(){var e=this;m(this,"mode"),m(this,v),m(this,p),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){return this.hasAttribute(t)},set:function(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,d);var t=localStorage.getItem(f);t&&[p,v].includes(t)&&(this.mode=t,this.permanent=!0),this.permanent&&!t&&localStorage.setItem(f,this.mode);var r=[p,v].includes(t);this.permanent&&t?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=v,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=p,this.o())),this.permanent||r||(window.matchMedia("(prefers-color-scheme: light)").onchange=function(t){e.mode=t.matches?p:v,e.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=function(t){e.mode=t.matches?v:p,e.o()}),new MutationObserver((function(t,n){e.mode=l.documentElement.dataset.colorMode,e.permanent&&r&&(localStorage.setItem(f,e.mode),e.i("permanentcolorscheme",{permanent:e.permanent})),e.h(),e.i(h,{colorScheme:e.mode})})).observe(l.documentElement,{attributes:!0}),this.i(h,{colorScheme:this.mode}),this.h()}},{key:"attributeChangedCallback",value:function(e,t,r){if("mode"===e&&t!==r&&[p,v].includes(r)){var n=localStorage.getItem(f);this.mode===n?(this.mode=r,this.h(),this.o()):this.mode&&this.mode!==n&&(this.h(),this.o())}else e!==p&&e!==v||t===r||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(f,this.mode):localStorage.removeItem(f))}},{key:"o",value:function(){l.documentElement.setAttribute("data-color-mode",this.mode)}},{key:"h",value:function(){this.icon.textContent=this.mode===p?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===p?this.getAttribute(v):this.getAttribute(p),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}},{key:"t",value:function(){var e=this,t=this.attachShadow({mode:"open"});this.label=l.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=function(){e.mode=e.mode===p?v:p,e.permanent&&localStorage.setItem(f,e.mode),e.o(),e.h()},t.appendChild(this.label),this.icon=l.createElement("span"),this.label.appendChild(this.icon),this.text=l.createElement("span"),this.label.appendChild(this.text);var r="_dark_mode_style_";if(!l.getElementById(r)){var n=l.createElement("style");n.id=r,n.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",l.head.appendChild(n)}var o=l.createElement("style");o.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",t.appendChild(o)}},{key:"i",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}],[{key:"observedAttributes",get:function(){return["mode",p,v,d]}}]),r}(u(HTMLElement));customElements.define("dark-mode",g)},1713:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r>>1,o=e[n];if(!(0>>1;na(u,r))ca(l,u)?(e[n]=l,e[c]=r,n=c):(e[n]=u,e[s]=r,n=s);else{if(!(ca(l,r)))break e;e[n]=l,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var c=[],l=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,g="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(l);null!==t;){if(null===t.callback)o(l);else{if(!(t.startTime<=e))break;o(l),t.sortIndex=t.expirationTime,r(c,t)}t=n(l)}}function w(e){if(m=!1,x(e),!v)if(null!==n(c))v=!0,D(S);else{var t=n(l);null!==t&&L(w,t.startTime-e)}}function S(e,r){v=!1,m&&(m=!1,b(_),_=-1),p=!0;var a=h;try{for(x(r),d=n(c);null!==d&&(!(d.expirationTime>r)||e&&!P());){var i=d.callback;if("function"===typeof i){d.callback=null,h=d.priorityLevel;var s=i(d.expirationTime<=r);r=t.unstable_now(),"function"===typeof s?d.callback=s:d===n(c)&&o(c),x(r)}else o(c);d=n(c)}if(null!==d)var u=!0;else{var f=n(l);null!==f&&L(w,f.startTime-r),u=!1}return u}finally{d=null,h=a,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,C=!1,k=null,_=-1,O=5,R=-1;function P(){return!(t.unstable_now()-Re||125i?(e.sortIndex=a,r(l,e),null===n(c)&&e===n(l)&&(m?(b(_),_=-1):m=!0,L(w,a-i))):(e.sortIndex=s,r(c,e),v||p||(v=!0,D(S))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}},7029:function(e,t,r){"use strict";e.exports=r(4478)},1985:function(e){e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),u=0;u0?C(Z,--D):0,T--,10===L&&(T=1,j--),L}function U(){return L=D2||W(L)>3?"":" "}function q(e,t){for(;--t&&U()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return z(e,H()+(t<6&&32==F()&&32==U()))}function V(e){for(;U();)switch(L){case e:return D;case 34:case 39:34!==e&&39!==e&&V(L);break;case 40:41===e&&V(e);break;case 92:U()}return D}function J(e,t){for(;U()&&e+L!==57&&(e+L!==84||47!==F()););return"/*"+z(t,D-1)+"*"+b(47===e?e:U())}function X(e){for(;!W(F());)U();return z(e,D)}function Q(e,t){for(var r="",n=0;n6)switch(C(e,t+1)){case 109:if(45!==C(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+l+"$2-$3$1"+c+(108==C(e,t+3)?"$3":"$2-$3"))+e;case 115:return~E(e,"stretch")?te(S(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,r,n,o,a,i,s){return u+r+":"+n+s+(o?u+r+"-span:"+(a?i:+i-+n)+s:"")+e}));case 4949:if(121===C(e,t+6))return S(e,":",":"+l)+e;break;case 6444:switch(C(e,45===C(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+l+(45===C(e,14)?"inline-":"")+"box$3$1"+l+"$2$3$1"+u+"$2box$3")+e;case 100:return S(e,":",":"+u)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function re(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case h:return void(e.return=te(e.value,e.length,r));case v:return Q([M(e,{value:S(e.value,"@","@"+l)})],n);case d:if(e.length)return function(e,t){return e.map(t).join("")}(r=e.props,(function(t){switch(w(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":I(M(e,{props:[S(t,/:(read-\w+)/,":"+c+"$1")]})),I(M(e,{props:[t]})),y(e,{props:P(r,n)});break;case"::placeholder":I(M(e,{props:[S(t,/:(plac\w+)/,":"+l+"input-$1")]})),I(M(e,{props:[S(t,/:(plac\w+)/,":"+c+"$1")]})),I(M(e,{props:[S(t,/:(plac\w+)/,u+"input-$1")]})),I(M(e,{props:[t]})),y(e,{props:P(r,n)})}return""}))}}function ne(e){return K(oe("",null,null,null,[""],e=$(e),0,[0],e))}function oe(e,t,r,n,o,a,i,s,u){for(var c=0,l=0,f=i,d=0,h=0,p=0,v=1,m=1,g=1,y=0,x="",w=o,k=a,O=n,P=x;m;)switch(p=y,y=U()){case 40:if(108!=p&&58==C(P,f-1)){-1!=E(P+=S(G(y),"&","&\f"),"&\f")&&(g=-1);break}case 34:case 39:case 91:P+=G(y);break;case 9:case 10:case 13:case 32:P+=Y(p);break;case 92:P+=q(H()-1,7);continue;case 47:switch(F()){case 42:case 47:R(ie(J(U(),H()),t,r,u),u);break;default:P+="/"}break;case 123*v:s[c++]=_(P)*g;case 125*v:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+l:-1==g&&(P=S(P,/\f/g,"")),h>0&&_(P)-f&&R(h>32?se(P+";",n,r,f-1,u):se(S(P," ","")+";",n,r,f-2,u),u);break;case 59:P+=";";default:if(R(O=ae(P,t,r,c,l,o,s,x,w=[],k=[],f,a),a),123===y)if(0===l)oe(P,t,O,O,w,a,f,s,k);else switch(99===d&&110===C(P,3)?100:d){case 100:case 108:case 109:case 115:oe(e,O,O,n&&R(ae(e,O,O,0,0,o,s,x,o,w=[],f,k),k),o,k,f,s,n?w:k);break;default:oe(P,O,O,O,[""],k,0,s,k)}}c=l=h=0,v=g=1,x=P="",f=i;break;case 58:f=1+_(P),h=p;default:if(v<1)if(123==y)--v;else if(125==y&&0==v++&&125==B())continue;switch(P+=b(y),y*v){case 38:g=l>0?1:(P+="\f",-1);break;case 44:s[c++]=(_(P)-1)*g,g=1;break;case 64:45===F()&&(P+=G(U())),d=F(),l=f=_(x=P+=X(H())),y++;break;case 45:45===p&&2==_(P)&&(v=0)}}return a}function ae(e,t,r,n,o,a,i,s,u,c,l,f){for(var h=o-1,p=0===o?a:[""],v=O(p),m=0,b=0,y=0;m0?p[w]+" "+E:S(E,/&\f/g,p[w])))&&(u[y++]=C);return N(e,t,r,0===o?d:s,u,c,l,f)}function ie(e,t,r,n){return N(e,t,r,f,b(L),k(e,2,-2),0,n)}function se(e,t,r,n,o){return N(e,t,r,h,k(e,0,n),k(e,n+1,-1),n,o)}var ue={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce=r(1713),le="undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",fe="undefined"!=typeof window&&"HTMLElement"in window,de=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),he=(new Set,Object.freeze([])),pe=Object.freeze({});function ve(e,t,r){return void 0===r&&(r=pe),e.theme!==r.theme&&e.theme||t||r.theme}var me=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ge=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function ye(e){return e.replace(ge,"-").replace(be,"")}var xe=/(a)(d)/gi,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function Se(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=we(t%52)+r;return(we(t%52)+r).replace(xe,"$1-$2")}var Ee,Ce=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ke=function(e){return Ce(5381,e)};function _e(e){return Se(ke(e)>>>0)}function Oe(e){return"string"==typeof e&&!0}var Re="function"==typeof Symbol&&Symbol.for,Pe=Re?Symbol.for("react.memo"):60115,je=Re?Symbol.for("react.forward_ref"):60112,Te={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},De={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Le=((Ee={})[je]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ee[Pe]=De,Ee);function Ze(e){return("type"in(t=e)&&t.type.$$typeof)===Pe?De:"$$typeof"in e?Le[e.$$typeof]:Te;var t}var Ne=Object.defineProperty,Me=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Be=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,Fe=Object.prototype;function He(e,t,r){if("string"!=typeof t){if(Fe){var n=Ue(t);n&&n!==Fe&&He(e,n,r)}var o=Me(t);Ie&&(o=o.concat(Ie(t)));for(var a=Ze(e),i=Ze(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var Je=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)if((o<<=1)<0)throw Ve(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(u+="".concat(e,","))})),n+="".concat(i).concat(s,'{content:"').concat(u,'"}').concat("/*!sc*/\n")},a=0;a0?".".concat(t):e},l=u.slice();l.push((function(e){e.type===d&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(vt,r).replace(n,c))})),i.prefix&&l.push(re),l.push(ee);var f=function(e,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,r=o,n=new RegExp("\\".concat(r,"\\b"),"g");var u=e.replace(mt,""),c=ne(a||o?"".concat(a," ").concat(o," { ").concat(u," }"):u);i.namespace&&(c=gt(c,i.namespace));var f,d=[];return Q(c,function(e){var t=O(e);return function(r,n,o,a){for(var i="",s=0;s="A"&&e<="Z"};function Ot(e){for(var t="",r=0;r>>0);if(!t.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,i)}n=$e(n,a),this.staticRulesId=a}else{for(var s=Ce(this.baseHash,r.hash),u="",c=0;c>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,r(u,".".concat(d),void 0,this.componentId)),n=$e(n,d)}}return n},e}(),Lt=a.createContext(void 0);Lt.Consumer;var Zt={};new Set;function Nt(e,t,r){var o=We(e),i=e,s=!Oe(e),u=t.attrs,c=void 0===u?he:u,l=t.componentId,f=void 0===l?function(e,t){var r="string"!=typeof e?"sc":ye(e);Zt[r]=(Zt[r]||0)+1;var n="".concat(r,"-").concat(_e("6.0.8"+r+Zt[r]));return t?"".concat(t,"-").concat(n):n}(t.displayName,t.parentComponentId):l,d=t.displayName,h=(void 0===d&&function(e){Oe(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||f),p=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,v=t.shouldForwardProp;if(o&&i.shouldForwardProp){var m=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;v=function(e,t){return m(e,t)&&g(e,t)}}else v=m}var b=new Dt(r,h,o?i.componentStyle:void 0);var y=a.forwardRef((function(e,t){return function(e,t,r){var o=e.attrs,i=e.componentStyle,s=e.defaultProps,u=e.foldedComponentIds,c=e.styledComponentId,l=e.target,f=a.useContext(Lt),d=Et(),h=e.shouldForwardProp||d.shouldForwardProp,p=function(e,t,r){for(var o,a=n(n({},t),{className:void 0,theme:r}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)}}();(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=st(),n=Ke([r&&'nonce="'.concat(r,'"'),"".concat(le,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ve(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ve(2);var r=((t={})[le]="",t["data-styled-version"]="6.0.8",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=st();return o&&(r.nonce=o),[a.createElement("style",n({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ve(2);return a.createElement(Ct,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ve(3)}})(),"__sc-".concat(le,"__")},7240:function(e,t,r){"use strict";r.r(t),r.d(t,{BACKGROUND_IMG:function(){return d},Pointer:function(){return l},default:function(){return p}});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),u=r(4760),c=["className","prefixCls","left","top","style","fillProps"],l=function(e){var t=e.className,r=e.prefixCls,a=e.left,i=e.top,s=e.style,l=e.fillProps,f=(0,o.Z)(e,c),d=(0,n.Z)({},s,{position:"absolute",left:a,top:i}),h=(0,n.Z)({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==l?void 0:l.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,u.jsx)("div",(0,n.Z)({className:r+"-pointer "+(t||""),style:d},f,{children:(0,u.jsx)("div",(0,n.Z)({className:r+"-fill"},l,{style:h}))}))},f=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",h=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-alpha":r,c=e.className,h=e.hsva,p=e.background,v=e.bgProps,m=void 0===v?{}:v,g=e.innerProps,b=void 0===g?{}:g,y=e.pointerProps,x=void 0===y?{}:y,w=e.radius,S=void 0===w?0:w,E=e.width,C=e.height,k=void 0===C?16:C,_=e.direction,O=void 0===_?"horizontal":_,R=e.style,P=e.onChange,j=e.pointer,T=(0,o.Z)(e,f),A=function(e){P&&P((0,n.Z)({},h,{a:"horizontal"===O?e.left:e.top}),e)},D=(0,i.hsvaToHslaString)(Object.assign({},h,{a:1})),L="linear-gradient(to "+("horizontal"===O?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+D+" 100%)",Z={};"horizontal"===O?Z.left=100*h.a+"%":Z.top=100*h.a+"%";var N=(0,n.Z)({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:S,background:"url("+d+") left center",backgroundColor:"var(--alpha-background-color)"},R,{position:"relative"},{width:E,height:k}),M=j&&"function"===typeof j?j((0,n.Z)({prefixCls:a},x,Z)):(0,u.jsx)(l,(0,n.Z)({},x,{prefixCls:a},Z));return(0,u.jsxs)("div",(0,n.Z)({},T,{className:[a,a+"-"+O,c||""].filter(Boolean).join(" "),style:N,ref:t,children:[(0,u.jsx)("div",(0,n.Z)({},m,{style:(0,n.Z)({inset:0,position:"absolute",background:p||L,borderRadius:S},m.style)})),(0,u.jsx)(s.default,(0,n.Z)({},b,{style:(0,n.Z)({},b.style,{inset:0,zIndex:1,position:"absolute"}),onMove:A,onDown:A,children:M}))]}))}));h.displayName="Alpha";var p=h},7961:function(e,t,r){"use strict";r.d(t,{Q:function(){return o}});var n=r(6493),o=function(e){if(!e)return"#ffffff";var t=(0,n.color)(e);return(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000000":"#ffffff"}},6493:function(e,t,r){"use strict";r.r(t),r.d(t,{color:function(){return M},equalColorObjects:function(){return a.zl},equalColorString:function(){return a.SJ},equalHex:function(){return a.Gp},getContrastingColor:function(){return i.Q},hexToHsva:function(){return O},hexToRgba:function(){return R},hslStringToHsla:function(){return p},hslStringToHsva:function(){return m},hslaStringToHsva:function(){return v},hslaToHsl:function(){return D},hslaToHsva:function(){return g},hsvStringToHsva:function(){return S},hsvaStringToHsva:function(){return y},hsvaToHex:function(){return L},hsvaToHexa:function(){return Z},hsvaToHslString:function(){return l},hsvaToHsla:function(){return b},hsvaToHslaString:function(){return h},hsvaToHsv:function(){return N},hsvaToHsvString:function(){return f},hsvaToHsvaString:function(){return d},hsvaToRgbString:function(){return j},hsvaToRgba:function(){return P},hsvaToRgbaString:function(){return T},parseHue:function(){return w},rgbStringToHsva:function(){return C},rgbaStringToHsva:function(){return E},rgbaToHex:function(){return k},rgbaToHexa:function(){return _},rgbaToHsva:function(){return c},rgbaToRgb:function(){return A},validHex:function(){return a.Ff}});var n=r(1026),o=r(5773),a=r(5301),i=r(7961),s=255,u=100,c=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),c=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(c<0?c+6:c),s:a?i/a*u:0,v:a/s*u,a:o}},l=function(e){var t=b(e),r=t.h,n=t.s,o=t.l;return"hsl("+r+", "+Math.round(n)+"%, "+Math.round(o)+"%)"},f=function(e){return"hsv("+e.h+", "+e.s+"%, "+e.v+"%)"},d=function(e){return"hsva("+e.h+", "+e.s+"%, "+e.v+"%, "+e.a+")"},h=function(e){var t=b(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},p=function(e){var t=(e.match(/\d+/g)||[]).map(Number),r=(0,n.Z)(t,4);return{h:r[0],s:r[1],l:r[2],a:r[3]}},v=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?g({h:w(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},m=v,g=function(e){var t=e.h,r=e.s,n=e.l,o=e.a;return{h:t,s:(r*=(n<50?n:u-n)/u)>0?2*r/(n+r)*u:0,v:n+r,a:o}},b=function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=(200-r)*n/u;return{h:t,s:a>0&&a<200?r*n/u/(a<=u?a:200-a)*u:0,l:a/2,a:o}},y=function(e){var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?{h:w(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?u:1)}:{h:0,s:0,v:0,a:1}},x={grad:.9,turn:360,rad:360/(2*Math.PI)},w=function(e,t){return void 0===t&&(t="deg"),Number(e)*(x[t]||1)},S=y,E=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?c({r:Number(t[1])/(t[2]?u/s:1),g:Number(t[3])/(t[4]?u/s:1),b:Number(t[5])/(t[6]?u/s:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?u:1)}):{h:0,s:0,v:0,a:1}},C=E,k=function(e){var t,r=e.r,n=e.g,o=e.b;return"#"+(t=(r<<16|n<<8|o).toString(16),new Array(7-t.length).join("0")+t)},_=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a="number"===typeof o&&(255*o|256).toString(16).slice(1);return""+k({r:t,g:r,b:n,a:o})+(a||"")},O=function(e){return c(R(e))},R=function(e){var t=e.replace("#","");/^#?/.test(e)&&3===t.length&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),o=e.match(r).map((function(e){return parseInt(e,16)})),a=(0,n.Z)(o,4),i=a[0],u=a[1],c=a[2],l=void 0===c?0:c,f=a[3];return{r:i,g:u,b:l,a:(null!=f?f:255)/s}},P=function(e){var t=e.h,r=e.s,n=e.v,a=e.a,i=t/60,c=r/u,l=n/u,f=Math.floor(i)%6,d=i-Math.floor(i),h=s*l*(1-c),p=s*l*(1-c*d),v=s*l*(1-c*(1-d));l*=s;var m={};switch(f){case 0:m.r=l,m.g=v,m.b=h;break;case 1:m.r=p,m.g=l,m.b=h;break;case 2:m.r=h,m.g=l,m.b=v;break;case 3:m.r=h,m.g=p,m.b=l;break;case 4:m.r=v,m.g=h,m.b=l;break;case 5:m.r=l,m.g=h,m.b=p}return m.r=Math.round(m.r),m.g=Math.round(m.g),m.b=Math.round(m.b),(0,o.Z)({},m,{a:a})},j=function(e){var t=P(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},T=function(e){var t=P(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},A=function(e){return{r:e.r,g:e.g,b:e.b}},D=function(e){return{h:e.h,s:e.s,l:e.l}},L=function(e){return k(P(e))},Z=function(e){return _(P(e))},N=function(e){return{h:e.h,s:e.s,v:e.v}},M=function(e){var t,r,n,o,i,s,u,c;return"string"===typeof e&&(0,a.Ff)(e)?(s=O(e),u=e):"string"!==typeof e&&(s=e),s&&(n=N(s),i=b(s),o=P(s),c=_(o),u=L(s),r=D(i),t=A(o)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:u,hexa:c}}},5301:function(e,t,r){"use strict";r.d(t,{Ff:function(){return s},Gp:function(){return i},SJ:function(){return a},zl:function(){return o}});var n=r(6493),o=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},a=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},i=function(e,t){return e.toLowerCase()===t.toLowerCase()||o((0,n.hexToRgba)(e),(0,n.hexToRgba)(t))},s=function(e){return/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e)}},3789:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(8702),s=r(6493),u=r(4760),c=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],l=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-editable-input-rgba":r,l=e.hsva,f=e.placement,d=void 0===f?"bottom":f,h=e.rProps,p=void 0===h?{}:h,v=e.gProps,m=void 0===v?{}:v,g=e.bProps,b=void 0===g?{}:g,y=e.aProps,x=void 0===y?{}:y,w=e.className,S=e.style,E=e.onChange,C=(0,o.Z)(e,c),k=l?(0,s.hsvaToRgba)(l):{};function _(e){var t=Number(e.target.value);t&&t>255&&(e.target.value="255"),t&&t<0&&(e.target.value="0")}var O=function(e,t,r){"number"===typeof e&&("a"===t&&(e<0&&(e=0),e>100&&(e=100),E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{a:e/100}))))),e>255&&(e=255,r.target.value="255"),e<0&&(e=0,r.target.value="0"),"r"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{r:e})))),"g"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{g:e})))),"b"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{b:e})))))};return(0,u.jsxs)("div",(0,n.Z)({ref:t,className:[a,w||""].filter(Boolean).join(" ")},C,{style:(0,n.Z)({fontSize:11,display:"flex"},S),children:[(0,u.jsx)(i.default,(0,n.Z)({label:"R",value:k.r||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"r",e)}},p,{style:(0,n.Z)({},p.style)})),(0,u.jsx)(i.default,(0,n.Z)({label:"G",value:k.g||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"g",e)}},m,{style:(0,n.Z)({marginLeft:5},p.style)})),(0,u.jsx)(i.default,(0,n.Z)({label:"B",value:k.b||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"b",e)}},b,{style:(0,n.Z)({marginLeft:5},b.style)})),x&&(0,u.jsx)(i.default,(0,n.Z)({label:"A",value:k.a?parseInt(String(100*k.a),10):0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"a",e)}},x,{style:(0,n.Z)({marginLeft:5},x.style)}))]}))}));l.displayName="EditableInputRGBA",t.default=l},8702:function(e,t,r){"use strict";r.r(t);var n=r(1026),o=r(5773),a=r(808),i=r(8573),s=r(4760),u=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],c=i.forwardRef((function(e,t){var r=e.prefixCls,c=void 0===r?"w-color-editable-input":r,l=e.placement,f=void 0===l?"bottom":l,d=e.label,h=e.value,p=e.className,v=e.style,m=e.labelStyle,g=e.inputStyle,b=e.onChange,y=e.onBlur,x=(0,a.Z)(e,u),w=(0,i.useState)(h),S=(0,n.Z)(w,2),E=S[0],C=S[1],k=(0,i.useRef)(!1);(0,i.useEffect)((function(){e.value!==E&&(k.current||C(e.value))}),[e.value]);var _={};"bottom"===f&&(_.flexDirection="column"),"top"===f&&(_.flexDirection="column-reverse"),"left"===f&&(_.flexDirection="row-reverse");var O=(0,o.Z)({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},_,v),R=(0,o.Z)({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},g);return(0,s.jsxs)("div",{className:[c,p||""].filter(Boolean).join(" "),style:O,children:[(0,s.jsx)("input",(0,o.Z)({ref:t,value:E,onChange:function(e,t){var r=t||e.target.value;/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(r)&&b&&b(e,r);var n=function(e){return Number(String(e).replace(/%/g,""))}(r);isNaN(n)||b&&b(e,n),C(r)},onBlur:function(t){k.current=!1,C(e.value),y&&y(t)},autoComplete:"off",onFocus:function(){return k.current=!0}},x,{style:R})),d&&(0,s.jsx)("span",{style:(0,o.Z)({color:"var(--editable-input-label-color)",textTransform:"capitalize"},m),children:d})]})}));c.displayName="EditableInput",t.default=c},7864:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(7240),s=r(4760),u=["prefixCls","className","hue","onChange","direction"],c=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-hue":r,c=e.className,l=e.hue,f=void 0===l?0:l,d=e.onChange,h=e.direction,p=void 0===h?"horizontal":h,v=(0,o.Z)(e,u);return(0,s.jsx)(i.default,(0,n.Z)({ref:t,className:a+" "+(c||"")},v,{direction:p,background:"linear-gradient(to "+("horizontal"===p?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:f,s:100,v:100,a:f/360},onChange:function(e,t){d&&d({h:"horizontal"===p?360*t.left:360*t.top})}}))}));c.displayName="Hue",t.default=c},6319:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return d}});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),u=r(4760),c=function(e){var t=e.className,r=e.color,n=e.left,o=e.top,i=e.prefixCls,s={position:"absolute",top:o,left:n},c={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return(0,a.useMemo)((function(){return(0,u.jsx)("div",{className:i+"-pointer "+(t||""),style:s,children:(0,u.jsx)("div",{className:i+"-fill",style:c})})}),[o,n,r,t,i])},l=["prefixCls","radius","pointer","className","style","hsva","onChange"],f=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-saturation":r,f=e.radius,d=void 0===f?0:f,h=e.pointer,p=e.className,v=e.style,m=e.hsva,g=e.onChange,b=(0,o.Z)(e,l),y=(0,n.Z)({width:200,height:200,borderRadius:d},v,{position:"relative"}),x=function(e,t){g&&g({h:m.h,s:100*e.left,v:100*(1-e.top),a:m.a})},w={top:100-m.v+"%",left:m.s+"%",color:(0,i.hsvaToHslaString)(m)},S=h&&"function"===typeof h?h((0,n.Z)({prefixCls:a},w)):(0,u.jsx)(c,(0,n.Z)({prefixCls:a},w));return(0,u.jsx)(s.default,(0,n.Z)({className:[a,p||""].filter(Boolean).join(" ")},b,{style:(0,n.Z)({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+m.h+", 100%, 50%))"},y),ref:t,onMove:x,onDown:x,children:S}))}));f.displayName="Saturation";var d=f},1507:function(e,t,r){"use strict";r.r(t);var n=r(1026),o=r(5773),a=r(808),i=r(8573),s=r(6319),u=r(7240),c=r(8702),l=r(3789),f=r(7864),d=r(5301),h=r(6493),p=r(9887),v=r(4760),m=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],g=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],b=function(e){return(0,v.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}})},y=i.forwardRef((function(e,t){var r=e.prefixCls,y=void 0===r?"w-color-sketch":r,x=e.className,w=e.onChange,S=e.width,E=void 0===S?218:S,C=e.presetColors,k=void 0===C?g:C,_=e.color,O=e.editableDisable,R=void 0===O||O,P=e.disableAlpha,j=void 0!==P&&P,T=e.style,A=(0,a.Z)(e,m),D=(0,i.useState)({h:209,s:36,v:90,a:1}),L=(0,n.Z)(D,2),Z=L[0],N=L[1];(0,i.useEffect)((function(){"string"===typeof _&&(0,d.Ff)(_)&&N((0,h.hexToHsva)(_)),"object"===typeof _&&N(_)}),[_]);var M=function(e){N(e),w&&w((0,h.color)(e))},I=(0,o.Z)({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:E},T),B={borderRadius:2,background:(0,h.hsvaToRgbaString)(Z),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,v.jsxs)("div",(0,o.Z)({},A,{className:y+" "+(x||""),ref:t,style:I,children:[(0,v.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,v.jsx)(s.default,{hsva:Z,style:{width:"auto",height:150},onChange:function(e){return M((0,o.Z)({},Z,e,{a:Z.a}))}}),(0,v.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,v.jsxs)("div",{style:{flex:1},children:[(0,v.jsx)(f.default,{width:"auto",height:10,hue:Z.h,pointer:b,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:function(e){return M((0,o.Z)({},Z,e))}}),!j&&(0,v.jsx)(u.default,{width:"auto",height:10,hsva:Z,pointer:b,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:function(e){return M((0,o.Z)({},Z,{a:e.a}))}})]}),!j&&(0,v.jsx)(u.default,{width:24,height:24,hsva:Z,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:B},pointer:function(){return(0,v.jsx)(i.Fragment,{})}})]})]}),R&&(0,v.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,v.jsx)(c.default,{label:"Hex",value:(0,h.hsvaToHex)(Z).replace(/^#/,"").toLocaleUpperCase(),onChange:function(e,t){var r;"string"===typeof(r=t)&&(0,d.Ff)(r)&&/(3|6)/.test(String(r.length))&&M((0,h.hexToHsva)(r))},style:{minWidth:58}}),(0,v.jsx)(l.default,{hsva:Z,style:{marginLeft:6},aProps:!j&&{},onChange:function(e){return M(e.hsva)}})]}),k&&k.length>0&&(0,v.jsx)(p.default,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:k,color:(0,h.hsvaToHex)(Z),onChange:function(e){return M(e)},rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));y.displayName="Sketch",t.default=y},9887:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(4760),u=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],c=a.forwardRef((function(e,t){var r=e.prefixCls,c=void 0===r?"w-color-swatch":r,l=e.className,f=e.color,d=e.colors,h=void 0===d?[]:d,p=e.style,v=e.rectProps,m=void 0===v?{}:v,g=e.onChange,b=e.addonAfter,y=e.addonBefore,x=e.rectRender,w=(0,o.Z)(e,u),S=(0,n.Z)({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},m.style),E=function(e,t){g&&g((0,i.hexToHsva)(e),(0,i.color)((0,i.hexToHsva)(e)),t)};return(0,s.jsxs)("div",(0,n.Z)({ref:t},w,{className:[c,l||""].filter(Boolean).join(" "),style:(0,n.Z)({display:"flex",flexWrap:"wrap",position:"relative"},p),children:[y&&a.isValidElement(y)&&y,h&&Array.isArray(h)&&h.map((function(e,t){var r="",o="";"string"===typeof e&&(r=e,o=e),"object"===typeof e&&e.color&&(r=e.title||e.color,o=e.color);var i=f&&f.toLocaleLowerCase()===o.toLocaleLowerCase();if(x)return x({key:t,title:r,color:o,checked:!!i,style:(0,n.Z)({},S,{background:o}),onClick:function(e){return E(o,e)}});var u=m.children&&a.isValidElement(m.children)?a.cloneElement(m.children,{color:o,checked:i}):null;return(0,s.jsx)("div",(0,n.Z)({tabIndex:0,title:r,onClick:function(e){return E(o,e)}},m,{children:u,style:(0,n.Z)({},S,{background:o})}),t)})),b&&a.isValidElement(b)&&b]}))}));c.displayName="Swatch",t.default=c},6813:function(e,t,r){"use strict";r.r(t),r.d(t,{clamp:function(){return l},default:function(){return v},getRelativePosition:function(){return f},isTouch:function(){return u},preventDefaultMove:function(){return c},useEventCallback:function(){return s}});var n=r(1026),o=r(5773),a=r(808),i=r(8573);function s(e){var t=(0,i.useRef)(e);return(0,i.useEffect)((function(){t.current=e})),(0,i.useCallback)((function(e,r){return t.current&&t.current(e,r)}),[])}var u=function(e){return"touches"in e},c=function(e){!u(e)&&e.preventDefault&&e.preventDefault()},l=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&b.current?C&&C(f(b.current,e),e):E(!1)}),[C]),O=(0,i.useCallback)((function(){return E(!1)}),[]),R=(0,i.useCallback)((function(e){var t=e?window.addEventListener:window.removeEventListener;t(y.current?"touchmove":"mousemove",_),t(y.current?"touchend":"mouseup",O)}),[]);(0,i.useEffect)((function(){return R(S),function(){S&&R(!1)}}),[S,R]);var P=(0,i.useCallback)((function(e){c(e.nativeEvent),function(e){return!(y.current&&!u(e))&&(y.current=u(e),!0)}(e.nativeEvent)&&(k&&k(f(b.current,e.nativeEvent),e.nativeEvent),E(!0))}),[k]);return(0,d.jsx)("div",(0,o.Z)({},g,{className:[l,p||""].filter(Boolean).join(" "),style:(0,o.Z)({},g.style,{touchAction:"none"}),ref:b,tabIndex:0,onMouseDown:P,onTouchStart:P}))}));p.displayName="Interactive";var v=p},7266:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},8983:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},6824:function(e,t,r){var n=r(6196),o=r(4161);function a(t,r,i){return o()?(e.exports=a=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,r){var o=[null];o.push.apply(o,t);var a=new(Function.bind.apply(e,o));return r&&n(a,r.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(null,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},2081:function(e,t,r){var n=r(4040);function o(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}r.d(t,{Z:function(){return n}})},6983:function(e,t,r){"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}r.d(t,{Z:function(){return n}})},1026:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(6470);var o=r(4013),a=r(3764);function i(e,t){return(0,n.Z)(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||(0,o.Z)(e,t)||(0,a.Z)()}},669:function(e,t,r){"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Z:function(){return n}})},2173:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(6470),o=r(5181),a=r(4013),i=r(3764);function s(e){return(0,n.Z)(e)||(0,o.Z)(e)||(0,a.Z)(e)||(0,i.Z)()}},649:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1793);var o=r(5181),a=r(4013);function i(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,o.Z)(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},5217:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(3940);function o(e){var t=function(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==(0,n.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===(0,n.Z)(t)?t:String(t)}},3940:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:function(){return n}})},4013:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1793);function o(e,t){if(e){if("string"===typeof e)return(0,n.Z)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(e,t):void 0}}},7373:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(7597),o=r(6983);var a=r(8119);function i(e,t,r){return i=(0,a.Z)()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&(0,o.Z)(a,r.prototype),a},i.apply(null,arguments)}function s(e){var t="function"===typeof Map?new Map:void 0;return s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return i(e,arguments,(0,n.Z)(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,o.Z)(a,e)},s(e)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,function(){var e=[];r.O=function(t,n,o,a){if(!n){var i=1/0;for(l=0;l=a)&&Object.keys(r.O).every((function(e){return r.O[e](n[u])}))?n.splice(u--,1):(s=!1,a0&&e[l-1][2]>a;l--)e[l]=e[l-1];e[l]=[n,o,a]}}(),r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"===typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){i[e]=function(){return n[e]}}));return i.default=function(){return n},r.d(a,i),a}}(),r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(t,n){return r.f[n](e,t),t}),[]))},r.u=function(e){return"static/js/"+(269===e?"refractor-vendor":e)+"."+{2:"6da3da2a",3:"858fe2b1",18:"c07b1920",31:"1b0cd9b2",66:"3a288404",94:"8a6120f0",107:"466b97f5",113:"31e40c6e",117:"31949d28",118:"6f3b0b31",221:"0504457b",231:"b9c3ded8",269:"0260c0d3",281:"4df7504b",297:"7b76461a",299:"11854554",301:"8bd45319",308:"b7ce428a",309:"c927a996",361:"aa245cc6",426:"ee69b934",446:"d9fb46d2",458:"f14d221b",466:"6f2442cf",469:"7af4a86a",494:"cde1347e",536:"4ecc7848",546:"b70807de",569:"b54108aa",620:"85f0f3e9",624:"784913d1",632:"7d3a603e",649:"eaa644a7",652:"84581b29",691:"1ed5b489",721:"2faf3454",756:"4178b543",781:"6819c40d",785:"ced3b982",852:"6f6cb68f",875:"9d9f14a8",919:"a92a1caa",952:"c9bcfd7a",955:"50536602",982:"61d56819",995:"9cd28e3f",996:"e499943e"}[e]+".chunk.js"},r.miniCssF=function(e){return"static/css/"+e+"."+{117:"d2ab10fd",281:"c7b2c18c"}[e]+".chunk.css"},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="website:";r.l=function(n,o,a,i){if(e[n])e[n].push(o);else{var s,u;if(void 0!==a)for(var c=document.getElementsByTagName("script"),l=0;l\n:host a:hover .octo-arm { animation: octocat-wave 560ms ease-in-out; }\n@keyframes octocat-wave {\n 0%, 100% { transform: rotate(0); }\n 20%, 60% { transform: rotate(-25deg); }\n 40%, 80% { transform: rotate(10deg); }\n}\n@media (max-width:500px) {\n :host a:hover .octo-arm { animation: none; }\n :host .octo-arm { animation: octocat-wave 560ms ease-in-out; }\n}\n:host svg {\n z-index: 99;\n position: fixed;\n border: 0px;\n top: 0px;\n}\n\n\n';var b=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){var e;return(0,d.Z)(this,r),(e=t.call(this)).right="0",e.shadow=e.attachShadow({mode:"open"}),e.shadow.appendChild(e.ownerDocument.importNode(g.content,!0)),e.update(),e}return(0,h.Z)(r,[{key:"setAttr",value:function(e,t){var r=this.shadow.querySelector("svg");/(href)/.test(e.toLocaleLowerCase())?r.lastElementChild.setAttribute("xlink:href",t):/(color|fill)/.test(e.toLocaleLowerCase())?r.firstElementChild.style[e]=t:/(z-index|position|top|left|right|bottom|transform)/.test(e.toLocaleLowerCase())?r.style[e]=t:r.setAttribute(e,t)}},{key:"update",value:function(){var e=this;[].concat((0,f.Z)(this.getAttributeNames()),["right"]).forEach((function(t){var r=e.getAttribute(t)||e[t]||"";e.setAttr(t,r)}))}},{key:"attributeChangedCallback",value:function(e,t,r){t!==r&&this.setAttr(e,r)}}],[{key:"observedAttributes",get:function(){return["style","z-index","target","height","width","href","color","fill","position","top","left","right","bottom","transform"]}}]),r}((0,m.Z)(HTMLElement));customElements.define("github-corners",b);var y=r(4760),x=["size","fixed","bottom","zIndex","className","style","bgColor","color","position"];function w(e){var t=e.size,r=void 0===t?80:t,n=e.fixed,o=void 0!==n&&n,a=e.bottom,i=e.zIndex,c=e.style,l=e.bgColor,f=void 0===l?"#151513":l,d=e.color,h=void 0===d?"#fff":d,p=e.position,v=void 0===p?"right":p,m=(0,u.Z)(e,x),g="left"===v?{left:0,right:"initial",transform:"scale(-1, 1)"}:{right:0,left:"initial",transform:"scale(1, 1)"};return a?(g.bottom=0,g.top="initial",g.transform="left"===v?"scale(-1, -1)":"scale(1, -1)"):(g.bottom="initial",g.top=0),(0,y.jsx)("github-corners",(0,s.Z)({target:"__blank",width:r,height:r,href:e.href,position:o?"fixed":"absolute","z-index":i,style:c,fill:f,color:h},g,m))}var S=r(7240),E=r(3940);function C(){C=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),s=new A(n||[]);return o(i,"_invoke",{value:R(e,r,s)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",v="completed",m={};function g(){}function b(){}function y(){}var x={};c(x,i,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(D([])));S&&S!==r&&n.call(S,i)&&(x=S);var k=y.prototype=g.prototype=Object.create(x);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(o,a,i,s){var u=f(e[o],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==(0,E.Z)(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(l).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,s)}))}s(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function R(t,r,n){var o=d;return function(a,i){if(o===p)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?v:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function k(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){k(a,n,o,i,s,"next",e)}function s(e){k(a,n,o,i,s,"throw",e)}i(void 0)}))}}var O,R=r(4649),P=r(2173),j=r(4013);function T(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=(0,j.Z)(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function F(e,t,r,n){void 0===n&&(n={});var o=n,a=o.window,i=void 0===a?document.defaultView:a,s=o.v5Compat,u=void 0!==s&&s,c=i.history,l=O.Pop,f=null,d=h();function h(){return(c.state||{idx:null}).idx}function p(){l=O.Pop;var e=h(),t=null==e?null:e-d;d=e,f&&f({action:l,location:m.location,delta:t})}function v(e){var t="null"!==i.location.origin?i.location.origin:i.location.href,r="string"===typeof e?e:B(e);return Z(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==d&&(d=0,c.replaceState(A({},c.state,{idx:d}),""));var m={get action(){return l},get location(){return e(i,c)},listen:function(e){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(L,p),f=e,function(){i.removeEventListener(L,p),f=null}},createHref:function(e){return t(i,e)},createURL:v,encodeLocation:function(e){var t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=O.Push;var n=I(m.location,e,t);r&&r(n,e);var o=M(n,d=h()+1),a=m.createHref(n);try{c.pushState(o,"",a)}catch(s){if(s instanceof DOMException&&"DataCloneError"===s.name)throw s;i.location.assign(a)}u&&f&&f({action:l,location:m.location,delta:1})},replace:function(e,t){l=O.Replace;var n=I(m.location,e,t);r&&r(n,e);var o=M(n,d=h()),a=m.createHref(n);c.replaceState(o,"",a),u&&f&&f({action:l,location:m.location,delta:0})},go:function(e){return c.go(e)}};return m}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(D||(D={}));var H=new Set(["lazy","caseSensitive","path","id","index","children"]);function z(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((function(e,o){var a=[].concat((0,f.Z)(r),[o]),i="string"===typeof e.id?e.id:a.join("-");if(Z(!0!==e.index||!e.children,"Cannot specify children on an index route"),Z(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){var s=A({},e,t(e),{id:i});return n[i]=s,s}var u=A({},e,t(e),{id:i,children:void 0});return n[i]=u,e.children&&(u.children=z(e.children,t,a,n)),u}))}function W(e,t,r){void 0===r&&(r="/");var n=oe(("string"===typeof t?U(t):t).pathname||"/",r);if(null==n)return null;var o=$(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var r=e.length===t.length&&e.slice(0,-1).every((function(e,r){return e===t[r]}));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(o);for(var a=null,i=0;null==a&&i0&&(Z(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),$(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:ee(s,e.index),routesMeta:u})};return e.forEach((function(e,t){var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?")){var n,a=T(K(e.path));try{for(a.s();!(n=a.n()).done;){var i=n.value;o(e,t,i)}}catch(s){a.e(s)}finally{a.f()}}else o(e,t)})),t}function K(e){var t=e.split("/");if(0===t.length)return[];var r=(0,P.Z)(t),n=r[0],o=r.slice(1),a=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===o.length)return a?[i,""]:[i];var s=K(o.join("/")),u=[];return u.push.apply(u,(0,f.Z)(s.map((function(e){return""===e?i:[i,e].join("/")})))),a&&u.push.apply(u,(0,f.Z)(s)),u.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}var G=/^:\w+$/,Y=3,q=2,V=1,J=10,X=-2,Q=function(e){return"*"===e};function ee(e,t){var r=e.split("/"),n=r.length;return r.some(Q)&&(n+=X),t&&(n+=q),r.filter((function(e){return!Q(e)})).reduce((function(e,t){return e+(G.test(t)?Y:""===t?V:J)}),n)}function te(e,t){for(var r=e.routesMeta,n={},o="/",a=[],i=0;i and the router will parse it for you.'}function ie(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function se(e,t,r,n){var o;void 0===n&&(n=!1),"string"===typeof e?o=U(e):(Z(!(o=A({},e)).pathname||!o.pathname.includes("?"),ae("?","pathname","search",o)),Z(!o.pathname||!o.pathname.includes("#"),ae("#","pathname","hash",o)),Z(!o.search||!o.search.includes("#"),ae("#","search","hash",o)));var a,i=""===e||""===o.pathname,s=i?"/":o.pathname;if(n||null==s)a=r;else{var u=t.length-1;if(s.startsWith("..")){for(var c=s.split("/");".."===c[0];)c.shift(),u-=1;o.pathname=c.join("/")}a=u>=0?t[u]:"/"}var l=function(e,t){void 0===t&&(t="/");var r="string"===typeof e?U(e):e,n=r.pathname,o=r.search,a=void 0===o?"":o,i=r.hash,s=void 0===i?"":i,u=n?n.startsWith("/")?n:function(e,t){var r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(n,t):t;return{pathname:u,search:le(a),hash:fe(s)}}(o,a),f=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!f&&!d||(l.pathname+="/"),l}var ue=function(e){return e.join("/").replace(/\/\/+/g,"/")},ce=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},le=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},fe=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},de=function(e){(0,p.Z)(r,e);var t=(0,v.Z)(r);function r(){return(0,d.Z)(this,r),t.apply(this,arguments)}return(0,h.Z)(r)}((0,m.Z)(Error));var he=(0,h.Z)((function e(t,r,n,o){(0,d.Z)(this,e),void 0===o&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}));function pe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var ve=["post","put","patch","delete"],me=new Set(ve),ge=["get"].concat(ve),be=new Set(ge),ye=new Set([301,302,303,307,308]),xe=new Set([307,308]),we={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Se={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ee={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ke=function(e){return{hasErrorBoundary:Boolean(e.hasErrorBoundary)}};function _e(e){var t,r=e.window?e.window:"undefined"!==typeof window?window:void 0,n="undefined"!==typeof r&&"undefined"!==typeof r.document&&"undefined"!==typeof r.document.createElement,o=!n;if(Z(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){var i=e.detectErrorBoundary;t=function(e){return{hasErrorBoundary:i(e)}}}else t=ke;var s,u={},c=z(e.routes,t,void 0,u),l=e.basename||"/",d=A({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,p=new Set,v=null,m=null,g=null,b=null!=e.hydrationData,y=W(c,e.history.location,l),x=null;if(null==y){var w=$e(404,{pathname:e.history.location.pathname}),S=We(c),E=S.matches,k=S.route;y=E,x=(0,R.Z)({},k.id,w)}var P,j,L=!y.some((function(e){return e.route.lazy}))&&(!y.some((function(e){return e.route.loader}))||null!=e.hydrationData),M={historyAction:e.history.action,location:e.history.location,matches:y,initialized:L,navigation:we,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},B=O.Pop,U=!1,F=!1,H=!1,$=[],K=[],G=new Map,Y=0,q=-1,V=new Map,J=new Set,X=new Map,Q=new Map,ee=new Map,te=!1;function re(e){M=A({},M,e),p.forEach((function(e){return e(M)}))}function ne(t,r){var n,o,a,i=null!=M.actionData&&null!=M.navigation.formMethod&&tt(M.navigation.formMethod)&&"loading"===M.navigation.state&&!0!==(null==(n=t.state)?void 0:n._isRedirect);a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:i?M.actionData:null;var u=r.loaderData?He(M.loaderData,r.loaderData,r.matches||[],r.errors):M.loaderData,l=M.blockers;l.size>0&&(l=new Map(l)).forEach((function(e,t){return l.set(t,Ee)}));var f=!0===U||null!=M.navigation.formMethod&&tt(M.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s&&(c=s,s=void 0),F||B===O.Pop||(B===O.Push?e.history.push(t,t.state):B===O.Replace&&e.history.replace(t,t.state)),re(A({},r,{actionData:a,loaderData:u,historyAction:B,location:t,initialized:!0,navigation:we,revalidation:"idle",restoreScrollPosition:et(t,r.matches||M.matches),preventScrollReset:f,blockers:l})),B=O.Pop,U=!1,F=!1,H=!1,$=[],K=[]}function ae(e,t){return ie.apply(this,arguments)}function ie(){return ie=_(C().mark((function t(r,n){var o,a,i,s,u,c,f,h,p,v,m;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("number"!==typeof r){t.next=3;break}return e.history.go(r),t.abrupt("return");case 3:if(o=Oe(M.location,M.matches,l,d.v7_prependBasename,r,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),a=Re(d.v7_normalizeFormMethod,!1,o,n),i=a.path,s=a.submission,u=a.error,c=M.location,f=A({},f=I(M.location,i,n&&n.state),e.history.encodeLocation(f)),h=n&&null!=n.replace?n.replace:void 0,p=O.Push,!0===h?p=O.Replace:!1===h||null!=s&&tt(s.formMethod)&&s.formAction===M.location.pathname+M.location.search&&(p=O.Replace),v=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,!(m=Ue({currentLocation:c,nextLocation:f,historyAction:p}))){t.next=16;break}return Be(m,{state:"blocked",location:f,proceed:function(){Be(m,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),ae(r,n)},reset:function(){var e=new Map(M.blockers);e.set(m,Ee),re({blockers:e})}}),t.abrupt("return");case 16:return t.next=18,se(p,f,{submission:s,pendingError:u,preventScrollReset:v,replace:n&&n.replace});case 18:return t.abrupt("return",t.sent);case 19:case"end":return t.stop()}}),t)}))),ie.apply(this,arguments)}function se(e,t,r){return ue.apply(this,arguments)}function ue(){return ue=_(C().mark((function t(r,n,o){var a,i,u,f,d,h,p,v,m,g,b,y,x,w,S;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j&&j.abort(),j=null,B=r,F=!0===(o&&o.startUninterruptedRevalidation),Qe(M.location,M.matches),U=!0===(o&&o.preventScrollReset),a=s||c,i=o&&o.overrideNavigation,u=W(a,n,l)){t.next=15;break}return f=$e(404,{pathname:n.pathname}),d=We(a),h=d.matches,p=d.route,Ge(),ne(n,{matches:h,loaderData:{},errors:(0,R.Z)({},p.id,f)}),t.abrupt("return");case 15:if(!M.initialized||H||!Ye(M.location,n)||o&&o.submission&&tt(o.submission.formMethod)){t.next=18;break}return ne(n,{matches:u}),t.abrupt("return");case 18:if(j=new AbortController,v=Me(e.history,n,j.signal,o&&o.submission),!o||!o.pendingError){t.next=24;break}g=(0,R.Z)({},ze(u).route.id,o.pendingError),t.next=34;break;case 24:if(!(o&&o.submission&&tt(o.submission.formMethod))){t.next=34;break}return t.next=27,ce(v,n,o.submission,u,{replace:o.replace});case 27:if(!(b=t.sent).shortCircuited){t.next=30;break}return t.abrupt("return");case 30:m=b.pendingActionData,g=b.pendingActionError,i=ct(n,o.submission),v=new Request(v.url,{signal:v.signal});case 34:return t.next=36,fe(v,n,u,i,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,m,g);case 36:if(y=t.sent,x=y.shortCircuited,w=y.loaderData,S=y.errors,!x){t.next=42;break}return t.abrupt("return");case 42:j=null,ne(n,A({matches:u},m?{actionData:m}:{},{loaderData:w,errors:S}));case 44:case"end":return t.stop()}}),t)}))),ue.apply(this,arguments)}function ce(e,t,r,n,o){return le.apply(this,arguments)}function le(){return le=_(C().mark((function e(r,n,o,a,i){var s,c,f,d;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===i&&(i={}),_e(),re({navigation:lt(n,o)}),(c=st(a,n)).route.action||c.route.lazy){e.next=9;break}s={type:D.error,error:$e(405,{method:r.method,pathname:n.pathname,routeId:c.route.id})},e.next=14;break;case 9:return e.next=11,Ze("action",r,c,a,u,t,l);case 11:if(s=e.sent,!r.signal.aborted){e.next=14;break}return e.abrupt("return",{shortCircuited:!0});case 14:if(!Je(s)){e.next=19;break}return f=i&&null!=i.replace?i.replace:s.location===M.location.pathname+M.location.search,e.next=18,me(M,s,{submission:o,replace:f});case 18:return e.abrupt("return",{shortCircuited:!0});case 19:if(!Ve(s)){e.next=23;break}return d=ze(a,c.route.id),!0!==(i&&i.replace)&&(B=O.Push),e.abrupt("return",{pendingActionData:{},pendingActionError:(0,R.Z)({},d.route.id,s.error)});case 23:if(!qe(s)){e.next=25;break}throw $e(400,{type:"defer-action"});case 25:return e.abrupt("return",{pendingActionData:(0,R.Z)({},c.route.id,s.data)});case 26:case"end":return e.stop()}}),e)}))),le.apply(this,arguments)}function fe(e,t,r,n,o,a,i,s,u){return de.apply(this,arguments)}function de(){return de=_(C().mark((function t(r,n,o,i,u,f,d,h,p){var v,m,g,b,y,x,w,S,E,k,_,O,R,P,T,D,L,Z,N,I,B,U;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v=i||ct(n,u),m=u||f||ut(v),g=s||c,b=je(e.history,M,o,m,n,H,$,K,X,J,g,l,h,p),y=(0,a.Z)(b,2),x=y[0],w=y[1],Ge((function(e){return!(o&&o.some((function(t){return t.route.id===e})))||x&&x.some((function(t){return t.route.id===e}))})),q=++Y,0!==x.length||0!==w.length){t.next=10;break}return S=Le(),ne(n,A({matches:o,loaderData:{},errors:p||null},h?{actionData:h}:{},S?{fetchers:new Map(M.fetchers)}:{})),t.abrupt("return",{shortCircuited:!0});case 10:return F||(w.forEach((function(e){var t=M.fetchers.get(e.key),r=ft(void 0,t?t.data:void 0);M.fetchers.set(e.key,r)})),E=h||M.actionData,re(A({navigation:v},E?0===Object.keys(E).length?{actionData:null}:{actionData:E}:{},w.length>0?{fetchers:new Map(M.fetchers)}:{}))),w.forEach((function(e){G.has(e.key)&&Ae(e.key),e.controller&&G.set(e.key,e.controller)})),k=function(){return w.forEach((function(e){return Ae(e.key)}))},j&&j.signal.addEventListener("abort",k),t.next=16,be(M.matches,o,x,w,r);case 16:if(_=t.sent,O=_.results,R=_.loaderResults,P=_.fetcherResults,!r.signal.aborted){t.next=22;break}return t.abrupt("return",{shortCircuited:!0});case 22:if(j&&j.signal.removeEventListener("abort",k),w.forEach((function(e){return G.delete(e.key)})),!(T=Ke(O))){t.next=30;break}return T.idx>=x.length&&(D=w[T.idx-x.length].key,J.add(D)),t.next=29,me(M,T.result,{replace:d});case 29:return t.abrupt("return",{shortCircuited:!0});case 30:return L=Fe(M,o,x,R,p,w,P,Q),Z=L.loaderData,N=L.errors,Q.forEach((function(e,t){e.subscribe((function(r){(r||e.done)&&Q.delete(t)}))})),I=Le(),B=Ne(q),U=I||B||w.length>0,t.abrupt("return",A({loaderData:Z,errors:N},U?{fetchers:new Map(M.fetchers)}:{}));case 36:case"end":return t.stop()}}),t)}))),de.apply(this,arguments)}function he(e){return M.fetchers.get(e)||Se}function pe(){return pe=_(C().mark((function r(n,o,i,f,d,h){var p,v,m,g,b,y,x,w,S,E,k,_,O,P,T,D,L,N,I,U,F,z,ee,te,oe,ae,ie,se,ue,ce,le;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(_e(),X.delete(n),f.route.action||f.route.lazy){r.next=6;break}return p=$e(405,{method:h.formMethod,pathname:i,routeId:o}),Pe(n,o,p),r.abrupt("return");case 6:return v=M.fetchers.get(n),m=dt(h,v),M.fetchers.set(n,m),re({fetchers:new Map(M.fetchers)}),g=new AbortController,b=Me(e.history,i,g.signal,h),G.set(n,g),y=Y,r.next=16,Ze("action",b,f,d,u,t,l);case 16:if(x=r.sent,!b.signal.aborted){r.next=20;break}return G.get(n)===g&&G.delete(n),r.abrupt("return");case 20:if(!Je(x)){r.next=34;break}if(G.delete(n),!(q>y)){r.next=29;break}return w=ht(void 0),M.fetchers.set(n,w),re({fetchers:new Map(M.fetchers)}),r.abrupt("return");case 29:return J.add(n),S=ft(h),M.fetchers.set(n,S),re({fetchers:new Map(M.fetchers)}),r.abrupt("return",me(M,x,{submission:h,isFetchActionRedirect:!0}));case 34:if(!Ve(x)){r.next=37;break}return Pe(n,o,x.error),r.abrupt("return");case 37:if(!qe(x)){r.next=39;break}throw $e(400,{type:"defer-action"});case 39:return E=M.navigation.location||M.location,k=Me(e.history,E,g.signal),_=s||c,Z(O="idle"!==M.navigation.state?W(_,M.navigation.location,l):M.matches,"Didn't find any matches after fetcher action"),P=++Y,V.set(n,P),T=ft(h,x.data),M.fetchers.set(n,T),D=je(e.history,M,O,h,E,H,$,K,X,J,_,l,(0,R.Z)({},f.route.id,x.data),void 0),L=(0,a.Z)(D,2),N=L[0],(I=L[1]).filter((function(e){return e.key!==n})).forEach((function(e){var t=e.key,r=M.fetchers.get(t),n=ft(void 0,r?r.data:void 0);M.fetchers.set(t,n),G.has(t)&&Ae(t),e.controller&&G.set(t,e.controller)})),re({fetchers:new Map(M.fetchers)}),U=function(){return I.forEach((function(e){return Ae(e.key)}))},g.signal.addEventListener("abort",U),r.next=55,be(M.matches,O,N,I,k);case 55:if(F=r.sent,z=F.results,ee=F.loaderResults,te=F.fetcherResults,!g.signal.aborted){r.next=61;break}return r.abrupt("return");case 61:if(g.signal.removeEventListener("abort",U),V.delete(n),G.delete(n),I.forEach((function(e){return G.delete(e.key)})),!(oe=Ke(z))){r.next=69;break}return oe.idx>=N.length&&(ae=I[oe.idx-N.length].key,J.add(ae)),r.abrupt("return",me(M,oe.result));case 69:ie=Fe(M,M.matches,N,ee,void 0,I,te,Q),se=ie.loaderData,ue=ie.errors,M.fetchers.has(n)&&(ce=ht(x.data),M.fetchers.set(n,ce)),le=Ne(P),"loading"===M.navigation.state&&P>q?(Z(B,"Expected pending action"),j&&j.abort(),ne(M.navigation.location,{matches:O,loaderData:se,errors:ue,fetchers:new Map(M.fetchers)})):(re(A({errors:ue,loaderData:He(M.loaderData,se,O,ue)},le||I.length>0?{fetchers:new Map(M.fetchers)}:{})),H=!1);case 73:case"end":return r.stop()}}),r)}))),pe.apply(this,arguments)}function ve(){return ve=_(C().mark((function r(n,o,a,i,s,c){var f,d,h,p,v,m,g,b,y;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return f=M.fetchers.get(n),d=ft(c,f?f.data:void 0),M.fetchers.set(n,d),re({fetchers:new Map(M.fetchers)}),h=new AbortController,p=Me(e.history,a,h.signal),G.set(n,h),v=Y,r.next=10,Ze("loader",p,i,s,u,t,l);case 10:if(!qe(m=r.sent)){r.next=18;break}return r.next=14,ot(m,p.signal,!0);case 14:if(r.t0=r.sent,r.t0){r.next=17;break}r.t0=m;case 17:m=r.t0;case 18:if(G.get(n)===h&&G.delete(n),!p.signal.aborted){r.next=21;break}return r.abrupt("return");case 21:if(!Je(m)){r.next=33;break}if(!(q>v)){r.next=29;break}return g=ht(void 0),M.fetchers.set(n,g),re({fetchers:new Map(M.fetchers)}),r.abrupt("return");case 29:return J.add(n),r.next=32,me(M,m);case 32:return r.abrupt("return");case 33:if(!Ve(m)){r.next=38;break}return b=ze(M.matches,o),M.fetchers.delete(n),re({fetchers:new Map(M.fetchers),errors:(0,R.Z)({},b.route.id,m.error)}),r.abrupt("return");case 38:Z(!qe(m),"Unhandled fetcher deferred data"),y=ht(m.data),M.fetchers.set(n,y),re({fetchers:new Map(M.fetchers)});case 42:case"end":return r.stop()}}),r)}))),ve.apply(this,arguments)}function me(e,t,r){return ge.apply(this,arguments)}function ge(){return ge=_(C().mark((function t(o,a,i){var s,u,c,f,d,h,p,v,m,g;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=(s=void 0===i?{}:i).submission,c=s.replace,f=s.isFetchActionRedirect,a.revalidate&&(H=!0),Z(d=I(o.location,a.location,A({_isRedirect:!0},f?{_isFetchActionRedirect:!0}:{})),"Expected a location on the redirect navigation"),!Ce.test(a.location)||!n){t.next=10;break}if(h=e.history.createURL(a.location),p=null==oe(h.pathname,l),r.location.origin===h.origin&&!p){t.next=10;break}return c?r.location.replace(a.location):r.location.assign(a.location),t.abrupt("return");case 10:if(j=null,v=!0===c?O.Replace:O.Push,m=u||ut(o.navigation),!(xe.has(a.status)&&m&&tt(m.formMethod))){t.next=18;break}return t.next=16,se(v,d,{submission:A({},m,{formAction:a.location}),preventScrollReset:U});case 16:case 21:t.next=26;break;case 18:if(!f){t.next=23;break}return t.next=21,se(v,d,{overrideNavigation:ct(d),fetcherSubmission:m,preventScrollReset:U});case 23:return g=ct(d,m),t.next=26,se(v,d,{overrideNavigation:g,preventScrollReset:U});case 26:case"end":return t.stop()}}),t)}))),ge.apply(this,arguments)}function be(e,t,r,n,o){return ye.apply(this,arguments)}function ye(){return ye=_(C().mark((function r(n,o,a,i,s){var c,d,h;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all([].concat((0,f.Z)(a.map((function(e){return Ze("loader",s,e,o,u,t,l)}))),(0,f.Z)(i.map((function(r){return r.matches&&r.match&&r.controller?Ze("loader",Me(e.history,r.path,r.controller.signal),r.match,r.matches,u,t,l):{type:D.error,error:$e(404,{pathname:r.path})}})))));case 2:return c=r.sent,d=c.slice(0,a.length),h=c.slice(a.length),r.next=7,Promise.all([rt(n,a,d,d.map((function(){return s.signal})),!1,M.loaderData),rt(n,i.map((function(e){return e.match})),h,i.map((function(e){return e.controller?e.controller.signal:null})),!0)]);case 7:return r.abrupt("return",{results:c,loaderResults:d,fetcherResults:h});case 8:case"end":return r.stop()}}),r)}))),ye.apply(this,arguments)}function _e(){var e;H=!0,(e=$).push.apply(e,(0,f.Z)(Ge())),X.forEach((function(e,t){G.has(t)&&(K.push(t),Ae(t))}))}function Pe(e,t,r){var n=ze(M.matches,t);Te(e),re({errors:(0,R.Z)({},n.route.id,r),fetchers:new Map(M.fetchers)})}function Te(e){var t=M.fetchers.get(e);!G.has(e)||t&&"loading"===t.state&&V.has(e)||Ae(e),X.delete(e),V.delete(e),J.delete(e),M.fetchers.delete(e)}function Ae(e){var t=G.get(e);Z(t,"Expected fetch controller: "+e),t.abort(),G.delete(e)}function De(e){var t,r=T(e);try{for(r.s();!(t=r.n()).done;){var n=t.value,o=ht(he(n).data);M.fetchers.set(n,o)}}catch(a){r.e(a)}finally{r.f()}}function Le(){var e,t=[],r=!1,n=T(J);try{for(n.s();!(e=n.n()).done;){var o=e.value,a=M.fetchers.get(o);Z(a,"Expected fetcher: "+o),"loading"===a.state&&(J.delete(o),t.push(o),r=!0)}}catch(i){n.e(i)}finally{n.f()}return De(t),r}function Ne(e){var t,r=[],n=T(V);try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0];if(o[1]0}function Ie(e){M.blockers.delete(e),ee.delete(e)}function Be(e,t){var r=M.blockers.get(e)||Ee;Z("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);var n=new Map(M.blockers);n.set(e,t),re({blockers:n})}function Ue(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==ee.size){ee.size>1&&N(!1,"A router only supports one blocker at a time");var o=Array.from(ee.entries()),i=(0,a.Z)(o[o.length-1],2),s=i[0],u=i[1],c=M.blockers.get(s);if(!c||"proceeding"!==c.state)return u({currentLocation:t,nextLocation:r,historyAction:n})?s:void 0}}function Ge(e){var t=[];return Q.forEach((function(r,n){e&&!e(n)||(r.cancel(),t.push(n),Q.delete(n))})),t}function Xe(e,t){if(m){var r=m(e,t.map((function(e){return function(e,t){var r=e.route,n=e.pathname,o=e.params;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}(e,M.loaderData)})));return r||e.key}return e.key}function Qe(e,t){if(v&&g){var r=Xe(e,t);v[r]=g()}}function et(e,t){if(v){var r=Xe(e,t),n=v[r];if("number"===typeof n)return n}return null}return P={get basename(){return l},get state(){return M},get routes(){return c},initialize:function(){return h=e.history.listen((function(t){var r=t.action,n=t.location,o=t.delta;if(!te){N(0===ee.size||null!=o,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");var a=Ue({currentLocation:M.location,nextLocation:n,historyAction:r});return a&&null!=o?(te=!0,e.history.go(-1*o),void Be(a,{state:"blocked",location:n,proceed:function(){Be(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset:function(){var e=new Map(M.blockers);e.set(a,Ee),re({blockers:e})}})):se(r,n)}te=!1})),M.initialized||se(O.Pop,M.location),P},subscribe:function(e){return p.add(e),function(){return p.delete(e)}},enableScrollRestoration:function(e,t,r){if(v=e,g=t,m=r||null,!b&&M.navigation===we){b=!0;var n=et(M.location,M.matches);null!=n&&re({restoreScrollPosition:n})}return function(){v=null,g=null,m=null}},navigate:ae,fetch:function(e,t,r,n){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");G.has(e)&&Ae(e);var a=s||c,i=Oe(M.location,M.matches,l,d.v7_prependBasename,r,t,null==n?void 0:n.relative),u=W(a,i,l);if(u){var f=Re(d.v7_normalizeFormMethod,!0,i,n),h=f.path,p=f.submission,v=f.error;if(v)Pe(e,t,v);else{var m=st(u,h);U=!0===(n&&n.preventScrollReset),p&&tt(p.formMethod)?function(e,t,r,n,o,a){pe.apply(this,arguments)}(e,t,h,m,u,p):(X.set(e,{routeId:t,path:h}),function(e,t,r,n,o,a){ve.apply(this,arguments)}(e,t,h,m,u,p))}}else Pe(e,t,$e(404,{pathname:i}))},revalidate:function(){_e(),re({revalidation:"loading"}),"submitting"!==M.navigation.state&&("idle"!==M.navigation.state?se(B||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation}):se(M.historyAction,M.location,{startUninterruptedRevalidation:!0}))},createHref:function(t){return e.history.createHref(t)},encodeLocation:function(t){return e.history.encodeLocation(t)},getFetcher:he,deleteFetcher:Te,dispose:function(){h&&h(),p.clear(),j&&j.abort(),M.fetchers.forEach((function(e,t){return Te(t)})),M.blockers.forEach((function(e,t){return Ie(t)}))},getBlocker:function(e,t){var r=M.blockers.get(e)||Ee;return ee.get(e)!==t&&ee.set(e,t),r},deleteBlocker:Ie,_internalFetchControllers:G,_internalActiveDeferreds:Q,_internalSetRoutes:function(e){s=z(e,t,void 0,u={})}},P}Symbol("deferred");function Oe(e,t,r,n,o,a,i){var s,u;if(null!=a&&"path"!==i){s=[];var c,l=T(t);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(s.push(f),f.route.id===a){u=f;break}}}catch(h){l.e(h)}finally{l.f()}}else s=t,u=t[t.length-1];var d=se(o||".",ie(s).map((function(e){return e.pathnameBase})),oe(e.pathname,r)||e.pathname,"path"===i);return null==o&&(d.search=e.search,d.hash=e.hash),null!=o&&""!==o&&"."!==o||!u||!u.route.index||it(d.search)||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(d.pathname="/"===d.pathname?r:ue([r,d.pathname])),B(d)}function Re(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&!et(n.formMethod))return{path:r,error:$e(405,{method:n.formMethod})};var o,i,s=function(){return{path:r,error:$e(400,{type:"invalid-body"})}},u=n.formMethod||"get",c=e?u.toUpperCase():u.toLowerCase(),l=Ge(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!tt(c))return s();var f="string"===typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((function(e,t){var r=(0,a.Z)(t,2);return""+e+r[0]+"="+r[1]+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}if("application/json"===n.formEncType){if(!tt(c))return s();try{var d="string"===typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch(v){return s()}}}if(Z("function"===typeof FormData,"FormData is not available in this environment"),n.formData)o=Ie(n.formData),i=n.formData;else if(n.body instanceof FormData)o=Ie(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=Be(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{i=Be(o=new URLSearchParams(n.body))}catch(v){return s()}var h={formMethod:c,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(tt(h.formMethod))return{path:r,submission:h};var p=U(r);return t&&p.search&&it(p.search)&&o.append("index",""),p.search="?"+o,{path:B(p),submission:h}}function Pe(e,t){var r=e;if(t){var n=e.findIndex((function(e){return e.route.id===t}));n>=0&&(r=e.slice(0,n))}return r}function je(e,t,r,n,o,a,i,s,u,c,l,f,d,h){var p=h?Object.values(h)[0]:d?Object.values(d)[0]:void 0,v=e.createURL(t.location),m=e.createURL(o),g=h?Object.keys(h)[0]:void 0,b=Pe(r,g).filter((function(e,r){if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){var n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||i.some((function(t){return t===e.route.id})))return!0;var o=t.matches[r],s=e;return Ae(e,A({currentUrl:v,currentParams:o.params,nextUrl:m,nextParams:s.params},n,{actionResult:p,defaultShouldRevalidate:a||v.pathname+v.search===m.pathname+m.search||v.search!==m.search||Te(o,s)}))})),y=[];return u.forEach((function(e,o){if(r.some((function(t){return t.route.id===e.routeId}))){var i=W(l,e.path,f);if(i){var u=t.fetchers.get(o),d=st(i,e.path);!c.has(o)&&(!!s.includes(o)||(u&&"idle"!==u.state&&void 0===u.data?a:Ae(d,A({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a}))))&&y.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})}else y.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null})}})),[b,y]}function Te(e,t){var r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ae(e,t){if(e.route.shouldRevalidate){var r=e.route.shouldRevalidate(t);if("boolean"===typeof r)return r}return t.defaultShouldRevalidate}function De(e,t,r){return Le.apply(this,arguments)}function Le(){return Le=_(C().mark((function e(t,r,n){var o,a,i,s,u,c;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.lazy){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.lazy();case 4:if(o=e.sent,t.lazy){e.next=7;break}return e.abrupt("return");case 7:for(s in Z(a=n[t.id],"No route found in manifest"),i={},o)u=a[s],N(!(c=void 0!==u&&"hasErrorBoundary"!==s),'Route "'+a.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+s+'" will be ignored.'),c||H.has(s)||(i[s]=o[s]);Object.assign(a,i),Object.assign(a,A({},r(a),{lazy:void 0}));case 13:case"end":return e.stop()}}),e)}))),Le.apply(this,arguments)}function Ze(e,t,r,n,o,a,i,s){return Ne.apply(this,arguments)}function Ne(){return Ne=_(C().mark((function e(t,r,n,o,a,i,s,u){var c,l,f,d,h,p,v,m,g,b,y,x,w,S,E,k,_,O;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===u&&(u={}),d=function(e){var t,o=new Promise((function(e,r){return t=r}));return f=function(){return t()},r.signal.addEventListener("abort",f),Promise.race([e({request:r,params:n.params,context:u.requestContext}),o])},e.prev=2,h=n.route[t],!n.route.lazy){e.next=30;break}if(!h){e.next=12;break}return e.next=8,Promise.all([d(h),De(n.route,i,a)]);case 8:p=e.sent,l=p[0],e.next=28;break;case 12:return e.next=14,De(n.route,i,a);case 14:if(!(h=n.route[t])){e.next=21;break}return e.next=18,d(h);case 18:l=e.sent,e.next=28;break;case 21:if("action"!==t){e.next=27;break}throw v=new URL(r.url),m=v.pathname+v.search,$e(405,{method:r.method,pathname:m,routeId:n.route.id});case 27:return e.abrupt("return",{type:D.data,data:void 0});case 28:e.next=39;break;case 30:if(h){e.next=36;break}throw g=new URL(r.url),$e(404,{pathname:g.pathname+g.search});case 36:return e.next=38,d(h);case 38:l=e.sent;case 39:Z(void 0!==l,"You defined "+("action"===t?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+t+"` function. Please return a value or `null`."),e.next=46;break;case 42:e.prev=42,e.t0=e.catch(2),c=D.error,l=e.t0;case 46:return e.prev=46,f&&r.signal.removeEventListener("abort",f),e.finish(46);case 49:if(!Qe(l)){e.next=74;break}if(b=l.status,!ye.has(b)){e.next=59;break}if(Z(y=l.headers.get("Location"),"Redirects returned/thrown from loaders/actions must have a Location header"),Ce.test(y)?u.isStaticRequest||(x=new URL(r.url),w=y.startsWith("//")?new URL(x.protocol+y):new URL(y),S=null!=oe(w.pathname,s),w.origin===x.origin&&S&&(y=w.pathname+w.search+w.hash)):y=Oe(new URL(r.url),o.slice(0,o.indexOf(n)+1),s,!0,y),!u.isStaticRequest){e.next=58;break}throw l.headers.set("Location",y),l;case 58:return e.abrupt("return",{type:D.redirect,status:b,location:y,revalidate:null!==l.headers.get("X-Remix-Revalidate")});case 59:if(!u.isRouteRequest){e.next=61;break}throw{type:c||D.data,response:l};case 61:if(!(k=l.headers.get("Content-Type"))||!/\bapplication\/json\b/.test(k)){e.next=68;break}return e.next=65,l.json();case 65:E=e.sent,e.next=71;break;case 68:return e.next=70,l.text();case 70:E=e.sent;case 71:if(c!==D.error){e.next=73;break}return e.abrupt("return",{type:c,error:new he(b,l.statusText,E),headers:l.headers});case 73:return e.abrupt("return",{type:D.data,data:E,statusCode:l.status,headers:l.headers});case 74:if(c!==D.error){e.next=76;break}return e.abrupt("return",{type:c,error:l});case 76:if(!Xe(l)){e.next=78;break}return e.abrupt("return",{type:D.deferred,deferredData:l,statusCode:null==(_=l.init)?void 0:_.status,headers:(null==(O=l.init)?void 0:O.headers)&&new Headers(l.init.headers)});case 78:return e.abrupt("return",{type:D.data,data:l});case 79:case"end":return e.stop()}}),e,null,[[2,42,46,49]])}))),Ne.apply(this,arguments)}function Me(e,t,r,n){var o=e.createURL(Ge(t)).toString(),a={signal:r};if(n&&tt(n.formMethod)){var i=n.formMethod,s=n.formEncType;a.method=i.toUpperCase(),"application/json"===s?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(n.json)):"text/plain"===s?a.body=n.text:"application/x-www-form-urlencoded"===s&&n.formData?a.body=Ie(n.formData):a.body=n.formData}return new Request(o,a)}function Ie(e){var t,r=new URLSearchParams,n=T(e.entries());try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0],s=o[1];r.append(i,"string"===typeof s?s:s.name)}}catch(u){n.e(u)}finally{n.f()}return r}function Be(e){var t,r=new FormData,n=T(e.entries());try{for(n.s();!(t=n.n()).done;){var o=(0,a.Z)(t.value,2),i=o[0],s=o[1];r.append(i,s)}}catch(u){n.e(u)}finally{n.f()}return r}function Ue(e,t,r,n,o){var a,i={},s=null,u=!1,c={};return r.forEach((function(r,l){var f=t[l].route.id;if(Z(!Je(r),"Cannot handle redirect results in processLoaderData"),Ve(r)){var d=ze(e,f),h=r.error;n&&(h=Object.values(n)[0],n=void 0),null==(s=s||{})[d.route.id]&&(s[d.route.id]=h),i[f]=void 0,u||(u=!0,a=pe(r.error)?r.error.status:500),r.headers&&(c[f]=r.headers)}else qe(r)?(o.set(f,r.deferredData),i[f]=r.deferredData.data):i[f]=r.data,null==r.statusCode||200===r.statusCode||u||(a=r.statusCode),r.headers&&(c[f]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function Fe(e,t,r,n,o,a,i,s){for(var u=Ue(t,r,n,o,s),c=u.loaderData,l=u.errors,f=0;f=0;t--){var r=e[t];if(Je(r))return{result:r,idx:t}}}function Ge(e){return B(A({},"string"===typeof e?U(e):e,{hash:""}))}function Ye(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}function qe(e){return e.type===D.deferred}function Ve(e){return e.type===D.error}function Je(e){return(e&&e.type)===D.redirect}function Xe(e){var t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}function Qe(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function et(e){return be.has(e.toLowerCase())}function tt(e){return me.has(e.toLowerCase())}function rt(e,t,r,n,o,a){return nt.apply(this,arguments)}function nt(){return(nt=_(C().mark((function e(t,r,n,o,a,i){var s,u;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=C().mark((function e(s){var u,c,l,f,d;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=n[s],c=r[s]){e.next=4;break}return e.abrupt("return",1);case 4:if(l=t.find((function(e){return e.route.id===c.route.id})),f=null!=l&&!Te(l,c)&&void 0!==(i&&i[c.route.id]),!qe(u)||!a&&!f){e.next=11;break}return Z(d=o[s],"Expected an AbortSignal for revalidating fetcher deferred result"),e.next=11,ot(u,d,a).then((function(e){e&&(n[s]=e||n[s])}));case 11:case"end":return e.stop()}}),e)})),u=0;case 2:if(!(u=0||Z(!1),a=a.slice(0,Math.min(a.length,s+1))}return a.reduceRight((function(e,n,o){var s=n.route.id?null==i?void 0:i[n.route.id]:null,u=null;r&&(u=n.route.errorElement||At);var l=t.concat(a.slice(0,o+1)),f=function(){var t;return t=s?u:n.route.Component?c.createElement(n.route.Component,null):n.route.element?n.route.element:e,c.createElement(Lt,{match:n,routeContext:{outlet:e,matches:l,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?c.createElement(Dt,{location:r.location,revalidation:r.revalidation,component:u,error:s,children:f(),routeContext:{outlet:null,matches:l,isDataRoute:!0}}):f()}),null)}function Nt(e){var t=c.useContext(vt);return t||Z(!1),t}function Mt(e){var t=c.useContext(mt);return t||Z(!1),t}function It(e){var t=function(e){var t=c.useContext(xt);return t||Z(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||Z(!1),r.route.id}function Bt(){var e,t=c.useContext(wt),r=Mt(Tt.UseRouteError),n=It(Tt.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(jt||(jt={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(Tt||(Tt={}));var Ut,Ft=l.startTransition;function Ht(e){var t=e.fallbackElement,r=e.router,n=e.future,o=c.useState(r.state),i=(0,a.Z)(o,2),s=i[0],u=i[1],l=(n||{}).v7_startTransition,f=c.useCallback((function(e){l&&Ft?Ft((function(){return u(e)})):u(e)}),[u,l]);c.useLayoutEffect((function(){return r.subscribe(f)}),[r,f]);var d=c.useMemo((function(){return{createHref:r.createHref,encodeLocation:r.encodeLocation,go:function(e){return r.navigate(e)},push:function(e,t,n){return r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})},replace:function(e,t,n){return r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})}}}),[r]),h=r.basename||"/",p=c.useMemo((function(){return{router:r,navigator:d,static:!1,basename:h}}),[r,d,h]);return c.createElement(c.Fragment,null,c.createElement(vt.Provider,{value:p},c.createElement(mt.Provider,{value:s},c.createElement($t,{basename:h,location:s.location,navigationType:s.historyAction,navigator:d},s.initialized?c.createElement(zt,{routes:r.routes,state:s}):t))),null)}function zt(e){return Rt(e.routes,void 0,e.state)}function Wt(e){return function(e){var t=c.useContext(xt).outlet;return t?c.createElement(_t.Provider,{value:e},t):t}(e.context)}function $t(e){var t=e.basename,r=void 0===t?"/":t,n=e.children,o=void 0===n?null:n,a=e.location,i=e.navigationType,s=void 0===i?O.Pop:i,u=e.navigator,l=e.static,f=void 0!==l&&l;St()&&Z(!1);var d=r.replace(/^\/*/,"/"),h=c.useMemo((function(){return{basename:d,navigator:u,static:f}}),[d,u,f]);"string"===typeof a&&(a=U(a));var p=a,v=p.pathname,m=void 0===v?"/":v,g=p.search,b=void 0===g?"":g,y=p.hash,x=void 0===y?"":y,w=p.state,S=void 0===w?null:w,E=p.key,C=void 0===E?"default":E,k=c.useMemo((function(){var e=oe(m,d);return null==e?null:{location:{pathname:e,search:b,hash:x,state:S,key:C},navigationType:s}}),[d,m,b,x,S,C,s]);return null==k?null:c.createElement(bt.Provider,{value:h},c.createElement(yt.Provider,{children:o,value:k}))}!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Ut||(Ut={}));var Kt=new Promise((function(){}));c.Component;function Gt(e){var t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:c.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:c.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[r]=e[r]);return o}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);var Vt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Jt=["aria-current","caseSensitive","className","end","style","to","children"];function Xt(){var e,t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Yt({},t,{errors:Qt(t.errors)})),t}function Qt(e){if(!e)return null;for(var t={},r=0,n=Object.entries(e);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function yr(e,t){var r=e.title,n=e.titleId,o=br(e,mr);return c.createElement("svg",gr({viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:14,height:14,ref:t,"aria-labelledby":n},o),r?c.createElement("title",{id:n},r):null,fr||(fr=c.createElement("path",{d:"M971.6736 445.2352L594.8416 53.3504a122.2656 122.2656 0 0 0-176.5376 0L41.5744 445.2352c-38.912 40.96-33.8944 75.4688-27.5456 90.0096a65.536 65.536 0 0 0 64.6144 38.912h55.296v301.4656c0 68.4032 49.152 133.12 119.0912 133.12h160.3584V689.4592c0-34.2016-5.12-53.248 29.7984-53.248h126.7712c35.0208 0 29.7984 19.0464 29.7984 53.248v319.0784h160.4608c69.8368 0 119.0912-64.512 119.0912-133.12V574.1568h55.1936a65.536 65.536 0 0 0 64.6144-38.912c6.4512-14.5408 11.4688-49.5616-27.4432-90.0096z",fill:"currentColor"})))}var xr,wr,Sr,Er,Cr,kr=c.forwardRef(yr),_r=(r.p,hr.ZP.div(xr||(xr=(0,i.Z)(["\n text-align: center;\n max-width: 560px;\n margin: 0 auto;\n > span {\n background-color: var(--color-theme-bg);\n padding: 0 5px;\n }\n"])))),Or=hr.ZP.div(wr||(wr=(0,i.Z)(["\n text-align: center;\n font-size: 124px;\n padding: 100px 0 32px 0;\n"]))),Rr=hr.ZP.header(Sr||(Sr=(0,i.Z)(["\n max-width: 860px;\n margin: 0 auto;\n padding: 21px 0;\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n a {\n margin: 6px 10px;\n padding: 5px 10px;\n background-color: #e6e6e6;\n box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px;\n border-radius: 5px;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: #333;\n transition: background-color 0.3s;\n &.comps {\n background: #10b316;\n color: white !important;\n }\n &.active {\n color: white;\n background: #333 !important;\n }\n svg {\n margin-right: 5px;\n }\n }\n"]))),Pr=function(){var e=(0,c.useContext)(pr._y),t=e.hsva,r=e.dispatch;return(0,y.jsx)(vr.default,{color:t,style:{margin:"20px auto 0 auto"},onChange:function(e){r({hsva:(0,o.Z)((0,o.Z)({},t),e.hsva)})}})};function jr(e){var t=e.menus;return(0,y.jsxs)("div",{children:[(0,y.jsx)(Or,{children:"\ud83c\udfa8"}),(0,y.jsxs)(_r,{children:[(0,y.jsxs)("span",{children:[(0,y.jsx)("b",{children:"react-color"})," is a tiny color picker widget component for react apps. These components can be installed and used separately."]}),(0,y.jsx)(Pr,{})]}),(0,y.jsx)(Rr,{children:t.map((function(e,t){return e.path?(0,y.jsxs)(nr,{to:e.path,className:e.isComp?"comps":"",children:["/"===e.path&&(0,y.jsx)(kr,{}),(0,y.jsx)("span",{children:e.label})]},t):null}))})]})}var Tr=hr.ZP.div(Er||(Er=(0,i.Z)(["\n transition: background-color 0.3s ease 0s;\n min-height: 100vh;\n dark-mode {\n font-size: 18px;\n position: fixed;\n top: 10px;\n left: 10px;\n }\n"]))),Ar=hr.ZP.div(Cr||(Cr=(0,i.Z)(["\n position: fixed;\n left: 88px;\n top: 12px;\n background: var(--color-theme-bg);\n border-radius: 3px;\n padding: 0px 6px;\n"])));function Dr(e,t){if(null==e)return{};var r,n,o=(0,u.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Lr=["children"],Zr={path:"/",Component:function(){var e=(0,c.useReducer)(pr.I6,pr.Of),t=(0,a.Z)(e,2),r=t[0],n=t[1];(0,c.useEffect)((function(){document.body.style.background="url(".concat(S.BACKGROUND_IMG,") left center"),document.body.style.backgroundAttachment="fixed"}),[]);var i=r.hsva;return(0,c.useEffect)((function(){document.documentElement.style.backgroundColor=(0,dr.hsvaToHslaString)(i)}),[i]),(0,y.jsx)(pr._y.Provider,{value:(0,o.Z)((0,o.Z)({},r),{},{dispatch:n}),children:(0,y.jsxs)(Tr,{style:{backgroundColor:(0,dr.hsvaToHslaString)(r.hsva)},children:[(0,y.jsx)("dark-mode",{permanent:!0,light:"Dark",dark:"Light"}),(0,y.jsxs)(Ar,{children:["v","1.3.4"]}),(0,y.jsx)(w,{fixed:!0,zIndex:99,size:60,target:"__blank",href:"https://github.com/uiwjs/react-color"}),(0,y.jsx)(jr,{menus:Zr.children||[]}),(0,y.jsx)(Wt,{}),(0,y.jsx)(ir,{})]})})},ErrorBoundary:(0,c.forwardRef)((function(e,t){e.children;var r=Dr(e,Lr),n=Bt();return(0,y.jsxs)("div",(0,o.Z)((0,o.Z)({id:"error-page"},r),{},{ref:t,children:[(0,y.jsx)("h1",{children:"Oops!"}),(0,y.jsx)("p",{children:"\u62b1\u6b49\uff0c\u53d1\u751f\u4e86\u610f\u5916\u9519\u8bef\u3002"}),(0,y.jsxs)("p",{children:[(null===n||void 0===n?void 0:n.status)&&(0,y.jsx)("em",{children:null===n||void 0===n?void 0:n.status}),(null===n||void 0===n?void 0:n.statusText)&&(0,y.jsx)("i",{children:decodeURI((null===n||void 0===n?void 0:n.statusText)||"")})]})]}))})),children:[{path:"/",label:"Home",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(31),r.e(281)]).then(r.bind(r,1281))}},{path:"/colorful",label:"Colorful",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(113)]).then(r.bind(r,5782))}},{path:"/sketch",label:"Sketch",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(308)]).then(r.bind(r,7711))}},{path:"/block",label:"Block",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(494)]).then(r.bind(r,5545))}},{path:"/circle",label:"Circle",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(785)]).then(r.bind(r,308))}},{path:"/compact",label:"Compact",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(952)]).then(r.bind(r,7216))}},{path:"/wheel",label:"Wheel",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(919)]).then(r.bind(r,9014))}},{path:"/github",label:"Github",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(781)]).then(r.bind(r,1956))}},{path:"/material",label:"Material",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(955)]).then(r.bind(r,3100))}},{path:"/chrome",label:"Chrome",isComp:!0,lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(31),r.e(446)]).then(r.bind(r,9446))}},{path:"/alpha",label:"Alpha",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(546)]).then(r.bind(r,9522))}},{path:"/editable-input",label:"EditableInput",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(756)]).then(r.bind(r,737))}},{path:"/editable-input-hsla",label:"EditableInputHsla",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(569)]).then(r.bind(r,6419))}},{path:"/editable-input-rgba",label:"EditableInputRgba",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(309)]).then(r.bind(r,2943))}},{path:"/hue",label:"Hue",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(297)]).then(r.bind(r,1144))}},{path:"/name",label:"Name",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(466)]).then(r.bind(r,8982))}},{path:"/saturation",label:"Saturation",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(649)]).then(r.bind(r,710))}},{path:"/shade-slider",label:"ShadeSlider",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(620)]).then(r.bind(r,3743))}},{path:"/slider",label:"Slider",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(875)]).then(r.bind(r,1983))}},{path:"/swatch",label:"Swatch",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(118)]).then(r.bind(r,8865))}},{path:"/drag-event-interactive",label:"Interactive",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(94)]).then(r.bind(r,5991))}},{path:"/convert",label:"Convert",lazy:function(){return Promise.all([r.e(269),r.e(117),r.e(721)]).then(r.bind(r,704))}}]},Nr=["children","style"],Mr={display:"flex",alignItems:"center",justifyContent:"center",gap:"1rem",left:0,right:0,top:0,bottom:0,position:"absolute",zIndex:9999},Ir=function(e){var t=e.children,r=e.style,n=Dr(e,Nr);return(0,y.jsxs)("div",(0,o.Z)((0,o.Z)({},n),{},{style:(0,o.Z)((0,o.Z)({},Mr),r),children:[(0,y.jsxs)("svg",{width:"25",height:"30",viewBox:"0 0 135 140",fill:"currentColor",children:[(0,y.jsxs)("rect",{y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"60",width:"15",height:"140",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]}),(0,y.jsxs)("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6",children:[(0,y.jsx)("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),(0,y.jsx)("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]})]}),(0,y.jsx)("div",{children:t||"Loading..."})]}))},Br=document.getElementById("root");(0,n.s)(Br).render((0,y.jsx)(Ht,{router:function(e,t){return _e({basename:null==t?void 0:t.basename,future:Yt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:(r={window:null==t?void 0:t.window},void 0===r&&(r={}),F((function(e,t){var r=U(e.location.hash.substr(1)),n=r.pathname,o=void 0===n?"/":n,a=r.search,i=void 0===a?"":a,s=r.hash;return I("",{pathname:o,search:i,hash:void 0===s?"":s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){var r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){var o=e.location.href,a=o.indexOf("#");n=-1===a?o:o.slice(0,a)}return n+"#"+("string"===typeof t?t:B(t))}),(function(e,t){N("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),r)),hydrationData:(null==t?void 0:t.hydrationData)||Xt(),routes:e,mapRouteProperties:Gt}).initialize();var r}([Zr]),fallbackElement:(0,y.jsx)(Ir,{})}))},6155:function(e,t,r){var n=r(8983).default,o=r(2081).default,a=r(7266).default,i=r(8724).default,s=r(670).default,u=r(9952).default,c=r(3231).default,l=document,f="_dark_mode_theme_",d="permanent",h="colorschemechange",p="light",v="dark",m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){var e=this.getAttribute(t);return null===e?"":e},set:function(e){this.setAttribute(t,e)}})},g=function(e){"use strict";i(r,e);var t=s(r);function r(){var e;return n(this,r),e=t.call(this),c(a(e),"LOCAL_NANE",f),e.t(),e}return o(r,[{key:"connectedCallback",value:function(){var e=this;m(this,"mode"),m(this,v),m(this,p),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;Object.defineProperty(e,r,{enumerable:!0,get:function(){return this.hasAttribute(t)},set:function(e){e?this.setAttribute(t,""):this.removeAttribute(t)}})}(this,d);var t=localStorage.getItem(f);t&&[p,v].includes(t)&&(this.mode=t,this.permanent=!0),this.permanent&&!t&&localStorage.setItem(f,this.mode);var r=[p,v].includes(t);this.permanent&&t?this.o():(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.mode=v,this.o()),window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&(this.mode=p,this.o())),this.permanent||r||(window.matchMedia("(prefers-color-scheme: light)").onchange=function(t){e.mode=t.matches?p:v,e.o()},window.matchMedia("(prefers-color-scheme: dark)").onchange=function(t){e.mode=t.matches?v:p,e.o()}),new MutationObserver((function(t,n){e.mode=l.documentElement.dataset.colorMode,e.permanent&&r&&(localStorage.setItem(f,e.mode),e.i("permanentcolorscheme",{permanent:e.permanent})),e.h(),e.i(h,{colorScheme:e.mode})})).observe(l.documentElement,{attributes:!0}),this.i(h,{colorScheme:this.mode}),this.h()}},{key:"attributeChangedCallback",value:function(e,t,r){if("mode"===e&&t!==r&&[p,v].includes(r)){var n=localStorage.getItem(f);this.mode===n?(this.mode=r,this.h(),this.o()):this.mode&&this.mode!==n&&(this.h(),this.o())}else e!==p&&e!==v||t===r||this.h();"permanent"===e&&"boolean"===typeof this.permanent&&(this.permanent?localStorage.setItem(f,this.mode):localStorage.removeItem(f))}},{key:"o",value:function(){l.documentElement.setAttribute("data-color-mode",this.mode)}},{key:"h",value:function(){this.icon.textContent=this.mode===p?"\ud83c\udf12":"\ud83c\udf1e",this.text.textContent=this.mode===p?this.getAttribute(v):this.getAttribute(p),!this.text.textContent&&this.text.parentElement&&this.text&&this.text.parentElement.removeChild(this.text)}},{key:"t",value:function(){var e=this,t=this.attachShadow({mode:"open"});this.label=l.createElement("span"),this.label.setAttribute("class","wrapper"),this.label.onclick=function(){e.mode=e.mode===p?v:p,e.permanent&&localStorage.setItem(f,e.mode),e.o(),e.h()},t.appendChild(this.label),this.icon=l.createElement("span"),this.label.appendChild(this.icon),this.text=l.createElement("span"),this.label.appendChild(this.text);var r="_dark_mode_style_";if(!l.getElementById(r)){var n=l.createElement("style");n.id=r,n.textContent="\n[data-color-mode*='dark'], [data-color-mode*='dark'] body {\n color-scheme: dark;\n --color-theme-bg: #0d1117;\n --color-theme-text: #c9d1d9;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}\n\n[data-color-mode*='light'], [data-color-mode*='light'] body {\n color-scheme: light;\n --color-theme-bg: #fff;\n --color-theme-text: #24292f;\n background-color: var(--color-theme-bg);\n color: var(--color-theme-text);\n}",l.head.appendChild(n)}var o=l.createElement("style");o.textContent="\n .wrapper { cursor: pointer; user-select: none; position: relative; }\n .wrapper > span + span { margin-left: .4rem; }\n ",t.appendChild(o)}},{key:"i",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}],[{key:"observedAttributes",get:function(){return["mode",p,v,d]}}]),r}(u(HTMLElement));customElements.define("dark-mode",g)},1713:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r>>1,o=e[n];if(!(0>>1;na(u,r))ca(l,u)?(e[n]=l,e[c]=r,n=c):(e[n]=u,e[s]=r,n=s);else{if(!(ca(l,r)))break e;e[n]=l,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var c=[],l=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,g="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,y="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=n(l);null!==t;){if(null===t.callback)o(l);else{if(!(t.startTime<=e))break;o(l),t.sortIndex=t.expirationTime,r(c,t)}t=n(l)}}function w(e){if(m=!1,x(e),!v)if(null!==n(c))v=!0,D(S);else{var t=n(l);null!==t&&L(w,t.startTime-e)}}function S(e,r){v=!1,m&&(m=!1,b(_),_=-1),p=!0;var a=h;try{for(x(r),d=n(c);null!==d&&(!(d.expirationTime>r)||e&&!P());){var i=d.callback;if("function"===typeof i){d.callback=null,h=d.priorityLevel;var s=i(d.expirationTime<=r);r=t.unstable_now(),"function"===typeof s?d.callback=s:d===n(c)&&o(c),x(r)}else o(c);d=n(c)}if(null!==d)var u=!0;else{var f=n(l);null!==f&&L(w,f.startTime-r),u=!1}return u}finally{d=null,h=a,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,C=!1,k=null,_=-1,O=5,R=-1;function P(){return!(t.unstable_now()-Re||125i?(e.sortIndex=a,r(l,e),null===n(c)&&e===n(l)&&(m?(b(_),_=-1):m=!0,L(w,a-i))):(e.sortIndex=s,r(c,e),v||p||(v=!0,D(S))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}},7029:function(e,t,r){"use strict";e.exports=r(4478)},1985:function(e){e.exports=function(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),u=0;u0?C(Z,--D):0,T--,10===L&&(T=1,j--),L}function U(){return L=D2||W(L)>3?"":" "}function q(e,t){for(;--t&&U()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return z(e,H()+(t<6&&32==F()&&32==U()))}function V(e){for(;U();)switch(L){case e:return D;case 34:case 39:34!==e&&39!==e&&V(L);break;case 40:41===e&&V(e);break;case 92:U()}return D}function J(e,t){for(;U()&&e+L!==57&&(e+L!==84||47!==F()););return"/*"+z(t,D-1)+"*"+b(47===e?e:U())}function X(e){for(;!W(F());)U();return z(e,D)}function Q(e,t){for(var r="",n=0;n6)switch(C(e,t+1)){case 109:if(45!==C(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1"+l+"$2-$3$1"+c+(108==C(e,t+3)?"$3":"$2-$3"))+e;case 115:return~E(e,"stretch")?te(S(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return S(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,r,n,o,a,i,s){return u+r+":"+n+s+(o?u+r+"-span:"+(a?i:+i-+n)+s:"")+e}));case 4949:if(121===C(e,t+6))return S(e,":",":"+l)+e;break;case 6444:switch(C(e,45===C(e,14)?18:11)){case 120:return S(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+l+(45===C(e,14)?"inline-":"")+"box$3$1"+l+"$2$3$1"+u+"$2box$3")+e;case 100:return S(e,":",":"+u)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return S(e,"scroll-","scroll-snap-")+e}return e}function re(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case h:return void(e.return=te(e.value,e.length,r));case v:return Q([M(e,{value:S(e.value,"@","@"+l)})],n);case d:if(e.length)return function(e,t){return e.map(t).join("")}(r=e.props,(function(t){switch(w(t,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":I(M(e,{props:[S(t,/:(read-\w+)/,":"+c+"$1")]})),I(M(e,{props:[t]})),y(e,{props:P(r,n)});break;case"::placeholder":I(M(e,{props:[S(t,/:(plac\w+)/,":"+l+"input-$1")]})),I(M(e,{props:[S(t,/:(plac\w+)/,":"+c+"$1")]})),I(M(e,{props:[S(t,/:(plac\w+)/,u+"input-$1")]})),I(M(e,{props:[t]})),y(e,{props:P(r,n)})}return""}))}}function ne(e){return K(oe("",null,null,null,[""],e=$(e),0,[0],e))}function oe(e,t,r,n,o,a,i,s,u){for(var c=0,l=0,f=i,d=0,h=0,p=0,v=1,m=1,g=1,y=0,x="",w=o,k=a,O=n,P=x;m;)switch(p=y,y=U()){case 40:if(108!=p&&58==C(P,f-1)){-1!=E(P+=S(G(y),"&","&\f"),"&\f")&&(g=-1);break}case 34:case 39:case 91:P+=G(y);break;case 9:case 10:case 13:case 32:P+=Y(p);break;case 92:P+=q(H()-1,7);continue;case 47:switch(F()){case 42:case 47:R(ie(J(U(),H()),t,r,u),u);break;default:P+="/"}break;case 123*v:s[c++]=_(P)*g;case 125*v:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+l:-1==g&&(P=S(P,/\f/g,"")),h>0&&_(P)-f&&R(h>32?se(P+";",n,r,f-1,u):se(S(P," ","")+";",n,r,f-2,u),u);break;case 59:P+=";";default:if(R(O=ae(P,t,r,c,l,o,s,x,w=[],k=[],f,a),a),123===y)if(0===l)oe(P,t,O,O,w,a,f,s,k);else switch(99===d&&110===C(P,3)?100:d){case 100:case 108:case 109:case 115:oe(e,O,O,n&&R(ae(e,O,O,0,0,o,s,x,o,w=[],f,k),k),o,k,f,s,n?w:k);break;default:oe(P,O,O,O,[""],k,0,s,k)}}c=l=h=0,v=g=1,x=P="",f=i;break;case 58:f=1+_(P),h=p;default:if(v<1)if(123==y)--v;else if(125==y&&0==v++&&125==B())continue;switch(P+=b(y),y*v){case 38:g=l>0?1:(P+="\f",-1);break;case 44:s[c++]=(_(P)-1)*g,g=1;break;case 64:45===F()&&(P+=G(U())),d=F(),l=f=_(x=P+=X(H())),y++;break;case 45:45===p&&2==_(P)&&(v=0)}}return a}function ae(e,t,r,n,o,a,i,s,u,c,l,f){for(var h=o-1,p=0===o?a:[""],v=O(p),m=0,b=0,y=0;m0?p[w]+" "+E:S(E,/&\f/g,p[w])))&&(u[y++]=C);return N(e,t,r,0===o?d:s,u,c,l,f)}function ie(e,t,r,n){return N(e,t,r,f,b(L),k(e,2,-2),0,n)}function se(e,t,r,n,o){return N(e,t,r,h,k(e,0,n),k(e,n+1,-1),n,o)}var ue={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce=r(1713),le="undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",fe="undefined"!=typeof window&&"HTMLElement"in window,de=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof ce&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),he=(new Set,Object.freeze([])),pe=Object.freeze({});function ve(e,t,r){return void 0===r&&(r=pe),e.theme!==r.theme&&e.theme||t||r.theme}var me=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ge=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function ye(e){return e.replace(ge,"-").replace(be,"")}var xe=/(a)(d)/gi,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function Se(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=we(t%52)+r;return(we(t%52)+r).replace(xe,"$1-$2")}var Ee,Ce=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},ke=function(e){return Ce(5381,e)};function _e(e){return Se(ke(e)>>>0)}function Oe(e){return"string"==typeof e&&!0}var Re="function"==typeof Symbol&&Symbol.for,Pe=Re?Symbol.for("react.memo"):60115,je=Re?Symbol.for("react.forward_ref"):60112,Te={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},De={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Le=((Ee={})[je]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ee[Pe]=De,Ee);function Ze(e){return("type"in(t=e)&&t.type.$$typeof)===Pe?De:"$$typeof"in e?Le[e.$$typeof]:Te;var t}var Ne=Object.defineProperty,Me=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols,Be=Object.getOwnPropertyDescriptor,Ue=Object.getPrototypeOf,Fe=Object.prototype;function He(e,t,r){if("string"!=typeof t){if(Fe){var n=Ue(t);n&&n!==Fe&&He(e,n,r)}var o=Me(t);Ie&&(o=o.concat(Ie(t)));for(var a=Ze(e),i=Ze(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var Je=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)if((o<<=1)<0)throw Ve(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a=0){var r=document.createTextNode(t);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e0&&(u+="".concat(e,","))})),n+="".concat(i).concat(s,'{content:"').concat(u,'"}').concat("/*!sc*/\n")},a=0;a0?".".concat(t):e},l=u.slice();l.push((function(e){e.type===d&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(vt,r).replace(n,c))})),i.prefix&&l.push(re),l.push(ee);var f=function(e,o,a,s){void 0===o&&(o=""),void 0===a&&(a=""),void 0===s&&(s="&"),t=s,r=o,n=new RegExp("\\".concat(r,"\\b"),"g");var u=e.replace(mt,""),c=ne(a||o?"".concat(a," ").concat(o," { ").concat(u," }"):u);i.namespace&&(c=gt(c,i.namespace));var f,d=[];return Q(c,function(e){var t=O(e);return function(r,n,o,a){for(var i="",s=0;s="A"&&e<="Z"};function Ot(e){for(var t="",r=0;r>>0);if(!t.hasNameForId(this.componentId,a)){var i=r(o,".".concat(a),void 0,this.componentId);t.insertRules(this.componentId,a,i)}n=$e(n,a),this.staticRulesId=a}else{for(var s=Ce(this.baseHash,r.hash),u="",c=0;c>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,r(u,".".concat(d),void 0,this.componentId)),n=$e(n,d)}}return n},e}(),Lt=a.createContext(void 0);Lt.Consumer;var Zt={};new Set;function Nt(e,t,r){var o=We(e),i=e,s=!Oe(e),u=t.attrs,c=void 0===u?he:u,l=t.componentId,f=void 0===l?function(e,t){var r="string"!=typeof e?"sc":ye(e);Zt[r]=(Zt[r]||0)+1;var n="".concat(r,"-").concat(_e("6.0.8"+r+Zt[r]));return t?"".concat(t,"-").concat(n):n}(t.displayName,t.parentComponentId):l,d=t.displayName,h=(void 0===d&&function(e){Oe(e)?"styled.".concat(e):"Styled(".concat(function(e){return e.displayName||e.name||"Component"}(e),")")}(e),t.displayName&&t.componentId?"".concat(ye(t.displayName),"-").concat(t.componentId):t.componentId||f),p=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,v=t.shouldForwardProp;if(o&&i.shouldForwardProp){var m=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;v=function(e,t){return m(e,t)&&g(e,t)}}else v=m}var b=new Dt(r,h,o?i.componentStyle:void 0);var y=a.forwardRef((function(e,t){return function(e,t,r){var o=e.attrs,i=e.componentStyle,s=e.defaultProps,u=e.foldedComponentIds,c=e.styledComponentId,l=e.target,f=a.useContext(Lt),d=Et(),h=e.shouldForwardProp||d.shouldForwardProp,p=function(e,t,r){for(var o,a=n(n({},t),{className:void 0,theme:r}),i=0;i2&&pt.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)}}();(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),r=st(),n=Ke([r&&'nonce="'.concat(r,'"'),"".concat(le,'="true"'),"".concat("data-styled-version",'="').concat("6.0.8",'"')].filter(Boolean)," ");return"")},this.getStyleTags=function(){if(e.sealed)throw Ve(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw Ve(2);var r=((t={})[le]="",t["data-styled-version"]="6.0.8",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=st();return o&&(r.nonce=o),[a.createElement("style",n({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new pt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw Ve(2);return a.createElement(Ct,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw Ve(3)}})(),"__sc-".concat(le,"__")},7240:function(e,t,r){"use strict";r.r(t),r.d(t,{BACKGROUND_IMG:function(){return d},Pointer:function(){return l},default:function(){return p}});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),u=r(4760),c=["className","prefixCls","left","top","style","fillProps"],l=function(e){var t=e.className,r=e.prefixCls,a=e.left,i=e.top,s=e.style,l=e.fillProps,f=(0,o.Z)(e,c),d=(0,n.Z)({},s,{position:"absolute",left:a,top:i}),h=(0,n.Z)({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==l?void 0:l.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,u.jsx)("div",(0,n.Z)({className:r+"-pointer "+(t||""),style:d},f,{children:(0,u.jsx)("div",(0,n.Z)({className:r+"-fill"},l,{style:h}))}))},f=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",h=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-alpha":r,c=e.className,h=e.hsva,p=e.background,v=e.bgProps,m=void 0===v?{}:v,g=e.innerProps,b=void 0===g?{}:g,y=e.pointerProps,x=void 0===y?{}:y,w=e.radius,S=void 0===w?0:w,E=e.width,C=e.height,k=void 0===C?16:C,_=e.direction,O=void 0===_?"horizontal":_,R=e.style,P=e.onChange,j=e.pointer,T=(0,o.Z)(e,f),A=function(e){P&&P((0,n.Z)({},h,{a:"horizontal"===O?e.left:e.top}),e)},D=(0,i.hsvaToHslaString)(Object.assign({},h,{a:1})),L="linear-gradient(to "+("horizontal"===O?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+D+" 100%)",Z={};"horizontal"===O?Z.left=100*h.a+"%":Z.top=100*h.a+"%";var N=(0,n.Z)({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:S,background:"url("+d+") left center",backgroundColor:"var(--alpha-background-color)"},R,{position:"relative"},{width:E,height:k}),M=j&&"function"===typeof j?j((0,n.Z)({prefixCls:a},x,Z)):(0,u.jsx)(l,(0,n.Z)({},x,{prefixCls:a},Z));return(0,u.jsxs)("div",(0,n.Z)({},T,{className:[a,a+"-"+O,c||""].filter(Boolean).join(" "),style:N,ref:t,children:[(0,u.jsx)("div",(0,n.Z)({},m,{style:(0,n.Z)({inset:0,position:"absolute",background:p||L,borderRadius:S},m.style)})),(0,u.jsx)(s.default,(0,n.Z)({},b,{style:(0,n.Z)({},b.style,{inset:0,zIndex:1,position:"absolute"}),onMove:A,onDown:A,children:M}))]}))}));h.displayName="Alpha";var p=h},7961:function(e,t,r){"use strict";r.d(t,{Q:function(){return o}});var n=r(6493),o=function(e){if(!e)return"#ffffff";var t=(0,n.color)(e);return(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000000":"#ffffff"}},6493:function(e,t,r){"use strict";r.r(t),r.d(t,{color:function(){return M},equalColorObjects:function(){return a.zl},equalColorString:function(){return a.SJ},equalHex:function(){return a.Gp},getContrastingColor:function(){return i.Q},hexToHsva:function(){return O},hexToRgba:function(){return R},hslStringToHsla:function(){return p},hslStringToHsva:function(){return m},hslaStringToHsva:function(){return v},hslaToHsl:function(){return D},hslaToHsva:function(){return g},hsvStringToHsva:function(){return S},hsvaStringToHsva:function(){return y},hsvaToHex:function(){return L},hsvaToHexa:function(){return Z},hsvaToHslString:function(){return l},hsvaToHsla:function(){return b},hsvaToHslaString:function(){return h},hsvaToHsv:function(){return N},hsvaToHsvString:function(){return f},hsvaToHsvaString:function(){return d},hsvaToRgbString:function(){return j},hsvaToRgba:function(){return P},hsvaToRgbaString:function(){return T},parseHue:function(){return w},rgbStringToHsva:function(){return C},rgbaStringToHsva:function(){return E},rgbaToHex:function(){return k},rgbaToHexa:function(){return _},rgbaToHsva:function(){return c},rgbaToRgb:function(){return A},validHex:function(){return a.Ff}});var n=r(1026),o=r(5773),a=r(5301),i=r(7961),s=255,u=100,c=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),c=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(c<0?c+6:c),s:a?i/a*u:0,v:a/s*u,a:o}},l=function(e){var t=b(e),r=t.h,n=t.s,o=t.l;return"hsl("+r+", "+Math.round(n)+"%, "+Math.round(o)+"%)"},f=function(e){return"hsv("+e.h+", "+e.s+"%, "+e.v+"%)"},d=function(e){return"hsva("+e.h+", "+e.s+"%, "+e.v+"%, "+e.a+")"},h=function(e){var t=b(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},p=function(e){var t=(e.match(/\d+/g)||[]).map(Number),r=(0,n.Z)(t,4);return{h:r[0],s:r[1],l:r[2],a:r[3]}},v=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?g({h:w(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},m=v,g=function(e){var t=e.h,r=e.s,n=e.l,o=e.a;return{h:t,s:(r*=(n<50?n:u-n)/u)>0?2*r/(n+r)*u:0,v:n+r,a:o}},b=function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=(200-r)*n/u;return{h:t,s:a>0&&a<200?r*n/u/(a<=u?a:200-a)*u:0,l:a/2,a:o}},y=function(e){var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?{h:w(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?u:1)}:{h:0,s:0,v:0,a:1}},x={grad:.9,turn:360,rad:360/(2*Math.PI)},w=function(e,t){return void 0===t&&(t="deg"),Number(e)*(x[t]||1)},S=y,E=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?c({r:Number(t[1])/(t[2]?u/s:1),g:Number(t[3])/(t[4]?u/s:1),b:Number(t[5])/(t[6]?u/s:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?u:1)}):{h:0,s:0,v:0,a:1}},C=E,k=function(e){var t,r=e.r,n=e.g,o=e.b;return"#"+(t=(r<<16|n<<8|o).toString(16),new Array(7-t.length).join("0")+t)},_=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a="number"===typeof o&&(255*o|256).toString(16).slice(1);return""+k({r:t,g:r,b:n,a:o})+(a||"")},O=function(e){return c(R(e))},R=function(e){var t=e.replace("#","");/^#?/.test(e)&&3===t.length&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),o=e.match(r).map((function(e){return parseInt(e,16)})),a=(0,n.Z)(o,4),i=a[0],u=a[1],c=a[2],l=void 0===c?0:c,f=a[3];return{r:i,g:u,b:l,a:(null!=f?f:255)/s}},P=function(e){var t=e.h,r=e.s,n=e.v,a=e.a,i=t/60,c=r/u,l=n/u,f=Math.floor(i)%6,d=i-Math.floor(i),h=s*l*(1-c),p=s*l*(1-c*d),v=s*l*(1-c*(1-d));l*=s;var m={};switch(f){case 0:m.r=l,m.g=v,m.b=h;break;case 1:m.r=p,m.g=l,m.b=h;break;case 2:m.r=h,m.g=l,m.b=v;break;case 3:m.r=h,m.g=p,m.b=l;break;case 4:m.r=v,m.g=h,m.b=l;break;case 5:m.r=l,m.g=h,m.b=p}return m.r=Math.round(m.r),m.g=Math.round(m.g),m.b=Math.round(m.b),(0,o.Z)({},m,{a:a})},j=function(e){var t=P(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},T=function(e){var t=P(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},A=function(e){return{r:e.r,g:e.g,b:e.b}},D=function(e){return{h:e.h,s:e.s,l:e.l}},L=function(e){return k(P(e))},Z=function(e){return _(P(e))},N=function(e){return{h:e.h,s:e.s,v:e.v}},M=function(e){var t,r,n,o,i,s,u,c;return"string"===typeof e&&(0,a.Ff)(e)?(s=O(e),u=e):"string"!==typeof e&&(s=e),s&&(n=N(s),i=b(s),o=P(s),c=_(o),u=L(s),r=D(i),t=A(o)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:u,hexa:c}}},5301:function(e,t,r){"use strict";r.d(t,{Ff:function(){return s},Gp:function(){return i},SJ:function(){return a},zl:function(){return o}});var n=r(6493),o=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},a=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},i=function(e,t){return e.toLowerCase()===t.toLowerCase()||o((0,n.hexToRgba)(e),(0,n.hexToRgba)(t))},s=function(e){return/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e)}},3789:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(8702),s=r(6493),u=r(4760),c=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],l=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-editable-input-rgba":r,l=e.hsva,f=e.placement,d=void 0===f?"bottom":f,h=e.rProps,p=void 0===h?{}:h,v=e.gProps,m=void 0===v?{}:v,g=e.bProps,b=void 0===g?{}:g,y=e.aProps,x=void 0===y?{}:y,w=e.className,S=e.style,E=e.onChange,C=(0,o.Z)(e,c),k=l?(0,s.hsvaToRgba)(l):{};function _(e){var t=Number(e.target.value);t&&t>255&&(e.target.value="255"),t&&t<0&&(e.target.value="0")}var O=function(e,t,r){"number"===typeof e&&("a"===t&&(e<0&&(e=0),e>100&&(e=100),E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{a:e/100}))))),e>255&&(e=255,r.target.value="255"),e<0&&(e=0,r.target.value="0"),"r"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{r:e})))),"g"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{g:e})))),"b"===t&&E&&E((0,s.color)((0,s.rgbaToHsva)((0,n.Z)({},k,{b:e})))))};return(0,u.jsxs)("div",(0,n.Z)({ref:t,className:[a,w||""].filter(Boolean).join(" ")},C,{style:(0,n.Z)({fontSize:11,display:"flex"},S),children:[(0,u.jsx)(i.default,(0,n.Z)({label:"R",value:k.r||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"r",e)}},p,{style:(0,n.Z)({},p.style)})),(0,u.jsx)(i.default,(0,n.Z)({label:"G",value:k.g||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"g",e)}},m,{style:(0,n.Z)({marginLeft:5},p.style)})),(0,u.jsx)(i.default,(0,n.Z)({label:"B",value:k.b||0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"b",e)}},b,{style:(0,n.Z)({marginLeft:5},b.style)})),x&&(0,u.jsx)(i.default,(0,n.Z)({label:"A",value:k.a?parseInt(String(100*k.a),10):0,onBlur:_,placement:d,onChange:function(e,t){return O(t,"a",e)}},x,{style:(0,n.Z)({marginLeft:5},x.style)}))]}))}));l.displayName="EditableInputRGBA",t.default=l},8702:function(e,t,r){"use strict";r.r(t);var n=r(1026),o=r(5773),a=r(808),i=r(8573),s=r(4760),u=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],c=i.forwardRef((function(e,t){var r=e.prefixCls,c=void 0===r?"w-color-editable-input":r,l=e.placement,f=void 0===l?"bottom":l,d=e.label,h=e.value,p=e.className,v=e.style,m=e.labelStyle,g=e.inputStyle,b=e.onChange,y=e.onBlur,x=(0,a.Z)(e,u),w=(0,i.useState)(h),S=(0,n.Z)(w,2),E=S[0],C=S[1],k=(0,i.useRef)(!1);(0,i.useEffect)((function(){e.value!==E&&(k.current||C(e.value))}),[e.value]);var _={};"bottom"===f&&(_.flexDirection="column"),"top"===f&&(_.flexDirection="column-reverse"),"left"===f&&(_.flexDirection="row-reverse");var O=(0,o.Z)({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},_,v),R=(0,o.Z)({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},g);return(0,s.jsxs)("div",{className:[c,p||""].filter(Boolean).join(" "),style:O,children:[(0,s.jsx)("input",(0,o.Z)({ref:t,value:E,onChange:function(e,t){var r=t||e.target.value;/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(r)&&b&&b(e,r);var n=function(e){return Number(String(e).replace(/%/g,""))}(r);isNaN(n)||b&&b(e,n),C(r)},onBlur:function(t){k.current=!1,C(e.value),y&&y(t)},autoComplete:"off",onFocus:function(){return k.current=!0}},x,{style:R})),d&&(0,s.jsx)("span",{style:(0,o.Z)({color:"var(--editable-input-label-color)",textTransform:"capitalize"},m),children:d})]})}));c.displayName="EditableInput",t.default=c},7864:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(7240),s=r(4760),u=["prefixCls","className","hue","onChange","direction"],c=a.forwardRef((function(e,t){var r=e.prefixCls,a=void 0===r?"w-color-hue":r,c=e.className,l=e.hue,f=void 0===l?0:l,d=e.onChange,h=e.direction,p=void 0===h?"horizontal":h,v=(0,o.Z)(e,u);return(0,s.jsx)(i.default,(0,n.Z)({ref:t,className:a+" "+(c||"")},v,{direction:p,background:"linear-gradient(to "+("horizontal"===p?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:f,s:100,v:100,a:f/360},onChange:function(e,t){d&&d({h:"horizontal"===p?360*t.left:360*t.top})}}))}));c.displayName="Hue",t.default=c},6319:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return d}});var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(6813),u=r(4760),c=function(e){var t=e.className,r=e.color,n=e.left,o=e.top,i=e.prefixCls,s={position:"absolute",top:o,left:n},c={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return(0,a.useMemo)((function(){return(0,u.jsx)("div",{className:i+"-pointer "+(t||""),style:s,children:(0,u.jsx)("div",{className:i+"-fill",style:c})})}),[o,n,r,t,i])},l=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],f=a.forwardRef((function(e,t){var r,f=e.prefixCls,d=void 0===f?"w-color-saturation":f,h=e.radius,p=void 0===h?0:h,v=e.pointer,m=e.className,g=e.hue,b=void 0===g?0:g,y=e.style,x=e.hsva,w=e.onChange,S=(0,o.Z)(e,l),E=(0,n.Z)({width:200,height:200,borderRadius:p},y,{position:"relative"}),C=function(e,t){w&&x&&w({h:x.h,s:100*e.left,v:100*(1-e.top),a:x.a})},k=(0,a.useMemo)((function(){if(!x)return null;var e={top:100-x.v+"%",left:x.s+"%",color:(0,i.hsvaToHslaString)(x)};return v&&"function"===typeof v?v((0,n.Z)({prefixCls:d},e)):(0,u.jsx)(c,(0,n.Z)({prefixCls:d},e))}),[x,v,d]);return(0,u.jsx)(s.default,(0,n.Z)({className:[d,m||""].filter(Boolean).join(" ")},S,{style:(0,n.Z)({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(null!=(r=null==x?void 0:x.h)?r:b)+", 100%, 50%))"},E),ref:t,onMove:C,onDown:C,children:k}))}));f.displayName="Saturation";var d=f},1507:function(e,t,r){"use strict";r.r(t);var n=r(1026),o=r(5773),a=r(808),i=r(8573),s=r(6319),u=r(7240),c=r(8702),l=r(3789),f=r(7864),d=r(5301),h=r(6493),p=r(9887),v=r(4760),m=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],g=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],b=function(e){return(0,v.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}})},y=i.forwardRef((function(e,t){var r=e.prefixCls,y=void 0===r?"w-color-sketch":r,x=e.className,w=e.onChange,S=e.width,E=void 0===S?218:S,C=e.presetColors,k=void 0===C?g:C,_=e.color,O=e.editableDisable,R=void 0===O||O,P=e.disableAlpha,j=void 0!==P&&P,T=e.style,A=(0,a.Z)(e,m),D=(0,i.useState)({h:209,s:36,v:90,a:1}),L=(0,n.Z)(D,2),Z=L[0],N=L[1];(0,i.useEffect)((function(){"string"===typeof _&&(0,d.Ff)(_)&&N((0,h.hexToHsva)(_)),"object"===typeof _&&N(_)}),[_]);var M=function(e){N(e),w&&w((0,h.color)(e))},I=(0,o.Z)({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:E},T),B={borderRadius:2,background:(0,h.hsvaToRgbaString)(Z),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,v.jsxs)("div",(0,o.Z)({},A,{className:y+" "+(x||""),ref:t,style:I,children:[(0,v.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,v.jsx)(s.default,{hsva:Z,style:{width:"auto",height:150},onChange:function(e){return M((0,o.Z)({},Z,e,{a:Z.a}))}}),(0,v.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,v.jsxs)("div",{style:{flex:1},children:[(0,v.jsx)(f.default,{width:"auto",height:10,hue:Z.h,pointer:b,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:function(e){return M((0,o.Z)({},Z,e))}}),!j&&(0,v.jsx)(u.default,{width:"auto",height:10,hsva:Z,pointer:b,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:function(e){return M((0,o.Z)({},Z,{a:e.a}))}})]}),!j&&(0,v.jsx)(u.default,{width:24,height:24,hsva:Z,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:B},pointer:function(){return(0,v.jsx)(i.Fragment,{})}})]})]}),R&&(0,v.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,v.jsx)(c.default,{label:"Hex",value:(0,h.hsvaToHex)(Z).replace(/^#/,"").toLocaleUpperCase(),onChange:function(e,t){var r;"string"===typeof(r=t)&&(0,d.Ff)(r)&&/(3|6)/.test(String(r.length))&&M((0,h.hexToHsva)(r))},style:{minWidth:58}}),(0,v.jsx)(l.default,{hsva:Z,style:{marginLeft:6},aProps:!j&&{},onChange:function(e){return M(e.hsva)}})]}),k&&k.length>0&&(0,v.jsx)(p.default,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:k,color:(0,h.hsvaToHex)(Z),onChange:function(e){return M(e)},rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));y.displayName="Sketch",t.default=y},9887:function(e,t,r){"use strict";r.r(t);var n=r(5773),o=r(808),a=r(8573),i=r(6493),s=r(4760),u=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],c=a.forwardRef((function(e,t){var r=e.prefixCls,c=void 0===r?"w-color-swatch":r,l=e.className,f=e.color,d=e.colors,h=void 0===d?[]:d,p=e.style,v=e.rectProps,m=void 0===v?{}:v,g=e.onChange,b=e.addonAfter,y=e.addonBefore,x=e.rectRender,w=(0,o.Z)(e,u),S=(0,n.Z)({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},m.style),E=function(e,t){g&&g((0,i.hexToHsva)(e),(0,i.color)((0,i.hexToHsva)(e)),t)};return(0,s.jsxs)("div",(0,n.Z)({ref:t},w,{className:[c,l||""].filter(Boolean).join(" "),style:(0,n.Z)({display:"flex",flexWrap:"wrap",position:"relative"},p),children:[y&&a.isValidElement(y)&&y,h&&Array.isArray(h)&&h.map((function(e,t){var r="",o="";"string"===typeof e&&(r=e,o=e),"object"===typeof e&&e.color&&(r=e.title||e.color,o=e.color);var i=f&&f.toLocaleLowerCase()===o.toLocaleLowerCase();if(x)return x({key:t,title:r,color:o,checked:!!i,style:(0,n.Z)({},S,{background:o}),onClick:function(e){return E(o,e)}});var u=m.children&&a.isValidElement(m.children)?a.cloneElement(m.children,{color:o,checked:i}):null;return(0,s.jsx)("div",(0,n.Z)({tabIndex:0,title:r,onClick:function(e){return E(o,e)}},m,{children:u,style:(0,n.Z)({},S,{background:o})}),t)})),b&&a.isValidElement(b)&&b]}))}));c.displayName="Swatch",t.default=c},6813:function(e,t,r){"use strict";r.r(t),r.d(t,{clamp:function(){return l},default:function(){return v},getRelativePosition:function(){return f},isTouch:function(){return u},preventDefaultMove:function(){return c},useEventCallback:function(){return s}});var n=r(1026),o=r(5773),a=r(808),i=r(8573);function s(e){var t=(0,i.useRef)(e);return(0,i.useEffect)((function(){t.current=e})),(0,i.useCallback)((function(e,r){return t.current&&t.current(e,r)}),[])}var u=function(e){return"touches"in e},c=function(e){!u(e)&&e.preventDefault&&e.preventDefault()},l=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&b.current?C&&C(f(b.current,e),e):E(!1)}),[C]),O=(0,i.useCallback)((function(){return E(!1)}),[]),R=(0,i.useCallback)((function(e){var t=e?window.addEventListener:window.removeEventListener;t(y.current?"touchmove":"mousemove",_),t(y.current?"touchend":"mouseup",O)}),[]);(0,i.useEffect)((function(){return R(S),function(){S&&R(!1)}}),[S,R]);var P=(0,i.useCallback)((function(e){c(e.nativeEvent),function(e){return!(y.current&&!u(e))&&(y.current=u(e),!0)}(e.nativeEvent)&&(k&&k(f(b.current,e.nativeEvent),e.nativeEvent),E(!0))}),[k]);return(0,d.jsx)("div",(0,o.Z)({},g,{className:[l,p||""].filter(Boolean).join(" "),style:(0,o.Z)({},g.style,{touchAction:"none"}),ref:b,tabIndex:0,onMouseDown:P,onTouchStart:P}))}));p.displayName="Interactive";var v=p},7266:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},8983:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},6824:function(e,t,r){var n=r(6196),o=r(4161);function a(t,r,i){return o()?(e.exports=a=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,r){var o=[null];o.push.apply(o,t);var a=new(Function.bind.apply(e,o));return r&&n(a,r.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(null,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},2081:function(e,t,r){var n=r(4040);function o(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}r.d(t,{Z:function(){return n}})},6983:function(e,t,r){"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}r.d(t,{Z:function(){return n}})},1026:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(6470);var o=r(4013),a=r(3764);function i(e,t){return(0,n.Z)(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||(0,o.Z)(e,t)||(0,a.Z)()}},669:function(e,t,r){"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Z:function(){return n}})},2173:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(6470),o=r(5181),a=r(4013),i=r(3764);function s(e){return(0,n.Z)(e)||(0,o.Z)(e)||(0,a.Z)(e)||(0,i.Z)()}},649:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1793);var o=r(5181),a=r(4013);function i(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||(0,o.Z)(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},5217:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(3940);function o(e){var t=function(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==(0,n.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===(0,n.Z)(t)?t:String(t)}},3940:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:function(){return n}})},4013:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1793);function o(e,t){if(e){if("string"===typeof e)return(0,n.Z)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(e,t):void 0}}},7373:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(7597),o=r(6983);var a=r(8119);function i(e,t,r){return i=(0,a.Z)()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&(0,o.Z)(a,r.prototype),a},i.apply(null,arguments)}function s(e){var t="function"===typeof Map?new Map:void 0;return s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return i(e,arguments,(0,n.Z)(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,o.Z)(a,e)},s(e)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,function(){var e=[];r.O=function(t,n,o,a){if(!n){var i=1/0;for(l=0;l=a)&&Object.keys(r.O).every((function(e){return r.O[e](n[u])}))?n.splice(u--,1):(s=!1,a0&&e[l-1][2]>a;l--)e[l]=e[l-1];e[l]=[n,o,a]}}(),r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"===typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){i[e]=function(){return n[e]}}));return i.default=function(){return n},r.d(a,i),a}}(),r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(t,n){return r.f[n](e,t),t}),[]))},r.u=function(e){return"static/js/"+(269===e?"refractor-vendor":e)+"."+{2:"6da3da2a",3:"858fe2b1",18:"c07b1920",31:"1b0cd9b2",66:"3a288404",94:"8a6120f0",107:"466b97f5",113:"31e40c6e",117:"31949d28",118:"6f3b0b31",221:"0504457b",231:"b9c3ded8",269:"0260c0d3",281:"4df7504b",297:"7b76461a",299:"11854554",301:"8bd45319",308:"b7ce428a",309:"c927a996",361:"aa245cc6",426:"ee69b934",446:"d9fb46d2",458:"f14d221b",466:"6f2442cf",469:"7af4a86a",494:"cde1347e",536:"4ecc7848",546:"b70807de",569:"b54108aa",620:"85f0f3e9",624:"8049ee84",632:"7d3a603e",649:"eaa644a7",652:"84581b29",691:"1ed5b489",721:"2faf3454",756:"4178b543",781:"6819c40d",785:"ced3b982",852:"6f6cb68f",875:"9d9f14a8",919:"a92a1caa",952:"c9bcfd7a",955:"50536602",982:"61d56819",995:"9cd28e3f",996:"e499943e"}[e]+".chunk.js"},r.miniCssF=function(e){return"static/css/"+e+"."+{117:"d2ab10fd",281:"c7b2c18c"}[e]+".chunk.css"},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="website:";r.l=function(n,o,a,i){if(e[n])e[n].push(o);else{var s,u;if(void 0!==a)for(var c=document.getElementsByTagName("script"),l=0;l(defaultContext);\n\nexport type ContextStore = {\n hsva: HsvaColor;\n dispatch?: React.Dispatch;\n};\n\nexport function reducer(state: ContextStore, action: ContextStore) {\n return { ...state, ...action };\n}\n","// @ts-ignore\ndeclare global {\n interface HTMLElementTagNameMap {\n 'github-corners': GithubCorners;\n }\n namespace JSX {\n interface IntrinsicElements {\n 'github-corners': Partial | {\n style?: Partial | React.CSSProperties;\n };\n }\n }\n}\n\nconst GITHUB_CORNERS_TEMPLATE = document.createElement(\"template\");\nGITHUB_CORNERS_TEMPLATE.innerHTML = `\n\n\n \n \n \n \n \n \n \n\n`;\n\nexport class GithubCorners extends HTMLElement {\n /** Sets the z-order of a positioned element and its descendants or flex items. */\n 'z-index'?: string;\n height?: string | number;\n width?: string | number;\n href?: string;\n color?: string;\n fill?: string;\n position?: string;\n target?: string;\n top?: string;\n left?: string;\n right?: string = '0';\n bottom?: string;\n transform?: string;\n private shadow: ShadowRoot\n static get observedAttributes(): string[] {\n return ['style', 'z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];\n }\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: 'open' });\n this.shadow.appendChild(this.ownerDocument.importNode(GITHUB_CORNERS_TEMPLATE.content, true));\n this.update()\n }\n private setAttr(name: string, value: string) {\n const svg = this.shadow.querySelector('svg');\n if (/(href)/.test(name.toLocaleLowerCase())) {\n svg.lastElementChild.setAttribute('xlink:href', value);\n } else if (/(color|fill)/.test(name.toLocaleLowerCase())) {\n (svg.firstElementChild as HTMLAnchorElement).style[name as any] = value;\n } else if (/(z-index|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {\n svg.style[name as any] = value;\n } else {\n svg.setAttribute(name, value);\n }\n }\n private update() {\n ;[...this.getAttributeNames(), 'right'].forEach((name) => {\n const value = this.getAttribute(name) || this[name as keyof GithubCorners] as any || '';\n this.setAttr(name, value);\n });\n }\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (oldValue !== newValue) {\n this.setAttr(name, newValue);\n }\n }\n}\n\ncustomElements.define('github-corners', GithubCorners);","import React from 'react';\nimport '@uiw/github-corners';\n\nexport interface GitHubCornersProps extends React.AnchorHTMLAttributes {\n /**\n * The link to your project page.\n */\n href?: string;\n /**\n * The width and height of the corner. \n * Default: `80`\n */\n size?: number;\n /**\n * The background color of the corner.\n * Default: `#151513`\n */\n bgColor?: string;\n /**\n * The Github logo color of the corner.\n * Default: `#fff`\n */\n color?: string;\n /**\n * The position of corner. \n * Default: `right`\n */\n position?: 'left' | 'right';\n /** Is it displayed at the bottom? */\n bottom?: boolean,\n /** \n * It is positioned relative to the initial containing block established.\n * Default: `false`\n */\n fixed?: boolean;\n /**\n * Sets the z-order of a positioned element and its descendants or flex items.\n */\n zIndex?: number;\n}\n\nexport default function githubCorners(props: GitHubCornersProps) {\n const { size = 80, fixed = false, bottom, zIndex, className, style, bgColor = '#151513', color = '#fff', position = 'right', ...otherProps } = props;\n const styl: React.CSSProperties = position === 'left' ? { left: 0, right: 'initial', transform: 'scale(-1, 1)' } : { right: 0, left: 'initial', transform: 'scale(1, 1)' };\n if (bottom) {\n styl.bottom = 0;\n styl.top = 'initial';\n styl.transform = position === 'left' ? 'scale(-1, -1)' : 'scale(1, -1)';\n } else {\n styl.bottom = 'initial';\n styl.top = 0;\n }\n return (\n \n );\n}","import _typeof from \"./typeof.js\";\nexport default function _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n };\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nexport enum Action {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Pop = \"POP\",\n\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n Push = \"PUSH\",\n\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n Replace = \"REPLACE\",\n}\n\n/**\n * The pathname, search, and hash values of a URL.\n */\nexport interface Path {\n /**\n * A URL pathname, beginning with a /.\n */\n pathname: string;\n\n /**\n * A URL search string, beginning with a ?.\n */\n search: string;\n\n /**\n * A URL fragment identifier, beginning with a #.\n */\n hash: string;\n}\n\n/**\n * An entry in a history stack. A location contains information about the\n * URL path, as well as possibly some arbitrary state and a key.\n */\nexport interface Location extends Path {\n /**\n * A value of arbitrary data associated with this location.\n */\n state: any;\n\n /**\n * A unique string associated with this location. May be used to safely store\n * and retrieve data in some other storage API, like `localStorage`.\n *\n * Note: This value is always \"default\" on the initial location.\n */\n key: string;\n}\n\n/**\n * A change to the current location.\n */\nexport interface Update {\n /**\n * The action that triggered the change.\n */\n action: Action;\n\n /**\n * The new location.\n */\n location: Location;\n\n /**\n * The delta between this location and the former location in the history stack\n */\n delta: number | null;\n}\n\n/**\n * A function that receives notifications about location changes.\n */\nexport interface Listener {\n (update: Update): void;\n}\n\n/**\n * Describes a location that is the destination of some navigation, either via\n * `history.push` or `history.replace`. May be either a URL or the pieces of a\n * URL path.\n */\nexport type To = string | Partial;\n\n/**\n * A history is an interface to the navigation stack. The history serves as the\n * source of truth for the current location, as well as provides a set of\n * methods that may be used to change it.\n *\n * It is similar to the DOM's `window.history` object, but with a smaller, more\n * focused API.\n */\nexport interface History {\n /**\n * The last action that modified the current location. This will always be\n * Action.Pop when a history instance is first created. This value is mutable.\n */\n readonly action: Action;\n\n /**\n * The current location. This value is mutable.\n */\n readonly location: Location;\n\n /**\n * Returns a valid href for the given `to` value that may be used as\n * the value of an attribute.\n *\n * @param to - The destination URL\n */\n createHref(to: To): string;\n\n /**\n * Returns a URL for the given `to` value\n *\n * @param to - The destination URL\n */\n createURL(to: To): URL;\n\n /**\n * Encode a location the same way window.history would do (no-op for memory\n * history) so we ensure our PUSH/REPLACE navigations for data routers\n * behave the same as POP\n *\n * @param to Unencoded path\n */\n encodeLocation(to: To): Path;\n\n /**\n * Pushes a new location onto the history stack, increasing its length by one.\n * If there were any entries in the stack after the current one, they are\n * lost.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n push(to: To, state?: any): void;\n\n /**\n * Replaces the current location in the history stack with a new one. The\n * location that was replaced will no longer be available.\n *\n * @param to - The new URL\n * @param state - Data to associate with the new location\n */\n replace(to: To, state?: any): void;\n\n /**\n * Navigates `n` entries backward/forward in the history stack relative to the\n * current index. For example, a \"back\" navigation would use go(-1).\n *\n * @param delta - The delta in the stack index\n */\n go(delta: number): void;\n\n /**\n * Sets up a listener that will be called whenever the current location\n * changes.\n *\n * @param listener - A function that will be called when the location changes\n * @returns unlisten - A function that may be used to stop listening\n */\n listen(listener: Listener): () => void;\n}\n\ntype HistoryState = {\n usr: any;\n key?: string;\n idx: number;\n};\n\nconst PopStateEventType = \"popstate\";\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Memory History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A user-supplied object that describes a location. Used when providing\n * entries to `createMemoryHistory` via its `initialEntries` option.\n */\nexport type InitialEntry = string | Partial;\n\nexport type MemoryHistoryOptions = {\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n v5Compat?: boolean;\n};\n\n/**\n * A memory history stores locations in memory. This is useful in stateful\n * environments where there is no web browser, such as node tests or React\n * Native.\n */\nexport interface MemoryHistory extends History {\n /**\n * The current index in the history stack.\n */\n readonly index: number;\n}\n\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\nexport function createMemoryHistory(\n options: MemoryHistoryOptions = {}\n): MemoryHistory {\n let { initialEntries = [\"/\"], initialIndex, v5Compat = false } = options;\n let entries: Location[]; // Declare so we can access from createMemoryLocation\n entries = initialEntries.map((entry, index) =>\n createMemoryLocation(\n entry,\n typeof entry === \"string\" ? null : entry.state,\n index === 0 ? \"default\" : undefined\n )\n );\n let index = clampIndex(\n initialIndex == null ? entries.length - 1 : initialIndex\n );\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n function clampIndex(n: number): number {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation(): Location {\n return entries[index];\n }\n function createMemoryLocation(\n to: To,\n state: any = null,\n key?: string\n ): Location {\n let location = createLocation(\n entries ? getCurrentLocation().pathname : \"/\",\n to,\n state,\n key\n );\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in memory history: ${JSON.stringify(\n to\n )}`\n );\n return location;\n }\n\n function createHref(to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history: MemoryHistory = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref,\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n encodeLocation(to: To) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\",\n };\n },\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 1 });\n }\n },\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n if (v5Compat && listener) {\n listener({ action, location: nextLocation, delta: 0 });\n }\n },\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n if (listener) {\n listener({ action, location: nextLocation, delta });\n }\n },\n listen(fn: Listener) {\n listener = fn;\n return () => {\n listener = null;\n };\n },\n };\n\n return history;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Browser History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A browser history stores the current location in regular URLs in a web\n * browser environment. This is the standard for most web apps and provides the\n * cleanest URLs the browser's address bar.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory\n */\nexport interface BrowserHistory extends UrlHistory {}\n\nexport type BrowserHistoryOptions = UrlHistoryOptions;\n\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nexport function createBrowserHistory(\n options: BrowserHistoryOptions = {}\n): BrowserHistory {\n function createBrowserLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let { pathname, search, hash } = window.location;\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createBrowserHref(window: Window, to: To) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(\n createBrowserLocation,\n createBrowserHref,\n null,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hash History\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A hash history stores the current location in the fragment identifier portion\n * of the URL in a web browser environment.\n *\n * This is ideal for apps that do not control the server for some reason\n * (because the fragment identifier is never sent to the server), including some\n * shared hosting environments that do not provide fine-grained controls over\n * which pages are served at which URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory\n */\nexport interface HashHistory extends UrlHistory {}\n\nexport type HashHistoryOptions = UrlHistoryOptions;\n\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nexport function createHashHistory(\n options: HashHistoryOptions = {}\n): HashHistory {\n function createHashLocation(\n window: Window,\n globalHistory: Window[\"history\"]\n ) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\n \"\",\n { pathname, search, hash },\n // state defaults to `null` because `window.history.state` does\n (globalHistory.state && globalHistory.state.usr) || null,\n (globalHistory.state && globalHistory.state.key) || \"default\"\n );\n }\n\n function createHashHref(window: Window, to: To) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location: Location, to: To) {\n warning(\n location.pathname.charAt(0) === \"/\",\n `relative pathnames are not supported in hash history.push(${JSON.stringify(\n to\n )})`\n );\n }\n\n return getUrlBasedHistory(\n createHashLocation,\n createHashHref,\n validateHashLocation,\n options\n );\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region UTILS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @private\n */\nexport function invariant(value: boolean, message?: string): asserts value;\nexport function invariant(\n value: T | null | undefined,\n message?: string\n): asserts value is T;\nexport function invariant(value: any, message?: string) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nexport function warning(cond: any, message: string) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location: Location, index: number): HistoryState {\n return {\n usr: location.state,\n key: location.key,\n idx: index,\n };\n}\n\n/**\n * Creates a Location object with a unique key from the given Path\n */\nexport function createLocation(\n current: string | Location,\n to: To,\n state: any = null,\n key?: string\n): Readonly {\n let location: Readonly = {\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\",\n ...(typeof to === \"string\" ? parsePath(to) : to),\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: (to && (to as Location).key) || key || createKey(),\n };\n return location;\n}\n\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nexport function createPath({\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n}: Partial) {\n if (search && search !== \"?\")\n pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\")\n pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nexport function parsePath(path: string): Partial {\n let parsedPath: Partial = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport interface UrlHistory extends History {}\n\nexport type UrlHistoryOptions = {\n window?: Window;\n v5Compat?: boolean;\n};\n\nfunction getUrlBasedHistory(\n getLocation: (window: Window, globalHistory: Window[\"history\"]) => Location,\n createHref: (window: Window, to: To) => string,\n validateLocation: ((location: Location, to: To) => void) | null,\n options: UrlHistoryOptions = {}\n): UrlHistory {\n let { window = document.defaultView!, v5Compat = false } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener: Listener | null = null;\n\n let index = getIndex()!;\n // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n if (index == null) {\n index = 0;\n globalHistory.replaceState({ ...globalHistory.state, idx: index }, \"\");\n }\n\n function getIndex(): number {\n let state = globalHistory.state || { idx: null };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n if (listener) {\n listener({ action, location: history.location, delta });\n }\n }\n\n function push(to: To, state?: any) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n\n // try...catch because iOS limits us to 100 pushState calls :/\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // If the exception is because `state` can't be serialized, let that throw\n // outwards just like a replace call would so the dev knows the cause\n // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps\n // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal\n if (error instanceof DOMException && error.name === \"DataCloneError\") {\n throw error;\n }\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 1 });\n }\n }\n\n function replace(to: To, state?: any) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({ action, location: history.location, delta: 0 });\n }\n }\n\n function createURL(to: To): URL {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base =\n window.location.origin !== \"null\"\n ? window.location.origin\n : window.location.href;\n\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(\n base,\n `No window.location.(origin|href) available to create URL for href: ${href}`\n );\n return new URL(href, base);\n }\n\n let history: History = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window, globalHistory);\n },\n listen(fn: Listener) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref(window, to);\n },\n createURL,\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n };\n },\n push,\n replace,\n go(n) {\n return globalHistory.go(n);\n },\n };\n\n return history;\n}\n\n//#endregion\n","import unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nexport default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n var F = function F() {};\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","import type { Location, Path, To } from \"./history\";\nimport { warning, invariant, parsePath } from \"./history\";\n\n/**\n * Map of routeId -> data returned from a loader/action/error\n */\nexport interface RouteData {\n [routeId: string]: any;\n}\n\nexport enum ResultType {\n data = \"data\",\n deferred = \"deferred\",\n redirect = \"redirect\",\n error = \"error\",\n}\n\n/**\n * Successful result from a loader or action\n */\nexport interface SuccessResult {\n type: ResultType.data;\n data: any;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Successful defer() result from a loader or action\n */\nexport interface DeferredResult {\n type: ResultType.deferred;\n deferredData: DeferredData;\n statusCode?: number;\n headers?: Headers;\n}\n\n/**\n * Redirect result from a loader or action\n */\nexport interface RedirectResult {\n type: ResultType.redirect;\n status: number;\n location: string;\n revalidate: boolean;\n}\n\n/**\n * Unsuccessful result from a loader or action\n */\nexport interface ErrorResult {\n type: ResultType.error;\n error: any;\n headers?: Headers;\n}\n\n/**\n * Result from a loader or action - potentially successful or unsuccessful\n */\nexport type DataResult =\n | SuccessResult\n | DeferredResult\n | RedirectResult\n | ErrorResult;\n\ntype LowerCaseFormMethod = \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\";\ntype UpperCaseFormMethod = Uppercase;\n\n/**\n * Users can specify either lowercase or uppercase form methods on
,\n * useSubmit(), , etc.\n */\nexport type HTMLFormMethod = LowerCaseFormMethod | UpperCaseFormMethod;\n\n/**\n * Active navigation/fetcher form methods are exposed in lowercase on the\n * RouterState\n */\nexport type FormMethod = LowerCaseFormMethod;\nexport type MutationFormMethod = Exclude;\n\n/**\n * In v7, active navigation/fetcher form methods are exposed in uppercase on the\n * RouterState. This is to align with the normalization done via fetch().\n */\nexport type V7_FormMethod = UpperCaseFormMethod;\nexport type V7_MutationFormMethod = Exclude;\n\nexport type FormEncType =\n | \"application/x-www-form-urlencoded\"\n | \"multipart/form-data\"\n | \"application/json\"\n | \"text/plain\";\n\n// Thanks https://github.com/sindresorhus/type-fest!\ntype JsonObject = { [Key in string]: JsonValue } & {\n [Key in string]?: JsonValue | undefined;\n};\ntype JsonArray = JsonValue[] | readonly JsonValue[];\ntype JsonPrimitive = string | number | boolean | null;\ntype JsonValue = JsonPrimitive | JsonObject | JsonArray;\n\n/**\n * @private\n * Internal interface to pass around for action submissions, not intended for\n * external consumption\n */\nexport type Submission =\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: FormData;\n json: undefined;\n text: undefined;\n }\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: undefined;\n json: JsonValue;\n text: undefined;\n }\n | {\n formMethod: FormMethod | V7_FormMethod;\n formAction: string;\n formEncType: FormEncType;\n formData: undefined;\n json: undefined;\n text: string;\n };\n\n/**\n * @private\n * Arguments passed to route loader/action functions. Same for now but we keep\n * this as a private implementation detail in case they diverge in the future.\n */\ninterface DataFunctionArgs {\n request: Request;\n params: Params;\n context?: any;\n}\n\n/**\n * Arguments passed to loader functions\n */\nexport interface LoaderFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Arguments passed to action functions\n */\nexport interface ActionFunctionArgs extends DataFunctionArgs {}\n\n/**\n * Loaders and actions can return anything except `undefined` (`null` is a\n * valid return value if there is no data to return). Responses are preferred\n * and will ease any future migration to Remix\n */\ntype DataFunctionValue = Response | NonNullable | null;\n\n/**\n * Route loader function signature\n */\nexport interface LoaderFunction {\n (args: LoaderFunctionArgs): Promise | DataFunctionValue;\n}\n\n/**\n * Route action function signature\n */\nexport interface ActionFunction {\n (args: ActionFunctionArgs): Promise | DataFunctionValue;\n}\n\n/**\n * Route shouldRevalidate function signature. This runs after any submission\n * (navigation or fetcher), so we flatten the navigation/fetcher submission\n * onto the arguments. It shouldn't matter whether it came from a navigation\n * or a fetcher, what really matters is the URLs and the formData since loaders\n * have to re-run based on the data models that were potentially mutated.\n */\nexport interface ShouldRevalidateFunction {\n (args: {\n currentUrl: URL;\n currentParams: AgnosticDataRouteMatch[\"params\"];\n nextUrl: URL;\n nextParams: AgnosticDataRouteMatch[\"params\"];\n formMethod?: Submission[\"formMethod\"];\n formAction?: Submission[\"formAction\"];\n formEncType?: Submission[\"formEncType\"];\n text?: Submission[\"text\"];\n formData?: Submission[\"formData\"];\n json?: Submission[\"json\"];\n actionResult?: DataResult;\n defaultShouldRevalidate: boolean;\n }): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set `hasErrorBoundary`\n * from the framework-aware `errorElement` prop\n *\n * @deprecated Use `mapRouteProperties` instead\n */\nexport interface DetectErrorBoundaryFunction {\n (route: AgnosticRouteObject): boolean;\n}\n\n/**\n * Function provided by the framework-aware layers to set any framework-specific\n * properties from framework-agnostic properties\n */\nexport interface MapRoutePropertiesFunction {\n (route: AgnosticRouteObject): {\n hasErrorBoundary: boolean;\n } & Record;\n}\n\n/**\n * Keys we cannot change from within a lazy() function. We spread all other keys\n * onto the route. Either they're meaningful to the router, or they'll get\n * ignored.\n */\nexport type ImmutableRouteKey =\n | \"lazy\"\n | \"caseSensitive\"\n | \"path\"\n | \"id\"\n | \"index\"\n | \"children\";\n\nexport const immutableRouteKeys = new Set([\n \"lazy\",\n \"caseSensitive\",\n \"path\",\n \"id\",\n \"index\",\n \"children\",\n]);\n\ntype RequireOne = Exclude<\n {\n [K in keyof T]: K extends Key ? Omit & Required> : never;\n }[keyof T],\n undefined\n>;\n\n/**\n * lazy() function to load a route definition, which can add non-matching\n * related properties to a route\n */\nexport interface LazyRouteFunction {\n (): Promise>>;\n}\n\n/**\n * Base RouteObject with common props shared by all types of routes\n */\ntype AgnosticBaseRouteObject = {\n caseSensitive?: boolean;\n path?: string;\n id?: string;\n loader?: LoaderFunction;\n action?: ActionFunction;\n hasErrorBoundary?: boolean;\n shouldRevalidate?: ShouldRevalidateFunction;\n handle?: any;\n lazy?: LazyRouteFunction;\n};\n\n/**\n * Index routes must not have children\n */\nexport type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {\n children?: undefined;\n index: true;\n};\n\n/**\n * Non-index routes may have children, but cannot have index\n */\nexport type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {\n children?: AgnosticRouteObject[];\n index?: false;\n};\n\n/**\n * A route object represents a logical route, with (optionally) its child\n * routes organized in a tree-like structure.\n */\nexport type AgnosticRouteObject =\n | AgnosticIndexRouteObject\n | AgnosticNonIndexRouteObject;\n\nexport type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {\n id: string;\n};\n\nexport type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {\n children?: AgnosticDataRouteObject[];\n id: string;\n};\n\n/**\n * A data route object, which is just a RouteObject with a required unique ID\n */\nexport type AgnosticDataRouteObject =\n | AgnosticDataIndexRouteObject\n | AgnosticDataNonIndexRouteObject;\n\nexport type RouteManifest = Record;\n\n// Recursive helper for finding path parameters in the absence of wildcards\ntype _PathParam =\n // split path into individual path segments\n Path extends `${infer L}/${infer R}`\n ? _PathParam | _PathParam\n : // find params after `:`\n Path extends `:${infer Param}`\n ? Param extends `${infer Optional}?`\n ? Optional\n : Param\n : // otherwise, there aren't any params present\n never;\n\n/**\n * Examples:\n * \"/a/b/*\" -> \"*\"\n * \":a\" -> \"a\"\n * \"/a/:b\" -> \"b\"\n * \"/a/blahblahblah:b\" -> \"b\"\n * \"/:a/:b\" -> \"a\" | \"b\"\n * \"/:a/b/:c/*\" -> \"a\" | \"c\" | \"*\"\n */\ntype PathParam =\n // check if path is just a wildcard\n Path extends \"*\" | \"/*\"\n ? \"*\"\n : // look for wildcard at the end of the path\n Path extends `${infer Rest}/*`\n ? \"*\" | _PathParam\n : // look for params in the absence of wildcards\n _PathParam;\n\n// Attempt to parse the given string segment. If it fails, then just return the\n// plain string type as a default fallback. Otherwise return the union of the\n// parsed string literals that were referenced as dynamic segments in the route.\nexport type ParamParseKey =\n // if could not find path params, fallback to `string`\n [PathParam] extends [never] ? string : PathParam;\n\n/**\n * The parameters that were parsed from the URL path.\n */\nexport type Params = {\n readonly [key in Key]: string | undefined;\n};\n\n/**\n * A RouteMatch contains info about how a route matched a URL.\n */\nexport interface AgnosticRouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObjectType;\n}\n\nexport interface AgnosticDataRouteMatch\n extends AgnosticRouteMatch {}\n\nfunction isIndexRoute(\n route: AgnosticRouteObject\n): route is AgnosticIndexRouteObject {\n return route.index === true;\n}\n\n// Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\nexport function convertRoutesToDataRoutes(\n routes: AgnosticRouteObject[],\n mapRouteProperties: MapRoutePropertiesFunction,\n parentPath: number[] = [],\n manifest: RouteManifest = {}\n): AgnosticDataRouteObject[] {\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(\n route.index !== true || !route.children,\n `Cannot specify children on an index route`\n );\n invariant(\n !manifest[id],\n `Found a route id collision on id \"${id}\". Route ` +\n \"id's must be globally unique within Data Router usages\"\n );\n\n if (isIndexRoute(route)) {\n let indexRoute: AgnosticDataIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n };\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute: AgnosticDataNonIndexRouteObject = {\n ...route,\n ...mapRouteProperties(route),\n id,\n children: undefined,\n };\n manifest[id] = pathOrLayoutRoute;\n\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(\n route.children,\n mapRouteProperties,\n treePath,\n manifest\n );\n }\n\n return pathOrLayoutRoute;\n }\n });\n}\n\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\nexport function matchRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n locationArg: Partial | string,\n basename = \"/\"\n): AgnosticRouteMatch[] | null {\n let location =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(\n branches[i],\n // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname)\n );\n }\n\n return matches;\n}\n\ninterface RouteMeta<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n relativePath: string;\n caseSensitive: boolean;\n childrenIndex: number;\n route: RouteObjectType;\n}\n\ninterface RouteBranch<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n> {\n path: string;\n score: number;\n routesMeta: RouteMeta[];\n}\n\nfunction flattenRoutes<\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n routes: RouteObjectType[],\n branches: RouteBranch[] = [],\n parentsMeta: RouteMeta[] = [],\n parentPath = \"\"\n): RouteBranch[] {\n let flattenRoute = (\n route: RouteObjectType,\n index: number,\n relativePath?: string\n ) => {\n let meta: RouteMeta = {\n relativePath:\n relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route,\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `Absolute route path \"${meta.relativePath}\" nested under path ` +\n `\"${parentPath}\" is not valid. An absolute child route path ` +\n `must start with the combined path of all its parent routes.`\n );\n\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n\n // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true,\n `Index routes must not have child routes. Please remove ` +\n `all child routes from route path \"${path}\".`\n );\n\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta,\n });\n };\n routes.forEach((route, index) => {\n // coarse-grain check for optional params\n if (route.path === \"\" || !route.path?.includes(\"?\")) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n\n return branches;\n}\n\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path: string): string[] {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n\n let [first, ...rest] = segments;\n\n // Optional path segments are denoted by a trailing `?`\n let isOptional = first.endsWith(\"?\");\n // Compute the corresponding required segment: `foo?` -> `foo`\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n\n let result: string[] = [];\n\n // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n result.push(\n ...restExploded.map((subpath) =>\n subpath === \"\" ? required : [required, subpath].join(\"/\")\n )\n );\n\n // Then if this is an optional value, add all child versions without\n if (isOptional) {\n result.push(...restExploded);\n }\n\n // for absolute paths, ensure `/` instead of empty segment\n return result.map((exploded) =>\n path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded\n );\n}\n\nfunction rankRouteBranches(branches: RouteBranch[]): void {\n branches.sort((a, b) =>\n a.score !== b.score\n ? b.score - a.score // Higher score first\n : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = (s: string) => s === \"*\";\n\nfunction computeScore(path: string, index: boolean | undefined): number {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments\n .filter((s) => !isSplat(s))\n .reduce(\n (score, segment) =>\n score +\n (paramRe.test(segment)\n ? dynamicSegmentValue\n : segment === \"\"\n ? emptySegmentValue\n : staticSegmentValue),\n initialScore\n );\n}\n\nfunction compareIndexes(a: number[], b: number[]): number {\n let siblings =\n a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n\n return siblings\n ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1]\n : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch<\n ParamKey extends string = string,\n RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject\n>(\n branch: RouteBranch,\n pathname: string\n): AgnosticRouteMatch[] | null {\n let { routesMeta } = branch;\n\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches: AgnosticRouteMatch[] = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname =\n matchedPathname === \"/\"\n ? pathname\n : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n\n if (!match) return null;\n\n Object.assign(matchedParams, match.params);\n\n let route = meta.route;\n\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams as Params,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route,\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\nexport function generatePath(\n originalPath: Path,\n params: {\n [key in PathParam]: string | null;\n } = {} as any\n): string {\n let path: string = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(\n false,\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n path = path.replace(/\\*$/, \"/*\") as Path;\n }\n\n // ensure `/` is added at the beginning if the path is absolute\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n\n const stringify = (p: any) =>\n p == null ? \"\" : typeof p === \"string\" ? p : String(p);\n\n const segments = path\n .split(/\\/+/)\n .map((segment, index, array) => {\n const isLastSegment = index === array.length - 1;\n\n // only apply the splat if it's the last segment\n if (isLastSegment && segment === \"*\") {\n const star = \"*\" as PathParam;\n // Apply the splat\n return stringify(params[star]);\n }\n\n const keyMatch = segment.match(/^:(\\w+)(\\??)$/);\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key as PathParam];\n invariant(optional === \"?\" || param != null, `Missing \":${key}\" param`);\n return stringify(param);\n }\n\n // Remove any optional markers from optional static segments\n return segment.replace(/\\?$/g, \"\");\n })\n // Remove empty segments\n .filter((segment) => !!segment);\n\n return prefix + segments.join(\"/\");\n}\n\n/**\n * A PathPattern is used to match on some portion of a URL pathname.\n */\nexport interface PathPattern {\n /**\n * A string to match against a URL pathname. May contain `:id`-style segments\n * to indicate placeholders for dynamic parameters. May also end with `/*` to\n * indicate matching the rest of the URL pathname.\n */\n path: Path;\n /**\n * Should be `true` if the static portions of the `path` should be matched in\n * the same case.\n */\n caseSensitive?: boolean;\n /**\n * Should be `true` if this pattern should match the entire URL pathname.\n */\n end?: boolean;\n}\n\n/**\n * A PathMatch contains info about how a PathPattern matched on a URL pathname.\n */\nexport interface PathMatch {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The pattern that was used to match.\n */\n pattern: PathPattern;\n}\n\ntype Mutable = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\nexport function matchPath<\n ParamKey extends ParamParseKey,\n Path extends string\n>(\n pattern: PathPattern | Path,\n pathname: string\n): PathMatch | null {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n\n let [matcher, paramNames] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n\n let match = pathname.match(matcher);\n if (!match) return null;\n\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params: Params = paramNames.reduce>(\n (memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname\n .slice(0, matchedPathname.length - splatValue.length)\n .replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(\n captureGroups[index] || \"\",\n paramName\n );\n return memo;\n },\n {}\n );\n\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern,\n };\n}\n\nfunction compilePath(\n path: string,\n caseSensitive = false,\n end = true\n): [RegExp, string[]] {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n\n let paramNames: string[] = [];\n let regexpSource =\n \"^\" +\n path\n .replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_: string, paramName: string) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource +=\n path === \"*\" || path === \"/*\"\n ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else {\n // Nothing to match for \"\" or \"/\"\n }\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value: string) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(\n false,\n `The URL path \"${value}\" could not be decoded because it is is a ` +\n `malformed URL segment. This is probably due to a bad percent ` +\n `encoding (${error}).`\n );\n\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value: string, paramName: string) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(\n false,\n `The value for the URL param \"${paramName}\" will not be decoded because` +\n ` the string \"${value}\" is a malformed URL segment. This is probably` +\n ` due to a bad percent encoding (${error}).`\n );\n\n return value;\n }\n}\n\n/**\n * @private\n */\nexport function stripBasename(\n pathname: string,\n basename: string\n): string | null {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n let startIndex = basename.endsWith(\"/\")\n ? basename.length - 1\n : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\nexport function resolvePath(to: To, fromPathname = \"/\"): Path {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\",\n } = typeof to === \"string\" ? parsePath(to) : to;\n\n let pathname = toPathname\n ? toPathname.startsWith(\"/\")\n ? toPathname\n : resolvePathname(toPathname, fromPathname)\n : fromPathname;\n\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash),\n };\n}\n\nfunction resolvePathname(relativePath: string, fromPathname: string): string {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(\n char: string,\n field: string,\n dest: string,\n path: Partial\n) {\n return (\n `Cannot include a '${char}' character in a manually specified ` +\n `\\`to.${field}\\` field [${JSON.stringify(\n path\n )}]. Please separate it out to the ` +\n `\\`to.${dest}\\` field. Alternatively you may provide the full path as ` +\n `a string in and the router will parse it for you.`\n );\n}\n\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\nexport function getPathContributingMatches<\n T extends AgnosticRouteMatch = AgnosticRouteMatch\n>(matches: T[]) {\n return matches.filter(\n (match, index) =>\n index === 0 || (match.route.path && match.route.path.length > 0)\n );\n}\n\n/**\n * @private\n */\nexport function resolveTo(\n toArg: To,\n routePathnames: string[],\n locationPathname: string,\n isPathRelative = false\n): Path {\n let to: Partial;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = { ...toArg };\n\n invariant(\n !to.pathname || !to.pathname.includes(\"?\"),\n getInvalidPathError(\"?\", \"pathname\", \"search\", to)\n );\n invariant(\n !to.pathname || !to.pathname.includes(\"#\"),\n getInvalidPathError(\"#\", \"pathname\", \"hash\", to)\n );\n invariant(\n !to.search || !to.search.includes(\"#\"),\n getInvalidPathError(\"#\", \"search\", \"hash\", to)\n );\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n\n let from: string;\n\n // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n\n // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n }\n\n // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from);\n\n // Ensure the pathname has a trailing slash if the original \"to\" had one\n let hasExplicitTrailingSlash =\n toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n // Or if this was a link to the current path which has a trailing slash\n let hasCurrentTrailingSlash =\n (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (\n !path.pathname.endsWith(\"/\") &&\n (hasExplicitTrailingSlash || hasCurrentTrailingSlash)\n ) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n\n/**\n * @private\n */\nexport function getToPathname(to: To): string | undefined {\n // Empty strings should be treated the same as / paths\n return to === \"\" || (to as Path).pathname === \"\"\n ? \"/\"\n : typeof to === \"string\"\n ? parsePath(to).pathname\n : to.pathname;\n}\n\n/**\n * @private\n */\nexport const joinPaths = (paths: string[]): string =>\n paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n\n/**\n * @private\n */\nexport const normalizePathname = (pathname: string): string =>\n pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n\n/**\n * @private\n */\nexport const normalizeSearch = (search: string): string =>\n !search || search === \"?\"\n ? \"\"\n : search.startsWith(\"?\")\n ? search\n : \"?\" + search;\n\n/**\n * @private\n */\nexport const normalizeHash = (hash: string): string =>\n !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n\nexport type JsonFunction = (\n data: Data,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\nexport const json: JsonFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n let headers = new Headers(responseInit.headers);\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\nexport interface TrackedPromise extends Promise {\n _tracked?: boolean;\n _data?: any;\n _error?: any;\n}\n\nexport class AbortedDeferredError extends Error {}\n\nexport class DeferredData {\n private pendingKeysSet: Set = new Set();\n private controller: AbortController;\n private abortPromise: Promise;\n private unlistenAbortSignal: () => void;\n private subscribers: Set<(aborted: boolean, settledKey?: string) => void> =\n new Set();\n data: Record;\n init?: ResponseInit;\n deferredKeys: string[] = [];\n\n constructor(data: Record, responseInit?: ResponseInit) {\n invariant(\n data && typeof data === \"object\" && !Array.isArray(data),\n \"defer() only accepts plain objects\"\n );\n\n // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n let reject: (e: AbortedDeferredError) => void;\n this.abortPromise = new Promise((_, r) => (reject = r));\n this.controller = new AbortController();\n let onAbort = () =>\n reject(new AbortedDeferredError(\"Deferred data aborted\"));\n this.unlistenAbortSignal = () =>\n this.controller.signal.removeEventListener(\"abort\", onAbort);\n this.controller.signal.addEventListener(\"abort\", onAbort);\n\n this.data = Object.entries(data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: this.trackPromise(key, value),\n }),\n {}\n );\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n private trackPromise(\n key: string,\n value: Promise | unknown\n ): TrackedPromise | unknown {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key);\n\n // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n let promise: TrackedPromise = Promise.race([value, this.abortPromise]).then(\n (data) => this.onSettle(promise, key, undefined, data as unknown),\n (error) => this.onSettle(promise, key, error as unknown)\n );\n\n // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n promise.catch(() => {});\n\n Object.defineProperty(promise, \"_tracked\", { get: () => true });\n return promise;\n }\n\n private onSettle(\n promise: TrackedPromise,\n key: string,\n error: unknown,\n data?: unknown\n ): unknown {\n if (\n this.controller.signal.aborted &&\n error instanceof AbortedDeferredError\n ) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", { get: () => error });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n // If the promise was resolved/rejected with undefined, we'll throw an error as you\n // should always resolve with a value or null\n if (error === undefined && data === undefined) {\n let undefinedError = new Error(\n `Deferred data for key \"${key}\" resolved/rejected with \\`undefined\\`, ` +\n `you must resolve/reject with a value or \\`null\\`.`\n );\n Object.defineProperty(promise, \"_error\", { get: () => undefinedError });\n this.emit(false, key);\n return Promise.reject(undefinedError);\n }\n\n if (data === undefined) {\n Object.defineProperty(promise, \"_error\", { get: () => error });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", { get: () => data });\n this.emit(false, key);\n return data;\n }\n\n private emit(aborted: boolean, settledKey?: string) {\n this.subscribers.forEach((subscriber) => subscriber(aborted, settledKey));\n }\n\n subscribe(fn: (aborted: boolean, settledKey?: string) => void) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal: AbortSignal) {\n let aborted = false;\n if (!this.done) {\n let onAbort = () => this.cancel();\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise((resolve) => {\n this.subscribe((aborted) => {\n signal.removeEventListener(\"abort\", onAbort);\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(\n this.data !== null && this.done,\n \"Can only unwrap data on initialized and settled deferreds\"\n );\n\n return Object.entries(this.data).reduce(\n (acc, [key, value]) =>\n Object.assign(acc, {\n [key]: unwrapTrackedPromise(value),\n }),\n {}\n );\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n}\n\nfunction isTrackedPromise(value: any): value is TrackedPromise {\n return (\n value instanceof Promise && (value as TrackedPromise)._tracked === true\n );\n}\n\nfunction unwrapTrackedPromise(value: any) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n return value._data;\n}\n\nexport type DeferFunction = (\n data: Record,\n init?: number | ResponseInit\n) => DeferredData;\n\nexport const defer: DeferFunction = (data, init = {}) => {\n let responseInit = typeof init === \"number\" ? { status: init } : init;\n\n return new DeferredData(data, responseInit);\n};\n\nexport type RedirectFunction = (\n url: string,\n init?: number | ResponseInit\n) => Response;\n\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nexport const redirect: RedirectFunction = (url, init = 302) => {\n let responseInit = init;\n if (typeof responseInit === \"number\") {\n responseInit = { status: responseInit };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n\n return new Response(null, {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\nexport class ErrorResponse {\n status: number;\n statusText: string;\n data: any;\n error?: Error;\n internal: boolean;\n\n constructor(\n status: number,\n statusText: string | undefined,\n data: any,\n internal = false\n ) {\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n}\n\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nexport function isRouteErrorResponse(error: any): error is ErrorResponse {\n return (\n error != null &&\n typeof error.status === \"number\" &&\n typeof error.statusText === \"string\" &&\n typeof error.internal === \"boolean\" &&\n \"data\" in error\n );\n}\n","import type { History, Location, Path, To } from \"./history\";\nimport {\n Action as HistoryAction,\n createLocation,\n createPath,\n invariant,\n parsePath,\n warning,\n} from \"./history\";\nimport type {\n DataResult,\n DeferredData,\n AgnosticDataRouteMatch,\n AgnosticDataRouteObject,\n DeferredResult,\n ErrorResult,\n FormEncType,\n FormMethod,\n DetectErrorBoundaryFunction,\n RedirectResult,\n RouteData,\n AgnosticRouteObject,\n Submission,\n SuccessResult,\n AgnosticRouteMatch,\n ShouldRevalidateFunction,\n RouteManifest,\n ImmutableRouteKey,\n ActionFunction,\n LoaderFunction,\n V7_MutationFormMethod,\n V7_FormMethod,\n HTMLFormMethod,\n MutationFormMethod,\n MapRoutePropertiesFunction,\n} from \"./utils\";\nimport {\n ErrorResponse,\n ResultType,\n convertRoutesToDataRoutes,\n getPathContributingMatches,\n immutableRouteKeys,\n isRouteErrorResponse,\n joinPaths,\n matchRoutes,\n resolveTo,\n stripBasename,\n} from \"./utils\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A Router instance manages all navigation and data loading/mutations\n */\nexport interface Router {\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the basename for the router\n */\n get basename(): RouterInit[\"basename\"];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the current state of the router\n */\n get state(): RouterState;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Return the routes for this router instance\n */\n get routes(): AgnosticDataRouteObject[];\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Initialize the router, including adding history listeners and kicking off\n * initial data fetches. Returns a function to cleanup listeners and abort\n * any in-progress loads\n */\n initialize(): Router;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Subscribe to router.state updates\n *\n * @param fn function to call with the new state\n */\n subscribe(fn: RouterSubscriber): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Enable scroll restoration behavior in the router\n *\n * @param savedScrollPositions Object that will manage positions, in case\n * it's being restored from sessionStorage\n * @param getScrollPosition Function to get the active Y scroll position\n * @param getKey Function to get the key to use for restoration\n */\n enableScrollRestoration(\n savedScrollPositions: Record,\n getScrollPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ): () => void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Navigate forward/backward in the history stack\n * @param to Delta to move in the history stack\n */\n navigate(to: number): Promise;\n\n /**\n * Navigate to the given path\n * @param to Path to navigate to\n * @param opts Navigation options (method, submission, etc.)\n */\n navigate(to: To | null, opts?: RouterNavigateOptions): Promise;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a fetcher load/submission\n *\n * @param key Fetcher key\n * @param routeId Route that owns the fetcher\n * @param href href to fetch\n * @param opts Fetcher options, (method, submission, etc.)\n */\n fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterFetchOptions\n ): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Trigger a revalidation of all current route loaders and fetcher loads\n */\n revalidate(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to create an href for the given location\n * @param location\n */\n createHref(location: Location | URL): string;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Utility function to URL encode a destination path according to the internal\n * history implementation\n * @param to\n */\n encodeLocation(to: To): Path;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get/create a fetcher for the given key\n * @param key\n */\n getFetcher(key?: string): Fetcher;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete the fetcher for a given key\n * @param key\n */\n deleteFetcher(key?: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Cleanup listeners and abort any in-progress loads\n */\n dispose(): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Get a navigation blocker\n * @param key The identifier for the blocker\n * @param fn The blocker function implementation\n */\n getBlocker(key: string, fn: BlockerFunction): Blocker;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Delete a navigation blocker\n * @param key The identifier for the blocker\n */\n deleteBlocker(key: string): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * HMR needs to pass in-flight route updates to React Router\n * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)\n */\n _internalSetRoutes(routes: AgnosticRouteObject[]): void;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal fetch AbortControllers accessed by unit tests\n */\n _internalFetchControllers: Map;\n\n /**\n * @internal\n * PRIVATE - DO NOT USE\n *\n * Internal pending DeferredData instances accessed by unit tests\n */\n _internalActiveDeferreds: Map;\n}\n\n/**\n * State maintained internally by the router. During a navigation, all states\n * reflect the the \"old\" location unless otherwise noted.\n */\nexport interface RouterState {\n /**\n * The action of the most recent navigation\n */\n historyAction: HistoryAction;\n\n /**\n * The current location reflected by the router\n */\n location: Location;\n\n /**\n * The current set of route matches\n */\n matches: AgnosticDataRouteMatch[];\n\n /**\n * Tracks whether we've completed our initial data load\n */\n initialized: boolean;\n\n /**\n * Current scroll position we should start at for a new view\n * - number -> scroll position to restore to\n * - false -> do not restore scroll at all (used during submissions)\n * - null -> don't have a saved position, scroll to hash or top of page\n */\n restoreScrollPosition: number | false | null;\n\n /**\n * Indicate whether this navigation should skip resetting the scroll position\n * if we are unable to restore the scroll position\n */\n preventScrollReset: boolean;\n\n /**\n * Tracks the state of the current navigation\n */\n navigation: Navigation;\n\n /**\n * Tracks any in-progress revalidations\n */\n revalidation: RevalidationState;\n\n /**\n * Data from the loaders for the current matches\n */\n loaderData: RouteData;\n\n /**\n * Data from the action for the current matches\n */\n actionData: RouteData | null;\n\n /**\n * Errors caught from loaders for the current matches\n */\n errors: RouteData | null;\n\n /**\n * Map of current fetchers\n */\n fetchers: Map;\n\n /**\n * Map of current blockers\n */\n blockers: Map;\n}\n\n/**\n * Data that can be passed into hydrate a Router from SSR\n */\nexport type HydrationState = Partial<\n Pick\n>;\n\n/**\n * Future flags to toggle new feature behavior\n */\nexport interface FutureConfig {\n v7_normalizeFormMethod: boolean;\n v7_prependBasename: boolean;\n}\n\n/**\n * Initialization options for createRouter\n */\nexport interface RouterInit {\n routes: AgnosticRouteObject[];\n history: History;\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n future?: Partial;\n hydrationData?: HydrationState;\n window?: Window;\n}\n\n/**\n * State returned from a server-side query() call\n */\nexport interface StaticHandlerContext {\n basename: Router[\"basename\"];\n location: RouterState[\"location\"];\n matches: RouterState[\"matches\"];\n loaderData: RouterState[\"loaderData\"];\n actionData: RouterState[\"actionData\"];\n errors: RouterState[\"errors\"];\n statusCode: number;\n loaderHeaders: Record;\n actionHeaders: Record;\n activeDeferreds: Record | null;\n _deepestRenderedBoundaryId?: string | null;\n}\n\n/**\n * A StaticHandler instance manages a singular SSR navigation/fetch event\n */\nexport interface StaticHandler {\n dataRoutes: AgnosticDataRouteObject[];\n query(\n request: Request,\n opts?: { requestContext?: unknown }\n ): Promise;\n queryRoute(\n request: Request,\n opts?: { routeId?: string; requestContext?: unknown }\n ): Promise;\n}\n\n/**\n * Subscriber function signature for changes to router state\n */\nexport interface RouterSubscriber {\n (state: RouterState): void;\n}\n\ninterface UseMatchesMatch {\n id: string;\n pathname: string;\n params: AgnosticRouteMatch[\"params\"];\n data: unknown;\n handle: unknown;\n}\n\n/**\n * Function signature for determining the key to be used in scroll restoration\n * for a given location\n */\nexport interface GetScrollRestorationKeyFunction {\n (location: Location, matches: UseMatchesMatch[]): string | null;\n}\n\n/**\n * Function signature for determining the current scroll position\n */\nexport interface GetScrollPositionFunction {\n (): number;\n}\n\nexport type RelativeRoutingType = \"route\" | \"path\";\n\n// Allowed for any navigation or fetch\ntype BaseNavigateOrFetchOptions = {\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n};\n\n// Only allowed for navigations\ntype BaseNavigateOptions = BaseNavigateOrFetchOptions & {\n replace?: boolean;\n state?: any;\n fromRouteId?: string;\n};\n\n// Only allowed for submission navigations\ntype BaseSubmissionOptions = {\n formMethod?: HTMLFormMethod;\n formEncType?: FormEncType;\n} & (\n | { formData: FormData; body?: undefined }\n | { formData?: undefined; body: any }\n);\n\n/**\n * Options for a navigate() call for a normal (non-submission) navigation\n */\ntype LinkNavigateOptions = BaseNavigateOptions;\n\n/**\n * Options for a navigate() call for a submission navigation\n */\ntype SubmissionNavigateOptions = BaseNavigateOptions & BaseSubmissionOptions;\n\n/**\n * Options to pass to navigate() for a navigation\n */\nexport type RouterNavigateOptions =\n | LinkNavigateOptions\n | SubmissionNavigateOptions;\n\n/**\n * Options for a fetch() load\n */\ntype LoadFetchOptions = BaseNavigateOrFetchOptions;\n\n/**\n * Options for a fetch() submission\n */\ntype SubmitFetchOptions = BaseNavigateOrFetchOptions & BaseSubmissionOptions;\n\n/**\n * Options to pass to fetch()\n */\nexport type RouterFetchOptions = LoadFetchOptions | SubmitFetchOptions;\n\n/**\n * Potential states for state.navigation\n */\nexport type NavigationStates = {\n Idle: {\n state: \"idle\";\n location: undefined;\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n formData: undefined;\n json: undefined;\n text: undefined;\n };\n Loading: {\n state: \"loading\";\n location: Location;\n formMethod: Submission[\"formMethod\"] | undefined;\n formAction: Submission[\"formAction\"] | undefined;\n formEncType: Submission[\"formEncType\"] | undefined;\n formData: Submission[\"formData\"] | undefined;\n json: Submission[\"json\"] | undefined;\n text: Submission[\"text\"] | undefined;\n };\n Submitting: {\n state: \"submitting\";\n location: Location;\n formMethod: Submission[\"formMethod\"];\n formAction: Submission[\"formAction\"];\n formEncType: Submission[\"formEncType\"];\n formData: Submission[\"formData\"];\n json: Submission[\"json\"];\n text: Submission[\"text\"];\n };\n};\n\nexport type Navigation = NavigationStates[keyof NavigationStates];\n\nexport type RevalidationState = \"idle\" | \"loading\";\n\n/**\n * Potential states for fetchers\n */\ntype FetcherStates = {\n Idle: {\n state: \"idle\";\n formMethod: undefined;\n formAction: undefined;\n formEncType: undefined;\n text: undefined;\n formData: undefined;\n json: undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Loading: {\n state: \"loading\";\n formMethod: Submission[\"formMethod\"] | undefined;\n formAction: Submission[\"formAction\"] | undefined;\n formEncType: Submission[\"formEncType\"] | undefined;\n text: Submission[\"text\"] | undefined;\n formData: Submission[\"formData\"] | undefined;\n json: Submission[\"json\"] | undefined;\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n Submitting: {\n state: \"submitting\";\n formMethod: Submission[\"formMethod\"];\n formAction: Submission[\"formAction\"];\n formEncType: Submission[\"formEncType\"];\n text: Submission[\"text\"];\n formData: Submission[\"formData\"];\n json: Submission[\"json\"];\n data: TData | undefined;\n \" _hasFetcherDoneAnything \"?: boolean;\n };\n};\n\nexport type Fetcher =\n FetcherStates[keyof FetcherStates];\n\ninterface BlockerBlocked {\n state: \"blocked\";\n reset(): void;\n proceed(): void;\n location: Location;\n}\n\ninterface BlockerUnblocked {\n state: \"unblocked\";\n reset: undefined;\n proceed: undefined;\n location: undefined;\n}\n\ninterface BlockerProceeding {\n state: \"proceeding\";\n reset: undefined;\n proceed: undefined;\n location: Location;\n}\n\nexport type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;\n\nexport type BlockerFunction = (args: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n}) => boolean;\n\ninterface ShortCircuitable {\n /**\n * startNavigation does not need to complete the navigation because we\n * redirected or got interrupted\n */\n shortCircuited?: boolean;\n}\n\ninterface HandleActionResult extends ShortCircuitable {\n /**\n * Error thrown from the current action, keyed by the route containing the\n * error boundary to render the error. To be committed to the state after\n * loaders have completed\n */\n pendingActionError?: RouteData;\n /**\n * Data returned from the current action, keyed by the route owning the action.\n * To be committed to the state after loaders have completed\n */\n pendingActionData?: RouteData;\n}\n\ninterface HandleLoadersResult extends ShortCircuitable {\n /**\n * loaderData returned from the current set of loaders\n */\n loaderData?: RouterState[\"loaderData\"];\n /**\n * errors thrown from the current set of loaders\n */\n errors?: RouterState[\"errors\"];\n}\n\n/**\n * Cached info for active fetcher.load() instances so they can participate\n * in revalidation\n */\ninterface FetchLoadMatch {\n routeId: string;\n path: string;\n}\n\n/**\n * Identified fetcher.load() calls that need to be revalidated\n */\ninterface RevalidatingFetcher extends FetchLoadMatch {\n key: string;\n match: AgnosticDataRouteMatch | null;\n matches: AgnosticDataRouteMatch[] | null;\n controller: AbortController | null;\n}\n\n/**\n * Wrapper object to allow us to throw any response out from callLoaderOrAction\n * for queryRouter while preserving whether or not it was thrown or returned\n * from the loader/action\n */\ninterface QueryRouteResponse {\n type: ResultType.data | ResultType.error;\n response: Response;\n}\n\nconst validMutationMethodsArr: MutationFormMethod[] = [\n \"post\",\n \"put\",\n \"patch\",\n \"delete\",\n];\nconst validMutationMethods = new Set(\n validMutationMethodsArr\n);\n\nconst validRequestMethodsArr: FormMethod[] = [\n \"get\",\n ...validMutationMethodsArr,\n];\nconst validRequestMethods = new Set(validRequestMethodsArr);\n\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\n\nexport const IDLE_NAVIGATION: NavigationStates[\"Idle\"] = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n};\n\nexport const IDLE_FETCHER: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n};\n\nexport const IDLE_BLOCKER: BlockerUnblocked = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined,\n};\n\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n\nconst defaultMapRouteProperties: MapRoutePropertiesFunction = (route) => ({\n hasErrorBoundary: Boolean(route.hasErrorBoundary),\n});\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\nexport function createRouter(init: RouterInit): Router {\n const routerWindow = init.window\n ? init.window\n : typeof window !== \"undefined\"\n ? window\n : undefined;\n const isBrowser =\n typeof routerWindow !== \"undefined\" &&\n typeof routerWindow.document !== \"undefined\" &&\n typeof routerWindow.document.createElement !== \"undefined\";\n const isServer = !isBrowser;\n\n invariant(\n init.routes.length > 0,\n \"You must provide a non-empty routes array to createRouter\"\n );\n\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (init.mapRouteProperties) {\n mapRouteProperties = init.mapRouteProperties;\n } else if (init.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = init.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n // Routes keyed by ID\n let manifest: RouteManifest = {};\n // Routes in tree format for matching\n let dataRoutes = convertRoutesToDataRoutes(\n init.routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n let inFlightDataRoutes: AgnosticDataRouteObject[] | undefined;\n let basename = init.basename || \"/\";\n // Config driven behavior flags\n let future: FutureConfig = {\n v7_normalizeFormMethod: false,\n v7_prependBasename: false,\n ...init.future,\n };\n // Cleanup function for history\n let unlistenHistory: (() => void) | null = null;\n // Externally-provided functions to call on all state changes\n let subscribers = new Set();\n // Externally-provided object to hold scroll restoration locations during routing\n let savedScrollPositions: Record | null = null;\n // Externally-provided function to get scroll restoration keys\n let getScrollRestorationKey: GetScrollRestorationKeyFunction | null = null;\n // Externally-provided function to get current scroll position\n let getScrollPosition: GetScrollPositionFunction | null = null;\n // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n let initialScrollRestored = init.hydrationData != null;\n\n let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n let initialErrors: RouteData | null = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname,\n });\n let { matches, route } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = { [route.id]: error };\n }\n\n let initialized =\n // All initialMatches need to be loaded before we're ready. If we have lazy\n // functions around still then we'll need to run them in initialize()\n !initialMatches.some((m) => m.route.lazy) &&\n // And we have to either have no loaders or have been provided hydrationData\n (!initialMatches.some((m) => m.route.loader) || init.hydrationData != null);\n\n let router: Router;\n let state: RouterState = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: (init.hydrationData && init.hydrationData.loaderData) || {},\n actionData: (init.hydrationData && init.hydrationData.actionData) || null,\n errors: (init.hydrationData && init.hydrationData.errors) || initialErrors,\n fetchers: new Map(),\n blockers: new Map(),\n };\n\n // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n let pendingAction: HistoryAction = HistoryAction.Pop;\n\n // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n let pendingPreventScrollReset = false;\n\n // AbortController for the active navigation\n let pendingNavigationController: AbortController | null;\n\n // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n let isUninterruptedRevalidation = false;\n\n // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidator()\n // - X-Remix-Revalidate (from redirect)\n let isRevalidationRequired = false;\n\n // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n let cancelledDeferredRoutes: string[] = [];\n\n // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n let cancelledFetcherLoads: string[] = [];\n\n // AbortControllers for any in-flight fetchers\n let fetchControllers = new Map();\n\n // Track loads based on the order in which they started\n let incrementingLoadId = 0;\n\n // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n let pendingNavigationLoadId = -1;\n\n // Fetchers that triggered data reloads as a result of their actions\n let fetchReloadIds = new Map();\n\n // Fetchers that triggered redirect navigations\n let fetchRedirectIds = new Set();\n\n // Most recent href/match for fetcher.load calls for fetchers\n let fetchLoadMatches = new Map();\n\n // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n let activeDeferreds = new Map();\n\n // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n let blockerFunctions = new Map();\n\n // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n let ignoreNextHistoryUpdate = false;\n\n // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(\n ({ action: historyAction, location, delta }) => {\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(\n blockerFunctions.size === 0 || delta != null,\n \"You are trying to use a blocker on a POP navigation to a location \" +\n \"that was not created by @remix-run/router. This will fail silently in \" +\n \"production. This can happen if you are navigating outside the router \" +\n \"via `window.history.pushState`/`window.location.hash` instead of using \" +\n \"router navigation APIs. This can also happen if you are using \" +\n \"createHashRouter and the user manually changes the URL.\"\n );\n\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction,\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1);\n\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location,\n });\n // Re-do the same POP navigation we just blocked\n init.history.go(delta);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey!, IDLE_BLOCKER);\n updateState({ blockers });\n },\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n }\n );\n\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n // Note we don't do any handling of lazy here. For SPA's it'll get handled\n // in the normal navigation flow. For SSR it's expected that lazy modules are\n // resolved prior to router creation since we can't go into a fallbackElement\n // UI for SSR'd apps\n if (!state.initialized) {\n startNavigation(HistoryAction.Pop, state.location);\n }\n\n return router;\n }\n\n // Clean up a router and it's side effects\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n\n // Subscribe to state updates for the router\n function subscribe(fn: RouterSubscriber) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n\n // Update our state and notify the calling context of the change\n function updateState(newState: Partial): void {\n state = {\n ...state,\n ...newState,\n };\n subscribers.forEach((subscriber) => subscriber(state));\n }\n\n // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n function completeNavigation(\n location: Location,\n newState: Partial>\n ): void {\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload =\n state.actionData != null &&\n state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n state.navigation.state === \"loading\" &&\n location.state?._isRedirect !== true;\n\n let actionData: RouteData | null;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n }\n\n // Always preserve any existing loaderData from re-used routes\n let loaderData = newState.loaderData\n ? mergeLoaderData(\n state.loaderData,\n newState.loaderData,\n newState.matches || [],\n newState.errors\n )\n : state.loaderData;\n\n // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n let blockers = state.blockers;\n if (blockers.size > 0) {\n blockers = new Map(blockers);\n blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));\n }\n\n // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n let preventScrollReset =\n pendingPreventScrollReset === true ||\n (state.navigation.formMethod != null &&\n isMutationMethod(state.navigation.formMethod) &&\n location.state?._isRedirect !== true);\n\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = undefined;\n }\n\n if (isUninterruptedRevalidation) {\n // If this was an uninterrupted revalidation then do not touch history\n } else if (pendingAction === HistoryAction.Pop) {\n // Do nothing for POP - URL has already been updated\n } else if (pendingAction === HistoryAction.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === HistoryAction.Replace) {\n init.history.replace(location, location.state);\n }\n\n updateState({\n ...newState, // matches, errors, fetchers go through as-is\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(\n location,\n newState.matches || state.matches\n ),\n preventScrollReset,\n blockers,\n });\n\n // Reset stateful navigation vars\n pendingAction = HistoryAction.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n }\n\n // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n async function navigate(\n to: number | To | null,\n opts?: RouterNavigateOptions\n ): Promise {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n to,\n opts?.fromRouteId,\n opts?.relative\n );\n let { path, submission, error } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n false,\n normalizedPath,\n opts\n );\n\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n\n // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n nextLocation = {\n ...nextLocation,\n ...init.history.encodeLocation(nextLocation),\n };\n\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n\n let historyAction = HistoryAction.Push;\n\n if (userReplace === true) {\n historyAction = HistoryAction.Replace;\n } else if (userReplace === false) {\n // no-op\n } else if (\n submission != null &&\n isMutationMethod(submission.formMethod) &&\n submission.formAction === state.location.pathname + state.location.search\n ) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = HistoryAction.Replace;\n }\n\n let preventScrollReset =\n opts && \"preventScrollReset\" in opts\n ? opts.preventScrollReset === true\n : undefined;\n\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n });\n\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey!, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation,\n });\n // Send the same navigation through\n navigate(to, opts);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey!, IDLE_BLOCKER);\n updateState({ blockers });\n },\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace,\n });\n }\n\n // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n function revalidate() {\n interruptActiveLoads();\n updateState({ revalidation: \"loading\" });\n\n // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n if (state.navigation.state === \"submitting\") {\n return;\n }\n\n // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true,\n });\n return;\n }\n\n // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n startNavigation(\n pendingAction || state.historyAction,\n state.navigation.location,\n { overrideNavigation: state.navigation }\n );\n }\n\n // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n async function startNavigation(\n historyAction: HistoryAction,\n location: Location,\n opts?: {\n submission?: Submission;\n fetcherSubmission?: Submission;\n overrideNavigation?: Navigation;\n pendingError?: ErrorResponse;\n startUninterruptedRevalidation?: boolean;\n preventScrollReset?: boolean;\n replace?: boolean;\n }\n ): Promise {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation =\n (opts && opts.startUninterruptedRevalidation) === true;\n\n // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(routesToUse, location, basename);\n\n // Short circuit with a 404 on the root error boundary if we match nothing\n if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(routesToUse);\n // Cancel all pending deferred on 404s since we don't keep any routes\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error,\n },\n });\n return;\n }\n\n // Short circuit if it's only a hash change and not a revalidation or\n // mutation submission.\n //\n // Ignore on initial page loads because since the initial load will always\n // be \"same hash\". For example, on /page#hash and submit a \n // which will default to a navigation to /page\n if (\n state.initialized &&\n !isRevalidationRequired &&\n isHashChangeOnly(state.location, location) &&\n !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))\n ) {\n completeNavigation(location, { matches });\n return;\n }\n\n // Create a controller/Request for this navigation\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(\n init.history,\n location,\n pendingNavigationController.signal,\n opts && opts.submission\n );\n let pendingActionData: RouteData | undefined;\n let pendingError: RouteData | undefined;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError,\n };\n } else if (\n opts &&\n opts.submission &&\n isMutationMethod(opts.submission.formMethod)\n ) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(\n request,\n location,\n opts.submission,\n matches,\n { replace: opts.replace }\n );\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n loadingNavigation = getLoadingNavigation(location, opts.submission);\n\n // Create a GET request for the loaders\n request = new Request(request.url, { signal: request.signal });\n }\n\n // Call loaders\n let { shortCircuited, loaderData, errors } = await handleLoaders(\n request,\n location,\n matches,\n loadingNavigation,\n opts && opts.submission,\n opts && opts.fetcherSubmission,\n opts && opts.replace,\n pendingActionData,\n pendingError\n );\n\n if (shortCircuited) {\n return;\n }\n\n // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n pendingNavigationController = null;\n\n completeNavigation(location, {\n matches,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n loaderData,\n errors,\n });\n }\n\n // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n async function handleAction(\n request: Request,\n location: Location,\n submission: Submission,\n matches: AgnosticDataRouteMatch[],\n opts: { replace?: boolean } = {}\n ): Promise {\n interruptActiveLoads();\n\n // Put us in a submitting state\n let navigation = getSubmittingNavigation(location, submission);\n updateState({ navigation });\n\n // Call our action and get the result\n let result: DataResult;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id,\n }),\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace: boolean;\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace =\n result.location === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(state, result, { submission, replace });\n return { shortCircuited: true };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n\n // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n if ((opts && opts.replace) !== true) {\n pendingAction = HistoryAction.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: { [boundaryMatch.route.id]: result.error },\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n return {\n pendingActionData: { [actionMatch.route.id]: result.data },\n };\n }\n\n // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n async function handleLoaders(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n overrideNavigation?: Navigation,\n submission?: Submission,\n fetcherSubmission?: Submission,\n replace?: boolean,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n ): Promise {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation =\n overrideNavigation || getLoadingNavigation(location, submission);\n\n // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n let activeSubmission =\n submission ||\n fetcherSubmission ||\n getSubmissionFromNavigation(loadingNavigation);\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n activeSubmission,\n location,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n pendingActionData,\n pendingError\n );\n\n // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n cancelActiveDeferreds(\n (routeId) =>\n !(matches && matches.some((m) => m.route.id === routeId)) ||\n (matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))\n );\n\n pendingNavigationLoadId = ++incrementingLoadId;\n\n // Short circuit if we have no loaders to run\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n let updatedFetchers = markFetchRedirectsDone();\n completeNavigation(location, {\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null,\n ...(pendingActionData ? { actionData: pendingActionData } : {}),\n ...(updatedFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n });\n return { shortCircuited: true };\n }\n\n // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach((rf) => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = getLoadingFetcher(\n undefined,\n fetcher ? fetcher.data : undefined\n );\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState({\n navigation: loadingNavigation,\n ...(actionData\n ? Object.keys(actionData).length === 0\n ? { actionData: null }\n : { actionData }\n : {}),\n ...(revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n }\n\n revalidatingFetchers.forEach((rf) => {\n if (fetchControllers.has(rf.key)) {\n abortFetcher(rf.key);\n }\n if (rf.controller) {\n // Fetchers use an independent AbortController so that aborting a fetcher\n // (via deleteFetcher) does not abort the triggering navigation that\n // triggered the revalidation\n fetchControllers.set(rf.key, rf.controller);\n }\n });\n\n // Proxy navigation abort through to revalidation fetchers\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((f) => abortFetcher(f.key));\n if (pendingNavigationController) {\n pendingNavigationController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n request\n );\n\n if (request.signal.aborted) {\n return { shortCircuited: true };\n }\n\n // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n if (pendingNavigationController) {\n pendingNavigationController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n }\n revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));\n\n // If any loaders returned a redirect Response, start a new REPLACE navigation\n let redirect = findRedirect(results);\n if (redirect) {\n if (redirect.idx >= matchesToLoad.length) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n let fetcherKey =\n revalidatingFetchers[redirect.idx - matchesToLoad.length].key;\n fetchRedirectIds.add(fetcherKey);\n }\n await startRedirectNavigation(state, redirect.result, { replace });\n return { shortCircuited: true };\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n matches,\n matchesToLoad,\n loaderResults,\n pendingError,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Wire up subscribers to update loaderData as promises settle\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe((aborted) => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n\n let updatedFetchers = markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n let shouldUpdateFetchers =\n updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n\n return {\n loaderData,\n errors,\n ...(shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}),\n };\n }\n\n function getFetcher(key: string): Fetcher {\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n\n // Trigger a fetcher load/submit for the given fetcher key\n function fetch(\n key: string,\n routeId: string,\n href: string | null,\n opts?: RouterFetchOptions\n ) {\n if (isServer) {\n throw new Error(\n \"router.fetch() was called during the server render, but it shouldn't be. \" +\n \"You are likely calling a useFetcher() method in the body of your component. \" +\n \"Try moving it to a useEffect or a callback.\"\n );\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let normalizedPath = normalizeTo(\n state.location,\n state.matches,\n basename,\n future.v7_prependBasename,\n href,\n routeId,\n opts?.relative\n );\n let matches = matchRoutes(routesToUse, normalizedPath, basename);\n\n if (!matches) {\n setFetcherError(\n key,\n routeId,\n getInternalRouterError(404, { pathname: normalizedPath })\n );\n return;\n }\n\n let { path, submission, error } = normalizeNavigateOptions(\n future.v7_normalizeFormMethod,\n true,\n normalizedPath,\n opts\n );\n\n if (error) {\n setFetcherError(key, routeId, error);\n return;\n }\n\n let match = getTargetMatch(matches, path);\n\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n }\n\n // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n fetchLoadMatches.set(key, { routeId, path });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n }\n\n // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n async function handleFetcherAction(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n requestMatches: AgnosticDataRouteMatch[],\n submission: Submission\n ) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action && !match.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId,\n });\n setFetcherError(key, routeId, error);\n return;\n }\n\n // Put this fetcher into it's submitting state\n let existingFetcher = state.fetchers.get(key);\n let fetcher = getSubmittingFetcher(submission, existingFetcher);\n state.fetchers.set(key, fetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the action for the fetcher\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal,\n submission\n );\n fetchControllers.set(key, abortController);\n\n let originatingLoadId = incrementingLoadId;\n let actionResult = await callLoaderOrAction(\n \"action\",\n fetchRequest,\n match,\n requestMatches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our action started, so that\n // should take precedence over this redirect navigation. We already\n // set isRevalidationRequired so all loaders for the new route should\n // fire unless opted out via shouldRevalidate\n let doneFetcher = getDoneFetcher(undefined);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n return;\n } else {\n fetchRedirectIds.add(key);\n let loadingFetcher = getLoadingFetcher(submission);\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n return startRedirectNavigation(state, actionResult, {\n submission,\n isFetchActionRedirect: true,\n });\n }\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, { type: \"defer-action\" });\n }\n\n // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(\n init.history,\n nextLocation,\n abortController.signal\n );\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches =\n state.navigation.state !== \"idle\"\n ? matchRoutes(routesToUse, state.navigation.location, basename)\n : state.matches;\n\n invariant(matches, \"Didn't find any matches after fetcher action\");\n\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher = getLoadingFetcher(submission, actionResult.data);\n state.fetchers.set(key, loadFetcher);\n\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(\n init.history,\n state,\n matches,\n submission,\n nextLocation,\n isRevalidationRequired,\n cancelledDeferredRoutes,\n cancelledFetcherLoads,\n fetchLoadMatches,\n fetchRedirectIds,\n routesToUse,\n basename,\n { [match.route.id]: actionResult.data },\n undefined // No need to send through errors since we short circuit above\n );\n\n // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n revalidatingFetchers\n .filter((rf) => rf.key !== key)\n .forEach((rf) => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = getLoadingFetcher(\n undefined,\n existingFetcher ? existingFetcher.data : undefined\n );\n state.fetchers.set(staleKey, revalidatingFetcher);\n if (fetchControllers.has(staleKey)) {\n abortFetcher(staleKey);\n }\n if (rf.controller) {\n fetchControllers.set(staleKey, rf.controller);\n }\n });\n\n updateState({ fetchers: new Map(state.fetchers) });\n\n let abortPendingFetchRevalidations = () =>\n revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));\n\n abortController.signal.addEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n let { results, loaderResults, fetcherResults } =\n await callLoadersAndMaybeResolveData(\n state.matches,\n matches,\n matchesToLoad,\n revalidatingFetchers,\n revalidationRequest\n );\n\n if (abortController.signal.aborted) {\n return;\n }\n\n abortController.signal.removeEventListener(\n \"abort\",\n abortPendingFetchRevalidations\n );\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));\n\n let redirect = findRedirect(results);\n if (redirect) {\n if (redirect.idx >= matchesToLoad.length) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n let fetcherKey =\n revalidatingFetchers[redirect.idx - matchesToLoad.length].key;\n fetchRedirectIds.add(fetcherKey);\n }\n return startRedirectNavigation(state, redirect.result);\n }\n\n // Process and commit output from loaders\n let { loaderData, errors } = processLoaderData(\n state,\n state.matches,\n matchesToLoad,\n loaderResults,\n undefined,\n revalidatingFetchers,\n fetcherResults,\n activeDeferreds\n );\n\n // Since we let revalidations complete even if the submitting fetcher was\n // deleted, only put it back to idle if it hasn't been deleted\n if (state.fetchers.has(key)) {\n let doneFetcher = getDoneFetcher(actionResult.data);\n state.fetchers.set(key, doneFetcher);\n }\n\n let didAbortFetchLoads = abortStaleFetchLoads(loadId);\n\n // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n if (\n state.navigation.state === \"loading\" &&\n loadId > pendingNavigationLoadId\n ) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers),\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState({\n errors,\n loaderData: mergeLoaderData(\n state.loaderData,\n loaderData,\n matches,\n errors\n ),\n ...(didAbortFetchLoads || revalidatingFetchers.length > 0\n ? { fetchers: new Map(state.fetchers) }\n : {}),\n });\n isRevalidationRequired = false;\n }\n }\n\n // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n async function handleFetcherLoader(\n key: string,\n routeId: string,\n path: string,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n submission?: Submission\n ) {\n let existingFetcher = state.fetchers.get(key);\n // Put this fetcher into it's loading state\n let loadingFetcher = getLoadingFetcher(\n submission,\n existingFetcher ? existingFetcher.data : undefined\n );\n state.fetchers.set(key, loadingFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n\n // Call the loader for this fetcher route match\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(\n init.history,\n path,\n abortController.signal\n );\n fetchControllers.set(key, abortController);\n\n let originatingLoadId = incrementingLoadId;\n let result: DataResult = await callLoaderOrAction(\n \"loader\",\n fetchRequest,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n );\n\n // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n if (isDeferredResult(result)) {\n result =\n (await resolveDeferredData(result, fetchRequest.signal, true)) ||\n result;\n }\n\n // We can delete this so long as we weren't aborted by our our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n }\n\n // If the loader threw a redirect Response, start a new REPLACE navigation\n if (isRedirectResult(result)) {\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our loader started, so that\n // should take precedence over this redirect navigation\n let doneFetcher = getDoneFetcher(undefined);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n return;\n } else {\n fetchRedirectIds.add(key);\n await startRedirectNavigation(state, result);\n return;\n }\n }\n\n // Process any non-redirect errors thrown\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key);\n // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error,\n },\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n\n // Put the fetcher back into an idle state\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n updateState({ fetchers: new Map(state.fetchers) });\n }\n\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n async function startRedirectNavigation(\n state: RouterState,\n redirect: RedirectResult,\n {\n submission,\n replace,\n isFetchActionRedirect,\n }: {\n submission?: Submission;\n replace?: boolean;\n isFetchActionRedirect?: boolean;\n } = {}\n ) {\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(\n state.location,\n redirect.location,\n // TODO: This can be removed once we get rid of useTransition in Remix v2\n {\n _isRedirect: true,\n ...(isFetchActionRedirect ? { _isFetchActionRedirect: true } : {}),\n }\n );\n invariant(\n redirectLocation,\n \"Expected a location on the redirect navigation\"\n );\n // Check if this an absolute external redirect that goes to a new origin\n if (ABSOLUTE_URL_REGEX.test(redirect.location) && isBrowser) {\n let url = init.history.createURL(redirect.location);\n let isDifferentBasename = stripBasename(url.pathname, basename) == null;\n\n if (routerWindow.location.origin !== url.origin || isDifferentBasename) {\n if (replace) {\n routerWindow.location.replace(redirect.location);\n } else {\n routerWindow.location.assign(redirect.location);\n }\n return;\n }\n }\n\n // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n pendingNavigationController = null;\n\n let redirectHistoryAction =\n replace === true ? HistoryAction.Replace : HistoryAction.Push;\n\n // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n let activeSubmission =\n submission || getSubmissionFromNavigation(state.navigation);\n\n // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n if (\n redirectPreserveMethodStatusCodes.has(redirect.status) &&\n activeSubmission &&\n isMutationMethod(activeSubmission.formMethod)\n ) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: {\n ...activeSubmission,\n formAction: redirect.location,\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else if (isFetchActionRedirect) {\n // For a fetch action redirect, we kick off a new loading navigation\n // without the fetcher submission, but we send it along for shouldRevalidate\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: getLoadingNavigation(redirectLocation),\n fetcherSubmission: activeSubmission,\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n } else {\n // If we have a submission, we will preserve it through the redirect navigation\n let overrideNavigation = getLoadingNavigation(\n redirectLocation,\n activeSubmission\n );\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation,\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset,\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(\n currentMatches: AgnosticDataRouteMatch[],\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n fetchersToLoad: RevalidatingFetcher[],\n request: Request\n ) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename\n )\n ),\n ...fetchersToLoad.map((f) => {\n if (f.matches && f.match && f.controller) {\n return callLoaderOrAction(\n \"loader\",\n createClientSideRequest(init.history, f.path, f.controller.signal),\n f.match,\n f.matches,\n manifest,\n mapRouteProperties,\n basename\n );\n } else {\n let error: ErrorResult = {\n type: ResultType.error,\n error: getInternalRouterError(404, { pathname: f.path }),\n };\n return error;\n }\n }),\n ]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n\n await Promise.all([\n resolveDeferredResults(\n currentMatches,\n matchesToLoad,\n loaderResults,\n loaderResults.map(() => request.signal),\n false,\n state.loaderData\n ),\n resolveDeferredResults(\n currentMatches,\n fetchersToLoad.map((f) => f.match),\n fetcherResults,\n fetchersToLoad.map((f) => (f.controller ? f.controller.signal : null)),\n true\n ),\n ]);\n\n return { results, loaderResults, fetcherResults };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true;\n\n // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n\n // Abort in-flight fetcher loads\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key: string, routeId: string, error: any) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error,\n },\n fetchers: new Map(state.fetchers),\n });\n }\n\n function deleteFetcher(key: string): void {\n let fetcher = state.fetchers.get(key);\n // Don't abort the controller if this is a deletion of a fetcher.submit()\n // in it's loading phase since - we don't want to abort the corresponding\n // revalidation and want them to complete and land\n if (\n fetchControllers.has(key) &&\n !(fetcher && fetcher.state === \"loading\" && fetchReloadIds.has(key))\n ) {\n abortFetcher(key);\n }\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key: string) {\n let controller = fetchControllers.get(key);\n invariant(controller, `Expected fetch controller: ${key}`);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys: string[]) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = getDoneFetcher(fetcher.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone(): boolean {\n let doneKeys = [];\n let updatedFetchers = false;\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n updatedFetchers = true;\n }\n }\n markFetchersDone(doneKeys);\n return updatedFetchers;\n }\n\n function abortStaleFetchLoads(landedId: number): boolean {\n let yeetedKeys = [];\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, `Expected fetcher: ${key}`);\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key: string, fn: BlockerFunction) {\n let blocker: Blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n\n return blocker;\n }\n\n function deleteBlocker(key: string) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n }\n\n // Utility function to update blockers, ensuring valid state transitions\n function updateBlocker(key: string, newBlocker: Blocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n invariant(\n (blocker.state === \"unblocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"blocked\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"proceeding\") ||\n (blocker.state === \"blocked\" && newBlocker.state === \"unblocked\") ||\n (blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\"),\n `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}`\n );\n\n let blockers = new Map(state.blockers);\n blockers.set(key, newBlocker);\n updateState({ blockers });\n }\n\n function shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction,\n }: {\n currentLocation: Location;\n nextLocation: Location;\n historyAction: HistoryAction;\n }): string | undefined {\n if (blockerFunctions.size === 0) {\n return;\n }\n\n // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n }\n\n // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n if (blockerFunction({ currentLocation, nextLocation, historyAction })) {\n return blockerKey;\n }\n }\n\n function cancelActiveDeferreds(\n predicate?: (routeId: string) => boolean\n ): string[] {\n let cancelledRouteIds: string[] = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n }\n\n // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n function enableScrollRestoration(\n positions: Record,\n getPosition: GetScrollPositionFunction,\n getKey?: GetScrollRestorationKeyFunction\n ) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey = getKey || null;\n\n // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n if (y != null) {\n updateState({ restoreScrollPosition: y });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function getScrollKey(location: Location, matches: AgnosticDataRouteMatch[]) {\n if (getScrollRestorationKey) {\n let key = getScrollRestorationKey(\n location,\n matches.map((m) => createUseMatchesMatch(m, state.loaderData))\n );\n return key || location.key;\n }\n return location.key;\n }\n\n function saveScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): void {\n if (savedScrollPositions && getScrollPosition) {\n let key = getScrollKey(location, matches);\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(\n location: Location,\n matches: AgnosticDataRouteMatch[]\n ): number | null {\n if (savedScrollPositions) {\n let key = getScrollKey(location, matches);\n let y = savedScrollPositions[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n\n function _internalSetRoutes(newRoutes: AgnosticDataRouteObject[]) {\n manifest = {};\n inFlightDataRoutes = convertRoutesToDataRoutes(\n newRoutes,\n mapRouteProperties,\n undefined,\n manifest\n );\n }\n\n router = {\n get basename() {\n return basename;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: (to: To) => init.history.createHref(to),\n encodeLocation: (to: To) => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes,\n };\n\n return router;\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nexport const UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\n\nexport interface CreateStaticHandlerOptions {\n basename?: string;\n /**\n * @deprecated Use `mapRouteProperties` instead\n */\n detectErrorBoundary?: DetectErrorBoundaryFunction;\n mapRouteProperties?: MapRoutePropertiesFunction;\n}\n\nexport function createStaticHandler(\n routes: AgnosticRouteObject[],\n opts?: CreateStaticHandlerOptions\n): StaticHandler {\n invariant(\n routes.length > 0,\n \"You must provide a non-empty routes array to createStaticHandler\"\n );\n\n let manifest: RouteManifest = {};\n let basename = (opts ? opts.basename : null) || \"/\";\n let mapRouteProperties: MapRoutePropertiesFunction;\n if (opts?.mapRouteProperties) {\n mapRouteProperties = opts.mapRouteProperties;\n } else if (opts?.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = opts.detectErrorBoundary;\n mapRouteProperties = (route) => ({\n hasErrorBoundary: detectErrorBoundary(route),\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n\n let dataRoutes = convertRoutesToDataRoutes(\n routes,\n mapRouteProperties,\n undefined,\n manifest\n );\n\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n async function query(\n request: Request,\n { requestContext }: { requestContext?: unknown } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\") {\n let error = getInternalRouterError(405, { method });\n let { matches: methodNotAllowedMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, { pathname: location.pathname });\n let { matches: notFoundMatches, route } =\n getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error,\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n if (isResponse(result)) {\n return result;\n }\n\n // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n return { location, basename, ...result };\n }\n\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n async function queryRoute(\n request: Request,\n {\n routeId,\n requestContext,\n }: { requestContext?: unknown; routeId?: string } = {}\n ): Promise {\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\" && method !== \"OPTIONS\") {\n throw getInternalRouterError(405, { method });\n } else if (!matches) {\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let match = routeId\n ? matches.find((m) => m.route.id === routeId)\n : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId,\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, { pathname: location.pathname });\n }\n\n let result = await queryImpl(\n request,\n location,\n matches,\n requestContext,\n match\n );\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n }\n\n // Pick off the right state value to return\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n let data = Object.values(result.loaderData)[0];\n if (result.activeDeferreds?.[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(\n request: Request,\n location: Location,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch\n ): Promise | Response> {\n invariant(\n request.signal,\n \"query()/queryRoute() requests must contain an AbortController signal\"\n );\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(\n request,\n matches,\n routeMatch || getTargetMatch(matches, location),\n requestContext,\n routeMatch != null\n );\n return result;\n }\n\n let result = await loadRouteData(\n request,\n matches,\n requestContext,\n routeMatch\n );\n return isResponse(result)\n ? result\n : {\n ...result,\n actionData: null,\n actionHeaders: {},\n };\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n return e.response;\n }\n // Redirects are always returned since they don't propagate to catch\n // boundaries\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n\n async function submit(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n actionMatch: AgnosticDataRouteMatch,\n requestContext: unknown,\n isRouteRequest: boolean\n ): Promise | Response> {\n let result: DataResult;\n\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id,\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n } else {\n result = await callLoaderOrAction(\n \"action\",\n request,\n actionMatch,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n { isStaticRequest: true, isRouteRequest, requestContext }\n );\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location,\n },\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, { type: \"defer-action\" });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error,\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: { [actionMatch.route.id]: result.data },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null,\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(\n request,\n matches,\n requestContext,\n undefined,\n {\n [boundaryMatch.route.id]: result.error,\n }\n );\n\n // action status codes take precedence over loader status codes\n return {\n ...context,\n statusCode: isRouteErrorResponse(result.error)\n ? result.error.status\n : 500,\n actionData: null,\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n // Create a GET request for the loaders\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal,\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n\n return {\n ...context,\n // action status codes take precedence over loader status codes\n ...(result.statusCode ? { statusCode: result.statusCode } : {}),\n actionData: {\n [actionMatch.route.id]: result.data,\n },\n actionHeaders: {\n ...(result.headers ? { [actionMatch.route.id]: result.headers } : {}),\n },\n };\n }\n\n async function loadRouteData(\n request: Request,\n matches: AgnosticDataRouteMatch[],\n requestContext: unknown,\n routeMatch?: AgnosticDataRouteMatch,\n pendingActionError?: RouteData\n ): Promise<\n | Omit<\n StaticHandlerContext,\n \"location\" | \"basename\" | \"actionData\" | \"actionHeaders\"\n >\n | Response\n > {\n let isRouteRequest = routeMatch != null;\n\n // Short circuit if we have no loaders to run (queryRoute())\n if (\n isRouteRequest &&\n !routeMatch?.route.loader &&\n !routeMatch?.route.lazy\n ) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch?.route.id,\n });\n }\n\n let requestMatches = routeMatch\n ? [routeMatch]\n : getLoaderMatchesUntilBoundary(\n matches,\n Object.keys(pendingActionError || {})[0]\n );\n let matchesToLoad = requestMatches.filter(\n (m) => m.route.loader || m.route.lazy\n );\n\n // Short circuit if we have no loaders to run (query())\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce(\n (acc, m) => Object.assign(acc, { [m.route.id]: null }),\n {}\n ),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null,\n };\n }\n\n let results = await Promise.all([\n ...matchesToLoad.map((match) =>\n callLoaderOrAction(\n \"loader\",\n request,\n match,\n matches,\n manifest,\n mapRouteProperties,\n basename,\n { isStaticRequest: true, isRouteRequest, requestContext }\n )\n ),\n ]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(`${method}() call aborted`);\n }\n\n // Process and commit output from loaders\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingActionError,\n activeDeferreds\n );\n\n // Add a null for any non-loader matches for proper revalidation on the client\n let executedLoaders = new Set(\n matchesToLoad.map((match) => match.route.id)\n );\n matches.forEach((match) => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n\n return {\n ...context,\n matches,\n activeDeferreds:\n activeDeferreds.size > 0\n ? Object.fromEntries(activeDeferreds.entries())\n : null,\n };\n }\n\n return {\n dataRoutes,\n query,\n queryRoute,\n };\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nexport function getStaticContextFromError(\n routes: AgnosticDataRouteObject[],\n context: StaticHandlerContext,\n error: any\n) {\n let newContext: StaticHandlerContext = {\n ...context,\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error,\n },\n };\n return newContext;\n}\n\nfunction isSubmissionNavigation(\n opts: RouterNavigateOptions\n): opts is SubmissionNavigateOptions {\n return (\n opts != null &&\n ((\"formData\" in opts && opts.formData != null) ||\n (\"body\" in opts && opts.body !== undefined))\n );\n}\n\nfunction normalizeTo(\n location: Path,\n matches: AgnosticDataRouteMatch[],\n basename: string,\n prependBasename: boolean,\n to: To | null,\n fromRouteId?: string,\n relative?: RelativeRoutingType\n) {\n let contextualMatches: AgnosticDataRouteMatch[];\n let activeRouteMatch: AgnosticDataRouteMatch | undefined;\n if (fromRouteId != null && relative !== \"path\") {\n // Grab matches up to the calling route so our route-relative logic is\n // relative to the correct source route. When using relative:path,\n // fromRouteId is ignored since that is always relative to the current\n // location path\n contextualMatches = [];\n for (let match of matches) {\n contextualMatches.push(match);\n if (match.route.id === fromRouteId) {\n activeRouteMatch = match;\n break;\n }\n }\n } else {\n contextualMatches = matches;\n activeRouteMatch = matches[matches.length - 1];\n }\n\n // Resolve the relative path\n let path = resolveTo(\n to ? to : \".\",\n getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase),\n stripBasename(location.pathname, basename) || location.pathname,\n relative === \"path\"\n );\n\n // When `to` is not specified we inherit search/hash from the current\n // location, unlike when to=\".\" and we just inherit the path.\n // See https://github.com/remix-run/remix/issues/927\n if (to == null) {\n path.search = location.search;\n path.hash = location.hash;\n }\n\n // Add an ?index param for matched index routes if we don't already have one\n if (\n (to == null || to === \"\" || to === \".\") &&\n activeRouteMatch &&\n activeRouteMatch.route.index &&\n !hasNakedIndexQuery(path.search)\n ) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n // If we're operating within a basename, prepend it to the pathname. If\n // this is a root navigation, then just use the raw basename which allows\n // the basename to have full control over the presence of a trailing slash\n // on root actions\n if (prependBasename && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(\n normalizeFormMethod: boolean,\n isFetcher: boolean,\n path: string,\n opts?: RouterNavigateOptions\n): {\n path: string;\n submission?: Submission;\n error?: ErrorResponse;\n} {\n // Return location verbatim on non-submission navigations\n if (!opts || !isSubmissionNavigation(opts)) {\n return { path };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, { method: opts.formMethod }),\n };\n }\n\n let getInvalidBodyError = () => ({\n path,\n error: getInternalRouterError(400, { type: \"invalid-body\" }),\n });\n\n // Create a Submission on non-GET navigations\n let rawFormMethod = opts.formMethod || \"get\";\n let formMethod = normalizeFormMethod\n ? (rawFormMethod.toUpperCase() as V7_FormMethod)\n : (rawFormMethod.toLowerCase() as FormMethod);\n let formAction = stripHashFromPath(path);\n\n if (opts.body !== undefined) {\n if (opts.formEncType === \"text/plain\") {\n // text only support POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n\n let text =\n typeof opts.body === \"string\"\n ? opts.body\n : opts.body instanceof FormData ||\n opts.body instanceof URLSearchParams\n ? // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data\n Array.from(opts.body.entries()).reduce(\n (acc, [name, value]) => `${acc}${name}=${value}\\n`,\n \"\"\n )\n : String(opts.body);\n\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json: undefined,\n text,\n },\n };\n } else if (opts.formEncType === \"application/json\") {\n // json only supports POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n\n try {\n let json =\n typeof opts.body === \"string\" ? JSON.parse(opts.body) : opts.body;\n\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json,\n text: undefined,\n },\n };\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n }\n\n invariant(\n typeof FormData === \"function\",\n \"FormData is not available in this environment\"\n );\n\n let searchParams: URLSearchParams;\n let formData: FormData;\n\n if (opts.formData) {\n searchParams = convertFormDataToSearchParams(opts.formData);\n formData = opts.formData;\n } else if (opts.body instanceof FormData) {\n searchParams = convertFormDataToSearchParams(opts.body);\n formData = opts.body;\n } else if (opts.body instanceof URLSearchParams) {\n searchParams = opts.body;\n formData = convertSearchParamsToFormData(searchParams);\n } else if (opts.body == null) {\n searchParams = new URLSearchParams();\n formData = new FormData();\n } else {\n try {\n searchParams = new URLSearchParams(opts.body);\n formData = convertSearchParamsToFormData(searchParams);\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n\n let submission: Submission = {\n formMethod,\n formAction,\n formEncType:\n (opts && opts.formEncType) || \"application/x-www-form-urlencoded\",\n formData,\n json: undefined,\n text: undefined,\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return { path, submission };\n }\n\n // Flatten submission onto URLSearchParams for GET submissions\n let parsedPath = parsePath(path);\n // On GET navigation submissions we can drop the ?index param from the\n // resulting location since all loaders will run. But fetcher GET submissions\n // only run a single loader so we need to preserve any incoming ?index params\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = `?${searchParams}`;\n\n return { path: createPath(parsedPath), submission };\n}\n\n// Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(\n matches: AgnosticDataRouteMatch[],\n boundaryId?: string\n) {\n let boundaryMatches = matches;\n if (boundaryId) {\n let index = matches.findIndex((m) => m.route.id === boundaryId);\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(\n history: History,\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n submission: Submission | undefined,\n location: Location,\n isRevalidationRequired: boolean,\n cancelledDeferredRoutes: string[],\n cancelledFetcherLoads: string[],\n fetchLoadMatches: Map,\n fetchRedirectIds: Set,\n routesToUse: AgnosticDataRouteObject[],\n basename: string | undefined,\n pendingActionData?: RouteData,\n pendingError?: RouteData\n): [AgnosticDataRouteMatch[], RevalidatingFetcher[]] {\n let actionResult = pendingError\n ? Object.values(pendingError)[0]\n : pendingActionData\n ? Object.values(pendingActionData)[0]\n : undefined;\n\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n\n // Pick navigation matches that are net-new or qualify for revalidation\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.lazy) {\n // We haven't loaded this route yet so we don't know if it's got a loader!\n return true;\n }\n if (match.route.loader == null) {\n return false;\n }\n\n // Always call the loader on new route instances and pending defer cancellations\n if (\n isNewLoader(state.loaderData, state.matches[index], match) ||\n cancelledDeferredRoutes.some((id) => id === match.route.id)\n ) {\n return true;\n }\n\n // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n\n return shouldRevalidateLoader(match, {\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params,\n ...submission,\n actionResult,\n defaultShouldRevalidate:\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n isRevalidationRequired ||\n // Clicked the same link, resubmitted a GET form\n currentUrl.pathname + currentUrl.search ===\n nextUrl.pathname + nextUrl.search ||\n // Search params affect all loaders\n currentUrl.search !== nextUrl.search ||\n isNewRouteInstance(currentRouteMatch, nextRouteMatch),\n });\n });\n\n // Pick fetcher.loads that need to be revalidated\n let revalidatingFetchers: RevalidatingFetcher[] = [];\n fetchLoadMatches.forEach((f, key) => {\n // Don't revalidate if fetcher won't be present in the subsequent render\n if (!matches.some((m) => m.route.id === f.routeId)) {\n return;\n }\n\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\n\n // If the fetcher path no longer matches, push it in with null matches so\n // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is\n // currently only a use-case for Remix HMR where the route tree can change\n // at runtime and remove a route previously loaded via a fetcher\n if (!fetcherMatches) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: null,\n match: null,\n controller: null,\n });\n return;\n }\n\n // Revalidating fetchers are decoupled from the route matches since they\n // load from a static href. They revalidate based on explicit revalidation\n // (submission, useRevalidator, or X-Remix-Revalidate)\n let fetcher = state.fetchers.get(key);\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n\n let shouldRevalidate = false;\n if (fetchRedirectIds.has(key)) {\n // Never trigger a revalidation of an actively redirecting fetcher\n shouldRevalidate = false;\n } else if (cancelledFetcherLoads.includes(key)) {\n // Always revalidate if the fetcher was cancelled\n shouldRevalidate = true;\n } else if (\n fetcher &&\n fetcher.state !== \"idle\" &&\n fetcher.data === undefined\n ) {\n // If the fetcher hasn't ever completed loading yet, then this isn't a\n // revalidation, it would just be a brand new load if an explicit\n // revalidation is required\n shouldRevalidate = isRevalidationRequired;\n } else {\n // Otherwise fall back on any user-defined shouldRevalidate, defaulting\n // to explicit revalidations only\n shouldRevalidate = shouldRevalidateLoader(fetcherMatch, {\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params,\n ...submission,\n actionResult,\n defaultShouldRevalidate: isRevalidationRequired,\n });\n }\n\n if (shouldRevalidate) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: fetcherMatches,\n match: fetcherMatch,\n controller: new AbortController(),\n });\n }\n });\n\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(\n currentLoaderData: RouteData,\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let isNew =\n // [a] -> [a, b]\n !currentMatch ||\n // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id;\n\n // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n let isMissingData = currentLoaderData[match.route.id] === undefined;\n\n // Always load if this is a net-new route or we don't yet have data\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(\n currentMatch: AgnosticDataRouteMatch,\n match: AgnosticDataRouteMatch\n) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n (currentPath != null &&\n currentPath.endsWith(\"*\") &&\n currentMatch.params[\"*\"] !== match.params[\"*\"])\n );\n}\n\nfunction shouldRevalidateLoader(\n loaderMatch: AgnosticDataRouteMatch,\n arg: Parameters[0]\n) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\nasync function loadLazyRouteModule(\n route: AgnosticDataRouteObject,\n mapRouteProperties: MapRoutePropertiesFunction,\n manifest: RouteManifest\n) {\n if (!route.lazy) {\n return;\n }\n\n let lazyRoute = await route.lazy();\n\n // If the lazy route function was executed and removed by another parallel\n // call then we can return - first lazy() to finish wins because the return\n // value of lazy is expected to be static\n if (!route.lazy) {\n return;\n }\n\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\");\n\n // Update the route in place. This should be safe because there's no way\n // we could yet be sitting on this route as we can't get there without\n // resolving lazy() first.\n //\n // This is different than the HMR \"update\" use-case where we may actively be\n // on the route being updated. The main concern boils down to \"does this\n // mutation affect any ongoing navigations or any current state.matches\n // values?\". If not, it should be safe to update in place.\n let routeUpdates: Record = {};\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue =\n routeToUpdate[lazyRouteProperty as keyof typeof routeToUpdate];\n\n let isPropertyStaticallyDefined =\n staticRouteValue !== undefined &&\n // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n\n warning(\n !isPropertyStaticallyDefined,\n `Route \"${routeToUpdate.id}\" has a static property \"${lazyRouteProperty}\" ` +\n `defined but its lazy function is also returning a value for this property. ` +\n `The lazy route property \"${lazyRouteProperty}\" will be ignored.`\n );\n\n if (\n !isPropertyStaticallyDefined &&\n !immutableRouteKeys.has(lazyRouteProperty as ImmutableRouteKey)\n ) {\n routeUpdates[lazyRouteProperty] =\n lazyRoute[lazyRouteProperty as keyof typeof lazyRoute];\n }\n }\n\n // Mutate the route with the provided updates. Do this first so we pass\n // the updated version to mapRouteProperties\n Object.assign(routeToUpdate, routeUpdates);\n\n // Mutate the `hasErrorBoundary` property on the route based on the route\n // updates and remove the `lazy` function so we don't resolve the lazy\n // route again.\n Object.assign(routeToUpdate, {\n // To keep things framework agnostic, we use the provided\n // `mapRouteProperties` (or wrapped `detectErrorBoundary`) function to\n // set the framework-aware properties (`element`/`hasErrorBoundary`) since\n // the logic will differ between frameworks.\n ...mapRouteProperties(routeToUpdate),\n lazy: undefined,\n });\n}\n\nasync function callLoaderOrAction(\n type: \"loader\" | \"action\",\n request: Request,\n match: AgnosticDataRouteMatch,\n matches: AgnosticDataRouteMatch[],\n manifest: RouteManifest,\n mapRouteProperties: MapRoutePropertiesFunction,\n basename: string,\n opts: {\n isStaticRequest?: boolean;\n isRouteRequest?: boolean;\n requestContext?: unknown;\n } = {}\n): Promise {\n let resultType;\n let result;\n let onReject: (() => void) | undefined;\n\n let runHandler = (handler: ActionFunction | LoaderFunction) => {\n // Setup a promise we can race against so that abort signals short circuit\n let reject: () => void;\n let abortPromise = new Promise((_, r) => (reject = r));\n onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n return Promise.race([\n handler({\n request,\n params: match.params,\n context: opts.requestContext,\n }),\n abortPromise,\n ]);\n };\n\n try {\n let handler = match.route[type];\n\n if (match.route.lazy) {\n if (handler) {\n // Run statically defined handler in parallel with lazy()\n let values = await Promise.all([\n runHandler(handler),\n loadLazyRouteModule(match.route, mapRouteProperties, manifest),\n ]);\n result = values[0];\n } else {\n // Load lazy route module, then run any returned handler\n await loadLazyRouteModule(match.route, mapRouteProperties, manifest);\n\n handler = match.route[type];\n if (handler) {\n // Handler still run even if we got interrupted to maintain consistency\n // with un-abortable behavior of handler execution on non-lazy or\n // previously-lazy-loaded routes\n result = await runHandler(handler);\n } else if (type === \"action\") {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(405, {\n method: request.method,\n pathname,\n routeId: match.route.id,\n });\n } else {\n // lazy() route has no loader to run. Short circuit here so we don't\n // hit the invariant below that errors on returning undefined.\n return { type: ResultType.data, data: undefined };\n }\n }\n } else if (!handler) {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(404, {\n pathname,\n });\n } else {\n result = await runHandler(handler);\n }\n\n invariant(\n result !== undefined,\n `You defined ${type === \"action\" ? \"an action\" : \"a loader\"} for route ` +\n `\"${match.route.id}\" but didn't return anything from your \\`${type}\\` ` +\n `function. Please return a value or \\`null\\`.`\n );\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n\n if (isResponse(result)) {\n let status = result.status;\n\n // Process redirects\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(\n location,\n \"Redirects returned/thrown from loaders/actions must have a Location header\"\n );\n\n // Support relative routing in internal redirects\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n location = normalizeTo(\n new URL(request.url),\n matches.slice(0, matches.indexOf(match) + 1),\n basename,\n true,\n location\n );\n } else if (!opts.isStaticRequest) {\n // Strip off the protocol+origin for same-origin + same-basename absolute\n // redirects. If this is a static request, we can let it go back to the\n // browser as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\")\n ? new URL(currentUrl.protocol + location)\n : new URL(location);\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n if (url.origin === currentUrl.origin && isSameBasename) {\n location = url.pathname + url.search + url.hash;\n }\n }\n\n // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n if (opts.isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null,\n };\n }\n\n // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n if (opts.isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result,\n };\n }\n\n let data: any;\n let contentType = result.headers.get(\"Content-Type\");\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers,\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers,\n };\n }\n\n if (resultType === ResultType.error) {\n return { type: resultType, error: result };\n }\n\n if (isDeferredData(result)) {\n return {\n type: ResultType.deferred,\n deferredData: result,\n statusCode: result.init?.status,\n headers: result.init?.headers && new Headers(result.init.headers),\n };\n }\n\n return { type: ResultType.data, data: result };\n}\n\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(\n history: History,\n location: string | Location,\n signal: AbortSignal,\n submission?: Submission\n): Request {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init: RequestInit = { signal };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let { formMethod, formEncType } = submission;\n // Didn't think we needed this but it turns out unlike other methods, patch\n // won't be properly normalized to uppercase and results in a 405 error.\n // See: https://fetch.spec.whatwg.org/#concept-method\n init.method = formMethod.toUpperCase();\n\n if (formEncType === \"application/json\") {\n init.headers = new Headers({ \"Content-Type\": formEncType });\n init.body = JSON.stringify(submission.json);\n } else if (formEncType === \"text/plain\") {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.text;\n } else if (\n formEncType === \"application/x-www-form-urlencoded\" &&\n submission.formData\n ) {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = convertFormDataToSearchParams(submission.formData);\n } else {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.formData;\n }\n }\n\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData: FormData): URLSearchParams {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, typeof value === \"string\" ? value : value.name);\n }\n\n return searchParams;\n}\n\nfunction convertSearchParamsToFormData(\n searchParams: URLSearchParams\n): FormData {\n let formData = new FormData();\n for (let [key, value] of searchParams.entries()) {\n formData.append(key, value);\n }\n return formData;\n}\n\nfunction processRouteLoaderData(\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors: RouterState[\"errors\"] | null;\n statusCode: number;\n loaderHeaders: Record;\n} {\n // Fill in loaderData/errors from our loaders\n let loaderData: RouterState[\"loaderData\"] = {};\n let errors: RouterState[\"errors\"] | null = null;\n let statusCode: number | undefined;\n let foundError = false;\n let loaderHeaders: Record = {};\n\n // Process loader results into state.loaderData/state.errors\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(\n !isRedirectResult(result),\n \"Cannot handle redirect results in processLoaderData\"\n );\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error;\n // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {};\n\n // Prefer higher error values if lower errors bubble to the same boundary\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n\n // Clear our any prior loaderData for the throwing route\n loaderData[id] = undefined;\n\n // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error)\n ? result.error.status\n : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n }\n\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (\n result.statusCode != null &&\n result.statusCode !== 200 &&\n !foundError\n ) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n });\n\n // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders,\n };\n}\n\nfunction processLoaderData(\n state: RouterState,\n matches: AgnosticDataRouteMatch[],\n matchesToLoad: AgnosticDataRouteMatch[],\n results: DataResult[],\n pendingError: RouteData | undefined,\n revalidatingFetchers: RevalidatingFetcher[],\n fetcherResults: DataResult[],\n activeDeferreds: Map\n): {\n loaderData: RouterState[\"loaderData\"];\n errors?: RouterState[\"errors\"];\n} {\n let { loaderData, errors } = processRouteLoaderData(\n matches,\n matchesToLoad,\n results,\n pendingError,\n activeDeferreds\n );\n\n // Process results from our revalidating fetchers\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let { key, match, controller } = revalidatingFetchers[index];\n invariant(\n fetcherResults !== undefined && fetcherResults[index] !== undefined,\n \"Did not find corresponding fetcher result\"\n );\n let result = fetcherResults[index];\n\n // Process fetcher non-redirect errors\n if (controller && controller.signal.aborted) {\n // Nothing to do for aborted fetchers\n continue;\n } else if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match?.route.id);\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = {\n ...errors,\n [boundaryMatch.route.id]: result.error,\n };\n }\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return { loaderData, errors };\n}\n\nfunction mergeLoaderData(\n loaderData: RouteData,\n newLoaderData: RouteData,\n matches: AgnosticDataRouteMatch[],\n errors: RouteData | null | undefined\n): RouteData {\n let mergedLoaderData = { ...newLoaderData };\n for (let match of matches) {\n let id = match.route.id;\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n } else {\n // No-op - this is so we ignore existing data if we have a key in the\n // incoming object with an undefined value, which is how we unset a prior\n // loaderData if we encounter a loader error\n }\n } else if (loaderData[id] !== undefined && match.route.loader) {\n // Preserve existing keys not included in newLoaderData and where a loader\n // wasn't removed by HMR\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n return mergedLoaderData;\n}\n\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(\n matches: AgnosticDataRouteMatch[],\n routeId?: string\n): AgnosticDataRouteMatch {\n let eligibleMatches = routeId\n ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1)\n : [...matches];\n return (\n eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) ||\n matches[0]\n );\n}\n\nfunction getShortCircuitMatches(routes: AgnosticDataRouteObject[]): {\n matches: AgnosticDataRouteMatch[];\n route: AgnosticDataRouteObject;\n} {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find((r) => r.index || !r.path || r.path === \"/\") || {\n id: `__shim-error-route__`,\n };\n\n return {\n matches: [\n {\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route,\n },\n ],\n route,\n };\n}\n\nfunction getInternalRouterError(\n status: number,\n {\n pathname,\n routeId,\n method,\n type,\n }: {\n pathname?: string;\n routeId?: string;\n method?: string;\n type?: \"defer-action\" | \"invalid-body\";\n } = {}\n) {\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method} request to \"${pathname}\" but ` +\n `did not provide a \\`loader\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n } else if (type === \"invalid-body\") {\n errorMessage = \"Unable to encode submission body\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = `Route \"${routeId}\" does not match URL \"${pathname}\"`;\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = `No route matches URL \"${pathname}\"`;\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n if (method && pathname && routeId) {\n errorMessage =\n `You made a ${method.toUpperCase()} request to \"${pathname}\" but ` +\n `did not provide an \\`action\\` for route \"${routeId}\", ` +\n `so there is no way to handle the request.`;\n } else if (method) {\n errorMessage = `Invalid request method \"${method.toUpperCase()}\"`;\n }\n }\n\n return new ErrorResponse(\n status || 500,\n statusText,\n new Error(errorMessage),\n true\n );\n}\n\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(\n results: DataResult[]\n): { result: RedirectResult; idx: number } | undefined {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n if (isRedirectResult(result)) {\n return { result, idx: i };\n }\n }\n}\n\nfunction stripHashFromPath(path: To) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath({ ...parsedPath, hash: \"\" });\n}\n\nfunction isHashChangeOnly(a: Location, b: Location): boolean {\n if (a.pathname !== b.pathname || a.search !== b.search) {\n return false;\n }\n\n if (a.hash === \"\") {\n // /page -> /page#hash\n return b.hash !== \"\";\n } else if (a.hash === b.hash) {\n // /page#hash -> /page#hash\n return true;\n } else if (b.hash !== \"\") {\n // /page#hash -> /page#other\n return true;\n }\n\n // If the hash is removed the browser will re-perform a request to the server\n // /page#hash -> /page\n return false;\n}\n\nfunction isDeferredResult(result: DataResult): result is DeferredResult {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result: DataResult): result is ErrorResult {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result?: DataResult): result is RedirectResult {\n return (result && result.type) === ResultType.redirect;\n}\n\nexport function isDeferredData(value: any): value is DeferredData {\n let deferred: DeferredData = value;\n return (\n deferred &&\n typeof deferred === \"object\" &&\n typeof deferred.data === \"object\" &&\n typeof deferred.subscribe === \"function\" &&\n typeof deferred.cancel === \"function\" &&\n typeof deferred.resolveData === \"function\"\n );\n}\n\nfunction isResponse(value: any): value is Response {\n return (\n value != null &&\n typeof value.status === \"number\" &&\n typeof value.statusText === \"string\" &&\n typeof value.headers === \"object\" &&\n typeof value.body !== \"undefined\"\n );\n}\n\nfunction isRedirectResponse(result: any): result is Response {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj: any): obj is QueryRouteResponse {\n return (\n obj &&\n isResponse(obj.response) &&\n (obj.type === ResultType.data || ResultType.error)\n );\n}\n\nfunction isValidMethod(method: string): method is FormMethod | V7_FormMethod {\n return validRequestMethods.has(method.toLowerCase() as FormMethod);\n}\n\nfunction isMutationMethod(\n method: string\n): method is MutationFormMethod | V7_MutationFormMethod {\n return validMutationMethods.has(method.toLowerCase() as MutationFormMethod);\n}\n\nasync function resolveDeferredResults(\n currentMatches: AgnosticDataRouteMatch[],\n matchesToLoad: (AgnosticDataRouteMatch | null)[],\n results: DataResult[],\n signals: (AbortSignal | null)[],\n isFetcher: boolean,\n currentLoaderData?: RouteData\n) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n if (!match) {\n continue;\n }\n\n let currentMatch = currentMatches.find(\n (m) => m.route.id === match!.route.id\n );\n let isRevalidatingLoader =\n currentMatch != null &&\n !isNewRouteInstance(currentMatch, match) &&\n (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n let signal = signals[index];\n invariant(\n signal,\n \"Expected an AbortSignal for revalidating fetcher deferred result\"\n );\n await resolveDeferredData(result, signal, isFetcher).then((result) => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(\n result: DeferredResult,\n signal: AbortSignal,\n unwrap = false\n): Promise {\n let aborted = await result.deferredData.resolveData(signal);\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData,\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e,\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data,\n };\n}\n\nfunction hasNakedIndexQuery(search: string): boolean {\n return new URLSearchParams(search).getAll(\"index\").some((v) => v === \"\");\n}\n\n// Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\nfunction createUseMatchesMatch(\n match: AgnosticDataRouteMatch,\n loaderData: RouteData\n): UseMatchesMatch {\n let { route, pathname, params } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id] as unknown,\n handle: route.handle as unknown,\n };\n}\n\nfunction getTargetMatch(\n matches: AgnosticDataRouteMatch[],\n location: Location | string\n) {\n let search =\n typeof location === \"string\" ? parsePath(location).search : location.search;\n if (\n matches[matches.length - 1].route.index &&\n hasNakedIndexQuery(search || \"\")\n ) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n }\n // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\n\nfunction getSubmissionFromNavigation(\n navigation: Navigation\n): Submission | undefined {\n let { formMethod, formAction, formEncType, text, formData, json } =\n navigation;\n if (!formMethod || !formAction || !formEncType) {\n return;\n }\n\n if (text != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json: undefined,\n text,\n };\n } else if (formData != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData,\n json: undefined,\n text: undefined,\n };\n } else if (json !== undefined) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json,\n text: undefined,\n };\n }\n}\n\nfunction getLoadingNavigation(\n location: Location,\n submission?: Submission\n): NavigationStates[\"Loading\"] {\n if (submission) {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n };\n return navigation;\n } else {\n let navigation: NavigationStates[\"Loading\"] = {\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n };\n return navigation;\n }\n}\n\nfunction getSubmittingNavigation(\n location: Location,\n submission: Submission\n): NavigationStates[\"Submitting\"] {\n let navigation: NavigationStates[\"Submitting\"] = {\n state: \"submitting\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n };\n return navigation;\n}\n\nfunction getLoadingFetcher(\n submission?: Submission,\n data?: Fetcher[\"data\"]\n): FetcherStates[\"Loading\"] {\n if (submission) {\n let fetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n } else {\n let fetcher: FetcherStates[\"Loading\"] = {\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n }\n}\n\nfunction getSubmittingFetcher(\n submission: Submission,\n existingFetcher?: Fetcher\n): FetcherStates[\"Submitting\"] {\n let fetcher: FetcherStates[\"Submitting\"] = {\n state: \"submitting\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data: existingFetcher ? existingFetcher.data : undefined,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n}\n\nfunction getDoneFetcher(data: Fetcher[\"data\"]): FetcherStates[\"Idle\"] {\n let fetcher: FetcherStates[\"Idle\"] = {\n state: \"idle\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data,\n \" _hasFetcherDoneAnything \": true,\n };\n return fetcher;\n}\n//#endregion\n","import * as React from \"react\";\nimport type {\n AgnosticRouteMatch,\n AgnosticIndexRouteObject,\n AgnosticNonIndexRouteObject,\n History,\n Location,\n RelativeRoutingType,\n Router,\n StaticHandlerContext,\n To,\n TrackedPromise,\n LazyRouteFunction,\n} from \"@remix-run/router\";\nimport type { Action as NavigationType } from \"@remix-run/router\";\n\n// Create react-specific types from the agnostic types in @remix-run/router to\n// export from react-router\nexport interface IndexRouteObject {\n caseSensitive?: AgnosticIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticIndexRouteObject[\"path\"];\n id?: AgnosticIndexRouteObject[\"id\"];\n loader?: AgnosticIndexRouteObject[\"loader\"];\n action?: AgnosticIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticIndexRouteObject[\"handle\"];\n index: true;\n children?: undefined;\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction;\n}\n\nexport interface NonIndexRouteObject {\n caseSensitive?: AgnosticNonIndexRouteObject[\"caseSensitive\"];\n path?: AgnosticNonIndexRouteObject[\"path\"];\n id?: AgnosticNonIndexRouteObject[\"id\"];\n loader?: AgnosticNonIndexRouteObject[\"loader\"];\n action?: AgnosticNonIndexRouteObject[\"action\"];\n hasErrorBoundary?: AgnosticNonIndexRouteObject[\"hasErrorBoundary\"];\n shouldRevalidate?: AgnosticNonIndexRouteObject[\"shouldRevalidate\"];\n handle?: AgnosticNonIndexRouteObject[\"handle\"];\n index?: false;\n children?: RouteObject[];\n element?: React.ReactNode | null;\n errorElement?: React.ReactNode | null;\n Component?: React.ComponentType | null;\n ErrorBoundary?: React.ComponentType | null;\n lazy?: LazyRouteFunction;\n}\n\nexport type RouteObject = IndexRouteObject | NonIndexRouteObject;\n\nexport type DataRouteObject = RouteObject & {\n children?: DataRouteObject[];\n id: string;\n};\n\nexport interface RouteMatch<\n ParamKey extends string = string,\n RouteObjectType extends RouteObject = RouteObject\n> extends AgnosticRouteMatch {}\n\nexport interface DataRouteMatch extends RouteMatch {}\n\nexport interface DataRouterContextObject extends NavigationContextObject {\n router: Router;\n staticContext?: StaticHandlerContext;\n}\n\nexport const DataRouterContext =\n React.createContext(null);\nif (__DEV__) {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nexport const DataRouterStateContext = React.createContext<\n Router[\"state\"] | null\n>(null);\nif (__DEV__) {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nexport const AwaitContext = React.createContext(null);\nif (__DEV__) {\n AwaitContext.displayName = \"Await\";\n}\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n}\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\nexport interface Navigator {\n createHref: History[\"createHref\"];\n // Optional for backwards-compat with Router/HistoryRouter usage (edge case)\n encodeLocation?: History[\"encodeLocation\"];\n go: History[\"go\"];\n push(to: To, state?: any, opts?: NavigateOptions): void;\n replace(to: To, state?: any, opts?: NavigateOptions): void;\n}\n\ninterface NavigationContextObject {\n basename: string;\n navigator: Navigator;\n static: boolean;\n}\n\nexport const NavigationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n NavigationContext.displayName = \"Navigation\";\n}\n\ninterface LocationContextObject {\n location: Location;\n navigationType: NavigationType;\n}\n\nexport const LocationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n LocationContext.displayName = \"Location\";\n}\n\nexport interface RouteContextObject {\n outlet: React.ReactElement | null;\n matches: RouteMatch[];\n isDataRoute: boolean;\n}\n\nexport const RouteContext = React.createContext({\n outlet: null,\n matches: [],\n isDataRoute: false,\n});\n\nif (__DEV__) {\n RouteContext.displayName = \"Route\";\n}\n\nexport const RouteErrorContext = React.createContext(null);\n\nif (__DEV__) {\n RouteErrorContext.displayName = \"RouteError\";\n}\n","import * as React from \"react\";\nimport type {\n Blocker,\n BlockerFunction,\n Location,\n ParamParseKey,\n Params,\n Path,\n PathMatch,\n PathPattern,\n RelativeRoutingType,\n Router as RemixRouter,\n RevalidationState,\n To,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n UNSAFE_invariant as invariant,\n isRouteErrorResponse,\n joinPaths,\n matchPath,\n matchRoutes,\n parsePath,\n resolveTo,\n stripBasename,\n IDLE_BLOCKER,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n UNSAFE_warning as warning,\n} from \"@remix-run/router\";\n\nimport type {\n NavigateOptions,\n RouteContextObject,\n RouteMatch,\n RouteObject,\n DataRouteMatch,\n} from \"./context\";\nimport {\n DataRouterContext,\n DataRouterStateContext,\n LocationContext,\n NavigationContext,\n RouteContext,\n RouteErrorContext,\n AwaitContext,\n} from \"./context\";\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\nexport function useHref(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useHref() may be used only in the context of a component.`\n );\n\n let { basename, navigator } = React.useContext(NavigationContext);\n let { hash, pathname, search } = useResolvedPath(to, { relative });\n\n let joinedPathname = pathname;\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n if (basename !== \"/\") {\n joinedPathname =\n pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({ pathname: joinedPathname, search, hash });\n}\n\n/**\n * Returns true if this component is a descendant of a .\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\nexport function useInRouterContext(): boolean {\n return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\nexport function useLocation(): Location {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useLocation() may be used only in the context of a component.`\n );\n\n return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\nexport function useNavigationType(): NavigationType {\n return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * .\n *\n * @see https://reactrouter.com/hooks/use-match\n */\nexport function useMatch<\n ParamKey extends ParamParseKey,\n Path extends string\n>(pattern: PathPattern | Path): PathMatch | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useMatch() may be used only in the context of a component.`\n );\n\n let { pathname } = useLocation();\n return React.useMemo(\n () => matchPath(pattern, pathname),\n [pathname, pattern]\n );\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\nexport interface NavigateFunction {\n (to: To, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\nconst navigateEffectWarning =\n `You should call navigate() in a React.useEffect(), not when ` +\n `your component is first rendered.`;\n\n// Mute warnings for calls to useNavigate in SSR environments\nfunction useIsomorphicLayoutEffect(\n cb: Parameters[0]\n) {\n let isStatic = React.useContext(NavigationContext).static;\n if (!isStatic) {\n // We should be able to get rid of this once react 18.3 is released\n // See: https://github.com/facebook/react/pull/26395\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(cb);\n }\n}\n\n/**\n * Returns an imperative method for changing the location. Used by s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nexport function useNavigate(): NavigateFunction {\n let { isDataRoute } = React.useContext(RouteContext);\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\n\nfunction useNavigateUnstable(): NavigateFunction {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useNavigate() may be used only in the context of a component.`\n );\n\n let dataRouterContext = React.useContext(DataRouterContext);\n let { basename, navigator } = React.useContext(NavigationContext);\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our history listener yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n options.relative === \"path\"\n );\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history (but only if we're not in a data router,\n // otherwise it'll prepend the basename inside of the router).\n // If this is a root navigation, then we navigate to the raw basename\n // which allows the basename to have full control over the presence of a\n // trailing slash on root links\n if (dataRouterContext == null && basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\"\n ? basename\n : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(\n path,\n options.state,\n options\n );\n },\n [\n basename,\n navigator,\n routePathnamesJson,\n locationPathname,\n dataRouterContext,\n ]\n );\n\n return navigate;\n}\n\nconst OutletContext = React.createContext(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\nexport function useOutletContext(): Context {\n return React.useContext(OutletContext) as Context;\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\nexport function useOutlet(context?: unknown): React.ReactElement | null {\n let outlet = React.useContext(RouteContext).outlet;\n if (outlet) {\n return (\n {outlet}\n );\n }\n return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\nexport function useParams<\n ParamsOrKey extends string | Record = string\n>(): Readonly<\n [ParamsOrKey] extends [string] ? Params : Partial\n> {\n let { matches } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? (routeMatch.params as any) : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\nexport function useResolvedPath(\n to: To,\n { relative }: { relative?: RelativeRoutingType } = {}\n): Path {\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n getPathContributingMatches(matches).map((match) => match.pathnameBase)\n );\n\n return React.useMemo(\n () =>\n resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname,\n relative === \"path\"\n ),\n [to, routePathnamesJson, locationPathname, relative]\n );\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\nexport function useRoutes(\n routes: RouteObject[],\n locationArg?: Partial | string\n): React.ReactElement | null {\n return useRoutesImpl(routes, locationArg);\n}\n\n// Internal implementation with accept optional param for RouterProvider usage\nexport function useRoutesImpl(\n routes: RouteObject[],\n locationArg?: Partial | string,\n dataRouterState?: RemixRouter[\"state\"]\n): React.ReactElement | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useRoutes() may be used only in the context of a component.`\n );\n\n let { navigator } = React.useContext(NavigationContext);\n let { matches: parentMatches } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (__DEV__) {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = (parentRoute && parentRoute.path) || \"\";\n warningOnce(\n parentPathname,\n !parentRoute || parentPath.endsWith(\"*\"),\n `You rendered descendant (or called \\`useRoutes()\\`) at ` +\n `\"${parentPathname}\" (under ) but the ` +\n `parent route path has no trailing \"*\". This means if you navigate ` +\n `deeper, the parent won't match anymore and therefore the child ` +\n `routes will never render.\\n\\n` +\n `Please change the parent to .`\n );\n }\n\n let locationFromContext = useLocation();\n\n let location;\n if (locationArg) {\n let parsedLocationArg =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n invariant(\n parentPathnameBase === \"/\" ||\n parsedLocationArg.pathname?.startsWith(parentPathnameBase),\n `When overriding the location using \\`\\` or \\`useRoutes(routes, location)\\`, ` +\n `the location pathname must begin with the portion of the URL pathname that was ` +\n `matched by all parent routes. The current pathname base is \"${parentPathnameBase}\" ` +\n `but pathname \"${parsedLocationArg.pathname}\" was given in the \\`location\\` prop.`\n );\n\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname =\n parentPathnameBase === \"/\"\n ? pathname\n : pathname.slice(parentPathnameBase.length) || \"/\";\n\n let matches = matchRoutes(routes, { pathname: remainingPathname });\n\n if (__DEV__) {\n warning(\n parentRoute || matches != null,\n `No routes matched location \"${location.pathname}${location.search}${location.hash}\" `\n );\n\n warning(\n matches == null ||\n matches[matches.length - 1].route.element !== undefined ||\n matches[matches.length - 1].route.Component !== undefined,\n `Matched leaf route at location \"${location.pathname}${location.search}${location.hash}\" ` +\n `does not have an element or Component. This means it will render an with a ` +\n `null value by default resulting in an \"empty\" page.`\n );\n }\n\n let renderedMatches = _renderMatches(\n matches &&\n matches.map((match) =>\n Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathname).pathname\n : match.pathname,\n ]),\n pathnameBase:\n match.pathnameBase === \"/\"\n ? parentPathnameBase\n : joinPaths([\n parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation\n ? navigator.encodeLocation(match.pathnameBase).pathname\n : match.pathnameBase,\n ]),\n })\n ),\n parentMatches,\n dataRouterState\n );\n\n // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n if (locationArg && renderedMatches) {\n return (\n \n {renderedMatches}\n \n );\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error)\n ? `${error.status} ${error.statusText}`\n : error instanceof Error\n ? error.message\n : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = { padding: \"0.5rem\", backgroundColor: lightgrey };\n let codeStyles = { padding: \"2px 4px\", backgroundColor: lightgrey };\n\n let devInfo = null;\n if (__DEV__) {\n console.error(\n \"Error handled by React Router default ErrorBoundary:\",\n error\n );\n\n devInfo = (\n <>\n

💿 Hey developer 👋

\n

\n You can provide a way better UX than this when your app throws errors\n by providing your own ErrorBoundary or{\" \"}\n errorElement prop on your route.\n

\n \n );\n }\n\n return (\n <>\n

Unexpected Application Error!

\n

{message}

\n {stack ?
{stack}
: null}\n {devInfo}\n \n );\n}\n\nconst defaultErrorElement = ;\n\ntype RenderErrorBoundaryProps = React.PropsWithChildren<{\n location: Location;\n revalidation: RevalidationState;\n error: any;\n component: React.ReactNode;\n routeContext: RouteContextObject;\n}>;\n\ntype RenderErrorBoundaryState = {\n location: Location;\n revalidation: RevalidationState;\n error: any;\n};\n\nexport class RenderErrorBoundary extends React.Component<\n RenderErrorBoundaryProps,\n RenderErrorBoundaryState\n> {\n constructor(props: RenderErrorBoundaryProps) {\n super(props);\n this.state = {\n location: props.location,\n revalidation: props.revalidation,\n error: props.error,\n };\n }\n\n static getDerivedStateFromError(error: any) {\n return { error: error };\n }\n\n static getDerivedStateFromProps(\n props: RenderErrorBoundaryProps,\n state: RenderErrorBoundaryState\n ) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (\n state.location !== props.location ||\n (state.revalidation !== \"idle\" && props.revalidation === \"idle\")\n ) {\n return {\n error: props.error,\n location: props.location,\n revalidation: props.revalidation,\n };\n }\n\n // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n return {\n error: props.error || state.error,\n location: state.location,\n revalidation: props.revalidation || state.revalidation,\n };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n console.error(\n \"React Router caught the following error during render\",\n error,\n errorInfo\n );\n }\n\n render() {\n return this.state.error ? (\n \n \n \n ) : (\n this.props.children\n );\n }\n}\n\ninterface RenderedRouteProps {\n routeContext: RouteContextObject;\n match: RouteMatch;\n children: React.ReactNode | null;\n}\n\nfunction RenderedRoute({ routeContext, match, children }: RenderedRouteProps) {\n let dataRouterContext = React.useContext(DataRouterContext);\n\n // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n if (\n dataRouterContext &&\n dataRouterContext.static &&\n dataRouterContext.staticContext &&\n (match.route.errorElement || match.route.ErrorBoundary)\n ) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return (\n \n {children}\n \n );\n}\n\nexport function _renderMatches(\n matches: RouteMatch[] | null,\n parentMatches: RouteMatch[] = [],\n dataRouterState: RemixRouter[\"state\"] | null = null\n): React.ReactElement | null {\n if (matches == null) {\n if (dataRouterState?.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches as DataRouteMatch[];\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches;\n\n // If we have data errors, trim matches to the highest error boundary\n let errors = dataRouterState?.errors;\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(\n (m) => m.route.id && errors?.[m.route.id]\n );\n invariant(\n errorIndex >= 0,\n `Could not find a matching route for errors on route IDs: ${Object.keys(\n errors\n ).join(\",\")}`\n );\n renderedMatches = renderedMatches.slice(\n 0,\n Math.min(renderedMatches.length, errorIndex + 1)\n );\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors?.[match.route.id] : null;\n // Only data routers handle errors\n let errorElement: React.ReactNode | null = null;\n if (dataRouterState) {\n errorElement = match.route.errorElement || defaultErrorElement;\n }\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n let getChildren = () => {\n let children: React.ReactNode;\n if (error) {\n children = errorElement;\n } else if (match.route.Component) {\n // Note: This is a de-optimized path since React won't re-use the\n // ReactElement since it's identity changes with each new\n // React.createElement call. We keep this so folks can use\n // `` in `` but generally `Component`\n // usage is only advised in `RouterProvider` when we can convert it to\n // `element` ahead of time.\n children = ;\n } else if (match.route.element) {\n children = match.route.element;\n } else {\n children = outlet;\n }\n return (\n \n );\n };\n // Only wrap in an error boundary within data router usages when we have an\n // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to\n // an ancestor ErrorBoundary/errorElement\n return dataRouterState &&\n (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? (\n \n ) : (\n getChildren()\n );\n }, null as React.ReactElement | null);\n}\n\nenum DataRouterHook {\n UseBlocker = \"useBlocker\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n}\n\nenum DataRouterStateHook {\n UseBlocker = \"useBlocker\",\n UseLoaderData = \"useLoaderData\",\n UseActionData = \"useActionData\",\n UseRouteError = \"useRouteError\",\n UseNavigation = \"useNavigation\",\n UseRouteLoaderData = \"useRouteLoaderData\",\n UseMatches = \"useMatches\",\n UseRevalidator = \"useRevalidator\",\n UseNavigateStable = \"useNavigate\",\n UseRouteId = \"useRouteId\",\n}\n\nfunction getDataRouterConsoleError(\n hookName: DataRouterHook | DataRouterStateHook\n) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/routers/picking-a-router.`;\n}\n\nfunction useDataRouterContext(hookName: DataRouterHook) {\n let ctx = React.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\n\nfunction useDataRouterState(hookName: DataRouterStateHook) {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\n\nfunction useRouteContext(hookName: DataRouterStateHook) {\n let route = React.useContext(RouteContext);\n invariant(route, getDataRouterConsoleError(hookName));\n return route;\n}\n\n// Internal version with hookName-aware debugging\nfunction useCurrentRouteId(hookName: DataRouterStateHook) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n invariant(\n thisRoute.route.id,\n `${hookName} can only be used on routes that contain a unique \"id\"`\n );\n return thisRoute.route.id;\n}\n\n/**\n * Returns the ID for the nearest contextual route\n */\nexport function useRouteId() {\n return useCurrentRouteId(DataRouterStateHook.UseRouteId);\n}\n\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\nexport function useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\nexport function useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation,\n };\n}\n\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\nexport function useMatches() {\n let { matches, loaderData } = useDataRouterState(\n DataRouterStateHook.UseMatches\n );\n return React.useMemo(\n () =>\n matches.map((match) => {\n let { pathname, params } = match;\n // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id] as unknown,\n handle: match.route.handle as unknown,\n };\n }),\n [matches, loaderData]\n );\n}\n\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\nexport function useLoaderData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\n `You cannot \\`useLoaderData\\` in an errorElement (routeId: ${routeId})`\n );\n return undefined;\n }\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the loaderData for the given routeId\n */\nexport function useRouteLoaderData(routeId: string): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the action data for the nearest ancestor Route action\n */\nexport function useActionData(): unknown {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n\n let route = React.useContext(RouteContext);\n invariant(route, `useActionData must be used inside a RouteContext`);\n\n return Object.values(state?.actionData || {})[0];\n}\n\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\nexport function useRouteError(): unknown {\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);\n\n // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n if (error) {\n return error;\n }\n\n // Otherwise look for errors from our data router state\n return state.errors?.[routeId];\n}\n\n/**\n * Returns the happy-path data from the nearest ancestor value\n */\nexport function useAsyncValue(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._data;\n}\n\n/**\n * Returns the error from the nearest ancestor value\n */\nexport function useAsyncError(): unknown {\n let value = React.useContext(AwaitContext);\n return value?._error;\n}\n\nlet blockerId = 0;\n\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\nexport function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker {\n let { router, basename } = useDataRouterContext(DataRouterHook.UseBlocker);\n let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n\n let [blockerKey, setBlockerKey] = React.useState(\"\");\n let blockerFunction = React.useCallback(\n (arg) => {\n if (typeof shouldBlock !== \"function\") {\n return !!shouldBlock;\n }\n if (basename === \"/\") {\n return shouldBlock(arg);\n }\n\n // If they provided us a function and we've got an active basename, strip\n // it from the locations we expose to the user to match the behavior of\n // useLocation\n let { currentLocation, nextLocation, historyAction } = arg;\n return shouldBlock({\n currentLocation: {\n ...currentLocation,\n pathname:\n stripBasename(currentLocation.pathname, basename) ||\n currentLocation.pathname,\n },\n nextLocation: {\n ...nextLocation,\n pathname:\n stripBasename(nextLocation.pathname, basename) ||\n nextLocation.pathname,\n },\n historyAction,\n });\n },\n [basename, shouldBlock]\n );\n\n // This effect is in charge of blocker key assignment and deletion (which is\n // tightly coupled to the key)\n React.useEffect(() => {\n let key = String(++blockerId);\n setBlockerKey(key);\n return () => router.deleteBlocker(key);\n }, [router]);\n\n // This effect handles assigning the blockerFunction. This is to handle\n // unstable blocker function identities, and happens only after the prior\n // effect so we don't get an orphaned blockerFunction in the router with a\n // key of \"\". Until then we just have the IDLE_BLOCKER.\n React.useEffect(() => {\n if (blockerKey !== \"\") {\n router.getBlocker(blockerKey, blockerFunction);\n }\n }, [router, blockerKey, blockerFunction]);\n\n // Prefer the blocker from `state` not `router.state` since DataRouterContext\n // is memoized so this ensures we update on blocker state updates\n return blockerKey && state.blockers.has(blockerKey)\n ? state.blockers.get(blockerKey)!\n : IDLE_BLOCKER;\n}\n\n/**\n * Stable version of useNavigate that is used when we are in the context of\n * a RouterProvider.\n */\nfunction useNavigateStable(): NavigateFunction {\n let { router } = useDataRouterContext(DataRouterHook.UseNavigateStable);\n let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);\n\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(activeRef.current, navigateEffectWarning);\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our router subscriber yet\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n router.navigate(to);\n } else {\n router.navigate(to, { fromRouteId: id, ...options });\n }\n },\n [router, id]\n );\n\n return navigate;\n}\n\nconst alreadyWarned: Record = {};\n\nfunction warningOnce(key: string, cond: boolean, message: string) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n warning(false, message);\n }\n}\n","import * as React from \"react\";\nimport type {\n TrackedPromise,\n InitialEntry,\n Location,\n MemoryHistory,\n Router as RemixRouter,\n To,\n LazyRouteFunction,\n RelativeRoutingType,\n RouterState,\n} from \"@remix-run/router\";\nimport {\n Action as NavigationType,\n AbortedDeferredError,\n createMemoryHistory,\n UNSAFE_invariant as invariant,\n parsePath,\n resolveTo,\n stripBasename,\n UNSAFE_warning as warning,\n UNSAFE_getPathContributingMatches as getPathContributingMatches,\n} from \"@remix-run/router\";\n\nimport type {\n DataRouteObject,\n IndexRouteObject,\n RouteMatch,\n RouteObject,\n Navigator,\n NonIndexRouteObject,\n} from \"./context\";\nimport {\n LocationContext,\n NavigationContext,\n DataRouterContext,\n DataRouterStateContext,\n AwaitContext,\n RouteContext,\n} from \"./context\";\nimport {\n useAsyncValue,\n useInRouterContext,\n useNavigate,\n useOutlet,\n useRoutes,\n _renderMatches,\n useRoutesImpl,\n useLocation,\n} from \"./hooks\";\n\nexport interface FutureConfig {\n v7_startTransition: boolean;\n}\n\nexport interface RouterProviderProps {\n fallbackElement?: React.ReactNode;\n router: RemixRouter;\n future?: FutureConfig;\n}\n\n/**\n Webpack + React 17 fails to compile on any of the following because webpack\n complains that `startTransition` doesn't exist in `React`:\n * import { startTransition } from \"react\"\n * import * as React from from \"react\";\n \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n * import * as React from from \"react\";\n \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n Moving it to a constant such as the following solves the Webpack/React 17 issue:\n * import * as React from from \"react\";\n const START_TRANSITION = \"startTransition\";\n START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n However, that introduces webpack/terser minification issues in production builds\n in React 18 where minification/obfuscation ends up removing the call of\n React.startTransition entirely from the first half of the ternary. Grabbing\n this exported reference once up front resolves that issue.\n\n See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nexport function RouterProvider({\n fallbackElement,\n router,\n future,\n}: RouterProviderProps): React.ReactElement {\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/)\n let [state, setStateImpl] = React.useState(router.state);\n let { v7_startTransition } = future || {};\n let setState = React.useCallback(\n (newState: RouterState) => {\n v7_startTransition && startTransitionImpl\n ? startTransitionImpl(() => setStateImpl(newState))\n : setStateImpl(newState);\n },\n [setStateImpl, v7_startTransition]\n );\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n\n let navigator = React.useMemo((): Navigator => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: (n) => router.navigate(n),\n push: (to, state, opts) =>\n router.navigate(to, {\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n replace: (to, state, opts) =>\n router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts?.preventScrollReset,\n }),\n };\n }, [router]);\n\n let basename = router.basename || \"/\";\n\n let dataRouterContext = React.useMemo(\n () => ({\n router,\n navigator,\n static: false,\n basename,\n }),\n [router, navigator, basename]\n );\n\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a