@epic-web/workshop-app 4.20.1 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/build/client/assets/{_-Dfo2h4rl.js → _-DbrWZazo.js} +2 -2
  2. package/build/client/assets/_-DbrWZazo.js.map +1 -0
  3. package/build/client/assets/_exerciseNumber-Cq0nozYz.js +2 -0
  4. package/build/client/assets/_exerciseNumber-Cq0nozYz.js.map +1 -0
  5. package/build/client/assets/{_exerciseNumber_._stepNumber-DpAxO0AM.js → _exerciseNumber_._stepNumber-B5pmJ29o.js} +2 -2
  6. package/build/client/assets/_exerciseNumber_._stepNumber-B5pmJ29o.js.map +1 -0
  7. package/build/client/assets/{_exerciseNumber_.finished-czQBjiVF.js → _exerciseNumber_.finished-Q9qnPuZX.js} +2 -2
  8. package/build/client/assets/_exerciseNumber_.finished-Q9qnPuZX.js.map +1 -0
  9. package/build/client/assets/{_layout-IOROGN78.js → _layout-AgYGL72C.js} +2 -2
  10. package/build/client/assets/_layout-AgYGL72C.js.map +1 -0
  11. package/build/client/assets/_layout-BUs3av-e.js.map +1 -1
  12. package/build/client/assets/{_layout-BrGbNrqb.js → _layout-C8uU4Hwj.js} +2 -2
  13. package/build/client/assets/{_layout-BrGbNrqb.js.map → _layout-C8uU4Hwj.js.map} +1 -1
  14. package/build/client/assets/_layout-DLVrpOki.js +2 -0
  15. package/build/client/assets/_layout-DLVrpOki.js.map +1 -0
  16. package/build/client/assets/accordion-BroSqIct.js +2 -0
  17. package/build/client/assets/accordion-BroSqIct.js.map +1 -0
  18. package/build/client/assets/{account-CQNVYlpT.js → account-7o6O4ruO.js} +2 -2
  19. package/build/client/assets/{account-CQNVYlpT.js.map → account-7o6O4ruO.js.map} +1 -1
  20. package/build/client/assets/app-BiWJY58g.js +2 -0
  21. package/build/client/assets/app-BiWJY58g.js.map +1 -0
  22. package/build/client/assets/{button-DcWUKEqR.js → button-BklqyTPS.js} +2 -2
  23. package/build/client/assets/{button-DcWUKEqR.js.map → button-BklqyTPS.js.map} +1 -1
  24. package/build/client/assets/{client-hints-DWL_Mq1C.js → client-hints-DNUUFGmB.js} +2 -2
  25. package/build/client/assets/{client-hints-DWL_Mq1C.js.map → client-hints-DNUUFGmB.js.map} +1 -1
  26. package/build/client/assets/{components-C17zb3Us.js → components-CME-nGId.js} +2 -2
  27. package/build/client/assets/{components-C17zb3Us.js.map → components-CME-nGId.js.map} +1 -1
  28. package/build/client/assets/diff-CpFxuKA2.js +2 -0
  29. package/build/client/assets/diff-CpFxuKA2.js.map +1 -0
  30. package/build/client/assets/diff-Cw8ktQ1-.js +2 -0
  31. package/build/client/assets/{diff-DBQZWFaQ.js.map → diff-Cw8ktQ1-.js.map} +1 -1
  32. package/build/client/assets/discord-CHP4_JLJ.js +2 -0
  33. package/build/client/assets/discord-CHP4_JLJ.js.map +1 -0
  34. package/build/client/assets/{discord-CBGQw7I4.js → discord-Dq4e30wV.js} +2 -2
  35. package/build/client/assets/{discord-CBGQw7I4.js.map → discord-Dq4e30wV.js.map} +1 -1
  36. package/build/client/assets/{entry.client-C1yl0iQe.js → entry.client-3M2p-8I3.js} +2 -2
  37. package/build/client/assets/{entry.client-C1yl0iQe.js.map → entry.client-3M2p-8I3.js.map} +1 -1
  38. package/build/client/assets/{epic-video-DGVKtAan.js → epic-video-iluUs1-s.js} +2 -2
  39. package/build/client/assets/{epic-video-DGVKtAan.js.map → epic-video-iluUs1-s.js.map} +1 -1
  40. package/build/client/assets/{error-boundary-yAXgvsPR.js → error-boundary-DDTvdkB4.js} +2 -2
  41. package/build/client/assets/{error-boundary-yAXgvsPR.js.map → error-boundary-DDTvdkB4.js.map} +1 -1
  42. package/build/client/assets/{finished-DQ70NSmN.js → finished-Bm-bCUU2.js} +2 -2
  43. package/build/client/assets/{finished-DQ70NSmN.js.map → finished-Bm-bCUU2.js.map} +1 -1
  44. package/build/client/assets/{index-B9w5akmN.js → index-B-hHvmeV.js} +2 -2
  45. package/build/client/assets/{index-B9w5akmN.js.map → index-B-hHvmeV.js.map} +1 -1
  46. package/build/client/assets/{index-Dc-1lfub.js → index-BATSX33w.js} +2 -2
  47. package/build/client/assets/{index-Dc-1lfub.js.map → index-BATSX33w.js.map} +1 -1
  48. package/build/client/assets/{index-DC4pM5aW.js → index-BXWoOGxB.js} +4 -4
  49. package/build/client/assets/{index-DC4pM5aW.js.map → index-BXWoOGxB.js.map} +1 -1
  50. package/build/client/assets/index-Dm1ll1kT.js +2 -0
  51. package/build/client/assets/index-Dm1ll1kT.js.map +1 -0
  52. package/build/client/assets/{index-yQg0GLtS.js → index-Tfdnz1AB.js} +2 -2
  53. package/build/client/assets/{index-yQg0GLtS.js.map → index-Tfdnz1AB.js.map} +1 -1
  54. package/build/client/assets/index-hogig2HK.js +2 -0
  55. package/build/client/assets/index-hogig2HK.js.map +1 -0
  56. package/build/client/assets/{loading-C4Cc1EBG.js → loading-C5uX0jJw.js} +2 -2
  57. package/build/client/assets/{loading-C4Cc1EBG.js.map → loading-C5uX0jJw.js.map} +1 -1
  58. package/build/client/assets/{login-Bimq6Ilz.js → login-4cvVFzF8.js} +2 -2
  59. package/build/client/assets/{login-Bimq6Ilz.js.map → login-4cvVFzF8.js.map} +1 -1
  60. package/build/client/assets/manifest-746b2907.js +1 -0
  61. package/build/client/assets/{mdx-Cb7iYGhg.js → mdx-M0kcP-mP.js} +2 -2
  62. package/build/client/assets/{mdx-Cb7iYGhg.js.map → mdx-M0kcP-mP.js.map} +1 -1
  63. package/build/client/assets/{misc-Bt-_bj1O.js → misc-ENVX3CWf.js} +2 -2
  64. package/build/client/assets/{misc-Bt-_bj1O.js.map → misc-ENVX3CWf.js.map} +1 -1
  65. package/build/client/assets/{nav-chevrons-DIhkJv4W.js → nav-chevrons-B82nbdyj.js} +2 -2
  66. package/build/client/assets/{nav-chevrons-DIhkJv4W.js.map → nav-chevrons-B82nbdyj.js.map} +1 -1
  67. package/build/client/assets/{onboarding-CU7IWhDE.js → onboarding-Bib-wh6d.js} +2 -2
  68. package/build/client/assets/{onboarding-CU7IWhDE.js.map → onboarding-Bib-wh6d.js.map} +1 -1
  69. package/build/client/assets/presence-Cr--lRCr.js +28 -0
  70. package/build/client/assets/{presence-DgSzsRAv.js.map → presence-Cr--lRCr.js.map} +1 -1
  71. package/build/client/assets/preview-CqrRe2BV.js +2 -0
  72. package/build/client/assets/preview-CqrRe2BV.js.map +1 -0
  73. package/build/client/assets/{progress-C1WSMZl4.js → progress-BsY6hGPp.js} +2 -2
  74. package/build/client/assets/{progress-C1WSMZl4.js.map → progress-BsY6hGPp.js.map} +1 -1
  75. package/build/client/assets/{progress-bar-DMef_aq8.js → progress-bar-CSvo1ZXP.js} +2 -2
  76. package/build/client/assets/{progress-bar-DMef_aq8.js.map → progress-bar-CSvo1ZXP.js.map} +1 -1
  77. package/build/client/assets/{request-info-DU15ezmn.js → request-info-CEhUGODY.js} +2 -2
  78. package/build/client/assets/{request-info-DU15ezmn.js.map → request-info-CEhUGODY.js.map} +1 -1
  79. package/build/client/assets/{root-CX2PgcP9.js → root-Tcnfz99O.js} +3 -3
  80. package/build/client/assets/{root-CX2PgcP9.js.map → root-Tcnfz99O.js.map} +1 -1
  81. package/build/client/assets/set-playground-Cdy8VlVD.js +2 -0
  82. package/build/client/assets/set-playground-Cdy8VlVD.js.map +1 -0
  83. package/build/client/assets/{support-D6UIcaNu.js → support-hcqGIpir.js} +2 -2
  84. package/build/client/assets/{support-D6UIcaNu.js.map → support-hcqGIpir.js.map} +1 -1
  85. package/build/client/assets/tailwind-DTowOebn.css +1 -0
  86. package/build/client/assets/test-D9HsTvpe.js +2 -0
  87. package/build/client/assets/test-D9HsTvpe.js.map +1 -0
  88. package/build/client/assets/tests-CmNNBElK.js +4 -0
  89. package/build/client/assets/tests-CmNNBElK.js.map +1 -0
  90. package/build/client/assets/{tooltip-Cqh5cQvd.js → tooltip-BiHTe_7F.js} +2 -2
  91. package/build/client/assets/{tooltip-Cqh5cQvd.js.map → tooltip-BiHTe_7F.js.map} +1 -1
  92. package/build/client/assets/{user-MNzkRgJ3.js → user-D6tTg1yS.js} +2 -2
  93. package/build/client/assets/{user-MNzkRgJ3.js.map → user-D6tTg1yS.js.map} +1 -1
  94. package/build/client/icons.svg +1 -1
  95. package/build/server/index.js +6144 -5873
  96. package/build/server/index.js.map +1 -1
  97. package/package.json +3 -3
  98. package/build/client/assets/_-Dfo2h4rl.js.map +0 -1
  99. package/build/client/assets/_exerciseNumber-CfKoF9W0.js +0 -2
  100. package/build/client/assets/_exerciseNumber-CfKoF9W0.js.map +0 -1
  101. package/build/client/assets/_exerciseNumber_._stepNumber-DpAxO0AM.js.map +0 -1
  102. package/build/client/assets/_exerciseNumber_.finished-czQBjiVF.js.map +0 -1
  103. package/build/client/assets/_layout-DBCEqk3b.js +0 -4
  104. package/build/client/assets/_layout-DBCEqk3b.js.map +0 -1
  105. package/build/client/assets/_layout-IOROGN78.js.map +0 -1
  106. package/build/client/assets/diff-CCCucBoq.js +0 -2
  107. package/build/client/assets/diff-CCCucBoq.js.map +0 -1
  108. package/build/client/assets/diff-DBQZWFaQ.js +0 -2
  109. package/build/client/assets/discord-CULpXzAC.js +0 -2
  110. package/build/client/assets/discord-CULpXzAC.js.map +0 -1
  111. package/build/client/assets/manifest-8371b608.js +0 -1
  112. package/build/client/assets/presence-DgSzsRAv.js +0 -28
  113. package/build/client/assets/tailwind-BZciDTNv.css +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tests-CmNNBElK.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/playground-window.tsx","../../../../../node_modules/entities/lib/decode_codepoint.js","../../../../../node_modules/entities/lib/decode.js","../../../../../node_modules/entities/lib/encode.js","../../../../../node_modules/entities/lib/index.js","../../../../../node_modules/ansi-to-html/lib/ansi_to_html.js","../../../app/utils/ansi-text.ts","../../../app/components/in-browser-test-runner.tsx","../../../app/routes/test.tsx","../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/tests.tsx"],"sourcesContent":["import { Icon } from '#app/components/icons'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.js'\nimport { PlaygroundChooser, SetPlayground } from '#app/routes/set-playground'\n\nexport function PlaygroundWindow({\n\tplaygroundAppName,\n\tproblemAppName,\n\tisUpToDate,\n\tallApps,\n\tchildren,\n}: {\n\tplaygroundAppName?: string\n\tproblemAppName?: string\n\tisUpToDate: boolean\n\tallApps: Array<{ name: string; displayName: string }>\n\tchildren: React.ReactNode\n}) {\n\tconst isCorrectApp = playgroundAppName === problemAppName\n\tconst playgroundLinkedUI =\n\t\tisCorrectApp && isUpToDate ? (\n\t\t\t<Icon size=\"xl\" name=\"Linked\" />\n\t\t) : (\n\t\t\t<Icon\n\t\t\t\tsize=\"xl\"\n\t\t\t\tname=\"Unlinked\"\n\t\t\t\tclassName=\"animate-pulse text-foreground-danger\"\n\t\t\t/>\n\t\t)\n\tlet setPlaygroundTooltipText = 'Click to reset Playground.'\n\tif (!isUpToDate) {\n\t\tsetPlaygroundTooltipText =\n\t\t\t'Playground is out of date. Click to reset Playground.'\n\t}\n\tif (!isCorrectApp) {\n\t\tsetPlaygroundTooltipText =\n\t\t\t'Playground is not set to the right app. Click to set Playground.'\n\t}\n\treturn (\n\t\t<div className=\"flex h-full w-full flex-col justify-between\">\n\t\t\t<div className=\"flex h-14 flex-shrink-0 items-center justify-start gap-2 border-b px-3\">\n\t\t\t\t<div className=\"display-alt-up\">\n\t\t\t\t\t{problemAppName ? (\n\t\t\t\t\t\t<SetPlayground\n\t\t\t\t\t\t\tappName={problemAppName}\n\t\t\t\t\t\t\ttooltipText={setPlaygroundTooltipText}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{playgroundLinkedUI}\n\t\t\t\t\t\t</SetPlayground>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<SimpleTooltip content=\"No problem app available for this step\">\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<Icon name=\"Question\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"display-alt-down\">\n\t\t\t\t\t{playgroundAppName ? (\n\t\t\t\t\t\t<SetPlayground\n\t\t\t\t\t\t\tappName={playgroundAppName}\n\t\t\t\t\t\t\treset\n\t\t\t\t\t\t\ttooltipText=\"Reset Playground\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"flex h-7 w-7 items-center justify-center\">\n\t\t\t\t\t\t\t\t<Icon name=\"Refresh\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</SetPlayground>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div className=\"h-7 w-7\" />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<PlaygroundChooser\n\t\t\t\t\tallApps={allApps}\n\t\t\t\t\tplaygroundAppName={playgroundAppName}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-1 flex-grow items-center justify-center\">\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decode_json_1 = __importDefault(require(\"./maps/decode.json\"));\n// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119\nvar fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.fromCodePoint ||\n function (codePoint) {\n var output = \"\";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n output += String.fromCharCode(codePoint);\n return output;\n };\nfunction decodeCodePoint(codePoint) {\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return \"\\uFFFD\";\n }\n if (codePoint in decode_json_1.default) {\n codePoint = decode_json_1.default[codePoint];\n }\n return fromCodePoint(codePoint);\n}\nexports.default = decodeCodePoint;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;\nvar entities_json_1 = __importDefault(require(\"./maps/entities.json\"));\nvar legacy_json_1 = __importDefault(require(\"./maps/legacy.json\"));\nvar xml_json_1 = __importDefault(require(\"./maps/xml.json\"));\nvar decode_codepoint_1 = __importDefault(require(\"./decode_codepoint\"));\nvar strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\\da-fA-F]+|#\\d+);/g;\nexports.decodeXML = getStrictDecoder(xml_json_1.default);\nexports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);\nfunction getStrictDecoder(map) {\n var replace = getReplacer(map);\n return function (str) { return String(str).replace(strictEntityRe, replace); };\n}\nvar sorter = function (a, b) { return (a < b ? 1 : -1); };\nexports.decodeHTML = (function () {\n var legacy = Object.keys(legacy_json_1.default).sort(sorter);\n var keys = Object.keys(entities_json_1.default).sort(sorter);\n for (var i = 0, j = 0; i < keys.length; i++) {\n if (legacy[j] === keys[i]) {\n keys[i] += \";?\";\n j++;\n }\n else {\n keys[i] += \";\";\n }\n }\n var re = new RegExp(\"&(?:\" + keys.join(\"|\") + \"|#[xX][\\\\da-fA-F]+;?|#\\\\d+;?)\", \"g\");\n var replace = getReplacer(entities_json_1.default);\n function replacer(str) {\n if (str.substr(-1) !== \";\")\n str += \";\";\n return replace(str);\n }\n // TODO consider creating a merged map\n return function (str) { return String(str).replace(re, replacer); };\n})();\nfunction getReplacer(map) {\n return function replace(str) {\n if (str.charAt(1) === \"#\") {\n var secondChar = str.charAt(2);\n if (secondChar === \"X\" || secondChar === \"x\") {\n return decode_codepoint_1.default(parseInt(str.substr(3), 16));\n }\n return decode_codepoint_1.default(parseInt(str.substr(2), 10));\n }\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return map[str.slice(1, -1)] || str;\n };\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;\nvar xml_json_1 = __importDefault(require(\"./maps/xml.json\"));\nvar inverseXML = getInverseObj(xml_json_1.default);\nvar xmlReplacer = getInverseReplacer(inverseXML);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using XML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeXML = getASCIIEncoder(inverseXML);\nvar entities_json_1 = __importDefault(require(\"./maps/entities.json\"));\nvar inverseHTML = getInverseObj(entities_json_1.default);\nvar htmlReplacer = getInverseReplacer(inverseHTML);\n/**\n * Encodes all entities and non-ASCII characters in the input.\n *\n * This includes characters that are valid ASCII characters in HTML documents.\n * For example `#` will be encoded as `&num;`. To get a more compact output,\n * consider using the `encodeNonAsciiHTML` function.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeHTML = getInverse(inverseHTML, htmlReplacer);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in HTML\n * documents using HTML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `&#xfc;`) will be used.\n */\nexports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);\nfunction getInverseObj(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (inverse, name) {\n inverse[obj[name]] = \"&\" + name + \";\";\n return inverse;\n }, {});\n}\nfunction getInverseReplacer(inverse) {\n var single = [];\n var multiple = [];\n for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) {\n var k = _a[_i];\n if (k.length === 1) {\n // Add value to single array\n single.push(\"\\\\\" + k);\n }\n else {\n // Add value to multiple array\n multiple.push(k);\n }\n }\n // Add ranges to single characters.\n single.sort();\n for (var start = 0; start < single.length - 1; start++) {\n // Find the end of a run of characters\n var end = start;\n while (end < single.length - 1 &&\n single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) {\n end += 1;\n }\n var count = 1 + end - start;\n // We want to replace at least three characters\n if (count < 3)\n continue;\n single.splice(start, count, single[start] + \"-\" + single[end]);\n }\n multiple.unshift(\"[\" + single.join(\"\") + \"]\");\n return new RegExp(multiple.join(\"|\"), \"g\");\n}\n// /[^\\0-\\x7F]/gu\nvar reNonASCII = /(?:[\\x80-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g;\nvar getCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.prototype.codePointAt != null\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n function (str) { return str.codePointAt(0); }\n : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n function (c) {\n return (c.charCodeAt(0) - 0xd800) * 0x400 +\n c.charCodeAt(1) -\n 0xdc00 +\n 0x10000;\n };\nfunction singleCharReplacer(c) {\n return \"&#x\" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0))\n .toString(16)\n .toUpperCase() + \";\";\n}\nfunction getInverse(inverse, re) {\n return function (data) {\n return data\n .replace(re, function (name) { return inverse[name]; })\n .replace(reNonASCII, singleCharReplacer);\n };\n}\nvar reEscapeChars = new RegExp(xmlReplacer.source + \"|\" + reNonASCII.source, \"g\");\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using numeric hexadecimal reference (eg. `&#xfc;`).\n *\n * Have a look at `escapeUTF8` if you want a more concise output at the expense\n * of reduced transportability.\n *\n * @param data String to escape.\n */\nfunction escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}\nexports.escape = escape;\n/**\n * Encodes all characters not valid in XML documents using numeric hexadecimal\n * reference (eg. `&#xfc;`).\n *\n * Note that the output will be character-set dependent.\n *\n * @param data String to escape.\n */\nfunction escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}\nexports.escapeUTF8 = escapeUTF8;\nfunction getASCIIEncoder(obj) {\n return function (data) {\n return data.replace(reEscapeChars, function (c) { return obj[c] || singleCharReplacer(c); });\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0;\nvar decode_1 = require(\"./decode\");\nvar encode_1 = require(\"./encode\");\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeXML` or `decodeHTML` directly.\n */\nfunction decode(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);\n}\nexports.decode = decode;\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.\n */\nfunction decodeStrict(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);\n}\nexports.decodeStrict = decodeStrict;\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.\n */\nfunction encode(data, level) {\n return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);\n}\nexports.encode = encode;\nvar encode_2 = require(\"./encode\");\nObject.defineProperty(exports, \"encodeXML\", { enumerable: true, get: function () { return encode_2.encodeXML; } });\nObject.defineProperty(exports, \"encodeHTML\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nObject.defineProperty(exports, \"encodeNonAsciiHTML\", { enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } });\nObject.defineProperty(exports, \"escape\", { enumerable: true, get: function () { return encode_2.escape; } });\nObject.defineProperty(exports, \"escapeUTF8\", { enumerable: true, get: function () { return encode_2.escapeUTF8; } });\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, \"encodeHTML4\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nObject.defineProperty(exports, \"encodeHTML5\", { enumerable: true, get: function () { return encode_2.encodeHTML; } });\nvar decode_2 = require(\"./decode\");\nObject.defineProperty(exports, \"decodeXML\", { enumerable: true, get: function () { return decode_2.decodeXML; } });\nObject.defineProperty(exports, \"decodeHTML\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTMLStrict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, \"decodeHTML4\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTML5\", { enumerable: true, get: function () { return decode_2.decodeHTML; } });\nObject.defineProperty(exports, \"decodeHTML4Strict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\nObject.defineProperty(exports, \"decodeHTML5Strict\", { enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } });\nObject.defineProperty(exports, \"decodeXMLStrict\", { enumerable: true, get: function () { return decode_2.decodeXML; } });\n","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\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); }\n\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; }\n\nvar entities = require('entities');\n\nvar defaults = {\n fg: '#FFF',\n bg: '#000',\n newline: false,\n escapeXML: false,\n stream: false,\n colors: getDefaultColors()\n};\n\nfunction getDefaultColors() {\n var colors = {\n 0: '#000',\n 1: '#A00',\n 2: '#0A0',\n 3: '#A50',\n 4: '#00A',\n 5: '#A0A',\n 6: '#0AA',\n 7: '#AAA',\n 8: '#555',\n 9: '#F55',\n 10: '#5F5',\n 11: '#FF5',\n 12: '#55F',\n 13: '#F5F',\n 14: '#5FF',\n 15: '#FFF'\n };\n range(0, 5).forEach(function (red) {\n range(0, 5).forEach(function (green) {\n range(0, 5).forEach(function (blue) {\n return setStyleColor(red, green, blue, colors);\n });\n });\n });\n range(0, 23).forEach(function (gray) {\n var c = gray + 232;\n var l = toHexString(gray * 10 + 8);\n colors[c] = '#' + l + l + l;\n });\n return colors;\n}\n/**\n * @param {number} red\n * @param {number} green\n * @param {number} blue\n * @param {object} colors\n */\n\n\nfunction setStyleColor(red, green, blue, colors) {\n var c = 16 + red * 36 + green * 6 + blue;\n var r = red > 0 ? red * 40 + 55 : 0;\n var g = green > 0 ? green * 40 + 55 : 0;\n var b = blue > 0 ? blue * 40 + 55 : 0;\n colors[c] = toColorHexString([r, g, b]);\n}\n/**\n * Converts from a number like 15 to a hex string like 'F'\n * @param {number} num\n * @returns {string}\n */\n\n\nfunction toHexString(num) {\n var str = num.toString(16);\n\n while (str.length < 2) {\n str = '0' + str;\n }\n\n return str;\n}\n/**\n * Converts from an array of numbers like [15, 15, 15] to a hex string like 'FFF'\n * @param {[red, green, blue]} ref\n * @returns {string}\n */\n\n\nfunction toColorHexString(ref) {\n var results = [];\n\n var _iterator = _createForOfIteratorHelper(ref),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var r = _step.value;\n results.push(toHexString(r));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return '#' + results.join('');\n}\n/**\n * @param {Array} stack\n * @param {string} token\n * @param {*} data\n * @param {object} options\n */\n\n\nfunction generateOutput(stack, token, data, options) {\n var result;\n\n if (token === 'text') {\n result = pushText(data, options);\n } else if (token === 'display') {\n result = handleDisplay(stack, data, options);\n } else if (token === 'xterm256Foreground') {\n result = pushForegroundColor(stack, options.colors[data]);\n } else if (token === 'xterm256Background') {\n result = pushBackgroundColor(stack, options.colors[data]);\n } else if (token === 'rgb') {\n result = handleRgb(stack, data);\n }\n\n return result;\n}\n/**\n * @param {Array} stack\n * @param {string} data\n * @returns {*}\n */\n\n\nfunction handleRgb(stack, data) {\n data = data.substring(2).slice(0, -1);\n var operation = +data.substr(0, 2);\n var color = data.substring(5).split(';');\n var rgb = color.map(function (value) {\n return ('0' + Number(value).toString(16)).substr(-2);\n }).join('');\n return pushStyle(stack, (operation === 38 ? 'color:#' : 'background-color:#') + rgb);\n}\n/**\n * @param {Array} stack\n * @param {number} code\n * @param {object} options\n * @returns {*}\n */\n\n\nfunction handleDisplay(stack, code, options) {\n code = parseInt(code, 10);\n var codeMap = {\n '-1': function _() {\n return '<br/>';\n },\n 0: function _() {\n return stack.length && resetStyles(stack);\n },\n 1: function _() {\n return pushTag(stack, 'b');\n },\n 3: function _() {\n return pushTag(stack, 'i');\n },\n 4: function _() {\n return pushTag(stack, 'u');\n },\n 8: function _() {\n return pushStyle(stack, 'display:none');\n },\n 9: function _() {\n return pushTag(stack, 'strike');\n },\n 22: function _() {\n return pushStyle(stack, 'font-weight:normal;text-decoration:none;font-style:normal');\n },\n 23: function _() {\n return closeTag(stack, 'i');\n },\n 24: function _() {\n return closeTag(stack, 'u');\n },\n 39: function _() {\n return pushForegroundColor(stack, options.fg);\n },\n 49: function _() {\n return pushBackgroundColor(stack, options.bg);\n },\n 53: function _() {\n return pushStyle(stack, 'text-decoration:overline');\n }\n };\n var result;\n\n if (codeMap[code]) {\n result = codeMap[code]();\n } else if (4 < code && code < 7) {\n result = pushTag(stack, 'blink');\n } else if (29 < code && code < 38) {\n result = pushForegroundColor(stack, options.colors[code - 30]);\n } else if (39 < code && code < 48) {\n result = pushBackgroundColor(stack, options.colors[code - 40]);\n } else if (89 < code && code < 98) {\n result = pushForegroundColor(stack, options.colors[8 + (code - 90)]);\n } else if (99 < code && code < 108) {\n result = pushBackgroundColor(stack, options.colors[8 + (code - 100)]);\n }\n\n return result;\n}\n/**\n * Clear all the styles\n * @returns {string}\n */\n\n\nfunction resetStyles(stack) {\n var stackClone = stack.slice(0);\n stack.length = 0;\n return stackClone.reverse().map(function (tag) {\n return '</' + tag + '>';\n }).join('');\n}\n/**\n * Creates an array of numbers ranging from low to high\n * @param {number} low\n * @param {number} high\n * @returns {Array}\n * @example range(3, 7); // creates [3, 4, 5, 6, 7]\n */\n\n\nfunction range(low, high) {\n var results = [];\n\n for (var j = low; j <= high; j++) {\n results.push(j);\n }\n\n return results;\n}\n/**\n * Returns a new function that is true if value is NOT the same category\n * @param {string} category\n * @returns {function}\n */\n\n\nfunction notCategory(category) {\n return function (e) {\n return (category === null || e.category !== category) && category !== 'all';\n };\n}\n/**\n * Converts a code into an ansi token type\n * @param {number} code\n * @returns {string}\n */\n\n\nfunction categoryForCode(code) {\n code = parseInt(code, 10);\n var result = null;\n\n if (code === 0) {\n result = 'all';\n } else if (code === 1) {\n result = 'bold';\n } else if (2 < code && code < 5) {\n result = 'underline';\n } else if (4 < code && code < 7) {\n result = 'blink';\n } else if (code === 8) {\n result = 'hide';\n } else if (code === 9) {\n result = 'strike';\n } else if (29 < code && code < 38 || code === 39 || 89 < code && code < 98) {\n result = 'foreground-color';\n } else if (39 < code && code < 48 || code === 49 || 99 < code && code < 108) {\n result = 'background-color';\n }\n\n return result;\n}\n/**\n * @param {string} text\n * @param {object} options\n * @returns {string}\n */\n\n\nfunction pushText(text, options) {\n if (options.escapeXML) {\n return entities.encodeXML(text);\n }\n\n return text;\n}\n/**\n * @param {Array} stack\n * @param {string} tag\n * @param {string} [style='']\n * @returns {string}\n */\n\n\nfunction pushTag(stack, tag, style) {\n if (!style) {\n style = '';\n }\n\n stack.push(tag);\n return \"<\".concat(tag).concat(style ? \" style=\\\"\".concat(style, \"\\\"\") : '', \">\");\n}\n/**\n * @param {Array} stack\n * @param {string} style\n * @returns {string}\n */\n\n\nfunction pushStyle(stack, style) {\n return pushTag(stack, 'span', style);\n}\n\nfunction pushForegroundColor(stack, color) {\n return pushTag(stack, 'span', 'color:' + color);\n}\n\nfunction pushBackgroundColor(stack, color) {\n return pushTag(stack, 'span', 'background-color:' + color);\n}\n/**\n * @param {Array} stack\n * @param {string} style\n * @returns {string}\n */\n\n\nfunction closeTag(stack, style) {\n var last;\n\n if (stack.slice(-1)[0] === style) {\n last = stack.pop();\n }\n\n if (last) {\n return '</' + style + '>';\n }\n}\n/**\n * @param {string} text\n * @param {object} options\n * @param {function} callback\n * @returns {Array}\n */\n\n\nfunction tokenize(text, options, callback) {\n var ansiMatch = false;\n var ansiHandler = 3;\n\n function remove() {\n return '';\n }\n\n function removeXterm256Foreground(m, g1) {\n callback('xterm256Foreground', g1);\n return '';\n }\n\n function removeXterm256Background(m, g1) {\n callback('xterm256Background', g1);\n return '';\n }\n\n function newline(m) {\n if (options.newline) {\n callback('display', -1);\n } else {\n callback('text', m);\n }\n\n return '';\n }\n\n function ansiMess(m, g1) {\n ansiMatch = true;\n\n if (g1.trim().length === 0) {\n g1 = '0';\n }\n\n g1 = g1.trimRight(';').split(';');\n\n var _iterator2 = _createForOfIteratorHelper(g1),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var g = _step2.value;\n callback('display', g);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return '';\n }\n\n function realText(m) {\n callback('text', m);\n return '';\n }\n\n function rgb(m) {\n callback('rgb', m);\n return '';\n }\n /* eslint no-control-regex:0 */\n\n\n var tokens = [{\n pattern: /^\\x08+/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[[012]?K/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[\\(B/,\n sub: remove\n }, {\n pattern: /^\\x1b\\[[34]8;2;\\d+;\\d+;\\d+m/,\n sub: rgb\n }, {\n pattern: /^\\x1b\\[38;5;(\\d+)m/,\n sub: removeXterm256Foreground\n }, {\n pattern: /^\\x1b\\[48;5;(\\d+)m/,\n sub: removeXterm256Background\n }, {\n pattern: /^\\n/,\n sub: newline\n }, {\n pattern: /^\\r+\\n/,\n sub: newline\n }, {\n pattern: /^\\r/,\n sub: newline\n }, {\n pattern: /^\\x1b\\[((?:\\d{1,3};?)+|)m/,\n sub: ansiMess\n }, {\n // CSI n J\n // ED - Erase in Display Clears part of the screen.\n // If n is 0 (or missing), clear from cursor to end of screen.\n // If n is 1, clear from cursor to beginning of the screen.\n // If n is 2, clear entire screen (and moves cursor to upper left on DOS ANSI.SYS).\n // If n is 3, clear entire screen and delete all lines saved in the scrollback buffer\n // (this feature was added for xterm and is supported by other terminal applications).\n pattern: /^\\x1b\\[\\d?J/,\n sub: remove\n }, {\n // CSI n ; m f\n // HVP - Horizontal Vertical Position Same as CUP\n pattern: /^\\x1b\\[\\d{0,3};\\d{0,3}f/,\n sub: remove\n }, {\n // catch-all for CSI sequences?\n pattern: /^\\x1b\\[?[\\d;]{0,3}/,\n sub: remove\n }, {\n /**\n * extracts real text - not containing:\n * - `\\x1b' - ESC - escape (Ascii 27)\n * - '\\x08' - BS - backspace (Ascii 8)\n * - `\\n` - Newline - linefeed (LF) (ascii 10)\n * - `\\r` - Windows Carriage Return (CR)\n */\n pattern: /^(([^\\x1b\\x08\\r\\n])+)/,\n sub: realText\n }];\n\n function process(handler, i) {\n if (i > ansiHandler && ansiMatch) {\n return;\n }\n\n ansiMatch = false;\n text = text.replace(handler.pattern, handler.sub);\n }\n\n var results1 = [];\n var _text = text,\n length = _text.length;\n\n outer: while (length > 0) {\n for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) {\n var handler = tokens[i];\n process(handler, i);\n\n if (text.length !== length) {\n // We matched a token and removed it from the text. We need to\n // start matching *all* tokens against the new text.\n length = text.length;\n continue outer;\n }\n }\n\n if (text.length === length) {\n break;\n }\n\n results1.push(0);\n length = text.length;\n }\n\n return results1;\n}\n/**\n * If streaming, then the stack is \"sticky\"\n *\n * @param {Array} stickyStack\n * @param {string} token\n * @param {*} data\n * @returns {Array}\n */\n\n\nfunction updateStickyStack(stickyStack, token, data) {\n if (token !== 'text') {\n stickyStack = stickyStack.filter(notCategory(categoryForCode(data)));\n stickyStack.push({\n token: token,\n data: data,\n category: categoryForCode(data)\n });\n }\n\n return stickyStack;\n}\n\nvar Filter = /*#__PURE__*/function () {\n /**\n * @param {object} options\n * @param {string=} options.fg The default foreground color used when reset color codes are encountered.\n * @param {string=} options.bg The default background color used when reset color codes are encountered.\n * @param {boolean=} options.newline Convert newline characters to `<br/>`.\n * @param {boolean=} options.escapeXML Generate HTML/XML entities.\n * @param {boolean=} options.stream Save style state across invocations of `toHtml()`.\n * @param {(string[] | {[code: number]: string})=} options.colors Can override specific colors or the entire ANSI palette.\n */\n function Filter(options) {\n _classCallCheck(this, Filter);\n\n options = options || {};\n\n if (options.colors) {\n options.colors = Object.assign({}, defaults.colors, options.colors);\n }\n\n this.options = Object.assign({}, defaults, options);\n this.stack = [];\n this.stickyStack = [];\n }\n /**\n * @param {string | string[]} input\n * @returns {string}\n */\n\n\n _createClass(Filter, [{\n key: \"toHtml\",\n value: function toHtml(input) {\n var _this = this;\n\n input = typeof input === 'string' ? [input] : input;\n var stack = this.stack,\n options = this.options;\n var buf = [];\n this.stickyStack.forEach(function (element) {\n var output = generateOutput(stack, element.token, element.data, options);\n\n if (output) {\n buf.push(output);\n }\n });\n tokenize(input.join(''), options, function (token, data) {\n var output = generateOutput(stack, token, data, options);\n\n if (output) {\n buf.push(output);\n }\n\n if (options.stream) {\n _this.stickyStack = updateStickyStack(_this.stickyStack, token, data);\n }\n });\n\n if (stack.length) {\n buf.push(resetStyles(stack));\n }\n\n return buf.join('');\n }\n }]);\n\n return Filter;\n}();\n\nmodule.exports = Filter;\n//# sourceMappingURL=ansi_to_html.js.map","import AnsiToHTML from 'ansi-to-html'\nimport { useMemo } from 'react'\nimport { useTheme } from '#app/routes/theme/index.js'\n\nexport function useAnsiToHtml() {\n\tconst theme = useTheme()\n\tconst ansi = useMemo(\n\t\t() =>\n\t\t\tnew AnsiToHTML(\n\t\t\t\ttheme === 'dark'\n\t\t\t\t\t? { fg: '#d6deeb', bg: '#121318', escapeXML: true }\n\t\t\t\t\t: { fg: '#000000', bg: '#f3f3f3', escapeXML: true },\n\t\t\t),\n\t\t[theme],\n\t)\n\treturn ansi\n}\n","import * as Accordion from '@radix-ui/react-accordion'\nimport { useEffect, useRef, useState } from 'react'\nimport { z } from 'zod'\nimport AccordionComponent from '#app/components/accordion.tsx'\nimport { useAnsiToHtml } from '#app/utils/ansi-text.js'\nimport { AnimatedBars, Icon } from './icons.tsx'\n\nconst testRunnerStatusDataSchema = z.intersection(\n\tz.object({\n\t\ttype: z.literal('epicshop:test-status-update'),\n\t\ttimestamp: z.number(),\n\t}),\n\tz.union([\n\t\tz.object({ status: z.literal('pending') }),\n\t\tz.object({ status: z.literal('pass') }),\n\t\tz.object({ status: z.literal('fail'), error: z.string() }),\n\t]),\n)\n\nconst testRunnerTestStepDataSchema = z.object({\n\ttype: z.literal('epicshop:test-step-update'),\n\tstatus: z.literal('pass'),\n\ttitle: z.string(),\n\ttimestamp: z.number(),\n})\n\nconst testRunnerDataSchema = z.union([\n\ttestRunnerTestStepDataSchema,\n\ttestRunnerStatusDataSchema,\n])\n\ntype TestRunnerStatusData = z.infer<typeof testRunnerStatusDataSchema>\ntype TestRunnerTestStepData = z.infer<typeof testRunnerTestStepDataSchema>\n\nexport function InBrowserTestRunner({\n\tpathname,\n\ttestFile,\n}: {\n\tpathname: string\n\ttestFile: string\n}) {\n\tconst ansi = useAnsiToHtml()\n\tconst iframeRef = useRef<HTMLIFrameElement>(null)\n\tconst [message, setMessage] = useState<TestRunnerStatusData | null>(null)\n\tconst [testSteps, setTestSteps] = useState<Array<TestRunnerTestStepData>>([])\n\n\tuseEffect(() => {\n\t\tfunction handleMessage(messageEvent: MessageEvent) {\n\t\t\tif (messageEvent.source !== iframeRef.current?.contentWindow) return\n\t\t\tif ('request' in messageEvent.data) return\n\n\t\t\tconst result = testRunnerDataSchema.safeParse(messageEvent.data, {\n\t\t\t\tpath: ['messageEvent', 'data'],\n\t\t\t})\n\t\t\tif (!result.success) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Invalid message from test iframe`,\n\t\t\t\t\tmessageEvent.data,\n\t\t\t\t\tresult.error,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { data } = result\n\t\t\tif (data.type === 'epicshop:test-status-update') {\n\t\t\t\tif (data.status === 'pending') {\n\t\t\t\t\tsetTestSteps([])\n\t\t\t\t}\n\t\t\t\tsetMessage(data)\n\t\t\t}\n\t\t\tif (data.type === 'epicshop:test-step-update') {\n\t\t\t\tsetTestSteps((steps) => [...steps, data])\n\t\t\t}\n\t\t}\n\t\twindow.addEventListener('message', handleMessage)\n\t\treturn () => {\n\t\t\twindow.removeEventListener('message', handleMessage)\n\t\t}\n\t}, [])\n\n\tconst statusEmoji = {\n\t\tpending: <AnimatedBars aria-label=\"Pending\" />,\n\t\tpass: (\n\t\t\t<Icon\n\t\t\t\tname=\"CheckSmall\"\n\t\t\t\taria-label=\"Passed\"\n\t\t\t\tclassName=\"text-emerald-700\"\n\t\t\t/>\n\t\t),\n\t\tfail: (\n\t\t\t<Icon\n\t\t\t\tname=\"Remove\"\n\t\t\t\taria-label=\"Failed\"\n\t\t\t\tclassName=\"text-foreground-danger\"\n\t\t\t/>\n\t\t),\n\t\tunknown: (\n\t\t\t<Icon name=\"Question\" aria-label=\"Unknown\" className=\"animate-pulse\" />\n\t\t),\n\t}[message?.status ?? 'unknown']\n\n\tconst sortedTestSteps = testSteps.sort((a, b) => a.timestamp - b.timestamp)\n\tconst testStepStatusEmojis = {\n\t\tpass: <Icon name=\"CheckSmall\" aria-label=\"Passed\" />,\n\t\tfail: <Icon name=\"Remove\" aria-label=\"Failed\" />,\n\t\tunknown: (\n\t\t\t<Icon name=\"Question\" aria-label=\"Unknown\" className=\"animate-pulse\" />\n\t\t),\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Accordion.Root className=\"w-full\" type=\"multiple\">\n\t\t\t\t<AccordionComponent\n\t\t\t\t\ticon={statusEmoji}\n\t\t\t\t\ttitle={testFile}\n\t\t\t\t\tforceMount={true}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"not-prose\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-2 p-5 pt-3\">\n\t\t\t\t\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t{sortedTestSteps.map((testStep, index) => (\n\t\t\t\t\t\t\t\t\t// sometimes the steps come in so fast that the timestamp is the same\n\t\t\t\t\t\t\t\t\t<li key={testStep.timestamp + testStep.title}>\n\t\t\t\t\t\t\t\t\t\t<div className=\"flex items-baseline gap-2 text-emerald-700\">\n\t\t\t\t\t\t\t\t\t\t\t<span>{index + 1}.</span>\n\t\t\t\t\t\t\t\t\t\t\t<span>{testStepStatusEmojis[testStep.status]}</span>\n\t\t\t\t\t\t\t\t\t\t\t<pre className=\"max-h-48 overflow-y-auto p-4 scrollbar-thin scrollbar-thumb-scrollbar\">\n\t\t\t\t\t\t\t\t\t\t\t\t{testStep.title}\n\t\t\t\t\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t{message?.status === 'fail' ? (\n\t\t\t\t\t\t\t\t<div className=\"flex items-baseline gap-2 text-foreground-danger\">\n\t\t\t\t\t\t\t\t\t<span>{sortedTestSteps.length + 1}.</span>\n\t\t\t\t\t\t\t\t\t<span>{testStepStatusEmojis.fail}</span>\n\t\t\t\t\t\t\t\t\t<pre\n\t\t\t\t\t\t\t\t\t\tclassName=\"max-h-48 overflow-y-auto p-4 scrollbar-thin scrollbar-thumb-scrollbar\"\n\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t__html: ansi.toHtml(message.error),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\t\tref={iframeRef}\n\t\t\t\t\t\t\t\ttitle={testFile}\n\t\t\t\t\t\t\t\tsrc={pathname + testFile}\n\t\t\t\t\t\t\t\tclassName=\"mt-5 min-h-[420px] w-full border bg-white\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"flex border-y\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\tiframeRef.current?.contentWindow?.location.reload()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName=\"border-r p-3\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"Refresh\" aria-label=\"Rerun Tests\" />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={pathname + testFile}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noreferrer\"\n\t\t\t\t\t\t\t\tclassName=\"border-r p-3\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon name=\"ExternalLink\" aria-label=\"Open in New Window\" />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</AccordionComponent>\n\t\t\t</Accordion.Root>\n\t\t</>\n\t)\n}\n","import { getAppByName } from '@epic-web/workshop-utils/apps.server'\nimport {\n\tclearTestProcessEntry,\n\tgetTestProcessEntry,\n\tisTestRunning,\n\trunAppTests,\n} from '@epic-web/workshop-utils/process-manager.server'\nimport {\n\tjson,\n\ttype ActionFunctionArgs,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { useFetcher } from '@remix-run/react'\nimport { useEffect, useReducer, useRef } from 'react'\nimport { useEventSource } from 'remix-utils/sse/react'\nimport { eventStream } from 'remix-utils/sse/server'\nimport { z } from 'zod'\nimport { AnimatedBars, Icon } from '#app/components/icons.tsx'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.tsx'\nimport { useAnsiToHtml } from '#app/utils/ansi-text.js'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\n\nconst testActionSchema = z.union([\n\tz.object({\n\t\tintent: z.literal('run'),\n\t\tname: z.string(),\n\t}),\n\tz.object({\n\t\tintent: z.literal('stop'),\n\t\tname: z.string(),\n\t}),\n\tz.object({\n\t\tintent: z.literal('clear'),\n\t\tname: z.string(),\n\t}),\n])\n\nconst testEventSchema = z.union([\n\tz.object({\n\t\ttype: z.literal('init'),\n\t\texitCode: z.number().nullable().optional(),\n\t\tisRunning: z.boolean(),\n\t\toutput: z.array(\n\t\t\tz.object({\n\t\t\t\ttype: z.union([z.literal('stdout'), z.literal('stderr')]),\n\t\t\t\tcontent: z.string(),\n\t\t\t\ttimestamp: z.number(),\n\t\t\t}),\n\t\t),\n\t}),\n\tz.object({\n\t\ttype: z.union([z.literal('stdout'), z.literal('stderr')]),\n\t\tdata: z.string(),\n\t\ttimestamp: z.number(),\n\t}),\n\tz.object({\n\t\ttype: z.literal('exit'),\n\t\tisRunning: z.literal(false),\n\t\tcode: z.number().nullable(),\n\t}),\n])\nconst testEventQueueSchema = z.array(testEventSchema)\n\ntype TestEvent = z.infer<typeof testEventSchema>\ntype TestEventQueue = z.infer<typeof testEventQueueSchema>\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\tconst url = new URL(request.url)\n\tconst name = url.searchParams.get('name')\n\tif (!name) {\n\t\treturn json({ error: 'Missing name' }, { status: 400 })\n\t}\n\tconst app = await getAppByName(name)\n\tif (!app) {\n\t\treturn json({ error: 'App not found' }, { status: 404 })\n\t}\n\tconst processEntry = getTestProcessEntry(app)\n\tif (!processEntry) {\n\t\treturn json({ error: 'App is not running tests' }, { status: 404 })\n\t}\n\treturn eventStream(request.signal, function setup(send) {\n\t\t// have to batch because the client may miss events if we send too many\n\t\t// too rapidly\n\t\tlet queue: TestEventQueue = []\n\t\tfunction sendEvent(event: TestEvent) {\n\t\t\tqueue.push(event)\n\t\t}\n\t\tconst interval = setInterval(() => {\n\t\t\tif (queue.length) {\n\t\t\t\tsend({ data: JSON.stringify(queue) })\n\t\t\t\tqueue = []\n\t\t\t}\n\t\t}, 10)\n\n\t\tconst isRunning = isTestRunning(app)\n\n\t\tsendEvent({\n\t\t\ttype: 'init',\n\t\t\texitCode: processEntry.exitCode,\n\t\t\tisRunning,\n\t\t\toutput: processEntry.output.map((line) => ({\n\t\t\t\ttype: line.type,\n\t\t\t\tcontent: line.content,\n\t\t\t\ttimestamp: line.timestamp,\n\t\t\t})),\n\t\t})\n\n\t\tconst testProcess = processEntry.process\n\t\tif (!testProcess) {\n\t\t\treturn () => {}\n\t\t}\n\n\t\tfunction handleStdOutData(data: Buffer) {\n\t\t\tsendEvent({\n\t\t\t\ttype: 'stdout',\n\t\t\t\tdata: data.toString('utf-8'),\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t})\n\t\t}\n\t\tfunction handleStdErrData(data: Buffer) {\n\t\t\tsendEvent({\n\t\t\t\ttype: 'stderr',\n\t\t\t\tdata: data.toString('utf-8'),\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t})\n\t\t}\n\t\tfunction handleExit(code: number) {\n\t\t\ttestProcess?.stdout?.off('data', handleStdOutData)\n\t\t\ttestProcess?.stderr?.off('data', handleStdErrData)\n\t\t\ttestProcess?.off('exit', handleExit)\n\t\t\tsendEvent({ type: 'exit', isRunning: false, code })\n\t\t}\n\t\ttestProcess.stdout?.on('data', handleStdOutData)\n\t\ttestProcess.stderr?.on('data', handleStdErrData)\n\t\ttestProcess.on('exit', handleExit)\n\t\treturn function cleanup() {\n\t\t\ttestProcess.stdout?.off('data', handleStdOutData)\n\t\t\ttestProcess.stderr?.off('data', handleStdErrData)\n\t\t\ttestProcess.off('exit', handleExit)\n\t\t\tclearInterval(interval)\n\t\t}\n\t})\n}\n\nexport async function action({ request }: ActionFunctionArgs) {\n\tensureUndeployed()\n\tconst formData = await request.formData()\n\tconst result = testActionSchema.safeParse({\n\t\tintent: formData.get('intent'),\n\t\tname: formData.get('name'),\n\t})\n\tif (!result.success) {\n\t\treturn json(\n\t\t\t{ success: false, error: result.error.flatten() },\n\t\t\t{ status: 400 },\n\t\t)\n\t}\n\tconst app = await getAppByName(result.data.name)\n\tif (!app) {\n\t\treturn json({ success: false, error: 'App not found' }, { status: 404 })\n\t}\n\tswitch (result.data.intent) {\n\t\tcase 'run': {\n\t\t\tvoid runAppTests(app)\n\t\t\treturn json({ success: true })\n\t\t}\n\t\tcase 'stop': {\n\t\t\tconst processEntry = getTestProcessEntry(app)\n\t\t\tif (processEntry) {\n\t\t\t\tprocessEntry.process?.kill()\n\t\t\t}\n\t\t\treturn json({ success: true })\n\t\t}\n\t\tcase 'clear': {\n\t\t\tclearTestProcessEntry(app)\n\t\t\treturn json({ success: true })\n\t\t}\n\t}\n}\n\nfunction simpleReducer<State>(prev: State, getNext: (prev: State) => State) {\n\treturn getNext(prev)\n}\n\nexport function TestOutput({ name }: { name: string }) {\n\ttype State = {\n\t\t/** version is used to trigger an unsubscribe and resubscribe to the event source */\n\t\tversion: number\n\t\tisRunning: boolean\n\t\texitCode: number | null | undefined\n\t\tlines: Array<{\n\t\t\ttype: 'stdout' | 'stderr'\n\t\t\tcontent: string\n\t\t\ttimestamp: number\n\t\t}>\n\t}\n\tconst [state, dispatch] = useReducer(simpleReducer<State>, {\n\t\tversion: 0,\n\t\tisRunning: false,\n\t\texitCode: undefined,\n\t\tlines: [],\n\t})\n\tconst ansi = useAnsiToHtml()\n\tconst { version, isRunning, exitCode, lines } = state\n\tconst lastMessage = useEventSource(\n\t\t`/test?${new URLSearchParams({ name })}&v=${version}`,\n\t)\n\tuseEffect(() => {\n\t\tif (!lastMessage) return\n\n\t\tconst parsed = JSON.parse(lastMessage)\n\t\tconst result = testEventQueueSchema.safeParse(parsed)\n\t\tif (!result.success) {\n\t\t\tconsole.error(result.error.flatten())\n\t\t\treturn\n\t\t}\n\t\tfor (const event of result.data) {\n\t\t\tswitch (event.type) {\n\t\t\t\tcase 'exit': {\n\t\t\t\t\tconst { isRunning, code: exitCode } = event\n\t\t\t\t\tdispatch((prev) => ({ ...prev, isRunning, exitCode }))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'init': {\n\t\t\t\t\tconst { output, exitCode, isRunning } = event\n\t\t\t\t\tdispatch((prev) => ({ ...prev, lines: output, exitCode, isRunning }))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'stderr':\n\t\t\t\tcase 'stdout': {\n\t\t\t\t\tconst { type, data: content, timestamp } = event\n\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t...prev,\n\t\t\t\t\t\tlines: [...prev.lines, { type, content, timestamp }].sort(\n\t\t\t\t\t\t\t(a, b) => a.timestamp - b.timestamp,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t}))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [lastMessage])\n\n\treturn (\n\t\t<div className=\"relative flex h-full w-full flex-col overflow-y-auto\">\n\t\t\t<div className=\"flex h-12 w-full flex-shrink-0 items-center justify-between border-b\">\n\t\t\t\t<div className=\"flex h-full items-center\">\n\t\t\t\t\t{!isRunning && (\n\t\t\t\t\t\t<TestRunner\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tonRun={() => {\n\t\t\t\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t\t\t\t...prev,\n\t\t\t\t\t\t\t\t\texitCode: undefined,\n\t\t\t\t\t\t\t\t\tlines: [],\n\t\t\t\t\t\t\t\t\tversion: prev.version + 1,\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{isRunning ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"flex h-full flex-grow items-center justify-center border-r px-3.5\">\n\t\t\t\t\t\t\t\t<AnimatedBars role=\"status\" aria-label=\"Running Tests\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<StopTest name={name} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\n\t\t\t\t{!isRunning && exitCode !== undefined && (\n\t\t\t\t\t<p className=\"pr-3.5 leading-none\">\n\t\t\t\t\t\t{exitCode === 0\n\t\t\t\t\t\t\t? `Tests passed`\n\t\t\t\t\t\t\t: `Test failed (exit code ${String(exitCode)})`}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t\t{!isRunning && exitCode !== undefined && (\n\t\t\t\t\t<ClearTest\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tonClear={() => {\n\t\t\t\t\t\t\tdispatch((prev) => ({\n\t\t\t\t\t\t\t\t...prev,\n\t\t\t\t\t\t\t\texitCode: undefined,\n\t\t\t\t\t\t\t\tlines: [],\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<div className=\"flex h-full flex-col gap-5 p-5\">\n\t\t\t\t<p className=\"font-mono text-sm font-medium uppercase\">Test Output</p>\n\t\t\t\t<pre className=\"shadow-on-scrollbox flex-1 overflow-y-scroll scrollbar-thin scrollbar-thumb-scrollbar\">\n\t\t\t\t\t{lines.map((line) => (\n\t\t\t\t\t\t<code\n\t\t\t\t\t\t\tkey={line.timestamp}\n\t\t\t\t\t\t\tdata-type={line.type}\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t__html: ansi.toHtml(line.content),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</pre>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nexport function TestRunner({\n\tname,\n\tonRun,\n}: {\n\tname: string\n\tonRun?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst latestOnRun = useRef(onRun)\n\tuseEffect(() => {\n\t\tlatestOnRun.current = onRun\n\t}, [onRun])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnRun.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Run Tests' : 'Running Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"run\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-r px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"TriangleSmall\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<AnimatedBars role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n\nexport function ClearTest({\n\tname,\n\tonClear,\n}: {\n\tname: string\n\tonClear?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst latestOnClear = useRef(onClear)\n\tuseEffect(() => {\n\t\tlatestOnClear.current = onClear\n\t}, [onClear])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnClear.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Clear Tests' : 'Clearing Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"clear\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-l px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"Clear\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon name=\"Clear\" className=\"animate-pulse\" role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n\nexport function StopTest({\n\tname,\n\tonStop,\n}: {\n\tname: string\n\tonStop?: () => void\n}) {\n\tconst fetcher = useFetcher<typeof action>()\n\tconst latestOnStop = useRef(onStop)\n\tuseEffect(() => {\n\t\tlatestOnStop.current = onStop\n\t}, [onStop])\n\tuseEffect(() => {\n\t\tif (fetcher.data?.success) {\n\t\t\tlatestOnStop.current?.()\n\t\t}\n\t}, [fetcher.data])\n\treturn (\n\t\t<fetcher.Form method=\"POST\" action=\"/test\" className=\"h-full\">\n\t\t\t<input type=\"hidden\" name=\"name\" value={name} />\n\t\t\t<SimpleTooltip\n\t\t\t\tcontent={fetcher.state === 'idle' ? 'Stop Tests' : 'Stopping Tests...'}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tname=\"intent\"\n\t\t\t\t\tvalue=\"stop\"\n\t\t\t\t\tclassName=\"flex h-full flex-grow items-center justify-center border-r px-3.5\"\n\t\t\t\t>\n\t\t\t\t\t{fetcher.state === 'idle' ? (\n\t\t\t\t\t\t<Icon name=\"Stop\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Icon name=\"Stop\" className=\"animate-pulse\" role=\"status\" />\n\t\t\t\t\t)}\n\t\t\t\t</button>\n\t\t\t</SimpleTooltip>\n\t\t</fetcher.Form>\n\t)\n}\n","import { type PlaygroundApp } from '@epic-web/workshop-utils/apps.server'\nimport { useState } from 'react'\nimport { Icon } from '#app/components/icons'\nimport { InBrowserTestRunner } from '#app/components/in-browser-test-runner'\nimport { TestOutput } from '#app/routes/test'\nimport { PlaygroundWindow } from './playground-window'\n\nexport function Tests({\n\tappInfo: playgroundAppInfo,\n\tproblemAppName,\n\tallApps,\n\tisUpToDate,\n}: {\n\tappInfo: Pick<PlaygroundApp, 'appName' | 'name' | 'test'> | null\n\tproblemAppName?: string\n\tallApps: Array<{ name: string; displayName: string }>\n\tisUpToDate: boolean\n}) {\n\treturn (\n\t\t<PlaygroundWindow\n\t\t\tplaygroundAppName={playgroundAppInfo?.appName}\n\t\t\tproblemAppName={problemAppName}\n\t\t\tallApps={allApps}\n\t\t\tisUpToDate={isUpToDate}\n\t\t>\n\t\t\t<TestUI playgroundAppInfo={playgroundAppInfo} />\n\t\t</PlaygroundWindow>\n\t)\n}\n\nexport function TestUI({\n\tplaygroundAppInfo,\n}: {\n\tplaygroundAppInfo: Pick<PlaygroundApp, 'name' | 'test'> | null\n}) {\n\tconst [inBrowserTestKey, setInBrowserTestKey] = useState(0)\n\n\tif (!playgroundAppInfo) {\n\t\treturn (\n\t\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t\t<p>No tests here 😢 Sorry.</p>\n\t\t\t</div>\n\t\t)\n\t}\n\n\tif (playgroundAppInfo.test.type === 'script') {\n\t\treturn <TestOutput name={playgroundAppInfo.name} />\n\t}\n\n\tif (playgroundAppInfo.test.type === 'browser') {\n\t\tconst { pathname } = playgroundAppInfo.test\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName=\"flex h-full w-full flex-grow flex-col overflow-y-auto\"\n\t\t\t\tkey={inBrowserTestKey}\n\t\t\t>\n\t\t\t\t{playgroundAppInfo.test.testFiles.map((testFile) => (\n\t\t\t\t\t<div key={testFile}>\n\t\t\t\t\t\t<InBrowserTestRunner pathname={pathname} testFile={testFile} />\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t\t<div className=\"px-3 py-[21px]\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tonClick={() => setInBrowserTestKey((c) => c + 1)}\n\t\t\t\t\t\tclassName=\"flex items-center gap-2 font-mono text-sm uppercase leading-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon name=\"Refresh\" aria-hidden /> Rerun All Tests\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\n\treturn (\n\t\t<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t<p>No tests here 😢 Sorry.</p>\n\t\t</div>\n\t)\n}\n"],"names":["PlaygroundWindow","playgroundAppName","problemAppName","isUpToDate","allApps","children","isCorrectApp","playgroundLinkedUI","jsx","Icon","setPlaygroundTooltipText","jsxs","SetPlayground","SimpleTooltip","PlaygroundChooser","__importDefault","this","mod","decode_codepoint","decode_json_1","require$$0","fromCodePoint","codePoint","output","decodeCodePoint","decode","entities_json_1","legacy_json_1","require$$1","xml_json_1","require$$2","decode_codepoint_1","require$$3","strictEntityRe","getStrictDecoder","map","replace","getReplacer","str","sorter","a","b","legacy","keys","i","j","re","replacer","secondChar","encode","inverseXML","getInverseObj","xmlReplacer","getInverseReplacer","getASCIIEncoder","inverseHTML","htmlReplacer","getInverse","obj","inverse","name","single","multiple","_i","_a","k","start","end","count","reNonASCII","getCodePoint","c","singleCharReplacer","data","reEscapeChars","escape","escapeUTF8","exports","decode_1","encode_1","level","decodeStrict","encode_2","decode_2","_classCallCheck","instance","Constructor","_defineProperties","target","props","descriptor","_createClass","protoProps","staticProps","_createForOfIteratorHelper","o","allowArrayLike","it","_unsupportedIterableToArray","F","_e","normalCompletion","didErr","err","step","_e2","minLen","_arrayLikeToArray","n","arr","len","arr2","entities","defaults","getDefaultColors","colors","range","red","green","blue","setStyleColor","gray","l","toHexString","r","g","toColorHexString","num","ref","results","_iterator","_step","generateOutput","stack","token","options","result","pushText","handleDisplay","pushForegroundColor","pushBackgroundColor","handleRgb","operation","color","rgb","value","pushStyle","code","codeMap","resetStyles","pushTag","closeTag","stackClone","tag","low","high","notCategory","category","e","categoryForCode","text","style","last","tokenize","callback","ansiMatch","ansiHandler","remove","removeXterm256Foreground","m","g1","removeXterm256Background","newline","ansiMess","_iterator2","_step2","realText","tokens","process","handler","results1","_text","length","outer","updateStickyStack","stickyStack","Filter","input","_this","buf","element","ansi_to_html","useAnsiToHtml","theme","useTheme","useMemo","AnsiToHTML","testRunnerStatusDataSchema","z","testRunnerTestStepDataSchema","testRunnerDataSchema","InBrowserTestRunner","pathname","testFile","ansi","iframeRef","useRef","message","setMessage","useState","testSteps","setTestSteps","useEffect","handleMessage","messageEvent","steps","statusEmoji","AnimatedBars","sortedTestSteps","testStepStatusEmojis","Fragment","Accordion.Root","AccordionComponent","testStep","index","_b","testEventSchema","union","object","type","literal","exitCode","number","nullable","optional","isRunning","boolean","array","content","string","timestamp","testEventQueueSchema","simpleReducer","prev","getNext","TestOutput","state","dispatch","useReducer","version","lines","lastMessage","useEventSource","URLSearchParams","parsed","JSON","parse","safeParse","success","console","error","flatten","event","sort","className","TestRunner","onRun","role","StopTest","String","ClearTest","onClear","line","dangerouslySetInnerHTML","__html","toHtml","fetcher","useFetcher","latestOnRun","current","Form","method","action","latestOnClear","onStop","latestOnStop","Tests","playgroundAppInfo","TestUI","inBrowserTestKey","setInBrowserTestKey"],"mappings":"6bAIO,SAASA,GAAiB,CAChC,kBAAAC,EACA,eAAAC,EACA,WAAAC,EACA,QAAAC,EACA,SAAAC,CACD,EAMG,CACF,MAA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OAAApR,EAAA,KAAC,MAAA,CACA,UAAU,wDAGT,SAAA,CAAAoR,EAAkB,KAAK,UAAU,IAAKpF,GACtCnM,EAAA,IAAC,MACA,CAAA,SAAAA,EAAA,IAACiM,GAAoB,CAAA,SAAAC,EAAoB,SAAAC,CAAoB,CAAA,CAAA,EADpDA,CAEV,CACA,EACDnM,EAAAA,IAAC,MAAI,CAAA,UAAU,iBACd,SAAAG,EAAA,KAAC,SAAA,CACA,QAAS,IAAMuR,EAAqB3N,GAAMA,EAAI,CAAC,EAC/C,UAAU,mEAEV,SAAA,CAAA/D,EAAA,IAACC,EAAK,CAAA,KAAK,UAAU,cAAW,GAAC,EAAE,kBAAA,CAAA,CAAA,EAErC,CAAA,CAAA,EAdKwR,CAAA,CAiBR,CAEA,aACE,MAAI,CAAA,UAAU,kDACd,SAACzR,MAAA,IAAA,CAAE,kCAAuB,CAAA,CAC3B,CAAA,CAEF","x_google_ignoreList":[1,2,3,4,5]}
@@ -1,2 +1,2 @@
1
- import{r as u,j as P,B as tn}from"./index-1cKOJFpX.js";import{r as _e}from"./components-C17zb3Us.js";import{c as nn}from"./misc-Bt-_bj1O.js";function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function on(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function at(...e){return t=>e.forEach(n=>on(n,t))}function J(...e){return u.useCallback(at(...e),e)}function lr(e,t){const n=u.createContext(t);function o(i){const{children:s,...a}=i,c=u.useMemo(()=>a,Object.values(a));return P.jsx(n.Provider,{value:c,children:s})}function r(i){const s=u.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return o.displayName=e+"Provider",[o,r]}function lt(e,t=[]){let n=[];function o(i,s){const a=u.createContext(s),c=n.length;n=[...n,s];function l(d){const{scope:h,children:p,...m}=d,g=(h==null?void 0:h[e][c])||a,x=u.useMemo(()=>m,Object.values(m));return P.jsx(g.Provider,{value:x,children:p})}function f(d,h){const p=(h==null?void 0:h[e][c])||a,m=u.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,f]}const r=()=>{const i=n.map(s=>u.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return u.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,rn(r,...t)]}function rn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...a,...d}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ut=u.forwardRef((e,t)=>{const{children:n,...o}=e,r=u.Children.toArray(n),i=r.find(sn);if(i){const s=i.props.children,a=r.map(c=>c===i?u.Children.count(s)>1?u.Children.only(null):u.isValidElement(s)?s.props.children:null:c);return P.jsx(Te,{...o,ref:t,children:u.isValidElement(s)?u.cloneElement(s,void 0,a):null})}return P.jsx(Te,{...o,ref:t,children:n})});ut.displayName="Slot";var Te=u.forwardRef((e,t)=>{const{children:n,...o}=e;if(u.isValidElement(n)){const r=an(n);return u.cloneElement(n,{...cn(o,n.props),ref:t?at(t,r):r})}return u.Children.count(n)>1?u.Children.only(null):null});Te.displayName="SlotClone";var ft=({children:e})=>P.jsx(P.Fragment,{children:e});function sn(e){return u.isValidElement(e)&&e.type===ft}function cn(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{i(...a),r(...a)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function an(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ln=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Q=ln.reduce((e,t)=>{const n=u.forwardRef((o,r)=>{const{asChild:i,...s}=o,a=i?ut:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(a,{...s,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function un(e,t){e&&_e.flushSync(()=>e.dispatchEvent(t))}function re(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function fn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e);u.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var dn="DismissableLayer",Se="dismissableLayer.update",pn="dismissableLayer.pointerDownOutside",hn="dismissableLayer.focusOutside",Ze,dt=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pt=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...c}=e,l=u.useContext(dt),[f,d]=u.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=u.useState({}),m=J(t,E=>d(E)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=f?g.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,b=xn(E=>{const O=E.target,L=[...l.branches].some(T=>T.contains(O));!w||L||(r==null||r(E),s==null||s(E),E.defaultPrevented||a==null||a())},h),A=vn(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},h);return fn(E=>{y===l.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),u.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ze=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Je(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ze)}},[f,h,n,l]),u.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Je())},[f,l]),u.useEffect(()=>{const E=()=>p({});return document.addEventListener(Se,E),()=>document.removeEventListener(Se,E)},[]),P.jsx(Q.div,{...c,ref:m,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,A.onFocusCapture),onBlurCapture:V(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,b.onPointerDownCapture)})});pt.displayName=dn;var mn="DismissableLayerBranch",gn=u.forwardRef((e,t)=>{const n=u.useContext(dt),o=u.useRef(null),r=J(t,o);return u.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(Q.div,{...e,ref:r})});gn.displayName=mn;function xn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e),o=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let c=function(){ht(pn,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function vn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e),o=u.useRef(!1);return u.useEffect(()=>{const r=i=>{i.target&&!o.current&&ht(hn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Je(){const e=new CustomEvent(Se);document.dispatchEvent(e)}function ht(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?un(r,i):r.dispatchEvent(i)}var te=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},yn=tn.useId||(()=>{}),wn=0;function bn(e){const[t,n]=u.useState(yn());return te(()=>{e||n(o=>o??String(wn++))},[e]),e||(t?`radix-${t}`:"")}const Cn=["top","right","bottom","left"],H=Math.min,W=Math.max,ge=Math.round,pe=Math.floor,G=e=>({x:e,y:e}),En={left:"right",right:"left",bottom:"top",top:"bottom"},Pn={start:"end",end:"start"};function De(e,t,n){return W(e,H(t,n))}function U(e,t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function ie(e){return e.split("-")[1]}function ke(e){return e==="x"?"y":"x"}function je(e){return e==="y"?"height":"width"}function q(e){return["top","bottom"].includes(Y(e))?"y":"x"}function $e(e){return ke(q(e))}function An(e,t,n){n===void 0&&(n=!1);const o=ie(e),r=$e(e),i=je(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xe(s)),[s,xe(s)]}function Rn(e){const t=xe(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.replace(/start|end/g,t=>Pn[t])}function On(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function Tn(e,t,n,o){const r=ie(e);let i=On(Y(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ne)))),i}function xe(e){return e.replace(/left|right|bottom|top/g,t=>En[t])}function Sn(e){return{top:0,right:0,bottom:0,left:0,...e}}function mt(e){return typeof e!="number"?Sn(e):{top:e,right:e,bottom:e,left:e}}function ve(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Qe(e,t,n){let{reference:o,floating:r}=e;const i=q(t),s=$e(t),a=je(s),c=Y(t),l=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let p;switch(c){case"top":p={x:f,y:o.y-r.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(ie(t)){case"start":p[s]-=h*(n&&l?-1:1);break;case"end":p[s]+=h*(n&&l?-1:1);break}return p}const Dn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=Qe(l,o,c),h=o,p={},m=0;for(let g=0;g<a.length;g++){const{name:x,fn:v}=a[g],{x:y,y:C,data:w,reset:b}=await v({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});f=y??f,d=C??d,p={...p,[x]:{...p[x],...w}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:f,y:d}=Qe(l,h,c)),g=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:p}};async function ae(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=U(t,e),m=mt(p),x=a[h?d==="floating"?"reference":"floating":d],v=ve(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},b=ve(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:C,strategy:c}):y);return{top:(v.top-b.top+m.top)/w.y,bottom:(b.bottom-v.bottom+m.bottom)/w.y,left:(v.left-b.left+m.left)/w.x,right:(b.right-v.right+m.right)/w.x}}const Nn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:f=0}=U(e,t)||{};if(l==null)return{};const d=mt(f),h={x:n,y:o},p=$e(r),m=je(p),g=await s.getDimensions(l),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-h[p]-i.floating[m],b=h[p]-i.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=A?A[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(A)))&&(E=a.floating[C]||i.floating[m]);const O=w/2-b/2,L=E/2-g[m]/2-1,T=H(d[v],L),_=H(d[y],L),k=T,j=E-g[m]-_,S=E/2-g[m]/2+O,M=De(k,S,j),$=!c.arrow&&ie(r)!=null&&S!==M&&i.reference[m]/2-(S<k?T:_)-g[m]/2<0,R=$?S<k?S-k:S-j:0;return{[p]:h[p]+R,data:{[p]:M,centerOffset:S-M-R,...$&&{alignmentOffset:R}},reset:$}}}),Ln=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Y(r),y=q(a),C=Y(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),b=h||(C||!g?[xe(a)]:Rn(a)),A=m!=="none";!h&&A&&b.push(...Tn(a,g,m,w));const E=[a,...b],O=await ae(t,x),L=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&L.push(O[v]),d){const S=An(r,s,w);L.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:L}],!L.every(S=>S<=0)){var _,k;const S=(((_=i.flip)==null?void 0:_.index)||0)+1,M=E[S];if(M)return{data:{index:S,overflows:T},reset:{placement:M}};let $=(k=T.filter(R=>R.overflows[0]<=0).sort((R,D)=>R.overflows[1]-D.overflows[1])[0])==null?void 0:k.placement;if(!$)switch(p){case"bestFit":{var j;const R=(j=T.filter(D=>{if(A){const N=q(D.placement);return N===y||N==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(N=>N>0).reduce((N,Re)=>N+Re,0)]).sort((D,N)=>D[1]-N[1])[0])==null?void 0:j[0];R&&($=R);break}case"initialPlacement":$=a;break}if(r!==$)return{reset:{placement:$}}}return{}}}};function et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tt(e){return Cn.some(t=>e[t]>=0)}const Mn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=U(e,t);switch(o){case"referenceHidden":{const i=await ae(t,{...r,elementContext:"reference"}),s=et(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:tt(s)}}}case"escaped":{const i=await ae(t,{...r,altBoundary:!0}),s=et(i,n.floating);return{data:{escapedOffsets:s,escaped:tt(s)}}}default:return{}}}}};async function _n(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Y(n),a=ie(n),c=q(n)==="y",l=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,d=U(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*f,y:h*l}:{x:h*l,y:p*f}}const kn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await _n(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},jn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...c}=U(e,t),l={x:n,y:o},f=await ae(t,c),d=q(Y(r)),h=ke(d);let p=l[h],m=l[d];if(i){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=p+f[x],C=p-f[v];p=De(y,p,C)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=m+f[x],C=m-f[v];m=De(y,m,C)}const g=a.fn({...t,[h]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-o}}}}},$n=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),f={x:n,y:o},d=q(r),h=ke(d);let p=f[h],m=f[d];const g=U(a,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=h==="y"?"height":"width",w=i.reference[h]-i.floating[C]+x.mainAxis,b=i.reference[h]+i.reference[C]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var v,y;const C=h==="y"?"width":"height",w=["top","left"].includes(Y(r)),b=i.reference[d]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),A=i.reference[d]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[d])||0)-(w?x.crossAxis:0);m<b?m=b:m>A&&(m=A)}return{[h]:p,[d]:m}}}},Wn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=U(e,t),c=await ae(t,a),l=Y(n),f=ie(n),d=q(n)==="y",{width:h,height:p}=o.floating;let m,g;l==="top"||l==="bottom"?(m=l,g=f===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=l,m=f==="end"?"top":"bottom");const x=p-c.top-c.bottom,v=h-c.left-c.right,y=H(p-c[m],x),C=H(h-c[g],v),w=!t.middlewareData.shift;let b=y,A=C;if(d?A=f||w?H(C,v):v:b=f||w?H(y,x):x,w&&!f){const O=W(c.left,0),L=W(c.right,0),T=W(c.top,0),_=W(c.bottom,0);d?A=h-2*(O!==0||L!==0?O+L:W(c.left,c.right)):b=p-2*(T!==0||_!==0?T+_:W(c.top,c.bottom))}await s({...t,availableWidth:A,availableHeight:b});const E=await r.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function se(e){return gt(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X(e){var t;return(t=(gt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gt(e){return e instanceof Node||e instanceof I(e).Node}function B(e){return e instanceof Element||e instanceof I(e).Element}function z(e){return e instanceof HTMLElement||e instanceof I(e).HTMLElement}function nt(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function ue(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=F(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function In(e){return["table","td","th"].includes(se(e))}function we(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function We(e){const t=Ie(),n=F(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Fn(e){let t=K(e);for(;z(t)&&!ne(t);){if(we(t))return null;if(We(t))return t;t=K(t)}return null}function Ie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ne(e){return["html","body","#document"].includes(se(e))}function F(e){return I(e).getComputedStyle(e)}function be(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){if(se(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nt(e)&&e.host||X(e);return nt(t)?t.host:t}function xt(e){const t=K(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&ue(t)?t:xt(t)}function le(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=I(r);return i?t.concat(s,s.visualViewport||[],ue(r)?r:[],s.frameElement&&n?le(s.frameElement):[]):t.concat(r,le(r,[],n))}function vt(e){const t=F(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=z(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=ge(n)!==i||ge(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Fe(e){return B(e)?e:e.contextElement}function ee(e){const t=Fe(e);if(!z(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=vt(t);let s=(i?ge(n.width):n.width)/o,a=(i?ge(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Hn=G(0);function yt(e){const t=I(e);return!Ie()||!t.visualViewport?Hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function Z(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Fe(e);let s=G(1);t&&(o?B(o)&&(s=ee(o)):s=ee(e));const a=Bn(i,n,o)?yt(i):G(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,f=r.width/s.x,d=r.height/s.y;if(i){const h=I(i),p=o&&B(o)?I(o):o;let m=h,g=m.frameElement;for(;g&&o&&p!==m;){const x=ee(g),v=g.getBoundingClientRect(),y=F(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,l*=x.y,f*=x.x,d*=x.y,c+=C,l+=w,m=I(g),g=m.frameElement}}return ve({width:f,height:d,x:c,y:l})}function zn(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=X(o),a=t?we(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=G(1);const f=G(0),d=z(o);if((d||!d&&!i)&&((se(o)!=="body"||ue(s))&&(c=be(o)),z(o))){const h=Z(o);l=ee(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x,y:n.y*l.y-c.scrollTop*l.y+f.y}}function Vn(e){return Array.from(e.getClientRects())}function wt(e){return Z(X(e)).left+be(e).scrollLeft}function Un(e){const t=X(e),n=be(e),o=e.ownerDocument.body,r=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+wt(e);const a=-n.scrollTop;return F(o).direction==="rtl"&&(s+=W(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function Yn(e,t){const n=I(e),o=X(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const l=Ie();(!l||l&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:a,y:c}}function Xn(e,t){const n=Z(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=z(e)?ee(e):G(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function ot(e,t,n){let o;if(t==="viewport")o=Yn(e,n);else if(t==="document")o=Un(X(e));else if(B(t))o=Xn(t,n);else{const r=yt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return ve(o)}function bt(e,t){const n=K(e);return n===t||!B(n)||ne(n)?!1:F(n).position==="fixed"||bt(n,t)}function Gn(e,t){const n=t.get(e);if(n)return n;let o=le(e,[],!1).filter(a=>B(a)&&se(a)!=="body"),r=null;const i=F(e).position==="fixed";let s=i?K(e):e;for(;B(s)&&!ne(s);){const a=F(s),c=We(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ue(s)&&!c&&bt(e,s))?o=o.filter(f=>f!==s):r=a,s=K(s)}return t.set(e,o),o}function qn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?we(t)?[]:Gn(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((l,f)=>{const d=ot(t,f,r);return l.top=W(d.top,l.top),l.right=H(d.right,l.right),l.bottom=H(d.bottom,l.bottom),l.left=W(d.left,l.left),l},ot(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Kn(e){const{width:t,height:n}=vt(e);return{width:t,height:n}}function Zn(e,t,n){const o=z(t),r=X(t),i=n==="fixed",s=Z(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=G(0);if(o||!o&&!i)if((se(t)!=="body"||ue(r))&&(a=be(t)),o){const d=Z(t,!0,i,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else r&&(c.x=wt(r));const l=s.left+a.scrollLeft-c.x,f=s.top+a.scrollTop-c.y;return{x:l,y:f,width:s.width,height:s.height}}function Oe(e){return F(e).position==="static"}function rt(e,t){return!z(e)||F(e).position==="fixed"?null:t?t(e):e.offsetParent}function Ct(e,t){const n=I(e);if(we(e))return n;if(!z(e)){let r=K(e);for(;r&&!ne(r);){if(B(r)&&!Oe(r))return r;r=K(r)}return n}let o=rt(e,t);for(;o&&In(o)&&Oe(o);)o=rt(o,t);return o&&ne(o)&&Oe(o)&&!We(o)?n:o||Fn(e)||n}const Jn=async function(e){const t=this.getOffsetParent||Ct,n=this.getDimensions,o=await n(e.floating);return{reference:Zn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Qn(e){return F(e).direction==="rtl"}const eo={convertOffsetParentRelativeRectToViewportRelativeRect:zn,getDocumentElement:X,getClippingRect:qn,getOffsetParent:Ct,getElementRects:Jn,getClientRects:Vn,getDimensions:Kn,getScale:ee,isElement:B,isRTL:Qn};function to(e,t){let n=null,o;const r=X(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:l,top:f,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const p=pe(f),m=pe(r.clientWidth-(l+d)),g=pe(r.clientHeight-(f+h)),x=pe(l),y={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:W(0,H(1,c))||1};let C=!0;function w(b){const A=b[0].intersectionRatio;if(A!==c){if(!C)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function no(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Fe(e),f=r||i?[...l?le(l):[],...le(t)]:[];f.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?to(l,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,g=c?Z(e):null;c&&x();function x(){const v=Z(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,m=requestAnimationFrame(x)}return n(),()=>{var v;f.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const oo=kn,ro=jn,io=Ln,so=Wn,co=Mn,it=Nn,ao=$n,lo=(e,t,n)=>{const o=new Map,r={platform:eo,...n},i={...r.platform,_c:o};return Dn(e,t,{...r,platform:i})};var me=typeof document<"u"?u.useLayoutEffect:u.useEffect;function ye(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!ye(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!ye(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Et(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function st(e,t){const n=Et(e);return Math.round(t*n)/n}function ct(e){const t=u.useRef(e);return me(()=>{t.current=e}),t}function uo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[f,d]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=u.useState(o);ye(h,o)||p(o);const[m,g]=u.useState(null),[x,v]=u.useState(null),y=u.useCallback(R=>{R!==A.current&&(A.current=R,g(R))},[]),C=u.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=i||m,b=s||x,A=u.useRef(null),E=u.useRef(null),O=u.useRef(f),L=c!=null,T=ct(c),_=ct(r),k=u.useCallback(()=>{if(!A.current||!E.current)return;const R={placement:t,strategy:n,middleware:h};_.current&&(R.platform=_.current),lo(A.current,E.current,R).then(D=>{const N={...D,isPositioned:!0};j.current&&!ye(O.current,N)&&(O.current=N,_e.flushSync(()=>{d(N)}))})},[h,t,n,_]);me(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const j=u.useRef(!1);me(()=>(j.current=!0,()=>{j.current=!1}),[]),me(()=>{if(w&&(A.current=w),b&&(E.current=b),w&&b){if(T.current)return T.current(w,b,k);k()}},[w,b,k,T,L]);const S=u.useMemo(()=>({reference:A,floating:E,setReference:y,setFloating:C}),[y,C]),M=u.useMemo(()=>({reference:w,floating:b}),[w,b]),$=u.useMemo(()=>{const R={position:n,left:0,top:0};if(!M.floating)return R;const D=st(M.floating,f.x),N=st(M.floating,f.y);return a?{...R,transform:"translate("+D+"px, "+N+"px)",...Et(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:N}},[n,a,M.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:k,refs:S,elements:M,floatingStyles:$}),[f,k,S,M,$])}const fo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?it({element:o.current,padding:r}).fn(n):{}:o?it({element:o,padding:r}).fn(n):{}}}},po=(e,t)=>({...oo(e),options:[e,t]}),ho=(e,t)=>({...ro(e),options:[e,t]}),mo=(e,t)=>({...ao(e),options:[e,t]}),go=(e,t)=>({...io(e),options:[e,t]}),xo=(e,t)=>({...so(e),options:[e,t]}),vo=(e,t)=>({...co(e),options:[e,t]}),yo=(e,t)=>({...fo(e),options:[e,t]});var wo="Arrow",Pt=u.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return P.jsx(Q.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pt.displayName=wo;var bo=Pt;function Co(e){const[t,n]=u.useState(void 0);return te(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var He="Popper",[At,Rt]=lt(He),[Eo,Ot]=At(He),Tt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=u.useState(null);return P.jsx(Eo,{scope:t,anchor:o,onAnchorChange:r,children:n})};Tt.displayName=He;var St="PopperAnchor",Dt=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Ot(St,n),s=u.useRef(null),a=J(t,s);return u.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:P.jsx(Q.div,{...r,ref:a})});Dt.displayName=St;var Be="PopperContent",[Po,Ao]=At(Be),Nt=u.forwardRef((e,t)=>{var Ve,Ue,Ye,Xe,Ge,qe;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=Ot(Be,n),[v,y]=u.useState(null),C=J(t,ce=>y(ce)),[w,b]=u.useState(null),A=Co(w),E=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,L=o+(i!=="center"?"-"+i:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(l)?l:[l],k=_.length>0,j={padding:T,boundary:_.filter(Oo),altBoundary:k},{refs:S,floatingStyles:M,placement:$,isPositioned:R,middlewareData:D}=uo({strategy:"fixed",placement:L,whileElementsMounted:(...ce)=>no(...ce,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[po({mainAxis:r+O,alignmentAxis:s}),c&&ho({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?mo():void 0,...j}),c&&go({...j}),xo({...j,apply:({elements:ce,rects:Ke,availableWidth:Zt,availableHeight:Jt})=>{const{width:Qt,height:en}=Ke.reference,de=ce.floating.style;de.setProperty("--radix-popper-available-width",`${Zt}px`),de.setProperty("--radix-popper-available-height",`${Jt}px`),de.setProperty("--radix-popper-anchor-width",`${Qt}px`),de.setProperty("--radix-popper-anchor-height",`${en}px`)}}),w&&yo({element:w,padding:a}),To({arrowWidth:E,arrowHeight:O}),h&&vo({strategy:"referenceHidden",...j})]}),[N,Re]=_t($),fe=re(m);te(()=>{R&&(fe==null||fe())},[R,fe]);const Yt=(Ve=D.arrow)==null?void 0:Ve.x,Xt=(Ue=D.arrow)==null?void 0:Ue.y,Gt=((Ye=D.arrow)==null?void 0:Ye.centerOffset)!==0,[qt,Kt]=u.useState();return te(()=>{v&&Kt(window.getComputedStyle(v).zIndex)},[v]),P.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:R?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:qt,"--radix-popper-transform-origin":[(Xe=D.transformOrigin)==null?void 0:Xe.x,(Ge=D.transformOrigin)==null?void 0:Ge.y].join(" "),...((qe=D.hide)==null?void 0:qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(Po,{scope:n,placedSide:N,onArrowChange:b,arrowX:Yt,arrowY:Xt,shouldHideArrow:Gt,children:P.jsx(Q.div,{"data-side":N,"data-align":Re,...g,ref:C,style:{...g.style,animation:R?void 0:"none"}})})})});Nt.displayName=Be;var Lt="PopperArrow",Ro={top:"bottom",right:"left",bottom:"top",left:"right"},Mt=u.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Ao(Lt,o),s=Ro[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(bo,{...r,ref:n,style:{...r.style,display:"block"}})})});Mt.displayName=Lt;function Oo(e){return e!==null}var To=e=>({name:"transformOrigin",options:e,fn(t){var x,v,y;const{placement:n,rects:o,middlewareData:r}=t,s=((x=r.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,f]=_t(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((v=r.arrow)==null?void 0:v.x)??0)+a/2,p=(((y=r.arrow)==null?void 0:y.y)??0)+c/2;let m="",g="";return l==="bottom"?(m=s?d:`${h}px`,g=`${-c}px`):l==="top"?(m=s?d:`${h}px`,g=`${o.floating.height+c}px`):l==="right"?(m=`${-c}px`,g=s?d:`${p}px`):l==="left"&&(m=`${o.floating.width+c}px`,g=s?d:`${p}px`),{data:{x:m,y:g}}}});function _t(e){const[t,n="center"]=e.split("-");return[t,n]}var So=Tt,Do=Dt,No=Nt,Lo=Mt;function Mo(e,t){return u.useReducer((n,o)=>t[n][o]??n,e)}var kt=e=>{const{present:t,children:n}=e,o=_o(t),r=typeof n=="function"?n({present:o.isPresent}):u.Children.only(n),i=J(o.ref,ko(r));return typeof n=="function"||o.isPresent?u.cloneElement(r,{ref:i}):null};kt.displayName="Presence";function _o(e){const[t,n]=u.useState(),o=u.useRef({}),r=u.useRef(e),i=u.useRef("none"),s=e?"mounted":"unmounted",[a,c]=Mo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const l=he(o.current);i.current=a==="mounted"?l:"none"},[a]),te(()=>{const l=o.current,f=r.current;if(f!==e){const h=i.current,p=he(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),te(()=>{if(t){const l=d=>{const p=he(o.current).includes(d.animationName);d.target===t&&p&&_e.flushSync(()=>c("ANIMATION_END"))},f=d=>{d.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:u.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function ko(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function jo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=$o({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,a=re(n),c=u.useCallback(l=>{if(i){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else r(l)},[i,e,r,a]);return[s,c]}function $o({defaultProp:e,onChange:t}){const n=u.useState(e),[o]=n,r=u.useRef(o),i=re(t);return u.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}var Wo="VisuallyHidden",jt=u.forwardRef((e,t)=>P.jsx(Q.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));jt.displayName=Wo;var Io=jt,[Ce,ur]=lt("Tooltip",[Rt]),Ee=Rt(),$t="TooltipProvider",Fo=700,Le="tooltip.open",[Ho,ze]=Ce($t),Wt=e=>{const{__scopeTooltip:t,delayDuration:n=Fo,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[s,a]=u.useState(!0),c=u.useRef(!1),l=u.useRef(0);return u.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),P.jsx(Ho,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:u.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:u.useCallback(f=>{c.current=f},[]),disableHoverableContent:r,children:i})};Wt.displayName=$t;var Pe="Tooltip",[Bo,Ae]=Ce(Pe),It=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,c=ze(Pe,e.__scopeTooltip),l=Ee(t),[f,d]=u.useState(null),h=bn(),p=u.useRef(0),m=s??c.disableHoverableContent,g=a??c.delayDuration,x=u.useRef(!1),[v=!1,y]=jo({prop:o,defaultProp:r,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Le))):c.onClose(),i==null||i(E)}}),C=u.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),w=u.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,y(!0)},[y]),b=u.useCallback(()=>{window.clearTimeout(p.current),y(!1)},[y]),A=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,y(!0)},g)},[g,y]);return u.useEffect(()=>()=>window.clearTimeout(p.current),[]),P.jsx(So,{...l,children:P.jsx(Bo,{scope:t,contentId:h,open:v,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayed?A():w()},[c.isOpenDelayed,A,w]),onTriggerLeave:u.useCallback(()=>{m?b():window.clearTimeout(p.current)},[b,m]),onOpen:w,onClose:b,disableHoverableContent:m,children:n})})};It.displayName=Pe;var Me="TooltipTrigger",Ft=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ae(Me,n),i=ze(Me,n),s=Ee(n),a=u.useRef(null),c=J(t,a,r.onTriggerChange),l=u.useRef(!1),f=u.useRef(!1),d=u.useCallback(()=>l.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),P.jsx(Do,{asChild:!0,...s,children:P.jsx(Q.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:c,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:V(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:V(e.onBlur,r.onClose),onClick:V(e.onClick,r.onClose)})})});Ft.displayName=Me;var zo="TooltipPortal",[fr,Vo]=Ce(zo,{forceMount:void 0}),oe="TooltipContent",Ht=u.forwardRef((e,t)=>{const n=Vo(oe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Ae(oe,e.__scopeTooltip);return P.jsx(kt,{present:o||s.open,children:s.disableHoverableContent?P.jsx(Bt,{side:r,...i,ref:t}):P.jsx(Uo,{side:r,...i,ref:t})})}),Uo=u.forwardRef((e,t)=>{const n=Ae(oe,e.__scopeTooltip),o=ze(oe,e.__scopeTooltip),r=u.useRef(null),i=J(t,r),[s,a]=u.useState(null),{trigger:c,onClose:l}=n,f=r.current,{onPointerInTransitChange:d}=o,h=u.useCallback(()=>{a(null),d(!1)},[d]),p=u.useCallback((m,g)=>{const x=m.currentTarget,v={x:m.clientX,y:m.clientY},y=qo(v,x.getBoundingClientRect()),C=Ko(v,y),w=Zo(g.getBoundingClientRect()),b=Qo([...C,...w]);a(b),d(!0)},[d]);return u.useEffect(()=>()=>h(),[h]),u.useEffect(()=>{if(c&&f){const m=x=>p(x,f),g=x=>p(x,c);return c.addEventListener("pointerleave",m),f.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),f.removeEventListener("pointerleave",g)}}},[c,f,p,h]),u.useEffect(()=>{if(s){const m=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),C=!Jo(v,s);y?h():C&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,f,s,l,h]),P.jsx(Bt,{...e,ref:i})}),[Yo,Xo]=Ce(Pe,{isInside:!1}),Bt=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,c=Ae(oe,n),l=Ee(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Le,f),()=>document.removeEventListener(Le,f)),[f]),u.useEffect(()=>{if(c.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),P.jsx(pt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:P.jsxs(No,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(ft,{children:o}),P.jsx(Yo,{scope:n,isInside:!0,children:P.jsx(Io,{id:c.contentId,role:"tooltip",children:r||o})})]})})});Ht.displayName=oe;var zt="TooltipArrow",Go=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ee(n);return Xo(zt,n).isInside?null:P.jsx(Lo,{...r,...o,ref:t})});Go.displayName=zt;function qo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ko(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Zo(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Jo(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,c=t[i].y,l=t[s].x,f=t[s].y;c>o!=f>o&&n<(l-a)*(o-c)/(f-c)+a&&(r=!r)}return r}function Qo(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),er(t)}function er(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tr=Wt,nr=It,or=Ft,Vt=Ht;const dr=tr,rr=nr,ir=or;function Ut({className:e,sideOffset:t=4,ref:n,...o}){return P.jsx(Vt,{ref:n,sideOffset:t,className:nn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}Ut.displayName=Vt.displayName;function pr({content:e,children:t}){return e?P.jsxs(rr,{children:[P.jsx(ir,{asChild:!0,children:t}),P.jsx(Ut,{children:e})]}):t}export{Do as A,No as C,pt as D,Q as P,So as R,pr as S,dr as T,jt as V,V as a,kt as b,lt as c,ut as d,lr as e,jo as f,bn as g,rr as h,ir as i,Ut as j,te as k,Rt as l,Lo as m,re as n,J as u};
2
- //# sourceMappingURL=tooltip-Cqh5cQvd.js.map
1
+ import{r as u,j as P,B as tn}from"./index-1cKOJFpX.js";import{r as _e}from"./components-CME-nGId.js";import{c as nn}from"./misc-ENVX3CWf.js";function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function on(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function at(...e){return t=>e.forEach(n=>on(n,t))}function J(...e){return u.useCallback(at(...e),e)}function lr(e,t){const n=u.createContext(t);function o(i){const{children:s,...a}=i,c=u.useMemo(()=>a,Object.values(a));return P.jsx(n.Provider,{value:c,children:s})}function r(i){const s=u.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return o.displayName=e+"Provider",[o,r]}function lt(e,t=[]){let n=[];function o(i,s){const a=u.createContext(s),c=n.length;n=[...n,s];function l(d){const{scope:h,children:p,...m}=d,g=(h==null?void 0:h[e][c])||a,x=u.useMemo(()=>m,Object.values(m));return P.jsx(g.Provider,{value:x,children:p})}function f(d,h){const p=(h==null?void 0:h[e][c])||a,m=u.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return l.displayName=i+"Provider",[l,f]}const r=()=>{const i=n.map(s=>u.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return u.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,rn(r,...t)]}function rn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...a,...d}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ut=u.forwardRef((e,t)=>{const{children:n,...o}=e,r=u.Children.toArray(n),i=r.find(sn);if(i){const s=i.props.children,a=r.map(c=>c===i?u.Children.count(s)>1?u.Children.only(null):u.isValidElement(s)?s.props.children:null:c);return P.jsx(Te,{...o,ref:t,children:u.isValidElement(s)?u.cloneElement(s,void 0,a):null})}return P.jsx(Te,{...o,ref:t,children:n})});ut.displayName="Slot";var Te=u.forwardRef((e,t)=>{const{children:n,...o}=e;if(u.isValidElement(n)){const r=an(n);return u.cloneElement(n,{...cn(o,n.props),ref:t?at(t,r):r})}return u.Children.count(n)>1?u.Children.only(null):null});Te.displayName="SlotClone";var ft=({children:e})=>P.jsx(P.Fragment,{children:e});function sn(e){return u.isValidElement(e)&&e.type===ft}function cn(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{i(...a),r(...a)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function an(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ln=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Q=ln.reduce((e,t)=>{const n=u.forwardRef((o,r)=>{const{asChild:i,...s}=o,a=i?ut:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(a,{...s,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function un(e,t){e&&_e.flushSync(()=>e.dispatchEvent(t))}function re(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function fn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e);u.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var dn="DismissableLayer",Se="dismissableLayer.update",pn="dismissableLayer.pointerDownOutside",hn="dismissableLayer.focusOutside",Ze,dt=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pt=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...c}=e,l=u.useContext(dt),[f,d]=u.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=u.useState({}),m=J(t,E=>d(E)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=f?g.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,b=xn(E=>{const O=E.target,L=[...l.branches].some(T=>T.contains(O));!w||L||(r==null||r(E),s==null||s(E),E.defaultPrevented||a==null||a())},h),A=vn(E=>{const O=E.target;[...l.branches].some(T=>T.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},h);return fn(E=>{y===l.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},h),u.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ze=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Je(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ze)}},[f,h,n,l]),u.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Je())},[f,l]),u.useEffect(()=>{const E=()=>p({});return document.addEventListener(Se,E),()=>document.removeEventListener(Se,E)},[]),P.jsx(Q.div,{...c,ref:m,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,A.onFocusCapture),onBlurCapture:V(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,b.onPointerDownCapture)})});pt.displayName=dn;var mn="DismissableLayerBranch",gn=u.forwardRef((e,t)=>{const n=u.useContext(dt),o=u.useRef(null),r=J(t,o);return u.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(Q.div,{...e,ref:r})});gn.displayName=mn;function xn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e),o=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let c=function(){ht(pn,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function vn(e,t=globalThis==null?void 0:globalThis.document){const n=re(e),o=u.useRef(!1);return u.useEffect(()=>{const r=i=>{i.target&&!o.current&&ht(hn,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Je(){const e=new CustomEvent(Se);document.dispatchEvent(e)}function ht(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?un(r,i):r.dispatchEvent(i)}var te=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},yn=tn.useId||(()=>{}),wn=0;function bn(e){const[t,n]=u.useState(yn());return te(()=>{e||n(o=>o??String(wn++))},[e]),e||(t?`radix-${t}`:"")}const Cn=["top","right","bottom","left"],H=Math.min,W=Math.max,ge=Math.round,pe=Math.floor,G=e=>({x:e,y:e}),En={left:"right",right:"left",bottom:"top",top:"bottom"},Pn={start:"end",end:"start"};function De(e,t,n){return W(e,H(t,n))}function U(e,t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function ie(e){return e.split("-")[1]}function ke(e){return e==="x"?"y":"x"}function je(e){return e==="y"?"height":"width"}function q(e){return["top","bottom"].includes(Y(e))?"y":"x"}function $e(e){return ke(q(e))}function An(e,t,n){n===void 0&&(n=!1);const o=ie(e),r=$e(e),i=je(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=xe(s)),[s,xe(s)]}function Rn(e){const t=xe(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.replace(/start|end/g,t=>Pn[t])}function On(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function Tn(e,t,n,o){const r=ie(e);let i=On(Y(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ne)))),i}function xe(e){return e.replace(/left|right|bottom|top/g,t=>En[t])}function Sn(e){return{top:0,right:0,bottom:0,left:0,...e}}function mt(e){return typeof e!="number"?Sn(e):{top:e,right:e,bottom:e,left:e}}function ve(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Qe(e,t,n){let{reference:o,floating:r}=e;const i=q(t),s=$e(t),a=je(s),c=Y(t),l=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let p;switch(c){case"top":p={x:f,y:o.y-r.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(ie(t)){case"start":p[s]-=h*(n&&l?-1:1);break;case"end":p[s]+=h*(n&&l?-1:1);break}return p}const Dn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=Qe(l,o,c),h=o,p={},m=0;for(let g=0;g<a.length;g++){const{name:x,fn:v}=a[g],{x:y,y:C,data:w,reset:b}=await v({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});f=y??f,d=C??d,p={...p,[x]:{...p[x],...w}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):b.rects),{x:f,y:d}=Qe(l,h,c)),g=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:p}};async function ae(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=U(t,e),m=mt(p),x=a[h?d==="floating"?"reference":"floating":d],v=ve(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:f,strategy:c})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},b=ve(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:C,strategy:c}):y);return{top:(v.top-b.top+m.top)/w.y,bottom:(b.bottom-v.bottom+m.bottom)/w.y,left:(v.left-b.left+m.left)/w.x,right:(b.right-v.right+m.right)/w.x}}const Nn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:f=0}=U(e,t)||{};if(l==null)return{};const d=mt(f),h={x:n,y:o},p=$e(r),m=je(p),g=await s.getDimensions(l),x=p==="y",v=x?"top":"left",y=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-h[p]-i.floating[m],b=h[p]-i.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=A?A[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(A)))&&(E=a.floating[C]||i.floating[m]);const O=w/2-b/2,L=E/2-g[m]/2-1,T=H(d[v],L),_=H(d[y],L),k=T,j=E-g[m]-_,S=E/2-g[m]/2+O,M=De(k,S,j),$=!c.arrow&&ie(r)!=null&&S!==M&&i.reference[m]/2-(S<k?T:_)-g[m]/2<0,R=$?S<k?S-k:S-j:0;return{[p]:h[p]+R,data:{[p]:M,centerOffset:S-M-R,...$&&{alignmentOffset:R}},reset:$}}}),Ln=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Y(r),y=q(a),C=Y(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),b=h||(C||!g?[xe(a)]:Rn(a)),A=m!=="none";!h&&A&&b.push(...Tn(a,g,m,w));const E=[a,...b],O=await ae(t,x),L=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&L.push(O[v]),d){const S=An(r,s,w);L.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:L}],!L.every(S=>S<=0)){var _,k;const S=(((_=i.flip)==null?void 0:_.index)||0)+1,M=E[S];if(M)return{data:{index:S,overflows:T},reset:{placement:M}};let $=(k=T.filter(R=>R.overflows[0]<=0).sort((R,D)=>R.overflows[1]-D.overflows[1])[0])==null?void 0:k.placement;if(!$)switch(p){case"bestFit":{var j;const R=(j=T.filter(D=>{if(A){const N=q(D.placement);return N===y||N==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(N=>N>0).reduce((N,Re)=>N+Re,0)]).sort((D,N)=>D[1]-N[1])[0])==null?void 0:j[0];R&&($=R);break}case"initialPlacement":$=a;break}if(r!==$)return{reset:{placement:$}}}return{}}}};function et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tt(e){return Cn.some(t=>e[t]>=0)}const Mn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=U(e,t);switch(o){case"referenceHidden":{const i=await ae(t,{...r,elementContext:"reference"}),s=et(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:tt(s)}}}case"escaped":{const i=await ae(t,{...r,altBoundary:!0}),s=et(i,n.floating);return{data:{escapedOffsets:s,escaped:tt(s)}}}default:return{}}}}};async function _n(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Y(n),a=ie(n),c=q(n)==="y",l=["left","top"].includes(s)?-1:1,f=i&&c?-1:1,d=U(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*f,y:h*l}:{x:h*l,y:p*f}}const kn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await _n(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},jn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:v,y}=x;return{x:v,y}}},...c}=U(e,t),l={x:n,y:o},f=await ae(t,c),d=q(Y(r)),h=ke(d);let p=l[h],m=l[d];if(i){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=p+f[x],C=p-f[v];p=De(y,p,C)}if(s){const x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=m+f[x],C=m-f[v];m=De(y,m,C)}const g=a.fn({...t,[h]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-o}}}}},$n=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),f={x:n,y:o},d=q(r),h=ke(d);let p=f[h],m=f[d];const g=U(a,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=h==="y"?"height":"width",w=i.reference[h]-i.floating[C]+x.mainAxis,b=i.reference[h]+i.reference[C]-x.mainAxis;p<w?p=w:p>b&&(p=b)}if(l){var v,y;const C=h==="y"?"width":"height",w=["top","left"].includes(Y(r)),b=i.reference[d]-i.floating[C]+(w&&((v=s.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),A=i.reference[d]+i.reference[C]+(w?0:((y=s.offset)==null?void 0:y[d])||0)-(w?x.crossAxis:0);m<b?m=b:m>A&&(m=A)}return{[h]:p,[d]:m}}}},Wn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=U(e,t),c=await ae(t,a),l=Y(n),f=ie(n),d=q(n)==="y",{width:h,height:p}=o.floating;let m,g;l==="top"||l==="bottom"?(m=l,g=f===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=l,m=f==="end"?"top":"bottom");const x=p-c.top-c.bottom,v=h-c.left-c.right,y=H(p-c[m],x),C=H(h-c[g],v),w=!t.middlewareData.shift;let b=y,A=C;if(d?A=f||w?H(C,v):v:b=f||w?H(y,x):x,w&&!f){const O=W(c.left,0),L=W(c.right,0),T=W(c.top,0),_=W(c.bottom,0);d?A=h-2*(O!==0||L!==0?O+L:W(c.left,c.right)):b=p-2*(T!==0||_!==0?T+_:W(c.top,c.bottom))}await s({...t,availableWidth:A,availableHeight:b});const E=await r.getDimensions(i.floating);return h!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function se(e){return gt(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function X(e){var t;return(t=(gt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gt(e){return e instanceof Node||e instanceof I(e).Node}function B(e){return e instanceof Element||e instanceof I(e).Element}function z(e){return e instanceof HTMLElement||e instanceof I(e).HTMLElement}function nt(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function ue(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=F(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function In(e){return["table","td","th"].includes(se(e))}function we(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function We(e){const t=Ie(),n=F(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Fn(e){let t=K(e);for(;z(t)&&!ne(t);){if(we(t))return null;if(We(t))return t;t=K(t)}return null}function Ie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ne(e){return["html","body","#document"].includes(se(e))}function F(e){return I(e).getComputedStyle(e)}function be(e){return B(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function K(e){if(se(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nt(e)&&e.host||X(e);return nt(t)?t.host:t}function xt(e){const t=K(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&ue(t)?t:xt(t)}function le(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=I(r);return i?t.concat(s,s.visualViewport||[],ue(r)?r:[],s.frameElement&&n?le(s.frameElement):[]):t.concat(r,le(r,[],n))}function vt(e){const t=F(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=z(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=ge(n)!==i||ge(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Fe(e){return B(e)?e:e.contextElement}function ee(e){const t=Fe(e);if(!z(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=vt(t);let s=(i?ge(n.width):n.width)/o,a=(i?ge(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Hn=G(0);function yt(e){const t=I(e);return!Ie()||!t.visualViewport?Hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function Z(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Fe(e);let s=G(1);t&&(o?B(o)&&(s=ee(o)):s=ee(e));const a=Bn(i,n,o)?yt(i):G(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,f=r.width/s.x,d=r.height/s.y;if(i){const h=I(i),p=o&&B(o)?I(o):o;let m=h,g=m.frameElement;for(;g&&o&&p!==m;){const x=ee(g),v=g.getBoundingClientRect(),y=F(g),C=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,w=v.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,l*=x.y,f*=x.x,d*=x.y,c+=C,l+=w,m=I(g),g=m.frameElement}}return ve({width:f,height:d,x:c,y:l})}function zn(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=X(o),a=t?we(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=G(1);const f=G(0),d=z(o);if((d||!d&&!i)&&((se(o)!=="body"||ue(s))&&(c=be(o)),z(o))){const h=Z(o);l=ee(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x,y:n.y*l.y-c.scrollTop*l.y+f.y}}function Vn(e){return Array.from(e.getClientRects())}function wt(e){return Z(X(e)).left+be(e).scrollLeft}function Un(e){const t=X(e),n=be(e),o=e.ownerDocument.body,r=W(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=W(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+wt(e);const a=-n.scrollTop;return F(o).direction==="rtl"&&(s+=W(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function Yn(e,t){const n=I(e),o=X(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const l=Ie();(!l||l&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:a,y:c}}function Xn(e,t){const n=Z(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=z(e)?ee(e):G(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function ot(e,t,n){let o;if(t==="viewport")o=Yn(e,n);else if(t==="document")o=Un(X(e));else if(B(t))o=Xn(t,n);else{const r=yt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return ve(o)}function bt(e,t){const n=K(e);return n===t||!B(n)||ne(n)?!1:F(n).position==="fixed"||bt(n,t)}function Gn(e,t){const n=t.get(e);if(n)return n;let o=le(e,[],!1).filter(a=>B(a)&&se(a)!=="body"),r=null;const i=F(e).position==="fixed";let s=i?K(e):e;for(;B(s)&&!ne(s);){const a=F(s),c=We(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ue(s)&&!c&&bt(e,s))?o=o.filter(f=>f!==s):r=a,s=K(s)}return t.set(e,o),o}function qn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?we(t)?[]:Gn(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((l,f)=>{const d=ot(t,f,r);return l.top=W(d.top,l.top),l.right=H(d.right,l.right),l.bottom=H(d.bottom,l.bottom),l.left=W(d.left,l.left),l},ot(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Kn(e){const{width:t,height:n}=vt(e);return{width:t,height:n}}function Zn(e,t,n){const o=z(t),r=X(t),i=n==="fixed",s=Z(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=G(0);if(o||!o&&!i)if((se(t)!=="body"||ue(r))&&(a=be(t)),o){const d=Z(t,!0,i,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else r&&(c.x=wt(r));const l=s.left+a.scrollLeft-c.x,f=s.top+a.scrollTop-c.y;return{x:l,y:f,width:s.width,height:s.height}}function Oe(e){return F(e).position==="static"}function rt(e,t){return!z(e)||F(e).position==="fixed"?null:t?t(e):e.offsetParent}function Ct(e,t){const n=I(e);if(we(e))return n;if(!z(e)){let r=K(e);for(;r&&!ne(r);){if(B(r)&&!Oe(r))return r;r=K(r)}return n}let o=rt(e,t);for(;o&&In(o)&&Oe(o);)o=rt(o,t);return o&&ne(o)&&Oe(o)&&!We(o)?n:o||Fn(e)||n}const Jn=async function(e){const t=this.getOffsetParent||Ct,n=this.getDimensions,o=await n(e.floating);return{reference:Zn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Qn(e){return F(e).direction==="rtl"}const eo={convertOffsetParentRelativeRectToViewportRelativeRect:zn,getDocumentElement:X,getClippingRect:qn,getOffsetParent:Ct,getElementRects:Jn,getClientRects:Vn,getDimensions:Kn,getScale:ee,isElement:B,isRTL:Qn};function to(e,t){let n=null,o;const r=X(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:l,top:f,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const p=pe(f),m=pe(r.clientWidth-(l+d)),g=pe(r.clientHeight-(f+h)),x=pe(l),y={rootMargin:-p+"px "+-m+"px "+-g+"px "+-x+"px",threshold:W(0,H(1,c))||1};let C=!0;function w(b){const A=b[0].intersectionRatio;if(A!==c){if(!C)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return s(!0),i}function no(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Fe(e),f=r||i?[...l?le(l):[],...le(t)]:[];f.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=l&&a?to(l,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,g=c?Z(e):null;c&&x();function x(){const v=Z(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,m=requestAnimationFrame(x)}return n(),()=>{var v;f.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const oo=kn,ro=jn,io=Ln,so=Wn,co=Mn,it=Nn,ao=$n,lo=(e,t,n)=>{const o=new Map,r={platform:eo,...n},i={...r.platform,_c:o};return Dn(e,t,{...r,platform:i})};var me=typeof document<"u"?u.useLayoutEffect:u.useEffect;function ye(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!ye(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!ye(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Et(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function st(e,t){const n=Et(e);return Math.round(t*n)/n}function ct(e){const t=u.useRef(e);return me(()=>{t.current=e}),t}function uo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[f,d]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=u.useState(o);ye(h,o)||p(o);const[m,g]=u.useState(null),[x,v]=u.useState(null),y=u.useCallback(R=>{R!==A.current&&(A.current=R,g(R))},[]),C=u.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=i||m,b=s||x,A=u.useRef(null),E=u.useRef(null),O=u.useRef(f),L=c!=null,T=ct(c),_=ct(r),k=u.useCallback(()=>{if(!A.current||!E.current)return;const R={placement:t,strategy:n,middleware:h};_.current&&(R.platform=_.current),lo(A.current,E.current,R).then(D=>{const N={...D,isPositioned:!0};j.current&&!ye(O.current,N)&&(O.current=N,_e.flushSync(()=>{d(N)}))})},[h,t,n,_]);me(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[l]);const j=u.useRef(!1);me(()=>(j.current=!0,()=>{j.current=!1}),[]),me(()=>{if(w&&(A.current=w),b&&(E.current=b),w&&b){if(T.current)return T.current(w,b,k);k()}},[w,b,k,T,L]);const S=u.useMemo(()=>({reference:A,floating:E,setReference:y,setFloating:C}),[y,C]),M=u.useMemo(()=>({reference:w,floating:b}),[w,b]),$=u.useMemo(()=>{const R={position:n,left:0,top:0};if(!M.floating)return R;const D=st(M.floating,f.x),N=st(M.floating,f.y);return a?{...R,transform:"translate("+D+"px, "+N+"px)",...Et(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:N}},[n,a,M.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:k,refs:S,elements:M,floatingStyles:$}),[f,k,S,M,$])}const fo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?it({element:o.current,padding:r}).fn(n):{}:o?it({element:o,padding:r}).fn(n):{}}}},po=(e,t)=>({...oo(e),options:[e,t]}),ho=(e,t)=>({...ro(e),options:[e,t]}),mo=(e,t)=>({...ao(e),options:[e,t]}),go=(e,t)=>({...io(e),options:[e,t]}),xo=(e,t)=>({...so(e),options:[e,t]}),vo=(e,t)=>({...co(e),options:[e,t]}),yo=(e,t)=>({...fo(e),options:[e,t]});var wo="Arrow",Pt=u.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return P.jsx(Q.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pt.displayName=wo;var bo=Pt;function Co(e){const[t,n]=u.useState(void 0);return te(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var He="Popper",[At,Rt]=lt(He),[Eo,Ot]=At(He),Tt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=u.useState(null);return P.jsx(Eo,{scope:t,anchor:o,onAnchorChange:r,children:n})};Tt.displayName=He;var St="PopperAnchor",Dt=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Ot(St,n),s=u.useRef(null),a=J(t,s);return u.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:P.jsx(Q.div,{...r,ref:a})});Dt.displayName=St;var Be="PopperContent",[Po,Ao]=At(Be),Nt=u.forwardRef((e,t)=>{var Ve,Ue,Ye,Xe,Ge,qe;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,x=Ot(Be,n),[v,y]=u.useState(null),C=J(t,ce=>y(ce)),[w,b]=u.useState(null),A=Co(w),E=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,L=o+(i!=="center"?"-"+i:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(l)?l:[l],k=_.length>0,j={padding:T,boundary:_.filter(Oo),altBoundary:k},{refs:S,floatingStyles:M,placement:$,isPositioned:R,middlewareData:D}=uo({strategy:"fixed",placement:L,whileElementsMounted:(...ce)=>no(...ce,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[po({mainAxis:r+O,alignmentAxis:s}),c&&ho({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?mo():void 0,...j}),c&&go({...j}),xo({...j,apply:({elements:ce,rects:Ke,availableWidth:Zt,availableHeight:Jt})=>{const{width:Qt,height:en}=Ke.reference,de=ce.floating.style;de.setProperty("--radix-popper-available-width",`${Zt}px`),de.setProperty("--radix-popper-available-height",`${Jt}px`),de.setProperty("--radix-popper-anchor-width",`${Qt}px`),de.setProperty("--radix-popper-anchor-height",`${en}px`)}}),w&&yo({element:w,padding:a}),To({arrowWidth:E,arrowHeight:O}),h&&vo({strategy:"referenceHidden",...j})]}),[N,Re]=_t($),fe=re(m);te(()=>{R&&(fe==null||fe())},[R,fe]);const Yt=(Ve=D.arrow)==null?void 0:Ve.x,Xt=(Ue=D.arrow)==null?void 0:Ue.y,Gt=((Ye=D.arrow)==null?void 0:Ye.centerOffset)!==0,[qt,Kt]=u.useState();return te(()=>{v&&Kt(window.getComputedStyle(v).zIndex)},[v]),P.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:R?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:qt,"--radix-popper-transform-origin":[(Xe=D.transformOrigin)==null?void 0:Xe.x,(Ge=D.transformOrigin)==null?void 0:Ge.y].join(" "),...((qe=D.hide)==null?void 0:qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(Po,{scope:n,placedSide:N,onArrowChange:b,arrowX:Yt,arrowY:Xt,shouldHideArrow:Gt,children:P.jsx(Q.div,{"data-side":N,"data-align":Re,...g,ref:C,style:{...g.style,animation:R?void 0:"none"}})})})});Nt.displayName=Be;var Lt="PopperArrow",Ro={top:"bottom",right:"left",bottom:"top",left:"right"},Mt=u.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=Ao(Lt,o),s=Ro[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(bo,{...r,ref:n,style:{...r.style,display:"block"}})})});Mt.displayName=Lt;function Oo(e){return e!==null}var To=e=>({name:"transformOrigin",options:e,fn(t){var x,v,y;const{placement:n,rects:o,middlewareData:r}=t,s=((x=r.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,f]=_t(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((v=r.arrow)==null?void 0:v.x)??0)+a/2,p=(((y=r.arrow)==null?void 0:y.y)??0)+c/2;let m="",g="";return l==="bottom"?(m=s?d:`${h}px`,g=`${-c}px`):l==="top"?(m=s?d:`${h}px`,g=`${o.floating.height+c}px`):l==="right"?(m=`${-c}px`,g=s?d:`${p}px`):l==="left"&&(m=`${o.floating.width+c}px`,g=s?d:`${p}px`),{data:{x:m,y:g}}}});function _t(e){const[t,n="center"]=e.split("-");return[t,n]}var So=Tt,Do=Dt,No=Nt,Lo=Mt;function Mo(e,t){return u.useReducer((n,o)=>t[n][o]??n,e)}var kt=e=>{const{present:t,children:n}=e,o=_o(t),r=typeof n=="function"?n({present:o.isPresent}):u.Children.only(n),i=J(o.ref,ko(r));return typeof n=="function"||o.isPresent?u.cloneElement(r,{ref:i}):null};kt.displayName="Presence";function _o(e){const[t,n]=u.useState(),o=u.useRef({}),r=u.useRef(e),i=u.useRef("none"),s=e?"mounted":"unmounted",[a,c]=Mo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const l=he(o.current);i.current=a==="mounted"?l:"none"},[a]),te(()=>{const l=o.current,f=r.current;if(f!==e){const h=i.current,p=he(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),te(()=>{if(t){const l=d=>{const p=he(o.current).includes(d.animationName);d.target===t&&p&&_e.flushSync(()=>c("ANIMATION_END"))},f=d=>{d.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:u.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function ko(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function jo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=$o({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,a=re(n),c=u.useCallback(l=>{if(i){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else r(l)},[i,e,r,a]);return[s,c]}function $o({defaultProp:e,onChange:t}){const n=u.useState(e),[o]=n,r=u.useRef(o),i=re(t);return u.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}var Wo="VisuallyHidden",jt=u.forwardRef((e,t)=>P.jsx(Q.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));jt.displayName=Wo;var Io=jt,[Ce,ur]=lt("Tooltip",[Rt]),Ee=Rt(),$t="TooltipProvider",Fo=700,Le="tooltip.open",[Ho,ze]=Ce($t),Wt=e=>{const{__scopeTooltip:t,delayDuration:n=Fo,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[s,a]=u.useState(!0),c=u.useRef(!1),l=u.useRef(0);return u.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),P.jsx(Ho,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:u.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:u.useCallback(f=>{c.current=f},[]),disableHoverableContent:r,children:i})};Wt.displayName=$t;var Pe="Tooltip",[Bo,Ae]=Ce(Pe),It=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,c=ze(Pe,e.__scopeTooltip),l=Ee(t),[f,d]=u.useState(null),h=bn(),p=u.useRef(0),m=s??c.disableHoverableContent,g=a??c.delayDuration,x=u.useRef(!1),[v=!1,y]=jo({prop:o,defaultProp:r,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Le))):c.onClose(),i==null||i(E)}}),C=u.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),w=u.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,y(!0)},[y]),b=u.useCallback(()=>{window.clearTimeout(p.current),y(!1)},[y]),A=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,y(!0)},g)},[g,y]);return u.useEffect(()=>()=>window.clearTimeout(p.current),[]),P.jsx(So,{...l,children:P.jsx(Bo,{scope:t,contentId:h,open:v,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayed?A():w()},[c.isOpenDelayed,A,w]),onTriggerLeave:u.useCallback(()=>{m?b():window.clearTimeout(p.current)},[b,m]),onOpen:w,onClose:b,disableHoverableContent:m,children:n})})};It.displayName=Pe;var Me="TooltipTrigger",Ft=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ae(Me,n),i=ze(Me,n),s=Ee(n),a=u.useRef(null),c=J(t,a,r.onTriggerChange),l=u.useRef(!1),f=u.useRef(!1),d=u.useCallback(()=>l.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),P.jsx(Do,{asChild:!0,...s,children:P.jsx(Q.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:c,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:V(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:V(e.onBlur,r.onClose),onClick:V(e.onClick,r.onClose)})})});Ft.displayName=Me;var zo="TooltipPortal",[fr,Vo]=Ce(zo,{forceMount:void 0}),oe="TooltipContent",Ht=u.forwardRef((e,t)=>{const n=Vo(oe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,s=Ae(oe,e.__scopeTooltip);return P.jsx(kt,{present:o||s.open,children:s.disableHoverableContent?P.jsx(Bt,{side:r,...i,ref:t}):P.jsx(Uo,{side:r,...i,ref:t})})}),Uo=u.forwardRef((e,t)=>{const n=Ae(oe,e.__scopeTooltip),o=ze(oe,e.__scopeTooltip),r=u.useRef(null),i=J(t,r),[s,a]=u.useState(null),{trigger:c,onClose:l}=n,f=r.current,{onPointerInTransitChange:d}=o,h=u.useCallback(()=>{a(null),d(!1)},[d]),p=u.useCallback((m,g)=>{const x=m.currentTarget,v={x:m.clientX,y:m.clientY},y=qo(v,x.getBoundingClientRect()),C=Ko(v,y),w=Zo(g.getBoundingClientRect()),b=Qo([...C,...w]);a(b),d(!0)},[d]);return u.useEffect(()=>()=>h(),[h]),u.useEffect(()=>{if(c&&f){const m=x=>p(x,f),g=x=>p(x,c);return c.addEventListener("pointerleave",m),f.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),f.removeEventListener("pointerleave",g)}}},[c,f,p,h]),u.useEffect(()=>{if(s){const m=g=>{const x=g.target,v={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(x))||(f==null?void 0:f.contains(x)),C=!Jo(v,s);y?h():C&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,f,s,l,h]),P.jsx(Bt,{...e,ref:i})}),[Yo,Xo]=Ce(Pe,{isInside:!1}),Bt=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,c=Ae(oe,n),l=Ee(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Le,f),()=>document.removeEventListener(Le,f)),[f]),u.useEffect(()=>{if(c.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,f]),P.jsx(pt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:P.jsxs(No,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(ft,{children:o}),P.jsx(Yo,{scope:n,isInside:!0,children:P.jsx(Io,{id:c.contentId,role:"tooltip",children:r||o})})]})})});Ht.displayName=oe;var zt="TooltipArrow",Go=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ee(n);return Xo(zt,n).isInside?null:P.jsx(Lo,{...r,...o,ref:t})});Go.displayName=zt;function qo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ko(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Zo(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Jo(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,c=t[i].y,l=t[s].x,f=t[s].y;c>o!=f>o&&n<(l-a)*(o-c)/(f-c)+a&&(r=!r)}return r}function Qo(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),er(t)}function er(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tr=Wt,nr=It,or=Ft,Vt=Ht;const dr=tr,rr=nr,ir=or;function Ut({className:e,sideOffset:t=4,ref:n,...o}){return P.jsx(Vt,{ref:n,sideOffset:t,className:nn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}Ut.displayName=Vt.displayName;function pr({content:e,children:t}){return e?P.jsxs(rr,{children:[P.jsx(ir,{asChild:!0,children:t}),P.jsx(Ut,{children:e})]}):t}export{Do as A,No as C,pt as D,Q as P,So as R,pr as S,dr as T,jt as V,rr as a,ir as b,Ut as c,lt as d,bn as e,V as f,kt as g,J as h,te as i,Rt as j,ut as k,Lo as l,re as m,lr as n,jo as u};
2
+ //# sourceMappingURL=tooltip-BiHTe_7F.js.map