diff --git a/package-lock.json b/package-lock.json index 273da59817..653f7d95c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,28 @@ "node": ">=6.0.0" } }, + "node_modules/@antfu/install-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz", + "integrity": "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==", + "license": "MIT", + "dependencies": { + "package-manager-detector": "^1.3.0", + "tinyexec": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@antfu/install-pkg/node_modules/tinyexec": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@asamuzakjp/css-color": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", @@ -120,7 +142,6 @@ "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -381,6 +402,12 @@ "node": ">=6.9.0" } }, + "node_modules/@braintree/sanitize-url": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.1.tgz", + "integrity": "sha512-i1L7noDNxtFyL5DmZafWy1wRVhGehQmzZaz1HiN5e7iylJMSZR7ekOV7NsIqa5qBldlLrsKv4HbgFUVlQrz8Mw==", + "license": "MIT" + }, "node_modules/@bundled-es-modules/cookie": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz", @@ -412,6 +439,45 @@ "tough-cookie": "^4.1.4" } }, + "node_modules/@chevrotain/cst-dts-gen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz", + "integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==", + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/gast": "11.0.3", + "@chevrotain/types": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/@chevrotain/gast": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.0.3.tgz", + "integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==", + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/types": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/@chevrotain/regexp-to-ast": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz", + "integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==", + "license": "Apache-2.0" + }, + "node_modules/@chevrotain/types": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz", + "integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==", + "license": "Apache-2.0" + }, + "node_modules/@chevrotain/utils": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz", + "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==", + "license": "Apache-2.0" + }, "node_modules/@csstools/color-helpers": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", @@ -496,7 +562,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -538,7 +603,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -2337,7 +2401,6 @@ "resolved": "https://registry.npmjs.org/@heroui/system/-/system-2.4.19.tgz", "integrity": "sha512-glLZASHQPmyE4BGVD22VyBb/vP0CRfHVFmA8/TXmNWqGLmapmcWgbJ3cnKOE7DWRFns4bMTe2LqSj1rgjt/EjA==", "license": "MIT", - "peer": true, "dependencies": { "@heroui/react-utils": "2.1.12", "@heroui/system-rsc": "2.3.16", @@ -2423,7 +2486,6 @@ "resolved": "https://registry.npmjs.org/@heroui/theme/-/theme-2.4.19.tgz", "integrity": "sha512-MksRtU/ux5d9Ogv8duIkBcddrY1W6YuhP9fgaucsvgEDKE9JiSLsb4owI63x1uC0GYQ0+4DIH164E2Lm6KOejQ==", "license": "MIT", - "peer": true, "dependencies": { "@heroui/shared-utils": "2.1.10", "clsx": "^1.2.1", @@ -2879,9 +2941,19 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", - "dev": true, "license": "MIT" }, + "node_modules/@iconify/utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.0.tgz", + "integrity": "sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==", + "license": "MIT", + "dependencies": { + "@antfu/install-pkg": "^1.1.0", + "@iconify/types": "^2.0.0", + "mlly": "^1.8.0" + } + }, "node_modules/@inquirer/confirm": { "version": "5.1.12", "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.12.tgz", @@ -3112,6 +3184,15 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mermaid-js/parser": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-0.6.3.tgz", + "integrity": "sha512-lnjOhe7zyHjc+If7yT4zoedx2vo4sHaTmtkl1+or8BRTnCtDmcTpAjpzDSfCZrshM5bCoz0GyidzadJAH1xobA==", + "license": "MIT", + "dependencies": { + "langium": "3.3.1" + } + }, "node_modules/@mswjs/interceptors": { "version": "0.39.2", "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.39.2.tgz", @@ -4635,7 +4716,6 @@ "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.24.12.tgz", "integrity": "sha512-fDwQB0XkjZjpdFUz5UAnuZj8nnbxDbX5tp+jTOjjJKw2TMQ9gFFYCQ12lSpdhezA2YgEGZfxyYTGW0DKDL5Drg==", "license": "Apache-2.0", - "peer": true, "dependencies": { "json-schema-merge-allof": "^0.8.1", "jsonpointer": "^5.0.1", @@ -5341,7 +5421,6 @@ "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -5541,12 +5620,264 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/d3": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz", + "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-axis": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz", + "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-brush": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz", + "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-chord": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz", + "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-contour": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz", + "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==", + "license": "MIT" + }, + "node_modules/@types/d3-dispatch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz", + "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==", + "license": "MIT" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-dsv": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz", + "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-fetch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz", + "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==", + "license": "MIT", + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", + "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", + "license": "MIT" + }, + "node_modules/@types/d3-format": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz", + "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==", + "license": "MIT" + }, + "node_modules/@types/d3-geo": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.0.tgz", + "integrity": "sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz", + "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-polygon": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz", + "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==", + "license": "MIT" + }, + "node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz", + "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==", + "license": "MIT" + }, + "node_modules/@types/d3-random": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.3.tgz", + "integrity": "sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==", + "license": "MIT" + }, + "node_modules/@types/d3-selection": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz", + "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==", + "license": "MIT" + }, + "node_modules/@types/d3-shape": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.7.tgz", + "integrity": "sha512-VLvUQ33C+3J+8p+Daf+nYSOsjB4GXp19/S/aGo60m9h1v6XaxjiT82lKVWJCfzhtuZ3yD7i/TPeC/fuKLLOSmg==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-time-format": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz", + "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/d3-transition": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz", + "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz", + "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "license": "MIT", - "peer": true, "dependencies": { "@types/ms": "*" } @@ -5573,6 +5904,12 @@ "@types/estree": "*" } }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/hast": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", @@ -5617,7 +5954,6 @@ "integrity": "sha512-jJD50LtlD2dodAEO653i3YF04NWak6jN3ky+Ri3Em3mGR39/glWiboM/IePaRbgwSfqM1TpGXfAg8ohn/4dTgA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -5721,7 +6057,6 @@ "integrity": "sha512-6sMvZePQrnZH2/cJkwRpkT7DxoAWh+g6+GFRK6bV3YQo7ogi3SX5rgF6099r5Q53Ma5qeT7LGmOmuIutF4t3lA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.35.0", "@typescript-eslint/types": "8.35.0", @@ -6027,9 +6362,7 @@ "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -6347,7 +6680,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", @@ -6535,6 +6867,32 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/chevrotain": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz", + "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/cst-dts-gen": "11.0.3", + "@chevrotain/gast": "11.0.3", + "@chevrotain/regexp-to-ast": "11.0.3", + "@chevrotain/types": "11.0.3", + "@chevrotain/utils": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/chevrotain-allstar": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz", + "integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==", + "license": "MIT", + "dependencies": { + "lodash-es": "^4.17.21" + }, + "peerDependencies": { + "chevrotain": "^11.0.0" + } + }, "node_modules/chownr": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", @@ -6792,7 +7150,6 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, "license": "MIT" }, "node_modules/consola": { @@ -6822,6 +7179,15 @@ "node": ">= 0.6" } }, + "node_modules/cose-base": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz", + "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", + "license": "MIT", + "dependencies": { + "layout-base": "^1.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -6898,106 +7264,620 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "license": "MIT" }, - "node_modules/data-urls": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", - "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", - "dev": true, + "node_modules/cytoscape": { + "version": "3.33.1", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.33.1.tgz", + "integrity": "sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==", "license": "MIT", - "dependencies": { - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^14.0.0" - }, "engines": { - "node": ">=18" + "node": ">=0.10" } }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/cytoscape-cose-bilkent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz", + "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", "license": "MIT", "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" + "cose-base": "^1.0.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependencies": { + "cytoscape": "^3.2.0" } }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "license": "MIT" - }, - "node_modules/decode-named-character-reference": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", - "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", + "node_modules/cytoscape-fcose": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz", + "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==", "license": "MIT", "dependencies": { - "character-entities": "^2.0.0" + "cose-base": "^2.2.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "peerDependencies": { + "cytoscape": "^3.2.0" } }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, + "node_modules/cytoscape-fcose/node_modules/cose-base": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz", + "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==", "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "layout-base": "^2.0.0" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, + "node_modules/cytoscape-fcose/node_modules/layout-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz", + "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==", "license": "MIT" }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "license": "MIT", + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "license": "ISC", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/define-data-property": { + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "license": "ISC", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "license": "ISC", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "license": "ISC", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "license": "ISC", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "license": "ISC", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-sankey": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz", + "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-array": "1 - 2", + "d3-shape": "^1.2.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "license": "BSD-3-Clause", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-sankey/node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-sankey/node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", + "license": "ISC" + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dagre-d3-es": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.13.tgz", + "integrity": "sha512-efEhnxpSuwpYOKRm/L5KbqoZmNNukHa/Flty4Wp62JRvgH2ojwVgPgdYyr4twpieZnyRDdIH7PY2mopX26+j2Q==", + "license": "MIT", + "dependencies": { + "d3": "^7.9.0", + "lodash-es": "^4.17.21" + } + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "license": "MIT" + }, + "node_modules/decode-named-character-reference": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", + "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/deep-equal": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", @@ -7033,6 +7913,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delaunator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.1.tgz", + "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", + "license": "ISC", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -7237,7 +8126,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -7301,7 +8189,6 @@ "integrity": "sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -7791,7 +8678,6 @@ "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.6.tgz", "integrity": "sha512-dsJ389QImVE3lQvM8Mnk99/j8tiZDM/7706PCqvkQ8sSCnpmWxsgX+g0lj7r5OBVL0U36pIecCTBoIWcM2RuKw==", "license": "MIT", - "peer": true, "dependencies": { "motion-dom": "^12.23.6", "motion-utils": "^12.23.6", @@ -8030,6 +8916,12 @@ "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, + "node_modules/hachure-fill": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz", + "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", + "license": "MIT" + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -8215,7 +9107,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -8245,7 +9136,6 @@ "resolved": "https://registry.npmjs.org/immer/-/immer-10.1.1.tgz", "integrity": "sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/immer" @@ -8319,6 +9209,15 @@ "node": ">= 0.4" } }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/intl-messageformat": { "version": "10.7.16", "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.16.tgz", @@ -9002,7 +9901,6 @@ "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", "dev": true, "license": "MIT", - "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -9056,7 +9954,6 @@ "integrity": "sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@asamuzakjp/dom-selector": "^2.0.1", "cssstyle": "^4.0.1", @@ -9170,6 +10067,31 @@ "node": ">=0.10.0" } }, + "node_modules/katex": { + "version": "0.16.27", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.27.tgz", + "integrity": "sha512-aeQoDkuRWSqQN6nSvVCEFvfXdqo1OQiCmmW1kc9xSdjutPv7BGO7pqY9sQRJpMOGrEdfDgF2TfRXe5eUAD2Waw==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "license": "MIT", + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -9180,6 +10102,33 @@ "json-buffer": "3.0.1" } }, + "node_modules/khroma": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", + "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==" + }, + "node_modules/langium": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/langium/-/langium-3.3.1.tgz", + "integrity": "sha512-QJv/h939gDpvT+9SiLVlY7tZC3xB2qK57v0J04Sh9wpMb6MP1q8gB21L3WIo8T5P1MSMg3Ep14L7KkDCFG3y4w==", + "license": "MIT", + "dependencies": { + "chevrotain": "~11.0.3", + "chevrotain-allstar": "~0.3.0", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", + "vscode-uri": "~3.0.8" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/layout-base": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", + "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==", + "license": "MIT" + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -9640,6 +10589,18 @@ "react": ">= 0.14.0" } }, + "node_modules/marked": { + "version": "16.4.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz", + "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 20" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -9949,6 +10910,34 @@ "node": ">= 8" } }, + "node_modules/mermaid": { + "version": "11.12.2", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.12.2.tgz", + "integrity": "sha512-n34QPDPEKmaeCG4WDMGy0OT6PSyxKCfy2pJgShP+Qow2KLrvWjclwbc3yXfSIf4BanqWEhQEpngWwNp/XhZt6w==", + "license": "MIT", + "dependencies": { + "@braintree/sanitize-url": "^7.1.1", + "@iconify/utils": "^3.0.1", + "@mermaid-js/parser": "^0.6.3", + "@types/d3": "^7.4.3", + "cytoscape": "^3.29.3", + "cytoscape-cose-bilkent": "^4.1.0", + "cytoscape-fcose": "^2.2.0", + "d3": "^7.9.0", + "d3-sankey": "^0.12.3", + "dagre-d3-es": "7.0.13", + "dayjs": "^1.11.18", + "dompurify": "^3.2.5", + "katex": "^0.16.22", + "khroma": "^2.1.0", + "lodash-es": "^4.17.21", + "marked": "^16.2.1", + "roughjs": "^4.6.6", + "stylis": "^4.3.6", + "ts-dedent": "^2.2.0", + "uuid": "^11.1.0" + } + }, "node_modules/micromark": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", @@ -10622,16 +11611,15 @@ } }, "node_modules/mlly": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", - "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", - "dev": true, + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", "license": "MIT", "dependencies": { - "acorn": "^8.14.0", - "pathe": "^2.0.1", - "pkg-types": "^1.3.0", - "ufo": "^1.5.4" + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" } }, "node_modules/motion-dom": { @@ -10905,6 +11893,12 @@ "dev": true, "license": "BlueOak-1.0.0" }, + "node_modules/package-manager-detector": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.6.0.tgz", + "integrity": "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==", + "license": "MIT" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -10956,6 +11950,12 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/path-data-parser": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz", + "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==", + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -11011,7 +12011,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, "license": "MIT" }, "node_modules/picocolors": { @@ -11048,7 +12047,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dev": true, "license": "MIT", "dependencies": { "confbox": "^0.1.8", @@ -11056,6 +12054,22 @@ "pathe": "^2.0.1" } }, + "node_modules/points-on-curve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz", + "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==", + "license": "MIT" + }, + "node_modules/points-on-path": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz", + "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==", + "license": "MIT", + "dependencies": { + "path-data-parser": "0.1.0", + "points-on-curve": "0.2.0" + } + }, "node_modules/possible-typed-array-names": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", @@ -11086,7 +12100,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -11133,7 +12146,6 @@ "integrity": "sha512-5xGWRa90Sp2+x1dQtNpIpeOQpTDBs9cZDmA/qs2vDNN2i18PdapqY7CmBeyLlMuGqXJRIOPaCaVZTLNQRWUH/A==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -11347,7 +12359,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -11360,7 +12371,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -11374,7 +12384,6 @@ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.58.1.tgz", "integrity": "sha512-Lml/KZYEEFfPhUVgE0RdCVpnC4yhW+PndRhbiTtdvSlQTL8IfVR+iQkBjLIvmmc6+GGoVeM11z37ktKFPAb0FA==", "license": "MIT", - "peer": true, "engines": { "node": ">=18.0.0" }, @@ -11637,6 +12646,12 @@ "node": ">=0.10.0" } }, + "node_modules/robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==", + "license": "Unlicense" + }, "node_modules/rollup": { "version": "4.44.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.1.tgz", @@ -11677,6 +12692,18 @@ "fsevents": "~2.3.2" } }, + "node_modules/roughjs": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz", + "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==", + "license": "MIT", + "dependencies": { + "hachure-fill": "^0.5.2", + "path-data-parser": "^0.1.0", + "points-on-curve": "^0.2.0", + "points-on-path": "^0.2.1" + } + }, "node_modules/rrweb-cssom": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", @@ -11708,6 +12735,12 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause" + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -11740,7 +12773,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, "license": "MIT" }, "node_modules/saxes": { @@ -12225,6 +13257,12 @@ "inline-style-parser": "0.2.4" } }, + "node_modules/stylis": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz", + "integrity": "sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==", + "license": "MIT" + }, "node_modules/sucrase": { "version": "3.35.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", @@ -12415,7 +13453,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -12538,6 +13575,15 @@ "typescript": ">=4.8.4" } }, + "node_modules/ts-dedent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", + "integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==", + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, "node_modules/ts-interface-checker": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", @@ -12719,7 +13765,6 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -12755,7 +13800,6 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", - "dev": true, "license": "MIT" }, "node_modules/ui": { @@ -13074,7 +14118,6 @@ "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -13635,7 +14678,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -13643,6 +14685,55 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "license": "MIT", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", + "license": "MIT" + }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", @@ -14121,7 +15212,7 @@ } }, "typescript/@ragbits/api-client": { - "version": "1.4.0-dev.202512090236", + "version": "1.4.0-dev.202601010248", "license": "MIT", "devDependencies": { "@eslint/js": "^9.17.0", @@ -14140,7 +15231,7 @@ } }, "typescript/@ragbits/api-client-react": { - "version": "1.4.0-dev.202512090236", + "version": "1.4.0-dev.202601010248", "license": "MIT", "dependencies": { "@ragbits/api-client": "*" @@ -14312,7 +15403,6 @@ "integrity": "sha512-xQroKAadK503CrmbzCISvQUjeuvEZzv6U0wlnlVFOi5i3gnzfH4onyQ29f3lzpe0FresAiTAd3aqK0Bi/jLI8w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/expect": "4.0.7", "@vitest/mocker": "4.0.7", @@ -14527,7 +15617,6 @@ "integrity": "sha512-xQroKAadK503CrmbzCISvQUjeuvEZzv6U0wlnlVFOi5i3gnzfH4onyQ29f3lzpe0FresAiTAd3aqK0Bi/jLI8w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/expect": "4.0.7", "@vitest/mocker": "4.0.7", @@ -14617,6 +15706,7 @@ "immer": "^10.1.1", "isomorphic-dompurify": "^2.18.0", "lodash": "^4.17.21", + "mermaid": "^11.12.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "^7.55.0", @@ -14776,7 +15866,6 @@ "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cssstyle": "^4.2.1", "data-urls": "^5.0.0", diff --git a/packages/ragbits-chat/CHANGELOG.md b/packages/ragbits-chat/CHANGELOG.md index 0053f5af4c..20aca8cd0c 100644 --- a/packages/ragbits-chat/CHANGELOG.md +++ b/packages/ragbits-chat/CHANGELOG.md @@ -1,8 +1,8 @@ # CHANGELOG ## Unreleased +- [Mermaid](https://mermaid.js.org/) support in UI chat messages (#901) - Change auth backend from jwt to http-only cookie based authentication, add support for OAuth2 authentication (#867) - - Make `SummaryGenerator` optional in `ChatInterface` by providing a default Heuristic implementation. - Refactor ragbits-client types to remove excessive use of any (#881) - Split params into path params, query params in API client (#871) diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-Bq7UOJ7y.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-Bq7UOJ7y.js deleted file mode 100644 index 09cceca054..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-Bq7UOJ7y.js +++ /dev/null @@ -1 +0,0 @@ -import{r as h,j as t,aW as i,aE as p,c as b,bo as f,bp as l,bq as d,br as j,bs as S}from"./index-BZLU40Mk.js";import{a as r}from"./authStore-BfGlL8rp.js";import{u as m}from"./useInitializeUserStore-DyHP7g8x.js";const v=h.createContext(null);function y({children:e}){const[a]=h.useState(()=>r);return t.jsx(v.Provider,{value:a,children:e})}function A(){const{logout:e,login:a,setHydrated:c}=i(r,x=>x),u=m(),n=p(),s=b("/api/user"),g=f();return h.useEffect(()=>{(async()=>{try{const o=await s.call();o?(a(o),u(o.user_id),g.pathname==="/login"&&n("/")):e()}catch(o){console.error("Failed to check session:",o),e(),n("/login")}finally{c()}})()},[]),null}function z({children:e}){const a=f(),c=i(r,s=>s.isAuthenticated),u=i(r,s=>s.hasHydrated),n=i(r,s=>s.logout);return u?a.pathname==="/login"?t.jsx(l,{baseUrl:d,auth:{credentials:"include"},children:e}):c?t.jsx(y,{children:t.jsx(l,{baseUrl:d,auth:{onUnauthorized:n,credentials:"include"},children:e})}):t.jsx(S,{to:"/login",replace:!0}):t.jsxs(l,{baseUrl:d,auth:{credentials:"include"},children:[t.jsx(A,{}),t.jsx(j,{})]})}export{z as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-YvzFBBF3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-YvzFBBF3.js new file mode 100644 index 0000000000..1caa9151fc --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-YvzFBBF3.js @@ -0,0 +1 @@ +import{r as h,j as t,g as i,h as b,c as j,bx as f,by as l,bz as d,bA as p,bB as S}from"./index-DpOBiJiD.js";import{a as r}from"./authStore-BJzDjplU.js";import{u as m}from"./useInitializeUserStore-gUBPelSF.js";const y=h.createContext(null);function A({children:e}){const[a]=h.useState(()=>r);return t.jsx(y.Provider,{value:a,children:e})}function v(){const{logout:e,login:a,setHydrated:c}=i(r,x=>x),u=m(),n=b(),s=j("/api/user"),g=f();return h.useEffect(()=>{(async()=>{try{const o=await s.call();o?(a(o),u(o.user_id),g.pathname==="/login"&&n("/")):e()}catch(o){console.error("Failed to check session:",o),e(),n("/login")}finally{c()}})()},[]),null}function R({children:e}){const a=f(),c=i(r,s=>s.isAuthenticated),u=i(r,s=>s.hasHydrated),n=i(r,s=>s.logout);return u?a.pathname==="/login"?t.jsx(l,{baseUrl:d,auth:{credentials:"include"},children:e}):c?t.jsx(A,{children:t.jsx(l,{baseUrl:d,auth:{onUnauthorized:n,credentials:"include"},children:e})}):t.jsx(S,{to:"/login",replace:!0}):t.jsxs(l,{baseUrl:d,auth:{credentials:"include"},children:[t.jsx(v,{}),t.jsx(p,{})]})}export{R as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-4DVzRZ5a.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-4DVzRZ5a.js new file mode 100644 index 0000000000..ba059b4b4a --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-4DVzRZ5a.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BwaZSzWt.js","assets/index-DpOBiJiD.js","assets/index-CHZF0o4N.css"])))=>i.map(i=>d[i]); +import{r as P,b_ as se,b$ as Xe,n as W,c0 as De,c1 as Ye,j as t,c2 as me,c3 as xe,c4 as Ze,c5 as ye,c6 as Pe,c7 as et,c8 as R,c9 as tt,d as X,i as ae,A as Ie,ca as ot,cb as ke,cc as rt,bh as Ne,bi as st,cd as pe,be as at,ce as _e,cf as he,cg as nt,ch as lt,ci as it,bj as dt,cj as be,ck as ct,cl as ut,cm as pt,cn as ft,co as K,cp as Ae,cq as vt,l as ht,cr as bt,cs as gt,ct as mt,cu as xt,cv as yt,a as Pt,h as Ct,a_ as fe,cw as Ce,o as ve,D as we,I as Q,cx as wt,cy as $t,cz as $e}from"./index-DpOBiJiD.js";import{u as jt,$ as St,m as je,a as Mt,b as Dt,c as It,d as kt,e as Nt}from"./useMenuTriggerState-CsqkQBB_.js";import{$ as _t}from"./useSelectableItem-BZ_O-SpJ.js";import{i as At}from"./chunk-SSA7SXE4-CH4dnGpZ.js";var Ot=(e,r)=>{var n;let a=[];const s=(n=P.Children.map(e,d=>P.isValidElement(d)&&d.type===r?(a.push(d),null):d))==null?void 0:n.filter(Boolean),u=a.length>=0?a:void 0;return[s,u]},Ft=se({base:["w-full","p-1","min-w-[200px]"]});se({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Xe,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});se({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});se({base:"w-full flex flex-col gap-0.5 p-1"});var Et=(e,r)=>{if(!e&&!r)return{};const n=new Set([...Object.keys(e||{}),...Object.keys(r||{})]);return Array.from(n).reduce((a,s)=>({...a,[s]:W(e?.[s],r?.[s])}),{})},[Tt,Oe]=De({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),Se=()=>Ze(()=>import("./index-BwaZSzWt.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fe=e=>{const{as:r,children:n,className:a,...s}=e,{Component:u,placement:d,backdrop:h,motionProps:l,disableAnimation:c,getPopoverProps:p,getDialogProps:w,getBackdropProps:b,getContentProps:x,isNonModal:I,onClose:j}=Oe(),f=P.useRef(null),{dialogProps:D,titleProps:M}=Ye({},f),y=w({ref:f,...D,...s}),S=r||u||"div",i=t.jsxs(t.Fragment,{children:[!I&&t.jsx(me,{onDismiss:j}),t.jsx(S,{...y,children:t.jsx("div",{...x({className:a}),children:typeof n=="function"?n(M):n})}),t.jsx(me,{onDismiss:j})]}),v=P.useMemo(()=>h==="transparent"?null:c?t.jsx("div",{...b()}):t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"exit",variants:Pe.fade,...b()})}),[h,c,b]),k=d?et(d==="center"?"top":d):void 0,o=t.jsx(t.Fragment,{children:c?i:t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"initial",style:k,variants:Pe.scaleSpringOpacity,...l,children:i})})});return t.jsxs("div",{...p(),children:[v,o]})};Fe.displayName="HeroUI.PopoverContent";var Rt=Fe,Ee=e=>{var r;const{triggerRef:n,getTriggerProps:a}=Oe(),{children:s,...u}=e,d=P.useMemo(()=>typeof s=="string"?t.jsx("p",{children:s}):P.Children.only(s),[s]),h=(r=d.props.ref)!=null?r:d.ref,{onPress:l,isDisabled:c,...p}=P.useMemo(()=>a(R(u,d.props),h),[a,d.props,u,h]),[,w]=Ot(s,X),{buttonProps:b}=tt({onPress:l,isDisabled:c},n),x=P.useMemo(()=>w?.[0]!==void 0,[w]);return x||delete p.preventFocusOnPress,P.cloneElement(d,R(p,x?{onPress:l,isDisabled:c}:b))};Ee.displayName="HeroUI.PopoverTrigger";var Ht=Ee,Te=ae((e,r)=>{const{children:n,...a}=e,s=jt({...a,ref:r}),[u,d]=P.Children.toArray(n),h=t.jsx(ot,{portalContainer:s.portalContainer,children:d});return t.jsxs(Tt,{value:s,children:[u,s.disableAnimation&&s.isOpen?h:t.jsx(Ie,{children:s.isOpen?h:null})]})});Te.displayName="HeroUI.Popover";var Ut=Te,[Kt,Re]=De({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function Bt(e){const{isSelected:r,disableAnimation:n,...a}=e;return t.jsx("svg",{"aria-hidden":"true","data-selected":r,role:"presentation",viewBox:"0 0 17 18",...a,children:t.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:r?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const He=new WeakMap;function Vt(e,r,n){let{shouldFocusWrap:a=!0,onKeyDown:s,onKeyUp:u,...d}=e;!e["aria-label"]&&e["aria-labelledby"];let h=ke(e,{labelable:!0}),{listProps:l}=rt({...d,ref:n,selectionManager:r.selectionManager,collection:r.collection,disabledKeys:r.disabledKeys,shouldFocusWrap:a,linkBehavior:"override"});return He.set(r,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ne(h,{onKeyDown:s,onKeyUp:u},{role:"menu",...l,onKeyDown:c=>{var p;(c.key!=="Escape"||e.shouldUseVirtualFocus)&&((p=l.onKeyDown)===null||p===void 0||p.call(l,c))}})}}function Lt(e,r,n){let{id:a,key:s,closeOnSelect:u,isVirtualized:d,"aria-haspopup":h,onPressStart:l,onPressUp:c,onPress:p,onPressChange:w,onPressEnd:b,onHoverStart:x,onHoverChange:I,onHoverEnd:j,onKeyDown:f,onKeyUp:D,onFocus:M,onFocusChange:y,onBlur:S,selectionManager:i=r.selectionManager}=e,v=!!h,k=v&&e["aria-expanded"]==="true";var o;let C=(o=e.isDisabled)!==null&&o!==void 0?o:i.isDisabled(s);var _;let A=(_=e.isSelected)!==null&&_!==void 0?_:i.isSelected(s),N=He.get(r),g=r.collection.getItem(s),T=e.onClose||N.onClose,B=st(),$=m=>{var J;if(!v){if(!(g==null||(J=g.props)===null||J===void 0)&&J.onAction?g.props.onAction():e.onAction&&e.onAction(s),N.onAction){let ce=N.onAction;ce(s)}m.target instanceof HTMLAnchorElement&&g&&B.open(m.target,m,g.props.href,g.props.routerOptions)}},E="menuitem";v||(i.selectionMode==="single"?E="menuitemradio":i.selectionMode==="multiple"&&(E="menuitemcheckbox"));let O=pe(),H=pe(),q=pe(),V={id:a,"aria-disabled":C||void 0,role:E,"aria-label":e["aria-label"],"aria-labelledby":O,"aria-describedby":[H,q].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":h,"aria-expanded":e["aria-expanded"]};i.selectionMode!=="none"&&!v&&(V["aria-checked"]=A),d&&(V["aria-posinset"]=g?.index,V["aria-setsize"]=St(r.collection));let G=m=>{m.pointerType==="keyboard"&&$(m),l?.(m)},Y=()=>{!v&&T&&(u??(i.selectionMode!=="multiple"||i.isLink(s)))&&T()},Z=m=>{m.pointerType==="mouse"&&($(m),Y()),c?.(m)},ne=m=>{m.pointerType!=="keyboard"&&m.pointerType!=="mouse"&&($(m),Y()),p?.(m)},{itemProps:L,isFocused:ee}=_t({id:a,selectionManager:i,key:s,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:N.shouldUseVirtualFocus}),{pressProps:le,isPressed:te}=at({onPressStart:G,onPress:ne,onPressUp:Z,onPressChange:w,onPressEnd:b,isDisabled:C}),{hoverProps:ie}=_e({isDisabled:C,onHoverStart(m){!he()&&!(k&&h)&&(i.setFocused(!0),i.setFocusedKey(s)),x?.(m)},onHoverChange:I,onHoverEnd:j}),{keyboardProps:oe}=nt({onKeyDown:m=>{if(m.repeat){m.continuePropagation();return}switch(m.key){case" ":!C&&i.selectionMode==="none"&&!v&&u!==!1&&T&&T();break;case"Enter":!C&&u!==!1&&!v&&T&&T();break;default:v||m.continuePropagation(),f?.(m);break}},onKeyUp:D}),{focusProps:U}=lt({onBlur:S,onFocus:M,onFocusChange:y}),re=ke(g?.props);delete re.id;let de=it(g?.props);return{menuItemProps:{...V,...Ne(re,de,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,le,ie,oe,U,N.shouldUseVirtualFocus||v?{onMouseDown:m=>m.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&k&&!N.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:O},descriptionProps:{id:H},keyboardShortcutProps:{id:q},isFocused:ee,isFocusVisible:ee&&i.isFocused&&he()&&!k,isSelected:A,isPressed:te,isDisabled:C}}function zt(e){let{heading:r,"aria-label":n}=e,a=dt();return{itemProps:{role:"presentation"},headingProps:r?{id:a,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":r?a:void 0}}}function Wt(e){var r,n;const a=be(),[s,u]=ct(e,je.variantKeys),{as:d,item:h,state:l,shortcut:c,description:p,startContent:w,endContent:b,isVirtualized:x,selectedIcon:I,className:j,classNames:f,onAction:D,autoFocus:M,onPress:y,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,onHoverStart:o,onHoverChange:C,onHoverEnd:_,hideSelectedIcon:A=!1,isReadOnly:N=!1,closeOnSelect:g,onClose:T,onClick:B,...$}=s,E=(n=(r=e.disableAnimation)!=null?r:a?.disableAnimation)!=null?n:!1,O=P.useRef(null),H=d||($?.href?"a":"li"),q=typeof H=="string",{rendered:V,key:G}=h,Y=l.disabledKeys.has(G)||e.isDisabled,Z=l.selectionManager.selectionMode!=="none",ne=Mt(),{isFocusVisible:L,focusProps:ee}=ut({autoFocus:M}),le=P.useCallback(F=>{B?.(F),y?.(F)},[B,y]),{isPressed:te,isFocused:ie,isSelected:oe,isDisabled:U,menuItemProps:re,labelProps:de,descriptionProps:m,keyboardShortcutProps:J}=Lt({key:G,onClose:T,isDisabled:Y,onPress:le,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,"aria-label":s["aria-label"],closeOnSelect:g,isVirtualized:x,onAction:D},l,O);let{hoverProps:ce,isHovered:ge}=_e({isDisabled:U,onHoverStart(F){he()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(G)),o?.(F)},onHoverChange:C,onHoverEnd:_}),ue=re;const z=P.useMemo(()=>je({...u,isDisabled:U,disableAnimation:E,hasTitleTextChild:typeof V=="string",hasDescriptionTextChild:typeof p=="string"}),[pt(u),U,E,V,p]),ze=W(f?.base,j);N&&(ue=ft(ue));const We=(F={})=>({ref:O,...R(N?{}:ee,Ae($,{enabled:q}),ue,ce,F),"data-focus":K(ie),"data-selectable":K(Z),"data-hover":K(ne?ge||te:ge),"data-disabled":K(U),"data-selected":K(oe),"data-pressed":K(te),"data-focus-visible":K(L),className:z.base({class:W(ze,F.className)})}),qe=(F={})=>({...R(de,F),className:z.title({class:f?.title})}),Ge=(F={})=>({...R(m,F),className:z.description({class:f?.description})}),Je=(F={})=>({...R(J,F),className:z.shortcut({class:f?.shortcut})}),Qe=P.useCallback((F={})=>({"aria-hidden":K(!0),"data-disabled":K(U),className:z.selectedIcon({class:f?.selectedIcon}),...F}),[U,z,f]);return{Component:H,domRef:O,slots:z,classNames:f,isSelectable:Z,isSelected:oe,isDisabled:U,rendered:V,shortcut:c,description:p,startContent:w,endContent:b,selectedIcon:I,disableAnimation:E,getItemProps:We,getLabelProps:qe,hideSelectedIcon:A,getDescriptionProps:Ge,getKeyboardShortcutProps:Je,getSelectedIconProps:Qe}}var Ue=e=>{const{Component:r,slots:n,classNames:a,rendered:s,shortcut:u,description:d,isSelectable:h,isSelected:l,isDisabled:c,selectedIcon:p,startContent:w,endContent:b,disableAnimation:x,hideSelectedIcon:I,getItemProps:j,getLabelProps:f,getDescriptionProps:D,getKeyboardShortcutProps:M,getSelectedIconProps:y}=Wt(e),S=P.useMemo(()=>{const i=t.jsx(Bt,{disableAnimation:x,isSelected:l});return typeof p=="function"?p({icon:i,isSelected:l,isDisabled:c}):p||i},[p,l,c,x]);return t.jsxs(r,{...j(),children:[w,d?t.jsxs("div",{className:n.wrapper({class:a?.wrapper}),children:[t.jsx("span",{...f(),children:s}),t.jsx("span",{...D(),children:d})]}):t.jsx("span",{...f(),children:s}),u&&t.jsx("kbd",{...M(),children:u}),h&&!I&&t.jsx("span",{...y(),children:S}),b]})};Ue.displayName="HeroUI.MenuItem";var Ke=Ue,Be=ae(({item:e,state:r,as:n,variant:a,color:s,disableAnimation:u,onAction:d,closeOnSelect:h,className:l,classNames:c,showDivider:p=!1,hideSelectedIcon:w,dividerProps:b={},itemClasses:x,title:I,...j},f)=>{const D=n||"li",M=P.useMemo(()=>Dt(),[]),y=W(c?.base,l),S=W(c?.divider,b?.className),{itemProps:i,headingProps:v,groupProps:k}=zt({heading:e.rendered,"aria-label":e["aria-label"]});return t.jsxs(D,{"data-slot":"base",...R(i,j),className:M.base({class:y}),children:[e.rendered&&t.jsx("span",{...v,className:M.heading({class:c?.heading}),"data-slot":"heading",children:e.rendered}),t.jsxs("ul",{...k,className:M.group({class:c?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(o=>{const{key:C,props:_}=o;let A=t.jsx(Ke,{classNames:x,closeOnSelect:h,color:s,disableAnimation:u,hideSelectedIcon:w,item:o,state:r,variant:a,onAction:d,..._},C);return o.wrapper&&(A=o.wrapper(A)),A}),p&&t.jsx(vt,{as:"li",className:M.divider({class:S}),...b})]})]})});Be.displayName="HeroUI.MenuSection";var qt=Be;function Gt(e){var r;const n=be(),{as:a,ref:s,variant:u,color:d,children:h,disableAnimation:l=(r=n?.disableAnimation)!=null?r:!1,onAction:c,closeOnSelect:p,itemClasses:w,className:b,state:x,topContent:I,bottomContent:j,hideEmptyContent:f=!1,hideSelectedIcon:D=!1,emptyContent:M="No items.",menuProps:y,onClose:S,classNames:i,...v}=e,k=a||"ul",o=ht(s),C=typeof k=="string",_=bt({...v,...y,children:h}),A=x||_,{menuProps:N}=Vt({...v,...y,onAction:c},A,o),g=P.useMemo(()=>It({className:b}),[b]),T=W(i?.base,b);return{Component:k,state:A,variant:u,color:d,disableAnimation:l,onClose:S,topContent:I,bottomContent:j,closeOnSelect:p,className:b,itemClasses:w,getBaseProps:(O={})=>({ref:o,"data-slot":"base",className:g.base({class:T}),...Ae(v,{enabled:C}),...O}),getListProps:(O={})=>({"data-slot":"list",className:g.list({class:i?.list}),...N,...O}),hideEmptyContent:f,hideSelectedIcon:D,getEmptyContentProps:(O={})=>({children:M,className:g.emptyContent({class:i?.emptyContent}),...O})}}var Jt=ae(function(r,n){const{Component:a,state:s,closeOnSelect:u,color:d,disableAnimation:h,hideSelectedIcon:l,hideEmptyContent:c,variant:p,onClose:w,topContent:b,bottomContent:x,itemClasses:I,getBaseProps:j,getListProps:f,getEmptyContentProps:D}=Gt({...r,ref:n}),M=t.jsxs(a,{...f(),children:[!s.collection.size&&!c&&t.jsx("li",{children:t.jsx("div",{...D()})}),[...s.collection].map(y=>{const S={closeOnSelect:u,color:d,disableAnimation:h,item:y,state:s,variant:p,onClose:w,hideSelectedIcon:l,...y.props},i=Et(I,S?.classNames);if(y.type==="section")return t.jsx(qt,{...S,itemClasses:i},y.key);let v=t.jsx(Ke,{...S,classNames:i},y.key);return y.wrapper&&(v=y.wrapper(v)),v})]});return t.jsxs("div",{...j(),children:[b,M,x]})}),Qt=Jt,Xt=gt,Me=Xt,Yt=ae(function(r,n){const{getMenuProps:a}=Re();return t.jsx(Rt,{children:t.jsx(mt,{contain:!0,restoreFocus:!0,children:t.jsx(Qt,{...a(r,n)})})})}),Zt=Yt,Ve=e=>{const{getMenuTriggerProps:r}=Re(),{children:n,...a}=e;return t.jsx(Ht,{...r(a),children:n})};Ve.displayName="HeroUI.DropdownTrigger";var eo=Ve,to=(e,r)=>{if(e){const n=Array.isArray(e.children)?e.children:[...e?.items||[]];if(n&&n.length)return n.find(s=>{if(s&&s.key===r)return s})||{}}return null},oo=(e,r,n)=>{const a=n||to(e,r);return a&&a.props&&"closeOnSelect"in a.props?a.props.closeOnSelect:e?.closeOnSelect};function ro(e){var r;const n=be(),{as:a,triggerRef:s,isOpen:u,defaultOpen:d,onOpenChange:h,isDisabled:l,type:c="menu",trigger:p="press",placement:w="bottom",closeOnSelect:b=!0,shouldBlockScroll:x=!0,classNames:I,disableAnimation:j=(r=n?.disableAnimation)!=null?r:!1,onClose:f,className:D,...M}=e,y=a||"div",S=P.useRef(null),i=s||S,v=P.useRef(null),k=P.useRef(null),o=kt({trigger:p,isOpen:u,defaultOpen:d,onOpenChange:$=>{h?.($),$||f?.()}}),{menuTriggerProps:C,menuProps:_}=Nt({type:c,trigger:p,isDisabled:l},o,i),A=P.useMemo(()=>Ft({className:D}),[D]),N=$=>{$!==void 0&&!$||b&&o.close()},g=($={})=>{const E=R(M,$);return{state:o,placement:w,ref:k,disableAnimation:j,shouldBlockScroll:x,scrollRef:v,triggerRef:i,...E,classNames:{...I,...$.classNames,content:W(A,I?.content,$.className)}}},T=($={})=>{const{onPress:E,onPressStart:O,...H}=C;return R(H,{isDisabled:l},$)},B=($,E=null)=>({ref:xt(E,v),menuProps:_,closeOnSelect:b,...R($,{onAction:(O,H)=>{const q=oo($,O,H);N(q)},onClose:o.close})});return{Component:y,menuRef:v,menuProps:_,closeOnSelect:b,onClose:o.close,autoFocus:o.focusStrategy||!0,disableAnimation:j,getPopoverProps:g,getMenuProps:B,getMenuTriggerProps:T}}var Le=e=>{const{children:r,...n}=e,a=ro(n),[s,u]=yt.Children.toArray(r);return t.jsx(Kt,{value:a,children:t.jsxs(Ut,{...a.getPopoverProps(),children:[s,u]})})};Le.displayName="HeroUI.Dropdown";var so=Le;function co(){const{selectConversation:e,deleteConversation:r,newConversation:n,setConversationProperties:a}=Pt(),s=Ct(),u=fe(Ce(o=>Object.keys(o.conversations).reverse())),d=fe(Ce(o=>Object.values(o.conversations).reverse().map(C=>C.summary))),h=fe(o=>o.currentConversation),[l,c]=P.useState(!1),[p,w]=P.useState(null),[b,x]=P.useState(""),[I,j]=P.useState(!1),f=P.useRef(null),D=l?"Open sidebar":"Close sidebar",M=t.jsx(Q,{icon:"heroicons:pencil-square"}),y=(o,C)=>{w(o),x(C??""),j(!0),setTimeout(()=>{f.current?.focus?.(),setTimeout(()=>j(!1),120)},0)},S=o=>{if(p!==o)return;const C=(b||"").trim();C&&a(o,{summary:C}),w(null),x(""),j(!1)},i=()=>{w(null),x(""),j(!1)},v=()=>{const o=n();s($e(o))},k=o=>{e(o),s($e(o))};return t.jsx(ve.div,{initial:!1,animate:{maxWidth:l?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(Ie,{children:[t.jsx(we,{content:D,placement:"bottom",children:t.jsx(X,{isIconOnly:!0,"aria-label":D,variant:"ghost",onPress:()=>c(o=>!o),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(Q,{icon:l?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!l&&t.jsx(ve.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(we,{content:"New conversation",placement:"right",children:t.jsx(X,{"aria-label":"New conversation",variant:"ghost",onPress:v,"data-testid":"chat-history-clear-chat-button",startContent:M,isIconOnly:l,children:!l&&"New conversation"})},"new-conversation-button"),!l&&t.jsx(ve.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:wt.zip(u,d).map(([o,C])=>{if(!o||$t(o))return null;const _=o===h,A=o===p,N=_?"solid":"light";return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[A?t.jsx(At,{ref:f,size:"sm",variant:"bordered",value:b,onChange:g=>x(g.target.value),onBlur:()=>{I||S(o)},onKeyDown:g=>{g.key==="Enter"&&S(o),g.key==="Escape"&&i()},className:"flex-1","data-testid":`input-conversation-${o}`}):t.jsx(X,{variant:N,"aria-label":`Select conversation ${o}`,"data-active":_,onPress:()=>k(o),title:C??o,"data-testid":`select-conversation-${o}`,className:"flex-1 justify-start",children:t.jsx("div",{className:"text-small truncate",children:C??o})}),t.jsxs(so,{children:[t.jsx(eo,{children:t.jsx(X,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${o}`,"data-testid":`dropdown-conversation-${o}`,children:t.jsx(Q,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),t.jsxs(Zt,{"aria-label":"Conversation actions",children:[t.jsx(Me,{startContent:t.jsx(Q,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>y(o,C??o),"data-testid":`edit-conversation-${o}`,children:"Edit"},"edit"),t.jsx(Me,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(Q,{icon:"heroicons:trash"}),onPress:()=>r(o),"data-testid":`delete-conversation-${o}`,children:"Delete conversation"},"delete")]})]})]},`${o}-${N}`)})},"conversation-list")]})})}export{co as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B2hLBYMJ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B2hLBYMJ.js deleted file mode 100644 index 0842adb032..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-B2hLBYMJ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bvn9K6h_.js","assets/index-BZLU40Mk.js","assets/index-ClAYkAiv.css"])))=>i.map(i=>d[i]); -import{r as P,t as ae,k as Xe,Z as W,ax as Me,$ as Ze,j as t,q as me,L as xe,_ as Ye,n as ye,T as Pe,s as et,v as R,V as tt,d as X,l as se,aq as Ie,o as ot,H as ke,a9 as rt,J as Ne,ay as at,ac as pe,U as st,X as _e,af as he,az as nt,aA as lt,ag as it,K as dt,O as be,Q as ct,W as ut,a0 as pt,ah as ft,a2 as K,a3 as Ae,ai as vt,R as ht,aB as bt,a8 as gt,aC as mt,aD as xt,a5 as yt,a as Pt,aE as Ct,i as fe,aF as Ce,aG as ve,D as we,I as Q,as as wt,aH as $t,aI as $e}from"./index-BZLU40Mk.js";import{u as jt,b as St,c as je,d as Dt,e as Mt,m as It,$ as kt,a as Nt}from"./useMenuTriggerState-SaFmATkk.js";import{$ as _t}from"./useSelectableItem-DhuFnc0W.js";import{i as At}from"./chunk-SSA7SXE4-CJa0HuAU.js";var Ot=(e,r)=>{var n;let s=[];const a=(n=P.Children.map(e,d=>P.isValidElement(d)&&d.type===r?(s.push(d),null):d))==null?void 0:n.filter(Boolean),u=s.length>=0?s:void 0;return[a,u]},Ft=ae({base:["w-full","p-1","min-w-[200px]"]});ae({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Xe,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});ae({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});ae({base:"w-full flex flex-col gap-0.5 p-1"});var Et=(e,r)=>{if(!e&&!r)return{};const n=new Set([...Object.keys(e||{}),...Object.keys(r||{})]);return Array.from(n).reduce((s,a)=>({...s,[a]:W(e?.[a],r?.[a])}),{})},[Tt,Oe]=Me({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),Se=()=>Ye(()=>import("./index-Bvn9K6h_.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fe=e=>{const{as:r,children:n,className:s,...a}=e,{Component:u,placement:d,backdrop:h,motionProps:l,disableAnimation:c,getPopoverProps:p,getDialogProps:w,getBackdropProps:b,getContentProps:x,isNonModal:I,onClose:j}=Oe(),f=P.useRef(null),{dialogProps:M,titleProps:D}=Ze({},f),y=w({ref:f,...M,...a}),S=r||u||"div",i=t.jsxs(t.Fragment,{children:[!I&&t.jsx(me,{onDismiss:j}),t.jsx(S,{...y,children:t.jsx("div",{...x({className:s}),children:typeof n=="function"?n(D):n})}),t.jsx(me,{onDismiss:j})]}),v=P.useMemo(()=>h==="transparent"?null:c?t.jsx("div",{...b()}):t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"exit",variants:Pe.fade,...b()})}),[h,c,b]),k=d?et(d==="center"?"top":d):void 0,o=t.jsx(t.Fragment,{children:c?i:t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"initial",style:k,variants:Pe.scaleSpringOpacity,...l,children:i})})});return t.jsxs("div",{...p(),children:[v,o]})};Fe.displayName="HeroUI.PopoverContent";var Rt=Fe,Ee=e=>{var r;const{triggerRef:n,getTriggerProps:s}=Oe(),{children:a,...u}=e,d=P.useMemo(()=>typeof a=="string"?t.jsx("p",{children:a}):P.Children.only(a),[a]),h=(r=d.props.ref)!=null?r:d.ref,{onPress:l,isDisabled:c,...p}=P.useMemo(()=>s(R(u,d.props),h),[s,d.props,u,h]),[,w]=Ot(a,X),{buttonProps:b}=tt({onPress:l,isDisabled:c},n),x=P.useMemo(()=>w?.[0]!==void 0,[w]);return x||delete p.preventFocusOnPress,P.cloneElement(d,R(p,x?{onPress:l,isDisabled:c}:b))};Ee.displayName="HeroUI.PopoverTrigger";var Ht=Ee,Te=se((e,r)=>{const{children:n,...s}=e,a=jt({...s,ref:r}),[u,d]=P.Children.toArray(n),h=t.jsx(ot,{portalContainer:a.portalContainer,children:d});return t.jsxs(Tt,{value:a,children:[u,a.disableAnimation&&a.isOpen?h:t.jsx(Ie,{children:a.isOpen?h:null})]})});Te.displayName="HeroUI.Popover";var Ut=Te,[Kt,Re]=Me({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function Bt(e){const{isSelected:r,disableAnimation:n,...s}=e;return t.jsx("svg",{"aria-hidden":"true","data-selected":r,role:"presentation",viewBox:"0 0 17 18",...s,children:t.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:r?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const He=new WeakMap;function Vt(e,r,n){let{shouldFocusWrap:s=!0,onKeyDown:a,onKeyUp:u,...d}=e;!e["aria-label"]&&e["aria-labelledby"];let h=ke(e,{labelable:!0}),{listProps:l}=rt({...d,ref:n,selectionManager:r.selectionManager,collection:r.collection,disabledKeys:r.disabledKeys,shouldFocusWrap:s,linkBehavior:"override"});return He.set(r,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ne(h,{onKeyDown:a,onKeyUp:u},{role:"menu",...l,onKeyDown:c=>{var p;(c.key!=="Escape"||e.shouldUseVirtualFocus)&&((p=l.onKeyDown)===null||p===void 0||p.call(l,c))}})}}function Lt(e,r,n){let{id:s,key:a,closeOnSelect:u,isVirtualized:d,"aria-haspopup":h,onPressStart:l,onPressUp:c,onPress:p,onPressChange:w,onPressEnd:b,onHoverStart:x,onHoverChange:I,onHoverEnd:j,onKeyDown:f,onKeyUp:M,onFocus:D,onFocusChange:y,onBlur:S,selectionManager:i=r.selectionManager}=e,v=!!h,k=v&&e["aria-expanded"]==="true";var o;let C=(o=e.isDisabled)!==null&&o!==void 0?o:i.isDisabled(a);var _;let A=(_=e.isSelected)!==null&&_!==void 0?_:i.isSelected(a),N=He.get(r),g=r.collection.getItem(a),T=e.onClose||N.onClose,B=at(),$=m=>{var J;if(!v){if(!(g==null||(J=g.props)===null||J===void 0)&&J.onAction?g.props.onAction():e.onAction&&e.onAction(a),N.onAction){let ce=N.onAction;ce(a)}m.target instanceof HTMLAnchorElement&&g&&B.open(m.target,m,g.props.href,g.props.routerOptions)}},E="menuitem";v||(i.selectionMode==="single"?E="menuitemradio":i.selectionMode==="multiple"&&(E="menuitemcheckbox"));let O=pe(),H=pe(),q=pe(),V={id:s,"aria-disabled":C||void 0,role:E,"aria-label":e["aria-label"],"aria-labelledby":O,"aria-describedby":[H,q].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":h,"aria-expanded":e["aria-expanded"]};i.selectionMode!=="none"&&!v&&(V["aria-checked"]=A),d&&(V["aria-posinset"]=g?.index,V["aria-setsize"]=St(r.collection));let G=m=>{m.pointerType==="keyboard"&&$(m),l?.(m)},Z=()=>{!v&&T&&(u??(i.selectionMode!=="multiple"||i.isLink(a)))&&T()},Y=m=>{m.pointerType==="mouse"&&($(m),Z()),c?.(m)},ne=m=>{m.pointerType!=="keyboard"&&m.pointerType!=="mouse"&&($(m),Z()),p?.(m)},{itemProps:L,isFocused:ee}=_t({id:s,selectionManager:i,key:a,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:N.shouldUseVirtualFocus}),{pressProps:le,isPressed:te}=st({onPressStart:G,onPress:ne,onPressUp:Y,onPressChange:w,onPressEnd:b,isDisabled:C}),{hoverProps:ie}=_e({isDisabled:C,onHoverStart(m){!he()&&!(k&&h)&&(i.setFocused(!0),i.setFocusedKey(a)),x?.(m)},onHoverChange:I,onHoverEnd:j}),{keyboardProps:oe}=nt({onKeyDown:m=>{if(m.repeat){m.continuePropagation();return}switch(m.key){case" ":!C&&i.selectionMode==="none"&&!v&&u!==!1&&T&&T();break;case"Enter":!C&&u!==!1&&!v&&T&&T();break;default:v||m.continuePropagation(),f?.(m);break}},onKeyUp:M}),{focusProps:U}=lt({onBlur:S,onFocus:D,onFocusChange:y}),re=ke(g?.props);delete re.id;let de=it(g?.props);return{menuItemProps:{...V,...Ne(re,de,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,le,ie,oe,U,N.shouldUseVirtualFocus||v?{onMouseDown:m=>m.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&k&&!N.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:O},descriptionProps:{id:H},keyboardShortcutProps:{id:q},isFocused:ee,isFocusVisible:ee&&i.isFocused&&he()&&!k,isSelected:A,isPressed:te,isDisabled:C}}function zt(e){let{heading:r,"aria-label":n}=e,s=dt();return{itemProps:{role:"presentation"},headingProps:r?{id:s,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":r?s:void 0}}}function Wt(e){var r,n;const s=be(),[a,u]=ct(e,je.variantKeys),{as:d,item:h,state:l,shortcut:c,description:p,startContent:w,endContent:b,isVirtualized:x,selectedIcon:I,className:j,classNames:f,onAction:M,autoFocus:D,onPress:y,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,onHoverStart:o,onHoverChange:C,onHoverEnd:_,hideSelectedIcon:A=!1,isReadOnly:N=!1,closeOnSelect:g,onClose:T,onClick:B,...$}=a,E=(n=(r=e.disableAnimation)!=null?r:s?.disableAnimation)!=null?n:!1,O=P.useRef(null),H=d||($?.href?"a":"li"),q=typeof H=="string",{rendered:V,key:G}=h,Z=l.disabledKeys.has(G)||e.isDisabled,Y=l.selectionManager.selectionMode!=="none",ne=Dt(),{isFocusVisible:L,focusProps:ee}=ut({autoFocus:D}),le=P.useCallback(F=>{B?.(F),y?.(F)},[B,y]),{isPressed:te,isFocused:ie,isSelected:oe,isDisabled:U,menuItemProps:re,labelProps:de,descriptionProps:m,keyboardShortcutProps:J}=Lt({key:G,onClose:T,isDisabled:Z,onPress:le,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,"aria-label":a["aria-label"],closeOnSelect:g,isVirtualized:x,onAction:M},l,O);let{hoverProps:ce,isHovered:ge}=_e({isDisabled:U,onHoverStart(F){he()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(G)),o?.(F)},onHoverChange:C,onHoverEnd:_}),ue=re;const z=P.useMemo(()=>je({...u,isDisabled:U,disableAnimation:E,hasTitleTextChild:typeof V=="string",hasDescriptionTextChild:typeof p=="string"}),[pt(u),U,E,V,p]),ze=W(f?.base,j);N&&(ue=ft(ue));const We=(F={})=>({ref:O,...R(N?{}:ee,Ae($,{enabled:q}),ue,ce,F),"data-focus":K(ie),"data-selectable":K(Y),"data-hover":K(ne?ge||te:ge),"data-disabled":K(U),"data-selected":K(oe),"data-pressed":K(te),"data-focus-visible":K(L),className:z.base({class:W(ze,F.className)})}),qe=(F={})=>({...R(de,F),className:z.title({class:f?.title})}),Ge=(F={})=>({...R(m,F),className:z.description({class:f?.description})}),Je=(F={})=>({...R(J,F),className:z.shortcut({class:f?.shortcut})}),Qe=P.useCallback((F={})=>({"aria-hidden":K(!0),"data-disabled":K(U),className:z.selectedIcon({class:f?.selectedIcon}),...F}),[U,z,f]);return{Component:H,domRef:O,slots:z,classNames:f,isSelectable:Y,isSelected:oe,isDisabled:U,rendered:V,shortcut:c,description:p,startContent:w,endContent:b,selectedIcon:I,disableAnimation:E,getItemProps:We,getLabelProps:qe,hideSelectedIcon:A,getDescriptionProps:Ge,getKeyboardShortcutProps:Je,getSelectedIconProps:Qe}}var Ue=e=>{const{Component:r,slots:n,classNames:s,rendered:a,shortcut:u,description:d,isSelectable:h,isSelected:l,isDisabled:c,selectedIcon:p,startContent:w,endContent:b,disableAnimation:x,hideSelectedIcon:I,getItemProps:j,getLabelProps:f,getDescriptionProps:M,getKeyboardShortcutProps:D,getSelectedIconProps:y}=Wt(e),S=P.useMemo(()=>{const i=t.jsx(Bt,{disableAnimation:x,isSelected:l});return typeof p=="function"?p({icon:i,isSelected:l,isDisabled:c}):p||i},[p,l,c,x]);return t.jsxs(r,{...j(),children:[w,d?t.jsxs("div",{className:n.wrapper({class:s?.wrapper}),children:[t.jsx("span",{...f(),children:a}),t.jsx("span",{...M(),children:d})]}):t.jsx("span",{...f(),children:a}),u&&t.jsx("kbd",{...D(),children:u}),h&&!I&&t.jsx("span",{...y(),children:S}),b]})};Ue.displayName="HeroUI.MenuItem";var Ke=Ue,Be=se(({item:e,state:r,as:n,variant:s,color:a,disableAnimation:u,onAction:d,closeOnSelect:h,className:l,classNames:c,showDivider:p=!1,hideSelectedIcon:w,dividerProps:b={},itemClasses:x,title:I,...j},f)=>{const M=n||"li",D=P.useMemo(()=>Mt(),[]),y=W(c?.base,l),S=W(c?.divider,b?.className),{itemProps:i,headingProps:v,groupProps:k}=zt({heading:e.rendered,"aria-label":e["aria-label"]});return t.jsxs(M,{"data-slot":"base",...R(i,j),className:D.base({class:y}),children:[e.rendered&&t.jsx("span",{...v,className:D.heading({class:c?.heading}),"data-slot":"heading",children:e.rendered}),t.jsxs("ul",{...k,className:D.group({class:c?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(o=>{const{key:C,props:_}=o;let A=t.jsx(Ke,{classNames:x,closeOnSelect:h,color:a,disableAnimation:u,hideSelectedIcon:w,item:o,state:r,variant:s,onAction:d,..._},C);return o.wrapper&&(A=o.wrapper(A)),A}),p&&t.jsx(vt,{as:"li",className:D.divider({class:S}),...b})]})]})});Be.displayName="HeroUI.MenuSection";var qt=Be;function Gt(e){var r;const n=be(),{as:s,ref:a,variant:u,color:d,children:h,disableAnimation:l=(r=n?.disableAnimation)!=null?r:!1,onAction:c,closeOnSelect:p,itemClasses:w,className:b,state:x,topContent:I,bottomContent:j,hideEmptyContent:f=!1,hideSelectedIcon:M=!1,emptyContent:D="No items.",menuProps:y,onClose:S,classNames:i,...v}=e,k=s||"ul",o=ht(a),C=typeof k=="string",_=bt({...v,...y,children:h}),A=x||_,{menuProps:N}=Vt({...v,...y,onAction:c},A,o),g=P.useMemo(()=>It({className:b}),[b]),T=W(i?.base,b);return{Component:k,state:A,variant:u,color:d,disableAnimation:l,onClose:S,topContent:I,bottomContent:j,closeOnSelect:p,className:b,itemClasses:w,getBaseProps:(O={})=>({ref:o,"data-slot":"base",className:g.base({class:T}),...Ae(v,{enabled:C}),...O}),getListProps:(O={})=>({"data-slot":"list",className:g.list({class:i?.list}),...N,...O}),hideEmptyContent:f,hideSelectedIcon:M,getEmptyContentProps:(O={})=>({children:D,className:g.emptyContent({class:i?.emptyContent}),...O})}}var Jt=se(function(r,n){const{Component:s,state:a,closeOnSelect:u,color:d,disableAnimation:h,hideSelectedIcon:l,hideEmptyContent:c,variant:p,onClose:w,topContent:b,bottomContent:x,itemClasses:I,getBaseProps:j,getListProps:f,getEmptyContentProps:M}=Gt({...r,ref:n}),D=t.jsxs(s,{...f(),children:[!a.collection.size&&!c&&t.jsx("li",{children:t.jsx("div",{...M()})}),[...a.collection].map(y=>{const S={closeOnSelect:u,color:d,disableAnimation:h,item:y,state:a,variant:p,onClose:w,hideSelectedIcon:l,...y.props},i=Et(I,S?.classNames);if(y.type==="section")return t.jsx(qt,{...S,itemClasses:i},y.key);let v=t.jsx(Ke,{...S,classNames:i},y.key);return y.wrapper&&(v=y.wrapper(v)),v})]});return t.jsxs("div",{...j(),children:[b,D,x]})}),Qt=Jt,Xt=gt,De=Xt,Zt=se(function(r,n){const{getMenuProps:s}=Re();return t.jsx(Rt,{children:t.jsx(mt,{contain:!0,restoreFocus:!0,children:t.jsx(Qt,{...s(r,n)})})})}),Yt=Zt,Ve=e=>{const{getMenuTriggerProps:r}=Re(),{children:n,...s}=e;return t.jsx(Ht,{...r(s),children:n})};Ve.displayName="HeroUI.DropdownTrigger";var eo=Ve,to=(e,r)=>{if(e){const n=Array.isArray(e.children)?e.children:[...e?.items||[]];if(n&&n.length)return n.find(a=>{if(a&&a.key===r)return a})||{}}return null},oo=(e,r,n)=>{const s=n||to(e,r);return s&&s.props&&"closeOnSelect"in s.props?s.props.closeOnSelect:e?.closeOnSelect};function ro(e){var r;const n=be(),{as:s,triggerRef:a,isOpen:u,defaultOpen:d,onOpenChange:h,isDisabled:l,type:c="menu",trigger:p="press",placement:w="bottom",closeOnSelect:b=!0,shouldBlockScroll:x=!0,classNames:I,disableAnimation:j=(r=n?.disableAnimation)!=null?r:!1,onClose:f,className:M,...D}=e,y=s||"div",S=P.useRef(null),i=a||S,v=P.useRef(null),k=P.useRef(null),o=kt({trigger:p,isOpen:u,defaultOpen:d,onOpenChange:$=>{h?.($),$||f?.()}}),{menuTriggerProps:C,menuProps:_}=Nt({type:c,trigger:p,isDisabled:l},o,i),A=P.useMemo(()=>Ft({className:M}),[M]),N=$=>{$!==void 0&&!$||b&&o.close()},g=($={})=>{const E=R(D,$);return{state:o,placement:w,ref:k,disableAnimation:j,shouldBlockScroll:x,scrollRef:v,triggerRef:i,...E,classNames:{...I,...$.classNames,content:W(A,I?.content,$.className)}}},T=($={})=>{const{onPress:E,onPressStart:O,...H}=C;return R(H,{isDisabled:l},$)},B=($,E=null)=>({ref:xt(E,v),menuProps:_,closeOnSelect:b,...R($,{onAction:(O,H)=>{const q=oo($,O,H);N(q)},onClose:o.close})});return{Component:y,menuRef:v,menuProps:_,closeOnSelect:b,onClose:o.close,autoFocus:o.focusStrategy||!0,disableAnimation:j,getPopoverProps:g,getMenuProps:B,getMenuTriggerProps:T}}var Le=e=>{const{children:r,...n}=e,s=ro(n),[a,u]=yt.Children.toArray(r);return t.jsx(Kt,{value:s,children:t.jsxs(Ut,{...s.getPopoverProps(),children:[a,u]})})};Le.displayName="HeroUI.Dropdown";var ao=Le;function co(){const{selectConversation:e,deleteConversation:r,newConversation:n,setConversationProperties:s}=Pt(),a=Ct(),u=fe(Ce(o=>Object.keys(o.conversations).reverse())),d=fe(Ce(o=>Object.values(o.conversations).reverse().map(C=>C.summary))),h=fe(o=>o.currentConversation),[l,c]=P.useState(!1),[p,w]=P.useState(null),[b,x]=P.useState(""),[I,j]=P.useState(!1),f=P.useRef(null),M=l?"Open sidebar":"Close sidebar",D=t.jsx(Q,{icon:"heroicons:pencil-square"}),y=(o,C)=>{w(o),x(C??""),j(!0),setTimeout(()=>{f.current?.focus?.(),setTimeout(()=>j(!1),120)},0)},S=o=>{if(p!==o)return;const C=(b||"").trim();C&&s(o,{summary:C}),w(null),x(""),j(!1)},i=()=>{w(null),x(""),j(!1)},v=()=>{const o=n();a($e(o))},k=o=>{e(o),a($e(o))};return t.jsx(ve.div,{initial:!1,animate:{maxWidth:l?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(Ie,{children:[t.jsx(we,{content:M,placement:"bottom",children:t.jsx(X,{isIconOnly:!0,"aria-label":M,variant:"ghost",onPress:()=>c(o=>!o),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(Q,{icon:l?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!l&&t.jsx(ve.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(we,{content:"New conversation",placement:"right",children:t.jsx(X,{"aria-label":"New conversation",variant:"ghost",onPress:v,"data-testid":"chat-history-clear-chat-button",startContent:D,isIconOnly:l,children:!l&&"New conversation"})},"new-conversation-button"),!l&&t.jsx(ve.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:wt.zip(u,d).map(([o,C])=>{if(!o||$t(o))return null;const _=o===h,A=o===p,N=_?"solid":"light";return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[A?t.jsx(At,{ref:f,size:"sm",variant:"bordered",value:b,onChange:g=>x(g.target.value),onBlur:()=>{I||S(o)},onKeyDown:g=>{g.key==="Enter"&&S(o),g.key==="Escape"&&i()},className:"flex-1","data-testid":`input-conversation-${o}`}):t.jsx(X,{variant:N,"aria-label":`Select conversation ${o}`,"data-active":_,onPress:()=>k(o),title:C??o,"data-testid":`select-conversation-${o}`,className:"flex-1 justify-start",children:t.jsx("div",{className:"text-small truncate",children:C??o})}),t.jsxs(ao,{children:[t.jsx(eo,{children:t.jsx(X,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${o}`,"data-testid":`dropdown-conversation-${o}`,children:t.jsx(Q,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),t.jsxs(Yt,{"aria-label":"Conversation actions",children:[t.jsx(De,{startContent:t.jsx(Q,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>y(o,C??o),"data-testid":`edit-conversation-${o}`,children:"Edit"},"edit"),t.jsx(De,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(Q,{icon:"heroicons:trash"}),onPress:()=>r(o),"data-testid":`delete-conversation-${o}`,children:"Delete conversation"},"delete")]})]})]},`${o}-${N}`)})},"conversation-list")]})})}export{co as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-2qFdqVbg.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-2qFdqVbg.js new file mode 100644 index 0000000000..a4dadbcd55 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-2qFdqVbg.js @@ -0,0 +1 @@ +import{br as z,r as f,u as ie,bs as ce,a as ue,a_ as le,b as fe,bt as Y,bu as Q,j as l,D as de,d as A,I as me,m as ge,e as he,f as pe}from"./index-DpOBiJiD.js";import{g as Z,v as W,F as be,t as ve}from"./index-C0uQR8UF.js";import{m as Se}from"./chunk-IGSAU2ZA-BcGvhJAc.js";import"./difference-CEM8oPgu.js";import"./forEach-CTOHlvm6.js";import"./_basePickBy-DTjWYYGV.js";import"./pick-Bos82ZJn.js";import"./chunk-SSA7SXE4-CH4dnGpZ.js";import"./useMenuTriggerState-CsqkQBB_.js";import"./useSelectableItem-BZ_O-SpJ.js";import"./index-DXdC0TND.js";import"./union-CR4sFk7V.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,v=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,b){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(b)&&(G=!!b.leading,D="maxWait"in b,P=D?c(q(b.maxWait)||0,u):P,k="trailing"in b?!!b.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var b=h.test(e);return b||i.test(e)?v(e.slice(2),b?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=v=>{g.current(v)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[v,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[v,y,C]}const Ce="ragbits-no-history-chat-options";function Ne(){const{isOpen:n,onOpen:t,onClose:s}=ie(),m=ce(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=ue(),v=le(a=>a.currentConversation),{config:{user_settings:S}}=fe(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(v,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,v,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(de,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(me,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ge,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(he,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(pe,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(be,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:ve,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{Ne as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-bfNG8UIW.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-bfNG8UIW.js deleted file mode 100644 index 0e3509e3fb..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-bfNG8UIW.js +++ /dev/null @@ -1 +0,0 @@ -import{g as z,r as f,u as ie,h as ce,a as ue,i as le,b as fe,p as Y,C as Q,j as l,D as de,d as A,I as me,m as ge,e as he,f as pe}from"./index-BZLU40Mk.js";import{g as Z,v as W,F as ve,t as be}from"./index-Be0kkf3d.js";import{m as Se}from"./chunk-IGSAU2ZA-NXd1g0Qd.js";import"./chunk-SSA7SXE4-CJa0HuAU.js";import"./useMenuTriggerState-SaFmATkk.js";import"./useSelectableItem-DhuFnc0W.js";import"./index-Ceq7Rkzy.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,b=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,v){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(v)&&(G=!!v.leading,D="maxWait"in v,P=D?c(q(v.maxWait)||0,u):P,k="trailing"in v?!!v.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var v=h.test(e);return v||i.test(e)?b(e.slice(2),v?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=b=>{g.current(b)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[b,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[b,y,C]}const Ce="ragbits-no-history-chat-options";function Le(){const{isOpen:n,onOpen:t,onClose:s}=ie(),m=ce(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=ue(),b=le(a=>a.currentConversation),{config:{user_settings:S}}=fe(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(b,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,b,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(de,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(me,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ge,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(he,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(pe,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(ve,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:be,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{Le as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-0g5-w2vR.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-0g5-w2vR.js deleted file mode 100644 index c9ebd5185c..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-0g5-w2vR.js +++ /dev/null @@ -1 +0,0 @@ -import{r as c,c as x,aW as w,aE as b,j as s,aq as S,aG as j,d as v,bm as P}from"./index-BZLU40Mk.js";import{a as q}from"./authStore-BfGlL8rp.js";import{u as C}from"./useInitializeUserStore-DyHP7g8x.js";import{i as d}from"./chunk-SSA7SXE4-CJa0HuAU.js";function N(){const[t,m]=c.useState({username:"",password:""}),u=x("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),p=w(q,e=>e.login),g=b(),f=C(),[y,o]=c.useState(!1),h=async e=>{o(!1),e.preventDefault(),e.stopPropagation();const r=new FormData(e.currentTarget),n=r.get("username"),i=r.get("password");try{const a=await u.call({body:{username:n,password:i}});if(!a.success||!a.user){o(!0);return}p(a.user),f(a.user.user_id),g("/")}catch(a){console.error("Failed to login",a),o(!0)}},l=e=>r=>m(n=>P(n,i=>{i[e]=r.target.value}));return s.jsxs("form",{className:"flex w-full flex-col gap-4",onSubmit:h,children:[s.jsx(d,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:t.username,onChange:l("username")}),s.jsx(d,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:t.password,onChange:l("password")}),s.jsx(S,{children:y&&!u.isLoading&&s.jsx(j.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),s.jsx(v,{type:"submit",color:t.password&&t.username?"primary":"default",children:"Sign in"})]})}export{N as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-rGU61X8K.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-rGU61X8K.js new file mode 100644 index 0000000000..3a5c965b59 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/CredentialsLogin-rGU61X8K.js @@ -0,0 +1 @@ +import{r as c,c as x,g as w,h as b,j as s,A as S,o as j,d as v,p as P}from"./index-DpOBiJiD.js";import{a as C}from"./authStore-BJzDjplU.js";import{u as q}from"./useInitializeUserStore-gUBPelSF.js";import{i as d}from"./chunk-SSA7SXE4-CH4dnGpZ.js";function N(){const[t,m]=c.useState({username:"",password:""}),u=x("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),p=w(C,e=>e.login),g=b(),f=q(),[y,o]=c.useState(!1),h=async e=>{o(!1),e.preventDefault(),e.stopPropagation();const r=new FormData(e.currentTarget),n=r.get("username"),i=r.get("password");try{const a=await u.call({body:{username:n,password:i}});if(!a.success||!a.user){o(!0);return}p(a.user),f(a.user.user_id),g("/")}catch(a){console.error("Failed to login",a),o(!0)}},l=e=>r=>m(n=>P(n,i=>{i[e]=r.target.value}));return s.jsxs("form",{className:"flex w-full flex-col gap-4",onSubmit:h,children:[s.jsx(d,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:t.username,onChange:l("username")}),s.jsx(d,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:t.password,onChange:l("password")}),s.jsx(S,{children:y&&!u.isLoading&&s.jsx(j.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),s.jsx(v,{type:"submit",color:t.password&&t.username?"primary":"default",children:"Sign in"})]})}export{N as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-Cr8NBUYO.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-Cr8NBUYO.js new file mode 100644 index 0000000000..44a2dde258 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-Cr8NBUYO.js @@ -0,0 +1 @@ +import{u as g,a as v,b as C,r as _,F as s,c as T,j as e,D as b,d as n,I as u,m as w,e as D,f as I}from"./index-DpOBiJiD.js";import{F as O,t as S,v as E}from"./index-C0uQR8UF.js";import{m as N}from"./chunk-IGSAU2ZA-BcGvhJAc.js";import"./difference-CEM8oPgu.js";import"./forEach-CTOHlvm6.js";import"./_basePickBy-DTjWYYGV.js";import"./pick-Bos82ZJn.js";import"./chunk-SSA7SXE4-CH4dnGpZ.js";import"./useMenuTriggerState-CsqkQBB_.js";import"./useSelectableItem-BZ_O-SpJ.js";import"./index-DXdC0TND.js";import"./union-CR4sFk7V.js";function M({message:t}){const{isOpen:f,onOpen:h,onClose:l}=g(),{mergeExtensions:p}=v(),{config:{feedback:o}}=C(),[i,x]=_.useState(s.Like),k=T("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"}),r=o[i].form,j=()=>{l()},c=async a=>{if(!t.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:t.serverId,feedback:i,payload:a??{}}})}catch(F){console.error(F)}},y=a=>{p(t.id,{feedbackType:i}),c(a.formData),l()},d=async a=>{if(x(a),o[a].form===null){await c(null);return}h()};if(!r)return null;const m=t.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(b,{content:"Like",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>d(s.Like),"data-testid":"feedback-like",children:e.jsx(u,{icon:m===s.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(b,{content:"Dislike",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>d(s.Dislike),"data-testid":"feedback-dislike",children:e.jsx(u,{icon:m===s.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),e.jsx(w,{isOpen:f,onOpenChange:j,children:e.jsx(D,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"text-default-900 flex flex-col gap-1",children:r.title}),e.jsx(I,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(O,{schema:r,validator:E,onSubmit:y,transformErrors:S,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(n,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(n,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{M as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-oSbly5oN.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-oSbly5oN.js deleted file mode 100644 index ae3eefaf9c..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-oSbly5oN.js +++ /dev/null @@ -1 +0,0 @@ -import{u as g,a as v,b as C,r as _,F as s,c as T,j as e,D as b,d as n,I as u,m as w,e as D,f as I}from"./index-BZLU40Mk.js";import{F as O,t as S,v as E}from"./index-Be0kkf3d.js";import{m as N}from"./chunk-IGSAU2ZA-NXd1g0Qd.js";import"./chunk-SSA7SXE4-CJa0HuAU.js";import"./useMenuTriggerState-SaFmATkk.js";import"./useSelectableItem-DhuFnc0W.js";import"./index-Ceq7Rkzy.js";function z({message:t}){const{isOpen:f,onOpen:h,onClose:r}=g(),{mergeExtensions:p}=v(),{config:{feedback:o}}=C(),[i,x]=_.useState(s.Like),k=T("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"}),l=o[i].form,j=()=>{r()},c=async a=>{if(!t.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:t.serverId,feedback:i,payload:a??{}}})}catch(F){console.error(F)}},y=a=>{p(t.id,{feedbackType:i}),c(a.formData),r()},d=async a=>{if(x(a),o[a].form===null){await c(null);return}h()};if(!l)return null;const m=t.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(b,{content:"Like",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>d(s.Like),"data-testid":"feedback-like",children:e.jsx(u,{icon:m===s.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(b,{content:"Dislike",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>d(s.Dislike),"data-testid":"feedback-dislike",children:e.jsx(u,{icon:m===s.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),e.jsx(w,{isOpen:f,onOpenChange:j,children:e.jsx(D,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"text-default-900 flex flex-col gap-1",children:l.title}),e.jsx(I,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(O,{schema:l,validator:E,onSubmit:y,transformErrors:S,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(n,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(n,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{z as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DSW_CNFu.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-C2iJsuxa.js similarity index 89% rename from packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DSW_CNFu.js rename to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-C2iJsuxa.js index 5c3d813897..f0c4797f87 100644 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-DSW_CNFu.js +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-C2iJsuxa.js @@ -1 +1 @@ -import{r as s,j as e}from"./index-BZLU40Mk.js";function n({children:t}){return s.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("div",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),t]})})}export{n as default}; +import{r as s,j as e}from"./index-DpOBiJiD.js";function n({children:t}){return s.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("div",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),t]})})}export{n as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BQE8NNsg.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BQE8NNsg.js deleted file mode 100644 index 44821782fa..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BQE8NNsg.js +++ /dev/null @@ -1 +0,0 @@ -import{c,aW as a,aE as l,j as o,D as g,d,I as h}from"./index-BZLU40Mk.js";import{a as s}from"./authStore-BfGlL8rp.js";function m(){const n=c("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),r=a(s,t=>t.logout),u=a(s,t=>t.isAuthenticated),e=l(),i=async()=>{if(!u){e("/login");return}try{if(!(await n.call()).success)return;r(),e("/login")}catch(t){console.error("Failed to logout",t)}};return o.jsx(g,{content:"Logout",placement:"bottom",children:o.jsx(d,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:i,"data-testid":"logout-button",children:o.jsx(h,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{m as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BYRoHaCU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BYRoHaCU.js new file mode 100644 index 0000000000..aa09c1ef32 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-BYRoHaCU.js @@ -0,0 +1 @@ +import{c,g as a,h as l,j as o,D as g,d,I as h}from"./index-DpOBiJiD.js";import{a as s}from"./authStore-BJzDjplU.js";function m(){const n=c("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),r=a(s,t=>t.logout),u=a(s,t=>t.isAuthenticated),e=l(),i=async()=>{if(!u){e("/login");return}try{if(!(await n.call()).success)return;r(),e("/login")}catch(t){console.error("Failed to logout",t)}};return o.jsx(g,{content:"Logout",placement:"bottom",children:o.jsx(d,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:i,"data-testid":"logout-button",children:o.jsx(h,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{m as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BoIcdXtJ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BoIcdXtJ.js new file mode 100644 index 0000000000..4d409354d8 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-BoIcdXtJ.js @@ -0,0 +1,2 @@ +import{bw as An,r as K,c as Sn,j as le,A as Rn,o as yn,d as On}from"./index-DpOBiJiD.js";var $e,Nt;function Mt(){if(Nt)return $e;Nt=1;const{entries:Z,setPrototypeOf:C,isFrozen:w,getPrototypeOf:ye,getOwnPropertyDescriptor:ce}=Object;let{freeze:T,seal:y,create:k}=Object,{apply:z,construct:H}=typeof Reflect<"u"&&Reflect;T||(T=function(o){return o}),y||(y=function(o){return o}),z||(z=function(o,l){for(var r=arguments.length,c=new Array(r>2?r-2:0),O=2;O1?l-1:0),c=1;c1?l-1:0),c=1;c2&&arguments[2]!==void 0?arguments[2]:me;C&&C(s,null);let r=o.length;for(;r--;){let c=o[r];if(typeof c=="string"){const O=l(c);O!==c&&(w(o)||(o[r]=O),c=O)}s[c]=!0}return s}function kt(s){for(let o=0;o/gm),Gt=y(/\$\{[\w\W]*/gm),Wt=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bt=y(/^aria-[\-\w]+$/),Qe=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yt=y(/^(?:\w+script|data):/i),jt=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),et=y(/^html$/i),Xt=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,ARIA_ATTR:Bt,ATTR_WHITESPACE:jt,CUSTOM_ELEMENT:Xt,DATA_ATTR:Wt,DOCTYPE_NAME:et,ERB_EXPR:Ht,IS_ALLOWED_URI:Qe,IS_SCRIPT_OR_DATA:Yt,MUSTACHE_EXPR:zt,TMPLIT_EXPR:Gt});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},$t=function(){return typeof window>"u"?null:window},Vt=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const c="data-tt-policy-suffix";l&&l.hasAttribute(c)&&(r=l.getAttribute(c));const O="dompurify"+(r?"#"+r:"");try{return o.createPolicy(O,{createHTML(W){return W},createScriptURL(W){return W}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ot(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t();const o=i=>ot(i);if(o.version="3.3.1",o.removed=[],!s||!s.document||s.document.nodeType!==te.document||!s.Element)return o.isSupported=!1,o;let{document:l}=s;const r=l,c=r.currentScript,{DocumentFragment:O,HTMLTemplateElement:W,Node:Me,Element:it,NodeFilter:ne,NamedNodeMap:Kt=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Jt,trustedTypes:de}=s,oe=it.prototype,Qt=ee(oe,"cloneNode"),en=ee(oe,"remove"),tn=ee(oe,"nextSibling"),nn=ee(oe,"childNodes"),Te=ee(oe,"parentNode");if(typeof W=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let S,ie="";const{implementation:Ce,createNodeIterator:on,createDocumentFragment:rn,getElementsByTagName:an}=l,{importNode:sn}=r;let R=nt();o.isSupported=typeof Z=="function"&&typeof Te=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:we,ERB_EXPR:xe,TMPLIT_EXPR:Pe,DATA_ATTR:ln,ARIA_ATTR:cn,IS_SCRIPT_OR_DATA:un,ATTR_WHITESPACE:rt,CUSTOM_ELEMENT:fn}=tt;let{IS_ALLOWED_URI:at}=tt,d=null;const st=a({},[...qe,...be,...De,...Ie,...Ke]);let E=null;const lt=a({},[...Ze,...Ne,...Je,...pe]);let f=Object.seal(k(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,ve=null;const B=Object.seal(k(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ct=!0,ke=!0,ut=!1,ft=!0,Y=!1,Ee=!0,F=!1,Fe=!1,Ue=!1,j=!1,_e=!1,ge=!1,mt=!0,pt=!1;const mn="user-content-";let ze=!0,ae=!1,X={},N=null;const He=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let dt=null;const Tt=a({},["audio","video","img","source","image","track"]);let Ge=null;const Et=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";let $=x,We=!1,Be=null;const pn=a({},[he,Ae,x],Oe);let Se=a({},["mi","mo","mn","ms","mtext"]),Re=a({},["annotation-xml"]);const dn=a({},["title","style","font","a","script"]);let se=null;const Tn=["application/xhtml+xml","text/html"],En="text/html";let p=null,V=null;const _n=l.createElement("form"),_t=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(V&&V===e)){if((!e||typeof e!="object")&&(e={}),e=I(e),se=Tn.indexOf(e.PARSER_MEDIA_TYPE)===-1?En:e.PARSER_MEDIA_TYPE,p=se==="application/xhtml+xml"?Oe:me,d=D(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,p):st,E=D(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,p):lt,Be=D(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Oe):pn,Ge=D(e,"ADD_URI_SAFE_ATTR")?a(I(Et),e.ADD_URI_SAFE_ATTR,p):Et,dt=D(e,"ADD_DATA_URI_TAGS")?a(I(Tt),e.ADD_DATA_URI_TAGS,p):Tt,N=D(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,p):He,re=D(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,p):I({}),ve=D(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,p):I({}),X=D(e,"USE_PROFILES")?e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,F=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,mt=e.SANITIZE_DOM!==!1,pt=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,at=e.ALLOWED_URI_REGEXP||Qe,$=e.NAMESPACE||x,Se=e.MATHML_TEXT_INTEGRATION_POINTS||Se,Re=e.HTML_INTEGRATION_POINTS||Re,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ke=!1),_e&&(j=!0),X&&(d=a({},Ke),E=[],X.html===!0&&(a(d,qe),a(E,Ze)),X.svg===!0&&(a(d,be),a(E,Ne),a(E,pe)),X.svgFilters===!0&&(a(d,De),a(E,Ne),a(E,pe)),X.mathMl===!0&&(a(d,Ie),a(E,Je),a(E,pe))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?B.tagCheck=e.ADD_TAGS:(d===st&&(d=I(d)),a(d,e.ADD_TAGS,p))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?B.attributeCheck=e.ADD_ATTR:(E===lt&&(E=I(E)),a(E,e.ADD_ATTR,p))),e.ADD_URI_SAFE_ATTR&&a(Ge,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(N===He&&(N=I(N)),a(N,e.FORBID_CONTENTS,p)),e.ADD_FORBID_CONTENTS&&(N===He&&(N=I(N)),a(N,e.ADD_FORBID_CONTENTS,p)),ze&&(d["#text"]=!0),F&&a(d,["html","head","body"]),d.table&&(a(d,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,ie=S.createHTML("")}else S===void 0&&(S=Vt(de,c)),S!==null&&typeof ie=="string"&&(ie=S.createHTML(""));T&&T(e),V=e}},gt=a({},[...be,...De,...Ft]),ht=a({},[...Ie,...Ut]),gn=function(e){let t=Te(e);(!t||!t.tagName)&&(t={namespaceURI:$,tagName:"template"});const n=me(e.tagName),u=me(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Ae?t.namespaceURI===x?n==="svg":t.namespaceURI===he?n==="svg"&&(u==="annotation-xml"||Se[u]):!!gt[n]:e.namespaceURI===he?t.namespaceURI===x?n==="math":t.namespaceURI===Ae?n==="math"&&Re[u]:!!ht[n]:e.namespaceURI===x?t.namespaceURI===Ae&&!Re[u]||t.namespaceURI===he&&!Se[u]?!1:!ht[n]&&(dn[n]||!gt[n]):!!(se==="application/xhtml+xml"&&Be[e.namespaceURI]):!1},M=function(e){b(o.removed,{element:e});try{Te(e).removeChild(e)}catch{en(e)}},U=function(e,t){try{b(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{b(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(j||_e)try{M(t)}catch{}else try{t.setAttribute(e,"")}catch{}},At=function(e){let t=null,n=null;if(Ue)e=""+e;else{const m=Le(e,/^[\r\n\t ]+/);n=m&&m[0]}se==="application/xhtml+xml"&&$===x&&(e=''+e+"");const u=S?S.createHTML(e):e;if($===x)try{t=new Jt().parseFromString(u,se)}catch{}if(!t||!t.documentElement){t=Ce.createDocument($,"template",null);try{t.documentElement.innerHTML=We?ie:u}catch{}}const g=t.body||t.documentElement;return e&&n&&g.insertBefore(l.createTextNode(n),g.childNodes[0]||null),$===x?an.call(t,F?"html":"body")[0]:F?t.documentElement:g},St=function(e){return on.call(e.ownerDocument||e,e,ne.SHOW_ELEMENT|ne.SHOW_COMMENT|ne.SHOW_TEXT|ne.SHOW_PROCESSING_INSTRUCTION|ne.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Kt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Rt=function(e){return typeof Me=="function"&&e instanceof Me};function P(i,e,t){G(i,n=>{n.call(o,e,t,V)})}const yt=function(e){let t=null;if(P(R.beforeSanitizeElements,e,null),je(e))return M(e),!0;const n=p(e.nodeName);if(P(R.uponSanitizeElement,e,{tagName:n,allowedTags:d}),Ee&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&h(/<[/\w!]/g,e.innerHTML)&&h(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||Ee&&e.nodeType===te.comment&&h(/<[/\w]/g,e.data))return M(e),!0;if(!(B.tagCheck instanceof Function&&B.tagCheck(n))&&(!d[n]||re[n])){if(!re[n]&&Lt(n)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(ze&&!N[n]){const u=Te(e)||e.parentNode,g=nn(e)||e.childNodes;if(g&&u){const m=g.length;for(let L=m-1;L>=0;--L){const v=Qt(g[L],!0);v.__removalCount=(e.__removalCount||0)+1,u.insertBefore(v,tn(e))}}}return M(e),!0}return e instanceof it&&!gn(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(M(e),!0):(Y&&e.nodeType===te.text&&(t=e.textContent,G([we,xe,Pe],u=>{t=J(t,u," ")}),e.textContent!==t&&(b(o.removed,{element:e.cloneNode()}),e.textContent=t)),P(R.afterSanitizeElements,e,null),!1)},Ot=function(e,t,n){if(mt&&(t==="id"||t==="name")&&(n in l||n in _n))return!1;if(!(ke&&!ve[t]&&h(ln,t))){if(!(ct&&h(cn,t))){if(!(B.attributeCheck instanceof Function&&B.attributeCheck(t,e))){if(!E[t]||ve[t]){if(!(Lt(e)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&h(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t,e))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Ge[t]){if(!h(at,J(n,rt,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&xt(n,"data:")===0&&dt[e])){if(!(ut&&!h(un,J(n,rt,"")))){if(n)return!1}}}}}}}return!0},Lt=function(e){return e!=="annotation-xml"&&Le(e,fn)},bt=function(e){P(R.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let u=t.length;for(;u--;){const g=t[u],{name:m,namespaceURI:L,value:v}=g,q=p(m),Xe=v;let _=m==="value"?Xe:Pt(Xe);if(n.attrName=q,n.attrValue=_,n.keepAttr=!0,n.forceKeepAttr=void 0,P(R.uponSanitizeAttribute,e,n),_=n.attrValue,pt&&(q==="id"||q==="name")&&(U(m,e),_=mn+_),Ee&&h(/((--!?|])>)|<\/(style|title|textarea)/i,_)){U(m,e);continue}if(q==="attributename"&&Le(_,"href")){U(m,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){U(m,e);continue}if(!ft&&h(/\/>/i,_)){U(m,e);continue}Y&&G([we,xe,Pe],It=>{_=J(_,It," ")});const Dt=p(e.nodeName);if(!Ot(Dt,q,_)){U(m,e);continue}if(S&&typeof de=="object"&&typeof de.getAttributeType=="function"&&!L)switch(de.getAttributeType(Dt,q)){case"TrustedHTML":{_=S.createHTML(_);break}case"TrustedScriptURL":{_=S.createScriptURL(_);break}}if(_!==Xe)try{L?e.setAttributeNS(L,m,_):e.setAttribute(m,_),je(e)?M(e):fe(o.removed)}catch{U(m,e)}}P(R.afterSanitizeAttributes,e,null)},hn=function i(e){let t=null;const n=St(e);for(P(R.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)P(R.uponSanitizeShadowNode,t,null),yt(t),bt(t),t.content instanceof O&&i(t.content);P(R.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,u=null,g=null;if(We=!i,We&&(i=""),typeof i!="string"&&!Rt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!o.isSupported)return i;if(Fe||Ye(e),o.removed=[],typeof i=="string"&&(ae=!1),ae){if(i.nodeName){const v=p(i.nodeName);if(!d[v]||re[v])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof Me)t=At(""),n=t.ownerDocument.importNode(i,!0),n.nodeType===te.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!j&&!Y&&!F&&i.indexOf("<")===-1)return S&&ge?S.createHTML(i):i;if(t=At(i),!t)return j?null:ge?ie:""}t&&Ue&&M(t.firstChild);const m=St(ae?i:t);for(;u=m.nextNode();)yt(u),bt(u),u.content instanceof O&&hn(u.content);if(ae)return i;if(j){if(_e)for(g=rn.call(t.ownerDocument);t.firstChild;)g.appendChild(t.firstChild);else g=t;return(E.shadowroot||E.shadowrootmode)&&(g=sn.call(r,g,!0)),g}let L=F?t.outerHTML:t.innerHTML;return F&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(et,t.ownerDocument.doctype.name)&&(L=" +`+L),Y&&G([we,xe,Pe],v=>{L=J(L,v," ")}),S&&ge?S.createHTML(L):L},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(i),Fe=!0},o.clearConfig=function(){V=null,Fe=!1},o.isValidAttribute=function(i,e,t){V||Ye({});const n=p(i),u=p(e);return Ot(n,u,t)},o.addHook=function(i,e){typeof e=="function"&&b(R[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=ue(R[i],e);return t===-1?void 0:wt(R[i],t,1)[0]}return fe(R[i])},o.removeHooks=function(i){R[i]=[]},o.removeAllHooks=function(){R=nt()},o}var qt=ot();return $e=qt,$e}var Ve,Ct;function Ln(){return Ct||(Ct=1,Ve=self.DOMPurify||(self.DOMPurify=Mt().default||Mt())),Ve}var bn=Ln();const Dn=An(bn);function Nn({provider:Z,displayName:C,visualConfig:w}){const[ye,ce]=K.useState(!1),[T,y]=K.useState(""),[k,z]=K.useState(!1),H=Sn("/api/auth/authorize/:provider"),G=K.useCallback(async()=>{ce(!1),z(!0);try{const b=await H.call({pathParams:{provider:Z}});if(!b.authorize_url)throw new Error(`Failed to get ${C} authorization URL`);window.location.href=b.authorize_url}catch(b){ce(!0),y(`Failed to initiate ${C} login: ${b}`),console.error(`Failed to start ${C} login`,b)}finally{z(!1)}},[H,C,Z]),ue=K.useMemo(()=>{if(w?.buttonColor)return{backgroundColor:w.buttonColor,color:w.textColor||"#FFFFFF"}},[w]),fe=K.useMemo(()=>{if(k||!w?.iconSvg)return null;const b=Dn.sanitize(w.iconSvg,{USE_PROFILES:{svg:!0}});return le.jsx("span",{className:"flex items-center justify-center",dangerouslySetInnerHTML:{__html:b}})},[k,w?.iconSvg]);return le.jsxs("div",{className:"flex flex-col gap-4",children:[le.jsx(Rn,{children:ye&&le.jsx(yn.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:T||`Failed to sign in with ${C}`})}),le.jsx(On,{onPress:G,color:ue?void 0:"primary",style:ue,isLoading:k,startContent:fe,children:k?"Redirecting...":`Sign in with ${C}`})]})}export{Nn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-EmJ39PUe.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-EmJ39PUe.js deleted file mode 100644 index 1eb9930422..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/OAuth2Login-EmJ39PUe.js +++ /dev/null @@ -1,2 +0,0 @@ -import{ar as An,r as K,c as Sn,j as le,aq as Rn,aG as yn,d as On}from"./index-BZLU40Mk.js";var $e,Nt;function Mt(){if(Nt)return $e;Nt=1;const{entries:Z,setPrototypeOf:C,isFrozen:w,getPrototypeOf:ye,getOwnPropertyDescriptor:ce}=Object;let{freeze:T,seal:y,create:k}=Object,{apply:z,construct:H}=typeof Reflect<"u"&&Reflect;T||(T=function(o){return o}),y||(y=function(o){return o}),z||(z=function(o,l){for(var r=arguments.length,c=new Array(r>2?r-2:0),O=2;O1?l-1:0),c=1;c1?l-1:0),c=1;c2&&arguments[2]!==void 0?arguments[2]:me;C&&C(s,null);let r=o.length;for(;r--;){let c=o[r];if(typeof c=="string"){const O=l(c);O!==c&&(w(o)||(o[r]=O),c=O)}s[c]=!0}return s}function kt(s){for(let o=0;o/gm),Gt=y(/\$\{[\w\W]*/gm),Wt=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bt=y(/^aria-[\-\w]+$/),Qe=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yt=y(/^(?:\w+script|data):/i),jt=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),et=y(/^html$/i),Xt=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,ARIA_ATTR:Bt,ATTR_WHITESPACE:jt,CUSTOM_ELEMENT:Xt,DATA_ATTR:Wt,DOCTYPE_NAME:et,ERB_EXPR:Ht,IS_ALLOWED_URI:Qe,IS_SCRIPT_OR_DATA:Yt,MUSTACHE_EXPR:zt,TMPLIT_EXPR:Gt});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},$t=function(){return typeof window>"u"?null:window},qt=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const c="data-tt-policy-suffix";l&&l.hasAttribute(c)&&(r=l.getAttribute(c));const O="dompurify"+(r?"#"+r:"");try{return o.createPolicy(O,{createHTML(W){return W},createScriptURL(W){return W}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ot(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t();const o=i=>ot(i);if(o.version="3.3.1",o.removed=[],!s||!s.document||s.document.nodeType!==te.document||!s.Element)return o.isSupported=!1,o;let{document:l}=s;const r=l,c=r.currentScript,{DocumentFragment:O,HTMLTemplateElement:W,Node:Me,Element:it,NodeFilter:ne,NamedNodeMap:Kt=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:Zt,DOMParser:Jt,trustedTypes:de}=s,oe=it.prototype,Qt=ee(oe,"cloneNode"),en=ee(oe,"remove"),tn=ee(oe,"nextSibling"),nn=ee(oe,"childNodes"),Te=ee(oe,"parentNode");if(typeof W=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let S,ie="";const{implementation:Ce,createNodeIterator:on,createDocumentFragment:rn,getElementsByTagName:an}=l,{importNode:sn}=r;let R=nt();o.isSupported=typeof Z=="function"&&typeof Te=="function"&&Ce&&Ce.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:we,ERB_EXPR:xe,TMPLIT_EXPR:Pe,DATA_ATTR:ln,ARIA_ATTR:cn,IS_SCRIPT_OR_DATA:un,ATTR_WHITESPACE:rt,CUSTOM_ELEMENT:fn}=tt;let{IS_ALLOWED_URI:at}=tt,d=null;const st=a({},[...Ve,...be,...De,...Ie,...Ke]);let E=null;const lt=a({},[...Ze,...Ne,...Je,...pe]);let f=Object.seal(k(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),re=null,ve=null;const B=Object.seal(k(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ct=!0,ke=!0,ut=!1,ft=!0,Y=!1,Ee=!0,F=!1,Fe=!1,Ue=!1,j=!1,_e=!1,ge=!1,mt=!0,pt=!1;const mn="user-content-";let ze=!0,ae=!1,X={},N=null;const He=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let dt=null;const Tt=a({},["audio","video","img","source","image","track"]);let Ge=null;const Et=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";let $=x,We=!1,Be=null;const pn=a({},[he,Ae,x],Oe);let Se=a({},["mi","mo","mn","ms","mtext"]),Re=a({},["annotation-xml"]);const dn=a({},["title","style","font","a","script"]);let se=null;const Tn=["application/xhtml+xml","text/html"],En="text/html";let p=null,q=null;const _n=l.createElement("form"),_t=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(q&&q===e)){if((!e||typeof e!="object")&&(e={}),e=I(e),se=Tn.indexOf(e.PARSER_MEDIA_TYPE)===-1?En:e.PARSER_MEDIA_TYPE,p=se==="application/xhtml+xml"?Oe:me,d=D(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,p):st,E=D(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,p):lt,Be=D(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Oe):pn,Ge=D(e,"ADD_URI_SAFE_ATTR")?a(I(Et),e.ADD_URI_SAFE_ATTR,p):Et,dt=D(e,"ADD_DATA_URI_TAGS")?a(I(Tt),e.ADD_DATA_URI_TAGS,p):Tt,N=D(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,p):He,re=D(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,p):I({}),ve=D(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,p):I({}),X=D(e,"USE_PROFILES")?e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,F=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,_e=e.RETURN_DOM_FRAGMENT||!1,ge=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,mt=e.SANITIZE_DOM!==!1,pt=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,ae=e.IN_PLACE||!1,at=e.ALLOWED_URI_REGEXP||Qe,$=e.NAMESPACE||x,Se=e.MATHML_TEXT_INTEGRATION_POINTS||Se,Re=e.HTML_INTEGRATION_POINTS||Re,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ke=!1),_e&&(j=!0),X&&(d=a({},Ke),E=[],X.html===!0&&(a(d,Ve),a(E,Ze)),X.svg===!0&&(a(d,be),a(E,Ne),a(E,pe)),X.svgFilters===!0&&(a(d,De),a(E,Ne),a(E,pe)),X.mathMl===!0&&(a(d,Ie),a(E,Je),a(E,pe))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?B.tagCheck=e.ADD_TAGS:(d===st&&(d=I(d)),a(d,e.ADD_TAGS,p))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?B.attributeCheck=e.ADD_ATTR:(E===lt&&(E=I(E)),a(E,e.ADD_ATTR,p))),e.ADD_URI_SAFE_ATTR&&a(Ge,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(N===He&&(N=I(N)),a(N,e.FORBID_CONTENTS,p)),e.ADD_FORBID_CONTENTS&&(N===He&&(N=I(N)),a(N,e.ADD_FORBID_CONTENTS,p)),ze&&(d["#text"]=!0),F&&a(d,["html","head","body"]),d.table&&(a(d,["tbody"]),delete re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=e.TRUSTED_TYPES_POLICY,ie=S.createHTML("")}else S===void 0&&(S=qt(de,c)),S!==null&&typeof ie=="string"&&(ie=S.createHTML(""));T&&T(e),q=e}},gt=a({},[...be,...De,...Ft]),ht=a({},[...Ie,...Ut]),gn=function(e){let t=Te(e);(!t||!t.tagName)&&(t={namespaceURI:$,tagName:"template"});const n=me(e.tagName),u=me(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Ae?t.namespaceURI===x?n==="svg":t.namespaceURI===he?n==="svg"&&(u==="annotation-xml"||Se[u]):!!gt[n]:e.namespaceURI===he?t.namespaceURI===x?n==="math":t.namespaceURI===Ae?n==="math"&&Re[u]:!!ht[n]:e.namespaceURI===x?t.namespaceURI===Ae&&!Re[u]||t.namespaceURI===he&&!Se[u]?!1:!ht[n]&&(dn[n]||!gt[n]):!!(se==="application/xhtml+xml"&&Be[e.namespaceURI]):!1},M=function(e){b(o.removed,{element:e});try{Te(e).removeChild(e)}catch{en(e)}},U=function(e,t){try{b(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{b(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(j||_e)try{M(t)}catch{}else try{t.setAttribute(e,"")}catch{}},At=function(e){let t=null,n=null;if(Ue)e=""+e;else{const m=Le(e,/^[\r\n\t ]+/);n=m&&m[0]}se==="application/xhtml+xml"&&$===x&&(e=''+e+"");const u=S?S.createHTML(e):e;if($===x)try{t=new Jt().parseFromString(u,se)}catch{}if(!t||!t.documentElement){t=Ce.createDocument($,"template",null);try{t.documentElement.innerHTML=We?ie:u}catch{}}const g=t.body||t.documentElement;return e&&n&&g.insertBefore(l.createTextNode(n),g.childNodes[0]||null),$===x?an.call(t,F?"html":"body")[0]:F?t.documentElement:g},St=function(e){return on.call(e.ownerDocument||e,e,ne.SHOW_ELEMENT|ne.SHOW_COMMENT|ne.SHOW_TEXT|ne.SHOW_PROCESSING_INSTRUCTION|ne.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof Zt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Kt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Rt=function(e){return typeof Me=="function"&&e instanceof Me};function P(i,e,t){G(i,n=>{n.call(o,e,t,q)})}const yt=function(e){let t=null;if(P(R.beforeSanitizeElements,e,null),je(e))return M(e),!0;const n=p(e.nodeName);if(P(R.uponSanitizeElement,e,{tagName:n,allowedTags:d}),Ee&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&h(/<[/\w!]/g,e.innerHTML)&&h(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||Ee&&e.nodeType===te.comment&&h(/<[/\w]/g,e.data))return M(e),!0;if(!(B.tagCheck instanceof Function&&B.tagCheck(n))&&(!d[n]||re[n])){if(!re[n]&&Lt(n)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(ze&&!N[n]){const u=Te(e)||e.parentNode,g=nn(e)||e.childNodes;if(g&&u){const m=g.length;for(let L=m-1;L>=0;--L){const v=Qt(g[L],!0);v.__removalCount=(e.__removalCount||0)+1,u.insertBefore(v,tn(e))}}}return M(e),!0}return e instanceof it&&!gn(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(M(e),!0):(Y&&e.nodeType===te.text&&(t=e.textContent,G([we,xe,Pe],u=>{t=J(t,u," ")}),e.textContent!==t&&(b(o.removed,{element:e.cloneNode()}),e.textContent=t)),P(R.afterSanitizeElements,e,null),!1)},Ot=function(e,t,n){if(mt&&(t==="id"||t==="name")&&(n in l||n in _n))return!1;if(!(ke&&!ve[t]&&h(ln,t))){if(!(ct&&h(cn,t))){if(!(B.attributeCheck instanceof Function&&B.attributeCheck(t,e))){if(!E[t]||ve[t]){if(!(Lt(e)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&h(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t,e))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Ge[t]){if(!h(at,J(n,rt,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&xt(n,"data:")===0&&dt[e])){if(!(ut&&!h(un,J(n,rt,"")))){if(n)return!1}}}}}}}return!0},Lt=function(e){return e!=="annotation-xml"&&Le(e,fn)},bt=function(e){P(R.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let u=t.length;for(;u--;){const g=t[u],{name:m,namespaceURI:L,value:v}=g,V=p(m),Xe=v;let _=m==="value"?Xe:Pt(Xe);if(n.attrName=V,n.attrValue=_,n.keepAttr=!0,n.forceKeepAttr=void 0,P(R.uponSanitizeAttribute,e,n),_=n.attrValue,pt&&(V==="id"||V==="name")&&(U(m,e),_=mn+_),Ee&&h(/((--!?|])>)|<\/(style|title|textarea)/i,_)){U(m,e);continue}if(V==="attributename"&&Le(_,"href")){U(m,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){U(m,e);continue}if(!ft&&h(/\/>/i,_)){U(m,e);continue}Y&&G([we,xe,Pe],It=>{_=J(_,It," ")});const Dt=p(e.nodeName);if(!Ot(Dt,V,_)){U(m,e);continue}if(S&&typeof de=="object"&&typeof de.getAttributeType=="function"&&!L)switch(de.getAttributeType(Dt,V)){case"TrustedHTML":{_=S.createHTML(_);break}case"TrustedScriptURL":{_=S.createScriptURL(_);break}}if(_!==Xe)try{L?e.setAttributeNS(L,m,_):e.setAttribute(m,_),je(e)?M(e):fe(o.removed)}catch{U(m,e)}}P(R.afterSanitizeAttributes,e,null)},hn=function i(e){let t=null;const n=St(e);for(P(R.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)P(R.uponSanitizeShadowNode,t,null),yt(t),bt(t),t.content instanceof O&&i(t.content);P(R.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,u=null,g=null;if(We=!i,We&&(i=""),typeof i!="string"&&!Rt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!o.isSupported)return i;if(Fe||Ye(e),o.removed=[],typeof i=="string"&&(ae=!1),ae){if(i.nodeName){const v=p(i.nodeName);if(!d[v]||re[v])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof Me)t=At(""),n=t.ownerDocument.importNode(i,!0),n.nodeType===te.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!j&&!Y&&!F&&i.indexOf("<")===-1)return S&&ge?S.createHTML(i):i;if(t=At(i),!t)return j?null:ge?ie:""}t&&Ue&&M(t.firstChild);const m=St(ae?i:t);for(;u=m.nextNode();)yt(u),bt(u),u.content instanceof O&&hn(u.content);if(ae)return i;if(j){if(_e)for(g=rn.call(t.ownerDocument);t.firstChild;)g.appendChild(t.firstChild);else g=t;return(E.shadowroot||E.shadowrootmode)&&(g=sn.call(r,g,!0)),g}let L=F?t.outerHTML:t.innerHTML;return F&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(et,t.ownerDocument.doctype.name)&&(L=" -`+L),Y&&G([we,xe,Pe],v=>{L=J(L,v," ")}),S&&ge?S.createHTML(L):L},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ye(i),Fe=!0},o.clearConfig=function(){q=null,Fe=!1},o.isValidAttribute=function(i,e,t){q||Ye({});const n=p(i),u=p(e);return Ot(n,u,t)},o.addHook=function(i,e){typeof e=="function"&&b(R[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=ue(R[i],e);return t===-1?void 0:wt(R[i],t,1)[0]}return fe(R[i])},o.removeHooks=function(i){R[i]=[]},o.removeAllHooks=function(){R=nt()},o}var Vt=ot();return $e=Vt,$e}var qe,Ct;function Ln(){return Ct||(Ct=1,qe=self.DOMPurify||(self.DOMPurify=Mt().default||Mt())),qe}var bn=Ln();const Dn=An(bn);function Nn({provider:Z,displayName:C,visualConfig:w}){const[ye,ce]=K.useState(!1),[T,y]=K.useState(""),[k,z]=K.useState(!1),H=Sn("/api/auth/authorize/:provider"),G=K.useCallback(async()=>{ce(!1),z(!0);try{const b=await H.call({pathParams:{provider:Z}});if(!b.authorize_url)throw new Error(`Failed to get ${C} authorization URL`);window.location.href=b.authorize_url}catch(b){ce(!0),y(`Failed to initiate ${C} login: ${b}`),console.error(`Failed to start ${C} login`,b)}finally{z(!1)}},[H,C,Z]),ue=K.useMemo(()=>{if(w?.buttonColor)return{backgroundColor:w.buttonColor,color:w.textColor||"#FFFFFF"}},[w]),fe=K.useMemo(()=>{if(k||!w?.iconSvg)return null;const b=Dn.sanitize(w.iconSvg,{USE_PROFILES:{svg:!0}});return le.jsx("span",{className:"flex items-center justify-center",dangerouslySetInnerHTML:{__html:b}})},[k,w?.iconSvg]);return le.jsxs("div",{className:"flex flex-col gap-4",children:[le.jsx(Rn,{children:ye&&le.jsx(yn.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:T||`Failed to sign in with ${C}`})}),le.jsx(On,{onPress:G,color:ue?void 0:"primary",style:ue,isLoading:k,startContent:fe,children:k?"Redirecting...":`Sign in with ${C}`})]})}export{Nn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-B7DyIVH0.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-B7DyIVH0.js deleted file mode 100644 index 9ab191b454..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-B7DyIVH0.js +++ /dev/null @@ -1 +0,0 @@ -import{av as Gr,u as Jr,r as hr,i as Wr,j as I,D as qr,d as gr,I as Yr,m as Kr,e as Lr,f as Qr,aw as Vr}from"./index-BZLU40Mk.js";import{m as Xr}from"./chunk-IGSAU2ZA-NXd1g0Qd.js";var T=Uint8Array,$=Uint16Array,jr=Int32Array,lr=new T([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new T([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pr=new T([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=function(r,e){for(var a=new $(31),n=0;n<31;++n)a[n]=e+=1<>1|(y&21845)<<1;Q=(Q&52428)>>2|(Q&13107)<<2,Q=(Q&61680)>>4|(Q&3855)<<4,Cr[y]=((Q&65280)>>8|(Q&255)<<8)>>1}var q=(function(r,e,a){for(var n=r.length,t=0,o=new $(e);t>h]=c}else for(l=new $(n),t=0;t>15-r[t]);return l}),V=new T(288);for(var y=0;y<144;++y)V[y]=8;for(var y=144;y<256;++y)V[y]=9;for(var y=256;y<280;++y)V[y]=7;for(var y=280;y<288;++y)V[y]=8;var fr=new T(32);for(var y=0;y<32;++y)fr[y]=5;var re=q(V,9,0),ee=q(V,9,1),ae=q(fr,5,0),ne=q(fr,5,1),wr=function(r){for(var e=r[0],a=1;ae&&(e=r[a]);return e},J=function(r,e,a){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&a},xr=function(r,e){var a=e/8|0;return(r[a]|r[a+1]<<8|r[a+2]<<16)>>(e&7)},Ar=function(r){return(r+7)/8|0},cr=function(r,e,a){return(e==null||e<0)&&(e=0),(a==null||a>r.length)&&(a=r.length),new T(r.subarray(e,a))},te=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],G=function(r,e,a){var n=new Error(e||te[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,G),!a)throw n;return n},oe=function(r,e,a,n){var t=r.length,o=0;if(!t||e.f&&!e.l)return a||new T(0);var v=!a,l=v||e.i!=2,h=e.i;v&&(a=new T(t*3));var c=function(ar){var nr=a.length;if(ar>nr){var rr=new T(Math.max(nr*2,ar));rr.set(a),a=rr}},f=e.f||0,i=e.p||0,u=e.b||0,x=e.l,S=e.d,w=e.m,d=e.n,m=t*8;do{if(!x){f=J(r,i,1);var R=J(r,i+1,3);if(i+=3,R)if(R==1)x=ee,S=ne,w=9,d=5;else if(R==2){var N=J(r,i,31)+257,A=J(r,i+10,15)+4,g=N+J(r,i+5,31)+1;i+=14;for(var s=new T(g),M=new T(19),C=0;C>4;if(j<16)s[C++]=j;else{var E=0,b=0;for(j==16?(b=3+J(r,i,3),i+=2,E=s[C-1]):j==17?(b=3+J(r,i,7),i+=3):j==18&&(b=11+J(r,i,127),i+=7);b--;)s[C++]=E}}var z=s.subarray(0,N),F=s.subarray(N);w=wr(z),d=wr(F),x=q(z,w,1),S=q(F,d,1)}else G(1);else{var j=Ar(i)+4,D=r[j-4]|r[j-3]<<8,O=j+D;if(O>t){h&&G(0);break}l&&c(u+D),a.set(r.subarray(j,O),u),e.b=u+=D,e.p=i=O*8,e.f=f;continue}if(i>m){h&&G(0);break}}l&&c(u+131072);for(var er=(1<>4;if(i+=E&15,i>m){h&&G(0);break}if(E||G(2),H<256)a[u++]=H;else if(H==256){Y=i,x=null;break}else{var P=H-254;if(H>264){var C=H-257,p=lr[C];P=J(r,i,(1<>4;W||G(3),i+=W&15;var F=Zr[X];if(X>3){var p=sr[X];F+=xr(r,i)&(1<m){h&&G(0);break}l&&c(u+131072);var Z=u+P;if(u>8},tr=function(r,e,a){a<<=e&7;var n=e/8|0;r[n]|=a,r[n+1]|=a>>8,r[n+2]|=a>>16},yr=function(r,e){for(var a=[],n=0;nu&&(u=o[n].s);var x=new $(u+1),S=Tr(a[f-1],x,0);if(S>e){var n=0,w=0,d=S-e,m=1<e)w+=m-(1<>=d;w>0;){var j=o[n].s;x[j]=0&&w;--n){var D=o[n].s;x[D]==e&&(--x[D],++w)}S=e}return{t:new T(x),l:S}},Tr=function(r,e,a){return r.s==-1?Math.max(Tr(r.l,e,a+1),Tr(r.r,e,a+1)):e[r.s]=a},Er=function(r){for(var e=r.length;e&&!r[--e];);for(var a=new $(++e),n=0,t=r[0],o=1,v=function(h){a[n++]=h},l=1;l<=e;++l)if(r[l]==t&&l!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)v(32754);o>2&&(v(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(v(t),--o;o>6;o-=6)v(8304);o>2&&(v(o-3<<5|8208),o=0)}for(;o--;)v(t);o=1,t=r[l]}return{c:a.subarray(0,n),n:e}},or=function(r,e){for(var a=0,n=0;n>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o4&&!M[pr[k-1]];--k);var L=c+5<<3,U=or(t,V)+or(o,fr)+v,_=or(t,u)+or(o,w)+v+14+3*k+or(A,M)+2*A[16]+3*A[17]+7*A[18];if(h>=0&&L<=U&&L<=_)return Ur(e,f,r.subarray(h,h+c));var E,b,z,F;if(K(e,f,1+(_15&&(K(e,f,H[g]>>5&127),f+=H[g]>>12)}}else E=re,b=V,z=ae,F=fr;for(var g=0;g255){var P=p>>18&31;tr(e,f,E[P+257]),f+=b[P+257],P>7&&(K(e,f,p>>23&31),f+=lr[P]);var W=p&31;tr(e,f,z[W]),f+=F[W],W>3&&(tr(e,f,p>>5&8191),f+=sr[W])}else tr(e,f,E[p]),f+=b[p]}return tr(e,f,E[256]),f+b[256]},fe=new jr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Hr=new T(0),ie=function(r,e,a,n,t,o){var v=o.z||r.length,l=new T(n+v+5*(1+Math.ceil(v/7e3))+t),h=l.subarray(n,l.length-t),c=o.l,f=(o.r||0)&7;if(e){f&&(h[0]=o.r>>3);for(var i=fe[e-1],u=i>>13,x=i&8191,S=(1<7e3||M>24576)&&(E>423||!c)){f=Fr(r,h,0,D,O,N,g,M,k,s-k,f),M=A=g=0,k=s;for(var b=0;b<286;++b)O[b]=0;for(var b=0;b<30;++b)N[b]=0}var z=2,F=0,er=x,B=U-_&32767;if(E>2&&L==j(s-B))for(var Y=Math.min(u,E)-1,H=Math.min(32767,s),P=Math.min(258,E);B<=H&&--er&&U!=_;){if(r[s+z]==r[s+z-B]){for(var p=0;pz){if(z=p,F=B,p>Y)break;for(var W=Math.min(B,p-2),X=0,b=0;bX&&(X=vr,_=Z)}}}U=_,_=w[U],B+=U-_&32767}if(F){D[M++]=268435456|mr[z]<<18|Mr[F];var ar=mr[z]&31,nr=Mr[F]&31;g+=lr[ar]+sr[nr],++O[257+ar],++N[nr],C=s+z,++A}else D[M++]=r[s],++O[r[s]]}}for(s=Math.max(s,C);s=v&&(h[f/8|0]=c,rr=v),f=Ur(h,f+1,r.subarray(s,rr))}o.i=v}return cr(l,0,n+Ar(f)+t)},Pr=function(){var r=1,e=0;return{p:function(a){for(var n=r,t=e,o=a.length|0,v=0;v!=o;){for(var l=Math.min(v+2655,o);v>16),t=(t&65535)+15*(t>>16)}r=n,e=t},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},ve=function(r,e,a,n,t){if(!t&&(t={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),v=new T(o.length+r.length);v.set(o),v.set(r,o.length),r=v,t.w=o.length}return ie(r,e.level==null?6:e.level,e.mem==null?t.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,a,n,t)},$r=function(r,e,a){for(;a;++e)r[e]=a,a>>>=8},le=function(r,e){var a=e.level,n=a==0?0:a<6?1:a==9?3:2;if(r[0]=120,r[1]=n<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var t=Pr();t.p(e.dictionary),$r(r,2,t.d())}},se=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&G(6,"invalid zlib data"),(r[1]>>5&1)==1&&G(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ce(r,e){e||(e={});var a=Pr();a.p(r);var n=ve(r,e,e.dictionary?6:2,4);return le(n,e),$r(n,n.length-4,a.d()),n}function ue(r,e){return oe(r.subarray(se(r),-4),{i:2},e,e)}var Or=typeof TextEncoder<"u"&&new TextEncoder,dr=typeof TextDecoder<"u"&&new TextDecoder,he=0;try{dr.decode(Hr,{stream:!0}),he=1}catch{}var ge=function(r){for(var e="",a=0;;){var n=r[a++],t=(n>127)+(n>223)+(n>239);if(a+t>r.length)return{s:e,r:cr(r,a-1)};t?t==3?(n=((n&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):t&1?e+=String.fromCharCode((n&31)<<6|r[a++]&63):e+=String.fromCharCode((n&15)<<12|(r[a++]&63)<<6|r[a++]&63):e+=String.fromCharCode(n)}};function kr(r,e){if(e){for(var a=new T(r.length),n=0;n>1)),v=0,l=function(f){o[v++]=f},n=0;no.length){var h=new T(v+8+(t-n<<1));h.set(o),o=h}var c=r.charCodeAt(n);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|r.charCodeAt(++n)&1023,l(240|c>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|c&63)):(l(224|c>>12),l(128|c>>6&63),l(128|c&63))}return cr(o,0,v)}function Ir(r,e){if(e){for(var a="",n=0;n`,br=``;function xe(r){if(typeof r!="object"||r===null)return!1;const e=r;return!(typeof e.history!="object"||"followupMessages"in e&&typeof e.followupMessages!="object"||"chatOptions"in e&&typeof e.chatOptions!="object"||"serverState"in e&&typeof e.serverState!="object"||"conversationId"in e&&typeof e.conversationId!="string"&&typeof e.conversationId!="object")}function be(){const{restore:r}=Gr(),{isOpen:e,onOpen:a,onClose:n}=Jr(),[t,o]=hr.useState(Dr),v=hr.useRef(null),{getCurrentConversation:l}=Wr(f=>f.primitives),h=()=>{const{chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}=l(),w=Vr({chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}),d=kr(`${Sr}${JSON.stringify(w)}${br}`),m=btoa(Ir(ce(d,{level:9}),!0));navigator.clipboard.writeText(m),o(we),n(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(Dr)},2e3)},c=()=>{n()};return hr.useEffect(()=>{const f=i=>{if(!i.clipboardData)return;const u=i.clipboardData.types;if(!u.includes("text/plain")&&!u.includes("text"))return;const x=i.clipboardData.getData("text/plain")??i.clipboardData.getData("text");try{const S=atob(x);if(!S.startsWith("xÚ"))return;const w=Ir(ue(kr(S,!0)));if(!w.startsWith(Sr)||!w.endsWith(br))return;i.preventDefault(),i.stopPropagation();const d=w.slice(Sr.length,-br.length),m=JSON.parse(d);if(!xe(m))return;r(m.history,m.followupMessages,m.chatOptions,m.serverState,m.conversationId)}catch(S){console.error("Couldn't parse pasted string as valid Ragbits state",S)}};return window.addEventListener("paste",f),()=>{window.removeEventListener("paste",f)}}),I.jsxs(I.Fragment,{children:[I.jsx(qr,{content:"Share conversation",placement:"bottom",children:I.jsx(gr,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:a,children:I.jsx(Yr,{icon:t})})}),I.jsx(Kr,{isOpen:e,onOpenChange:c,children:I.jsx(Lr,{children:f=>I.jsxs(I.Fragment,{children:[I.jsx(Xr,{className:"text-default-900 flex flex-col gap-1",children:"Share conversation"}),I.jsx(Qr,{children:I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsx("p",{className:"text-medium text-default-500",children:"You are about to copy a code that allows sharing and storing your current app state. Once copied, you can paste this code anywhere on the site to instantly return to this exact setup. It’s a quick way to save your progress or share it with others."}),I.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[I.jsx(gr,{color:"danger",variant:"light",onPress:f,"aria-label":"Close share modal",children:"Cancel"}),I.jsx(gr,{color:"primary",onPress:h,"aria-label":"Copy to clipboard to share the conversation",children:"Copy to clipboard"})]})]})})]})})})]})}export{be as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DMRLcM7z.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DMRLcM7z.js new file mode 100644 index 0000000000..1c5d5c5ba0 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-DMRLcM7z.js @@ -0,0 +1 @@ +import{aZ as Gr,u as Jr,r as hr,a_ as Wr,j as I,D as qr,d as gr,I as Yr,m as Zr,e as Kr,f as Lr,a$ as Qr}from"./index-DpOBiJiD.js";import{m as Vr}from"./chunk-IGSAU2ZA-BcGvhJAc.js";var T=Uint8Array,P=Uint16Array,jr=Int32Array,lr=new T([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new T([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pr=new T([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_r=function(r,e){for(var a=new P(31),n=0;n<31;++n)a[n]=e+=1<>1|(y&21845)<<1;L=(L&52428)>>2|(L&13107)<<2,L=(L&61680)>>4|(L&3855)<<4,Cr[y]=((L&65280)>>8|(L&255)<<8)>>1}var q=(function(r,e,a){for(var n=r.length,t=0,o=new P(e);t>h]=c}else for(l=new P(n),t=0;t>15-r[t]);return l}),Q=new T(288);for(var y=0;y<144;++y)Q[y]=8;for(var y=144;y<256;++y)Q[y]=9;for(var y=256;y<280;++y)Q[y]=7;for(var y=280;y<288;++y)Q[y]=8;var fr=new T(32);for(var y=0;y<32;++y)fr[y]=5;var re=q(Q,9,0),ee=q(Q,9,1),ae=q(fr,5,0),ne=q(fr,5,1),wr=function(r){for(var e=r[0],a=1;ae&&(e=r[a]);return e},J=function(r,e,a){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&a},xr=function(r,e){var a=e/8|0;return(r[a]|r[a+1]<<8|r[a+2]<<16)>>(e&7)},Ar=function(r){return(r+7)/8|0},cr=function(r,e,a){return(e==null||e<0)&&(e=0),(a==null||a>r.length)&&(a=r.length),new T(r.subarray(e,a))},te=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],G=function(r,e,a){var n=new Error(e||te[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,G),!a)throw n;return n},oe=function(r,e,a,n){var t=r.length,o=0;if(!t||e.f&&!e.l)return a||new T(0);var v=!a,l=v||e.i!=2,h=e.i;v&&(a=new T(t*3));var c=function(ar){var nr=a.length;if(ar>nr){var rr=new T(Math.max(nr*2,ar));rr.set(a),a=rr}},f=e.f||0,i=e.p||0,u=e.b||0,x=e.l,S=e.d,w=e.m,d=e.n,m=t*8;do{if(!x){f=J(r,i,1);var R=J(r,i+1,3);if(i+=3,R)if(R==1)x=ee,S=ne,w=9,d=5;else if(R==2){var _=J(r,i,31)+257,A=J(r,i+10,15)+4,g=_+J(r,i+5,31)+1;i+=14;for(var s=new T(g),M=new T(19),C=0;C>4;if(j<16)s[C++]=j;else{var E=0,b=0;for(j==16?(b=3+J(r,i,3),i+=2,E=s[C-1]):j==17?(b=3+J(r,i,7),i+=3):j==18&&(b=11+J(r,i,127),i+=7);b--;)s[C++]=E}}var z=s.subarray(0,_),F=s.subarray(_);w=wr(z),d=wr(F),x=q(z,w,1),S=q(F,d,1)}else G(1);else{var j=Ar(i)+4,D=r[j-4]|r[j-3]<<8,O=j+D;if(O>t){h&&G(0);break}l&&c(u+D),a.set(r.subarray(j,O),u),e.b=u+=D,e.p=i=O*8,e.f=f;continue}if(i>m){h&&G(0);break}}l&&c(u+131072);for(var er=(1<>4;if(i+=E&15,i>m){h&&G(0);break}if(E||G(2),$<256)a[u++]=$;else if($==256){Y=i,x=null;break}else{var H=$-254;if($>264){var C=$-257,p=lr[C];H=J(r,i,(1<>4;W||G(3),i+=W&15;var F=Xr[V];if(V>3){var p=sr[V];F+=xr(r,i)&(1<m){h&&G(0);break}l&&c(u+131072);var X=u+H;if(u>8},tr=function(r,e,a){a<<=e&7;var n=e/8|0;r[n]|=a,r[n+1]|=a>>8,r[n+2]|=a>>16},yr=function(r,e){for(var a=[],n=0;nu&&(u=o[n].s);var x=new P(u+1),S=Tr(a[f-1],x,0);if(S>e){var n=0,w=0,d=S-e,m=1<e)w+=m-(1<>=d;w>0;){var j=o[n].s;x[j]=0&&w;--n){var D=o[n].s;x[D]==e&&(--x[D],++w)}S=e}return{t:new T(x),l:S}},Tr=function(r,e,a){return r.s==-1?Math.max(Tr(r.l,e,a+1),Tr(r.r,e,a+1)):e[r.s]=a},Er=function(r){for(var e=r.length;e&&!r[--e];);for(var a=new P(++e),n=0,t=r[0],o=1,v=function(h){a[n++]=h},l=1;l<=e;++l)if(r[l]==t&&l!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)v(32754);o>2&&(v(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(v(t),--o;o>6;o-=6)v(8304);o>2&&(v(o-3<<5|8208),o=0)}for(;o--;)v(t);o=1,t=r[l]}return{c:a.subarray(0,n),n:e}},or=function(r,e){for(var a=0,n=0;n>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o4&&!M[pr[k-1]];--k);var K=c+5<<3,U=or(t,Q)+or(o,fr)+v,N=or(t,u)+or(o,w)+v+14+3*k+or(A,M)+2*A[16]+3*A[17]+7*A[18];if(h>=0&&K<=U&&K<=N)return Ur(e,f,r.subarray(h,h+c));var E,b,z,F;if(Z(e,f,1+(N15&&(Z(e,f,$[g]>>5&127),f+=$[g]>>12)}}else E=re,b=Q,z=ae,F=fr;for(var g=0;g255){var H=p>>18&31;tr(e,f,E[H+257]),f+=b[H+257],H>7&&(Z(e,f,p>>23&31),f+=lr[H]);var W=p&31;tr(e,f,z[W]),f+=F[W],W>3&&(tr(e,f,p>>5&8191),f+=sr[W])}else tr(e,f,E[p]),f+=b[p]}return tr(e,f,E[256]),f+b[256]},fe=new jr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$r=new T(0),ie=function(r,e,a,n,t,o){var v=o.z||r.length,l=new T(n+v+5*(1+Math.ceil(v/7e3))+t),h=l.subarray(n,l.length-t),c=o.l,f=(o.r||0)&7;if(e){f&&(h[0]=o.r>>3);for(var i=fe[e-1],u=i>>13,x=i&8191,S=(1<7e3||M>24576)&&(E>423||!c)){f=Fr(r,h,0,D,O,_,g,M,k,s-k,f),M=A=g=0,k=s;for(var b=0;b<286;++b)O[b]=0;for(var b=0;b<30;++b)_[b]=0}var z=2,F=0,er=x,B=U-N&32767;if(E>2&&K==j(s-B))for(var Y=Math.min(u,E)-1,$=Math.min(32767,s),H=Math.min(258,E);B<=$&&--er&&U!=N;){if(r[s+z]==r[s+z-B]){for(var p=0;pz){if(z=p,F=B,p>Y)break;for(var W=Math.min(B,p-2),V=0,b=0;bV&&(V=vr,N=X)}}}U=N,N=w[U],B+=U-N&32767}if(F){D[M++]=268435456|mr[z]<<18|Mr[F];var ar=mr[z]&31,nr=Mr[F]&31;g+=lr[ar]+sr[nr],++O[257+ar],++_[nr],C=s+z,++A}else D[M++]=r[s],++O[r[s]]}}for(s=Math.max(s,C);s=v&&(h[f/8|0]=c,rr=v),f=Ur(h,f+1,r.subarray(s,rr))}o.i=v}return cr(l,0,n+Ar(f)+t)},Hr=function(){var r=1,e=0;return{p:function(a){for(var n=r,t=e,o=a.length|0,v=0;v!=o;){for(var l=Math.min(v+2655,o);v>16),t=(t&65535)+15*(t>>16)}r=n,e=t},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},ve=function(r,e,a,n,t){if(!t&&(t={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),v=new T(o.length+r.length);v.set(o),v.set(r,o.length),r=v,t.w=o.length}return ie(r,e.level==null?6:e.level,e.mem==null?t.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,a,n,t)},Pr=function(r,e,a){for(;a;++e)r[e]=a,a>>>=8},le=function(r,e){var a=e.level,n=a==0?0:a<6?1:a==9?3:2;if(r[0]=120,r[1]=n<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var t=Hr();t.p(e.dictionary),Pr(r,2,t.d())}},se=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&G(6,"invalid zlib data"),(r[1]>>5&1)==1&&G(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ce(r,e){e||(e={});var a=Hr();a.p(r);var n=ve(r,e,e.dictionary?6:2,4);return le(n,e),Pr(n,n.length-4,a.d()),n}function ue(r,e){return oe(r.subarray(se(r),-4),{i:2},e,e)}var Or=typeof TextEncoder<"u"&&new TextEncoder,dr=typeof TextDecoder<"u"&&new TextDecoder,he=0;try{dr.decode($r,{stream:!0}),he=1}catch{}var ge=function(r){for(var e="",a=0;;){var n=r[a++],t=(n>127)+(n>223)+(n>239);if(a+t>r.length)return{s:e,r:cr(r,a-1)};t?t==3?(n=((n&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):t&1?e+=String.fromCharCode((n&31)<<6|r[a++]&63):e+=String.fromCharCode((n&15)<<12|(r[a++]&63)<<6|r[a++]&63):e+=String.fromCharCode(n)}};function kr(r,e){if(e){for(var a=new T(r.length),n=0;n>1)),v=0,l=function(f){o[v++]=f},n=0;no.length){var h=new T(v+8+(t-n<<1));h.set(o),o=h}var c=r.charCodeAt(n);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|r.charCodeAt(++n)&1023,l(240|c>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|c&63)):(l(224|c>>12),l(128|c>>6&63),l(128|c&63))}return cr(o,0,v)}function Ir(r,e){if(e){for(var a="",n=0;n`,br=``;function xe(r){if(typeof r!="object"||r===null)return!1;const e=r;return!(typeof e.history!="object"||"followupMessages"in e&&typeof e.followupMessages!="object"||"chatOptions"in e&&typeof e.chatOptions!="object"||"serverState"in e&&typeof e.serverState!="object"||"conversationId"in e&&typeof e.conversationId!="string"&&typeof e.conversationId!="object")}function be(){const{restore:r}=Gr(),{isOpen:e,onOpen:a,onClose:n}=Jr(),[t,o]=hr.useState(Dr),v=hr.useRef(null),{getCurrentConversation:l}=Wr(f=>f.primitives),h=()=>{const{chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}=l(),w=Qr({chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}),d=kr(`${Sr}${JSON.stringify(w)}${br}`),m=btoa(Ir(ce(d,{level:9}),!0));navigator.clipboard.writeText(m),o(we),n(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(Dr)},2e3)},c=()=>{n()};return hr.useEffect(()=>{const f=i=>{if(!i.clipboardData)return;const u=i.clipboardData.types;if(!u.includes("text/plain")&&!u.includes("text"))return;const x=i.clipboardData.getData("text/plain")??i.clipboardData.getData("text");try{const S=atob(x);if(!S.startsWith("xÚ"))return;const w=Ir(ue(kr(S,!0)));if(!w.startsWith(Sr)||!w.endsWith(br))return;i.preventDefault(),i.stopPropagation();const d=w.slice(Sr.length,-br.length),m=JSON.parse(d);if(!xe(m))return;r(m.history,m.followupMessages,m.chatOptions,m.serverState,m.conversationId)}catch(S){console.error("Couldn't parse pasted string as valid Ragbits state",S)}};return window.addEventListener("paste",f),()=>{window.removeEventListener("paste",f)}}),I.jsxs(I.Fragment,{children:[I.jsx(qr,{content:"Share conversation",placement:"bottom",children:I.jsx(gr,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:a,children:I.jsx(Yr,{icon:t})})}),I.jsx(Zr,{isOpen:e,onOpenChange:c,children:I.jsx(Kr,{children:f=>I.jsxs(I.Fragment,{children:[I.jsx(Vr,{className:"text-default-900 flex flex-col gap-1",children:"Share conversation"}),I.jsx(Lr,{children:I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsx("p",{className:"text-medium text-default-500",children:"You are about to copy a code that allows sharing and storing your current app state. Once copied, you can paste this code anywhere on the site to instantly return to this exact setup. It’s a quick way to save your progress or share it with others."}),I.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[I.jsx(gr,{color:"danger",variant:"light",onPress:f,"aria-label":"Close share modal",children:"Cancel"}),I.jsx(gr,{color:"primary",onPress:h,"aria-label":"Copy to clipboard to share the conversation",children:"Copy to clipboard"})]})]})})]})})})]})}export{be as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-BABA7a-w.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-BABA7a-w.js deleted file mode 100644 index 90d77383a1..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-BABA7a-w.js +++ /dev/null @@ -1 +0,0 @@ -import{r as B,aX as Ml,aY as ae,t as Ne,k as ie,aK as z,aZ as W,a_ as U,a$ as te,b0 as Tl,aT as _,b1 as Rl,b2 as Vl,A as ze,b3 as ue,b4 as Ol,K as pe,H as Hl,J,M as Ll,b5 as L,af as Ul,b6 as Y,b7 as Z,b8 as le,U as Wl,b9 as Gl,ba as Ce,bb as Yl,l as T,R as M,W as X,Z as K,j as h,v as I,a2 as w,ap as be,au as Fe,a3 as O,w as Zl,y as _l,x as ql,a5 as q,O as Jl,Q as Pe,a0 as Ke,X as Ie,u as Xl,as as De,D as Ql,d as eu,I as tu,m as lu,e as uu,f as nu,bc as ou}from"./index-BZLU40Mk.js";import{b as fe,$ as je}from"./useSelectableItem-DhuFnc0W.js";import{C as su,u as iu}from"./index-Ceq7Rkzy.js";import{m as ru}from"./chunk-IGSAU2ZA-NXd1g0Qd.js";function Me(e,t){const l=B.useRef(!0),u=B.useRef(null);B.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]),B.useEffect(()=>{let o=u.current;l.current?l.current=!1:(!o||t.some((n,i)=>!Object.is(n,o[i])))&&e(),u.current=t},t)}function au(e,t){let l=t?.isDisabled,[u,o]=B.useState(!1);return Ml(()=>{if(e?.current&&!l){let n=()=>{if(e.current){let a=ae(e.current,{tabbable:!0});o(!!a.nextNode())}};n();let i=new MutationObserver(n);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),l?!1:u}var Be=Ne({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),ke=Ne({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const he=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function cu(e,t){let l=he.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}`}function Te(e,t,l){let u=he.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}-${ce(l)}`}function Re(e,t){return[...e.collection.rowHeaderColumnKeys].map(l=>Te(e,t,l)).join(" ")}var Ve={};Ve={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Oe={};Oe={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var He={};He={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var Le={};Le={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Ue={};Ue={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var We={};We={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ge={};Ge={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var Ye={};Ye={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ze={};Ze={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var _e={};_e={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var qe={};qe={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var Je={};Je={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Xe={};Xe={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Qe={};Qe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var et={};et={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var tt={};tt={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var lt={};lt={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var ut={};ut={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var nt={};nt={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var ot={};ot={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var st={};st={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var it={};it={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var rt={};rt={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var at={};at={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var ct={};ct={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var dt={};dt={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var mt={};mt={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var pt={};pt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var bt={};bt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var ft={};ft={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var ht={};ht={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var vt={};vt={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var gt={};gt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var $t={};$t={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Ve,"bg-BG":Oe,"cs-CZ":He,"da-DK":Le,"de-DE":Ue,"el-GR":We,"en-US":Ge,"es-ES":Ye,"et-EE":Ze,"fi-FI":_e,"fr-FR":qe,"he-IL":Je,"hr-HR":Xe,"hu-HU":Qe,"it-IT":et,"ja-JP":tt,"ko-KR":lt,"lt-LT":ut,"lv-LV":nt,"nb-NO":ot,"nl-NL":st,"pl-PL":it,"pt-BR":rt,"pt-PT":at,"ro-RO":ct,"ru-RU":dt,"sk-SK":mt,"sl-SI":pt,"sr-SP":bt,"sv-SE":ft,"tr-TR":ht,"uk-UA":vt,"zh-CN":gt,"zh-TW":$t};class yt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var l;return this.disabledBehavior==="all"&&(((l=t.props)===null||l===void 0?void 0:l.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,l){let u=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;u=this.collection.getKeyBefore(u)}return null}findNextKey(t,l){let u=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;if(u=this.collection.getKeyAfter(u),u==null)return null}return null}getKeyForItemInRowByIndex(t,l=0){if(l<0)return null;let u=this.collection.getItem(t);if(!u)return null;let o=0;for(let a of z(u,this.collection)){var n;if(a.colSpan&&a.colSpan+o>l)return(n=a.key)!==null&&n!==void 0?n:null;a.colSpan&&(o=o+a.colSpan-1);var i;if(o===l)return(i=a.key)!==null&&i!==void 0?i:null;o++}return null}getKeyBelow(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findNextKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyAbove(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findPreviousKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyRightOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=W(d))===null||u===void 0?void 0:u.key:(o=U(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index-1):te(r,l.index+1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&c!==void 0?c:null}return null}getKeyLeftOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=U(d))===null||u===void 0?void 0:u.key:(o=W(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index+1):te(r,l.index-1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&c!==void 0?c:null}return null}getFirstKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;var i;return(i=(n=U(z(c,this.collection)))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findNextKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;var m;u=(m=(a=U(z(c,this.collection)))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getLastKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;let d=z(c,this.collection);var i;return(i=(n=W(d))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findPreviousKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;let d=z(c,this.collection);var m;u=(m=(a=W(d))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getKeyPageAbove(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=Math.max(0,u.y+u.height-this.layoutDelegate.getVisibleRect().height);for(;u&&u.y>o&&l!=null;){var n;if(l=(n=this.getKeyAbove(l))!==null&&n!==void 0?n:null,l==null)break;u=this.layoutDelegate.getItemRect(l)}return l}getKeyPageBelow(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,u.y+o);for(;u&&u.y+u.heightr.type==="item"),u==null&&!a&&(u=this.getFirstKey(),a=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new du(t.layout):new Tl(t.ref)),this.focusMode=t.focusMode||"row"}}class du{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var l;return((l=this.layout.getLayoutInfo(t))===null||l===void 0?void 0:l.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const ve=new WeakMap;var xt={};xt={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var Ct={};Ct={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var Dt={};Dt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var Bt={};Bt={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var kt={};kt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Et={};Et={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var St={};St={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var At={};At={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var wt={};wt={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var Nt={};Nt={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var zt={};zt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Ft={};Ft={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var Pt={};Pt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Kt={};Kt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var It={};It={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var jt={};jt={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var Mt={};Mt={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Tt={};Tt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Rt={};Rt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Vt={};Vt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Ot={};Ot={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ht={};Ht={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Lt={};Lt={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ut={};Ut={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Wt={};Wt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Gt={};Gt={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var Yt={};Yt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Zt={};Zt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var _t={};_t={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var qt={};qt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Jt={};Jt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Xt={};Xt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Qt={};Qt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var el={};el={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":xt,"bg-BG":Ct,"cs-CZ":Dt,"da-DK":Bt,"de-DE":kt,"el-GR":Et,"en-US":St,"es-ES":At,"et-EE":wt,"fi-FI":Nt,"fr-FR":zt,"he-IL":Ft,"hr-HR":Pt,"hu-HU":Kt,"it-IT":It,"ja-JP":jt,"ko-KR":Mt,"lt-LT":Tt,"lv-LV":Rt,"nb-NO":Vt,"nl-NL":Ot,"pl-PL":Ht,"pt-BR":Lt,"pt-PT":Ut,"ro-RO":Wt,"ru-RU":Gt,"sk-SK":Yt,"sl-SI":Zt,"sr-SP":_t,"sv-SE":qt,"tr-TR":Jt,"uk-UA":Xt,"zh-CN":Qt,"zh-TW":el};const tl=7e3;let V=null;function ll(e,t="assertive",l=tl){V?V.announce(e,t,l):(V=new mu,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,l):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,l)},100))}class mu{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let l=document.createElement("div");return l.setAttribute("role","log"),l.setAttribute("aria-live",t),l.setAttribute("aria-relevant","additions"),l}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,l="assertive",u=tl){var o,n;if(!this.node)return;let i=document.createElement("div");typeof t=="object"?(i.setAttribute("role","img"),i.setAttribute("aria-labelledby",t["aria-labelledby"])):i.textContent=t,l==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(i):(n=this.politeLog)===null||n===void 0||n.appendChild(i),t!==""&&setTimeout(()=>{i.remove()},u)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function pu(e){return e&&e.__esModule?e.default:e}function bu(e,t){let{getRowText:l=a=>{var m,c,d,r;return(r=(m=(c=t.collection).getTextValue)===null||m===void 0?void 0:m.call(c,a))!==null&&r!==void 0?r:(d=t.collection.getItem(a))===null||d===void 0?void 0:d.textValue}}=e,u=_(pu(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=B.useRef(o),i=Rl(()=>{var a;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let m=Ee(o,n.current),c=Ee(n.current,o),d=t.selectionManager.selectionBehavior==="replace",r=[];if(t.selectionManager.selectedKeys.size===1&&d){let p=t.selectionManager.selectedKeys.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(m.size===1&&c.size===0){let p=m.keys().next().value;if(p!=null){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(c.size===1&&m.size===0){let p=c.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("deselectedItem",{item:s}))}}t.selectionManager.selectionMode==="multiple"&&(r.length===0||o==="all"||o.size>1||n.current==="all"||((a=n.current)===null||a===void 0?void 0:a.size)>1)&&r.push(o==="all"?u.format("selectedAll"):u.format("selectedCount",{count:o.size})),r.length>0&&ll(r.join(" ")),n.current=o});Me(()=>{if(t.selectionManager.isFocused)i();else{let a=requestAnimationFrame(i);return()=>cancelAnimationFrame(a)}},[o,t.selectionManager.isFocused])}function Ee(e,t){let l=new Set;if(e==="all"||t==="all")return l;for(let u of e.keys())t.has(u)||l.add(u);return l}function fu(e){return e&&e.__esModule?e.default:e}function hu(e){let t=_(fu(oe),"@react-aria/grid"),l=Vl(),u=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window,o=B.useMemo(()=>{let i=e.selectionManager.selectionMode,a=e.selectionManager.selectionBehavior,m;return u&&(m=t.format("longPressToSelect")),a==="replace"&&i!=="none"&&e.hasItemActions?m:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,u]);return fe(o)}function vu(e,t,l){let{isVirtualized:u,disallowTypeAhead:o,keyboardDelegate:n,focusMode:i,scrollRef:a,getRowText:m,onRowAction:c,onCellAction:d,escapeKeyBehavior:r="clearSelection",shouldSelectOnPressUp:p}=e,{selectionManager:s}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=ze({usage:"search",sensitivity:"base"}),{direction:v}=ue(),g=t.selectionManager.disabledBehavior,x=B.useMemo(()=>n||new yt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:l,direction:v,collator:b,focusMode:i}),[n,t.collection,t.disabledKeys,g,l,v,b,i]),{collectionProps:D}=Ol({ref:l,selectionManager:s,keyboardDelegate:x,isVirtualized:u,scrollRef:a,disallowTypeAhead:o,escapeKeyBehavior:r}),y=pe(e.id);ve.set(t,{keyboardDelegate:x,actions:{onRowAction:c,onCellAction:d},shouldSelectOnPressUp:p});let $=hu({selectionManager:s,hasItemActions:!!(c||d)}),f=Hl(e,{labelable:!0}),E=B.useCallback(C=>{if(s.isFocused){C.currentTarget.contains(C.target)||s.setFocused(!1);return}C.currentTarget.contains(C.target)&&s.setFocused(!0)},[s]),S=B.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=au(l,{isDisabled:t.collection.size!==0}),k=J(f,{role:"grid",id:y,"aria-multiselectable":s.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,$);return u&&(k["aria-rowcount"]=t.collection.size,k["aria-colcount"]=t.collection.columnCount),bu({getRowText:m},t),{gridProps:k}}function gu(){return{rowGroupProps:{role:"rowgroup"}}}function $u(e,t,l){var u,o;let{node:n,isVirtualized:i,shouldSelectOnPressUp:a,onAction:m}=e,{actions:c,shouldSelectOnPressUp:d}=ve.get(t),r=c.onRowAction?()=>{var g;return(g=c.onRowAction)===null||g===void 0?void 0:g.call(c,n.key)}:m,{itemProps:p,...s}=je({selectionManager:t.selectionManager,key:n.key,ref:l,isVirtualized:i,shouldSelectOnPressUp:d||a,onAction:r||!(n==null||(u=n.props)===null||u===void 0)&&u.onAction?Ll(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,r):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),v={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":s.isDisabled||void 0,...p};return i&&(v["aria-rowindex"]=n.index+1),{rowProps:v,...s}}function ul(e,t,l){let{node:u,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:i,onAction:a}=e,{direction:m}=ue(),{keyboardDelegate:c,actions:{onCellAction:d}}=ve.get(t),r=B.useRef(null),p=()=>{if(l.current){let y=ae(l.current);if(n==="child"){if(l.current.contains(document.activeElement)&&l.current!==document.activeElement)return;let $=t.selectionManager.childFocusStrategy==="last"?re(y):y.firstChild();if($){L($);return}}(r.current!=null&&u.key!==r.current||!l.current.contains(document.activeElement))&&L(l.current)}},{itemProps:s,isPressed:b}=je({selectionManager:t.selectionManager,key:u.key,ref:l,isVirtualized:o,focus:p,shouldSelectOnPressUp:i,onAction:d?()=>d(u.key):a,isDisabled:t.collection.size===0}),v=y=>{if(!y.currentTarget.contains(y.target)||t.isKeyboardNavigationDisabled||!l.current||!document.activeElement)return;let $=ae(l.current);switch($.currentNode=document.activeElement,y.key){case"ArrowLeft":{let C=m==="rtl"?$.nextNode():$.previousNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var f;if(((f=c.getKeyLeftOf)===null||f===void 0?void 0:f.call(c,u.key))!==u.key){var E;(E=l.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="rtl"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=m==="rtl"?$.firstChild():re($),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowRight":{let C=m==="rtl"?$.previousNode():$.nextNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var S;if(((S=c.getKeyRightOf)===null||S===void 0?void 0:S.call(c,u.key))!==u.key){var A;(A=l.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="ltr"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=m==="rtl"?re($):$.firstChild(),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowUp":case"ArrowDown":if(!y.altKey&&l.current.contains(y.target)){var k;y.stopPropagation(),y.preventDefault(),(k=l.current.parentElement)===null||k===void 0||k.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent))}break}},g=y=>{if(r.current=u.key,y.target!==l.current){Ul()||t.selectionManager.setFocusedKey(u.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===l.current&&p()})},x=J(s,{role:"gridcell",onKeyDownCapture:v,"aria-colspan":u.colSpan,"aria-colindex":u.colIndex!=null?u.colIndex+1:void 0,colSpan:o?void 0:u.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=u.colIndex)!==null&&D!==void 0?D:u.index)+1),i&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=y=>{let $=y.currentTarget,f=$.getAttribute("tabindex");$.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&$.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,l=null;do l=e.lastChild(),l&&(t=l);while(l);return t}function yu(e){return e&&e.__esModule?e.default:e}function xu(e,t){let{key:l}=e,u=t.selectionManager,o=pe(),n=!t.selectionManager.canSelectItem(l),i=t.selectionManager.isSelected(l),a=()=>u.toggleSelection(l);const m=_(yu(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":m.format("select"),isSelected:i,isDisabled:n,onChange:a}}}class Cu extends yt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let u=U(z(l,this.collection));if(u)return u.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(t)}getKeyAbove(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let n=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return n&&n.type==="column"?n.key:null}let u=super.getKeyAbove(t),o=u!=null?this.collection.getItem(u):null;return o&&o.type!=="headerrow"?u:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(t){let l=this.findNextKey(t.key,o=>o.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level];for(let o of z(u,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let l=this.findPreviousKey(t.key,n=>n.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level],o=[...z(u,this.collection)];for(let n=o.length-1;n>=0;n--){let i=o[n];if(i.type==="column")return i.key}return null}getKeyRightOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(l):this.findNextColumnKey(l):super.getKeyRightOf(t):null}getKeyLeftOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findNextColumnKey(l):this.findPreviousColumnKey(l):super.getKeyLeftOf(t):null}getKeyForSearch(t,l){if(!this.collator)return null;let u=this.collection,o=l??this.getFirstKey();if(o==null)return null;let n=u.getItem(o);var i;n?.type==="cell"&&(o=(i=n.parentKey)!==null&&i!==void 0?i:null);let a=!1;for(;o!=null;){let m=u.getItem(o);if(!m)return null;if(m.textValue){let c=m.textValue.slice(0,t.length);if(this.collator.compare(c,t)===0)return m.key}for(let c of z(m,this.collection)){let d=u.columns[c.index];if(u.rowHeaderColumnKeys.has(d.key)&&c.textValue){let r=c.textValue.slice(0,t.length);if(this.collator.compare(r,t)===0){let p=l!=null?u.getItem(l):n;return p?.type==="cell"?c.key:m.key}}}o=this.getKeyBelow(o),o==null&&!a&&(o=this.getFirstKey(),a=!0)}return null}}function Du(e){return e&&e.__esModule?e.default:e}function Bu(e,t,l){let{keyboardDelegate:u,isVirtualized:o,layoutDelegate:n,layout:i}=e,a=ze({usage:"search",sensitivity:"base"}),{direction:m}=ue(),c=t.selectionManager.disabledBehavior,d=B.useMemo(()=>u||new Cu({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:c,ref:l,direction:m,collator:a,layoutDelegate:n,layout:i}),[u,t.collection,t.disabledKeys,c,l,m,a,n,i]),r=pe(e.id);he.set(t,r);let{gridProps:p}=vu({...e,id:r,keyboardDelegate:d},t,l);o&&(p["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),le()&&"expandedKeys"in t&&(p.role="treegrid");let{column:s,direction:b}=t.sortDescriptor||{},v=_(Du(ne),"@react-aria/table"),g=B.useMemo(()=>{var D,y;let $=(y=(D=t.collection.columns.find(f=>f.key===s))===null||D===void 0?void 0:D.textValue)!==null&&y!==void 0?y:"";return b&&s?v.format(`${b}Sort`,{columnName:$}):void 0},[b,s,t.collection.columns]),x=fe(g);return Me(()=>{g&&ll(g,"assertive",500)},[g]),{gridProps:J(p,x,{"aria-describedby":[x["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")})}}function ku(e){return e&&e.__esModule?e.default:e}function nl(e,t,l){var u,o;let{node:n}=e,i=n.props.allowsSorting,{gridCellProps:a}=ul({...e,focusMode:"child"},t,l),m=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:c}=Wl({isDisabled:!i||m,onPress(){t.sort(n.key)},ref:l}),{focusableProps:d}=Gl({},l),r,p=((u=t.sortDescriptor)===null||u===void 0?void 0:u.column)===n.key,s=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(r=p?s:"none");let b=_(ku(ne),"@react-aria/table"),v;i&&(v=`${b.format("sortable")}`,p&&s&&Ce()&&(v=`${v}, ${b.format(s)}`));let g=fe(v),x=t.collection.size===0;return B.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...J(d,a,c,g,x?{tabIndex:-1}:null),role:"columnheader",id:cu(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":r}}}const Se={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Eu(e,t,l){let{node:u,isVirtualized:o}=e,{rowProps:n,...i}=$u(e,t,l),{direction:a}=ue();o&&!(le()&&"expandedKeys"in t)?n["aria-rowindex"]=u.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let m={};if(le()&&"expandedKeys"in t){let f=t.keyMap.get(u.key);if(f!=null){var c,d,r,p,s,b;let E=((c=f.props)===null||c===void 0?void 0:c.UNSTABLE_childItems)||((r=f.props)===null||r===void 0||(d=r.children)===null||d===void 0?void 0:d.length)>t.userColumnCount;var v,g,x,D;m={onKeyDown:S=>{(S.key===Se.expand[a]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Se.collapse[a]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(u.key):void 0,"aria-level":f.level,"aria-posinset":((v=f.indexOfType)!==null&&v!==void 0?v:0)+1,"aria-setsize":f.level>1?((x=(p=W((g=(s=t.keyMap.get(f.parentKey))===null||s===void 0?void 0:s.childNodes)!==null&&g!==void 0?g:[]))===null||p===void 0?void 0:p.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let y=Yl(u.props),$=i.hasAction?y:{};return{rowProps:{...J(n,m,$),"aria-labelledby":Re(t,u.key)},...i}}function Su(e,t,l){let{node:u,isVirtualized:o}=e,n={role:"row"};return o&&!(le()&&"expandedKeys"in t)&&(n["aria-rowindex"]=u.index+1),{rowProps:n}}function ol(e,t,l){var u;let{gridCellProps:o,isPressed:n}=ul(e,t,l),i=(u=e.node.column)===null||u===void 0?void 0:u.key;return i!=null&&t.collection.rowHeaderColumnKeys.has(i)&&(o.role="rowheader",o.id=Te(t,e.node.parentKey,i)),{gridCellProps:o,isPressed:n}}function Au(e){return e&&e.__esModule?e.default:e}function wu(e,t){let{key:l}=e;const{checkboxProps:u}=xu(e,t);return{checkboxProps:{...u,"aria-labelledby":`${u.id} ${Re(t,l)}`}}}function Nu(e){let{isEmpty:t,isSelectAll:l,selectionMode:u}=e.selectionManager;return{checkboxProps:{"aria-label":_(Au(ne),"@react-aria/table").format(u==="single"?"select":"selectAll"),isSelected:l,isDisabled:u!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!l,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return gu()}var sl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,slots:a,state:m,selectionMode:c,color:d,checkboxesProps:r,disableAnimation:p,classNames:s,...b}=e,v=o||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:i},m,x),{isFocusVisible:y,focusProps:$}=X(),{checkboxProps:f}=Nu(m),E=K(s?.th,n,(l=i.props)==null?void 0:l.className),S=c==="single",{onChange:A,...k}=f;return h.jsx(v,{ref:x,"data-focus-visible":w(y),...I(D,$,O(i.props,{enabled:g}),O(b,{enabled:g})),className:(u=a.th)==null?void 0:u.call(a,{class:E}),children:S?h.jsx(be,{children:f["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:p,onValueChange:A,...I(r,k)})})});sl.displayName="HeroUI.TableSelectAllCheckbox";var il=sl;function zu(e){let{collection:t,focusMode:l}=e,u=e.UNSAFE_selectionState||Zl(e),o=B.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=u.setFocusedKey;u.setFocusedKey=(m,c)=>{if(l==="cell"&&m!=null){let b=t.getItem(m);if(b?.type==="item"){var d,r;let v=z(b,t);var p,s;c==="last"?m=(p=(d=W(v))===null||d===void 0?void 0:d.key)!==null&&p!==void 0?p:null:m=(s=(r=U(v))===null||r===void 0?void 0:r.key)!==null&&s!==void 0?s:null}}n(m,c)};let i=B.useMemo(()=>new _l(t,u),[t,u]);const a=B.useRef(null);return B.useEffect(()=>{if(u.focusedKey!=null&&a.current&&!t.getItem(u.focusedKey)){const m=a.current.getItem(u.focusedKey),c=m?.parentKey!=null&&(m.type==="cell"||m.type==="rowheader"||m.type==="column")?a.current.getItem(m.parentKey):m;if(!c){u.setFocusedKey(null);return}const d=a.current.rows,r=t.rows,p=d.length-r.length;let s=Math.min(p>1?Math.max(c.index-p+1,0):c.index,r.length-1),b=null;for(;s>=0;){if(!i.isDisabled(r[s].key)&&r[s].type!=="headerrow"){b=r[s];break}sc.index&&(s=c.index),s--)}if(b){const v=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&c!==m&&m&&m.index{let p=this.keyMap.get(r.key);t.visitNode&&(r=t.visitNode(r)),this.keyMap.set(r.key,r);let s=new Set,b=null,v=!1;if(r.type==="item"){var g;for(let f of r.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){v=!0;break}}for(let f of r.childNodes){if(f.type==="cell"&&v){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var y,$;f.colIndex=b?((y=b.colIndex)!==null&&y!==void 0?y:b.index)+(($=b.colSpan)!==null&&$!==void 0?$:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=r.key),s.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,l(f),b=f}if(b&&(b.nextKey=null),p)for(let f of p.childNodes)s.has(f.key)||u(f)},u=r=>{this.keyMap.delete(r.key);for(let p of r.childNodes)this.keyMap.get(p.key)===p&&u(p)},o=null;for(let[r,p]of t.items.entries()){var n,i,a,m,c,d;let s={...p,level:(n=p.level)!==null&&n!==void 0?n:0,key:(i=p.key)!==null&&i!==void 0?i:"row-"+r,type:(a=p.type)!==null&&a!==void 0?a:"row",value:(m=p.value)!==null&&m!==void 0?m:null,hasChildNodes:!0,childNodes:[...p.childNodes],rendered:p.rendered,textValue:(c=p.textValue)!==null&&c!==void 0?c:"",index:(d=p.index)!==null&&d!==void 0?d:r};o?(o.nextKey=s.key,s.prevKey=o.key):s.prevKey=null,this.rows.push(s),l(s),o=s}o&&(o.nextKey=null)}}const rl="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;rl===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Pu(e,t){if(t.length===0)return[];let l=[],u=new Map;for(let d of t){let r=d.parentKey,p=[d];for(;r;){let s=e.get(r);if(!s)break;if(u.has(s)){var o,n;(n=(o=s).colSpan)!==null&&n!==void 0||(o.colSpan=0),s.colSpan++,s.colspan=s.colSpan;let{column:b,index:v}=u.get(s);if(v>p.length)break;for(let g=v;gd.length)),a=Array(i).fill(0).map(()=>[]),m=0;for(let d of l){let r=i-1;for(let p of d){if(p){let s=a[r],b=s.reduce((v,g)=>{var x;return v+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(s[s.length-1].nextKey=v.key,v.prevKey=s[s.length-1].key),s.push(v)}s.length>0&&(s[s.length-1].nextKey=p.key,p.prevKey=s[s.length-1].key),p.level=r,p.colIndex=m,s.push(p)}r--}m++}let c=0;for(let d of a){let r=d.reduce((p,s)=>{var b;return p+((b=s.colSpan)!==null&&b!==void 0?b:1)},0);if(r({type:"headerrow",key:"headerrow-"+r,index:r,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:d,textValue:""}))}class Ku extends Fu{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var u;return(u=l?.prevKey)!==null&&u!==void 0?u:null}getKeyAfter(t){let l=this.keyMap.get(t);var u;return(u=l?.nextKey)!==null&&u!==void 0?u:null}getFirstKey(){var t,l;return(l=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getLastKey(){var t,l;return(l=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let l=this.getItem(t);if(!l)return"";if(l.textValue)return l.textValue;let u=this.rowHeaderColumnKeys;if(u){let o=[];for(let n of l.childNodes){let i=this.columns[n.index];if(u.has(i.key)&&n.textValue&&o.push(n.textValue),o.length===u.size)break}return o.join(" ")}return""}constructor(t,l,u){let o=new Set,n=null,i=[];if(u?.showSelectionCheckboxes){let r={type:"column",key:rl,value:null,textValue:"",level:0,index:u?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};i.unshift(r)}if(u?.showDragButtons){let r={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};i.unshift(r)}let a=[],m=new Map,c=r=>{switch(r.type){case"body":n=r;break;case"column":m.set(r.key,r),r.hasChildNodes||(i.push(r),r.props.isRowHeader&&o.add(r.key));break;case"item":a.push(r);return}for(let p of r.childNodes)c(p)};for(let r of t)c(r);let d=Pu(m,i);if(d.forEach((r,p)=>a.splice(p,0,r)),super({columnCount:i.length,items:a,visitNode:r=>(r.column=i[r.index],r)}),this._size=0,this.columns=i,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=d,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let r=this.columns.find(p=>{var s,b;return!(!((s=p.props)===null||s===void 0)&&s.isDragButtonCell)&&!(!((b=p.props)===null||b===void 0)&&b.isSelectionCell)});r&&this.rowHeaderColumnKeys.add(r.key)}}}const Iu={ascending:"descending",descending:"ascending"};function ju(e){let[t,l]=B.useState(!1),{selectionMode:u="none",showSelectionCheckboxes:o,showDragButtons:n}=e,i=B.useMemo(()=>({showSelectionCheckboxes:o&&u!=="none",showDragButtons:n,selectionMode:u,columns:[]}),[e.children,o,u,n]),a=ql(e,B.useCallback(r=>new Ku(r,null,i),[i]),i),{disabledKeys:m,selectionManager:c}=zu({...e,collection:a,disabledBehavior:e.disabledBehavior||"selection"});var d;return{collection:a,disabledKeys:m,selectionManager:c,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(d=e.sortDescriptor)!==null&&d!==void 0?d:null,isKeyboardNavigationDisabled:a.size===0||t,setKeyboardNavigationDisabled:l,sort(r,p){var s,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:r,direction:p??(((s=e.sortDescriptor)===null||s===void 0?void 0:s.column)===r?Iu[e.sortDescriptor.direction]:"ascending")})}}}function al(e){return null}al.getCollectionNode=function*(t,l){let{children:u,columns:o}=t;if(l.columns=[],typeof u=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:u}}else{let n=[];q.Children.forEach(u,i=>{n.push({type:"column",element:i})}),yield*n}};let Mu=al;function cl(e){return null}cl.getCollectionNode=function*(t){let{children:l,items:u}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof l=="function"){if(!u)throw new Error("props.children was a function but props.items is missing");for(let o of u)yield{type:"item",value:o,renderer:l}}else{let o=[];q.Children.forEach(l,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Tu=cl;function dl(e){return null}dl.getCollectionNode=function*(t,l){let{title:u,children:o,childColumns:n}=t,i=u||o,a=t.textValue||(typeof i=="string"?i:"")||t["aria-label"],m=yield{type:"column",hasChildNodes:!!n||!!u&&q.Children.count(o)>0,rendered:i,textValue:a,props:t,*childNodes(){if(n)for(let d of n)yield{type:"column",value:d};else if(u){let d=[];q.Children.forEach(o,r=>{d.push({type:"column",element:r})}),yield*d}},shouldInvalidate(d){return c(d),!1}},c=d=>{for(let r of m)r.hasChildNodes||d.columns.push(r)};c(l)};let Ru=dl;function me(e){return null}me.getCollectionNode=function*(t,l){let{children:u,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(l.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),l.showSelectionCheckboxes&&l.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof u=="function"){for(let i of l.columns)yield{type:"cell",element:u(i.key),key:i.key};if(n)for(let i of n)yield{type:"item",value:i}}else{let i=[],a=[],m=0;if(q.Children.forEach(u,c=>{if(c.type===me){if(i.lengtha.key!==l.columns[m].key)||i.showSelectionCheckboxes!==l.showSelectionCheckboxes||i.showDragButtons!==l.showDragButtons||i.selectionMode!==l.selectionMode}}};let Vu=me;function ml(e){return null}ml.getCollectionNode=function*(t){let{children:l}=t,u=t.textValue||(typeof l=="string"?l:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:l,textValue:u,"aria-label":t["aria-label"],hasChildNodes:!1}};let Ou=ml;function pl(e){var t;const l=Jl(),[u,o]=Pe(e,ke.variantKeys),{ref:n,as:i,baseRef:a,children:m,className:c,classNames:d,removeWrapper:r=!1,disableAnimation:p=(t=l?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:s=!1,selectionMode:b="none",topContentPlacement:v="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:y=b==="multiple"&&x!=="replace",BaseComponent:$="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:k,onCellAction:C,...N}=u,j=i||"table",F=typeof j=="string",R=M(n),Q=M(a),G=ju({...e,children:m,showSelectionCheckboxes:y});s&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:sn,...Fl}=e,{gridProps:$e}=Bu({...Fl},G,R),ee=b!=="none",ye=b==="multiple",H=B.useMemo(()=>ke({...o,isSelectable:ee,isMultiSelectable:ye}),[Ke(o),ee,ye]),xe=K(d?.base,c),Pl=B.useMemo(()=>{var P;return{state:G,slots:H,isSelectable:ee,collection:se,classNames:d,color:e?.color,disableAnimation:p,checkboxesProps:f,isHeaderSticky:(P=e?.isHeaderSticky)!=null?P:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:y,onRowAction:k,onCellAction:C}},[H,G,se,ee,d,b,x,f,D,p,y,e?.color,e?.isHeaderSticky,k,C]),Kl=B.useCallback(P=>({...P,ref:Q,className:H.base({class:K(xe,P?.className)})}),[xe,H]),Il=B.useCallback(P=>({...P,ref:Q,className:H.wrapper({class:K(d?.wrapper,P?.className)})}),[d?.wrapper,H]),jl=B.useCallback(P=>({...I($e,O(N,{enabled:F}),P),onKeyDownCapture:void 0,ref:R,className:H.table({class:K(d?.table,P?.className)})}),[d?.table,F,H,$e,N]);return{BaseComponent:$,Component:j,children:m,state:G,collection:se,values:Pl,topContent:E,bottomContent:S,removeWrapper:r,topContentPlacement:v,bottomContentPlacement:g,sortIcon:A,getBaseProps:Kl,getWrapperProps:Il,getTableProps:jl}}var bl=T((e,t)=>{var l,u,o;const{as:n,className:i,node:a,rowKey:m,slots:c,state:d,classNames:r,...p}=e,s=n||"td",b=typeof s=="string",v=M(t),{gridCellProps:g}=ol({node:a},d,v),x=K(r?.td,i,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=d.selectionManager.isSelected(m),f=B.useMemo(()=>{const S=typeof a.rendered;return S!=="object"&&S!=="function"?h.jsx("span",{children:a.rendered}):a.rendered},[a.rendered]),E=((u=a.column)==null?void 0:u.props)||{};return h.jsx(s,{ref:v,"data-focus-visible":w(D),"data-selected":w($),...I(g,y,O(a.props,{enabled:b}),p),className:(o=c.td)==null?void 0:o.call(c,{align:E.align,class:x}),children:f})});bl.displayName="HeroUI.TableCell";var fl=bl,hl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,rowKey:a,slots:m,state:c,color:d,disableAnimation:r,checkboxesProps:p,selectionMode:s,classNames:b,...v}=e,g=o||"td",x=typeof g=="string",D=M(t),{gridCellProps:y}=ol({node:i},c,D),{isFocusVisible:$,focusProps:f}=X(),{checkboxProps:E}=wu({key:i?.parentKey||i.key},c),S=K(b?.td,n,(l=i.props)==null?void 0:l.className),A=s==="single",{onChange:k,...C}=E,N=c.selectionManager.isSelected(a);return h.jsx(g,{ref:D,"data-focus-visible":w($),"data-selected":w(N),...I(y,f,O(i.props,{enabled:x}),v),className:(u=m.td)==null?void 0:u.call(m,{class:S}),children:A?h.jsx(be,{children:E["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:r,onValueChange:k,...I(p,C)})})});hl.displayName="HeroUI.TableCheckboxCell";var vl=hl,gl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,state:c,isSelectable:d,classNames:r,...p}=e,s=o||(e?.href?"a":"tr"),b=typeof s=="string",v=M(t),{rowProps:g}=Eu({node:a},c,v),x=K(r?.tr,n,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=c.disabledKeys.has(a.key),f=c.selectionManager.isSelected(a.key),{isHovered:E,hoverProps:S}=Ie({isDisabled:$}),{isFirst:A,isLast:k,isMiddle:C,isOdd:N}=B.useMemo(()=>{const j=a.key===c.collection.getFirstKey(),F=a.key===c.collection.getLastKey(),R=!j&&!F,Q=a?.index?(a.index+1)%2===0:!1;return{isFirst:j,isLast:F,isMiddle:R,isOdd:Q}},[a,c.collection]);return h.jsx(s,{ref:v,"data-disabled":w($),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(k),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...I(g,y,d?S:{},O(a.props,{enabled:b}),p),className:(u=m.tr)==null?void 0:u.call(m,{class:x}),children:i})});gl.displayName="HeroUI.TableRow";var $l=gl,yl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,rowVirtualizer:b,...v}=e,g=u||"tbody",x=typeof g=="string",D=M(t),{rowGroupProps:y}=ge(),$=K(s?.tbody,o),f=a?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...a.body.childNodes],A=b.getVirtualItems();let k,C;return a.size===0&&f.emptyContent&&(k=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:f.loadingContent}),!k&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(g,{ref:D,...I(y,O(f,{enabled:x}),v),className:(l=n.tbody)==null?void 0:l.call(n,{class:$}),"data-empty":w(a.size===0),"data-loading":w(E),children:[A.map((N,j)=>{const F=S[N.index];return F?h.jsx($l,{classNames:s,isSelectable:m,node:F,slots:n,state:i,style:{transform:`translateY(${N.start-j*N.size}px)`,height:`${N.size}px`},children:[...F.childNodes].map(R=>R.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:R,rowKey:F.key,selectionMode:p,slots:n,state:i},String(R.key)):h.jsx(fl,{classNames:s,node:R,rowKey:F.key,slots:n,state:i},String(R.key)))},String(F.key)):null}),C,k]})});yl.displayName="HeroUI.VirtualizedTableBody";var Hu=yl,xl=T((e,t)=>{var l,u,o,n,i;const{as:a,className:m,state:c,node:d,slots:r,classNames:p,sortIcon:s,...b}=e,v=a||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:d},c,x),y=K(p?.th,m,(l=d.props)==null?void 0:l.className),{isFocusVisible:$,focusProps:f}=X(),{isHovered:E,hoverProps:S}=Ie({}),{hideHeader:A,align:k,...C}=d.props,N=C.allowsSorting,j={"aria-hidden":!0,"data-direction":(u=c.sortDescriptor)==null?void 0:u.direction,"data-visible":w(((o=c.sortDescriptor)==null?void 0:o.column)===d.key),className:(n=r.sortIcon)==null?void 0:n.call(r,{class:p?.sortIcon})},F=typeof s=="function"?s(j):B.isValidElement(s)&&B.cloneElement(s,j);return h.jsxs(v,{ref:x,colSpan:d.colspan,"data-focus-visible":w($),"data-hover":w(E),"data-sortable":w(N),...I(D,f,O(C,{enabled:g}),N?S:{},b),className:(i=r.th)==null?void 0:i.call(r,{align:k,class:y}),children:[A?h.jsx(be,{children:d.rendered}):d.rendered,N&&(F||h.jsx(su,{strokeWidth:3,...j}))]})});xl.displayName="HeroUI.TableColumnHeader";var Cl=xl,Dl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,classNames:c,state:d,...r}=e,p=o||"tr",s=typeof p=="string",b=M(t),{rowProps:v}=Su({node:a},d),g=K(c?.tr,n,(l=a.props)==null?void 0:l.className);return h.jsx(p,{ref:b,...I(v,O(a.props,{enabled:s}),r),className:(u=m.tr)==null?void 0:u.call(m,{class:g}),children:i})});Dl.displayName="HeroUI.TableHeaderRow";var Bl=Dl,kl=B.forwardRef((e,t)=>{var l;const{as:u,className:o,children:n,slots:i,classNames:a,...m}=e,c=u||"thead",d=M(t),{rowGroupProps:r}=ge(),p=K(a?.thead,o);return h.jsx(c,{ref:d,className:(l=i.thead)==null?void 0:l.call(i,{class:p}),...I(r,m),children:n})});kl.displayName="HeroUI.TableRowGroup";var El=kl,Lu={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Ae=e=>{var t;return(t=Lu[e])!=null?t:e};function Uu(e){const[t,l]=Pe(e,Be.variantKeys),{as:u,className:o,x:n=1,y:i=1,...a}=t,m=u||"span",c=B.useMemo(()=>Be({...l,className:o}),[Ke(l),o]),d=Ae(n),r=Ae(i);return{Component:m,getSpacerProps:(s={})=>({...s,...a,"aria-hidden":w(!0),className:K(c,s.className),style:{...s.style,...a.style,marginLeft:d,marginTop:r}})}}var Sl=T((e,t)=>{const{Component:l,getSpacerProps:u}=Uu({...e});return h.jsx(l,{ref:t,...u()})});Sl.displayName="HeroUI.Spacer";var Al=Sl,wl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,getBaseProps:d,getWrapperProps:r,getTableProps:p}=pl({...e,ref:t}),{rowHeight:s=40,maxTableHeight:b=600}=e,v=B.useCallback(({children:A})=>h.jsx(l,{...r(),ref:D,style:{height:b,display:"block"},children:A}),[r,b]),x=[...o.body.childNodes].length,D=B.useRef(null),[y,$]=B.useState(0),f=B.useRef(null);B.useLayoutEffect(()=>{f.current&&$(f.current.getBoundingClientRect().height)},[f]);const E=iu({count:x,getScrollElement:()=>D.current,estimateSize:()=>s,overscan:5}),S=p();return h.jsxs("div",{...d(),children:[a==="outside"&&i,h.jsx(v,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...S,style:{height:`calc(${E.getTotalSize()+y}px)`,...S.style},children:[h.jsxs(El,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>h.jsx(Bl,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(k=>{var C;return(C=k?.props)!=null&&C.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:k,selectionMode:n.selectionMode,slots:n.slots,state:n.state},k?.key):h.jsx(Cl,{classNames:n.classNames,node:k,slots:n.slots,state:n.state},k?.key)})},A?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Hu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});wl.displayName="HeroUI.VirtualizedTable";var Wu=wl,Nl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,...b}=e,v=u||"tbody",g=typeof v=="string",x=M(t),{rowGroupProps:D}=ge(),y=K(s?.tbody,o),$=a?.body.props,f=$?.isLoading||$?.loadingState==="loading"||$?.loadingState==="loadingMore",E=B.useMemo(()=>[...a.body.childNodes].map(k=>h.jsx($l,{classNames:s,isSelectable:m,node:k,slots:n,state:i,children:[...k.childNodes].map(C=>C.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:C,rowKey:k.key,selectionMode:p,slots:n,state:i},C.key):h.jsx(fl,{classNames:s,node:C,rowKey:k.key,slots:n,state:i},C.key))},k.key)),[a.body.childNodes,s,m,n,i]);let S,A;return a.size===0&&$.emptyContent&&(S=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!f&&$.emptyContent})})),f&&$.loadingContent&&(A=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:$.loadingContent}),!S&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(v,{ref:x,...I(D,O($,{enabled:g}),b),className:(l=n.tbody)==null?void 0:l.call(n,{class:y}),"data-empty":w(a.size===0),"data-loading":w(f),children:[E,A,S]})});Nl.displayName="HeroUI.TableBody";var Gu=Nl,zl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,removeWrapper:d,sortIcon:r,getBaseProps:p,getWrapperProps:s,getTableProps:b}=pl({...e,ref:t}),{isVirtualized:v,rowHeight:g=40,maxTableHeight:x=600}=e,D=v,y=B.useCallback(({children:$})=>d?$:h.jsx(l,{...s(),children:$}),[d,s]);return D?h.jsx(Wu,{...e,ref:t,maxTableHeight:x,rowHeight:g}):h.jsxs("div",{...p(),children:[a==="outside"&&i,h.jsx(y,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...b(),children:[h.jsxs(El,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map($=>h.jsx(Bl,{classNames:n.classNames,node:$,slots:n.slots,state:n.state,children:[...$.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):h.jsx(Cl,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:r,state:n.state},f?.key)})},$?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Gu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});zl.displayName="HeroUI.Table";var Yu=zl,Zu=Ru,_u=Zu,qu=Mu,Ju=qu,Xu=Vu,Qu=Xu,en=Tu,tn=en,ln=Ou,un=ln;const nn={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},we=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function on(e){return e.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(t,l,u,o,n){return n<0?l+"0."+Array(1-n-u.length).join("0")+o+u:l+u+o+Array(n-o.length+1).join("0")})}function mn({usage:e}){const t=Object.keys(e),{isOpen:l,onOpen:u,onClose:o}=Xl(),n=()=>{o()},i=Object.keys(e[t[0]]),a=[...we.filter(s=>s==="model"||i.includes(s)),...i.filter(s=>!we.includes(s))],m=i.reduce((s,b)=>({...s,[b]:0}),{}),c=t.reduce((s,b)=>(a.reduce((v,g)=>(g==="model"||(v[g]+=e[b][g]),v),s),s),m),d=[...a.map(s=>({key:s,label:nn[s]??De.words(s).map(De.upperFirst).join(" ")}))],r=[...t.map(s=>({model:s,...e[s]})),{model:"Total",...c}],p=h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[c.prompt_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),h.jsx("span",{children:c.prompt_tokens})]}),c.completion_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Completion tokens"}),h.jsx("span",{children:c.completion_tokens})]}),c.total_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Total tokens"}),h.jsx("span",{children:c.total_tokens})]}),c.estimated_cost!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Estimated cost"}),h.jsxs("span",{children:[on(c.estimated_cost.toString()),"$"]})]})]}),h.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return h.jsxs(h.Fragment,{children:[h.jsx(Ql,{content:p,placement:"bottom",children:h.jsx(eu,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:u,children:h.jsx(tu,{icon:"heroicons:information-circle"})})}),h.jsx(lu,{isOpen:l,onOpenChange:n,size:"4xl",children:h.jsx(uu,{children:h.jsxs(h.Fragment,{children:[h.jsx(ru,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),h.jsx(nu,{children:h.jsxs(Yu,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[h.jsx(Ju,{columns:d,children:s=>h.jsx(_u,{children:s.label},s.key)}),h.jsx(tn,{items:r,children:s=>h.jsx(Qu,{className:s.model==="Total"?"border-default-200 border-t-1":"",children:b=>h.jsx(un,{children:ou(s,b)})},s.model)})]})})]})})})]})}export{mn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-NAp9VzWA.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-NAp9VzWA.js new file mode 100644 index 0000000000..c6f77886af --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-NAp9VzWA.js @@ -0,0 +1 @@ +import{r as k,bc as Ml,dj as ae,b_ as Ne,b$ as ie,cJ as z,dk as W,dl as U,dm as te,dn as Tl,cU as _,dp as Rl,dq as Vl,dr as ze,ds as ue,dt as Ol,bj as pe,cb as Hl,bh as J,du as Ll,bk as L,cf as Ul,dv as q,dw as Y,dx as le,be as Wl,dy as Gl,dz as Ce,dA as ql,i as T,l as M,cl as X,n as K,j as h,c8 as j,co as w,dB as be,dC as Fe,cp as O,dD as Yl,dE as _l,dF as Zl,cv as Z,cj as Jl,ck as Pe,cm as Ke,ce as je,u as Xl,cx as De,D as Ql,d as eu,I as tu,m as lu,e as uu,f as nu,dG as ou}from"./index-DpOBiJiD.js";import{b as fe,$ as Ie}from"./useSelectableItem-BZ_O-SpJ.js";import{C as su,u as iu}from"./index-DXdC0TND.js";import{m as ru}from"./chunk-IGSAU2ZA-BcGvhJAc.js";function Me(e,t){const l=k.useRef(!0),u=k.useRef(null);k.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]),k.useEffect(()=>{let o=u.current;l.current?l.current=!1:(!o||t.some((n,i)=>!Object.is(n,o[i])))&&e(),u.current=t},t)}function au(e,t){let l=t?.isDisabled,[u,o]=k.useState(!1);return Ml(()=>{if(e?.current&&!l){let n=()=>{if(e.current){let a=ae(e.current,{tabbable:!0});o(!!a.nextNode())}};n();let i=new MutationObserver(n);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),l?!1:u}var ke=Ne({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),Be=Ne({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const he=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function cu(e,t){let l=he.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}`}function Te(e,t,l){let u=he.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}-${ce(l)}`}function Re(e,t){return[...e.collection.rowHeaderColumnKeys].map(l=>Te(e,t,l)).join(" ")}var Ve={};Ve={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Oe={};Oe={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var He={};He={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var Le={};Le={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Ue={};Ue={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var We={};We={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ge={};Ge={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var qe={};qe={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ye={};Ye={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var _e={};_e={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var Ze={};Ze={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var Je={};Je={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Xe={};Xe={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Qe={};Qe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var et={};et={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var tt={};tt={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var lt={};lt={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var ut={};ut={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var nt={};nt={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var ot={};ot={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var st={};st={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var it={};it={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var rt={};rt={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var at={};at={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var ct={};ct={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var dt={};dt={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var mt={};mt={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var pt={};pt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var bt={};bt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var ft={};ft={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var ht={};ht={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var vt={};vt={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var gt={};gt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var $t={};$t={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Ve,"bg-BG":Oe,"cs-CZ":He,"da-DK":Le,"de-DE":Ue,"el-GR":We,"en-US":Ge,"es-ES":qe,"et-EE":Ye,"fi-FI":_e,"fr-FR":Ze,"he-IL":Je,"hr-HR":Xe,"hu-HU":Qe,"it-IT":et,"ja-JP":tt,"ko-KR":lt,"lt-LT":ut,"lv-LV":nt,"nb-NO":ot,"nl-NL":st,"pl-PL":it,"pt-BR":rt,"pt-PT":at,"ro-RO":ct,"ru-RU":dt,"sk-SK":mt,"sl-SI":pt,"sr-SP":bt,"sv-SE":ft,"tr-TR":ht,"uk-UA":vt,"zh-CN":gt,"zh-TW":$t};class yt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var l;return this.disabledBehavior==="all"&&(((l=t.props)===null||l===void 0?void 0:l.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,l){let u=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;u=this.collection.getKeyBefore(u)}return null}findNextKey(t,l){let u=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;if(u=this.collection.getKeyAfter(u),u==null)return null}return null}getKeyForItemInRowByIndex(t,l=0){if(l<0)return null;let u=this.collection.getItem(t);if(!u)return null;let o=0;for(let a of z(u,this.collection)){var n;if(a.colSpan&&a.colSpan+o>l)return(n=a.key)!==null&&n!==void 0?n:null;a.colSpan&&(o=o+a.colSpan-1);var i;if(o===l)return(i=a.key)!==null&&i!==void 0?i:null;o++}return null}getKeyBelow(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findNextKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyAbove(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findPreviousKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyRightOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=W(d))===null||u===void 0?void 0:u.key:(o=U(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index-1):te(r,l.index+1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&c!==void 0?c:null}return null}getKeyLeftOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=U(d))===null||u===void 0?void 0:u.key:(o=W(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index+1):te(r,l.index-1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&c!==void 0?c:null}return null}getFirstKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;var i;return(i=(n=U(z(c,this.collection)))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findNextKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;var m;u=(m=(a=U(z(c,this.collection)))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getLastKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;let d=z(c,this.collection);var i;return(i=(n=W(d))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findPreviousKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;let d=z(c,this.collection);var m;u=(m=(a=W(d))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getKeyPageAbove(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=Math.max(0,u.y+u.height-this.layoutDelegate.getVisibleRect().height);for(;u&&u.y>o&&l!=null;){var n;if(l=(n=this.getKeyAbove(l))!==null&&n!==void 0?n:null,l==null)break;u=this.layoutDelegate.getItemRect(l)}return l}getKeyPageBelow(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,u.y+o);for(;u&&u.y+u.heightr.type==="item"),u==null&&!a&&(u=this.getFirstKey(),a=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new du(t.layout):new Tl(t.ref)),this.focusMode=t.focusMode||"row"}}class du{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var l;return((l=this.layout.getLayoutInfo(t))===null||l===void 0?void 0:l.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const ve=new WeakMap;var xt={};xt={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var Ct={};Ct={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var Dt={};Dt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var kt={};kt={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var Bt={};Bt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Et={};Et={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var St={};St={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var At={};At={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var wt={};wt={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var Nt={};Nt={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var zt={};zt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Ft={};Ft={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var Pt={};Pt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Kt={};Kt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var jt={};jt={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var It={};It={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var Mt={};Mt={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Tt={};Tt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Rt={};Rt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Vt={};Vt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Ot={};Ot={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ht={};Ht={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Lt={};Lt={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ut={};Ut={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Wt={};Wt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Gt={};Gt={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var qt={};qt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Yt={};Yt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var _t={};_t={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var Zt={};Zt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Jt={};Jt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Xt={};Xt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Qt={};Qt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var el={};el={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":xt,"bg-BG":Ct,"cs-CZ":Dt,"da-DK":kt,"de-DE":Bt,"el-GR":Et,"en-US":St,"es-ES":At,"et-EE":wt,"fi-FI":Nt,"fr-FR":zt,"he-IL":Ft,"hr-HR":Pt,"hu-HU":Kt,"it-IT":jt,"ja-JP":It,"ko-KR":Mt,"lt-LT":Tt,"lv-LV":Rt,"nb-NO":Vt,"nl-NL":Ot,"pl-PL":Ht,"pt-BR":Lt,"pt-PT":Ut,"ro-RO":Wt,"ru-RU":Gt,"sk-SK":qt,"sl-SI":Yt,"sr-SP":_t,"sv-SE":Zt,"tr-TR":Jt,"uk-UA":Xt,"zh-CN":Qt,"zh-TW":el};const tl=7e3;let V=null;function ll(e,t="assertive",l=tl){V?V.announce(e,t,l):(V=new mu,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,l):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,l)},100))}class mu{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let l=document.createElement("div");return l.setAttribute("role","log"),l.setAttribute("aria-live",t),l.setAttribute("aria-relevant","additions"),l}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,l="assertive",u=tl){var o,n;if(!this.node)return;let i=document.createElement("div");typeof t=="object"?(i.setAttribute("role","img"),i.setAttribute("aria-labelledby",t["aria-labelledby"])):i.textContent=t,l==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(i):(n=this.politeLog)===null||n===void 0||n.appendChild(i),t!==""&&setTimeout(()=>{i.remove()},u)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function pu(e){return e&&e.__esModule?e.default:e}function bu(e,t){let{getRowText:l=a=>{var m,c,d,r;return(r=(m=(c=t.collection).getTextValue)===null||m===void 0?void 0:m.call(c,a))!==null&&r!==void 0?r:(d=t.collection.getItem(a))===null||d===void 0?void 0:d.textValue}}=e,u=_(pu(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=k.useRef(o),i=Rl(()=>{var a;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let m=Ee(o,n.current),c=Ee(n.current,o),d=t.selectionManager.selectionBehavior==="replace",r=[];if(t.selectionManager.selectedKeys.size===1&&d){let p=t.selectionManager.selectedKeys.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(m.size===1&&c.size===0){let p=m.keys().next().value;if(p!=null){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(c.size===1&&m.size===0){let p=c.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("deselectedItem",{item:s}))}}t.selectionManager.selectionMode==="multiple"&&(r.length===0||o==="all"||o.size>1||n.current==="all"||((a=n.current)===null||a===void 0?void 0:a.size)>1)&&r.push(o==="all"?u.format("selectedAll"):u.format("selectedCount",{count:o.size})),r.length>0&&ll(r.join(" ")),n.current=o});Me(()=>{if(t.selectionManager.isFocused)i();else{let a=requestAnimationFrame(i);return()=>cancelAnimationFrame(a)}},[o,t.selectionManager.isFocused])}function Ee(e,t){let l=new Set;if(e==="all"||t==="all")return l;for(let u of e.keys())t.has(u)||l.add(u);return l}function fu(e){return e&&e.__esModule?e.default:e}function hu(e){let t=_(fu(oe),"@react-aria/grid"),l=Vl(),u=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window,o=k.useMemo(()=>{let i=e.selectionManager.selectionMode,a=e.selectionManager.selectionBehavior,m;return u&&(m=t.format("longPressToSelect")),a==="replace"&&i!=="none"&&e.hasItemActions?m:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,u]);return fe(o)}function vu(e,t,l){let{isVirtualized:u,disallowTypeAhead:o,keyboardDelegate:n,focusMode:i,scrollRef:a,getRowText:m,onRowAction:c,onCellAction:d,escapeKeyBehavior:r="clearSelection",shouldSelectOnPressUp:p}=e,{selectionManager:s}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=ze({usage:"search",sensitivity:"base"}),{direction:v}=ue(),g=t.selectionManager.disabledBehavior,x=k.useMemo(()=>n||new yt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:l,direction:v,collator:b,focusMode:i}),[n,t.collection,t.disabledKeys,g,l,v,b,i]),{collectionProps:D}=Ol({ref:l,selectionManager:s,keyboardDelegate:x,isVirtualized:u,scrollRef:a,disallowTypeAhead:o,escapeKeyBehavior:r}),y=pe(e.id);ve.set(t,{keyboardDelegate:x,actions:{onRowAction:c,onCellAction:d},shouldSelectOnPressUp:p});let $=hu({selectionManager:s,hasItemActions:!!(c||d)}),f=Hl(e,{labelable:!0}),E=k.useCallback(C=>{if(s.isFocused){C.currentTarget.contains(C.target)||s.setFocused(!1);return}C.currentTarget.contains(C.target)&&s.setFocused(!0)},[s]),S=k.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=au(l,{isDisabled:t.collection.size!==0}),B=J(f,{role:"grid",id:y,"aria-multiselectable":s.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,$);return u&&(B["aria-rowcount"]=t.collection.size,B["aria-colcount"]=t.collection.columnCount),bu({getRowText:m},t),{gridProps:B}}function gu(){return{rowGroupProps:{role:"rowgroup"}}}function $u(e,t,l){var u,o;let{node:n,isVirtualized:i,shouldSelectOnPressUp:a,onAction:m}=e,{actions:c,shouldSelectOnPressUp:d}=ve.get(t),r=c.onRowAction?()=>{var g;return(g=c.onRowAction)===null||g===void 0?void 0:g.call(c,n.key)}:m,{itemProps:p,...s}=Ie({selectionManager:t.selectionManager,key:n.key,ref:l,isVirtualized:i,shouldSelectOnPressUp:d||a,onAction:r||!(n==null||(u=n.props)===null||u===void 0)&&u.onAction?Ll(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,r):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),v={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":s.isDisabled||void 0,...p};return i&&(v["aria-rowindex"]=n.index+1),{rowProps:v,...s}}function ul(e,t,l){let{node:u,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:i,onAction:a}=e,{direction:m}=ue(),{keyboardDelegate:c,actions:{onCellAction:d}}=ve.get(t),r=k.useRef(null),p=()=>{if(l.current){let y=ae(l.current);if(n==="child"){if(l.current.contains(document.activeElement)&&l.current!==document.activeElement)return;let $=t.selectionManager.childFocusStrategy==="last"?re(y):y.firstChild();if($){L($);return}}(r.current!=null&&u.key!==r.current||!l.current.contains(document.activeElement))&&L(l.current)}},{itemProps:s,isPressed:b}=Ie({selectionManager:t.selectionManager,key:u.key,ref:l,isVirtualized:o,focus:p,shouldSelectOnPressUp:i,onAction:d?()=>d(u.key):a,isDisabled:t.collection.size===0}),v=y=>{if(!y.currentTarget.contains(y.target)||t.isKeyboardNavigationDisabled||!l.current||!document.activeElement)return;let $=ae(l.current);switch($.currentNode=document.activeElement,y.key){case"ArrowLeft":{let C=m==="rtl"?$.nextNode():$.previousNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),q(C,{containingElement:Y(l.current)});else{var f;if(((f=c.getKeyLeftOf)===null||f===void 0?void 0:f.call(c,u.key))!==u.key){var E;(E=l.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="rtl"?(L(l.current),q(l.current,{containingElement:Y(l.current)})):($.currentNode=l.current,C=m==="rtl"?$.firstChild():re($),C&&(L(C),q(C,{containingElement:Y(l.current)})))}break}case"ArrowRight":{let C=m==="rtl"?$.previousNode():$.nextNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),q(C,{containingElement:Y(l.current)});else{var S;if(((S=c.getKeyRightOf)===null||S===void 0?void 0:S.call(c,u.key))!==u.key){var A;(A=l.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="ltr"?(L(l.current),q(l.current,{containingElement:Y(l.current)})):($.currentNode=l.current,C=m==="rtl"?re($):$.firstChild(),C&&(L(C),q(C,{containingElement:Y(l.current)})))}break}case"ArrowUp":case"ArrowDown":if(!y.altKey&&l.current.contains(y.target)){var B;y.stopPropagation(),y.preventDefault(),(B=l.current.parentElement)===null||B===void 0||B.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent))}break}},g=y=>{if(r.current=u.key,y.target!==l.current){Ul()||t.selectionManager.setFocusedKey(u.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===l.current&&p()})},x=J(s,{role:"gridcell",onKeyDownCapture:v,"aria-colspan":u.colSpan,"aria-colindex":u.colIndex!=null?u.colIndex+1:void 0,colSpan:o?void 0:u.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=u.colIndex)!==null&&D!==void 0?D:u.index)+1),i&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=y=>{let $=y.currentTarget,f=$.getAttribute("tabindex");$.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&$.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,l=null;do l=e.lastChild(),l&&(t=l);while(l);return t}function yu(e){return e&&e.__esModule?e.default:e}function xu(e,t){let{key:l}=e,u=t.selectionManager,o=pe(),n=!t.selectionManager.canSelectItem(l),i=t.selectionManager.isSelected(l),a=()=>u.toggleSelection(l);const m=_(yu(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":m.format("select"),isSelected:i,isDisabled:n,onChange:a}}}class Cu extends yt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let u=U(z(l,this.collection));if(u)return u.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(t)}getKeyAbove(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let n=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return n&&n.type==="column"?n.key:null}let u=super.getKeyAbove(t),o=u!=null?this.collection.getItem(u):null;return o&&o.type!=="headerrow"?u:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(t){let l=this.findNextKey(t.key,o=>o.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level];for(let o of z(u,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let l=this.findPreviousKey(t.key,n=>n.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level],o=[...z(u,this.collection)];for(let n=o.length-1;n>=0;n--){let i=o[n];if(i.type==="column")return i.key}return null}getKeyRightOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(l):this.findNextColumnKey(l):super.getKeyRightOf(t):null}getKeyLeftOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findNextColumnKey(l):this.findPreviousColumnKey(l):super.getKeyLeftOf(t):null}getKeyForSearch(t,l){if(!this.collator)return null;let u=this.collection,o=l??this.getFirstKey();if(o==null)return null;let n=u.getItem(o);var i;n?.type==="cell"&&(o=(i=n.parentKey)!==null&&i!==void 0?i:null);let a=!1;for(;o!=null;){let m=u.getItem(o);if(!m)return null;if(m.textValue){let c=m.textValue.slice(0,t.length);if(this.collator.compare(c,t)===0)return m.key}for(let c of z(m,this.collection)){let d=u.columns[c.index];if(u.rowHeaderColumnKeys.has(d.key)&&c.textValue){let r=c.textValue.slice(0,t.length);if(this.collator.compare(r,t)===0){let p=l!=null?u.getItem(l):n;return p?.type==="cell"?c.key:m.key}}}o=this.getKeyBelow(o),o==null&&!a&&(o=this.getFirstKey(),a=!0)}return null}}function Du(e){return e&&e.__esModule?e.default:e}function ku(e,t,l){let{keyboardDelegate:u,isVirtualized:o,layoutDelegate:n,layout:i}=e,a=ze({usage:"search",sensitivity:"base"}),{direction:m}=ue(),c=t.selectionManager.disabledBehavior,d=k.useMemo(()=>u||new Cu({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:c,ref:l,direction:m,collator:a,layoutDelegate:n,layout:i}),[u,t.collection,t.disabledKeys,c,l,m,a,n,i]),r=pe(e.id);he.set(t,r);let{gridProps:p}=vu({...e,id:r,keyboardDelegate:d},t,l);o&&(p["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),le()&&"expandedKeys"in t&&(p.role="treegrid");let{column:s,direction:b}=t.sortDescriptor||{},v=_(Du(ne),"@react-aria/table"),g=k.useMemo(()=>{var D,y;let $=(y=(D=t.collection.columns.find(f=>f.key===s))===null||D===void 0?void 0:D.textValue)!==null&&y!==void 0?y:"";return b&&s?v.format(`${b}Sort`,{columnName:$}):void 0},[b,s,t.collection.columns]),x=fe(g);return Me(()=>{g&&ll(g,"assertive",500)},[g]),{gridProps:J(p,x,{"aria-describedby":[x["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")})}}function Bu(e){return e&&e.__esModule?e.default:e}function nl(e,t,l){var u,o;let{node:n}=e,i=n.props.allowsSorting,{gridCellProps:a}=ul({...e,focusMode:"child"},t,l),m=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:c}=Wl({isDisabled:!i||m,onPress(){t.sort(n.key)},ref:l}),{focusableProps:d}=Gl({},l),r,p=((u=t.sortDescriptor)===null||u===void 0?void 0:u.column)===n.key,s=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(r=p?s:"none");let b=_(Bu(ne),"@react-aria/table"),v;i&&(v=`${b.format("sortable")}`,p&&s&&Ce()&&(v=`${v}, ${b.format(s)}`));let g=fe(v),x=t.collection.size===0;return k.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...J(d,a,c,g,x?{tabIndex:-1}:null),role:"columnheader",id:cu(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":r}}}const Se={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Eu(e,t,l){let{node:u,isVirtualized:o}=e,{rowProps:n,...i}=$u(e,t,l),{direction:a}=ue();o&&!(le()&&"expandedKeys"in t)?n["aria-rowindex"]=u.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let m={};if(le()&&"expandedKeys"in t){let f=t.keyMap.get(u.key);if(f!=null){var c,d,r,p,s,b;let E=((c=f.props)===null||c===void 0?void 0:c.UNSTABLE_childItems)||((r=f.props)===null||r===void 0||(d=r.children)===null||d===void 0?void 0:d.length)>t.userColumnCount;var v,g,x,D;m={onKeyDown:S=>{(S.key===Se.expand[a]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Se.collapse[a]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(u.key):void 0,"aria-level":f.level,"aria-posinset":((v=f.indexOfType)!==null&&v!==void 0?v:0)+1,"aria-setsize":f.level>1?((x=(p=W((g=(s=t.keyMap.get(f.parentKey))===null||s===void 0?void 0:s.childNodes)!==null&&g!==void 0?g:[]))===null||p===void 0?void 0:p.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let y=ql(u.props),$=i.hasAction?y:{};return{rowProps:{...J(n,m,$),"aria-labelledby":Re(t,u.key)},...i}}function Su(e,t,l){let{node:u,isVirtualized:o}=e,n={role:"row"};return o&&!(le()&&"expandedKeys"in t)&&(n["aria-rowindex"]=u.index+1),{rowProps:n}}function ol(e,t,l){var u;let{gridCellProps:o,isPressed:n}=ul(e,t,l),i=(u=e.node.column)===null||u===void 0?void 0:u.key;return i!=null&&t.collection.rowHeaderColumnKeys.has(i)&&(o.role="rowheader",o.id=Te(t,e.node.parentKey,i)),{gridCellProps:o,isPressed:n}}function Au(e){return e&&e.__esModule?e.default:e}function wu(e,t){let{key:l}=e;const{checkboxProps:u}=xu(e,t);return{checkboxProps:{...u,"aria-labelledby":`${u.id} ${Re(t,l)}`}}}function Nu(e){let{isEmpty:t,isSelectAll:l,selectionMode:u}=e.selectionManager;return{checkboxProps:{"aria-label":_(Au(ne),"@react-aria/table").format(u==="single"?"select":"selectAll"),isSelected:l,isDisabled:u!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!l,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return gu()}var sl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,slots:a,state:m,selectionMode:c,color:d,checkboxesProps:r,disableAnimation:p,classNames:s,...b}=e,v=o||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:i},m,x),{isFocusVisible:y,focusProps:$}=X(),{checkboxProps:f}=Nu(m),E=K(s?.th,n,(l=i.props)==null?void 0:l.className),S=c==="single",{onChange:A,...B}=f;return h.jsx(v,{ref:x,"data-focus-visible":w(y),...j(D,$,O(i.props,{enabled:g}),O(b,{enabled:g})),className:(u=a.th)==null?void 0:u.call(a,{class:E}),children:S?h.jsx(be,{children:f["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:p,onValueChange:A,...j(r,B)})})});sl.displayName="HeroUI.TableSelectAllCheckbox";var il=sl;function zu(e){let{collection:t,focusMode:l}=e,u=e.UNSAFE_selectionState||Yl(e),o=k.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=u.setFocusedKey;u.setFocusedKey=(m,c)=>{if(l==="cell"&&m!=null){let b=t.getItem(m);if(b?.type==="item"){var d,r;let v=z(b,t);var p,s;c==="last"?m=(p=(d=W(v))===null||d===void 0?void 0:d.key)!==null&&p!==void 0?p:null:m=(s=(r=U(v))===null||r===void 0?void 0:r.key)!==null&&s!==void 0?s:null}}n(m,c)};let i=k.useMemo(()=>new _l(t,u),[t,u]);const a=k.useRef(null);return k.useEffect(()=>{if(u.focusedKey!=null&&a.current&&!t.getItem(u.focusedKey)){const m=a.current.getItem(u.focusedKey),c=m?.parentKey!=null&&(m.type==="cell"||m.type==="rowheader"||m.type==="column")?a.current.getItem(m.parentKey):m;if(!c){u.setFocusedKey(null);return}const d=a.current.rows,r=t.rows,p=d.length-r.length;let s=Math.min(p>1?Math.max(c.index-p+1,0):c.index,r.length-1),b=null;for(;s>=0;){if(!i.isDisabled(r[s].key)&&r[s].type!=="headerrow"){b=r[s];break}sc.index&&(s=c.index),s--)}if(b){const v=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&c!==m&&m&&m.index{let p=this.keyMap.get(r.key);t.visitNode&&(r=t.visitNode(r)),this.keyMap.set(r.key,r);let s=new Set,b=null,v=!1;if(r.type==="item"){var g;for(let f of r.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){v=!0;break}}for(let f of r.childNodes){if(f.type==="cell"&&v){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var y,$;f.colIndex=b?((y=b.colIndex)!==null&&y!==void 0?y:b.index)+(($=b.colSpan)!==null&&$!==void 0?$:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=r.key),s.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,l(f),b=f}if(b&&(b.nextKey=null),p)for(let f of p.childNodes)s.has(f.key)||u(f)},u=r=>{this.keyMap.delete(r.key);for(let p of r.childNodes)this.keyMap.get(p.key)===p&&u(p)},o=null;for(let[r,p]of t.items.entries()){var n,i,a,m,c,d;let s={...p,level:(n=p.level)!==null&&n!==void 0?n:0,key:(i=p.key)!==null&&i!==void 0?i:"row-"+r,type:(a=p.type)!==null&&a!==void 0?a:"row",value:(m=p.value)!==null&&m!==void 0?m:null,hasChildNodes:!0,childNodes:[...p.childNodes],rendered:p.rendered,textValue:(c=p.textValue)!==null&&c!==void 0?c:"",index:(d=p.index)!==null&&d!==void 0?d:r};o?(o.nextKey=s.key,s.prevKey=o.key):s.prevKey=null,this.rows.push(s),l(s),o=s}o&&(o.nextKey=null)}}const rl="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;rl===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Pu(e,t){if(t.length===0)return[];let l=[],u=new Map;for(let d of t){let r=d.parentKey,p=[d];for(;r;){let s=e.get(r);if(!s)break;if(u.has(s)){var o,n;(n=(o=s).colSpan)!==null&&n!==void 0||(o.colSpan=0),s.colSpan++,s.colspan=s.colSpan;let{column:b,index:v}=u.get(s);if(v>p.length)break;for(let g=v;gd.length)),a=Array(i).fill(0).map(()=>[]),m=0;for(let d of l){let r=i-1;for(let p of d){if(p){let s=a[r],b=s.reduce((v,g)=>{var x;return v+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(s[s.length-1].nextKey=v.key,v.prevKey=s[s.length-1].key),s.push(v)}s.length>0&&(s[s.length-1].nextKey=p.key,p.prevKey=s[s.length-1].key),p.level=r,p.colIndex=m,s.push(p)}r--}m++}let c=0;for(let d of a){let r=d.reduce((p,s)=>{var b;return p+((b=s.colSpan)!==null&&b!==void 0?b:1)},0);if(r({type:"headerrow",key:"headerrow-"+r,index:r,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:d,textValue:""}))}class Ku extends Fu{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var u;return(u=l?.prevKey)!==null&&u!==void 0?u:null}getKeyAfter(t){let l=this.keyMap.get(t);var u;return(u=l?.nextKey)!==null&&u!==void 0?u:null}getFirstKey(){var t,l;return(l=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getLastKey(){var t,l;return(l=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let l=this.getItem(t);if(!l)return"";if(l.textValue)return l.textValue;let u=this.rowHeaderColumnKeys;if(u){let o=[];for(let n of l.childNodes){let i=this.columns[n.index];if(u.has(i.key)&&n.textValue&&o.push(n.textValue),o.length===u.size)break}return o.join(" ")}return""}constructor(t,l,u){let o=new Set,n=null,i=[];if(u?.showSelectionCheckboxes){let r={type:"column",key:rl,value:null,textValue:"",level:0,index:u?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};i.unshift(r)}if(u?.showDragButtons){let r={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};i.unshift(r)}let a=[],m=new Map,c=r=>{switch(r.type){case"body":n=r;break;case"column":m.set(r.key,r),r.hasChildNodes||(i.push(r),r.props.isRowHeader&&o.add(r.key));break;case"item":a.push(r);return}for(let p of r.childNodes)c(p)};for(let r of t)c(r);let d=Pu(m,i);if(d.forEach((r,p)=>a.splice(p,0,r)),super({columnCount:i.length,items:a,visitNode:r=>(r.column=i[r.index],r)}),this._size=0,this.columns=i,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=d,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let r=this.columns.find(p=>{var s,b;return!(!((s=p.props)===null||s===void 0)&&s.isDragButtonCell)&&!(!((b=p.props)===null||b===void 0)&&b.isSelectionCell)});r&&this.rowHeaderColumnKeys.add(r.key)}}}const ju={ascending:"descending",descending:"ascending"};function Iu(e){let[t,l]=k.useState(!1),{selectionMode:u="none",showSelectionCheckboxes:o,showDragButtons:n}=e,i=k.useMemo(()=>({showSelectionCheckboxes:o&&u!=="none",showDragButtons:n,selectionMode:u,columns:[]}),[e.children,o,u,n]),a=Zl(e,k.useCallback(r=>new Ku(r,null,i),[i]),i),{disabledKeys:m,selectionManager:c}=zu({...e,collection:a,disabledBehavior:e.disabledBehavior||"selection"});var d;return{collection:a,disabledKeys:m,selectionManager:c,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(d=e.sortDescriptor)!==null&&d!==void 0?d:null,isKeyboardNavigationDisabled:a.size===0||t,setKeyboardNavigationDisabled:l,sort(r,p){var s,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:r,direction:p??(((s=e.sortDescriptor)===null||s===void 0?void 0:s.column)===r?ju[e.sortDescriptor.direction]:"ascending")})}}}function al(e){return null}al.getCollectionNode=function*(t,l){let{children:u,columns:o}=t;if(l.columns=[],typeof u=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:u}}else{let n=[];Z.Children.forEach(u,i=>{n.push({type:"column",element:i})}),yield*n}};let Mu=al;function cl(e){return null}cl.getCollectionNode=function*(t){let{children:l,items:u}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof l=="function"){if(!u)throw new Error("props.children was a function but props.items is missing");for(let o of u)yield{type:"item",value:o,renderer:l}}else{let o=[];Z.Children.forEach(l,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Tu=cl;function dl(e){return null}dl.getCollectionNode=function*(t,l){let{title:u,children:o,childColumns:n}=t,i=u||o,a=t.textValue||(typeof i=="string"?i:"")||t["aria-label"],m=yield{type:"column",hasChildNodes:!!n||!!u&&Z.Children.count(o)>0,rendered:i,textValue:a,props:t,*childNodes(){if(n)for(let d of n)yield{type:"column",value:d};else if(u){let d=[];Z.Children.forEach(o,r=>{d.push({type:"column",element:r})}),yield*d}},shouldInvalidate(d){return c(d),!1}},c=d=>{for(let r of m)r.hasChildNodes||d.columns.push(r)};c(l)};let Ru=dl;function me(e){return null}me.getCollectionNode=function*(t,l){let{children:u,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(l.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),l.showSelectionCheckboxes&&l.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof u=="function"){for(let i of l.columns)yield{type:"cell",element:u(i.key),key:i.key};if(n)for(let i of n)yield{type:"item",value:i}}else{let i=[],a=[],m=0;if(Z.Children.forEach(u,c=>{if(c.type===me){if(i.lengtha.key!==l.columns[m].key)||i.showSelectionCheckboxes!==l.showSelectionCheckboxes||i.showDragButtons!==l.showDragButtons||i.selectionMode!==l.selectionMode}}};let Vu=me;function ml(e){return null}ml.getCollectionNode=function*(t){let{children:l}=t,u=t.textValue||(typeof l=="string"?l:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:l,textValue:u,"aria-label":t["aria-label"],hasChildNodes:!1}};let Ou=ml;function pl(e){var t;const l=Jl(),[u,o]=Pe(e,Be.variantKeys),{ref:n,as:i,baseRef:a,children:m,className:c,classNames:d,removeWrapper:r=!1,disableAnimation:p=(t=l?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:s=!1,selectionMode:b="none",topContentPlacement:v="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:y=b==="multiple"&&x!=="replace",BaseComponent:$="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:B,onCellAction:C,...N}=u,I=i||"table",F=typeof I=="string",R=M(n),Q=M(a),G=Iu({...e,children:m,showSelectionCheckboxes:y});s&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:sn,...Fl}=e,{gridProps:$e}=ku({...Fl},G,R),ee=b!=="none",ye=b==="multiple",H=k.useMemo(()=>Be({...o,isSelectable:ee,isMultiSelectable:ye}),[Ke(o),ee,ye]),xe=K(d?.base,c),Pl=k.useMemo(()=>{var P;return{state:G,slots:H,isSelectable:ee,collection:se,classNames:d,color:e?.color,disableAnimation:p,checkboxesProps:f,isHeaderSticky:(P=e?.isHeaderSticky)!=null?P:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:y,onRowAction:B,onCellAction:C}},[H,G,se,ee,d,b,x,f,D,p,y,e?.color,e?.isHeaderSticky,B,C]),Kl=k.useCallback(P=>({...P,ref:Q,className:H.base({class:K(xe,P?.className)})}),[xe,H]),jl=k.useCallback(P=>({...P,ref:Q,className:H.wrapper({class:K(d?.wrapper,P?.className)})}),[d?.wrapper,H]),Il=k.useCallback(P=>({...j($e,O(N,{enabled:F}),P),onKeyDownCapture:void 0,ref:R,className:H.table({class:K(d?.table,P?.className)})}),[d?.table,F,H,$e,N]);return{BaseComponent:$,Component:I,children:m,state:G,collection:se,values:Pl,topContent:E,bottomContent:S,removeWrapper:r,topContentPlacement:v,bottomContentPlacement:g,sortIcon:A,getBaseProps:Kl,getWrapperProps:jl,getTableProps:Il}}var bl=T((e,t)=>{var l,u,o;const{as:n,className:i,node:a,rowKey:m,slots:c,state:d,classNames:r,...p}=e,s=n||"td",b=typeof s=="string",v=M(t),{gridCellProps:g}=ol({node:a},d,v),x=K(r?.td,i,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=d.selectionManager.isSelected(m),f=k.useMemo(()=>{const S=typeof a.rendered;return S!=="object"&&S!=="function"?h.jsx("span",{children:a.rendered}):a.rendered},[a.rendered]),E=((u=a.column)==null?void 0:u.props)||{};return h.jsx(s,{ref:v,"data-focus-visible":w(D),"data-selected":w($),...j(g,y,O(a.props,{enabled:b}),p),className:(o=c.td)==null?void 0:o.call(c,{align:E.align,class:x}),children:f})});bl.displayName="HeroUI.TableCell";var fl=bl,hl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,rowKey:a,slots:m,state:c,color:d,disableAnimation:r,checkboxesProps:p,selectionMode:s,classNames:b,...v}=e,g=o||"td",x=typeof g=="string",D=M(t),{gridCellProps:y}=ol({node:i},c,D),{isFocusVisible:$,focusProps:f}=X(),{checkboxProps:E}=wu({key:i?.parentKey||i.key},c),S=K(b?.td,n,(l=i.props)==null?void 0:l.className),A=s==="single",{onChange:B,...C}=E,N=c.selectionManager.isSelected(a);return h.jsx(g,{ref:D,"data-focus-visible":w($),"data-selected":w(N),...j(y,f,O(i.props,{enabled:x}),v),className:(u=m.td)==null?void 0:u.call(m,{class:S}),children:A?h.jsx(be,{children:E["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:r,onValueChange:B,...j(p,C)})})});hl.displayName="HeroUI.TableCheckboxCell";var vl=hl,gl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,state:c,isSelectable:d,classNames:r,...p}=e,s=o||(e?.href?"a":"tr"),b=typeof s=="string",v=M(t),{rowProps:g}=Eu({node:a},c,v),x=K(r?.tr,n,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=c.disabledKeys.has(a.key),f=c.selectionManager.isSelected(a.key),{isHovered:E,hoverProps:S}=je({isDisabled:$}),{isFirst:A,isLast:B,isMiddle:C,isOdd:N}=k.useMemo(()=>{const I=a.key===c.collection.getFirstKey(),F=a.key===c.collection.getLastKey(),R=!I&&!F,Q=a?.index?(a.index+1)%2===0:!1;return{isFirst:I,isLast:F,isMiddle:R,isOdd:Q}},[a,c.collection]);return h.jsx(s,{ref:v,"data-disabled":w($),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(B),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...j(g,y,d?S:{},O(a.props,{enabled:b}),p),className:(u=m.tr)==null?void 0:u.call(m,{class:x}),children:i})});gl.displayName="HeroUI.TableRow";var $l=gl,yl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,rowVirtualizer:b,...v}=e,g=u||"tbody",x=typeof g=="string",D=M(t),{rowGroupProps:y}=ge(),$=K(s?.tbody,o),f=a?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...a.body.childNodes],A=b.getVirtualItems();let B,C;return a.size===0&&f.emptyContent&&(B=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:f.loadingContent}),!B&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(g,{ref:D,...j(y,O(f,{enabled:x}),v),className:(l=n.tbody)==null?void 0:l.call(n,{class:$}),"data-empty":w(a.size===0),"data-loading":w(E),children:[A.map((N,I)=>{const F=S[N.index];return F?h.jsx($l,{classNames:s,isSelectable:m,node:F,slots:n,state:i,style:{transform:`translateY(${N.start-I*N.size}px)`,height:`${N.size}px`},children:[...F.childNodes].map(R=>R.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:R,rowKey:F.key,selectionMode:p,slots:n,state:i},String(R.key)):h.jsx(fl,{classNames:s,node:R,rowKey:F.key,slots:n,state:i},String(R.key)))},String(F.key)):null}),C,B]})});yl.displayName="HeroUI.VirtualizedTableBody";var Hu=yl,xl=T((e,t)=>{var l,u,o,n,i;const{as:a,className:m,state:c,node:d,slots:r,classNames:p,sortIcon:s,...b}=e,v=a||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:d},c,x),y=K(p?.th,m,(l=d.props)==null?void 0:l.className),{isFocusVisible:$,focusProps:f}=X(),{isHovered:E,hoverProps:S}=je({}),{hideHeader:A,align:B,...C}=d.props,N=C.allowsSorting,I={"aria-hidden":!0,"data-direction":(u=c.sortDescriptor)==null?void 0:u.direction,"data-visible":w(((o=c.sortDescriptor)==null?void 0:o.column)===d.key),className:(n=r.sortIcon)==null?void 0:n.call(r,{class:p?.sortIcon})},F=typeof s=="function"?s(I):k.isValidElement(s)&&k.cloneElement(s,I);return h.jsxs(v,{ref:x,colSpan:d.colspan,"data-focus-visible":w($),"data-hover":w(E),"data-sortable":w(N),...j(D,f,O(C,{enabled:g}),N?S:{},b),className:(i=r.th)==null?void 0:i.call(r,{align:B,class:y}),children:[A?h.jsx(be,{children:d.rendered}):d.rendered,N&&(F||h.jsx(su,{strokeWidth:3,...I}))]})});xl.displayName="HeroUI.TableColumnHeader";var Cl=xl,Dl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,classNames:c,state:d,...r}=e,p=o||"tr",s=typeof p=="string",b=M(t),{rowProps:v}=Su({node:a},d),g=K(c?.tr,n,(l=a.props)==null?void 0:l.className);return h.jsx(p,{ref:b,...j(v,O(a.props,{enabled:s}),r),className:(u=m.tr)==null?void 0:u.call(m,{class:g}),children:i})});Dl.displayName="HeroUI.TableHeaderRow";var kl=Dl,Bl=k.forwardRef((e,t)=>{var l;const{as:u,className:o,children:n,slots:i,classNames:a,...m}=e,c=u||"thead",d=M(t),{rowGroupProps:r}=ge(),p=K(a?.thead,o);return h.jsx(c,{ref:d,className:(l=i.thead)==null?void 0:l.call(i,{class:p}),...j(r,m),children:n})});Bl.displayName="HeroUI.TableRowGroup";var El=Bl,Lu={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Ae=e=>{var t;return(t=Lu[e])!=null?t:e};function Uu(e){const[t,l]=Pe(e,ke.variantKeys),{as:u,className:o,x:n=1,y:i=1,...a}=t,m=u||"span",c=k.useMemo(()=>ke({...l,className:o}),[Ke(l),o]),d=Ae(n),r=Ae(i);return{Component:m,getSpacerProps:(s={})=>({...s,...a,"aria-hidden":w(!0),className:K(c,s.className),style:{...s.style,...a.style,marginLeft:d,marginTop:r}})}}var Sl=T((e,t)=>{const{Component:l,getSpacerProps:u}=Uu({...e});return h.jsx(l,{ref:t,...u()})});Sl.displayName="HeroUI.Spacer";var Al=Sl,wl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,getBaseProps:d,getWrapperProps:r,getTableProps:p}=pl({...e,ref:t}),{rowHeight:s=40,maxTableHeight:b=600}=e,v=k.useCallback(({children:A})=>h.jsx(l,{...r(),ref:D,style:{height:b,display:"block"},children:A}),[r,b]),x=[...o.body.childNodes].length,D=k.useRef(null),[y,$]=k.useState(0),f=k.useRef(null);k.useLayoutEffect(()=>{f.current&&$(f.current.getBoundingClientRect().height)},[f]);const E=iu({count:x,getScrollElement:()=>D.current,estimateSize:()=>s,overscan:5}),S=p();return h.jsxs("div",{...d(),children:[a==="outside"&&i,h.jsx(v,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...S,style:{height:`calc(${E.getTotalSize()+y}px)`,...S.style},children:[h.jsxs(El,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>h.jsx(kl,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(B=>{var C;return(C=B?.props)!=null&&C.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:B,selectionMode:n.selectionMode,slots:n.slots,state:n.state},B?.key):h.jsx(Cl,{classNames:n.classNames,node:B,slots:n.slots,state:n.state},B?.key)})},A?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Hu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});wl.displayName="HeroUI.VirtualizedTable";var Wu=wl,Nl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,...b}=e,v=u||"tbody",g=typeof v=="string",x=M(t),{rowGroupProps:D}=ge(),y=K(s?.tbody,o),$=a?.body.props,f=$?.isLoading||$?.loadingState==="loading"||$?.loadingState==="loadingMore",E=k.useMemo(()=>[...a.body.childNodes].map(B=>h.jsx($l,{classNames:s,isSelectable:m,node:B,slots:n,state:i,children:[...B.childNodes].map(C=>C.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:C,rowKey:B.key,selectionMode:p,slots:n,state:i},C.key):h.jsx(fl,{classNames:s,node:C,rowKey:B.key,slots:n,state:i},C.key))},B.key)),[a.body.childNodes,s,m,n,i]);let S,A;return a.size===0&&$.emptyContent&&(S=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!f&&$.emptyContent})})),f&&$.loadingContent&&(A=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:$.loadingContent}),!S&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(v,{ref:x,...j(D,O($,{enabled:g}),b),className:(l=n.tbody)==null?void 0:l.call(n,{class:y}),"data-empty":w(a.size===0),"data-loading":w(f),children:[E,A,S]})});Nl.displayName="HeroUI.TableBody";var Gu=Nl,zl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,removeWrapper:d,sortIcon:r,getBaseProps:p,getWrapperProps:s,getTableProps:b}=pl({...e,ref:t}),{isVirtualized:v,rowHeight:g=40,maxTableHeight:x=600}=e,D=v,y=k.useCallback(({children:$})=>d?$:h.jsx(l,{...s(),children:$}),[d,s]);return D?h.jsx(Wu,{...e,ref:t,maxTableHeight:x,rowHeight:g}):h.jsxs("div",{...p(),children:[a==="outside"&&i,h.jsx(y,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...b(),children:[h.jsxs(El,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map($=>h.jsx(kl,{classNames:n.classNames,node:$,slots:n.slots,state:n.state,children:[...$.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):h.jsx(Cl,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:r,state:n.state},f?.key)})},$?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Gu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});zl.displayName="HeroUI.Table";var qu=zl,Yu=Ru,_u=Yu,Zu=Mu,Ju=Zu,Xu=Vu,Qu=Xu,en=Tu,tn=en,ln=Ou,un=ln;const nn={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},we=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function on(e){return e.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(t,l,u,o,n){return n<0?l+"0."+Array(1-n-u.length).join("0")+o+u:l+u+o+Array(n-o.length+1).join("0")})}function mn({usage:e}){const t=Object.keys(e),{isOpen:l,onOpen:u,onClose:o}=Xl(),n=()=>{o()},i=Object.keys(e[t[0]]),a=[...we.filter(s=>s==="model"||i.includes(s)),...i.filter(s=>!we.includes(s))],m=i.reduce((s,b)=>({...s,[b]:0}),{}),c=t.reduce((s,b)=>(a.reduce((v,g)=>(g==="model"||(v[g]+=e[b][g]),v),s),s),m),d=[...a.map(s=>({key:s,label:nn[s]??De.words(s).map(De.upperFirst).join(" ")}))],r=[...t.map(s=>({model:s,...e[s]})),{model:"Total",...c}],p=h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[c.prompt_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),h.jsx("span",{children:c.prompt_tokens})]}),c.completion_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Completion tokens"}),h.jsx("span",{children:c.completion_tokens})]}),c.total_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Total tokens"}),h.jsx("span",{children:c.total_tokens})]}),c.estimated_cost!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Estimated cost"}),h.jsxs("span",{children:[on(c.estimated_cost.toString()),"$"]})]})]}),h.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return h.jsxs(h.Fragment,{children:[h.jsx(Ql,{content:p,placement:"bottom",children:h.jsx(eu,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:u,children:h.jsx(tu,{icon:"heroicons:information-circle"})})}),h.jsx(lu,{isOpen:l,onOpenChange:n,size:"4xl",children:h.jsx(uu,{children:h.jsxs(h.Fragment,{children:[h.jsx(ru,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),h.jsx(nu,{children:h.jsxs(qu,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[h.jsx(Ju,{columns:d,children:s=>h.jsx(_u,{children:s.label},s.key)}),h.jsx(tn,{items:r,children:s=>h.jsx(Qu,{className:s.model==="Total"?"border-default-200 border-t-1":"",children:b=>h.jsx(un,{children:ou(s,b)})},s.model)})]})})]})})})]})}export{mn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/_basePickBy-DTjWYYGV.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/_basePickBy-DTjWYYGV.js new file mode 100644 index 0000000000..852320bb02 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/_basePickBy-DTjWYYGV.js @@ -0,0 +1 @@ +import{a as p,p as x,o as g,q as u,t as b,s as O}from"./forEach-CTOHlvm6.js";import{bQ as d,bR as P,bS as N}from"./index-DpOBiJiD.js";function Q(r){var n=r==null?0:r.length;return n?r[n-1]:void 0}function W(r){var n=r==null?0:r.length;return n?p(r,1):[]}var l=Object.prototype,_=l.hasOwnProperty;function B(r,n){return r!=null&&_.call(r,n)}function X(r,n){return r!=null&&x(r,n,B)}var S=/\s/;function T(r){for(var n=r.length;n--&&S.test(r.charAt(n)););return n}var A=/^\s+/;function E(r){return r&&r.slice(0,T(r)+1).replace(A,"")}var h=NaN,F=/^[-+]0x[0-9a-f]+$/i,$=/^0b[01]+$/i,w=/^0o[0-7]+$/i,y=parseInt;function G(r){if(typeof r=="number")return r;if(g(r))return h;if(d(r)){var n=typeof r.valueOf=="function"?r.valueOf():r;r=d(n)?n+"":n}if(typeof r!="string")return r===0?r:+r;r=E(r);var t=$.test(r);return t||w.test(r)?y(r.slice(2),t?2:8):F.test(r)?h:+r}var m=1/0,H=17976931348623157e292;function R(r){if(!r)return r===0?r:0;if(r=G(r),r===m||r===-m){var n=r<0?-1:1;return n*H}return r===r?r:0}function Y(r){var n=R(r),t=n%1;return n===n?t?n-t:n:0}function q(r,n,t,f){if(!d(r))return r;n=u(n,r);for(var e=-1,o=n.length,a=o-1,i=r;i!=null&&++er*r+G*G&&(F=w,I=p),{cx:F,cy:I,x01:-n,y01:-d,x11:F*(v/T-1),y11:I*(v/T-1)}}function hn(){var l=cn,h=yn,z=O(0),E=null,v=gn,A=dn,S=mn,a=null,B=ln(s);function s(){var n,d,u=+l.apply(this,arguments),i=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,j=rn(c-f),t=c>f;if(a||(a=n=B()),iy))a.moveTo(0,0);else if(j>tn-y)a.moveTo(i*H(f),i*D(f)),a.arc(0,0,i,f,c,!t),u>y&&(a.moveTo(u*H(c),u*D(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=j,C=j,F=S.apply(this,arguments)/2,I=F>y&&(E?+E.apply(this,arguments):L(u*u+i*i)),w=_(rn(i-u)/2,+z.apply(this,arguments)),p=w,x=w,e,r;if(I>y){var G=sn(I/u*D(F)),M=sn(I/i*D(F));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(C-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(C=0,m=g=(f+c)/2)}var J=i*H(m),K=i*D(m),N=u*H(T),Q=u*D(T);if(w>y){var U=i*H(g),V=i*D(g),X=u*H(R),Y=u*D(R),q;if(jy?x>y?(e=W(X,Y,J,K,i,x,t),r=W(U,V,N,Q,i,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),po?(this.rect.x-=(this.labelWidth-o)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(o+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(s+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>s?(this.rect.y-=(this.labelHeight-s)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(s+this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(t){var o=this.rect.x;o>e.WORLD_BOUNDARY?o=e.WORLD_BOUNDARY:o<-e.WORLD_BOUNDARY&&(o=-e.WORLD_BOUNDARY);var s=this.rect.y;s>e.WORLD_BOUNDARY?s=e.WORLD_BOUNDARY:s<-e.WORLD_BOUNDARY&&(s=-e.WORLD_BOUNDARY);var c=new l(o,s),f=t.inverseTransformPoint(c);this.setLocation(f.x,f.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=i}),(function(A,P,N){var u=N(0);function h(){}for(var a in u)h[a]=u[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,P,N){function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=u}),(function(A,P,N){var u=N(2),h=N(10),a=N(0),e=N(7),r=N(3),l=N(1),i=N(13),g=N(12),t=N(11);function o(c,f,T){u.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,f!=null&&f instanceof e?this.graphManager=f:f!=null&&f instanceof Layout&&(this.graphManager=f.graphManager)}o.prototype=Object.create(u.prototype);for(var s in u)o[s]=u[s];o.prototype.getNodes=function(){return this.nodes},o.prototype.getEdges=function(){return this.edges},o.prototype.getGraphManager=function(){return this.graphManager},o.prototype.getParent=function(){return this.parent},o.prototype.getLeft=function(){return this.left},o.prototype.getRight=function(){return this.right},o.prototype.getTop=function(){return this.top},o.prototype.getBottom=function(){return this.bottom},o.prototype.isConnected=function(){return this.isConnected},o.prototype.add=function(c,f,T){if(f==null&&T==null){var d=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var v=c;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(f.owner==T.owner&&f.owner==this))throw"Both owners must be this graph!";return f.owner!=T.owner?null:(v.source=f,v.target=T,v.isInterGraph=!1,this.getEdges().push(v),f.edges.push(v),T!=f&&T.edges.push(v),v)}},o.prototype.remove=function(c){var f=c;if(c instanceof r){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=f.edges.slice(),d,v=T.length,L=0;L-1&&G>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(C,1),d.target!=d.source&&d.target.edges.splice(G,1);var b=d.source.owner.getEdges().indexOf(d);if(b==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(b,1)}},o.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,f=h.MAX_VALUE,T,d,v,L=this.getNodes(),b=L.length,C=0;CT&&(c=T),f>d&&(f=d)}return c==h.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?v=L[0].getParent().paddingLeft:v=this.margin,this.left=f-v,this.top=c-v,new g(this.left,this.top))},o.prototype.updateBounds=function(c){for(var f=h.MAX_VALUE,T=-h.MAX_VALUE,d=h.MAX_VALUE,v=-h.MAX_VALUE,L,b,C,G,k,Y=this.nodes,K=Y.length,O=0;OL&&(f=L),TC&&(d=C),vL&&(f=L),TC&&(d=C),v=this.nodes.length){var K=0;T.forEach(function(O){O.owner==c&&K++}),K==this.nodes.length&&(this.isConnected=!0)}},A.exports=o}),(function(A,P,N){var u,h=N(1);function a(e){u=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),r=this.layout.newNode(null),l=this.add(e,r);return this.setRootGraph(l),this.rootGraph},a.prototype.add=function(e,r,l,i,g){if(l==null&&i==null&&g==null){if(e==null)throw"Graph is null!";if(r==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(r.child!=null)throw"Already has a child!";return e.parent=r,r.child=e,e}else{g=l,i=r,l=e;var t=i.getOwner(),o=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(o!=null&&o.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==o)return l.isInterGraph=!1,t.add(l,i,g);if(l.isInterGraph=!0,l.source=i,l.target=g,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},a.prototype.remove=function(e){if(e instanceof u){var r=e;if(r.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(r==this.rootGraph||r.parent!=null&&r.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(r.getEdges());for(var i,g=l.length,t=0;t=e.getRight()?r[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(r[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(r[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var g=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(g=1);var t=g*r[0],o=r[1]/g;r[0]t)return r[0]=l,r[1]=s,r[2]=g,r[3]=Y,!1;if(ig)return r[0]=o,r[1]=i,r[2]=G,r[3]=t,!1;if(lg?(r[0]=f,r[1]=T,n=!0):(r[0]=c,r[1]=s,n=!0):p===y&&(l>g?(r[0]=o,r[1]=s,n=!0):(r[0]=d,r[1]=T,n=!0)),-E===y?g>l?(r[2]=k,r[3]=Y,m=!0):(r[2]=G,r[3]=C,m=!0):E===y&&(g>l?(r[2]=b,r[3]=C,m=!0):(r[2]=K,r[3]=Y,m=!0)),n&&m)return!1;if(l>g?i>t?(R=this.getCardinalDirection(p,y,4),M=this.getCardinalDirection(E,y,2)):(R=this.getCardinalDirection(-p,y,3),M=this.getCardinalDirection(-E,y,1)):i>t?(R=this.getCardinalDirection(-p,y,1),M=this.getCardinalDirection(-E,y,3)):(R=this.getCardinalDirection(p,y,2),M=this.getCardinalDirection(E,y,4)),!n)switch(R){case 1:W=s,S=l+-L/y,r[0]=S,r[1]=W;break;case 2:S=d,W=i+v*y,r[0]=S,r[1]=W;break;case 3:W=T,S=l+L/y,r[0]=S,r[1]=W;break;case 4:S=f,W=i+-v*y,r[0]=S,r[1]=W;break}if(!m)switch(M){case 1:q=C,D=g+-it/y,r[2]=D,r[3]=q;break;case 2:D=K,q=t+O*y,r[2]=D,r[3]=q;break;case 3:q=Y,D=g+it/y,r[2]=D,r[3]=q;break;case 4:D=k,q=t+-O*y,r[2]=D,r[3]=q;break}}return!1},h.getCardinalDirection=function(a,e,r){return a>e?r:1+r%4},h.getIntersection=function(a,e,r,l){if(l==null)return this.getIntersection2(a,e,r);var i=a.x,g=a.y,t=e.x,o=e.y,s=r.x,c=r.y,f=l.x,T=l.y,d=void 0,v=void 0,L=void 0,b=void 0,C=void 0,G=void 0,k=void 0,Y=void 0,K=void 0;return L=o-g,C=i-t,k=t*g-i*o,b=T-c,G=s-f,Y=f*c-s*T,K=L*G-b*C,K===0?null:(d=(C*Y-G*k)/K,v=(b*k-L*Y)/K,new u(d,v))},h.angleOfVector=function(a,e,r,l){var i=void 0;return a!==r?(i=Math.atan((l-e)/(r-a)),r=0){var T=(-s+Math.sqrt(s*s-4*o*c))/(2*o),d=(-s-Math.sqrt(s*s-4*o*c))/(2*o),v=null;return T>=0&&T<=1?[T]:d>=0&&d<=1?[d]:v}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,P,N){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=u}),(function(A,P,N){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,A.exports=u}),(function(A,P,N){var u=(function(){function i(g,t){for(var o=0;o"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},A.exports=h}),(function(A,P,N){function u(s){if(Array.isArray(s)){for(var c=0,f=Array(s.length);c0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),v.add(G);for(var k=G.getEdges(),d=0;d-1&&C.splice(it,1)}v=new Set,b=new Map}}return s},o.prototype.createDummyNodesForBendpoints=function(s){for(var c=[],f=s.source,T=this.graphManager.calcLowestCommonAncestor(s.source,s.target),d=0;d0){for(var T=this.edgeToDummyNodes.get(f),d=0;d=0&&c.splice(Y,1);var K=b.getNeighborsList();K.forEach(function(n){if(f.indexOf(n)<0){var m=T.get(n),p=m-1;p==1&&G.push(n),T.set(n,p)}})}f=f.concat(G),(c.length==1||c.length==2)&&(d=!0,v=c[0])}return v},o.prototype.setGraphManager=function(s){this.graphManager=s},A.exports=o}),(function(A,P,N){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},A.exports=u}),(function(A,P,N){var u=N(5);function h(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var e=0,r=this.lworldExtX;return r!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/r),e},h.prototype.transformY=function(a){var e=0,r=this.lworldExtY;return r!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/r),e},h.prototype.inverseTransformX=function(a){var e=0,r=this.ldeviceExtX;return r!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/r),e},h.prototype.inverseTransformY=function(a){var e=0,r=this.ldeviceExtY;return r!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/r),e},h.prototype.inverseTransformPoint=function(a){var e=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},A.exports=h}),(function(A,P,N){function u(t){if(Array.isArray(t)){for(var o=0,s=Array(t.length);oa.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),o,s=0;s0&&arguments[0]!==void 0?arguments[0]:!0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s,c,f,T,d=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),v=new Set,s=0;sL||v>L)&&(t.gravitationForceX=-this.gravityConstant*f,t.gravitationForceY=-this.gravityConstant*T)):(L=o.getEstimatedSize()*this.compoundGravityRangeFactor,(d>L||v>L)&&(t.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},i.prototype.isConverged=function(){var t,o=!1;return this.totalIterations>this.maxIterations/3&&(o=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=d.length||L>=d[0].length)){for(var b=0;bi}}]),r})();A.exports=e}),(function(A,P,N){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),r=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),l=!0,i=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var y=E+1;y=0;V--){if((function(Tt,Ct){return Tt&&Ct})(V0;){var Q=void 0,It=void 0;for(Q=n-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(e[Q])<=ht+_*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[Q]=0;break}if(Q===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=Q&&Nt!==Q;Nt--){var vt=(Nt!==n?Math.abs(e[Nt]):0)+(Nt!==Q+1?Math.abs(e[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+_*vt){this.s[Nt]=0;break}}Nt===Q?It=3:Nt===n-1?It=1:(It=2,Q=Nt)}switch(Q++,It){case 1:{var rt=e[n-2];e[n-2]=0;for(var gt=n-2;gt>=Q;gt--){var mt=u.hypot(this.s[gt],rt),At=this.s[gt]/mt,Ot=rt/mt;this.s[gt]=mt,gt!==Q&&(rt=-Ot*e[gt-1],e[gt-1]=At*e[gt-1]);for(var Et=0;Et=this.s[Q+1]);){var Lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=Lt,QMath.abs(a)?(e=a/h,e=Math.abs(h)*Math.sqrt(1+e*e)):a!=0?(e=h/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},A.exports=u}),(function(A,P,N){var u=(function(){function e(r,l){for(var i=0;i2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=r,this.sequence2=l,this.match_score=i,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=r.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var o=0;o=0;r--){var l=this.listeners[r];l.event===a&&l.callback===e&&this.listeners.splice(r,1)}},h.emit=function(a,e){for(var r=0;r{var P={45:((a,e,r)=>{var l={};l.layoutBase=r(551),l.CoSEConstants=r(806),l.CoSEEdge=r(767),l.CoSEGraph=r(880),l.CoSEGraphManager=r(578),l.CoSELayout=r(765),l.CoSENode=r(991),l.ConstraintHandler=r(902),a.exports=l}),806:((a,e,r)=>{var l=r(551).FDLayoutConstants;function i(){}for(var g in l)i[g]=l[g];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,a.exports=i}),767:((a,e,r)=>{var l=r(551).FDLayoutEdge;function i(t,o,s){l.call(this,t,o,s)}i.prototype=Object.create(l.prototype);for(var g in l)i[g]=l[g];a.exports=i}),880:((a,e,r)=>{var l=r(551).LGraph;function i(t,o,s){l.call(this,t,o,s)}i.prototype=Object.create(l.prototype);for(var g in l)i[g]=l[g];a.exports=i}),578:((a,e,r)=>{var l=r(551).LGraphManager;function i(t){l.call(this,t)}i.prototype=Object.create(l.prototype);for(var g in l)i[g]=l[g];a.exports=i}),765:((a,e,r)=>{var l=r(551).FDLayout,i=r(578),g=r(880),t=r(991),o=r(767),s=r(806),c=r(902),f=r(551).FDLayoutConstants,T=r(551).LayoutConstants,d=r(551).Point,v=r(551).PointD,L=r(551).DimensionD,b=r(551).Layout,C=r(551).Integer,G=r(551).IGeometry,k=r(551).LGraph,Y=r(551).Transform,K=r(551).LinkedList;function O(){l.call(this),this.toBeTiled={},this.constraints={}}O.prototype=Object.create(l.prototype);for(var it in l)O[it]=l[it];O.prototype.newGraphManager=function(){var n=new i(this);return this.graphManager=n,n},O.prototype.newGraph=function(n){return new g(null,this.graphManager,n)},O.prototype.newNode=function(n){return new t(this.graphManager,n)},O.prototype.newEdge=function(n){return new o(null,null,n)},O.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.isSubLayout||(s.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},O.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},O.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},O.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(s.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(R){return m.has(R)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),s.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},O.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),s.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),s.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},O.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(E.fixedNodeWeight=R)}}if(this.constraints.relativePlacementConstraint){var M=new Map,S=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(w){n.fixedNodesOnHorizontal.add(w),n.fixedNodesOnVertical.add(w)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*w.length/3;_--)H=Math.floor(Math.random()*(_+1)),B=w[_],w[_]=w[H],w[H]=B;return w},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(w){if(w.left){var H=M.has(w.left)?M.get(w.left):w.left,B=M.has(w.right)?M.get(w.right):w.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:B,gap:w.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:H,gap:w.gap})}else{var _=S.has(w.top)?S.get(w.top):w.top,ht=S.has(w.bottom)?S.get(w.bottom):w.bottom;n.nodesInRelativeVertical.includes(_)||(n.nodesInRelativeVertical.push(_),n.nodeToRelativeConstraintMapVertical.set(_,[]),n.dummyToNodeForHorizontalAlignment.has(_)?n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(_).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(_).push({bottom:ht,gap:w.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:_,gap:w.gap})}});else{var q=new Map,V=new Map;this.constraints.relativePlacementConstraint.forEach(function(w){if(w.left){var H=M.has(w.left)?M.get(w.left):w.left,B=M.has(w.right)?M.get(w.right):w.right;q.has(H)?q.get(H).push(B):q.set(H,[B]),q.has(B)?q.get(B).push(H):q.set(B,[H])}else{var _=S.has(w.top)?S.get(w.top):w.top,ht=S.has(w.bottom)?S.get(w.bottom):w.bottom;V.has(_)?V.get(_).push(ht):V.set(_,[ht]),V.has(ht)?V.get(ht).push(_):V.set(ht,[_])}});var X=function(H,B){var _=[],ht=[],Q=new K,It=new Set,Nt=0;return H.forEach(function(vt,rt){if(!It.has(rt)){_[Nt]=[],ht[Nt]=!1;var gt=rt;for(Q.push(gt),It.add(gt),_[Nt].push(gt);Q.length!=0;){gt=Q.shift(),B.has(gt)&&(ht[Nt]=!0);var mt=H.get(gt);mt.forEach(function(At){It.has(At)||(Q.push(At),It.add(At),_[Nt].push(At))})}Nt++}}),{components:_,isFixed:ht}},et=X(q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=et.components,this.fixedComponentsOnHorizontal=et.isFixed;var z=X(V,n.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},O.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var w=n.idToNodeMap.get(z.nodeId);w.displacementX=0,w.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,p=0;p1){var S;for(S=0;SE&&(E=Math.floor(M.y)),R=Math.floor(M.x+s.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(T.WORLD_CENTER_X-M.x/2,T.WORLD_CENTER_Y-M.y/2))},O.radialLayout=function(n,m,p){var E=Math.max(this.maxDiagonalInTree(n),s.DEFAULT_RADIAL_SEPARATION);O.branchRadialLayout(m,null,0,359,0,E);var y=k.calculateBounds(n),R=new Y;R.setDeviceOrgX(y.getMinX()),R.setDeviceOrgY(y.getMinY()),R.setWorldOrgX(p.x),R.setWorldOrgY(p.y);for(var M=0;M1;){var B=H[0];H.splice(0,1);var _=V.indexOf(B);_>=0&&V.splice(_,1),z--,X--}m!=null?w=(V.indexOf(H[0])+1)%z:w=0;for(var ht=Math.abs(E-p)/X,Q=w;et!=X;Q=++Q%z){var It=V[Q].getOtherEnd(n);if(It!=m){var Nt=(p+et*ht)%360,vt=(Nt+ht)%360;O.branchRadialLayout(It,n,Nt,vt,y+R,R),et++}}},O.maxDiagonalInTree=function(n){for(var m=C.MIN_VALUE,p=0;pm&&(m=y)}return m},O.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},O.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var p=[],E=this.graphManager.getAllNodes(),y=0;y"u"&&(m[S]=[]),m[S]=m[S].concat(R)}Object.keys(m).forEach(function(W){if(m[W].length>1){var D="DummyCompound_"+W;n.memberGroups[D]=m[W];var q=m[W][0].getParent(),V=new t(n.graphManager);V.id=D,V.paddingLeft=q.paddingLeft||0,V.paddingRight=q.paddingRight||0,V.paddingBottom=q.paddingBottom||0,V.paddingTop=q.paddingTop||0,n.idToDummyNode[D]=V;var X=n.getGraphManager().add(n.newGraph(),V),et=q.getChild();et.add(V);for(var z=0;zy?(E.rect.x-=(E.labelWidth-y)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-y)/2):E.labelPosHorizontal=="right"&&E.setWidth(y+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(R+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>R?(E.rect.y-=(E.labelHeight-R)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-R)/2):E.labelPosVertical=="bottom"&&E.setHeight(R+E.labelHeight))}})},O.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],p=m.id,E=m.paddingLeft,y=m.paddingTop,R=m.labelMarginLeft,M=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],m.rect.x,m.rect.y,E,y,R,M)}},O.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(p){var E=n.idToDummyNode[p],y=E.paddingLeft,R=E.paddingTop,M=E.labelMarginLeft,S=E.labelMarginTop;n.adjustLocations(m[p],E.rect.x,E.rect.y,y,R,M,S)})},O.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var p=n.getChild();if(p==null)return this.toBeTiled[m]=!1,!1;for(var E=p.getNodes(),y=0;y0)return this.toBeTiled[m]=!1,!1;if(R.getChild()==null){this.toBeTiled[R.id]=!1;continue}if(!this.getToBeTiled(R))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},O.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),p=0,E=0;Eq&&(q=X.rect.height)}p+=q+n.verticalPadding}},O.prototype.tileCompoundMembers=function(n,m){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var y=m[E];if(p.tiledMemberPack[E]=p.tileNodes(n[E],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[E].width,y.rect.height=p.tiledMemberPack[E].height,y.setCenter(p.tiledMemberPack[E].centerX,p.tiledMemberPack[E].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,s.NODE_DIMENSIONS_INCLUDE_LABELS){var R=y.rect.width,M=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(R+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>R?(y.rect.x-=(y.labelWidth-R)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-R)/2):y.labelPosHorizontal=="right"&&y.setWidth(R+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(M+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>M?(y.rect.y-=(y.labelHeight-M)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-M)/2):y.labelPosVertical=="bottom"&&y.setHeight(M+y.labelHeight))}})},O.prototype.tileNodes=function(n,m){var p=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),y=this.getOrgRatio(p),R=this.getOrgRatio(E),M;return RS&&(S=z.getWidth())});var W=R/y,D=M/y,q=Math.pow(p-E,2)+4*(W+E)*(D+p)*y,V=(E-p+Math.sqrt(q))/(2*(W+E)),X;m?(X=Math.ceil(V),X==V&&X++):X=Math.floor(V);var et=X*(W+E)-E;return S>et&&(et=S),et+=E*2,et},O.prototype.tileNodesByFavoringDim=function(n,m,p){var E=s.TILING_PADDING_VERTICAL,y=s.TILING_PADDING_HORIZONTAL,R=s.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:y,centerX:0,centerY:0};R&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var S=function(w){return w.rect.width*w.rect.height},W=function(w,H){return S(H)-S(w)};n.sort(function(z,w){var H=W;return M.idealRowWidth?(H=R,H(z.id,w.id)):H(z,w)});for(var D=0,q=0,V=0;V0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(S+=n.verticalPadding);var W=0;S>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=S,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(m)},O.prototype.getShortestRowIndex=function(n){for(var m=-1,p=Number.MAX_VALUE,E=0;Ep&&(m=E,p=n.rowWidth[E]);return m},O.prototype.canAddHorizontal=function(n,m,p){if(n.idealRowWidth){var E=n.rows.length-1,y=n.rowWidth[E];return y+m+n.horizontalPadding<=n.idealRowWidth}var R=this.getShortestRowIndex(n);if(R<0)return!0;var M=n.rowWidth[R];if(M+n.horizontalPadding+m<=n.width)return!0;var S=0;n.rowHeight[R]0&&(S=p+n.verticalPadding-n.rowHeight[R]);var W;n.width-M>=m+n.horizontalPadding?W=(n.height+S)/(M+m+n.horizontalPadding):W=(n.height+S)/n.width,S=p+n.verticalPadding;var D;return n.widthR&&m!=p){E.splice(-1,1),n.rows[p].push(y),n.rowWidth[m]=n.rowWidth[m]-R,n.rowWidth[p]=n.rowWidth[p]+R,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,S=0;SM&&(M=E[S].height);m>0&&(M+=n.verticalPadding);var W=n.rowHeight[m]+n.rowHeight[p];n.rowHeight[m]=M,n.rowHeight[p]0)for(var et=y;et<=R;et++)X[0]+=this.grid[et][M-1].length+this.grid[et][M].length-1;if(R0)for(var et=M;et<=S;et++)X[3]+=this.grid[y-1][et].length+this.grid[y][et].length-1;for(var z=C.MAX_VALUE,w,H,B=0;B{var l=r(551).FDLayoutNode,i=r(551).IMath;function g(o,s,c,f){l.call(this,o,s,c,f)}g.prototype=Object.create(l.prototype);for(var t in l)g[t]=l[t];g.prototype.calculateDisplacement=function(){var o=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=o.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=o.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementX=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>o.coolingFactor*o.maxNodeDisplacement&&(this.displacementY=o.coolingFactor*o.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(o,s){for(var c=this.getChild().getNodes(),f,T=0;T{function l(c){if(Array.isArray(c)){for(var f=0,T=Array(c.length);f0){var Lt=0;ot.forEach(function(st){$=="horizontal"?(tt.set(st,d.has(st)?v[d.get(st)]:Z.get(st)),Lt+=tt.get(st)):(tt.set(st,d.has(st)?L[d.get(st)]:Z.get(st)),Lt+=tt.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){J.has(st)||tt.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){$=="horizontal"?ft+=d.has(st)?v[d.get(st)]:Z.get(st):ft+=d.has(st)?L[d.get(st)]:Z.get(st)}),ft=ft/lt.length,lt.forEach(function(st){tt.set(st,ft)})}});for(var Mt=function(){var ot=ut.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(tt.get(ft.id)st&&(st=Zt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;tt.set(te,tt.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return tt},it=function(U){var $=0,J=0,Z=0,at=0;if(U.forEach(function(j){j.left?v[d.get(j.left)]-v[d.get(j.right)]>=0?$++:J++:L[d.get(j.top)]-L[d.get(j.bottom)]>=0?Z++:at++}),$>J&&Z>at)for(var ct=0;ctJ)for(var nt=0;ntat)for(var tt=0;tt1)f.fixedNodeConstraint.forEach(function(F,U){E[U]=[F.position.x,F.position.y],y[U]=[v[d.get(F.nodeId)],L[d.get(F.nodeId)]]}),R=!0;else if(f.alignmentConstraint)(function(){var F=0;if(f.alignmentConstraint.vertical){for(var U=f.alignmentConstraint.vertical,$=function(tt){var j=new Set;U[tt].forEach(function(pt){j.add(pt)});var ut=new Set([].concat(l(j)).filter(function(pt){return S.has(pt)})),Mt=void 0;ut.size>0?Mt=v[d.get(ut.values().next().value)]:Mt=K(j).x,U[tt].forEach(function(pt){E[F]=[Mt,L[d.get(pt)]],y[F]=[v[d.get(pt)],L[d.get(pt)]],F++})},J=0;J0?Mt=v[d.get(ut.values().next().value)]:Mt=K(j).y,Z[tt].forEach(function(pt){E[F]=[v[d.get(pt)],Mt],y[F]=[v[d.get(pt)],L[d.get(pt)]],F++})},ct=0;ctV&&(V=q[et].length,X=et);if(V0){var Et={x:0,y:0};f.fixedNodeConstraint.forEach(function(F,U){var $={x:v[d.get(F.nodeId)],y:L[d.get(F.nodeId)]},J=F.position,Z=Y(J,$);Et.x+=Z.x,Et.y+=Z.y}),Et.x/=f.fixedNodeConstraint.length,Et.y/=f.fixedNodeConstraint.length,v.forEach(function(F,U){v[U]+=Et.x}),L.forEach(function(F,U){L[U]+=Et.y}),f.fixedNodeConstraint.forEach(function(F){v[d.get(F.nodeId)]=F.position.x,L[d.get(F.nodeId)]=F.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var Dt=f.alignmentConstraint.vertical,Rt=function(U){var $=new Set;Dt[U].forEach(function(at){$.add(at)});var J=new Set([].concat(l($)).filter(function(at){return S.has(at)})),Z=void 0;J.size>0?Z=v[d.get(J.values().next().value)]:Z=K($).x,$.forEach(function(at){S.has(at)||(v[d.get(at)]=Z)})},Ht=0;Ht0?Z=L[d.get(J.values().next().value)]:Z=K($).y,$.forEach(function(at){S.has(at)||(L[d.get(at)]=Z)})},Ft=0;Ft{a.exports=A})},N={};function u(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return P[a](r,r.exports,u),r.exports}var h=u(45);return h})()})})(le)),le.exports}var pr=he.exports,De;function yr(){return De||(De=1,(function(I,x){(function(P,N){I.exports=N(vr())})(pr,function(A){return(()=>{var P={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var r=arguments.length,l=Array(r>1?r-1:0),i=1;i{var l=(function(){function t(o,s){var c=[],f=!0,T=!1,d=void 0;try{for(var v=o[Symbol.iterator](),L;!(f=(L=v.next()).done)&&(c.push(L.value),!(s&&c.length===s));f=!0);}catch(b){T=!0,d=b}finally{try{!f&&v.return&&v.return()}finally{if(T)throw d}}return c}return function(o,s){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return t(o,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),i=r(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var o={},s=0;s0&&R.merge(D)});for(var M=0;M1){L=d[0],b=L.connectedEdges().length,d.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),k),Y},g.relocateComponent=function(t,o,s){if(!s.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY;if(s.quality=="draft"){var v=!0,L=!1,b=void 0;try{for(var C=o.nodeIndexes[Symbol.iterator](),G;!(v=(G=C.next()).done);v=!0){var k=G.value,Y=l(k,2),K=Y[0],O=Y[1],it=s.cy.getElementById(K);if(it){var n=it.boundingBox(),m=o.xCoords[O]-n.w/2,p=o.xCoords[O]+n.w/2,E=o.yCoords[O]-n.h/2,y=o.yCoords[O]+n.h/2;mf&&(f=p),Ed&&(d=y)}}}catch(D){L=!0,b=D}finally{try{!v&&C.return&&C.return()}finally{if(L)throw b}}var R=t.x-(f+c)/2,M=t.y-(d+T)/2;o.xCoords=o.xCoords.map(function(D){return D+R}),o.yCoords=o.yCoords.map(function(D){return D+M})}else{Object.keys(o).forEach(function(D){var q=o[D],V=q.getRect().x,X=q.getRect().x+q.getRect().width,et=q.getRect().y,z=q.getRect().y+q.getRect().height;Vf&&(f=X),etd&&(d=z)});var S=t.x-(f+c)/2,W=t.y-(d+T)/2;Object.keys(o).forEach(function(D){var q=o[D];q.setCenter(q.getCenterX()+S,q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,o,s,c){for(var f=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,C=void 0,G=void 0,k=t.descendants().not(":parent"),Y=k.length,K=0;KL&&(f=L),TC&&(d=C),v{var l=r(548),i=r(140).CoSELayout,g=r(140).CoSENode,t=r(140).layoutBase.PointD,o=r(140).layoutBase.DimensionD,s=r(140).layoutBase.LayoutConstants,c=r(140).layoutBase.FDLayoutConstants,f=r(140).CoSEConstants,T=function(v,L){var b=v.cy,C=v.eles,G=C.nodes(),k=C.edges(),Y=void 0,K=void 0,O=void 0,it={};v.randomize&&(Y=L.nodeIndexes,K=L.xCoords,O=L.yCoords);var n=function(D){return typeof D=="function"},m=function(D,q){return n(D)?D(q):D},p=l.calcParentsWithoutChildren(b,C),E=function W(D,q,V,X){for(var et=q.length,z=0;z0){var Q=void 0;Q=V.getGraphManager().add(V.newGraph(),B),W(Q,H,V,X)}}},y=function(D,q,V){for(var X=0,et=0,z=0;z0?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/et:n(v.idealEdgeLength)?f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:f.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,f.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},R=function(D,q){q.fixedNodeConstraint&&(D.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(D.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(D.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};v.nestingFactor!=null&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(f.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(f.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(f.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?s.QUALITY=2:s.QUALITY=0,f.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!v.randomize,f.ANIMATE=c.ANIMATE=s.ANIMATE=v.animate,f.TILE=v.tile,f.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!v.randomize,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1),v.step=="enforced"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1),v.step=="cose"&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?f.TREE_REDUCTION_ON_INCREMENTAL=!1:f.TREE_REDUCTION_ON_INCREMENTAL=!0;var M=new i,S=M.newGraphManager();return E(S.addRoot(),l.getTopMostNodes(G),M,v),y(M,S,k),R(M,v),M.runLayout(),it};a.exports={coseLayout:T}}),212:((a,e,r)=>{var l=(function(){function v(L,b){for(var C=0;C0)if(p){var R=t.getTopMostNodes(C.eles.nodes());if(O=t.connectComponents(G,C.eles,R),O.forEach(function(vt){var rt=vt.boundingBox();it.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),C.randomize&&O.forEach(function(vt){C.eles=vt,Y.push(s(C))}),C.quality=="default"||C.quality=="proof"){var M=G.collection();if(C.tile){var S=new Map,W=[],D=[],q=0,V={nodeIndexes:S,xCoords:W,yCoords:D},X=[];if(O.forEach(function(vt,rt){vt.edges().length==0&&(vt.nodes().forEach(function(gt,mt){M.merge(vt.nodes()[mt]),gt.isParent()||(V.nodeIndexes.set(vt.nodes()[mt].id(),q++),V.xCoords.push(vt.nodes()[0].position().x),V.yCoords.push(vt.nodes()[0].position().y))}),X.push(rt))}),M.length>1){var et=M.boundingBox();it.push({x:et.x1+et.w/2,y:et.y1+et.h/2}),O.push(M),Y.push(V);for(var z=X.length-1;z>=0;z--)O.splice(X[z],1),Y.splice(X[z],1),it.splice(X[z],1)}}O.forEach(function(vt,rt){C.eles=vt,K.push(f(C,Y[rt])),t.relocateComponent(it[rt],K[rt],C)})}else O.forEach(function(vt,rt){t.relocateComponent(it[rt],Y[rt],C)});var w=new Set;if(O.length>1){var H=[],B=k.filter(function(vt){return vt.css("display")=="none"});O.forEach(function(vt,rt){var gt=void 0;if(C.quality=="draft"&&(gt=Y[rt].nodeIndexes),vt.nodes().not(B).length>0){var mt={};mt.edges=[],mt.nodes=[];var At=void 0;vt.nodes().not(B).forEach(function(Ot){if(C.quality=="draft")if(!Ot.isParent())At=gt.get(Ot.id()),mt.nodes.push({x:Y[rt].xCoords[At]-Ot.boundingbox().w/2,y:Y[rt].yCoords[At]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var Et=t.calcBoundingBox(Ot,Y[rt].xCoords,Y[rt].yCoords,gt);mt.nodes.push({x:Et.topLeftX,y:Et.topLeftY,width:Et.width,height:Et.height})}else K[rt][Ot.id()]&&mt.nodes.push({x:K[rt][Ot.id()].getLeft(),y:K[rt][Ot.id()].getTop(),width:K[rt][Ot.id()].getWidth(),height:K[rt][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var Et=Ot.source(),Dt=Ot.target();if(Et.css("display")!="none"&&Dt.css("display")!="none")if(C.quality=="draft"){var Rt=gt.get(Et.id()),Ht=gt.get(Dt.id()),Ut=[],Pt=[];if(Et.isParent()){var Ft=t.calcBoundingBox(Et,Y[rt].xCoords,Y[rt].yCoords,gt);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[rt].xCoords[Rt]),Ut.push(Y[rt].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,Y[rt].xCoords,Y[rt].yCoords,gt);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[rt].xCoords[Ht]),Pt.push(Y[rt].yCoords[Ht]);mt.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else K[rt][Et.id()]&&K[rt][Dt.id()]&&mt.edges.push({startX:K[rt][Et.id()].getCenterX(),startY:K[rt][Et.id()].getCenterY(),endX:K[rt][Dt.id()].getCenterX(),endY:K[rt][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(H.push(mt),w.add(rt))}});var _=m.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,rt){var gt=vt.xCoords.map(function(At){return At+_[rt].dx}),mt=vt.yCoords.map(function(At){return At+_[rt].dy});vt.xCoords=gt,vt.yCoords=mt});else{var ht=0;w.forEach(function(vt){Object.keys(K[vt]).forEach(function(rt){var gt=K[vt][rt];gt.setCenter(gt.getCenterX()+_[ht].dx,gt.getCenterY()+_[ht].dy)}),ht++})}}}else{var E=C.eles.boundingBox();if(it.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),C.randomize){var y=s(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?(K.push(f(C,Y[0])),t.relocateComponent(it[0],K[0],C)):t.relocateComponent(it[0],Y[0],C)}var Q=function(rt,gt){if(C.quality=="default"||C.quality=="proof"){typeof rt=="number"&&(rt=gt);var mt=void 0,At=void 0,Ot=rt.data("id");return K.forEach(function(Dt){Ot in Dt&&(mt={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},At=Dt[Ot])}),C.nodeDimensionsIncludeLabels&&(At.labelWidth&&(At.labelPosHorizontal=="left"?mt.x+=At.labelWidth/2:At.labelPosHorizontal=="right"&&(mt.x-=At.labelWidth/2)),At.labelHeight&&(At.labelPosVertical=="top"?mt.y+=At.labelHeight/2:At.labelPosVertical=="bottom"&&(mt.y-=At.labelHeight/2))),mt==null&&(mt={x:rt.position("x"),y:rt.position("y")}),{x:mt.x,y:mt.y}}else{var Et=void 0;return Y.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(rt.id());Rt!=null&&(Et={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Et==null&&(Et={x:rt.position("x"),y:rt.position("y")}),{x:Et.x,y:Et.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,k),Nt=k.filter(function(vt){return vt.css("display")=="none"});C.eles=k.not(Nt),k.nodes().not(":parent").not(Nt).layoutPositions(b,C,Q),It.length>0&&It.forEach(function(vt){vt.position(Q(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v})();a.exports=d}),657:((a,e,r)=>{var l=r(548),i=r(140).layoutBase.Matrix,g=r(140).layoutBase.SVD,t=function(s){var c=s.cy,f=s.eles,T=f.nodes(),d=f.nodes(":parent"),v=new Map,L=new Map,b=new Map,C=[],G=[],k=[],Y=[],K=[],O=[],it=[],n=[],m=void 0,p=1e8,E=1e-9,y=s.piTol,R=s.samplingType,M=s.nodeSeparation,S=void 0,W=function(){for(var U=0,$=0,J=!1;$=at;){nt=Z[at++];for(var xt=C[nt],lt=0;ltut&&(ut=K[Lt],Mt=Lt)}return Mt},q=function(U){var $=void 0;if(U){$=Math.floor(Math.random()*m);for(var Z=0;Z=1)break;j=tt}for(var pt=0;pt=1)break;j=tt}for(var lt=0;lt0&&($.isParent()?C[U].push(b.get($.id())):C[U].push($.id()))})});var Nt=function(U){var $=L.get(U),J=void 0;v.get(U).forEach(function(Z){c.getElementById(Z).isParent()?J=b.get(Z):J=Z,C[$].push(J),C[L.get(J)].push(U)})},vt=!0,rt=!1,gt=void 0;try{for(var mt=v.keys()[Symbol.iterator](),At;!(vt=(At=mt.next()).done);vt=!0){var Ot=At.value;Nt(Ot)}}catch(F){rt=!0,gt=F}finally{try{!vt&&mt.return&&mt.return()}finally{if(rt)throw gt}}m=L.size;var Et=void 0;if(m>2){S=m{var l=r(212),i=function(t){t&&t("layout","fcose",l)};typeof cytoscape<"u"&&i(cytoscape),a.exports=i}),140:(a=>{a.exports=A})},N={};function u(a){var e=N[a];if(e!==void 0)return e.exports;var r=N[a]={exports:{}};return P[a](r,r.exports,u),r.exports}var h=u(579);return h})()})})(he)),he.exports}var Er=yr();const mr=Ze(Er);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:dt(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:dt(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:dt(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:dt(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:dt((I,x)=>I-x+2,"L"),R:dt((I,x)=>I-2,"R"),T:dt((I,x)=>I-x+2,"T"),B:dt((I,x)=>I-2,"B")},Tr=dt(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=dt(function(I){const x=I;return x==="L"||x==="R"||x==="T"||x==="B"},"isArchitectureDirection"),Wt=dt(function(I){const x=I;return x==="L"||x==="R"},"isArchitectureDirectionX"),qt=dt(function(I){const x=I;return x==="T"||x==="B"},"isArchitectureDirectionY"),Te=dt(function(I,x){const A=Wt(I)&&qt(x),P=qt(I)&&Wt(x);return A||P},"isArchitectureDirectionXY"),Nr=dt(function(I){const x=I[0],A=I[1],P=Wt(x)&&qt(A),N=qt(x)&&Wt(A);return P||N},"isArchitecturePairXY"),Lr=dt(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),ye=dt(function(I,x){const A=`${I}${x}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=dt(function([I,x],A){const P=A[0],N=A[1];return Wt(P)?qt(N)?[I+(P==="L"?-1:1),x+(N==="T"?1:-1)]:[I+(P==="L"?-1:1),x]:Wt(N)?[I+(N==="L"?1:-1),x+(P==="T"?1:-1)]:[I,x+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=dt(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Mr=dt(function(I,x){return Te(I,x)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),wr=dt(function(I){return I.type==="service"},"isArchitectureService"),Or=dt(function(I){return I.type==="junction"},"isArchitectureJunction"),be=dt(I=>I.data(),"edgeData"),ie=dt(I=>I.data(),"nodeData"),Dr=ar.architecture,ae,Pe=(ae=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},er()}addService({id:x,icon:A,in:P,title:N,iconText:u}){if(this.registeredIds[x]!==void 0)throw new Error(`The service id [${x}] is already in use by another ${this.registeredIds[x]}`);if(P!==void 0){if(x===P)throw new Error(`The service [${x}] cannot be placed within itself`);if(this.registeredIds[P]===void 0)throw new Error(`The service [${x}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[P]==="node")throw new Error(`The service [${x}]'s parent is not a group`)}this.registeredIds[x]="node",this.nodes[x]={id:x,type:"service",icon:A,iconText:u,title:N,edges:[],in:P}}getServices(){return Object.values(this.nodes).filter(wr)}addJunction({id:x,in:A}){this.registeredIds[x]="node",this.nodes[x]={id:x,type:"junction",edges:[],in:A}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(x){return this.nodes[x]??null}addGroup({id:x,icon:A,in:P,title:N}){if(this.registeredIds?.[x]!==void 0)throw new Error(`The group id [${x}] is already in use by another ${this.registeredIds[x]}`);if(P!==void 0){if(x===P)throw new Error(`The group [${x}] cannot be placed within itself`);if(this.registeredIds?.[P]===void 0)throw new Error(`The group [${x}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[P]==="node")throw new Error(`The group [${x}]'s parent is not a group`)}this.registeredIds[x]="group",this.groups[x]={id:x,icon:A,title:N,in:P}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:x,rhsId:A,lhsDir:P,rhsDir:N,lhsInto:u,rhsInto:h,lhsGroup:a,rhsGroup:e,title:r}){if(!Re(P))throw new Error(`Invalid direction given for left hand side of edge ${x}--${A}. Expected (L,R,T,B) got ${String(P)}`);if(!Re(N))throw new Error(`Invalid direction given for right hand side of edge ${x}--${A}. Expected (L,R,T,B) got ${String(N)}`);if(this.nodes[x]===void 0&&this.groups[x]===void 0)throw new Error(`The left-hand id [${x}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[A]===void 0&&this.groups[A]===void 0)throw new Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);const l=this.nodes[x].in,i=this.nodes[A].in;if(a&&l&&i&&l==i)throw new Error(`The left-hand id [${x}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(e&&l&&i&&l==i)throw new Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:x,lhsDir:P,lhsInto:u,lhsGroup:a,rhsId:A,rhsDir:N,rhsInto:h,rhsGroup:e,title:r};this.edges.push(g),this.nodes[x]&&this.nodes[A]&&(this.nodes[x].edges.push(this.edges[this.edges.length-1]),this.nodes[A].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const x={},A=Object.entries(this.nodes).reduce((e,[r,l])=>(e[r]=l.edges.reduce((i,g)=>{const t=this.getNode(g.lhsId)?.in,o=this.getNode(g.rhsId)?.in;if(t&&o&&t!==o){const s=Mr(g.lhsDir,g.rhsDir);s!=="bend"&&(x[t]??={},x[t][o]=s,x[o]??={},x[o][t]=s)}if(g.lhsId===r){const s=ye(g.lhsDir,g.rhsDir);s&&(i[s]=g.rhsId)}else{const s=ye(g.rhsDir,g.lhsDir);s&&(i[s]=g.lhsId)}return i},{}),e),{}),P=Object.keys(A)[0],N={[P]:1},u=Object.keys(A).reduce((e,r)=>r===P?e:{...e,[r]:1},{}),h=dt(e=>{const r={[e]:[0,0]},l=[e];for(;l.length>0;){const i=l.shift();if(i){N[i]=1,delete u[i];const g=A[i],[t,o]=r[i];Object.entries(g).forEach(([s,c])=>{N[c]||(r[c]=Cr([t,o],s),l.push(c))})}}return r},"BFS"),a=[h(P)];for(;Object.keys(u).length>0;)a.push(h(Object.keys(u)[0]));this.dataStructures={adjList:A,spatialMaps:a,groupAlignments:x}}return this.dataStructures}setElementForId(x,A){this.elements[x]=A}getElementById(x){return this.elements[x]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(x){return this.getConfig()[x]}},dt(ae,"ArchitectureDB"),ae),xr=dt((I,x)=>{fr(I,x),I.groups.map(A=>x.addGroup(A)),I.services.map(A=>x.addService({...A,type:"service"})),I.junctions.map(A=>x.addJunction({...A,type:"junction"})),I.edges.map(A=>x.addEdge(A))},"populateDb"),Ge={parser:{yy:void 0},parse:dt(async I=>{const x=await cr("architecture",I);Se.debug(x);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(x,A)},"parse")},Ir=dt(I=>` + .edge { + stroke-width: ${I.archEdgeWidth}; + stroke: ${I.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${I.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${I.archGroupBorderColor}; + stroke-width: ${I.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),Rr=Ir,re=dt(I=>`${I}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:lr,blank:{body:re("")}}},Sr=dt(async function(I,x,A){const P=A.getConfigField("padding"),N=A.getConfigField("iconSize"),u=N/2,h=N/6,a=h/2;await Promise.all(x.edges().map(async e=>{const{source:r,sourceDir:l,sourceArrow:i,sourceGroup:g,target:t,targetDir:o,targetArrow:s,targetGroup:c,label:f}=be(e);let{x:T,y:d}=e[0].sourceEndpoint();const{x:v,y:L}=e[0].midpoint();let{x:b,y:C}=e[0].targetEndpoint();const G=P+4;if(g&&(Wt(l)?T+=l==="L"?-G:G:d+=l==="T"?-G:G+18),c&&(Wt(o)?b+=o==="L"?-G:G:C+=o==="T"?-G:G+18),!g&&A.getNode(r)?.type==="junction"&&(Wt(l)?T+=l==="L"?u:-u:d+=l==="T"?u:-u),!c&&A.getNode(t)?.type==="junction"&&(Wt(o)?b+=o==="L"?u:-u:C+=o==="T"?u:-u),e[0]._private.rscratch){const k=I.insert("g");if(k.insert("path").attr("d",`M ${T},${d} L ${v},${L} L${b},${C} `).attr("class","edge").attr("id",sr(r,t,{prefix:"L"})),i){const Y=Wt(l)?se[l](T,h):T-a,K=qt(l)?se[l](d,h):d-a;k.insert("polygon").attr("points",Ie[l](h)).attr("transform",`translate(${Y},${K})`).attr("class","arrow")}if(s){const Y=Wt(o)?se[o](b,h):b-a,K=qt(o)?se[o](C,h):C-a;k.insert("polygon").attr("points",Ie[o](h)).attr("transform",`translate(${Y},${K})`).attr("class","arrow")}if(f){const Y=Te(l,o)?"XY":Wt(l)?"X":"Y";let K=0;Y==="X"?K=Math.abs(T-b):Y==="Y"?K=Math.abs(d-C)/1.5:K=Math.abs(T-b)/2;const O=k.append("g");if(await me(O,f,{useHtmlLabels:!1,width:K,classes:"architecture-service-label"},Ee()),O.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Y==="X")O.attr("transform","translate("+v+", "+L+")");else if(Y==="Y")O.attr("transform","translate("+v+", "+L+") rotate(-90)");else if(Y==="XY"){const it=ye(l,o);if(it&&Nr(it)){const n=O.node().getBoundingClientRect(),[m,p]=Ar(it);O.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*p*45})`);const E=O.node().getBoundingClientRect();O.attr("transform",` + translate(${v}, ${L-n.height/2}) + translate(${m*E.width/2}, ${p*E.height/2}) + rotate(${-1*m*p*45}, 0, ${n.height/2}) + `)}}}}}))},"drawEdges"),Fr=dt(async function(I,x,A){const N=A.getConfigField("padding")*.75,u=A.getConfigField("fontSize"),a=A.getConfigField("iconSize")/2;await Promise.all(x.nodes().map(async e=>{const r=ie(e);if(r.type==="group"){const{h:l,w:i,x1:g,y1:t}=e.boundingBox(),o=I.append("rect");o.attr("id",`group-${r.id}`).attr("x",g+a).attr("y",t+a).attr("width",i).attr("height",l).attr("class","node-bkg");const s=I.append("g");let c=g,f=t;if(r.icon){const T=s.append("g");T.html(`${await pe(r.icon,{height:N,width:N,fallbackPrefix:ne.prefix})}`),T.attr("transform","translate("+(c+a+1)+", "+(f+a+1)+")"),c+=N,f+=u/2-1-2}if(r.label){const T=s.append("g");await me(T,r.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},Ee()),T.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),T.attr("transform","translate("+(c+a+4)+", "+(f+a+2)+")")}A.setElementForId(r.id,o)}}))},"drawGroups"),br=dt(async function(I,x,A){const P=Ee();for(const N of A){const u=x.append("g"),h=I.getConfigField("iconSize");if(N.title){const l=u.append("g");await me(l,N.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},P),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),l.attr("transform","translate("+h/2+", "+h+")")}const a=u.append("g");if(N.icon)a.html(`${await pe(N.icon,{height:h,width:h,fallbackPrefix:ne.prefix})}`);else if(N.iconText){a.html(`${await pe("blank",{height:h,width:h,fallbackPrefix:ne.prefix})}`);const g=a.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(nr(N.iconText,P)),t=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/t)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+N.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);u.attr("id",`service-${N.id}`).attr("class","architecture-service");const{width:e,height:r}=u.node().getBBox();N.width=e,N.height=r,I.setElementForId(N.id,u)}return 0},"drawServices"),Pr=dt(function(I,x,A){A.forEach(P=>{const N=x.append("g"),u=I.getConfigField("iconSize");N.append("g").append("rect").attr("id","node-"+P.id).attr("fill-opacity","0").attr("width",u).attr("height",u),N.attr("class","architecture-junction");const{width:a,height:e}=N._groups[0][0].getBBox();N.width=a,N.height=e,I.setElementForId(P.id,N)})},"drawJunctions");hr([{name:ne.prefix,icons:ne}]);Fe.use(mr);function Ue(I,x,A){I.forEach(P=>{x.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}dt(Ue,"addServices");function Ye(I,x,A){I.forEach(P=>{x.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}dt(Ye,"addJunctions");function Xe(I,x){x.nodes().map(A=>{const P=ie(A);if(P.type==="group")return;P.x=A.position().x,P.y=A.position().y,I.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")")})}dt(Xe,"positionNodes");function He(I,x){I.forEach(A=>{x.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}dt(He,"addGroups");function We(I,x){I.forEach(A=>{const{lhsId:P,rhsId:N,lhsInto:u,lhsGroup:h,rhsInto:a,lhsDir:e,rhsDir:r,rhsGroup:l,title:i}=A,g=Te(A.lhsDir,A.rhsDir)?"segments":"straight",t={id:`${P}-${N}`,label:i,source:P,sourceDir:e,sourceArrow:u,sourceGroup:h,sourceEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%",target:N,targetDir:r,targetArrow:a,targetGroup:l,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};x.add({group:"edges",data:t,classes:g})})}dt(We,"addEdges");function Ve(I,x,A){const P=dt((a,e)=>Object.entries(a).reduce((r,[l,i])=>{let g=0;const t=Object.entries(i);if(t.length===1)return r[l]=t[0][1],r;for(let o=0;o{const e={},r={};return Object.entries(a).forEach(([l,[i,g]])=>{const t=I.getNode(l)?.in??"default";e[g]??={},e[g][t]??=[],e[g][t].push(l),r[i]??={},r[i][t]??=[],r[i][t].push(l)}),{horiz:Object.values(P(e,"horizontal")).filter(l=>l.length>1),vert:Object.values(P(r,"vertical")).filter(l=>l.length>1)}}),[u,h]=N.reduce(([a,e],{horiz:r,vert:l})=>[[...a,...r],[...e,...l]],[[],[]]);return{horizontal:u,vertical:h}}dt(Ve,"getAlignments");function ze(I,x){const A=[],P=dt(u=>`${u[0]},${u[1]}`,"posToStr"),N=dt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return I.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([l,i])=>[P(i),l])),a=[P([0,0])],e={},r={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){const l=a.shift();if(l){e[l]=1;const i=h[l];if(i){const g=N(l);Object.entries(r).forEach(([t,o])=>{const s=P([g[0]+o[0],g[1]+o[1]]),c=h[s];c&&!e[s]&&(a.push(s),A.push({[xe[t]]:c,[xe[Tr(t)]]:i,gap:1.5*x.getConfigField("iconSize")}))})}}}}),A}dt(ze,"getRelativeConstraints");function Be(I,x,A,P,N,{spatialMaps:u,groupAlignments:h}){return new Promise(a=>{const e=or("body").append("div").attr("id","cy").attr("style","display:none"),r=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});e.remove(),He(A,r),Ue(I,r,N),Ye(x,r,N),We(P,r);const l=Ve(N,u,h),i=ze(u,N),g=r.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?1.5*N.getConfigField("iconSize"):.5*N.getConfigField("iconSize")},edgeElasticity(t){const[o,s]=t.connectedNodes(),{parent:c}=ie(o),{parent:f}=ie(s);return c===f?.45:.001},alignmentConstraint:l,relativePlacementConstraint:i});g.one("layoutstop",()=>{function t(o,s,c,f){let T,d;const{x:v,y:L}=o,{x:b,y:C}=s;d=(f-L+(v-c)*(L-C)/(v-b))/Math.sqrt(1+Math.pow((L-C)/(v-b),2)),T=Math.sqrt(Math.pow(f-L,2)+Math.pow(c-v,2)-Math.pow(d,2));const G=Math.sqrt(Math.pow(b-v,2)+Math.pow(C-L,2));T=T/G;let k=(b-v)*(f-L)-(C-L)*(c-v);switch(!0){case k>=0:k=1;break;case k<0:k=-1;break}let Y=(b-v)*(c-v)+(C-L)*(f-L);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}return d=Math.abs(d)*k,T=T*Y,{distances:d,weights:T}}dt(t,"getSegmentWeights"),r.startBatch();for(const o of Object.values(r.edges()))if(o.data?.()){const{x:s,y:c}=o.source().position(),{x:f,y:T}=o.target().position();if(s!==f&&c!==T){const d=o.sourceEndpoint(),v=o.targetEndpoint(),{sourceDir:L}=be(o),[b,C]=qt(L)?[d.x,v.y]:[v.x,d.y],{weights:G,distances:k}=t(d,v,b,C);o.style("segment-distances",k),o.style("segment-weights",G)}}r.endBatch(),g.run()}),g.run(),r.ready(t=>{Se.info("Ready",t),a(r)})})}dt(Be,"layoutArchitecture");var Gr=dt(async(I,x,A,P)=>{const N=P.db,u=N.getServices(),h=N.getJunctions(),a=N.getGroups(),e=N.getEdges(),r=N.getDataStructures(),l=ke(x),i=l.append("g");i.attr("class","architecture-edges");const g=l.append("g");g.attr("class","architecture-services");const t=l.append("g");t.attr("class","architecture-groups"),await br(N,g,u),Pr(N,g,h);const o=await Be(u,h,a,e,N,r);await Sr(i,o,N),await Fr(t,o,N),Xe(N,o),qe(void 0,l,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Ur={draw:Gr},qr={parser:Ge,get db(){return new Pe},renderer:Ur,styles:Rr};export{qr as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js new file mode 100644 index 0000000000..29d7c86c6a --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BJzDjplU.js @@ -0,0 +1 @@ +import{s,t as r}from"./index-DpOBiJiD.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js deleted file mode 100644 index 023e09cb93..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BfGlL8rp.js +++ /dev/null @@ -1 +0,0 @@ -import{bu as s,bv as r}from"./index-BZLU40Mk.js";const i=s(r(t=>({user:null,isAuthenticated:!1,hasHydrated:!1,login:e=>t(a=>{a.user=e,a.isAuthenticated=!0}),logout:()=>t(e=>{e.user=null,e.isAuthenticated=!1}),setHydrated:()=>t(e=>{e.hasHydrated=!0})})));export{i as a}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js new file mode 100644 index 0000000000..e69f24a858 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/blockDiagram-VD42YOAC-U9iGLyTC.js @@ -0,0 +1,122 @@ +import{g as oe}from"./chunk-FMBD7UC4-fSM8np9_.js";import{_ as d,a5 as rt,B as O,G as he,E as L,$ as de,a1 as ge,z as R,aS as ue,ai as pe,aj as fe,af as xe,aT as j,aU as Wt,aV as ye,T as $,O as be,aW as we,aX as xt,L as yt,aY as me}from"./index-DpOBiJiD.js";import{c as Le}from"./clone-CQ2NOoIB.js";import{G as Se}from"./graph-C2pZo5Z6.js";import{c as ke}from"./channel-D6izjHHp.js";import"./forEach-CTOHlvm6.js";import"./isUndefined-B80uo2Th.js";import"./union-CR4sFk7V.js";var bt=(function(){var e=d(function(D,y,g,f){for(g=g||{},f=D.length;f--;g[D[f]]=y);return g},"o"),t=[1,15],a=[1,7],i=[1,13],l=[1,14],s=[1,19],r=[1,16],n=[1,17],c=[1,18],u=[8,30],o=[8,10,21,28,29,30,31,39,43,46],x=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],k={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(y,g,f,m,E,h,W){var p=h.length-1;switch(E){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",h[p-1]),m.setHierarchy(h[p-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:m.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:m.getLogger().debug("Rule: link: ",h[p],y),this.$={edgeTypeStr:h[p],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const I=parseInt(h[p]),Z=m.generateId();this.$={id:Z,type:"space",label:"",width:I,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const V=m.edgeStrToEdgeData(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",directions:h[p].directions,arrowTypeEnd:V,arrowTypeStart:"arrow_open"},{id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:m.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),m.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const at=m.generateId();this.$={id:at,type:"composite",label:"",children:h[p-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:m.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:i,29:l,31:s,39:r,43:n,46:c}),e(o,[2,16],{14:22,15:x,16:w}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(b,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:s},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:x,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(y,g){if(g.recoverable)this.trace(y);else{var f=new Error(y);throw f.hash=g,f}},"parseError"),parse:d(function(y){var g=this,f=[0],m=[],E=[null],h=[],W=this.table,p="",I=0,Z=0,V=2,at=1,ne=h.slice.call(arguments,1),z=Object.create(this.lexer),q={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(q.yy[gt]=this.yy[gt]);z.setInput(y,q.yy),q.yy.lexer=z,q.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var ut=z.yylloc;h.push(ut);var le=z.options&&z.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(P){f.length=f.length-2*P,E.length=E.length-P,h.length=h.length-P}d(ce,"popStack");function Tt(){var P;return P=m.pop()||z.lex()||at,typeof P!="number"&&(P instanceof Array&&(m=P,P=m.pop()),P=g.symbols_[P]||P),P}d(Tt,"lex");for(var F,J,H,pt,Q={},st,G,Nt,it;;){if(J=f[f.length-1],this.defaultActions[J]?H=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=Tt()),H=W[J]&&W[J][F]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in W[J])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");z.showPosition?ft="Parse error on line "+(I+1)+`: +`+z.showPosition()+` +Expecting `+it.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ft="Parse error on line "+(I+1)+": Unexpected "+(F==at?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ft,{text:z.match,token:this.terminals_[F]||F,line:z.yylineno,loc:ut,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:f.push(F),E.push(z.yytext),h.push(z.yylloc),f.push(H[1]),F=null,Z=z.yyleng,p=z.yytext,I=z.yylineno,ut=z.yylloc;break;case 2:if(G=this.productions_[H[1]][1],Q.$=E[E.length-G],Q._$={first_line:h[h.length-(G||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(G||1)].first_column,last_column:h[h.length-1].last_column},le&&(Q._$.range=[h[h.length-(G||1)].range[0],h[h.length-1].range[1]]),pt=this.performAction.apply(Q,[p,Z,I,q.yy,H[1],E,h].concat(ne)),typeof pt<"u")return pt;G&&(f=f.slice(0,-1*G*2),E=E.slice(0,-1*G),h=h.slice(0,-1*G)),f.push(this.productions_[H[1]][0]),E.push(Q.$),h.push(Q._$),Nt=W[f[f.length-2]][f[f.length-1]],f.push(Nt);break;case 3:return!0}}return!0},"parse")},B=(function(){var D={EOF:1,parseError:d(function(g,f){if(this.yy.parser)this.yy.parser.parseError(g,f);else throw new Error(g)},"parseError"),setInput:d(function(y,g){return this.yy=g||this.yy||{},this._input=y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var g=y.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:d(function(y){var g=y.length,f=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(y){this.unput(this.match.slice(y))},"less"),pastInput:d(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var y=this.pastInput(),g=new Array(y.length+1).join("-");return y+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:d(function(y,g){var f,m,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),m=y[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(y[0].length),this.matched+=y[0],f=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,g,f,m;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;hg[0].length)){if(g=f,m=h,this.options.backtrack_lexer){if(y=this.test_match(f,E[h]),y!==!1)return y;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(y=this.test_match(g,E[m]),y!==!1?y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(g,f,m,E){switch(m){case 0:return g.getLogger().debug("Found block-beta"),10;case 1:return g.getLogger().debug("Found id-block"),29;case 2:return g.getLogger().debug("Found block"),10;case 3:g.getLogger().debug(".",f.yytext);break;case 4:g.getLogger().debug("_",f.yytext);break;case 5:return 5;case 6:return f.yytext=-1,28;case 7:return f.yytext=f.yytext.replace(/columns\s+/,""),g.getLogger().debug("COLUMNS (LEX)",f.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:g.getLogger().debug("LEX: POPPING STR:",f.yytext),this.popState();break;case 13:return g.getLogger().debug("LEX: STR end:",f.yytext),"STR";case 14:return f.yytext=f.yytext.replace(/space\:/,""),g.getLogger().debug("SPACE NUM (LEX)",f.yytext),21;case 15:return f.yytext="1",g.getLogger().debug("COLUMNS (LEX)",f.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),g.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),g.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),g.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),g.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),g.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),g.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),g.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),g.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),g.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),g.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return g.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return g.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return g.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return g.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return g.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return g.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return g.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),g.getLogger().debug("LEX ARR START"),37;case 74:return g.getLogger().debug("Lex: NODE_ID",f.yytext),31;case 75:return g.getLogger().debug("Lex: EOF",f.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:g.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:g.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return g.getLogger().debug("LEX: NODE_DESCR:",f.yytext),"NODE_DESCR";case 83:g.getLogger().debug("LEX POPPING"),this.popState();break;case 84:g.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (right): dir:",f.yytext),"DIR";case 86:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (left):",f.yytext),"DIR";case 87:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (x):",f.yytext),"DIR";case 88:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (y):",f.yytext),"DIR";case 89:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (up):",f.yytext),"DIR";case 90:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (down):",f.yytext),"DIR";case 91:return f.yytext="]>",g.getLogger().debug("Lex (ARROW_DIR end):",f.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 93:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 94:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 95:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 96:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 97:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 98:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return g.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 102:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 103:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 104:return g.getLogger().debug("Lex: COLON",f.yytext),f.yytext=f.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D})();k.lexer=B;function _(){this.yy={}}return d(_,"Parser"),_.prototype=k,k.Parser=_,new _})();bt.parser=bt;var ve=bt,X=new Map,kt=[],wt=new Map,Bt="color",Ct="fill",Ee="bgFill",Pt=",",_e=R(),ct=new Map,De=d(e=>be.sanitizeText(e,_e),"sanitizeText"),Te=d(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Pt).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Bt).exec(i)){const r=l.replace(Ct,Ee).replace(Bt,Ct);a.textStyles.push(r)}a.styles.push(l)})},"addStyleClass"),Ne=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Pt))},"addStyle2Node"),Be=d(function(e,t){e.split(",").forEach(function(a){let i=X.get(a);if(i===void 0){const l=a.trim();i={id:l,type:"na",children:[]},X.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=d((e,t)=>{const a=e.flat(),i=[],s=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof s=="number"&&s>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>s&&L.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`),r.label&&(r.label=De(r.label)),r.type==="classDef"){Te(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&Ne(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const c=r.width??1;for(let u=0;u{L.debug("Clear called"),de(),et={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",et]]),vt=[],ct=new Map,kt=[],wt=new Map},"clear");function Ht(e){switch(L.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return L.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}d(Ht,"typeStr2Type");function Kt(e){return L.debug("typeStr2Type",e),e==="=="?"thick":"normal"}d(Kt,"edgeTypeStr2Type");function Xt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Xt,"edgeStrToEdgeData");var It=0,Ie=d(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Oe=d(e=>{et.children=e,Yt(e,et),vt=et.children},"setHierarchy"),Re=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=d(()=>[...X.values()],"getBlocksFlat"),Ae=d(()=>vt||[],"getBlocks"),Me=d(()=>kt,"getEdges"),Fe=d(e=>X.get(e),"getBlock"),We=d(e=>{X.set(e.id,e)},"setBlock"),Pe=d(()=>L,"getLogger"),Ye=d(function(){return ct},"getClasses"),He={getConfig:d(()=>rt().block,"getConfig"),typeStr2Type:Ht,edgeTypeStr2Type:Kt,edgeStrToEdgeData:Xt,getLogger:Pe,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Oe,getBlock:Fe,setBlock:We,getColumns:Re,getClasses:Ye,clear:Ce,generateId:Ie},Ke=He,nt=d((e,t)=>{const a=ke,i=a(e,"r"),l=a(e,"g"),s=a(e,"b");return ge(i,l,s,t)},"fade"),Xe=d(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${nt(e.edgeLabelBackground,.5)}; + // background-color: + } + + .node .cluster { + // fill: ${nt(e.mainBkg,.5)}; + fill: ${nt(e.clusterBkg,.5)}; + stroke: ${nt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${oe()} +`,"getStyles"),Ue=Xe,je=d((e,t,a,i)=>{t.forEach(l=>{rr[l](e,a,i)})},"insertMarkers"),Ve=d((e,t,a)=>{L.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ge=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ze=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),qe=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Je=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),$e=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),tr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),er=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),rr={extension:Ve,composition:Ge,aggregation:Ze,dependency:qe,lollipop:Je,point:Qe,circle:$e,cross:tr,barb:er},ar=je,C=R()?.block?.padding??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,i=Math.floor(t/e);return{px:a,py:i}}d(Ut,"calculateBlockPosition");var sr=d(e=>{let t=0,a=0;for(const i of e.children){const{width:l,height:s,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};L.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",s,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),s>a&&(a=s))}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,i=0){L.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:i,x:0,y:0});let l=0,s=0;if(e.children?.length>0){for(const b of e.children)ot(b,t);const r=sr(e);l=r.width,s=r.height,L.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,s);for(const b of e.children)b.size&&(L.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${s} ${JSON.stringify(b.size)}`),b.size.width=l*(b.widthInColumns??1)+C*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,L.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${s}`));for(const b of e.children)ot(b,t,l,s);const n=e.columns??-1;let c=0;for(const b of e.children)c+=b.widthInColumns??1;let u=e.children.length;n>0&&n0?Math.min(e.children.length,n):e.children.length;if(b>0){const S=(x-b*C-C)/b;L.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,S);for(const v of e.children)v.size&&(v.size.width=S)}}e.size={width:x,height:w,x:0,y:0}}L.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Et(e,t){L.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(L.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,l=e.children.length*i+(e.children.length-1)*C;L.debug("widthOfChildren 88",l,"posX");let s=0;L.debug("abc91 block?.size?.x",e.id,e?.size?.x);let r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,n=0;for(const c of e.children){const u=e;if(!c.size)continue;const{width:o,height:x}=c.size,{px:w,py:b}=Ut(a,s);if(b!=n&&(n=b,r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,L.debug("New row in layout for block",e.id," and child ",c.id,n)),L.debug(`abc89 layout blocks (child) id: ${c.id} Pos: ${s} (px, py) ${w},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${o}${C}`),u.size){const v=o/2;c.size.x=r+C+v,L.debug(`abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${r} new startingPosX${c.size.x} ${v} padding=${C} width=${o} halfWidth=${v} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(c?.widthInColumns??1)/2}`),r=c.size.x+v,c.size.y=u.size.y-u.size.height/2+b*(x+C)+x/2+C,L.debug(`abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${r}${C}${v}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${o*(c?.widthInColumns??1)/2}`)}c.children&&Et(c);let S=c?.widthInColumns??1;a>0&&(S=Math.min(S,a-s%a)),s+=S,L.debug("abc88 columnsPos",c,s)}}L.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Et,"layoutBlocks");function _t(e,{minX:t,minY:a,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:s,y:r,width:n,height:c}=e.size;s-n/2i&&(i=s+n/2),r+c/2>l&&(l=r+c/2)}if(e.children)for(const s of e.children)({minX:t,minY:a,maxX:i,maxY:l}=_t(s,{minX:t,minY:a,maxX:i,maxY:l}));return{minX:t,minY:a,maxX:i,maxY:l}}d(_t,"findBounds");function jt(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Et(t),L.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:i,maxX:l,maxY:s}=_t(t),r=s-i,n=l-a;return{x:a,y:i,width:n,height:r}}d(jt,"layout");function mt(e,t){t&&e.attr("style",t)}d(mt,"applyStyle");function Vt(e,t){const a=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=a.append("xhtml:div"),l=e.label,s=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(yt(l,t)),mt(r,e.labelStyle),r.attr("class",s),mt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}d(Vt,"addHtmlLabel");var ir=d(async(e,t,a,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const s=R();if(j(s.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"
"),L.debug("vertexText"+l);const r=await we(xt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Vt(n,s)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|/gi):Array.isArray(l)?n=l:n=[];for(const c of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),a?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=c.trim(),r.appendChild(u)}return r}},"createLabel"),K=ir,nr=d((e,t,a,i,l)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,a,i,l)},"addEdgeMarkers"),lr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=d((e,t,a,i,l,s)=>{const r=lr[a];if(!r){L.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${s}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},cr=d(async(e,t)=>{const a=R(),i=j(a.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},a):await K(t.label,t.labelStyle),s=e.insert("g").attr("class","edgeLabel"),r=s.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],o=O(l);n=u.getBoundingClientRect(),o.attr("width",n.width),o.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=s,t.width=n.width,t.height=n.height;let c;if(t.startLabelLeft){const u=await K(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startLeft=o,tt(c,t.startLabelLeft)}if(t.startLabelRight){const u=await K(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=o.node().appendChild(u),x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startRight=o,tt(c,t.startLabelRight)}if(t.endLabelLeft){const u=await K(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endLeft=o,tt(c,t.endLabelLeft)}if(t.endLabelRight){const u=await K(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endRight=o,tt(c,t.endLabelRight)}return l},"insertEdgeLabel");function tt(e,t){R().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(tt,"setTerminalWidth");var or=d((e,t)=>{L.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=R(),{subGraphTitleTotalMargin:l}=ye(i);if(e.label){const s=Lt[e.id];let r=e.x,n=e.y;if(a){const c=$.calcLabelPosition(a);L.debug("Moving label "+e.label+" from (",r,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(r=c.x,n=c.y)}s.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const s=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const s=M[e.id].startRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const s=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const s=M[e.id].endRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=d((e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),s=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||s>=n},"outsideNode"),dr=d((e,t,a)=>{L.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,s=Math.abs(i-a.x),r=e.width/2;let n=a.xMath.abs(i-t.x)*c){let x=a.y{L.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],l=!1;return e.forEach(s=>{if(!hr(t,s)&&!l){const r=dr(t,i,s);let n=!1;a.forEach(c=>{n=n||c.x===r.x&&c.y===r.y}),a.some(c=>c.x===r.x&&c.y===r.y)||a.push(r),l=!0}else i=s,l||a.push(s)}),a},"cutPathAtIntersect"),gr=d(function(e,t,a,i,l,s,r){let n=a.points;L.debug("abc88 InsertEdge: edge=",a,"e=",t);let c=!1;const u=s.node(t.v);var o=s.node(t.w);o?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(L.debug("to cluster abc88",i[a.toCluster]),n=Rt(a.points,i[a.toCluster].node),c=!0),a.fromCluster&&(L.debug("from cluster abc88",i[a.fromCluster]),n=Rt(n.reverse(),i[a.fromCluster].node).reverse(),c=!0);const x=n.filter(y=>!Number.isNaN(y.y));let w=fe;a.curve&&(l==="graph"||l==="flowchart")&&(w=a.curve);const{x:b,y:S}=ue(a),v=pe().x(b).y(S).curve(w);let k;switch(a.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(a.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const B=e.append("path").attr("d",v(x)).attr("id",a.id).attr("class"," "+k+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=xe(!0)),nr(B,a,_,r,l);let D={};return c&&(D.updatedPath=n),D.originalPath=a.points,D},"insertEdge"),ur=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),pr=d((e,t,a)=>{const i=ur(e),l=2,s=t.height+2*a.padding,r=s/l,n=t.width+2*r+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*c},{x:n-r,y:0},{x:n,y:0},{x:n,y:-s/3},{x:n+2*c,y:-s/2},{x:n,y:-2*s/3},{x:n,y:-s},{x:n-r,y:-s},{x:n/2,y:-s-2*c},{x:r,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*c,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-s},{x:n-r,y:-s},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-s+r},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-s+r},{x:n,y:-s}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-s}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-s}]:i.has("right")?[{x:r,y:-c},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s+c}]:i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}d(Gt,"intersectNode");var fr=Gt;function Zt(e,t,a,i){var l=e.x,s=e.y,r=l-i.x,n=s-i.y,c=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/c);i.x0}d(St,"sameSign");var yr=Qt,br=$t;function $t(e,t,a){var i=e.x,l=e.y,s=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(S){r=Math.min(r,S.x),n=Math.min(n,S.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-r,u=l-e.height/2-n,o=0;o1&&s.sort(function(S,v){var k=S.x-a.x,B=S.y-a.y,_=Math.sqrt(k*k+B*B),D=v.x-a.x,y=v.y-a.y,g=Math.sqrt(D*D+y*y);return _{var a=e.x,i=e.y,l=t.x-a,s=t.y-i,r=e.width/2,n=e.height/2,c,u;return Math.abs(s)*r>Math.abs(l)*n?(s<0&&(n=-n),c=s===0?0:n*l/s,u=n):(l<0&&(r=-r),c=r,u=l===0?0:r*s/l),{x:a+c,y:i+u}},"intersectRect"),mr=wr,T={node:fr,circle:xr,ellipse:qt,polygon:br,rect:mr},A=d(async(e,t,a,i)=>{const l=R();let s;const r=t.useHtmlLabels||j(l.flowchart.htmlLabels);a?s=a:s="node default";const n=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=c.node();let x;t.labelType==="markdown"?x=Wt(c,yt(xt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):x=o.appendChild(await K(yt(xt(u),l),t.labelStyle,!1,i));let w=x.getBBox();const b=t.padding/2;if(j(l.flowchart.htmlLabels)){const S=x.children[0],v=O(x),k=S.getElementsByTagName("img");if(k){const B=u.replace(/]*>/g,"").trim()==="";await Promise.all([...k].map(_=>new Promise(D=>{function y(){if(_.style.display="flex",_.style.flexDirection="column",B){const g=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,m=parseInt(g,10)*5+"px";_.style.minWidth=m,_.style.maxWidth=m}else _.style.width="100%";D(_)}d(y,"setupImage"),setTimeout(()=>{_.complete&&y()}),_.addEventListener("error",y),_.addEventListener("load",y)})))}w=S.getBoundingClientRect(),v.attr("width",w.width),v.attr("height",w.height)}return r?c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"):c.attr("transform","translate(0, "+-w.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:n,bbox:w,halfPadding:b,label:c}},"labelHelper"),N=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function U(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(U,"insertPolygonShape");var Lr=d(async(e,t)=>{t.useHtmlLabels||R().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:s}=await A(e,t,"node "+t.classes,!0);L.info("Classes = ",t.classes);const r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-s).attr("y",-l.height/2-s).attr("width",l.width+t.padding).attr("height",l.height+t.padding),N(t,r),t.intersect=function(n){return T.rect(t,n)},i},"note"),Sr=Lr,zt=d(e=>e?" "+e:"","formatClass"),Y=d((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),At=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=l+s,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];L.info("Question main (Circle)");const c=U(a,r,r,n);return c.attr("style",t.style),N(t,c),t.intersect=function(u){return L.warn("Intersect called"),T.polygon(t,n,u)},a},"question"),kr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return T.circle(t,14,r)},a},"choice"),vr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=4,s=i.height+t.padding,r=s/l,n=i.width+2*r+t.padding,c=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}],u=U(a,n,s,c);return u.attr("style",t.style),N(t,u),t.intersect=function(o){return T.polygon(t,c,o)},a},"hexagon"),Er=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,void 0,!0),l=2,s=i.height+2*t.padding,r=s/l,n=i.width+2*r+t.padding,c=pr(t.directions,i,t),u=U(a,n,s,c);return u.attr("style",t.style),N(t,u),t.intersect=function(o){return T.polygon(t,c,o)},a},"block_arrow"),_r=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-s/2,y:0},{x:l,y:0},{x:l,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return U(a,l,s,r).attr("style",t.style),t.width=l+s,t.height=s,t.intersect=function(c){return T.polygon(t,r,c)},a},"rect_left_inv_arrow"),Dr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"lean_right"),Tr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:2*s/6,y:0},{x:l+s/6,y:0},{x:l-2*s/6,y:-s},{x:-s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"lean_left"),Nr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l+2*s/6,y:0},{x:l-s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"trapezoid"),Br=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:-2*s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"inv_trapezoid"),Cr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l+s/2,y:0},{x:l,y:-s/2},{x:l+s/2,y:-s},{x:0,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"rect_right_inv_arrow"),Ir=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=l/2,r=s/(2.5+l/50),n=i.height+r+t.padding,c="M 0,"+r+" a "+s+","+r+" 0,0,0 "+l+" 0 a "+s+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+s+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return N(t,u),t.intersect=function(o){const x=T.rect(t,o),w=x.x-t.x;if(s!=0&&(Math.abs(w)t.height/2-r)){let b=r*r*(1-w*w/(s*s));b!=0&&(b=Math.sqrt(b)),b=r-b,o.y-t.y>0&&(b=-b),x.y+=b}return x},a},"cylinder"),Or=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes+" "+t.class,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return N(t,s),t.intersect=function(o){return T.rect(t,o)},a},"rect"),Rr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return N(t,s),t.intersect=function(o){return T.rect(t,o)},a},"composite"),zr=d(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);L.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,s=0;if(i.attr("width",l).attr("height",s),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(i,t.props.borders,l,s),r.delete("borders")),r.forEach(n=>{L.warn(`Unknown node property ${n}`)})}return N(t,i),t.intersect=function(r){return T.rect(t,r)},a},"labelRect");function ht(e,t,a,i){const l=[],s=d(n=>{l.push(n,0)},"addBorder"),r=d(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(L.debug("add top border"),s(a)):r(a),t.includes("r")?(L.debug("add right border"),s(i)):r(i),t.includes("b")?(L.debug("add bottom border"),s(a)):r(a),t.includes("l")?(L.debug("add left border"),s(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}d(ht,"applyNodePropertyBorders");var Ar=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),s=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,L.info("Label text abc79",c,n,typeof n=="object");const u=r.node().appendChild(await K(c,t.labelStyle,!0,!0));let o={width:0,height:0};if(j(R().flowchart.htmlLabels)){const v=u.children[0],k=O(u);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}L.info("Text 2",n);const x=n.slice(1,n.length);let w=u.getBBox();const b=r.node().appendChild(await K(x.join?x.join("
"):x,t.labelStyle,!0,!0));if(j(R().flowchart.htmlLabels)){const v=b.children[0],k=O(b);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}const S=t.padding/2;return O(b).attr("transform","translate( "+(o.width>w.width?0:(w.width-o.width)/2)+", "+(w.height+S+5)+")"),O(u).attr("transform","translate( "+(o.width{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.height+t.padding,s=i.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l);return N(t,r),t.intersect=function(n){return T.rect(t,n)},a},"stadium"),Fr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=a.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("Circle main"),N(t,s),t.intersect=function(r){return L.info("Circle intersect",t,i.width/2+l,r),T.circle(t,i.width/2+l,r)},a},"circle"),Wr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=5,r=a.insert("g",":first-child"),n=r.insert("circle"),c=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+s).attr("width",i.width+t.padding+s*2).attr("height",i.height+t.padding+s*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("DoubleCircle main"),N(t,n),t.intersect=function(u){return L.info("DoubleCircle intersect",t,i.width/2+l+s,u),T.circle(t,i.width/2+l+s,u)},a},"doublecircle"),Pr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],n=U(a,l,s,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return T.polygon(t,r,c)},a},"subroutine"),Yr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,i),t.intersect=function(l){return T.circle(t,7,l)},a},"start"),Mt=d((e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,s=10;a==="LR"&&(l=10,s=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*s/2).attr("width",l).attr("height",s).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return T.rect(t,n)},i},"forkJoin"),Hr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,l),t.intersect=function(s){return T.circle(t,7,s)},a},"end"),Kr=d(async(e,t)=>{const a=t.padding/2,i=4,l=8;let s;t.classes?s="node "+t.classes:s="node default";const r=e.insert("g").attr("class",s).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),c=r.insert("line"),u=r.insert("line");let o=0,x=i;const w=r.insert("g").attr("class","label");let b=0;const S=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",k=w.node().appendChild(await K(v,t.labelStyle,!0,!0));let B=k.getBBox();if(j(R().flowchart.htmlLabels)){const E=k.children[0],h=O(k);B=E.getBoundingClientRect(),h.attr("width",B.width),h.attr("height",B.height)}t.classData.annotations[0]&&(x+=B.height+i,o+=B.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R().flowchart.htmlLabels?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const D=w.node().appendChild(await K(_,t.labelStyle,!0,!0));O(D).attr("class","classTitle");let y=D.getBBox();if(j(R().flowchart.htmlLabels)){const E=D.children[0],h=O(D);y=E.getBoundingClientRect(),h.attr("width",y.width),h.attr("height",y.height)}x+=y.height+i,y.width>o&&(o=y.width);const g=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,g.push(p)}),x+=l;const f=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(//g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,f.push(p)}),x+=l,S){let E=(o-B.width)/2;O(k).attr("transform","translate( "+(-1*o/2+E)+", "+-1*x/2+")"),b=B.height+i}let m=(o-y.width)/2;return O(D).attr("transform","translate( "+(-1*o/2+m)+", "+(-1*x/2+b)+")"),b+=y.height+i,c.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,g.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b+l/2)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),b+=l,u.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,f.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(x/2)-a).attr("width",o+t.padding).attr("height",x+t.padding),N(t,n),t.intersect=function(E){return T.rect(t,E)},r},"class_box"),Ft={rhombus:At,composite:Rr,question:At,rect:Or,labelRect:zr,rectWithTitle:Ar,choice:kr,circle:Fr,doublecircle:Wr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:_r,lean_right:Dr,lean_left:Tr,trapezoid:Nr,inv_trapezoid:Br,rect_right_inv_arrow:Cr,cylinder:Ir,start:Yr,end:Hr,note:Sr,subroutine:Pr,fork:Mt,join:Mt,class_box:Kr},lt={},te=d(async(e,t,a)=>{let i,l;if(t.link){let s;R().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),l=await Ft[t.shape](i,t,a)}else l=await Ft[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Xr=d(e=>{const t=lt[e.id];L.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,a=!1){const i=e;let l="default";(i?.classes?.length||0)>0&&(l=(i?.classes??[]).join(" ")),l=l+" flowchart-label";let s=0,r="",n;switch(i.type){case"round":s=5,r="rect";break;case"composite":s=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const c=me(i?.styles??[]),u=i.label,o=i.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:r,labelText:u,rx:s,ry:s,class:l,style:c.style,id:i.id,directions:i.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:i.type,padding:n??rt()?.block?.padding??0}}d(Dt,"getNodeFromBlock");async function ee(e,t,a){const i=Dt(t,a,!1);if(i.type==="group")return;const l=rt(),s=await te(e,i,{config:l}),r=s.node().getBBox(),n=a.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:s},a.setBlock(n),s.remove()}d(ee,"calculateBlockSize");async function re(e,t,a){const i=Dt(t,a,!0);if(a.getBlock(i.id).type!=="space"){const s=rt();await te(e,i,{config:s}),t.intersect=i?.intersect,Xr(i)}}d(re,"insertBlockPositioned");async function dt(e,t,a,i){for(const l of t)await i(e,l,a),l.children&&await dt(e,l.children,a,i)}d(dt,"performOperations");async function ae(e,t,a){await dt(e,t,a,ee)}d(ae,"calculateBlockSizes");async function se(e,t,a){await dt(e,t,a,re)}d(se,"insertBlocks");async function ie(e,t,a,i,l){const s=new Se({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&s.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),c=i.getBlock(r.end);if(n?.size&&c?.size){const u=n.size,o=c.size,x=[{x:u.x,y:u.y},{x:u.x+(o.x-u.x)/2,y:u.y+(o.y-u.y)/2},{x:o.x,y:o.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,l),r.label&&(await cr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),or({...r,x:x[1].x,y:x[1].y},{originalPath:x}))}}}d(ie,"insertEdges");var Ur=d(function(e,t){return t.db.getClasses()},"getClasses"),jr=d(async function(e,t,a,i){const{securityLevel:l,block:s}=rt(),r=i.db;let n;l==="sandbox"&&(n=O("#i"+t));const c=l==="sandbox"?O(n.nodes()[0].contentDocument.body):O("body"),u=l==="sandbox"?c.select(`[id="${t}"]`):O(`[id="${t}"]`);ar(u,["point","circle","cross"],i.type,t);const x=r.getBlocks(),w=r.getBlocksFlat(),b=r.getEdges(),S=u.insert("g").attr("class","block");await ae(S,x,r);const v=jt(r);if(await se(S,x,r),await ie(S,b,w,r,t),v){const k=v,B=Math.max(1,Math.round(.125*(k.width/k.height))),_=k.height+B+10,D=k.width+10,{useMaxWidth:y}=s;he(u,_,D,!!y),L.debug("Here Bounds",v,k),u.attr("viewBox",`${k.x-5} ${k.y-5} ${k.width+10} ${k.height+10}`)}},"draw"),Vr={draw:jr,getClasses:Ur},ra={parser:ve,db:Ke,renderer:Vr,styles:Ue};export{ra as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js new file mode 100644 index 0000000000..379ca1429a --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/c4Diagram-YG6GDRKO-BaEi9NAL.js @@ -0,0 +1,10 @@ +import{g as Se,d as De}from"./chunk-TZMSLE5B-DMZmIkT7.js";import{_ as g,v as Pe,w as Be,x as Ie,y as Me,z as Bt,B as jt,E as de,G as Le,J as Ne,K as Tt,L as ge,M as Ye,N as je,O as $t,P as fe}from"./index-DpOBiJiD.js";var Ft=(function(){var e=g(function(_t,x,m,v){for(m=m||{},v=_t.length;v--;m[_t[v]]=x);return m},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],y=[1,68],p=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],rt=[1,47],st=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:g(function(x,m,v,b,R,h,Dt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Qt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:y,41:p,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:n,37:i,38:u,39:d,40:y,41:p,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Mt,[2,73]),{78:[1,133]},e(Mt,[2,75]),e(Mt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Qt,[2,18]),e(Ct,[2,38]),e(le,[2,72]),e(Mt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Ht,[2,25]),e(Ht,[2,26],{12:[1,138]}),e(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:g(function(x,m){if(m.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=m,v}},"parseError"),parse:g(function(x){var m=this,v=[0],b=[],R=[null],h=[],Dt=this.table,f="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}g(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=m.symbols_[L]||L),L}g(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=v[v.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`: +`+D.showPosition()+` +Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:v.push(I),R.push(D.yytext),h.push(D.yylloc),v.push(N[1]),I=null,oe=D.yyleng,f=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[f,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(v=v.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),v.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[v[v.length-2]][v[v.length-1]],v.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:g(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:g(function(x,m){return this.yy=m||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var m=x.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:g(function(x){var m=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===b.length?this.yylloc.first_column:0)+b[b.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(x){this.unput(this.match.slice(x))},"less"),pastInput:g(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var x=this.pastInput(),m=new Array(x.length+1).join("-");return x+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:g(function(x,m){var v,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,m,v,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hm[0].length)){if(m=v,b=h,this.options.backtrack_lexer){if(x=this.test_match(v,R[h]),x!==!1)return x;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(x=this.test_match(m,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var m=this.next();return m||this.lex()},"lex"),begin:g(function(m){this.conditionStack.push(m)},"begin"),popState:g(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:g(function(m){this.begin(m)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(m,v,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();qt.lexer=Ce;function Lt(){this.yy={}}return g(Lt,"Parser"),Lt.prototype=qt,qt.Parser=Lt,new Lt})();Ft.parser=Ft;var Ue=Ft,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],It=[],ie="",ne=!1,Vt=4,zt=2,be,Fe=g(function(){return be},"getC4Type"),Ve=g(function(e){be=ge(e,Bt())},"setC4Type"),ze=g(function(e,t,s,o,l,a,r,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=It.find(y=>y.from===t&&y.to===s);if(d?u=d:It.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[y,p]=Object.entries(l)[0];u[y]={text:p}}else u.techn={text:l};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[y,p]=Object.entries(a)[0];u[y]={text:p}}else u.descr={text:a};if(typeof r=="object"){let[y,p]=Object.entries(r)[0];u[y]=p}else u.sprite=r;if(typeof n=="object"){let[y,p]=Object.entries(n)[0];u[y]=p}else u.tags=n;if(typeof i=="object"){let[y,p]=Object.entries(i)[0];u[y]=p}else u.link=i;u.wrap=mt()},"addRel"),Xe=g(function(e,t,s,o,l,a,r){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.tags=a;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.link=r;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),We=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Qe=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof a=="object"){let[d,y]=Object.entries(a)[0];i[d]=y}else i.sprite=a;if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),He=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),qe=g(function(e,t,s,o,l){if(e===null||t===null)return;let a={};const r=X.find(n=>n.alias===e);if(r&&e===r.alias?a=r:(a.alias=e,X.push(a)),t==null?a.label={text:""}:a.label={text:t},s==null)a.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];a[n]={text:i}}else a.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];a[n]=i}else a.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];a[n]=i}else a.link=l;a.parentBoundary=B,a.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),Ge=g(function(e,t,s,o,l,a,r,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,y]=Object.entries(o)[0];i[d]={text:y}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,y]=Object.entries(l)[0];i[d]={text:y}}else i.descr={text:l};if(typeof r=="object"){let[d,y]=Object.entries(r)[0];i[d]=y}else i.tags=r;if(typeof n=="object"){let[d,y]=Object.entries(n)[0];i[d]=y}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),Ke=g(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Je=g(function(e,t,s,o,l,a,r,n,i,u,d){let y=V.find(p=>p.alias===t);if(!(y===void 0&&(y=X.find(p=>p.alias===t),y===void 0))){if(s!=null)if(typeof s=="object"){let[p,E]=Object.entries(s)[0];y[p]=E}else y.bgColor=s;if(o!=null)if(typeof o=="object"){let[p,E]=Object.entries(o)[0];y[p]=E}else y.fontColor=o;if(l!=null)if(typeof l=="object"){let[p,E]=Object.entries(l)[0];y[p]=E}else y.borderColor=l;if(a!=null)if(typeof a=="object"){let[p,E]=Object.entries(a)[0];y[p]=E}else y.shadowing=a;if(r!=null)if(typeof r=="object"){let[p,E]=Object.entries(r)[0];y[p]=E}else y.shape=r;if(n!=null)if(typeof n=="object"){let[p,E]=Object.entries(n)[0];y[p]=E}else y.sprite=n;if(i!=null)if(typeof i=="object"){let[p,E]=Object.entries(i)[0];y[p]=E}else y.techn=i;if(u!=null)if(typeof u=="object"){let[p,E]=Object.entries(u)[0];y[p]=E}else y.legendText=u;if(d!=null)if(typeof d=="object"){let[p,E]=Object.entries(d)[0];y[p]=E}else y.legendSprite=d}},"updateElStyle"),Ze=g(function(e,t,s,o,l,a,r){const n=It.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(a);if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(r)}},"updateRelStyle"),$e=g(function(e,t,s){let o=Vt,l=zt;if(typeof t=="object"){const a=Object.values(t)[0];o=parseInt(a)}else o=parseInt(t);if(typeof s=="object"){const a=Object.values(s)[0];l=parseInt(a)}else l=parseInt(s);o>=1&&(Vt=o),l>=1&&(zt=l)},"updateLayoutConfig"),t0=g(function(){return Vt},"getC4ShapeInRow"),e0=g(function(){return zt},"getC4BoundaryInRow"),a0=g(function(){return B},"getCurrentBoundaryParse"),i0=g(function(){return F},"getParentBoundaryParse"),_e=g(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),n0=g(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),r0=g(function(e){return Object.keys(_e(e))},"getC4ShapeKeys"),xe=g(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),s0=xe,l0=g(function(){return It},"getRels"),o0=g(function(){return ie},"getTitle"),c0=g(function(e){ne=e},"setWrap"),mt=g(function(){return ne},"autoWrap"),h0=g(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],It=[],xt=[""],ie="",ne=!1,Vt=4,zt=2},"clear"),u0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},d0={FILLED:0,OPEN:1},f0={LEFTOF:0,RIGHTOF:1,OVER:2},p0=g(function(e){ie=ge(e,Bt())},"setTitle"),te={addPersonOrSystem:Xe,addPersonOrSystemBoundary:He,addContainer:We,addContainerBoundary:qe,addComponent:Qe,addDeploymentNode:Ge,popBoundaryParseStack:Ke,addRel:ze,updateElStyle:Je,updateRelStyle:Ze,updateLayoutConfig:$e,autoWrap:mt,setWrap:c0,getC4ShapeArray:_e,getC4Shape:n0,getC4ShapeKeys:r0,getBoundaries:xe,getBoundarys:s0,getCurrentBoundaryParse:a0,getParentBoundaryParse:i0,getRels:l0,getTitle:o0,getC4Type:Fe,getC4ShapeInRow:t0,getC4BoundaryInRow:e0,setAccTitle:Me,getAccTitle:Ie,getAccDescription:Be,setAccDescription:Pe,getConfig:g(()=>Bt().c4,"getConfig"),clear:h0,LINETYPE:u0,ARROWTYPE:d0,PLACEMENT:f0,setTitle:p0,setC4Type:Ve},re=g(function(e,t){return De(e,t)},"drawRect"),me=g(function(e,t,s,o,l,a){const r=e.append("image");r.attr("width",t),r.attr("height",s),r.attr("x",o),r.attr("y",l);let n=a.startsWith("data:image/png;base64")?a:Ye.sanitizeUrl(a);r.attr("xlink:href",n)},"drawImage"),y0=g((e,t,s)=>{const o=e.append("g");let l=0;for(let a of t){let r=a.textColor?a.textColor:"#444444",n=a.lineColor?a.lineColor:"#444444",i=a.offsetX?parseInt(a.offsetX):0,u=a.offsetY?parseInt(a.offsetY):0,d="";if(l===0){let p=o.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",n),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)"),l=-1}else{let p=o.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",n).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#arrowend)")}let y=s.messageFont();Q(s)(a.label.text,o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+u,a.label.width,a.label.height,{fill:r},y),a.techn&&a.techn.text!==""&&(y=s.messageFont(),Q(s)("["+a.techn.text+"]",o,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+i,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+u,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:r,"font-style":"italic"},y))}},"drawRels"),g0=g(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",a=t.borderColor?t.borderColor:"#444444",r=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};re(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=r,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=r,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=r,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),b0=g(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],a=t.fontColor?t.fontColor:"#FFFFFF",r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Se();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},re(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=w0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":me(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,r);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=a,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:a},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=a,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:a,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:a,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=a,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:a},d)),t.height},"drawC4Shape"),_0=g(function(e){e.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),x0=g(function(e){e.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),m0=g(function(e){e.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),v0=g(function(e){e.append("defs").append("marker").attr("id","arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),E0=g(function(e){e.append("defs").append("marker").attr("id","arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),A0=g(function(e){e.append("defs").append("marker").attr("id","filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),k0=g(function(e){e.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertDynamicNumber"),C0=g(function(e){const s=e.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);s.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),s.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),w0=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,a,r,n,i,u,d){const y=a.append("text").attr("x",r+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(y,d)}g(e,"byText");function t(l,a,r,n,i,u,d,y){const{fontSize:p,fontFamily:E,fontWeight:O}=y,S=l.split($t.lineBreakRegex);for(let P=0;P=this.data.widthLimit||o>=this.data.widthLimit||this.nextData.cnt>ve)&&(s=this.nextData.startx+t.margin+_.nextLinePaddingX,l=this.nextData.stopy+t.margin*2,this.nextData.stopx=o=s+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=l+t.height,this.nextData.cnt=1),t.x=s,t.y=l,this.updateVal(this.data,"startx",s,Math.min),this.updateVal(this.data,"starty",l,Math.min),this.updateVal(this.data,"stopx",o,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",s,Math.min),this.updateVal(this.nextData,"starty",l,Math.min),this.updateVal(this.nextData,"stopx",o,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(t){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},ae(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},g(Ot,"Bounds"),Ot),ae=g(function(e){Ne(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),Pt=g((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Ut=g(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),T0=g(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=je(t[e].text,l,o),t[e].textLines=t[e].text.split($t.lineBreakRegex).length,t[e].width=l,t[e].height=fe(t[e].text,o);else{let a=t[e].text.split($t.lineBreakRegex);t[e].textLines=a.length;let r=0;t[e].height=0,t[e].width=0;for(const n of a)t[e].width=Math.max(Tt(n,o),t[e].width),r=fe(n,o),t[e].height=t[e].height+r}}g(j,"calcC4ShapeTextWH");var Ae=g(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Ut(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let a=Tt(t.label.text,l);j("label",t,o,l,a),z.drawBoundary(e,t,_)},"drawBoundary"),ke=g(function(e,t,s,o){let l=0;for(const a of o){l=0;const r=s[a];let n=Pt(_,r.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,r.typeC4Shape.width=Tt("«"+r.typeC4Shape.text+"»",n),r.typeC4Shape.height=n.fontSize+2,r.typeC4Shape.Y=_.c4ShapePadding,l=r.typeC4Shape.Y+r.typeC4Shape.height-4,r.image={width:0,height:0,Y:0},r.typeC4Shape.text){case"person":case"external_person":r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height;break}r.sprite&&(r.image.width=48,r.image.height=48,r.image.Y=l,l=r.image.Y+r.image.height);let i=r.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=Pt(_,r.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",r,i,d,u),r.label.Y=l+8,l=r.label.Y+r.label.height,r.type&&r.type.text!==""){r.type.text="["+r.type.text+"]";let E=Pt(_,r.typeC4Shape.text);j("type",r,i,E,u),r.type.Y=l+5,l=r.type.Y+r.type.height}else if(r.techn&&r.techn.text!==""){r.techn.text="["+r.techn.text+"]";let E=Pt(_,r.techn.text);j("techn",r,i,E,u),r.techn.Y=l+5,l=r.techn.Y+r.techn.height}let y=l,p=r.label.width;if(r.descr&&r.descr.text!==""){let E=Pt(_,r.typeC4Shape.text);j("descr",r,i,E,u),r.descr.Y=l+20,l=r.descr.Y+r.descr.height,p=Math.max(r.label.width,r.descr.width),y=l-r.descr.textLines*5}p=p+_.c4ShapePadding,r.width=Math.max(r.width||_.width,p,_.width),r.height=Math.max(r.height||_.height,y,_.height),r.margin=r.margin||_.c4ShapeMargin,e.insert(r),z.drawC4Shape(t,r,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Rt,Y=(Rt=class{constructor(t,s){this.x=t,this.y=s}},g(Rt,"Point"),Rt),pe=g(function(e,t){let s=e.x,o=e.y,l=t.x,a=t.y,r=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-a),d=u/i,y=e.height/e.width,p=null;return o==a&&sl?p=new Y(s,n):s==l&&oa&&(p=new Y(r,o)),s>l&&o=d?p=new Y(s,n+d*e.width/2):p=new Y(r-i/u*e.height/2,o+e.height):s=d?p=new Y(s+e.width,n+d*e.width/2):p=new Y(r+i/u*e.height/2,o+e.height):sa?y>=d?p=new Y(s+e.width,n-d*e.width/2):p=new Y(r+e.height/2*i/u,o):s>l&&o>a&&(y>=d?p=new Y(s,n-e.width/2*d):p=new Y(r-e.height/2*i/u,o)),p},"getIntersectPoint"),O0=g(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=pe(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=pe(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),R0=g(function(e,t,s,o){let l=0;for(let a of t){l=l+1;let r=a.wrap&&_.wrap,n=T0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=l+": "+a.label.text);let u=Tt(a.label.text,n);j("label",a,r,n,u),a.techn&&a.techn.text!==""&&(u=Tt(a.techn.text,n),j("techn",a,r,n,u)),a.descr&&a.descr.text!==""&&(u=Tt(a.descr.text,n),j("descr",a,r,n,u));let d=s(a.from),y=s(a.to),p=O0(d,y);a.startPoint=p.startPoint,a.endPoint=p.endPoint}z.drawRels(e,t,_)},"drawRels");function se(e,t,s,o,l){let a=new Ee(l);a.data.widthLimit=s.data.widthLimit/Math.min(ee,o.length);for(let[r,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Ut(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,a.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Ut(_);j("type",n,u,O,a.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Ut(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,a.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(r==0||r%ee===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;a.setData(O,O,S,S)}else{let O=a.data.stopx!==a.data.startx?a.data.stopx+_.diagramMarginX:a.data.startx,S=a.data.starty;a.setData(O,O,S,S)}a.name=n.alias;let y=l.db.getC4ShapeArray(n.alias),p=l.db.getC4ShapeKeys(n.alias);p.length>0&&ke(a,e,y,p),t=n.alias;let E=l.db.getBoundaries(t);E.length>0&&se(e,t,a,E,l),n.alias!=="global"&&Ae(e,n,a),s.data.stopy=Math.max(a.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(a.data.stopx+_.c4ShapeMargin,s.data.stopx),Xt=Math.max(Xt,s.data.stopx),Wt=Math.max(Wt,s.data.stopy)}}g(se,"drawInsideBoundary");var S0=g(function(e,t,s,o){_=Bt().c4;const l=Bt().securityLevel;let a;l==="sandbox"&&(a=jt("#i"+t));const r=l==="sandbox"?jt(a.nodes()[0].contentDocument.body):jt("body");let n=o.db;o.db.setWrap(_.wrap),ve=n.getC4ShapeInRow(),ee=n.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?r.select(`[id="${t}"]`):jt(`[id="${t}"]`);z.insertComputerIcon(i),z.insertDatabaseIcon(i),z.insertClockIcon(i);let u=new Ee(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Xt=_.diagramMarginX,Wt=_.diagramMarginY;const d=o.db.getTitle();let y=o.db.getBoundaries("");se(i,"",u,y,o),z.insertArrowHead(i),z.insertArrowEnd(i),z.insertArrowCrossHead(i),z.insertArrowFilledHead(i),R0(i,o.db.getRels(),o.db.getC4Shape,o),u.data.stopx=Xt,u.data.stopy=Wt;const p=u.data;let O=p.stopy-p.starty+2*_.diagramMarginY;const P=p.stopx-p.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(p.stopx-p.startx)/2-4*_.diagramMarginX).attr("y",p.starty+_.diagramMarginY),Le(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",p.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),de.debug("models:",p)},"draw"),ye={drawPersonOrSystemArray:ke,drawBoundary:Ae,setConf:ae,draw:S0},D0=g(e=>`.person { + stroke: ${e.personBorder}; + fill: ${e.personBkg}; + } +`,"getStyles"),P0=D0,M0={parser:Ue,db:te,renderer:ye,styles:P0,init:g(({c4:e,wrap:t})=>{ye.setConf(e),te.setWrap(t)},"init")};export{M0 as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js new file mode 100644 index 0000000000..551a93cd48 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/channel-D6izjHHp.js @@ -0,0 +1 @@ +import{aN as o,aO as n}from"./index-DpOBiJiD.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js new file mode 100644 index 0000000000..ee376927f6 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-4BX2VUAB-D7HUlyWF.js @@ -0,0 +1 @@ +import{_ as i}from"./index-DpOBiJiD.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js new file mode 100644 index 0000000000..725251bbfb --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-55IACEB6-DUaTCW0f.js @@ -0,0 +1 @@ +import{_ as a,B as o}from"./index-DpOBiJiD.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js new file mode 100644 index 0000000000..d5b9dd9529 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-B4BG7PRW-DtfSht4V.js @@ -0,0 +1,165 @@ +import{g as et}from"./chunk-FMBD7UC4-fSM8np9_.js";import{g as tt}from"./chunk-55IACEB6-DUaTCW0f.js";import{s as st}from"./chunk-QN33PNHL-Cb84mGB3.js";import{_ as A,E as Oe,z as D,R as it,S as at,T as we,B as ee,y as nt,x as rt,v as ut,w as lt,U as ot,V as ct,O as v,$ as ht,Z as dt,L as pt,ah as R}from"./index-DpOBiJiD.js";var Ve=(function(){var s=A(function(I,o,c,d){for(c=c||{},d=I.length;d--;c[I[d]]=o);return c},"o"),i=[1,18],a=[1,19],u=[1,20],l=[1,41],n=[1,42],p=[1,26],f=[1,24],C=[1,25],B=[1,32],L=[1,33],Ae=[1,34],m=[1,45],fe=[1,35],ge=[1,36],Ce=[1,37],me=[1,38],be=[1,27],Ee=[1,28],ye=[1,29],Te=[1,30],ke=[1,31],b=[1,44],E=[1,46],y=[1,43],T=[1,47],De=[1,9],h=[1,8,9],te=[1,58],se=[1,59],ie=[1,60],ae=[1,61],ne=[1,62],Fe=[1,63],Be=[1,64],z=[1,8,9,41],Pe=[1,76],P=[1,8,9,12,13,22,39,41,44,68,69,70,71,72,73,74,79,81],re=[1,8,9,12,13,18,20,22,39,41,44,50,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],_e=[1,100],Y=[1,117],Q=[1,113],W=[1,109],j=[1,115],X=[1,110],H=[1,111],q=[1,112],J=[1,114],Z=[1,116],Re=[22,48,60,61,82,86,87,88,89,90],Se=[1,8,9,39,41,44],le=[1,8,9,22],Ge=[1,145],Ue=[1,8,9,61],N=[1,8,9,22,48,60,61,82,86,87,88,89,90],Ne={trace:A(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,CLASS:46,emptyBody:47,SPACE:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"CLASS",48:"SPACE",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[43,2],[43,3],[47,0],[47,2],[47,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:A(function(o,c,d,r,g,e,$){var t=e.length-1;switch(g){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:r.addRelation(e[t]);break;case 20:e[t-1].title=r.cleanupLabel(e[t]),r.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(e[t-3],e[t-1]);break;case 35:r.addClassesToNamespace(e[t-4],e[t-1]);break;case 36:this.$=e[t],r.addNamespace(e[t]);break;case 37:this.$=[e[t]];break;case 38:this.$=[e[t-1]];break;case 39:e[t].unshift(e[t-2]),this.$=e[t];break;case 41:r.setCssClass(e[t-2],e[t]);break;case 42:r.addMembers(e[t-3],e[t-1]);break;case 44:r.setCssClass(e[t-5],e[t-3]),r.addMembers(e[t-5],e[t-1]);break;case 45:this.$=e[t],r.addClass(e[t]);break;case 46:this.$=e[t-1],r.addClass(e[t-1]),r.setClassLabel(e[t-1],e[t]);break;case 50:r.addAnnotation(e[t],e[t-2]);break;case 51:case 64:this.$=[e[t]];break;case 52:e[t].push(e[t-1]),this.$=e[t];break;case 53:break;case 54:r.addMember(e[t-1],r.cleanupLabel(e[t]));break;case 55:break;case 56:break;case 57:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 58:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 59:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 60:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 61:r.addNote(e[t],e[t-1]);break;case 62:r.addNote(e[t]);break;case 63:this.$=e[t-2],r.defineClass(e[t-1],e[t]);break;case 65:this.$=e[t-2].concat([e[t]]);break;case 66:r.setDirection("TB");break;case 67:r.setDirection("BT");break;case 68:r.setDirection("RL");break;case 69:r.setDirection("LR");break;case 70:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 71:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 72:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 73:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 74:this.$=r.relationType.AGGREGATION;break;case 75:this.$=r.relationType.EXTENSION;break;case 76:this.$=r.relationType.COMPOSITION;break;case 77:this.$=r.relationType.DEPENDENCY;break;case 78:this.$=r.relationType.LOLLIPOP;break;case 79:this.$=r.lineType.LINE;break;case 80:this.$=r.lineType.DOTTED_LINE;break;case 81:case 87:this.$=e[t-2],r.setClickEvent(e[t-1],e[t]);break;case 82:case 88:this.$=e[t-3],r.setClickEvent(e[t-2],e[t-1]),r.setTooltip(e[t-2],e[t]);break;case 83:this.$=e[t-2],r.setLink(e[t-1],e[t]);break;case 84:this.$=e[t-3],r.setLink(e[t-2],e[t-1],e[t]);break;case 85:this.$=e[t-3],r.setLink(e[t-2],e[t-1]),r.setTooltip(e[t-2],e[t]);break;case 86:this.$=e[t-4],r.setLink(e[t-3],e[t-2],e[t]),r.setTooltip(e[t-3],e[t-1]);break;case 89:this.$=e[t-3],r.setClickEvent(e[t-2],e[t-1],e[t]);break;case 90:this.$=e[t-4],r.setClickEvent(e[t-3],e[t-2],e[t-1]),r.setTooltip(e[t-3],e[t]);break;case 91:this.$=e[t-3],r.setLink(e[t-2],e[t]);break;case 92:this.$=e[t-4],r.setLink(e[t-3],e[t-1],e[t]);break;case 93:this.$=e[t-4],r.setLink(e[t-3],e[t-1]),r.setTooltip(e[t-3],e[t]);break;case 94:this.$=e[t-5],r.setLink(e[t-4],e[t-2],e[t]),r.setTooltip(e[t-4],e[t-1]);break;case 95:this.$=e[t-2],r.setCssStyle(e[t-1],e[t]);break;case 96:r.setCssClass(e[t-1],e[t]);break;case 97:this.$=[e[t]];break;case 98:e[t-2].push(e[t]),this.$=e[t-2];break;case 100:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:u,38:22,42:l,43:23,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(De,[2,5],{8:[1,48]}),{8:[1,49]},s(h,[2,19],{22:[1,50]}),s(h,[2,21]),s(h,[2,22]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),{34:[1,51]},{36:[1,52]},s(h,[2,33]),s(h,[2,53],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:te,69:se,70:ie,71:ae,72:ne,73:Fe,74:Be}),{39:[1,65]},s(z,[2,40],{39:[1,67],44:[1,66]}),s(h,[2,55]),s(h,[2,56]),{16:68,60:m,86:b,100:E,102:y},{16:39,17:40,19:69,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:70,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:71,60:m,86:b,100:E,102:y,103:T},{60:[1,72]},{13:[1,73]},{16:39,17:40,19:74,60:m,86:b,100:E,102:y,103:T},{13:Pe,55:75},{58:77,60:[1,78]},s(h,[2,66]),s(h,[2,67]),s(h,[2,68]),s(h,[2,69]),s(P,[2,13],{16:39,17:40,19:80,18:[1,79],20:[1,81],60:m,86:b,100:E,102:y,103:T}),s(P,[2,15],{20:[1,82]}),{15:83,16:84,17:85,60:m,86:b,100:E,102:y,103:T},{16:39,17:40,19:86,60:m,86:b,100:E,102:y,103:T},s(re,[2,123]),s(re,[2,124]),s(re,[2,125]),s(re,[2,126]),s([1,8,9,12,13,20,22,39,41,44,68,69,70,71,72,73,74,79,81],[2,127]),s(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:87,33:i,35:a,37:u,42:l,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T}),{5:88,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:u,38:22,42:l,43:23,46:n,49:p,51:f,52:C,54:B,56:L,57:Ae,60:m,62:fe,63:ge,64:Ce,65:me,75:be,76:Ee,78:ye,82:Te,83:ke,86:b,100:E,102:y,103:T},s(h,[2,20]),s(h,[2,31]),s(h,[2,32]),{13:[1,90],16:39,17:40,19:89,60:m,86:b,100:E,102:y,103:T},{53:91,66:56,67:57,68:te,69:se,70:ie,71:ae,72:ne,73:Fe,74:Be},s(h,[2,54]),{67:92,73:Fe,74:Be},s(ue,[2,73],{66:93,68:te,69:se,70:ie,71:ae,72:ne}),s(K,[2,74]),s(K,[2,75]),s(K,[2,76]),s(K,[2,77]),s(K,[2,78]),s(Me,[2,79]),s(Me,[2,80]),{8:[1,95],24:96,40:94,43:23,46:n},{16:97,60:m,86:b,100:E,102:y},{41:[1,99],45:98,51:_e},{50:[1,101]},{13:[1,102]},{13:[1,103]},{79:[1,104],81:[1,105]},{22:Y,48:Q,59:106,60:W,82:j,84:107,85:108,86:X,87:H,88:q,89:J,90:Z},{60:[1,118]},{13:Pe,55:119},s(h,[2,62]),s(h,[2,128]),{22:Y,48:Q,59:120,60:W,61:[1,121],82:j,84:107,85:108,86:X,87:H,88:q,89:J,90:Z},s(Re,[2,64]),{16:39,17:40,19:122,60:m,86:b,100:E,102:y,103:T},s(P,[2,16]),s(P,[2,17]),s(P,[2,18]),{39:[2,36]},{15:124,16:84,17:85,18:[1,123],39:[2,9],60:m,86:b,100:E,102:y,103:T},{39:[2,10]},s(Se,[2,45],{11:125,12:[1,126]}),s(De,[2,7]),{9:[1,127]},s(le,[2,57]),{16:39,17:40,19:128,60:m,86:b,100:E,102:y,103:T},{13:[1,130],16:39,17:40,19:129,60:m,86:b,100:E,102:y,103:T},s(ue,[2,72],{66:131,68:te,69:se,70:ie,71:ae,72:ne}),s(ue,[2,71]),{41:[1,132]},{24:96,40:133,43:23,46:n},{8:[1,134],41:[2,37]},s(z,[2,41],{39:[1,135]}),{41:[1,136]},s(z,[2,43]),{41:[2,51],45:137,51:_e},{16:39,17:40,19:138,60:m,86:b,100:E,102:y,103:T},s(h,[2,81],{13:[1,139]}),s(h,[2,83],{13:[1,141],77:[1,140]}),s(h,[2,87],{13:[1,142],80:[1,143]}),{13:[1,144]},s(h,[2,95],{61:Ge}),s(Ue,[2,97],{85:146,22:Y,48:Q,60:W,82:j,86:X,87:H,88:q,89:J,90:Z}),s(N,[2,99]),s(N,[2,101]),s(N,[2,102]),s(N,[2,103]),s(N,[2,104]),s(N,[2,105]),s(N,[2,106]),s(N,[2,107]),s(N,[2,108]),s(N,[2,109]),s(h,[2,96]),s(h,[2,61]),s(h,[2,63],{61:Ge}),{60:[1,147]},s(P,[2,14]),{15:148,16:84,17:85,60:m,86:b,100:E,102:y,103:T},{39:[2,12]},s(Se,[2,46]),{13:[1,149]},{1:[2,4]},s(le,[2,59]),s(le,[2,58]),{16:39,17:40,19:150,60:m,86:b,100:E,102:y,103:T},s(ue,[2,70]),s(h,[2,34]),{41:[1,151]},{24:96,40:152,41:[2,38],43:23,46:n},{45:153,51:_e},s(z,[2,42]),{41:[2,52]},s(h,[2,50]),s(h,[2,82]),s(h,[2,84]),s(h,[2,85],{77:[1,154]}),s(h,[2,88]),s(h,[2,89],{13:[1,155]}),s(h,[2,91],{13:[1,157],77:[1,156]}),{22:Y,48:Q,60:W,82:j,84:158,85:108,86:X,87:H,88:q,89:J,90:Z},s(N,[2,100]),s(Re,[2,65]),{39:[2,11]},{14:[1,159]},s(le,[2,60]),s(h,[2,35]),{41:[2,39]},{41:[1,160]},s(h,[2,86]),s(h,[2,90]),s(h,[2,92]),s(h,[2,93],{77:[1,161]}),s(Ue,[2,98],{85:146,22:Y,48:Q,60:W,82:j,86:X,87:H,88:q,89:J,90:Z}),s(Se,[2,8]),s(z,[2,44]),s(h,[2,94])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],83:[2,36],85:[2,10],124:[2,12],127:[2,4],137:[2,52],148:[2,11],152:[2,39]},parseError:A(function(o,c){if(c.recoverable)this.trace(o);else{var d=new Error(o);throw d.hash=c,d}},"parseError"),parse:A(function(o){var c=this,d=[0],r=[],g=[null],e=[],$=this.table,t="",ce=0,ze=0,qe=2,Ke=1,Je=e.slice.call(arguments,1),k=Object.create(this.lexer),O={yy:{}};for(var Le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Le)&&(O.yy[Le]=this.yy[Le]);k.setInput(o,O.yy),O.yy.lexer=k,O.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var xe=k.yylloc;e.push(xe);var Ze=k.options&&k.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $e(_){d.length=d.length-2*_,g.length=g.length-_,e.length=e.length-_}A($e,"popStack");function Ye(){var _;return _=r.pop()||k.lex()||Ke,typeof _!="number"&&(_ instanceof Array&&(r=_,_=r.pop()),_=c.symbols_[_]||_),_}A(Ye,"lex");for(var F,w,S,ve,M={},he,x,Qe,de;;){if(w=d[d.length-1],this.defaultActions[w]?S=this.defaultActions[w]:((F===null||typeof F>"u")&&(F=Ye()),S=$[w]&&$[w][F]),typeof S>"u"||!S.length||!S[0]){var Ie="";de=[];for(he in $[w])this.terminals_[he]&&he>qe&&de.push("'"+this.terminals_[he]+"'");k.showPosition?Ie="Parse error on line "+(ce+1)+`: +`+k.showPosition()+` +Expecting `+de.join(", ")+", got '"+(this.terminals_[F]||F)+"'":Ie="Parse error on line "+(ce+1)+": Unexpected "+(F==Ke?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(Ie,{text:k.match,token:this.terminals_[F]||F,line:k.yylineno,loc:xe,expected:de})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+F);switch(S[0]){case 1:d.push(F),g.push(k.yytext),e.push(k.yylloc),d.push(S[1]),F=null,ze=k.yyleng,t=k.yytext,ce=k.yylineno,xe=k.yylloc;break;case 2:if(x=this.productions_[S[1]][1],M.$=g[g.length-x],M._$={first_line:e[e.length-(x||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(x||1)].first_column,last_column:e[e.length-1].last_column},Ze&&(M._$.range=[e[e.length-(x||1)].range[0],e[e.length-1].range[1]]),ve=this.performAction.apply(M,[t,ze,ce,O.yy,S[1],g,e].concat(Je)),typeof ve<"u")return ve;x&&(d=d.slice(0,-1*x*2),g=g.slice(0,-1*x),e=e.slice(0,-1*x)),d.push(this.productions_[S[1]][0]),g.push(M.$),e.push(M._$),Qe=$[d[d.length-2]][d[d.length-1]],d.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var I={EOF:1,parseError:A(function(c,d){if(this.yy.parser)this.yy.parser.parseError(c,d);else throw new Error(c)},"parseError"),setInput:A(function(o,c){return this.yy=c||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:A(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var c=o.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:A(function(o){var c=o.length,d=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===r.length?this.yylloc.first_column:0)+r[r.length-d.length].length-d[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:A(function(){return this._more=!0,this},"more"),reject:A(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:A(function(o){this.unput(this.match.slice(o))},"less"),pastInput:A(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:A(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:A(function(){var o=this.pastInput(),c=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:A(function(o,c){var d,r,g;if(this.options.backtrack_lexer&&(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(g.yylloc.range=this.yylloc.range.slice(0))),r=o[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],d=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var e in g)this[e]=g[e];return!1}return!1},"test_match"),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,c,d,r;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),e=0;ec[0].length)){if(c=d,r=e,this.options.backtrack_lexer){if(o=this.test_match(d,g[e]),o!==!1)return o;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(o=this.test_match(c,g[r]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:A(function(){var c=this.next();return c||this.lex()},"lex"),begin:A(function(c){this.conditionStack.push(c)},"begin"),popState:A(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:A(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:A(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:A(function(c){this.begin(c)},"pushState"),stateStackSize:A(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:A(function(c,d,r,g){switch(r){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:return this.popState(),41;case 34:return"EOF_IN_STRUCT";case 35:return 8;case 36:break;case 37:return"EDGE_STATE";case 38:return this.begin("class"),46;case 39:return this.popState(),8;case 40:break;case 41:return this.popState(),this.popState(),41;case 42:return this.begin("class-body"),39;case 43:return this.popState(),41;case 44:return"EOF_IN_STRUCT";case 45:return"EDGE_STATE";case 46:return"OPEN_IN_STRUCT";case 47:break;case 48:return"MEMBER";case 49:return 83;case 50:return 75;case 51:return 76;case 52:return 78;case 53:return 54;case 54:return 56;case 55:return 49;case 56:return 50;case 57:return 81;case 58:this.popState();break;case 59:return"GENERICTYPE";case 60:this.begin("generic");break;case 61:this.popState();break;case 62:return"BQUOTE_STR";case 63:this.begin("bqstring");break;case 64:return 77;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 69;case 69:return 69;case 70:return 71;case 71:return 71;case 72:return 70;case 73:return 68;case 74:return 72;case 75:return 73;case 76:return 74;case 77:return 22;case 78:return 44;case 79:return 100;case 80:return 18;case 81:return"PLUS";case 82:return 87;case 83:return 61;case 84:return 89;case 85:return 89;case 86:return 90;case 87:return"EQUALS";case 88:return"EQUALS";case 89:return 60;case 90:return 12;case 91:return 14;case 92:return"PUNCTUATION";case 93:return 86;case 94:return 102;case 95:return 48;case 96:return 48;case 97:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,33,34,35,36,37,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},namespace:{rules:[26,29,30,31,32,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},"class-body":{rules:[26,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},class:{rules:[26,39,40,41,42,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_descr:{rules:[9,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},acc_title:{rules:[7,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_args:{rules:[22,23,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},callback_name:{rules:[19,20,21,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},href:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},struct:{rules:[26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},generic:{rules:[26,49,50,51,52,53,54,55,56,57,58,59,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},bqstring:{rules:[26,49,50,51,52,53,54,55,56,57,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},string:{rules:[24,25,26,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,86,87,88,89,90,91,92,93,94,95,97],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,38,49,50,51,52,53,54,55,56,57,60,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],inclusive:!0}}};return I})();Ne.lexer=He;function oe(){this.yy={}}return A(oe,"Parser"),oe.prototype=Ne,Ne.Parser=oe,new oe})();Ve.parser=Ve;var Tt=Ve,We=["#","+","~","-",""],G,je=(G=class{constructor(i,a){this.memberType=a,this.visibility="",this.classifier="",this.text="";const u=pt(i,D());this.parseMember(u)}getDisplayDetails(){let i=this.visibility+R(this.id);this.memberType==="method"&&(i+=`(${R(this.parameters.trim())})`,this.returnType&&(i+=" : "+R(this.returnType))),i=i.trim();const a=this.parseClassifier();return{displayText:i,cssStyle:a}}parseMember(i){let a="";if(this.memberType==="method"){const n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(i);if(n){const p=n[1]?n[1].trim():"";if(We.includes(p)&&(this.visibility=p),this.id=n[2],this.parameters=n[3]?n[3].trim():"",a=n[4]?n[4].trim():"",this.returnType=n[5]?n[5].trim():"",a===""){const f=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(f)&&(a=f,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const l=i.length,n=i.substring(0,1),p=i.substring(l-1);We.includes(n)&&(this.visibility=n),/[$*]/.exec(p)&&(a=p),this.id=i.substring(this.visibility===""?0:1,a===""?l:l-1)}this.classifier=a,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const u=`${this.visibility?"\\"+this.visibility:""}${R(this.id)}${this.memberType==="method"?`(${R(this.parameters)})${this.returnType?" : "+R(this.returnType):""}`:""}`;this.text=u.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},A(G,"ClassMember"),G),pe="classId-",Xe=0,V=A(s=>v.sanitizeText(s,D()),"sanitizeText"),U,kt=(U=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=A(i=>{let a=ee(".mermaidTooltip");(a._groups||a)[0][0]===null&&(a=ee("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),ee(i).select("svg").selectAll("g.node").on("mouseover",n=>{const p=ee(n.currentTarget);if(p.attr("title")===null)return;const C=this.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.text(p.attr("title")).style("left",window.scrollX+C.left+(C.right-C.left)/2+"px").style("top",window.scrollY+C.top-14+document.body.scrollTop+"px"),a.html(a.html().replace(/<br\/>/g,"
")),p.classed("hover",!0)}).on("mouseout",n=>{a.transition().duration(500).style("opacity",0),ee(n.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=nt,this.getAccTitle=rt,this.setAccDescription=ut,this.getAccDescription=lt,this.setDiagramTitle=ot,this.getDiagramTitle=ct,this.getConfig=A(()=>D().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(i){const a=v.sanitizeText(i,D());let u="",l=a;if(a.indexOf("~")>0){const n=a.split("~");l=V(n[0]),u=V(n[1])}return{className:l,type:u}}setClassLabel(i,a){const u=v.sanitizeText(i,D());a&&(a=V(a));const{className:l}=this.splitClassNameAndType(u);this.classes.get(l).label=a,this.classes.get(l).text=`${a}${this.classes.get(l).type?`<${this.classes.get(l).type}>`:""}`}addClass(i){const a=v.sanitizeText(i,D()),{className:u,type:l}=this.splitClassNameAndType(a);if(this.classes.has(u))return;const n=v.sanitizeText(u,D());this.classes.set(n,{id:n,type:l,label:n,text:`${n}${l?`<${l}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+n+"-"+Xe}),Xe++}addInterface(i,a){const u={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(u)}lookUpDomId(i){const a=v.sanitizeText(i,D());if(this.classes.has(a))return this.classes.get(a).domId;throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",ht()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(i){Oe.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=v.sanitizeText(i.relationTitle1.trim(),D()),i.relationTitle2=v.sanitizeText(i.relationTitle2.trim(),D()),this.relations.push(i)}addAnnotation(i,a){const u=this.splitClassNameAndType(i).className;this.classes.get(u).annotations.push(a)}addMember(i,a){this.addClass(i);const u=this.splitClassNameAndType(i).className,l=this.classes.get(u);if(typeof a=="string"){const n=a.trim();n.startsWith("<<")&&n.endsWith(">>")?l.annotations.push(V(n.substring(2,n.length-2))):n.indexOf(")")>0?l.methods.push(new je(n,"method")):n&&l.members.push(new je(n,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(u=>this.addMember(i,u)))}addNote(i,a){const u={id:`note${this.notes.length}`,class:a,text:i};this.notes.push(u)}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),V(i.trim())}setCssClass(i,a){i.split(",").forEach(u=>{let l=u;/\d/.exec(u[0])&&(l=pe+l);const n=this.classes.get(l);n&&(n.cssClasses+=" "+a)})}defineClass(i,a){for(const u of i){let l=this.styleClasses.get(u);l===void 0&&(l={id:u,styles:[],textStyles:[]},this.styleClasses.set(u,l)),a&&a.forEach(n=>{if(/color/.exec(n)){const p=n.replace("fill","bgFill");l.textStyles.push(p)}l.styles.push(n)}),this.classes.forEach(n=>{n.cssClasses.includes(u)&&n.styles.push(...a.flatMap(p=>p.split(",")))})}}setTooltip(i,a){i.split(",").forEach(u=>{a!==void 0&&(this.classes.get(u).tooltip=V(a))})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,u){const l=D();i.split(",").forEach(n=>{let p=n;/\d/.exec(n[0])&&(p=pe+p);const f=this.classes.get(p);f&&(f.link=we.formatUrl(a,l),l.securityLevel==="sandbox"?f.linkTarget="_top":typeof u=="string"?f.linkTarget=V(u):f.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,u){i.split(",").forEach(l=>{this.setClickFunc(l,a,u),this.classes.get(l).haveCallback=!0}),this.setCssClass(i,"clickable")}setClickFunc(i,a,u){const l=v.sanitizeText(i,D());if(D().securityLevel!=="loose"||a===void 0)return;const p=l;if(this.classes.has(p)){const f=this.lookUpDomId(p);let C=[];if(typeof u=="string"){C=u.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let B=0;B{const B=document.querySelector(`[id="${f}"]`);B!==null&&B.addEventListener("click",()=>{we.runFunc(a,...C)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}getDirection(){return this.direction}setDirection(i){this.direction=i}addNamespace(i){this.namespaces.has(i)||(this.namespaces.set(i,{id:i,classes:new Map,children:{},domId:pe+i+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a){if(this.namespaces.has(i))for(const u of a){const{className:l}=this.splitClassNameAndType(u);this.classes.get(l).parent=i,this.namespaces.get(i).classes.set(l,this.classes.get(l))}}setCssStyle(i,a){const u=this.classes.get(i);if(!(!a||!u))for(const l of a)l.includes(",")?u.styles.push(...l.split(",")):u.styles.push(l)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}getData(){const i=[],a=[],u=D();for(const n of this.namespaces.keys()){const p=this.namespaces.get(n);if(p){const f={id:p.id,label:p.id,isGroup:!0,padding:u.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:u.look};i.push(f)}}for(const n of this.classes.keys()){const p=this.classes.get(n);if(p){const f=p;f.parentId=p.parent,f.look=u.look,i.push(f)}}let l=0;for(const n of this.notes){l++;const p={id:n.id,label:n.text,isGroup:!1,shape:"note",padding:u.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${u.themeVariables.noteBkgColor}`,`stroke: ${u.themeVariables.noteBorderColor}`],look:u.look};i.push(p);const f=this.classes.get(n.class)?.id??"";if(f){const C={id:`edgeNote${l}`,start:n.id,end:f,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:u.look};a.push(C)}}for(const n of this.interfaces){const p={id:n.id,label:n.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:u.look};i.push(p)}l=0;for(const n of this.relations){l++;const p={id:dt(n.id1,n.id2,{prefix:"id",counter:l}),start:n.id1,end:n.id2,type:"normal",label:n.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(n.relation.type1),arrowTypeEnd:this.getArrowMarker(n.relation.type2),startLabelRight:n.relationTitle1==="none"?"":n.relationTitle1,endLabelLeft:n.relationTitle2==="none"?"":n.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:n.style||"",pattern:n.relation.lineType==1?"dashed":"solid",look:u.look};a.push(p)}return{nodes:i,edges:a,other:{},config:u,direction:this.getDirection()}}},A(U,"ClassDB"),U),At=A(s=>`g.classGroup text { + fill: ${s.nodeBorder||s.classText}; + stroke: none; + font-family: ${s.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + +.nodeLabel, .edgeLabel { + color: ${s.classText}; +} +.edgeLabel .label rect { + fill: ${s.mainBkg}; +} +.label text { + fill: ${s.classText}; +} + +.labelBkg { + background: ${s.mainBkg}; +} +.edgeLabel .label span { + background: ${s.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: 1px; + } + + +.divider { + stroke: ${s.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; +} + +g.classGroup line { + stroke: ${s.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${s.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${s.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${s.lineColor}; + stroke-width: 1; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +#compositionStart, .composition { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#compositionEnd, .composition { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#dependencyStart, .dependency { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#dependencyStart, .dependency { + fill: ${s.lineColor} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#extensionStart, .extension { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#extensionEnd, .extension { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#aggregationStart, .aggregation { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#aggregationEnd, .aggregation { + fill: transparent !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#lollipopStart, .lollipop { + fill: ${s.mainBkg} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +#lollipopEnd, .lollipop { + fill: ${s.mainBkg} !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${s.textColor}; +} + ${et()} +`,"getStyles"),Dt=At,ft=A((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const u of s.doc)u.stmt==="dir"&&(a=u.value);return a},"getDir"),gt=A(function(s,i){return i.db.getClasses()},"getClasses"),Ct=A(async function(s,i,a,u){Oe.info("REF0:"),Oe.info("Drawing class diagram (v3)",i);const{securityLevel:l,state:n,layout:p}=D(),f=u.db.getData(),C=tt(i,l);f.type=u.type,f.layoutAlgorithm=it(p),f.nodeSpacing=n?.nodeSpacing||50,f.rankSpacing=n?.rankSpacing||50,f.markers=["aggregation","extension","composition","dependency","lollipop"],f.diagramId=i,await at(f,C);const B=8;we.insertTitle(C,"classDiagramTitleText",n?.titleTopMargin??25,u.db.getDiagramTitle()),st(C,B,"classDiagram",n?.useMaxWidth??!0)},"draw"),Ft={getClasses:gt,draw:Ct,getDir:ft};export{kt as C,Tt as a,Ft as c,Dt as s}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js new file mode 100644 index 0000000000..14604c8f4c --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-DI55MBZ5-Ckbm5c8K.js @@ -0,0 +1,220 @@ +import{g as te}from"./chunk-55IACEB6-DUaTCW0f.js";import{s as ee}from"./chunk-QN33PNHL-Cb84mGB3.js";import{_ as u,E as b,z as w,S as se,T as ie,x as re,y as ae,w as ne,v as oe,U as le,V as ce,ak as he,O as U,$ as ue}from"./index-DpOBiJiD.js";var vt=(function(){var t=u(function(Y,o,c,n){for(c=c||{},n=Y.length;n--;c[Y[n]]=o);return c},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],h=[1,9],d=[1,11],S=[1,16],f=[1,17],T=[1,18],_=[1,19],m=[1,33],A=[1,20],v=[1,21],p=[1,22],k=[1,23],R=[1,24],L=[1,26],$=[1,27],I=[1,28],P=[1,29],st=[1,30],it=[1,31],rt=[1,32],at=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],H=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:u(function(o,c,n,g,E,i,J){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const q=i[l-1];q.description=g.trimColon(i[l]),this.$=q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const Tt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var B=i[l],z=i[l-2].trim();if(i[l].match(":")){var ut=i[l].split(":");B=ut[0],z=[z,ut[1]]}this.$={stmt:"state",id:B,type:"default",description:z};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:S,17:f,19:T,22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:H},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:H},t(y,[2,17]),t(xt,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,72],22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(xt,r,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:d,8:8,9:10,10:12,11:13,12:14,13:15,16:S,17:f,19:T,21:[1,81],22:_,24:m,25:A,26:v,27:p,28:k,29:R,32:25,33:L,35:$,37:I,38:P,41:st,45:it,48:rt,51:at,52:nt,53:ot,54:lt,57:H},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:u(function(o,c){if(c.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=c,n}},"parseError"),parse:u(function(o){var c=this,n=[0],g=[],E=[null],i=[],J=this.table,l="",B=0,z=0,ut=2,q=1,Tt=i.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(V.yy[Et]=this.yy[Et]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;i.push(_t);var Qt=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(O){n.length=n.length-2*O,E.length=E.length-O,i.length=i.length-O}u(Zt,"popStack");function Lt(){var O;return O=g.pop()||D.lex()||q,typeof O!="number"&&(O instanceof Array&&(g=O,O=g.pop()),O=c.symbols_[O]||O),O}u(Lt,"lex");for(var x,M,N,mt,W={},dt,F,It,ft;;){if(M=n[n.length-1],this.defaultActions[M]?N=this.defaultActions[M]:((x===null||typeof x>"u")&&(x=Lt()),N=J[M]&&J[M][x]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in J[M])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(B+1)+`: +`+D.showPosition()+` +Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(B+1)+": Unexpected "+(x==q?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[x]||x,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+x);switch(N[0]){case 1:n.push(x),E.push(D.yytext),i.push(D.yylloc),n.push(N[1]),x=null,z=D.yyleng,l=D.yytext,B=D.yylineno,_t=D.yylloc;break;case 2:if(F=this.productions_[N[1]][1],W.$=E[E.length-F],W._$={first_line:i[i.length-(F||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(F||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(W._$.range=[i[i.length-(F||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply(W,[l,z,B,V.yy,N[1],E,i].concat(Tt)),typeof mt<"u")return mt;F&&(n=n.slice(0,-1*F*2),E=E.slice(0,-1*F),i=i.slice(0,-1*F)),n.push(this.productions_[N[1]][0]),E.push(W.$),i.push(W._$),It=J[n[n.length-2]][n[n.length-1]],n.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var Y={EOF:1,parseError:u(function(c,n){if(this.yy.parser)this.yy.parser.parseError(c,n);else throw new Error(c)},"parseError"),setInput:u(function(o,c){return this.yy=c||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var c=o.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:u(function(o){var c=o.length,n=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(o){this.unput(this.match.slice(o))},"less"),pastInput:u(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var o=this.pastInput(),c=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+c+"^"},"showPosition"),test_match:u(function(o,c){var n,g,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],n=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,c,n,g;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;ic[0].length)){if(c=n,g=i,this.options.backtrack_lexer){if(o=this.test_match(n,E[i]),o!==!1)return o;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(o=this.test_match(c,E[g]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var c=this.next();return c||this.lex()},"lex"),begin:u(function(c){this.conditionStack.push(c)},"begin"),popState:u(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:u(function(c){this.begin(c)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(c,n,g,E){switch(g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 70:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return n.yytext=n.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return Y})();gt.lexer=qt;function ht(){this.yy={}}return u(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();vt.parser=vt;var Be=vt,de="TB",Yt="TB",Ot="dir",X="state",K="root",Ct="relation",fe="classDef",pe="style",Se="applyClass",tt="default",Gt="divider",Bt="fill:none",Vt="fill: #333",Mt="c",Ut="text",jt="normal",Dt="rect",kt="rectWithTitle",ye="stateStart",ge="stateEnd",Rt="divider",Nt="roundedWithTitle",Te="note",Ee="noteGroup",et="statediagram",_e="state",me=`${et}-${_e}`,Ht="transition",be="note",De="note-edge",ke=`${Ht} ${De}`,ve=`${et}-${be}`,Ce="cluster",Ae=`${et}-${Ce}`,xe="cluster-alt",Le=`${et}-${xe}`,zt="parent",Wt="note",Ie="state",At="----",Oe=`${At}${Wt}`,wt=`${At}${zt}`,Kt=u((t,e=Yt)=>{if(!t.doc)return e;let s=e;for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),Re=u(function(t,e){return e.db.getClasses()},"getClasses"),Ne=u(async function(t,e,s,a){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:r,state:h,layout:d}=w();a.db.extract(a.db.getRootDocV2());const S=a.db.getData(),f=te(e,r);S.type=a.type,S.layoutAlgorithm=d,S.nodeSpacing=h?.nodeSpacing||50,S.rankSpacing=h?.rankSpacing||50,S.markers=["barb"],S.diagramId=e,await se(S,f);const T=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((m,A)=>{const v=typeof A=="string"?A:typeof A?.id=="string"?A.id:"";if(!v){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(A));return}const p=f.node()?.querySelectorAll("g");let k;if(p?.forEach(I=>{I.textContent?.trim()===v&&(k=I)}),!k){b.warn("⚠️ Could not find node matching text:",v);return}const R=k.parentNode;if(!R){b.warn("⚠️ Node has no parent, cannot wrap:",v);return}const L=document.createElementNS("http://www.w3.org/2000/svg","a"),$=m.url.replace(/^"+|"+$/g,"");if(L.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",$),L.setAttribute("target","_blank"),m.tooltip){const I=m.tooltip.replace(/^"+|"+$/g,"");L.setAttribute("title",I)}R.replaceChild(L,k),L.appendChild(k),b.info("🔗 Wrapped node in tag for:",v,m.url)})}catch(_){b.error("❌ Error injecting clickable links:",_)}ie.insertTitle(f,"statediagramTitleText",h?.titleTopMargin??25,a.db.getDiagramTitle()),ee(f,T,et,h?.useMaxWidth??!0)},"draw"),Ve={getClasses:Re,draw:Ne,getDir:Kt},St=new Map,G=0;function yt(t="",e=0,s="",a=At){const r=s!==null&&s.length>0?`${a}${s}`:"";return`${Ie}-${t}${r}-${e}`}u(yt,"stateDomId");var we=u((t,e,s,a,r,h,d,S)=>{b.trace("items",e),e.forEach(f=>{switch(f.stmt){case X:Z(t,f,s,a,r,h,d,S);break;case tt:Z(t,f,s,a,r,h,d,S);break;case Ct:{Z(t,f.state1,s,a,r,h,d,S),Z(t,f.state2,s,a,r,h,d,S);const T={id:"edge"+G,start:f.state1.id,end:f.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:Bt,labelStyle:"",label:U.sanitizeText(f.description??"",w()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:jt,classes:Ht,look:d};r.push(T),G++}break}})},"setupDoc"),$t=u((t,e=Yt)=>{let s=e;if(t.doc)for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function Q(t,e,s){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(r=>{const h=s.get(r);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));const a=t.find(r=>r.id===e.id);a?Object.assign(a,e):t.push(e)}u(Q,"insertOrUpdateNode");function Xt(t){return t?.classes?.join(" ")??""}u(Xt,"getClassesFromDbInfo");function Jt(t){return t?.styles??[]}u(Jt,"getStylesFromDbInfo");var Z=u((t,e,s,a,r,h,d,S)=>{const f=e.id,T=s.get(f),_=Xt(T),m=Jt(T),A=w();if(b.info("dataFetcher parsedItem",e,T,m),f!=="root"){let v=Dt;e.start===!0?v=ye:e.start===!1&&(v=ge),e.type!==tt&&(v=e.type),St.get(f)||St.set(f,{id:f,shape:v,description:U.sanitizeText(f,A),cssClasses:`${_} ${me}`,cssStyles:m});const p=St.get(f);e.description&&(Array.isArray(p.description)?(p.shape=kt,p.description.push(e.description)):p.description?.length&&p.description.length>0?(p.shape=kt,p.description===f?p.description=[e.description]:p.description=[p.description,e.description]):(p.shape=Dt,p.description=e.description),p.description=U.sanitizeTextOrArray(p.description,A)),p.description?.length===1&&p.shape===kt&&(p.type==="group"?p.shape=Nt:p.shape=Dt),!p.type&&e.doc&&(b.info("Setting cluster for XCX",f,$t(e)),p.type="group",p.isGroup=!0,p.dir=$t(e),p.shape=e.type===Gt?Rt:Nt,p.cssClasses=`${p.cssClasses} ${Ae} ${h?Le:""}`);const k={labelStyle:"",shape:p.shape,label:p.description,cssClasses:p.cssClasses,cssCompiledStyles:[],cssStyles:p.cssStyles,id:f,dir:p.dir,domId:yt(f,G),type:p.type,isGroup:p.type==="group",padding:8,rx:10,ry:10,look:d};if(k.shape===Rt&&(k.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",f," to be child of its parent ",t.id),k.parentId=t.id),k.centerLabel=!0,e.note){const R={labelStyle:"",shape:Te,label:e.note.text,cssClasses:ve,cssStyles:[],cssCompiledStyles:[],id:f+Oe+"-"+G,domId:yt(f,G,Wt),type:p.type,isGroup:p.type==="group",padding:A.flowchart?.padding,look:d,position:e.note.position},L=f+wt,$={labelStyle:"",shape:Ee,label:e.note.text,cssClasses:p.cssClasses,cssStyles:[],id:f+wt,domId:yt(f,G,zt),type:"group",isGroup:!0,padding:16,look:d,position:e.note.position};G++,$.id=L,R.parentId=L,Q(a,$,S),Q(a,R,S),Q(a,k,S);let I=f,P=R.id;e.note.position==="left of"&&(I=R.id,P=f),r.push({id:I+"-"+P,start:I,end:P,arrowhead:"none",arrowTypeEnd:"",style:Bt,labelStyle:"",classes:ke,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:jt,look:d})}else Q(a,k,S)}e.doc&&(b.trace("Adding nodes children "),we(e,e.doc,s,a,r,!h,d,S))},"dataFetcher"),$e=u(()=>{St.clear(),G=0},"reset"),C={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=u(()=>new Map,"newClassesList"),Ft=u(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=u(t=>JSON.parse(JSON.stringify(t)),"clone"),j,Me=(j=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=oe,this.setDiagramTitle=le,this.getDiagramTitle=ce,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(const r of Array.isArray(e)?e:e.doc)switch(r.stmt){case X:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case Ct:this.addRelation(r.state1,r.state2,r.description);break;case fe:this.addStyleClass(r.id.trim(),r.classes);break;case pe:this.handleStyleDef(r);break;case Se:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}const s=this.getStates(),a=w();$e(),Z(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(const r of this.nodes)if(Array.isArray(r.label)){if(r.description=r.label.slice(1),r.isGroup&&r.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`);r.label=r.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),a=e.styleClass.split(",");for(const r of s){let h=this.getState(r);if(!h){const d=r.trim();this.addState(d),h=this.getState(d)}h&&(h.styles=a.map(d=>d.replace(/;/g,"")?.trim()))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===Ct){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===X&&(s.id===C.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==K&&s.stmt!==X||!s.doc)return;const r=[];let h=[];for(const d of s.doc)if(d.type===Gt){const S=pt(d);S.doc=pt(h),r.push(S),h=[]}else h.push(d);if(r.length>0&&h.length>0){const d={stmt:X,id:he(),type:"divider",doc:pt(h)};r.push(pt(d)),s.doc=r}s.doc.forEach(d=>this.docTranslator(s,d,!0))}getRootDocV2(){return this.docTranslator({id:K,stmt:K},{id:K,stmt:K,doc:this.rootDoc},!0),{id:K,doc:this.rootDoc}}addState(e,s=tt,a=void 0,r=void 0,h=void 0,d=void 0,S=void 0,f=void 0){const T=e?.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,r),this.currentDocument.states.set(T,{stmt:X,id:T,descriptions:[],type:s,doc:a,note:h,classes:[],styles:[],textStyles:[]});else{const _=this.currentDocument.states.get(T);if(!_)throw new Error(`State not found: ${T}`);_.doc||(_.doc=a),_.type||(_.type=s)}if(r&&(b.info("Setting state description",T,r),(Array.isArray(r)?r:[r]).forEach(m=>this.addDescription(T,m.trim()))),h){const _=this.currentDocument.states.get(T);if(!_)throw new Error(`State not found: ${T}`);_.note=h,_.note.text=U.sanitizeText(_.note.text,w())}d&&(b.info("Setting state classes",T,d),(Array.isArray(d)?d:[d]).forEach(m=>this.setCssClass(T,m.trim()))),S&&(b.info("Setting state styles",T,S),(Array.isArray(S)?S:[S]).forEach(m=>this.setStyle(T,m.trim()))),f&&(b.info("Setting state styles",T,S),(Array.isArray(f)?f:[f]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,ue())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),b.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===C.START_NODE?(this.startEndCount++,`${C.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=tt){return e===C.START_NODE?C.START_TYPE:s}endIdIfNeeded(e=""){return e===C.END_NODE?(this.startEndCount++,`${C.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=tt){return e===C.END_NODE?C.END_TYPE:s}addRelationObjs(e,s,a=""){const r=this.startIdIfNeeded(e.id.trim()),h=this.startTypeIfNeeded(e.id.trim(),e.type),d=this.startIdIfNeeded(s.id.trim()),S=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(r,h,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(d,S,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:U.sanitizeText(a,w())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){const r=this.startIdIfNeeded(e.trim()),h=this.startTypeIfNeeded(e),d=this.endIdIfNeeded(s.trim()),S=this.endTypeIfNeeded(s);this.addState(r,h),this.addState(d,S),this.currentDocument.relations.push({id1:r,id2:d,relationTitle:a?U.sanitizeText(a,w()):void 0})}}addDescription(e,s){const a=this.currentDocument.states.get(e),r=s.startsWith(":")?s.replace(":","").trim():s;a?.descriptions?.push(U.sanitizeText(r,w()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const a=this.classes.get(e);s&&a&&s.split(C.STYLECLASS_SEP).forEach(r=>{const h=r.replace(/([^;]*);/,"$1").trim();if(RegExp(C.COLOR_KEYWORD).exec(r)){const S=h.replace(C.FILL_KEYWORD,C.BG_FILL).replace(C.COLOR_KEYWORD,C.FILL_KEYWORD);a.textStyles.push(S)}a.styles.push(h)})}getClasses(){return this.classes}setCssClass(e,s){e.split(",").forEach(a=>{let r=this.getState(a);if(!r){const h=a.trim();this.addState(h),r=this.getState(h)}r?.classes?.push(s)})}setStyle(e,s){this.getState(e)?.styles?.push(s)}setTextStyle(e,s){this.getState(e)?.textStyles?.push(s)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Ot)}getDirection(){return this.getDirectionStatement()?.value??de}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Ot,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=w();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Kt(this.getRootDocV2())}}getConfig(){return w().state}},u(j,"StateDB"),j.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},j),Pe=u(t=>` +defs #statediagram-barbEnd { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: 1; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: 1; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: 1px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: 1px; +} +#statediagram-barbEnd { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: 1px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +#dependencyStart, #dependencyEnd { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: 1; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} +`,"getStyles"),Ue=Pe;export{Me as S,Be as a,Ve as b,Ue as s}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js new file mode 100644 index 0000000000..82b44f820a --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-FMBD7UC4-fSM8np9_.js @@ -0,0 +1,15 @@ +import{_ as e}from"./index-DpOBiJiD.js";var l=e(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles");export{l as g}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js new file mode 100644 index 0000000000..888f4f50ae --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-BcGvhJAc.js @@ -0,0 +1 @@ +import{i as h,k as i,l as p,r as x,j as M,n as H}from"./index-DpOBiJiD.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=i(),f=p(o),u=t||"header";return x.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:H(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var R=s;export{R as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js deleted file mode 100644 index 0831e92f07..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-NXd1g0Qd.js +++ /dev/null @@ -1 +0,0 @@ -import{l as h,be as p,R as x,r as i,j as M,Z as R}from"./index-BZLU40Mk.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:R(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var N=s;export{N as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js new file mode 100644 index 0000000000..eee3be2380 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QN33PNHL-Cb84mGB3.js @@ -0,0 +1 @@ +import{_ as a,G as w,E as x}from"./index-DpOBiJiD.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js new file mode 100644 index 0000000000..951c211fc8 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-QZHKN3VN-D5XXShj3.js @@ -0,0 +1 @@ +import{_ as s}from"./index-DpOBiJiD.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js new file mode 100644 index 0000000000..509f41dd25 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CH4dnGpZ.js @@ -0,0 +1 @@ +import{i as q,q as y,j as e,r as t,C as D}from"./index-DpOBiJiD.js";var E=q((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:C,getInputWrapperProps:o,getMainWrapperProps:I,getHelperWrapperProps:b,getDescriptionProps:i,getErrorMessageProps:l,getClearButtonProps:f}=y({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(D,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...b(),children:W?e.jsx("div",{...l(),children:s}):e.jsx("div",{...i(),children:r})})},[x,P,s,r,b,l,i]),a=t.useMemo(()=>e.jsxs("div",{...C(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,C]),R=t.useMemo(()=>m?e.jsxs("div",{...I(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,I,o,l,i]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var T=E;export{T as i}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js deleted file mode 100644 index 9c271739b1..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-CJa0HuAU.js +++ /dev/null @@ -1 +0,0 @@ -import{l as y,bn as D,j as e,r as t,am as N}from"./index-BZLU40Mk.js";var E=y((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:b,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=D({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(N,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...b(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,b]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js new file mode 100644 index 0000000000..64a336d6e7 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-TZMSLE5B-DMZmIkT7.js @@ -0,0 +1 @@ +import{_ as n,al as o,M as l}from"./index-DpOBiJiD.js";var x=n((a,t)=>{const e=a.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const r in t.attrs)e.attr(r,t.attrs[r]);return t.class&&e.attr("class",t.class),e},"drawRect"),d=n((a,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(a,e).lower()},"drawBackgroundRect"),g=n((a,t)=>{const e=t.text.replace(o," "),r=a.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);const s=r.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(e),r},"drawText"),h=n((a,t,e,r)=>{const s=a.append("image");s.attr("x",t),s.attr("y",e);const i=l.sanitizeUrl(r);s.attr("xlink:href",i)},"drawImage"),m=n((a,t,e,r)=>{const s=a.append("use");s.attr("x",t),s.attr("y",e);const i=l.sanitizeUrl(r);s.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),y=n(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=n(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");export{d as a,p as b,m as c,x as d,h as e,g as f,y as g}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js new file mode 100644 index 0000000000..711c0d7971 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-2ON5EDUG-DRA-t-oi.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DtfSht4V.js";import{_ as i}from"./index-DpOBiJiD.js";import"./chunk-FMBD7UC4-fSM8np9_.js";import"./chunk-55IACEB6-DUaTCW0f.js";import"./chunk-QN33PNHL-Cb84mGB3.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js new file mode 100644 index 0000000000..711c0d7971 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/classDiagram-v2-WZHVMYZB-DRA-t-oi.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-B4BG7PRW-DtfSht4V.js";import{_ as i}from"./index-DpOBiJiD.js";import"./chunk-FMBD7UC4-fSM8np9_.js";import"./chunk-55IACEB6-DUaTCW0f.js";import"./chunk-QN33PNHL-Cb84mGB3.js";var p={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{p as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js new file mode 100644 index 0000000000..51126b5cc5 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/clone-CQ2NOoIB.js @@ -0,0 +1 @@ +import{c as r}from"./forEach-CTOHlvm6.js";var e=4;function a(o){return r(o,e)}export{a as c}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js new file mode 100644 index 0000000000..8461000717 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cose-bilkent-S5V4N54A-CCAC2cqm.js @@ -0,0 +1 @@ +import{bw as lt,_ as V,E as k,B as gt}from"./index-DpOBiJiD.js";import{c as tt}from"./cytoscape.esm-5J0xJHOV.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=lt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=gt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),At=Lt;export{At as render}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js new file mode 100644 index 0000000000..969925daae --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/cytoscape.esm-5J0xJHOV.js @@ -0,0 +1,321 @@ +function Bs(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Jl(r,e,t){return(e=jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ac(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);l=!0);}catch(v){u=!0,n=v}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}function ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sc(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(r,e){return ec(r)||nc(r,e)||Xs(r,e)||ic()}function mn(r){return rc(r)||ac(r)||Xs(r)||sc()}function oc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function jl(r){var e=oc(r,"string");return typeof e=="symbol"?e:e+""}function ar(r){"@babel/helpers - typeof";return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(r)}function Xs(r,e){if(r){if(typeof r=="string")return Bs(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Bs(r,e):void 0}}var rr=typeof window>"u"?null:window,To=rr?rr.navigator:null;rr&&rr.document;var uc=ar(""),ev=ar({}),lc=ar(function(){}),vc=typeof HTMLElement>"u"?"undefined":ar(HTMLElement),La=function(e){return e&&e.instanceString&&Ue(e.instanceString)?e.instanceString():null},ge=function(e){return e!=null&&ar(e)==uc},Ue=function(e){return e!=null&&ar(e)===lc},_e=function(e){return!Dr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Le=function(e){return e!=null&&ar(e)===ev&&!_e(e)&&e.constructor===Object},fc=function(e){return e!=null&&ar(e)===ev},ae=function(e){return e!=null&&ar(e)===ar(1)&&!isNaN(e)},cc=function(e){return ae(e)&&Math.floor(e)===e},bn=function(e){if(vc!=="undefined")return e!=null&&e instanceof HTMLElement},Dr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Ys=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},dc=function(e){return La(e)==="event"},ut=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},hc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},gc=function(e){return Le(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},pc=function(e){return fc(e)&&Ue(e.then)},yc=function(){return To&&To.userAgent.match(/msie|trident|edge/i)},Qt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;st?1:0},Tc=function(e,t){return-1*nv(e,t)},be=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+wc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),l=Math.round(255*v(h,c,a)),u=Math.round(255*v(h,c,a-1/3))}t=[o,l,u,s]}return t},Dc=function(e){var t,a=new RegExp("^"+mc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Bc=function(e){return Pc[e.toLowerCase()]},iv=function(e){return(_e(e)?e:null)||Bc(e)||Sc(e)||Dc(e)||kc(e)},Pc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},sv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i=l||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function D(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function B(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,l),w(y)}return d===void 0&&(d=setTimeout(T,l)),h}return P.cancel=D,P.flush=B,P}return fi=s,fi}var Vc=Fc(),Fa=Oa(Vc),ci=rr?rr.performance:null,lv=ci&&ci.now?function(){return ci.now()}:function(){return Date.now()},qc=(function(){if(rr){if(rr.requestAnimationFrame)return function(r){rr.requestAnimationFrame(r)};if(rr.mozRequestAnimationFrame)return function(r){rr.mozRequestAnimationFrame(r)};if(rr.webkitRequestAnimationFrame)return function(r){rr.webkitRequestAnimationFrame(r)};if(rr.msRequestAnimationFrame)return function(r){rr.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(lv())},1e3/60)}})(),wn=function(e){return qc(e)},Yr=lv,Tt=9261,vv=65599,Ht=5381,fv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt,a=t,n;n=e.next(),!n.done;)a=a*vv+n.value|0;return a},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt;return t*vv+e|0},Ta=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ht;return(t<<5)+t+e|0},_c=function(e,t){return e*2097152+t},et=function(e){return e[0]*2097152+e[1]},Xa=function(e,t){return[Ca(e[0],t[0]),Ta(e[1],t[1])]},qo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0;n--)e[n]===t&&e.splice(n,1)},eo=function(e){e.splice(0,e.length)},Qc=function(e,t){for(var a=0;a"u"?"undefined":ar(Set))!==jc?Set:ed,In=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ys(e)){$e("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){$e("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ra,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];_e(t.classes)?u=t.classes:ge(t.classes)&&(u=t.classes.split(/\s+/));for(var v=0,f=u.length;vm?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);bD;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;wB;0<=B?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),D=0;D0)for(O.unshift(M);f[G];){var N=f[G];O.unshift(N.edge),O.unshift(N.node),V=N.node,G=V.id()}return o.spawn(O)}}}},od={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,l=function(w){for(var E=0;E0;){if(E(),x++,w===v){for(var T=[],k=i,D=v,B=p[D];T.unshift(k),B!=null&&T.unshift(B),k=g[D],k!=null;)D=k.id(),B=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;AB&&(d[D]=B,m[D]=k,b[D]=E),!i){var P=k*v+T;!i&&d[P]>B&&(d[P]=B,m[P]=T,b[P]=E)}}}for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:s,ie=b(we),de=[],he=ie;;){if(he==null)return t.spawn();var Ee=m(he),pe=Ee.edge,Se=Ee.pred;if(de.unshift(he[0]),he.same(ye)&&de.length>0)break;pe!=null&&de.unshift(pe),he=Se}return l.spawn(de)},C=0;C=0;v--){var f=u[v],c=f[1],h=f[2];(t[c]===o&&t[h]===l||t[c]===l&&t[h]===o)&&u.splice(v,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*t.length);t=gd(i,e,t),a--}return t},pd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/hd);if(i<2){$e("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],v=0;v1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a0&&e.splice(0,t));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},Ed=function(e){return Math.PI*e/180},Ya=function(e,t){return Math.atan2(t,e)-Math.PI/2},ro=Math.log2||function(r){return Math.log(r)/Math.log(2)},to=function(e){return e>0?1:e<0?-1:0},Bt=function(e,t){return Math.sqrt(Et(e,t))},Et=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Cd=function(e){for(var t=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Sd=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Dd=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},mv=function(e,t,a){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},un=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ln=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Je(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ao=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},nt=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Ko=function(e,t){return nt(e,t.x,t.y)},bv=function(e,t){return nt(e,t.x1,t.y1)&&nt(e,t.x2,t.y2)},Bd=(gi=Math.hypot)!==null&&gi!==void 0?gi:function(r,e){return Math.sqrt(r*r+e*e)};function Pd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Bd(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,D=0;D7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?vt(i,s):l,v=i/2,f=s/2;u=Math.min(u,v,f);var c=u!==v,h=u!==f,d;if(c){var y=a-v+u-o,g=n-f-o,p=a+v-u+o,m=g;if(d=it(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+u-o,E=b,C=n+f-u+o;if(d=it(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+u-o,T=n+f+o,k=a+v-u+o,D=T;if(d=it(e,t,a,n,x,T,k,D,!1),d.length>0)return d}if(h){var B=a-v-o,P=n-f+u-o,A=B,R=n+f-u+o;if(d=it(e,t,a,n,B,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+u,M=n-f+u;if(L=ya(e,t,a,n,I,M,u+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-u,V=n-f+u;if(L=ya(e,t,a,n,O,V,u+o),L.length>0&&L[0]>=O&&L[1]<=V)return[L[0],L[1]]}{var G=a+v-u,N=n+f-u;if(L=ya(e,t,a,n,G,N,u+o),L.length>0&&L[0]>=G&&L[1]>=N)return[L[0],L[1]]}{var F=a-v+u,U=n+f-u;if(L=ya(e,t,a,n,F,U,u+o),L.length>0&&L[0]<=F&&L[1]>=U)return[L[0],L[1]]}return[]},Rd=function(e,t,a,n,i,s,o){var l=o,u=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=v+l&&f-l<=t&&t<=c+l},Md=function(e,t,a,n,i,s,o,l,u){var v={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(ev.x2||tv.y2)},Ld=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-t+s)/o,u=(-t-s)/o;return[l,u]},Id=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,l,u,v,f,c,h,d;if(l=(3*a-t*t)/9,u=-(27*n)+t*(9*a-2*(t*t)),u/=54,o=l*l*l+u*u,i[1]=0,h=t/3,o>0){f=u+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}l=-l,v=l*l*l,v=Math.acos(u/Math.sqrt(v)),d=2*Math.sqrt(l),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Od=function(e,t,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,v=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,f=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*t+2*s*s+2*s*t-l*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Id(u,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E=0?wu?(e-i)*(e-i)+(t-s)*(t-s):v-c},Sr=function(e,t,a){for(var n,i,s,o,l,u=0,v=0;v=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>t&&u++;else continue;return u%2!==0},Zr=function(e,t,a,n,i,s,o,l,u){var v=new Array(a.length),f;l[0]!=null?(f=Math.atan(l[1]/l[0]),l[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=l;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d0){var g=Cn(v,-u);y=En(g)}else y=v;return Sr(e,t,y)},zd=function(e,t,a,n,i,s,o,l){for(var u=new Array(a.length*2),v=0;v=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*l[0]+e,w=m[0]*l[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*l[0]+e,C=m[1]*l[1]+t;return[b,w,E,C]}else return[b,w]},pi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},it=function(e,t,a,n,i,s,o,l,u){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=l-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:u?[e+b*f,t+b*d]:[]}else return g===0||p===0?pi(e,a,o)===o?[o,l]:pi(e,a,i)===i?[i,s]:pi(i,o,a)===a?[a,n]:[]:[]},Vd=function(e,t,a,n,i){var s=[],o=n/2,l=i/2,u=t,v=a;s.push({x:u+o*e[0],y:v+l*e[1]});for(var f=1;f0){var y=Cn(f,-l);h=En(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;gv&&(v=w)},get:function(b){return u[b]}},c=0;c0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[B]+I&&(x[A]=x[B]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[B]+I&&(C[A]=C[A]+C[B],E[A].push(B))}else for(var M=0;M0;){for(var N=w.pop(),F=0;F0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},eh=function(e,t){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:ah,o=n,l,u,v=0;v=2?va(e,t,a,0,Jo,nh):va(e,t,a,0,Qo)},squaredEuclidean:function(e,t,a){return va(e,t,a,0,Jo)},manhattan:function(e,t,a){return va(e,t,a,0,Qo)},max:function(e,t,a){return va(e,t,a,-1/0,ih)}};Jt["squared-euclidean"]=Jt.squaredEuclidean;Jt.squaredeuclidean=Jt.squaredEuclidean;function Nn(r,e,t,a,n,i){var s;return Ue(r)?s=r:s=Jt[r]||Jt.euclidean,e===0&&Ue(r)?s(n,i):s(e,t,a,n,i)}var sh=cr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),io=function(e){return sh(e)},Tn=function(e,t,a,n,i){var s=i!=="kMedoids",o=s?function(f){return a[f]}:function(f){return n[f](a)},l=function(c){return n[c](t)},u=a,v=t;return Nn(e,n.length,o,l,u,v)},mi=function(e,t,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(t),l=null,u=0;ua)return!1}return!0},lh=function(e,t,a){for(var n=0;no&&(o=t[u][v],l=v);i[l].push(e[u])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[s],y=t[n[s]],g;i.mode==="dendrogram"?g={left:d,right:y,key:d.key}:g={value:d.value.concat(y.value),key:d.key},e[d.index]=g,e.splice(y.index,1),t[d.key]=g;for(var p=0;pa[y.key][m.key]&&(l=a[y.key][m.key])):i.linkage==="max"?(l=a[d.key][m.key],a[d.key][m.key]0&&n.push(i);return n},nu=function(e,t,a){for(var n=[],i=0;io&&(s=u,o=t[i*e+u])}s>0&&n.push(s)}for(var v=0;vu&&(l=v,u=f)}a[i]=s[l]}return n=nu(e,t,a),n},iu=function(e){for(var t=this.cy(),a=this.nodes(),n=xh(e),i={},s=0;s=B?(P=B,B=R,A=L):R>P&&(P=R);for(var I=0;I0?1:0;x[k%n.minIterations*o+F]=U,N+=U}if(N>0&&(k>=n.minIterations-1||k==n.maxIterations-1)){for(var Q=0,K=0;K1||C>1)&&(o=!0),f[b]=[],m.outgoers().forEach(function(T){T.isEdge()&&f[b].push(T.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var w=m.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),f[b]=[],m.connectedEdges().forEach(function(E){return f[b].push(E.id())})}else c[b]=[m.source().id(),m.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(u&&l)if(i){if(v&&u!=v)return h;v=u}else{if(v&&u!=v&&l!=v)return h;v||(v=u)}else v||(v=s[0].id());var d=function(b){for(var w=b,E=[b],C,x,T;f[w].length;)C=f[w].shift(),x=c[C][0],T=c[C][1],w!=T?(f[T]=f[T].filter(function(k){return k!=C}),w=T):!i&&w!=x&&(f[x]=f[x].filter(function(k){return k!=C}),w=x),E.unshift(C),E.unshift(w);return E},y=[],g=[];for(g=d(v);g.length!=1;)f[g[0]].length==0?(y.unshift(s.getElementById(g.shift())),y.unshift(s.getElementById(g.shift()))):g=d(g.shift()).concat(g);y.unshift(s.getElementById(g.shift()));for(var p in f)if(f[p].length)return h;return h.found=!0,h.trail=this.spawn(y,!0),h}},Qa=function(){var e=this,t={},a=0,n=0,i=[],s=[],o={},l=function(c,h){for(var d=s.length-1,y=[],g=e.spawn();s[d].x!=c||s[d].y!=h;)y.push(s.pop().edge),d--;y.push(s.pop().edge),y.forEach(function(p){var m=p.connectedNodes().intersection(e);g.merge(p),m.forEach(function(b){var w=b.id(),E=b.connectedEdges().intersection(e);g.merge(b),t[w].cutVertex?g.merge(E.filter(function(C){return C.isLoop()})):g.merge(E)})}),i.push(g)},u=function(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var y=e.getElementById(h).connectedEdges().intersection(e);if(y.size()===0)i.push(e.spawn(e.getElementById(h)));else{var g,p,m,b;y.forEach(function(w){g=w.source().id(),p=w.target().id(),m=g===h?p:g,m!==d&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:h,y:m,edge:w})),m in t?t[h].low=Math.min(t[h].low,t[m].id):(u(c,m,h),t[h].low=Math.min(t[h].low,t[m].low),t[h].id<=t[m].low&&(t[h].cutVertex=!0,l(h,m))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,u(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},Ph={hopcroftTarjanBiconnected:Qa,htbc:Qa,htb:Qa,hopcroftTarjanBiconnectedComponents:Qa},Ja=function(){var e=this,t={},a=0,n=[],i=[],s=e.spawn(e),o=function(u){i.push(u),t[u]={index:a,low:a++,explored:!1};var v=e.getElementById(u).connectedEdges().intersection(e);if(v.forEach(function(y){var g=y.target().id();g!==u&&(g in t||o(g),t[g].explored||(t[u].low=Math.min(t[u].low,t[g].low)))}),t[u].index===t[u].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[u].index,t[c].explored=!0,c===u)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||o(u)}}),{cut:s,components:n}},Ah={tarjanStronglyConnected:Ja,tsc:Ja,tscc:Ja,tarjanStronglyConnectedComponents:Ja},Dv={};[Sa,sd,od,ld,fd,dd,pd,Hd,Xt,Yt,Rs,th,gh,bh,kh,Bh,Ph,Ah].forEach(function(r){be(Dv,r)});var Bv=0,Pv=1,Av=2,Nr=function(e){if(!(this instanceof Nr))return new Nr(e);this.id="Thenable/1.0.7",this.state=Bv,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Nr.prototype={fulfill:function(e){return su(this,Pv,"fulfillValue",e)},reject:function(e){return su(this,Av,"rejectReason",e)},then:function(e,t){var a=this,n=new Nr;return a.onFulfilled.push(uu(e,n,"fulfill")),a.onRejected.push(uu(t,n,"reject")),Rv(a),n.proxy}};var su=function(e,t,a,n){return e.state===Bv&&(e.state=t,e[a]=n,Rv(e)),e},Rv=function(e){e.state===Pv?ou(e,"onFulfilled",e.fulfillValue):e.state===Av&&ou(e,"onRejected",e.rejectReason)},ou=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var o=0;o0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}return qi=e,qi}var _i,Ru;function Yh(){if(Ru)return _i;Ru=1;var r=Vn();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return _i=e,_i}var Gi,Mu;function Zh(){if(Mu)return Gi;Mu=1;var r=$h(),e=Uh(),t=Kh(),a=Xh(),n=Yh();function i(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o-1&&a%1==0&&a0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){_e(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};vn.className=vn.classNames=vn.classes;var Me={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:tr,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Me.variable="(?:[\\w-.]|(?:\\\\"+Me.metaChar+"))+";Me.className="(?:[\\w-]|(?:\\\\"+Me.metaChar+"))+";Me.value=Me.string+"|"+Me.number;Me.id=Me.variable;(function(){var r,e,t;for(r=Me.comparatorOp.split("|"),t=0;t=0)&&e!=="="&&(Me.comparatorOp+="|\\!"+e)})();var qe=function(){return{checks:[]}},se={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Os=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Tc(r.selector,e.selector)}),Dg=(function(){for(var r={},e,t=0;t0&&v.edgeCount>0)return Ve("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return Ve("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&Ve("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Lg=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},t=function(v){return ge(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case se.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case se.DATA_COMPARE:{var y=v.field,g=v.operator;return"["+y+a(e(g))+t(h)+"]"}case se.DATA_BOOL:{var p=v.operator,m=v.field;return"["+e(p)+m+"]"}case se.DATA_EXIST:{var b=v.field;return"["+b+"]"}case se.META_COMPARE:{var w=v.operator,E=v.field;return"[["+E+a(e(w))+t(h)+"]]"}case se.STATE:return h;case se.ID:return"#"+h;case se.CLASS:return"."+h;case se.PARENT:case se.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case se.ANCESTOR:case se.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case se.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),T=i(v.right,f);return C+(C.length>0?" ":"")+x+T}case se.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},s="",o=0;o1&&o=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||o||v)&&(l=!i&&!s?"":""+e,u=""+a),v&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),t){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e0;){var v=n.shift();e(v),i.add(v.id()),o&&a(n,i,v)}return r}function Vv(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,Vv)};function qv(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}jt.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,qv)};function _g(r,e,t){qv(r,e,t),Vv(r,e,t)}jt.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return lo(this,r,e,_g)};jt.ancestors=jt.parents;var Ba,_v;Ba=_v={data:Fe.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Fe.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Fe.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fe.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Fe.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Fe.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ba.attr=Ba.data;Ba.removeAttr=Ba.removeData;var Gg=_v,_n={};function ps(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,s=0;se}),minIndegree:Nt("indegree",function(r,e){return re}),minOutdegree:Nt("outdegree",function(r,e){return re})});be(_n,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?u.position(e,t+h[e]):i!==void 0&&u.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),y=o?a.parent():null,g=y&&y.length>0,p=g;g&&(y=y[0]);var m=p?y.position():{x:0,y:0};return i={x:d.x-m.x,y:d.y-m.y},e===void 0?i:i[e]}else if(!s)return;return this}};Or.modelPosition=Or.point=Or.position;Or.modelPositions=Or.points=Or.positions;Or.renderedPoint=Or.renderedPosition;Or.relativePoint=Or.relativePosition;var Hg=Gv,Zt,pt;Zt=pt={};pt.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};pt.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};pt.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),c=o.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(k,D,B){var P=0,A=0,R=D+B;return k>0&&R>0&&(P=D/R*k,A=B/R*k),{biasDiff:P,biasComplementDiff:A}}function d(k,D,B,P){if(B.units==="%")switch(P){case"width":return k>0?B.pfValue*k:0;case"height":return D>0?B.pfValue*D:0;case"average":return k>0&&D>0?B.pfValue*(k+D)/2:0;case"min":return k>0&&D>0?k>D?B.pfValue*D:B.pfValue*k:0;case"max":return k>0&&D>0?k>D?B.pfValue*k:B.pfValue*D:0;default:return 0}else return B.units==="px"?B.pfValue:0}var y=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(y=y*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var p=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(p=p*100/v.height.val);var m=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(m=m*100/v.height.val);var b=h(v.width.val-f.w,y,g),w=b.biasDiff,E=b.biasComplementDiff,C=h(v.height.val-f.h,p,m),x=C.biasDiff,T=C.biasComplementDiff;o.autoPadding=d(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+E)/2,o.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+T)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},tt=function(e,t){return t==null?e:Ir(e,t.x1,t.y1,t.x2,t.y2)},fa=function(e,t,a){return Tr(e,t,a)},ja=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,s=i.arrowWidth/2,o=t.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){a==="source"?(l=i.srcX,u=i.srcY):a==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=l-s,f.y1=u-s,f.x2=l+s,f.y2=u+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,un(f,1),Ir(e,f.x1,f.y1,f.x2,f.y2)}}},ys=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,s=i.rstyle,o=t.pstyle(n+"label").strValue;if(o){var l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),v=fa(s,"labelWidth",a),f=fa(s,"labelHeight",a),c=fa(s,"labelX",a),h=fa(s,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,y=t.pstyle(n+"text-margin-y").pfValue,g=t.isEdge(),p=t.pstyle(n+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,E=t.pstyle("text-background-padding").pfValue,C=2,x=f,T=v,k=T/2,D=x/2,B,P,A,R;if(g)B=c-k,P=c+k,A=h-D,R=h+D;else{switch(l.value){case"left":B=c-T,P=c;break;case"center":B=c-k,P=c+k;break;case"right":B=c,P=c+T;break}switch(u.value){case"top":A=h-x,R=h;break;case"center":A=h-D,R=h+D;break;case"bottom":A=h,R=h+x;break}}var L=d-Math.max(m,w)-E-C,I=d+Math.max(m,w)+E+C,M=y-Math.max(m,w)-E-C,O=y+Math.max(m,w)+E+C;B+=L,P+=I,A+=M,R+=O;var V=a||"main",G=i.labelBounds,N=G[V]=G[V]||{};N.x1=B,N.y1=A,N.x2=P,N.y2=R,N.w=P-B,N.h=R-A,N.leftPad=L,N.rightPad=I,N.topPad=M,N.botPad=O;var F=g&&p.strValue==="autorotate",U=p.pfValue!=null&&p.pfValue!==0;if(F||U){var Q=F?fa(i.rstyle,"labelAngle",a):p.pfValue,K=Math.cos(Q),j=Math.sin(Q),re=(B+P)/2,ne=(A+R)/2;if(!g){switch(l.value){case"left":re=P;break;case"right":re=B;break}switch(u.value){case"top":ne=R;break;case"bottom":ne=A;break}}var J=function(Ce,we){return Ce=Ce-re,we=we-ne,{x:Ce*K-we*j+re,y:Ce*j+we*K+ne}},z=J(B,A),q=J(B,R),H=J(P,A),Y=J(P,R);B=Math.min(z.x,q.x,H.x,Y.x),P=Math.max(z.x,q.x,H.x,Y.x),A=Math.min(z.y,q.y,H.y,Y.y),R=Math.max(z.y,q.y,H.y,Y.y)}var te=V+"Rot",ce=G[te]=G[te]||{};ce.x1=B,ce.y1=A,ce.x2=P,ce.y2=R,ce.w=P-B,ce.h=R-A,Ir(e,B,A,P,R),Ir(i.labelBounds.all,B,A,P,R)}return e}},ol=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,s=n+i;Wv(e,t,a,s,"outside",s/2)}},Wv=function(e,t,a,n,i,s){if(!(a===0||n<=0||i==="inside")){var o=t.cy(),l=t.pstyle("shape").value,u=o.renderer().nodeShapes[l],v=t.position(),f=v.x,c=v.y,h=t.width(),d=t.height();if(u.hasMiterBounds){i==="center"&&(n/=2);var y=u.miterBounds(f,c,h,d,n);tt(e,y)}else s!=null&&s>0&&ln(e,[s,s,s,s])}},Wg=function(e,t){if(!t.cy().headless()){var a=t.pstyle("border-opacity").value,n=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Wv(e,t,a,n,i)}},$g=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=wr(),o=e._private,l=e.isNode(),u=e.isEdge(),v,f,c,h,d,y,g=o.rstyle,p=l&&n?e.pstyle("bounds-expansion").pfValue:[0],m=function(Ae){return Ae.pstyle("display").value!=="none"},b=!n||m(e)&&(!u||m(e.source())&&m(e.target()));if(b){var w=0,E=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(E=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var T=Math.max(E,x),k=0,D=0;if(n&&(k=e.pstyle("width").pfValue,D=k/2),l&&t.includeNodes){var B=e.position();d=B.x,y=B.y;var P=e.outerWidth(),A=P/2,R=e.outerHeight(),L=R/2;v=d-A,f=d+A,c=y-L,h=y+L,Ir(s,v,c,f,h),n&&ol(s,e),n&&t.includeOutlines&&!i&&ol(s,e),n&&Wg(s,e)}else if(u&&t.includeEdges)if(n&&!i){var I=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),c=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=D,f+=D,c-=D,h+=D,Ir(s,v,c,f,h),I==="haystack"){var M=g.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var O=v;v=f,f=O}if(c>h){var V=c;c=h,h=V}Ir(s,v-D,c-D,f+D,h+D)}}else if(I==="bezier"||I==="unbundled-bezier"||at(I,"segments")||at(I,"taxi")){var G;switch(I){case"bezier":case"unbundled-bezier":G=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":G=g.linePts;break}if(G!=null)for(var N=0;Nf){var re=v;v=f,f=re}if(c>h){var ne=c;c=h,h=ne}v-=D,f+=D,c-=D,h+=D,Ir(s,v,c,f,h)}if(n&&t.includeEdges&&u&&(ja(s,e,"mid-source"),ja(s,e,"mid-target"),ja(s,e,"source"),ja(s,e,"target")),n){var J=e.pstyle("ghost").value==="yes";if(J){var z=e.pstyle("ghost-offset-x").pfValue,q=e.pstyle("ghost-offset-y").pfValue;Ir(s,s.x1+z,s.y1+q,s.x2+z,s.y2+q)}}var H=o.bodyBounds=o.bodyBounds||{};Uo(H,s),ln(H,p),un(H,1),n&&(v=s.x1,f=s.x2,c=s.y1,h=s.y2,Ir(s,v-T,c-T,f+T,h+T));var Y=o.overlayBounds=o.overlayBounds||{};Uo(Y,s),ln(Y,p),un(Y,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?kd(te.all):te.all=wr(),n&&t.includeLabels&&(t.includeMainLabels&&ys(s,e,null),u&&(t.includeSourceLabels&&ys(s,e,"source"),t.includeTargetLabels&&ys(s,e,"target")))}return s.x1=Ar(s.x1),s.y1=Ar(s.y1),s.x2=Ar(s.x2),s.y2=Ar(s.y2),s.w=Ar(s.x2-s.x1),s.h=Ar(s.y2-s.y1),s.w>0&&s.h>0&&b&&(ln(s,p),un(s,1)),s},$v=function(e){var t=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:sp,e=arguments.length>1?arguments[1]:void 0,t=0;t=0;o--)s(o);return this};dt.removeAllListeners=function(){return this.removeListener("*")};dt.emit=dt.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,_e(e)||(e=[e]),op(this,function(i,s){t!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}],n=a.length);for(var o=function(){var v=a[l];if(v.type===s.type&&(!v.namespace||v.namespace===s.namespace||v.namespace===ip)&&i.eventMatches(i.context,v,s)){var f=[s];e!=null&&Qc(f,e),i.beforeEmit(i.context,v,s),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(d){return d!==v}));var c=i.callbackContext(i.context,v,s),h=v.callback.apply(c,f);i.afterEmit(i.context,v,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ge(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;ia&&(a=l,n=o)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":ar(Symbol))!=e&&ar(Symbol.iterator)!=e;t&&(Sn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Jl({next:function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){a._private.styleDirty&&(a._private.styleDirty=!1,n.style().apply(a));var i=a._private.style[e];return i??(t?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Le(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(ge(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(v[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});gr.neighbourhood=gr.neighborhood;gr.closedNeighbourhood=gr.closedNeighborhood;gr.openNeighbourhood=gr.openNeighborhood;be(gr,{source:Rr(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:Rr(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:ml({attr:"source"}),targets:ml({attr:"target"})});function ml(r){return function(t){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});gr.componentsOf=gr.components;var fr=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){$e("A collection must have a reference to the core");return}var i=new Xr,s=!1;if(!t)t=[];else if(t.length>0&&Le(t[0])&&!Ia(t[0])){s=!0;for(var o=[],l=new ra,u=0,v=t.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],s=[],o,l=0,u=t.length;l0){for(var V=o.length===t.length?t:new fr(a,o),G=0;G0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function s(R){for(var L=R._private.edges,I=0;I0&&(r?B.emitAndNotify("remove"):e&&B.emit("remove"));for(var P=0;P0?P=R:B=R;while(Math.abs(A)>s&&++L=i?m(D,L):I===0?L:w(D,B,B+u)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var T=function(B){return C||x(),r===e&&t===a?B:B===0?0:B===1?1:g(E(B),e,a)};T.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var k="generateBezier("+[r,e,t,a]+")";return T.toString=function(){return k},T}var mp=(function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:r(s)}}function t(a,n){var i={dx:a.v,dv:r(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),l=e(a,n,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),v=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+v*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(u=a(n,i),h=u/s*f):h=f;d=t(d||o,h),l.push(1+d.x),u+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(y){return l[y*(l.length-1)|0]}:u}})(),Ge=function(e,t,a,n){var i=yp(e,t,a,n);return function(s,o,l){return s+(o-s)*i(l)}},cn={linear:function(e,t,a){return e+(t-e)*a},ease:Ge(.25,.1,.25,1),"ease-in":Ge(.42,0,1,1),"ease-out":Ge(0,0,.58,1),"ease-in-out":Ge(.42,0,.58,1),"ease-in-sine":Ge(.47,0,.745,.715),"ease-out-sine":Ge(.39,.575,.565,1),"ease-in-out-sine":Ge(.445,.05,.55,.95),"ease-in-quad":Ge(.55,.085,.68,.53),"ease-out-quad":Ge(.25,.46,.45,.94),"ease-in-out-quad":Ge(.455,.03,.515,.955),"ease-in-cubic":Ge(.55,.055,.675,.19),"ease-out-cubic":Ge(.215,.61,.355,1),"ease-in-out-cubic":Ge(.645,.045,.355,1),"ease-in-quart":Ge(.895,.03,.685,.22),"ease-out-quart":Ge(.165,.84,.44,1),"ease-in-out-quart":Ge(.77,0,.175,1),"ease-in-quint":Ge(.755,.05,.855,.06),"ease-out-quint":Ge(.23,1,.32,1),"ease-in-out-quint":Ge(.86,0,.07,1),"ease-in-expo":Ge(.95,.05,.795,.035),"ease-out-expo":Ge(.19,1,.22,1),"ease-in-out-expo":Ge(1,0,0,1),"ease-in-circ":Ge(.6,.04,.98,.335),"ease-out-circ":Ge(.075,.82,.165,1),"ease-in-out-circ":Ge(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return cn.linear;var n=mp(e,t,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":Ge};function xl(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function El(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function zt(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var s=El(r,n),o=El(e,n);if(ae(s)&&ae(o))return xl(i,s,o,t,a);if(_e(s)&&_e(o)){for(var l=[],u=0;u0?(h==="spring"&&d.push(s.duration),s.easingImpl=cn[h].apply(null,d)):s.easingImpl=cn[h]}var y=s.easingImpl,g;if(s.duration===0?g=1:g=(t-l)/s.duration,s.applying&&(g=s.progress),g<0?g=0:g>1&&(g=1),s.delay==null){var p=s.startPosition,m=s.position;if(m&&n&&!r.locked()){var b={};da(p.x,m.x)&&(b.x=zt(p.x,m.x,g,y)),da(p.y,m.y)&&(b.y=zt(p.y,m.y,g,y)),r.position(b)}var w=s.startPan,E=s.pan,C=i.pan,x=E!=null&&a;x&&(da(w.x,E.x)&&(C.x=zt(w.x,E.x,g,y)),da(w.y,E.y)&&(C.y=zt(w.y,E.y,g,y)),r.emit("pan"));var T=s.startZoom,k=s.zoom,D=k!=null&&a;D&&(da(T,k)&&(i.zoom=ka(i.minZoom,zt(T,k,g,y),i.maxZoom)),r.emit("zoom")),(x||D)&&r.emit("viewport");var B=s.style;if(B&&B.length>0&&n){for(var P=0;P=0;x--){var T=C[x];T()}C.splice(0,C.length)},m=h.length-1;m>=0;m--){var b=h[m],w=b._private;if(w.stopped){h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||wp(v,b,r),bp(v,b,r,f),w.applying&&(w.applying=!1),p(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(m,1),w.hooked=!1,w.playing=!1,w.started=!1,p(w.completes)),y=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),y}for(var i=!1,s=0;s0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var xp={animate:Fe.animate(),animation:Fe.animation(),animated:Fe.animated(),clearQueue:Fe.clearQueue(),delay:Fe.delay(),delayAnimation:Fe.delayAnimation(),stop:Fe.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&wn(function(i){Cl(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){Cl(s,e)},a.beforeRenderPriorities.animations):t()}},Ep={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Ia(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},tn=function(e){return ge(e)?new ft(e):e},tf={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Gn(Ep,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,tn(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,tn(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,tn(t),a),this},once:function(e,t,a){return this.emitter().one(e,tn(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Fe.eventAliasesOn(tf);var zs={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};zs.jpeg=zs.jpg;var dn={layout:function(e){var t=this;if(e==null){$e("Layout options must be specified to make a layout");return}if(e.name==null){$e("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){$e("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;ge(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var s=new n(be({},e,{cy:t,eles:i}));return s}};dn.createLayout=dn.makeLayout=dn.layout;var Cp={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Fs.invalidateDimensions=Fs.resize;var hn={collection:function(e,t){return ge(e)?this.$(e):Dr(e)?e.collection():_e(e)?(t||(t={}),new fr(this,e,t.unique,t.removed)):new fr(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};hn.elements=hn.filter=hn.$;var ur={},wa="t",Sp="f";ur.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i0;if(c||f&&h){var d=void 0;c&&h||c?d=u.properties:h&&(d=u.mappedProperties);for(var y=0;y1&&(w=1),o.color){var C=a.valueMin[0],x=a.valueMax[0],T=a.valueMin[1],k=a.valueMax[1],D=a.valueMin[2],B=a.valueMax[2],P=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],R=[Math.round(C+(x-C)*w),Math.round(T+(k-T)*w),Math.round(D+(B-D)*w),Math.round(P+(A-P)*w)];i={bypass:a.bypass,name:a.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var L=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,L,a.bypass,c)}else return!1;if(!i)return y(),!1;i.mapping=a,a=i;break}case s.data:{for(var I=a.field.split("."),M=f.data,O=0;O0&&i>0){for(var o={},l=!1,u=0;u0?r.delayAnimation(s).play().promise().then(b):b()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)};ur.checkTrigger=function(r,e,t,a,n,i){var s=this.properties[e],o=n(s);r.removed()||o!=null&&o(t,a,r)&&i(s)};ur.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})};ur.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};ur.checkConnectedEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfConnectedEdges},function(n){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ur.checkParallelEdgesBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBoundsOfParallelEdges},function(n){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ur.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a),this.checkConnectedEdgesBoundsTrigger(r,e,t,a),this.checkParallelEdgesBoundsTrigger(r,e,t,a)};var _a={};_a.applyBypass=function(r,e,t,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function l(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Ve("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new ft(f);if(c.invalid){Ve("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),o();continue}}var h=v[2],d=!1;i=h;for(var y=[];;){var g=i.match(/^\s*$/);if(g)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ve("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}s=p[0];var m=p[1],b=p[2],w=e.properties[m];if(!w){Ve("Skipping property: Invalid property name in: "+s),l();continue}var E=t.parse(m,b);if(!E){Ve("Skipping property: Invalid property definition in: "+s),l();continue}y.push({name:m,val:b}),l()}if(d){o();break}t.selector(f);for(var C=0;C=7&&e[0]==="d"&&(v=new RegExp(o.data.regex).exec(e))){if(t)return!1;var c=o.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(o.mapData.regex).exec(e))){if(t||u.multiple)return!1;var h=o.mapData;if(!(u.color||u.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var y=this.parse(r,f[5]);if(!y||y.mapped)return!1;if(d.pfValue===y.pfValue||d.strValue===y.strValue)return Ve("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(u.color){var g=d.value,p=y.value,m=g[0]===p[0]&&g[1]===p[1]&&g[2]===p[2]&&(g[3]===p[3]||(g[3]==null||g[3]===1)&&(p[3]==null||p[3]===1));if(m)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:y.value,bypass:t}}}if(u.multiple&&a!=="multiple"){var b;if(l?b=e.split(/\s+/):_e(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],E=[],C=[],x="",T=!1,k=0;k0?" ":"")+D.strValue}return u.validate&&!u.validate(w,E)?null:u.singleEnum&&T?w.length===1&&ge(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:E}}var B=function(){for(var J=0;Ju.max||u.strictMax&&e===u.max))return null;var I={name:r,value:e,strValue:""+e+(P||""),units:P,bypass:t};return u.unitless||P!=="px"&&P!=="em"?I.pfValue=e:I.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(I.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(I.pfValue=P==="rad"?e:Ed(e)),P==="%"&&(I.pfValue=e/100),I}else if(u.propList){var M=[],O=""+e;if(O!=="none"){for(var V=O.split(/\s*,\s*|\s+/),G=0;G0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*t)/a.w,(o-2*t)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,s,o=!1;if(t.zoomingEnabled||(o=!0),ae(e)?s=e:Le(e)&&(s=e.level,e.position!=null?i=On(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(o=!0)),s=s>t.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=l,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;ae(u.x)&&(t.pan.x=u.x,o=!1),ae(u.y)&&(t.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(ge(e)){var a=e;e=this.mutableElements().filter(a)}else Dr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();t=t===void 0?this._private.zoom:t;var o={x:(i-t*(n.x1+n.x2))/2,y:(s-t*(n.y1+n.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?(function(){var n=a.window().getComputedStyle(t),i=function(o){return parseFloat(n.getPropertyValue(o))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};At.centre=At.center;At.autolockNodes=At.autolock;At.autoungrabifyNodes=At.autoungrabify;var Aa={data:Fe.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Fe.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Fe.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fe.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Aa.attr=Aa.data;Aa.removeAttr=Aa.removeData;var Ra=function(e){var t=this;e=be({},e);var a=e.container;a&&!bn(a)&&bn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var s=rr!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=be({name:s?"grid":"null"},o.layout),o.renderer=be({name:s?"canvas":"null"},o.renderer);var l=function(d,y,g){return y!==void 0?y:g!==void 0?g:d},u=this._private={container:a,ready:!1,options:o,elements:new fr(this),listeners:[],aniEles:new fr(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Le(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Le(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var v=function(d,y){var g=d.some(pc);if(g)return ta.all(d).then(y);y(d)};u.styleEnabled&&t.setStyle([]);var f=be({},o,o.renderer);t.initRenderer(f);var c=function(d,y,g){t.notifications(!1);var p=t.mutableElements();p.length>0&&p.remove(),d!=null&&(Le(d)||_e(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",g),t.emit("done")});var m=be({},t._private.options.layout);m.eles=t.elements(),t.layout(m).run()};v([o.style,o.elements],function(h){var d=h[0],y=h[1];u.styleEnabled&&t.style().append(d),c(y,function(){t.startAnimationLoop(),u.ready=!0,Ue(o.ready)&&t.on("ready",o.ready);for(var g=0;g0,o=!!r.boundingBox,l=wr(o?r.boundingBox:structuredClone(e.extent())),u;if(Dr(r.roots))u=r.roots;else if(_e(r.roots)){for(var v=[],f=0;f0;){var R=A(),L=k(R,B);if(L)R.outgoers().filter(function(ye){return ye.isNode()&&t.has(ye)}).forEach(P);else if(L===null){Ve("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var I=0;if(r.avoidOverlap)for(var M=0;M0&&p[0].length<=3?pe/2:0),Re=2*Math.PI/p[he].length*Ee;return he===0&&p[0].length===1&&(Se=1),{x:H.x+Se*Math.cos(Re),y:H.y+Se*Math.sin(Re)}}else{var Oe=p[he].length,Ne=Math.max(Oe===1?0:o?(l.w-r.padding*2-Y.w)/((r.grid?ce:Oe)-1):(l.w-r.padding*2-Y.w)/((r.grid?ce:Oe)+1),I),ze={x:H.x+(Ee+1-(Oe+1)/2)*Ne,y:H.y+(he+1-(K+1)/2)*te};return ze}},Ce={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ce).indexOf(r.direction)===-1&&$e("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ce).join(", ")));var we=function(ie){return $c(Ae(ie),l,Ce[r.direction])};return t.nodes().layoutPositions(this,r,we),this};var Ap={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function nf(r){this.options=be({},Ap,r)}nf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=wr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),v,f=0,c=0;c1&&e.avoidOverlap){f*=1.75;var p=Math.cos(u)-Math.cos(0),m=Math.sin(u)-Math.sin(0),b=Math.sqrt(f*f/(p*p+m*m));v=Math.max(b,v)}var w=function(C,x){var T=e.startAngle+x*u*(n?1:-1),k=v*Math.cos(T),D=v*Math.sin(T),B={x:o.x+k,y:o.y+D};return B};return a.nodes().layoutPositions(this,e,w),this};var Rp={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function sf(r){this.options=be({},Rp,r)}sf.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),s=wr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,v=0;v0){var E=Math.abs(m[0].value-w.value);E>=g&&(m=[],p.push(m))}m.push(w)}var C=u+e.minNodeSpacing;if(!e.avoidOverlap){var x=p.length>0&&p[0].length>1,T=Math.min(s.w,s.h)/2-C,k=T/(p.length+x?1:0);C=Math.min(C,k)}for(var D=0,B=0;B1&&e.avoidOverlap){var L=Math.cos(R)-Math.cos(0),I=Math.sin(R)-Math.sin(0),M=Math.sqrt(C*C/(L*L+I*I));D=Math.max(M,D)}P.r=D,D+=C}if(e.equidistant){for(var O=0,V=0,G=0;G=r.numIter||(Fp(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature=r.animationThreshold&&i(),wn(v)}};v()}else{for(;u;)u=s(l),l++;kl(a,r),o()}return this};Kn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Kn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Lp=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=wr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={},v=0;v0){o.graphSet.push(T);for(var v=0;vn.count?0:n.graph},of=function(e,t,a,n){var i=n.graphSet[a];if(-10)var f=n.nodeOverlap*v,c=Math.sqrt(o*o+l*l),h=f*o/c,d=f*l/c;else var y=Dn(e,o,l),g=Dn(t,-1*o,-1*l),p=g.x-y.x,m=g.y-y.y,b=p*p+m*m,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*p/c,d=f*m/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},_p=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var s=e.maxY-t.minY;else var s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Dn=function(e,t,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=a/t,u=s/o,v={};return t===0&&0a?(v.x=n,v.y=i+s/2,v):0t&&-1*u<=l&&l<=u?(v.x=n-o/2,v.y=i-o*a/2/t,v):0=u)?(v.x=n+s*t/2/a,v.y=i+s/2,v):(0>a&&(l<=-1*u||l>=u)&&(v.x=n-s*t/2/a,v.y=i-s/2),v)},Gp=function(e,t){for(var a=0;aa){var g=t.gravity*h/y,p=t.gravity*d/y;c.offsetX+=g,c.offsetY+=p}}}}},Wp=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},lf=function(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(d+=g+t.componentSpacing,h=0,y=0,g=0)}}},Kp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function vf(r){this.options=be({},Kp,r)}vf.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=wr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),v=function(Q){if(Q==null)return Math.min(l,u);var K=Math.min(l,u);K==l?l=Q:u=Q},f=function(Q){if(Q==null)return Math.max(l,u);var K=Math.max(l,u);K==l?l=Q:u=Q},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)l=c,u=h;else if(c!=null&&h==null)l=c,u=Math.ceil(s/l);else if(c==null&&h!=null)u=h,l=Math.ceil(s/u);else if(u*l>s){var d=v(),y=f();(d-1)*y>=s?v(d-1):(y-1)*d>=s&&f(y-1)}else for(;u*l=s?f(p+1):v(g+1)}var m=i.w/u,b=i.h/l;if(e.condense&&(m=0,b=0),e.avoidOverlap)for(var w=0;w=u&&(L=0,R++)},M={},O=0;O(L=Nd(r,e,I[M],I[M+1],I[M+2],I[M+3])))return g(x,L),!0}else if(k.edgeType==="bezier"||k.edgeType==="multibezier"||k.edgeType==="self"||k.edgeType==="compound"){for(var I=k.allpts,M=0;M+5(L=Od(r,e,I[M],I[M+1],I[M+2],I[M+3],I[M+4],I[M+5])))return g(x,L),!0}for(var O=O||T.source,V=V||T.target,G=n.getArrowWidth(D,B),N=[{name:"source",x:k.arrowStartX,y:k.arrowStartY,angle:k.srcArrowAngle},{name:"target",x:k.arrowEndX,y:k.arrowEndY,angle:k.tgtArrowAngle},{name:"mid-source",x:k.midX,y:k.midY,angle:k.midsrcArrowAngle},{name:"mid-target",x:k.midX,y:k.midY,angle:k.midtgtArrowAngle}],M=0;M0&&(p(O),p(V))}function b(x,T,k){return Tr(x,T,k)}function w(x,T){var k=x._private,D=c,B;T?B=T+"-":B="",x.boundingBox();var P=k.labelBounds[T||"main"],A=x.pstyle(B+"label").value,R=x.pstyle("text-events").strValue==="yes";if(!(!R||!A)){var L=b(k.rscratch,"labelX",T),I=b(k.rscratch,"labelY",T),M=b(k.rscratch,"labelAngle",T),O=x.pstyle(B+"text-margin-x").pfValue,V=x.pstyle(B+"text-margin-y").pfValue,G=P.x1-D-O,N=P.x2+D-O,F=P.y1-D-V,U=P.y2+D-V;if(M){var Q=Math.cos(M),K=Math.sin(M),j=function(Y,te){return Y=Y-L,te=te-I,{x:Y*Q-te*K+L,y:Y*K+te*Q+I}},re=j(G,F),ne=j(G,U),J=j(N,F),z=j(N,U),q=[re.x+O,re.y+V,J.x+O,J.y+V,z.x+O,z.y+V,ne.x+O,ne.y+V];if(Sr(r,e,q))return g(x),!0}else if(nt(P,r,e))return g(x),!0}}for(var E=s.length-1;E>=0;E--){var C=s[E];C.isNode()?p(C)||w(C):m(C)||w(C)||w(C,"source")||w(C,"target")}return o};Mt.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),s=2/i,o=[],l=Math.min(r,t),u=Math.max(r,t),v=Math.min(e,a),f=Math.max(e,a);r=l,t=u,e=v,a=f;var c=wr({x1:r,y1:e,x2:t,y2:a}),h=[{x:c.x1,y:c.y1},{x:c.x2,y:c.y1},{x:c.x2,y:c.y2},{x:c.x1,y:c.y2}],d=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function y(Y,te,ce){return Tr(Y,te,ce)}function g(Y,te){var ce=Y._private,Ae=s,Ce="";Y.boundingBox();var we=ce.labelBounds.main;if(!we)return null;var ye=y(ce.rscratch,"labelX",te),ie=y(ce.rscratch,"labelY",te),de=y(ce.rscratch,"labelAngle",te),he=Y.pstyle(Ce+"text-margin-x").pfValue,Ee=Y.pstyle(Ce+"text-margin-y").pfValue,pe=we.x1-Ae-he,Se=we.x2+Ae-he,Re=we.y1-Ae-Ee,Oe=we.y2+Ae-Ee;if(de){var Ne=Math.cos(de),ze=Math.sin(de),xe=function(X,S){return X=X-ye,S=S-ie,{x:X*Ne-S*ze+ye,y:X*ze+S*Ne+ie}};return[xe(pe,Re),xe(Se,Re),xe(Se,Oe),xe(pe,Oe)]}else return[{x:pe,y:Re},{x:Se,y:Re},{x:Se,y:Oe},{x:pe,y:Oe}]}function p(Y,te,ce,Ae){function Ce(we,ye,ie){return(ie.y-we.y)*(ye.x-we.x)>(ye.y-we.y)*(ie.x-we.x)}return Ce(Y,ce,Ae)!==Ce(te,ce,Ae)&&Ce(Y,te,ce)!==Ce(Y,te,Ae)}for(var m=0;m0?-(Math.PI-e.ang):Math.PI+e.ang},jp=function(e,t,a,n,i){if(e!==Rl?Ml(t,e,Vr):Jp(Pr,Vr),Ml(t,a,Pr),Pl=Vr.nx*Pr.ny-Vr.ny*Pr.nx,Al=Vr.nx*Pr.nx-Vr.ny*-Pr.ny,Ur=Math.asin(Math.max(-1,Math.min(1,Pl))),Math.abs(Ur)<1e-6){Vs=t.x,qs=t.y,Ct=Vt=0;return}St=1,gn=!1,Al<0?Ur<0?Ur=Math.PI+Ur:(Ur=Math.PI-Ur,St=-1,gn=!0):Ur>0&&(St=-1,gn=!0),t.radius!==void 0?Vt=t.radius:Vt=n,wt=Ur/2,an=Math.min(Vr.len/2,Pr.len/2),i?(zr=Math.abs(Math.cos(wt)*Vt/Math.sin(wt)),zr>an?(zr=an,Ct=Math.abs(zr*Math.sin(wt)/Math.cos(wt))):Ct=Vt):(zr=Math.min(an,Vt),Ct=Math.abs(zr*Math.sin(wt)/Math.cos(wt))),_s=t.x+Pr.nx*zr,Gs=t.y+Pr.ny*zr,Vs=_s-Pr.ny*Ct*St,qs=Gs+Pr.nx*Ct*St,hf=t.x+Vr.nx*zr,gf=t.y+Vr.ny*zr,Rl=t};function pf(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function po(r,e,t,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(jp(r,e,t,a,n),{cx:Vs,cy:qs,radius:Ct,startX:hf,startY:gf,stopX:_s,stopY:Gs,startAngle:Vr.ang+Math.PI/2*St,endAngle:Pr.ang-Math.PI/2*St,counterClockwise:gn})}var Ma=.01,ey=Math.sqrt(2*Ma),yr={};yr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(E,C,x,T){var k=T-C,D=x-E,B=Math.sqrt(D*D+k*k);return{x:-k/B,y:D/B}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(l){var f=this.manualEndptToPx(r.source()[0],s),c=Je(f,2),h=c[0],d=c[1],y=this.manualEndptToPx(r.target()[0],o),g=Je(y,2),p=g[0],m=g[1],b={x1:h,y1:d,x2:p,y2:m};n=u(h,d,p,m),i=b}else Ve("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};yr.findHaystackPoints=function(r){for(var e=0;e0?Math.max(S-_,0):Math.min(S+_,0)},A=P(D,T),R=P(B,k),L=!1;m===u?p=Math.abs(A)>Math.abs(R)?n:a:m===l||m===o?(p=a,L=!0):(m===i||m===s)&&(p=n,L=!0);var I=p===a,M=I?R:A,O=I?B:D,V=to(O),G=!1;!(L&&(w||C))&&(m===o&&O<0||m===l&&O>0||m===i&&O>0||m===s&&O<0)&&(V*=-1,M=V*Math.abs(M),G=!0);var N;if(w){var F=E<0?1+E:E;N=F*M}else{var U=E<0?M:0;N=U+E*V}var Q=function(S){return Math.abs(S)=Math.abs(M)},K=Q(N),j=Q(Math.abs(M)-Math.abs(N)),re=K||j;if(re&&!G)if(I){var ne=Math.abs(O)<=c/2,J=Math.abs(D)<=h/2;if(ne){var z=(v.x1+v.x2)/2,q=v.y1,H=v.y2;t.segpts=[z,q,z,H]}else if(J){var Y=(v.y1+v.y2)/2,te=v.x1,ce=v.x2;t.segpts=[te,Y,ce,Y]}else t.segpts=[v.x1,v.y2]}else{var Ae=Math.abs(O)<=f/2,Ce=Math.abs(B)<=d/2;if(Ae){var we=(v.y1+v.y2)/2,ye=v.x1,ie=v.x2;t.segpts=[ye,we,ie,we]}else if(Ce){var de=(v.x1+v.x2)/2,he=v.y1,Ee=v.y2;t.segpts=[de,he,de,Ee]}else t.segpts=[v.x2,v.y1]}else if(I){var pe=v.y1+N+(g?c/2*V:0),Se=v.x1,Re=v.x2;t.segpts=[Se,pe,Re,pe]}else{var Oe=v.x1+N+(g?f/2*V:0),Ne=v.y1,ze=v.y2;t.segpts=[Oe,Ne,Oe,ze]}if(t.isRound){var xe=r.pstyle("taxi-radius").value,ue=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(xe),t.isArcRadius=new Array(t.segpts.length/2).fill(ue)}};yr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,c=e.tgtCornerRadius,h=e.srcRs,d=e.tgtRs,y=!ae(t.startX)||!ae(t.startY),g=!ae(t.arrowStartX)||!ae(t.arrowStartY),p=!ae(t.endX)||!ae(t.endY),m=!ae(t.arrowEndX)||!ae(t.arrowEndY),b=3,w=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=b*w,C=Bt({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),x=CO.poolIndex()){var V=M;M=O,O=V}var G=A.srcPos=M.position(),N=A.tgtPos=O.position(),F=A.srcW=M.outerWidth(),U=A.srcH=M.outerHeight(),Q=A.tgtW=O.outerWidth(),K=A.tgtH=O.outerHeight(),j=A.srcShape=t.nodeShapes[e.getNodeShape(M)],re=A.tgtShape=t.nodeShapes[e.getNodeShape(O)],ne=A.srcCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,J=A.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,z=A.tgtRs=O._private.rscratch,q=A.srcRs=M._private.rscratch;A.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var H=0;H=ey||(Re=Math.sqrt(Math.max(Se*Se,Ma)+Math.max(pe*pe,Ma)));var Oe=A.vector={x:Se,y:pe},Ne=A.vectorNorm={x:Oe.x/Re,y:Oe.y/Re},ze={x:-Ne.y,y:Ne.x};A.nodesOverlap=!ae(Re)||re.checkPoint(we[0],we[1],0,Q,K,N.x,N.y,J,z)||j.checkPoint(ie[0],ie[1],0,F,U,G.x,G.y,ne,q),A.vectorNormInverse=ze,R={nodesOverlap:A.nodesOverlap,dirCounts:A.dirCounts,calculatedIntersection:!0,hasBezier:A.hasBezier,hasUnbundled:A.hasUnbundled,eles:A.eles,srcPos:N,srcRs:z,tgtPos:G,tgtRs:q,srcW:Q,srcH:K,tgtW:F,tgtH:U,srcIntn:de,tgtIntn:ye,srcShape:re,tgtShape:j,posPts:{x1:Ee.x2,y1:Ee.y2,x2:Ee.x1,y2:Ee.y1},intersectionPts:{x1:he.x2,y1:he.y2,x2:he.x1,y2:he.y1},vector:{x:-Oe.x,y:-Oe.y},vectorNorm:{x:-Ne.x,y:-Ne.y},vectorNormInverse:{x:-ze.x,y:-ze.y}}}var xe=Ce?R:A;te.nodesOverlap=xe.nodesOverlap,te.srcIntn=xe.srcIntn,te.tgtIntn=xe.tgtIntn,te.isRound=ce.startsWith("round"),n&&(M.isParent()||M.isChild()||O.isParent()||O.isChild())&&(M.parents().anySame(O)||O.parents().anySame(M)||M.same(O)&&M.isParent())?e.findCompoundLoopPoints(Y,xe,H,Ae):M===O?e.findLoopPoints(Y,xe,H,Ae):ce.endsWith("segments")?e.findSegmentsPoints(Y,xe):ce.endsWith("taxi")?e.findTaxiPoints(Y,xe):ce==="straight"||!Ae&&A.eles.length%2===1&&H===Math.floor(A.eles.length/2)?e.findStraightEdgePoints(Y):e.findBezierPoints(Y,xe,H,Ae,Ce),e.findEndpoints(Y),e.tryToCorrectInvalidPoints(Y,xe),e.checkForInvalidEdgeWarning(Y),e.storeAllpts(Y),e.storeEdgeProjections(Y),e.calculateArrowAngles(Y),e.recalculateEdgeLabelProjections(Y),e.calculateLabelAngles(Y)}},x=0;x0){var we=u,ye=Et(we,Wt(s)),ie=Et(we,Wt(Ce)),de=ye;if(ie2){var he=Et(we,{x:Ce[2],y:Ce[3]});he0){var W=v,$=Et(W,Wt(s)),Z=Et(W,Wt(_)),oe=$;if(Z<$&&(s=[_[0],_[1]],oe=Z),_.length>2){var ee=Et(W,{x:_[2],y:_[3]});ee=d||x){g={cp:w,segment:C};break}}if(g)break}var T=g.cp,k=g.segment,D=(d-p)/k.length,B=k.t1-k.t0,P=h?k.t0+B*D:k.t1-B*D;P=ka(0,P,1),e=Kt(T.p0,T.p1,T.p2,P),c=ty(T.p0,T.p1,T.p2,P);break}case"straight":case"segments":case"haystack":{for(var A=0,R,L,I,M,O=a.allpts.length,V=0;V+3=d));V+=2);var G=d-L,N=G/R;N=ka(0,N,1),e=Td(I,M,N),c=bf(I,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,c)}};u("source"),u("target"),this.applyLabelDimensions(r)}};Gr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Gr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=Dt(a,r._private.labelDimsKey);if(Tr(t.rscratch,"prefixedLabelDimsKey",e)!==n){Kr(t.rscratch,"prefixedLabelDimsKey",e,n);var i=this.calculateLabelDimensions(r,a),s=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,l=Tr(t.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),v=i.height/u,f=v*s,c=i.width,h=i.height+(u-1)*(s-1)*v;Kr(t.rstyle,"labelWidth",e,c),Kr(t.rscratch,"labelWidth",e,c),Kr(t.rstyle,"labelHeight",e,h),Kr(t.rscratch,"labelHeight",e,h),Kr(t.rscratch,"labelLineHeight",e,f)}};Gr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,s=function(U,Q){return Q?(Kr(t.rscratch,U,e,Q),Q):Tr(t.rscratch,U,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=r.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",v=n.split(` +`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;gf){var E=p.matchAll(y),C="",x=0,T=kr(E),k;try{for(T.s();!(k=T.n()).done;){var D=k.value,B=D[0],P=p.substring(x,D.index);x=D.index+B.length;var A=C.length===0?P:C+P+B,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+B:(C&&d.push(C),C=P+B)}}catch(F){T.e(F)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",O="…",V=!1;if(this.calculateLabelDimensions(r,n).widthI)break;M+=n[G],G===n.length-1&&(V=!0)}return V||(M+=O),M}return n};Gr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Gr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,v=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),f=this.labelCalcCanvasContext=v.getContext("2d");var c=v.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var h=0,d=0,y=e.split(` +`),g=0;g1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=r.desktopTapThreshold2}var lr=i(S);je&&(r.hoverData.tapholdCancelled=!0);var jr=function(){var Br=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Br.length===0?(Br.push(Pe[0]),Br.push(Pe[1])):(Br[0]+=Pe[0],Br[1]+=Pe[1])};W=!0,n(De,["mousemove","vmousemove","tapdrag"],S,{x:ee[0],y:ee[1]});var Ze=function(Br){return{originalEvent:S,type:Br,position:{x:ee[0],y:ee[1]}}},Wr=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||$.emit(Ze("boxstart")),me[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(je){var $r=Ze("cxtdrag");fe?fe.emit($r):$.emit($r),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||De!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(Ze("cxtdragout")),r.hoverData.cxtOver=De,De&&De.emit(Ze("cxtdragover")))}}else if(r.hoverData.dragging){if(W=!0,$.panningEnabled()&&$.userPanningEnabled()){var It;if(r.hoverData.justStartedPan){var $a=r.hoverData.mdownPos;It={x:(ee[0]-$a[0])*Z,y:(ee[1]-$a[1])*Z},r.hoverData.justStartedPan=!1}else It={x:Pe[0]*Z,y:Pe[1]*Z};$.panBy(It),$.emit(Ze("dragpan")),r.hoverData.dragged=!0}ee=r.projectIntoViewport(S.clientX,S.clientY)}else if(me[4]==1&&(fe==null||fe.pannable())){if(je){if(!r.hoverData.dragging&&$.boxSelectionEnabled()&&(lr||!$.panningEnabled()||!$.userPanningEnabled()))Wr();else if(!r.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()){var bt=s(fe,r.hoverData.downs);bt&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,me[4]=0,r.data.bgActivePosistion=Wt(ve),r.redrawHint("select",!0),r.redraw())}fe&&fe.pannable()&&fe.active()&&fe.unactivate()}}else{if(fe&&fe.pannable()&&fe.active()&&fe.unactivate(),(!fe||!fe.grabbed())&&De!=Te&&(Te&&n(Te,["mouseout","tapdragout"],S,{x:ee[0],y:ee[1]}),De&&n(De,["mouseover","tapdragover"],S,{x:ee[0],y:ee[1]}),r.hoverData.last=De),fe)if(je){if($.boxSelectionEnabled()&&lr)fe&&fe.grabbed()&&(p(Be),fe.emit(Ze("freeon")),Be.emit(Ze("free")),r.dragData.didDrag&&(fe.emit(Ze("dragfreeon")),Be.emit(Ze("dragfree")))),Wr();else if(fe&&fe.grabbed()&&r.nodeIsDraggable(fe)){var Er=!r.dragData.didDrag;Er&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||y(Be,{inDragLayer:!0});var hr={x:0,y:0};if(ae(Pe[0])&&ae(Pe[1])&&(hr.x+=Pe[0],hr.y+=Pe[1],Er)){var Cr=r.hoverData.dragDelta;Cr&&ae(Cr[0])&&ae(Cr[1])&&(hr.x+=Cr[0],hr.y+=Cr[1])}r.hoverData.draggingEles=!0,Be.silentShift(hr).emit(Ze("position")).emit(Ze("drag")),r.redrawHint("drag",!0),r.redraw()}}else jr();W=!0}if(me[2]=ee[0],me[3]=ee[1],W)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var P,A,R;r.registerBinding(e,"mouseup",function(S){if(!(r.hoverData.which===1&&S.which!==1&&r.hoverData.capture)){var _=r.hoverData.capture;if(_){r.hoverData.capture=!1;var W=r.cy,$=r.projectIntoViewport(S.clientX,S.clientY),Z=r.selection,oe=r.findNearestElement($[0],$[1],!0,!1),ee=r.dragData.possibleDragElements,ve=r.hoverData.down,le=i(S);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,ve&&ve.unactivate();var me=function(Ke){return{originalEvent:S,type:Ke,position:{x:$[0],y:$[1]}}};if(r.hoverData.which===3){var De=me("cxttapend");if(ve?ve.emit(De):W.emit(De),!r.hoverData.cxtDragged){var Te=me("cxttap");ve?ve.emit(Te):W.emit(Te)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(n(oe,["mouseup","tapend","vmouseup"],S,{x:$[0],y:$[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(n(ve,["click","tap","vclick"],S,{x:$[0],y:$[1]}),A=!1,S.timeStamp-R<=W.multiClickDebounceTime()?(P&&clearTimeout(P),A=!0,R=null,n(ve,["dblclick","dbltap","vdblclick"],S,{x:$[0],y:$[1]})):(P=setTimeout(function(){A||n(ve,["oneclick","onetap","voneclick"],S,{x:$[0],y:$[1]})},W.multiClickDebounceTime()),R=S.timeStamp)),ve==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(S)&&(W.$(t).unselect(["tapunselect"]),ee.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=ee=W.collection()),oe==ve&&!r.dragData.didDrag&&!r.hoverData.selecting&&oe!=null&&oe._private.selectable&&(r.hoverData.dragging||(W.selectionType()==="additive"||le?oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]):le||(W.$(t).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var fe=W.collection(r.getAllInBox(Z[0],Z[1],Z[2],Z[3]));r.redrawHint("select",!0),fe.length>0&&r.redrawHint("eles",!0),W.emit(me("boxend"));var Pe=function(Ke){return Ke.selectable()&&!Ke.selected()};W.selectionType()==="additive"||le||W.$(t).unmerge(fe).unselect(),fe.emit(me("box")).stdFilter(Pe).select().emit(me("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!Z[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Be=ve&&ve.grabbed();p(ee),Be&&(ve.emit(me("freeon")),ee.emit(me("free")),r.dragData.didDrag&&(ve.emit(me("dragfreeon")),ee.emit(me("dragfree"))))}}Z[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}}},!1);var L=[],I=4,M,O=1e5,V=function(S,_){for(var W=0;W=I){var $=L;if(M=V($,5),!M){var Z=Math.abs($[0]);M=G($)&&Z>5}if(M)for(var oe=0;oe<$.length;oe++)O=Math.min(Math.abs($[oe]),O)}else L.push(W),_=!0;else M&&(O=Math.min(Math.abs(W),O));if(!r.scrollingPage){var ee=r.cy,ve=ee.zoom(),le=ee.pan(),me=r.projectIntoViewport(S.clientX,S.clientY),De=[me[0]*ve+le.x,me[1]*ve+le.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||k()){S.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var Te;_&&Math.abs(W)>5&&(W=to(W)*5),Te=W/-250,M&&(Te/=O,Te*=3),Te=Te*r.wheelSensitivity;var fe=S.deltaMode===1;fe&&(Te*=33);var Pe=ee.zoom()*Math.pow(10,Te);S.type==="gesturechange"&&(Pe=r.gestureStartZoom*S.scale),ee.zoom({level:Pe,renderedPosition:{x:De[0],y:De[1]}}),ee.emit({type:S.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:S,position:{x:me[0],y:me[1]}})}}}};r.registerBinding(r.container,"wheel",N,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(X){r.hasTouchStarted||N(X)},!0),r.registerBinding(r.container,"mouseout",function(S){var _=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:_[0],y:_[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var _=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:_[0],y:_[1]}})},!1);var F,U,Q,K,j,re,ne,J,z,q,H,Y,te,ce=function(S,_,W,$){return Math.sqrt((W-S)*(W-S)+($-_)*($-_))},Ae=function(S,_,W,$){return(W-S)*(W-S)+($-_)*($-_)},Ce;r.registerBinding(r.container,"touchstart",Ce=function(S){if(r.hasTouchStarted=!0,!!D(S)){b(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var _=r.cy,W=r.touchData.now,$=r.touchData.earlier;if(S.touches[0]){var Z=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);W[0]=Z[0],W[1]=Z[1]}if(S.touches[1]){var Z=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);W[2]=Z[0],W[3]=Z[1]}if(S.touches[2]){var Z=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);W[4]=Z[0],W[5]=Z[1]}var oe=function(lr){return{originalEvent:S,type:lr,position:{x:W[0],y:W[1]}}};if(S.touches[1]){r.touchData.singleTouchMoved=!0,p(r.dragData.touchDragEles);var ee=r.findContainerClientCoords();z=ee[0],q=ee[1],H=ee[2],Y=ee[3],F=S.touches[0].clientX-z,U=S.touches[0].clientY-q,Q=S.touches[1].clientX-z,K=S.touches[1].clientY-q,te=0<=F&&F<=H&&0<=Q&&Q<=H&&0<=U&&U<=Y&&0<=K&&K<=Y;var ve=_.pan(),le=_.zoom();j=ce(F,U,Q,K),re=Ae(F,U,Q,K),ne=[(F+Q)/2,(U+K)/2],J=[(ne[0]-ve.x)/le,(ne[1]-ve.y)/le];var me=200,De=me*me;if(re=1){for(var mr=r.touchData.startPosition=[null,null,null,null,null,null],Ye=0;Ye=r.touchTapThreshold2}if(_&&r.touchData.cxt){S.preventDefault();var Ye=S.touches[0].clientX-z,ir=S.touches[0].clientY-q,er=S.touches[1].clientX-z,lr=S.touches[1].clientY-q,jr=Ae(Ye,ir,er,lr),Ze=jr/re,Wr=150,$r=Wr*Wr,It=1.5,$a=It*It;if(Ze>=$a||jr>=$r){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var bt=le("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(bt),r.touchData.start=null):$.emit(bt)}}if(_&&r.touchData.cxt){var bt=le("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(bt):$.emit(bt),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var Er=r.findNearestElement(Z[0],Z[1],!0,!0);(!r.touchData.cxtOver||Er!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(le("cxtdragout")),r.touchData.cxtOver=Er,Er&&Er.emit(le("cxtdragover")))}else if(_&&S.touches[2]&&$.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||$.emit(le("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,W[4]=1,!W||W.length===0||W[0]===void 0?(W[0]=(Z[0]+Z[2]+Z[4])/3,W[1]=(Z[1]+Z[3]+Z[5])/3,W[2]=(Z[0]+Z[2]+Z[4])/3+1,W[3]=(Z[1]+Z[3]+Z[5])/3+1):(W[2]=(Z[0]+Z[2]+Z[4])/3,W[3]=(Z[1]+Z[3]+Z[5])/3),r.redrawHint("select",!0),r.redraw();else if(_&&S.touches[1]&&!r.touchData.didSelect&&$.zoomingEnabled()&&$.panningEnabled()&&$.userZoomingEnabled()&&$.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var hr=r.dragData.touchDragEles;if(hr){r.redrawHint("drag",!0);for(var Cr=0;Cr0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var ye;r.registerBinding(e,"touchcancel",ye=function(S){var _=r.touchData.start;r.touchData.capture=!1,_&&_.unactivate()});var ie,de,he,Ee;if(r.registerBinding(e,"touchend",ie=function(S){var _=r.touchData.start,W=r.touchData.capture;if(W)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var $=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Z=r.cy,oe=Z.zoom(),ee=r.touchData.now,ve=r.touchData.earlier;if(S.touches[0]){var le=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);ee[0]=le[0],ee[1]=le[1]}if(S.touches[1]){var le=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);ee[2]=le[0],ee[3]=le[1]}if(S.touches[2]){var le=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);ee[4]=le[0],ee[5]=le[1]}var me=function($r){return{originalEvent:S,type:$r,position:{x:ee[0],y:ee[1]}}};_&&_.unactivate();var De;if(r.touchData.cxt){if(De=me("cxttapend"),_?_.emit(De):Z.emit(De),!r.touchData.cxtDragged){var Te=me("cxttap");_?_.emit(Te):Z.emit(Te)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&Z.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var fe=Z.collection(r.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,r.redrawHint("select",!0),Z.emit(me("boxend"));var Pe=function($r){return $r.selectable()&&!$r.selected()};fe.emit(me("box")).stdFilter(Pe).select().emit(me("boxselect")),fe.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(_?.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Be=r.dragData.touchDragEles;if(_!=null){var je=_._private.grabbed;p(Be),r.redrawHint("drag",!0),r.redrawHint("eles",!0),je&&(_.emit(me("freeon")),Be.emit(me("free")),r.dragData.didDrag&&(_.emit(me("dragfreeon")),Be.emit(me("dragfree")))),n(_,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]}),_.unactivate(),r.touchData.start=null}else{var Ke=r.findNearestElement(ee[0],ee[1],!0,!0);n(Ke,["touchend","tapend","vmouseup","tapdragout"],S,{x:ee[0],y:ee[1]})}var mr=r.touchData.startPosition[0]-ee[0],Ye=mr*mr,ir=r.touchData.startPosition[1]-ee[1],er=ir*ir,lr=Ye+er,jr=lr*oe*oe;r.touchData.singleTouchMoved||(_||Z.$(":selected").unselect(["tapunselect"]),n(_,["tap","vclick"],S,{x:ee[0],y:ee[1]}),de=!1,S.timeStamp-Ee<=Z.multiClickDebounceTime()?(he&&clearTimeout(he),de=!0,Ee=null,n(_,["dbltap","vdblclick"],S,{x:ee[0],y:ee[1]})):(he=setTimeout(function(){de||n(_,["onetap","voneclick"],S,{x:ee[0],y:ee[1]})},Z.multiClickDebounceTime()),Ee=S.timeStamp)),_!=null&&!r.dragData.didDrag&&_._private.selectable&&jr"u"){var pe=[],Se=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},Re=function(S){return{event:S,touch:Se(S)}},Oe=function(S){pe.push(Re(S))},Ne=function(S){for(var _=0;_0)return F[0]}return null},d=Object.keys(c),y=0;y0?h:wv(i,s,e,t,a,n,o,l)},checkPoint:function(e,t,a,n,i,s,o,l){l=l==="auto"?vt(n,i):l;var u=2*l;if(Zr(e,t,this.points,s,o,n,i-u,[0,-1],a)||Zr(e,t,this.points,s,o,n-u,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[s-v,o-f,s-v,o,s+v,o,s+v,o-f];return!!(Sr(e,t,c)||kt(e,t,u,u,s+n/2-l,o+i/2-l,a)||kt(e,t,u,u,s-n/2+l,o+i/2-l,a))}}};Qr.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",br(3,0)),this.generateRoundPolygon("round-triangle",br(3,0)),this.generatePolygon("rectangle",br(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",br(5,0)),this.generateRoundPolygon("round-pentagon",br(5,0)),this.generatePolygon("hexagon",br(6,0)),this.generateRoundPolygon("round-hexagon",br(6,0)),this.generatePolygon("heptagon",br(7,0)),this.generateRoundPolygon("round-heptagon",br(7,0)),this.generatePolygon("octagon",br(8,0)),this.generateRoundPolygon("round-octagon",br(8,0));var a=new Array(20);{var n=Ps(5,0),i=Ps(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(m>=e.deqCost*h||m>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ws)break;var E=e.deq(a,g,y);if(E.length>0)for(var C=0;C0&&(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,g,y)&&i())},o=e.priority||js;n.beforeRender(s,o(a))}}}},ny=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xn;ht(this,r),this.idsByKey=new Xr,this.keyForId=new Xr,this.cachesByLvl=new Xr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return gt(r,[{key:"getIdsFor",value:function(t){t==null&&$e("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new ra,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Xr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}])})(),Nl=25,nn=50,pn=-4,Hs=3,Sf=7.99,iy=8,sy=1024,oy=1024,uy=1024,ly=.2,vy=.8,fy=10,cy=.15,dy=.1,hy=.9,gy=.9,py=100,yy=1,Ut={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},my=cr({getKey:null,doesEleInvalidateKey:xn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:dv,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ba=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=my(t);be(a,n),a.lookup=new ny(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},nr=ba.prototype;nr.reasons=Ut;nr.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};nr.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a};nr.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Va(function(t,a){return a.reqs-t.reqs});return e};nr.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};nr.getElement=function(r,e,t,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(ro(o*t))),a=Sf||a>Hs)return null;var u=Math.pow(2,a),v=e.h*u,f=e.w*u,c=s.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,c))return null;var h=l.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=Nl?d=Nl:v<=nn?d=nn:d=Math.ceil(v/nn)*nn,v>uy||f>oy)return null;var y=i.getTextureQueue(d),g=y[y.length-2],p=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};g||(g=y[y.length-1]),g||(g=p()),g.width-g.usedWidtha;B--)k=i.getElement(r,e,t,B,Ut.downscale);D()}else return i.queueElement(r,C.level-1),C;else{var P;if(!b&&!w&&!E)for(var A=a-1;A>=pn;A--){var R=l.get(r,A);if(R){P=R;break}}if(m(P))return i.queueElement(r,a),P;g.context.translate(g.usedWidth,0),g.context.scale(u,u),this.drawElement(g.context,r,e,c,!1),g.context.scale(1/u,1/u),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:u,width:f,height:v,scaledLabelShown:c},g.usedWidth+=Math.ceil(f+iy),g.eleCaches.push(h),l.set(r,a,h),i.checkTextureFullness(g),h};nr.invalidateElements=function(r){for(var e=0;e=ly*r.width&&this.retireTexture(r)};nr.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>vy&&r.fullnessChecks>=fy?lt(t,r):r.fullnessChecks++};nr.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;lt(a,r),r.retired=!0;for(var i=r.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,eo(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),lt(n,s),a.push(s),s}};nr.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,a.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(o),n[i]=o}};nr.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=t.pop(),l=o.key,u=o.eles[0],v=i.hasCache(u,o.level);if(a[l]=null,v)continue;n.push(o);var f=e.getBoundingBox(u);e.getElement(u,f,r,o.level,Ut.dequeue)}return n};nr.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Js,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))};nr.onDequeue=function(r){this.onDequeues.push(r)};nr.offDequeue=function(r){lt(this.onDequeues,r)};nr.setupDequeueing=Tf.setupDequeueing({deqRedrawThreshold:py,deqCost:cy,deqAvgCost:dy,deqNoDrawCost:hy,deqFastCost:gy,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a=wy||t>Pn)return null}a.validateLayersElesOrdering(t,r);var l=a.layersByLevel,u=Math.pow(2,t),v=l[t]=l[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var D=function(L){if(a.validateLayersElesOrdering(L,r),a.levelIsComplete(L,r))return h=l[L],!0},B=function(L){if(!h)for(var I=t+L;xa<=I&&I<=Pn&&!D(I);I+=L);};B(1),B(-1);for(var P=v.length-1;P>=0;P--){var A=v[P];A.invalid&<(v,A)}};if(!c)d();else return v;var y=function(){if(!f){f=wr();for(var D=0;DFl||A>Fl)return null;var R=P*A;if(R>By)return null;var L=a.makeLayer(f,t);if(B!=null){var I=v.indexOf(B)+1;v.splice(I,0,L)}else(D.insert===void 0||D.insert)&&v.unshift(L);return L};if(a.skipping&&!o)return null;for(var p=null,m=r.length/by,b=!o,w=0;w=m||!bv(p.bb,E.boundingBox()))&&(p=g({insert:!0,after:p}),!p))return null;h||b?a.queueLayer(p,E):a.drawEleInLayer(p,E,t,e),p.eles.push(E),x[t]=p}return h||(b?null:v)};dr.getEleLevelForLayerLevel=function(r,e){return r};dr.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,s=r.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,Py),i.setImgSmoothing(s,!0))};dr.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};dr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a0){e=!0;break}}return e};dr.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Yr(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))};dr.invalidateLayer=function(r){if(this.lastInvalidationTime=Yr(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];lt(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;t&&(l=t,r.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,p=u*v,m=u*v,b=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;f==="straight-triangle"?(s.eleStrokeStyle(r,e,L),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=d,s.eleStrokeStyle(r,e,L),s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(r.lineWidth=h+y,r.lineCap=d,y>0)s.colorStrokeStyle(r,g[0],g[1],g[2],L);else{r.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,c),r.lineCap="butt")},E=function(){n&&s.drawEdgeOverlay(r,e)},C=function(){n&&s.drawEdgeUnderlay(r,e)},x=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;s.drawArrowheads(r,e,L)},T=function(){s.drawElementText(r,e,null,a)};r.lineJoin="round";var k=e.pstyle("ghost").value==="yes";if(k){var D=e.pstyle("ghost-offset-x").pfValue,B=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,A=p*P;r.translate(D,B),b(A),x(A),r.translate(-D,-B)}else w();C(),b(),x(),E(),T(),t&&r.translate(l.x1,l.y1)}};var Bf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=u,o.edgeType==="self"&&!s?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,o.allpts,"solid")}}}};Jr.drawEdgeOverlay=Bf("overlay");Jr.drawEdgeUnderlay=Bf("underlay");Jr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(l){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=f,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,v=e.pstyle("label"),f=e.pstyle("source-label"),c=e.pstyle("target-label");if(u||(!v||!v.value)&&(!f||!f.value)&&(!c||!c.value))return;r.textAlign="center",r.textBaseline="bottom"}var h=!t,d;t&&(d=t,r.translate(-d.x1,-d.y1)),n==null?(s.drawText(r,e,null,h,i),e.isEdge()&&(s.drawText(r,e,"source",h,i),s.drawText(r,e,"target",h,i))):s.drawText(r,e,n,h,i),t&&r.translate(d.x1,d.y1)};Lt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+s+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],o),this.colorStrokeStyle(r,v[0],v[1],v[2],l)};function qy(r,e,t,a,n){var i=Math.min(a,n),s=i/2,o=e+a/2,l=t+n/2;r.beginPath(),r.arc(o,l,s,0,Math.PI*2),r.closePath()}function Gl(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(i,a/2,n/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+a-s,t),r.quadraticCurveTo(e+a,t,e+a,t+s),r.lineTo(e+a,t+n-s),r.quadraticCurveTo(e+a,t+n,e+a-s,t+n),r.lineTo(e+s,t+n),r.quadraticCurveTo(e,t+n,e,t+n-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Lt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",s=r.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=Tr(n,"labelAngle",e);t=r.isEdge()?o:0}else s.strValue==="none"?t=0:t=s.pfValue;return t};Lt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=Tr(s,"labelX",t),u=Tr(s,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=Tr(s,"labelWidth",t),y=Tr(s,"labelHeight",t),g=e.pstyle(h+"text-margin-x").pfValue,p=e.pstyle(h+"text-margin-y").pfValue,m=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;m&&(b="center",w="center"),l+=g,u+=p;var E;switch(a?E=this.getTextAngle(e,t):E=0,E!==0&&(v=l,f=u,r.translate(v,f),r.rotate(E),l=0,u=0),w){case"top":break;case"center":u+=y/2;break;case"bottom":u+=y;break}var C=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,k=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,B=D==="round-rectangle"||D==="roundrectangle",P=D==="circle",A=2;if(C>0||T>0&&x>0){var R=r.fillStyle,L=r.strokeStyle,I=r.lineWidth,M=e.pstyle("text-background-color").value,O=e.pstyle("text-border-color").value,V=e.pstyle("text-border-style").value,G=C>0,N=T>0&&x>0,F=l-k;switch(b){case"left":F-=d;break;case"center":F-=d/2;break}var U=u-y-k,Q=d+2*k,K=y+2*k;if(G&&(r.fillStyle="rgba(".concat(M[0],",").concat(M[1],",").concat(M[2],",").concat(C*o,")")),N&&(r.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(x*o,")"),r.lineWidth=T,r.setLineDash))switch(V){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=T/4,r.setLineDash([]);break;default:r.setLineDash([]);break}if(B?(r.beginPath(),Gl(r,F,U,Q,K,A)):P?(r.beginPath(),qy(r,F,U,Q,K)):(r.beginPath(),r.rect(F,U,Q,K)),G&&r.fill(),N&&r.stroke(),N&&V==="double"){var j=T/2;r.beginPath(),B?Gl(r,F+j,U+j,Q-2*j,K-2*j,A):r.rect(F+j,U+j,Q-2*j,K-2*j),r.stroke()}r.fillStyle=R,r.strokeStyle=L,r.lineWidth=I,r.setLineDash&&r.setLineDash([])}var re=2*e.pstyle("text-outline-width").pfValue;if(re>0&&(r.lineWidth=re),e.pstyle("text-wrap").value==="wrap"){var ne=Tr(s,"labelWrapCachedLines",t),J=Tr(s,"labelLineHeight",t),z=d/2,q=this.getLabelJustification(e);switch(q==="auto"||(b==="left"?q==="left"?l+=-d:q==="center"&&(l+=-z):b==="center"?q==="left"?l+=-z:q==="right"&&(l+=z):b==="right"&&(q==="center"?l+=z:q==="right"&&(l+=d))),w){case"top":u-=(ne.length-1)*J;break;case"center":case"bottom":u-=(ne.length-1)*J;break}for(var H=0;H0&&r.strokeText(ne[H],l,u),r.fillText(ne[H],l,u),u+=J}else re>0&&r.strokeText(c,l,u),r.fillText(c,l,u);E!==0&&(r.rotate(-E),r.translate(-v,-f))}}};var yt={};yt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,v=u.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=s.usePaths(),d,y=!1,g=e.padding();o=e.width()+2*g,l=e.height()+2*g;var p;t&&(p=t,r.translate(-p.x1,-p.y1));for(var m=e.pstyle("background-image"),b=m.value,w=new Array(b.length),E=new Array(b.length),C=0,x=0;x0&&arguments[0]!==void 0?arguments[0]:A;s.eleFillStyle(r,e,ue)},J=function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;s.colorStrokeStyle(r,R[0],R[1],R[2],ue)},z=function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:K;s.colorStrokeStyle(r,U[0],U[1],U[2],ue)},q=function(ue,X,S,_){var W=s.nodePathCache=s.nodePathCache||[],$=cv(S==="polygon"?S+","+_.join(","):S,""+X,""+ue,""+re),Z=W[$],oe,ee=!1;return Z!=null?(oe=Z,ee=!0,v.pathCache=oe):(oe=new Path2D,W[$]=v.pathCache=oe),{path:oe,cacheHit:ee}},H=e.pstyle("shape").strValue,Y=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var te=q(o,l,H,Y);d=te.path,y=te.cacheHit}var ce=function(){if(!y){var ue=f;h&&(ue={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||r,ue.x,ue.y,o,l,re,v)}h?r.fill(d):r.fill()},Ae=function(){for(var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,S=u.backgrounding,_=0,W=0;W0&&arguments[0]!==void 0?arguments[0]:!1,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(r,e,X),ue&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,l,re,v)))},we=function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasStripe(e)&&(r.save(),h?r.clip(v.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,l,re,v),r.clip()),s.drawStripe(r,e,X),r.restore(),ue&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,f.x,f.y,o,l,re,v)))},ye=function(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,X=(B>0?B:-B)*ue,S=B>0?0:255;B!==0&&(s.colorFillStyle(r,S,S,S,X),h?r.fill(d):r.fill())},ie=function(){if(P>0){if(r.lineWidth=P,r.lineCap=M,r.lineJoin=I,r.setLineDash)switch(L){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(V),r.lineDashOffset=G;break;case"solid":case"double":r.setLineDash([]);break}if(O!=="center"){if(r.save(),r.lineWidth*=2,O==="inside")h?r.clip(d):r.clip();else{var ue=new Path2D;ue.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),ue.addPath(d),r.clip(ue,"evenodd")}h?r.stroke(d):r.stroke(),r.restore()}else h?r.stroke(d):r.stroke();if(L==="double"){r.lineWidth=P/3;var X=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=X}r.setLineDash&&r.setLineDash([])}},de=function(){if(F>0){if(r.lineWidth=F,r.lineCap="butt",r.setLineDash)switch(Q){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var ue=f;h&&(ue={x:0,y:0});var X=s.getNodeShape(e),S=P;O==="inside"&&(S=0),O==="outside"&&(S*=2);var _=(o+S+(F+j))/o,W=(l+S+(F+j))/l,$=o*_,Z=l*W,oe=s.nodeShapes[X].points,ee;if(h){var ve=q($,Z,X,oe);ee=ve.path}if(X==="ellipse")s.drawEllipsePath(ee||r,ue.x,ue.y,$,Z);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(X)){var le=0,me=0,De=0;X==="round-diamond"?le=(S+j+F)*1.4:X==="round-heptagon"?(le=(S+j+F)*1.075,De=-(S/2+j+F)/35):X==="round-hexagon"?le=(S+j+F)*1.12:X==="round-pentagon"?(le=(S+j+F)*1.13,De=-(S/2+j+F)/15):X==="round-tag"?(le=(S+j+F)*1.12,me=(S/2+F+j)*.07):X==="round-triangle"&&(le=(S+j+F)*(Math.PI/2),De=-(S+j/2+F)/Math.PI),le!==0&&(_=(o+le)/o,$=o*_,["round-hexagon","round-tag"].includes(X)||(W=(l+le)/l,Z=l*W)),re=re==="auto"?Ev($,Z):re;for(var Te=$/2,fe=Z/2,Pe=re+(S+F+j)/2,Be=new Array(oe.length/2),je=new Array(oe.length/2),Ke=0;Ke0){if(n=n||a.position(),i==null||s==null){var h=a.padding();i=a.width()+2*h,s=a.height()+2*h}o.colorFillStyle(t,v[0],v[1],v[2],u),o.nodeShapes[f].draw(t,n.x,n.y,i+l*2,s+l*2,c),t.fill()}}}};yt.drawNodeOverlay=Pf("overlay");yt.drawNodeUnderlay=Pf("underlay");yt.hasPie=function(r){return r=r[0],r._private.hasPie};yt.hasStripe=function(r){return r=r[0],r._private.hasStripe};yt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=a.x,u=a.y,v=e.width(),f=e.height(),c=Math.min(v,f)/2,h,d=0,y=this.usePaths();if(y&&(l=0,u=0),i.units==="%"?c=c*i.pfValue:i.pfValue!==void 0&&(c=i.pfValue/2),s.units==="%"?h=c*s.pfValue:s.pfValue!==void 0&&(h=s.pfValue/2),!(h>=c))for(var g=1;g<=n.pieBackgroundN;g++){var p=e.pstyle("pie-"+g+"-background-size").value,m=e.pstyle("pie-"+g+"-background-color").value,b=e.pstyle("pie-"+g+"-background-opacity").value*t,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d;E+=o;var C=2*Math.PI*w,x=E+C;p===0||d>=1||d+w>1||(h===0?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,c,E,x),r.closePath()):(r.beginPath(),r.arc(l,u,c,E,x),r.arc(l,u,h,x,E,!0),r.closePath()),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),d+=w)}};yt.drawStripe=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=a.x,s=a.y,o=e.width(),l=e.height(),u=0,v=this.usePaths();r.save();var f=e.pstyle("stripe-direction").value,c=e.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var h=o,d=l;c.units==="%"?(h=h*c.pfValue,d=d*c.pfValue):c.pfValue!==void 0&&(h=c.pfValue,d=c.pfValue),v&&(i=0,s=0),s-=h/2,i-=d/2;for(var y=1;y<=n.stripeBackgroundN;y++){var g=e.pstyle("stripe-"+y+"-background-size").value,p=e.pstyle("stripe-"+y+"-background-color").value,m=e.pstyle("stripe-"+y+"-background-opacity").value*t,b=g/100;b+u>1&&(b=1-u),!(g===0||u>=1||u+b>1)&&(r.beginPath(),r.rect(i,s+d*u,h,d*b),r.closePath(),this.colorFillStyle(r,p[0],p[1],p[2],m),r.fill(),u+=b)}r.restore()};var xr={},_y=100;xr.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};xr.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;ne.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!f&&(v[e.NODE]=!0,v[e.SELECT_BOX]=!0);var m=t.style(),b=t.zoom(),w=s!==void 0?s:b,E=t.pan(),C={x:E.x,y:E.y},x={zoom:b,pan:{x:E.x,y:E.y}},T=e.prevViewport,k=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!k&&!(y&&!d)&&(e.motionBlurPxRatio=1),o&&(C=o),w*=l,C.x*=l,C.y*=l;var D=e.getCachedZSortedEles();function B(J,z,q,H,Y){var te=J.globalCompositeOperation;J.globalCompositeOperation="destination-out",e.colorFillStyle(J,255,255,255,e.motionBlurTransparency),J.fillRect(z,q,H,Y),J.globalCompositeOperation=te}function P(J,z){var q,H,Y,te;!e.clearingMotionBlur&&(J===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||J===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(q={x:E.x*h,y:E.y*h},H=b*h,Y=e.canvasWidth*h,te=e.canvasHeight*h):(q=C,H=w,Y=e.canvasWidth,te=e.canvasHeight),J.setTransform(1,0,0,1,0,0),z==="motionBlur"?B(J,0,0,Y,te):!a&&(z===void 0||z)&&J.clearRect(0,0,Y,te),n||(J.translate(q.x,q.y),J.scale(H,H)),o&&J.translate(o.x,o.y),s&&J.scale(s,s)}if(f||(e.textureDrawLastFrame=!1),f){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var A=e.data.bufferContexts[e.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var x=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[e.DRAG]=!1,v[e.NODE]=!1;var R=u.contexts[e.NODE],L=e.textureCache.texture,x=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),c?B(R,0,0,x.width,x.height):R.clearRect(0,0,x.width,x.height);var I=m.core("outside-texture-bg-color").value,M=m.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,I[0],I[1],I[2],M),R.fillRect(0,0,x.width,x.height);var b=t.zoom();P(R,!1),R.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l),R.drawImage(L,x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l)}else e.textureOnViewport&&!a&&(e.textureCache=null);var O=t.extent(),V=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),G=e.hideEdgesOnViewport&&V,N=[];if(N[e.NODE]=!v[e.NODE]&&c&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!v[e.DRAG]&&c&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),v[e.NODE]||n||i||N[e.NODE]){var F=c&&!N[e.NODE]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),U=c&&!F?"motionBlur":void 0;P(R,U),G?e.drawCachedNodes(R,D.nondrag,l,O):e.drawLayeredElements(R,D.nondrag,l,O),e.debug&&e.drawDebugPoints(R,D.nondrag),!n&&!c&&(v[e.NODE]=!1)}if(!i&&(v[e.DRAG]||n||N[e.DRAG])){var F=c&&!N[e.DRAG]&&h!==1,R=a||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(R,c&&!F?"motionBlur":void 0),G?e.drawCachedNodes(R,D.drag,l,O):e.drawCachedElements(R,D.drag,l,O),e.debug&&e.drawDebugPoints(R,D.drag),!n&&!c&&(v[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,P),c&&h!==1){var Q=u.contexts[e.NODE],K=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=u.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(z,q,H){z.setTransform(1,0,0,1,0,0),H||!p?z.clearRect(0,0,e.canvasWidth,e.canvasHeight):B(z,0,0,e.canvasWidth,e.canvasHeight);var Y=h;z.drawImage(q,0,0,e.canvasWidth*Y,e.canvasHeight*Y,0,0,e.canvasWidth,e.canvasHeight)};(v[e.NODE]||N[e.NODE])&&(ne(Q,K,N[e.NODE]),v[e.NODE]=!1),(v[e.DRAG]||N[e.DRAG])&&(ne(j,re,N[e.DRAG]),v[e.DRAG]=!1)}e.prevViewport=x,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),c&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!f,e.mbFrames=0,v[e.NODE]=!0,v[e.DRAG]=!0,e.redraw()},_y)),a||t.emit("render")};var ha;xr.drawSelectionRectangle=function(r,e){var t=this,a=t.cy,n=t.data,i=a.style(),s=r.drawOnlyNodeLayer,o=r.drawAllLayers,l=n.canvasNeedsRedraw,u=r.forcedContext;if(t.showFps||!s&&l[t.SELECT_BOX]&&!o){var v=u||n.contexts[t.SELECT_BOX];if(e(v),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var f=t.cy.zoom(),c=i.core("selection-box-border-width").value/f;v.lineWidth=c,v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",v.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),c>0&&(v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",v.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(n.bgActivePosistion&&!t.hoverData.selecting){var f=t.cy.zoom(),h=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",v.beginPath(),v.arc(h.x,h.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI),v.fill()}var d=t.lastRedrawTime;if(t.showFps&&d){d=Math.round(d);var y=Math.round(1e3/d),g="1 frame = "+d+" ms = "+y+" fps";if(v.setTransform(1,0,0,1,0,0),v.fillStyle="rgba(255, 0, 0, 0.75)",v.strokeStyle="rgba(255, 0, 0, 0.75)",v.font="30px Arial",!ha){var p=v.measureText(g);ha=p.actualBoundingBoxAscent}v.fillText(g,0,ha);var m=60;v.strokeRect(0,ha+10,250,20),v.fillRect(0,ha+10,250*Math.min(y/m,1),20)}o||(l[t.SELECT_BOX]=!1)}};function Hl(r,e,t){var a=r.createShader(e);if(r.shaderSource(a,t),r.compileShader(a),!r.getShaderParameter(a,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(a));return a}function Gy(r,e,t){var a=Hl(r,r.VERTEX_SHADER,e),n=Hl(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,a),r.attachShader(i,n),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function Hy(r,e,t){t===void 0&&(t=e);var a=r.makeOffscreenCanvas(e,t),n=a.context=a.getContext("2d");return a.clear=function(){return n.clearRect(0,0,a.width,a.height)},a.clear(),a}function bo(r){var e=r.pixelRatio,t=r.cy.zoom(),a=r.cy.pan();return{zoom:t*e,pan:{x:a.x*e,y:a.y*e}}}function Wy(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function $y(r,e,t,a,n){var i=a*t+e.x,s=n*t+e.y;return s=Math.round(r.canvasHeight-s),[i,s]}function Uy(r){return r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function Ky(r,e){if(r.length!==e.length)return!1;for(var t=0;t>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Xy(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function Yy(r,e){var t=r.createTexture();return t.buffer=function(a){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,a),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}function Af(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function Rf(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function Zy(r,e,t,a,n,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*a,n);case r.INT:return new Int32Array(t.buffer,i*a,n)}}function Qy(r,e,t,a){var n=Af(r,e),i=Je(n,2),s=i[0],o=i[1],l=Rf(r,o,a),u=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),u}function Fr(r,e,t,a){var n=Af(r,t),i=Je(n,3),s=i[0],o=i[1],l=i[2],u=Rf(r,o,e*s),v=s*l,f=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,e*v,r.DYNAMIC_DRAW),r.enableVertexAttribArray(a),o===r.FLOAT?r.vertexAttribPointer(a,s,o,!1,v,0):o===r.INT&&r.vertexAttribIPointer(a,s,o,v,0),r.vertexAttribDivisor(a,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var c=new Array(e),h=0;hs&&(o=s/a,l=a*o,u=n*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(t,a,n){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(a),v=u.scale,f=u.texW,c=u.texH,h=function(b,w){if(n&&w){var E=w.context,C=b.x,x=b.row,T=C,k=l*x;E.save(),E.translate(T,k),E.scale(v,v),n(E,a),E.restore()}},d=[null,null],y=function(){h(i.freePointer,i.canvas),d[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:f,h:c},d[1]={x:i.freePointer.x+f,y:i.freePointer.row*l,w:0,h:c},i.freePointer.x+=f,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){var b=i.scratch,w=i.canvas;b.clear(),h({x:0,row:0},b);var E=s-i.freePointer.x,C=f-E,x=l;{var T=i.freePointer.x,k=i.freePointer.row*l,D=E;w.context.drawImage(b,0,0,D,x,T,k,D,x),d[0]={x:T,y:k,w:D,h:c}}{var B=E,P=(i.freePointer.row+1)*l,A=C;w&&w.context.drawImage(b,B,0,A,x,0,P,A,x),d[1]={x:0,y:P,w:A,h:c}}i.freePointer.x=C,i.freePointer.row++},p=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+f<=s)y();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(p(),y()):this.enableWrapping?g():(p(),y())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var a=this.texSize,n=this.texRows,i=this.getScale(t),s=i.texW;return this.freePointer.x+s>a?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},i=n.forceRedraw,s=i===void 0?!1:i,o=n.filterEle,l=o===void 0?function(){return!0}:o,u=n.filterType,v=u===void 0?function(){return!0}:u,f=!1,c=!1,h=kr(t),d;try{for(h.s();!(d=h.n()).done;){var y=d.value;if(l(y)){var g=kr(this.renderTypes.values()),p;try{var m=function(){var w=p.value,E=w.type;if(v(E)){var C=a.collections.get(w.collection),x=w.getKey(y),T=Array.isArray(x)?x:[x];if(s)T.forEach(function(P){return C.markKeyForGC(P)}),c=!0;else{var k=w.getID?w.getID(y):y.id(),D=a._key(E,k),B=a.typeAndIdToKey.get(D);B!==void 0&&!Ky(T,B)&&(f=!0,a.typeAndIdToKey.delete(D),B.forEach(function(P){return C.markKeyForGC(P)}))}}};for(g.s();!(p=g.n()).done;)m()}catch(b){g.e(b)}finally{g.f()}}}}catch(b){h.e(b)}finally{h.f()}return c&&(this.gc(),f=!1),f}},{key:"gc",value:function(){var t=kr(this.collections.values()),a;try{for(t.s();!(a=t.n()).done;){var n=a.value;n.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,a,n,i){var s=this.renderTypes.get(a),o=this.collections.get(s.collection),l=!1,u=o.draw(i,n,function(c){s.drawClipped?(c.save(),c.beginPath(),c.rect(0,0,n.w,n.h),c.clip(),s.drawElement(c,t,n,!0,!0),c.restore()):s.drawElement(c,t,n,!0,!0),l=!0});if(l){var v=s.getID?s.getID(t):t.id(),f=this._key(a,v);this.typeAndIdToKey.has(f)?this.typeAndIdToKey.get(f).push(i):this.typeAndIdToKey.set(f,[i])}return u}},{key:"getAtlasInfo",value:function(t,a){var n=this,i=this.renderTypes.get(a),s=i.getKey(t),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=i.getBoundingBox(t,l),v=n.getOrCreateAtlas(t,a,u,l),f=v.getOffsets(l),c=Je(f,2),h=c[0],d=c[1];return{atlas:v,tex:h,tex1:h,tex2:d,bb:u}})}},{key:"getDebugInfo",value:function(){var t=[],a=kr(this.collections),n;try{for(a.s();!(n=a.n()).done;){var i=Je(n.value,2),s=i[0],o=i[1],l=o.getCounts(),u=l.keyCount,v=l.atlasCount;t.push({type:s,keyCount:u,atlasCount:v})}}catch(f){a.e(f)}finally{a.f()}return t}}])})(),sm=(function(){function r(e){ht(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return gt(r,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,a){return a})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(t):!0}},{key:"getAtlasIndexForBatch",value:function(t){var a=this.batchAtlases.indexOf(t);if(a<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),a=this.batchAtlases.length-1}return a}}])})(),om=` + float circleSD(vec2 p, float r) { + return distance(vec2(0), p) - r; // signed distance + } +`,um=` + float rectangleSD(vec2 p, vec2 b) { + vec2 d = abs(p)-b; + return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); + } +`,lm=` + float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { + cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; + cr.x = (p.y > 0.0) ? cr.x : cr.y; + vec2 q = abs(p) - b + cr.x; + return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; + } +`,vm=` + float ellipseSD(vec2 p, vec2 ab) { + p = abs( p ); // symmetry + + // find root with Newton solver + vec2 q = ab*(p-ab); + float w = (q.x1.0) ? d : -d; + } +`,Ea={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},An={IGNORE:1,USE_BB:2},Cs=0,Kl=1,Xl=2,Ts=3,_t=4,sn=5,ga=6,pa=7,fm=(function(){function r(e,t,a){ht(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Hy,this.atlasManager=new im(e,a),this.batchManager=new sm(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ea.SCREEN),this.pickingProgram=this._createShaderProgram(Ea.PICKING),this.vao=this._createVAO()}return gt(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#version 300 es + precision highp float; + + uniform mat3 uPanZoomMatrix; + uniform int uAtlasSize; + + // instanced + in vec2 aPosition; // a vertex from the unit square + + in mat3 aTransform; // used to transform verticies, eg into a bounding box + in int aVertType; // the type of thing we are rendering + + // the z-index that is output when using picking mode + in vec4 aIndex; + + // For textures + in int aAtlasId; // which shader unit/atlas to use + in vec4 aTex; // x/y/w/h of texture in atlas + + // for edges + in vec4 aPointAPointB; + in vec4 aPointCPointD; + in vec2 aLineWidth; // also used for node border width + + // simple shapes + in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left] + in vec4 aColor; // also used for edges + in vec4 aBorderColor; // aLineWidth is used for border width + + // output values passed to the fragment shader + out vec2 vTexCoord; + out vec4 vColor; + out vec2 vPosition; + // flat values are not interpolated + flat out int vAtlasId; + flat out int vVertType; + flat out vec2 vTopRight; + flat out vec2 vBotLeft; + flat out vec4 vCornerRadius; + flat out vec4 vBorderColor; + flat out vec2 vBorderWidth; + flat out vec4 vIndex; + + void main(void) { + int vid = gl_VertexID; + vec2 position = aPosition; // TODO make this a vec3, simplifies some code below + + if(aVertType == `.concat(Cs,`) { + float texX = aTex.x; // texture coordinates + float texY = aTex.y; + float texW = aTex.z; + float texH = aTex.w; + + if(vid == 1 || vid == 2 || vid == 4) { + texX += texW; + } + if(vid == 2 || vid == 4 || vid == 5) { + texY += texH; + } + + float d = float(uAtlasSize); + vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(_t," || aVertType == ").concat(pa,` + || aVertType == `).concat(sn," || aVertType == ").concat(ga,`) { // simple shapes + + // the bounding box is needed by the fragment shader + vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat + vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat + vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated + + // calculations are done in the fragment shader, just pass these along + vColor = aColor; + vCornerRadius = aCornerRadius; + vBorderColor = aBorderColor; + vBorderWidth = aLineWidth; + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + } + else if(aVertType == `).concat(Kl,`) { + vec2 source = aPointAPointB.xy; + vec2 target = aPointAPointB.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + // stretch the unit square into a long skinny rectangle + vec2 xBasis = target - source; + vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); + vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y; + + gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); + vColor = aColor; + } + else if(aVertType == `).concat(Xl,`) { + vec2 pointA = aPointAPointB.xy; + vec2 pointB = aPointAPointB.zw; + vec2 pointC = aPointCPointD.xy; + vec2 pointD = aPointCPointD.zw; + + // adjust the geometry so that the line is centered on the edge + position.y = position.y - 0.5; + + vec2 p0, p1, p2, pos; + if(position.x == 0.0) { // The left side of the unit square + p0 = pointA; + p1 = pointB; + p2 = pointC; + pos = position; + } else { // The right side of the unit square, use same approach but flip the geometry upside down + p0 = pointD; + p1 = pointC; + p2 = pointB; + pos = vec2(0.0, -position.y); + } + + vec2 p01 = p1 - p0; + vec2 p12 = p2 - p1; + vec2 p21 = p1 - p2; + + // Find the normal vector. + vec2 tangent = normalize(normalize(p12) + normalize(p01)); + vec2 normal = vec2(-tangent.y, tangent.x); + + // Find the vector perpendicular to p0 -> p1. + vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); + + // Determine the bend direction. + float sigma = sign(dot(p01 + p21, normal)); + float width = aLineWidth[0]; + + if(sign(pos.y) == -sigma) { + // This is an intersecting vertex. Adjust the position so that there's no overlap. + vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } else { + // This is a non-intersecting vertex. Treat it like a mitre join. + vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); + gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); + } + + vColor = aColor; + } + else if(aVertType == `).concat(Ts,` && vid < 3) { + // massage the first triangle into an edge arrow + if(vid == 0) + position = vec2(-0.15, -0.3); + if(vid == 1) + position = vec2( 0.0, 0.0); + if(vid == 2) + position = vec2( 0.15, -0.3); + + gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); + vColor = aColor; + } + else { + gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space + } + + vAtlasId = aAtlasId; + vVertType = aVertType; + vIndex = aIndex; + } + `),i=this.batchManager.getIndexArray(),s=`#version 300 es + precision highp float; + + // declare texture unit for each texture atlas in the batch + `.concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(` + `),` + + uniform vec4 uBGColor; + uniform float uZoom; + + in vec2 vTexCoord; + in vec4 vColor; + in vec2 vPosition; // model coordinates + + flat in int vAtlasId; + flat in vec4 vIndex; + flat in int vVertType; + flat in vec2 vTopRight; + flat in vec2 vBotLeft; + flat in vec4 vCornerRadius; + flat in vec4 vBorderColor; + flat in vec2 vBorderWidth; + + out vec4 outColor; + + `).concat(om,` + `).concat(um,` + `).concat(lm,` + `).concat(vm,` + + vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha + return vec4( + top.rgb + (bot.rgb * (1.0 - top.a)), + top.a + (bot.a * (1.0 - top.a)) + ); + } + + vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance + // scale to the zoom level so that borders don't look blurry when zoomed in + // note 1.5 is an aribitrary value chosen because it looks good + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + } + + void main(void) { + if(vVertType == `).concat(Cs,`) { + // look up the texel from the texture unit + `).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` + else `),` + } + else if(vVertType == `).concat(Ts,`) { + // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; + outColor = blend(vColor, uBGColor); + outColor.a = 1.0; // make opaque, masks out line under arrow + } + else if(vVertType == `).concat(_t,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done + } + else if(vVertType == `).concat(_t," || vVertType == ").concat(pa,` + || vVertType == `).concat(sn," || vVertType == ").concat(ga,`) { // use SDF + + float outerBorder = vBorderWidth[0]; + float innerBorder = vBorderWidth[1]; + float borderPadding = outerBorder * 2.0; + float w = vTopRight.x - vBotLeft.x - borderPadding; + float h = vTopRight.y - vBotLeft.y - borderPadding; + vec2 b = vec2(w/2.0, h/2.0); // half width, half height + vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center + + float d; // signed distance + if(vVertType == `).concat(_t,`) { + d = rectangleSD(p, b); + } else if(vVertType == `).concat(pa,` && w == h) { + d = circleSD(p, b.x); // faster than ellipse + } else if(vVertType == `).concat(pa,`) { + d = ellipseSD(p, b); + } else { + d = roundRectangleSD(p, b, vCornerRadius.wzyx); + } + + // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling + // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box + if(d > 0.0) { + if(d > outerBorder) { + discard; + } else { + outColor = distInterp(vBorderColor, vec4(0), d - outerBorder); + } + } else { + if(d > innerBorder) { + vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; + vec4 innerBorderColor = blend(vBorderColor, vColor); + outColor = distInterp(innerBorderColor, outerColor, d); + } + else { + vec4 outerColor; + if(innerBorder == 0.0 && outerBorder == 0.0) { + outerColor = vec4(0); + } else if(innerBorder == 0.0) { + outerColor = vBorderColor; + } else { + outerColor = blend(vBorderColor, vColor); + } + outColor = distInterp(vColor, outerColor, d - innerBorder); + } + } + } + else { + outColor = vColor; + } + + `).concat(t.picking?`if(outColor.a == 0.0) discard; + else outColor = vIndex;`:"",` + } + `),o=Gy(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:Ea.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(t);if(l===An.IGNORE)return;if(l==An.USE_BB){this.drawPickingRectangle(t,a,n);return}}var u=i.getAtlasInfo(t,n),v=kr(u),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p=this.maxInstances&&this.endBatch()}}}}catch(B){v.e(B)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,v=i.tex2,f=u.w/(u.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(l,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;$l(t);var l=n.getRotation?n.getRotation(i):0;if(l!==0){var u=n.getRotationPoint(i),v=u.x,f=u.y;yn(t,t,[v,f]),Ul(t,t,l);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;yn(t,t,[s,o]),Ws(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,l=t.w,u=t.h,v=t.yOffset;a&&(s-=a,o-=a,l+=2*a,u+=2*a);var f=0,c=l*i;return n&&i<1?l=c:!n&&i<1&&(f=l-c,s+=f,l=c),{x1:s,y1:o,w:l,h:u,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=_t;var o=this.indexBuffer.getView(s);qt(a,o);var l=this.colorBuffer.getView(s);xt([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,a,n);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===sn||o===ga){var u=i.getBoundingBox(t),v=this._getCornerRadius(t,s.radius,u),f=this.cornerRadiusBuffer.getView(l);f[0]=v,f[1]=v,f[2]=v,f[3]=v,o===ga&&(f[0]=0,f[2]=0)}var c=this.indexBuffer.getView(l);qt(a,c);var h=t.pstyle(s.color).value,d=t.pstyle(s.opacity).value,y=this.colorBuffer.getView(l);xt(h,d,y);var g=this.lineWidthBuffer.getView(l);if(g[0]=0,g[1]=0,s.border){var p=t.pstyle("border-width").value;if(p>0){var m=t.pstyle("border-color").value,b=t.pstyle("border-opacity").value,w=this.borderColorBuffer.getView(l);xt(m,b,w);var E=t.pstyle("border-position").value;if(E==="inside")g[0]=0,g[1]=-p;else if(E==="outside")g[0]=p,g[1]=0;else{var C=p/2;g[0]=C,g[1]=-C}}}var x=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,x,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,a){var n=t.pstyle(a).value;switch(n){case"rectangle":return _t;case"ellipse":return pa;case"roundrectangle":case"round-rectangle":return sn;case"bottom-round-rectangle":return ga;default:return}}},{key:"_getCornerRadius",value:function(t,a,n){var i=n.w,s=n.h;if(t.pstyle(a).value==="auto")return vt(i,s);var o=t.pstyle(a).pfValue,l=i/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(t,a,n){if(t.visible()){var i=t._private.rscratch,s,o,l;if(n==="source"?(s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=t.pstyle(n+"-arrow-shape").value;if(u!=="none"){var v=t.pstyle(n+"-arrow-color").value,f=t.pstyle("opacity").value,c=t.pstyle("line-opacity").value,h=f*c,d=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,g=this.r.getArrowWidth(d,y),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);$l(m),yn(m,m,[s,o]),Ws(m,m,[g,g]),Ul(m,m,l),this.vertTypeBuffer.getView(p)[0]=Ts;var b=this.indexBuffer.getView(p);qt(a,b);var w=this.colorBuffer.getView(p);xt(v,h,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(t,a){if(t.visible()){var n=this._getEdgePoints(t);if(n){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*s;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=Kl;var f=this.indexBuffer.getView(v);qt(a,f);var c=this.colorBuffer.getView(v);xt(l,u,c);var h=this.lineWidthBuffer.getView(v);h[0]=o;var d=this.pointAPointBBuffer.getView(v);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var a=t._private.rscratch;return!(a.badLine||a.allpts==null||isNaN(a.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var a=t._private.rscratch;if(this._isValidEdge(t)){var n=a.allpts;if(n.length==4)return n;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(n,i)}}},{key:"_getNumSegments",value:function(t){var a=15;return Math.min(Math.max(a,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,a){if(t.length==4)return t;for(var n=Array((a+1)*2),i=0;i<=a;i++)if(i==0)n[0]=t[0],n[1]=t[1];else if(i==a)n[i*2]=t[t.length-2],n[i*2+1]=t[t.length-1];else{var s=i/a;this._setCurvePoint(t,s,n,i*2)}return n}},{key:"_setCurvePoint",value:function(t,a,n,i){if(t.length<=2)n[i]=t[0],n[i+1]=t[1];else{for(var s=Array(t.length-2),o=0;o0}},o=function(f){var c=f.pstyle("text-events").strValue==="yes";return c?An.USE_BB:An.IGNORE},l=function(f){var c=f.position(),h=c.x,d=c.y,y=f.outerWidth(),g=f.outerHeight();return{w:y,h:g,x1:h-y/2,y1:d-g/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:Uy,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getLabelKey,null),getBoundingBox:ks(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:n(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getSourceLabelKey,"source"),getBoundingBox:ks(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:n("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:Ss(e.getTargetLabelKey,"target"),getBoundingBox:ks(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:n("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=Fa(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(v,f){var c=!1;f&&f.length>0&&(c|=t.drawing.invalidate(f)),c&&u()}),dm(t)};function cm(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return iv(t)}function Lf(r,e){var t=r._private.rscratch;return Tr(t,"labelWrapCachedLines",e)||[]}var Ss=function(e,t){return function(a){var n=e(a),i=Lf(a,t);return i.length>1?i.map(function(s,o){return"".concat(n,"_").concat(o)}):n}},ks=function(e,t){return function(a,n){var i=e(a);if(typeof n=="string"){var s=n.indexOf("_");if(s>0){var o=Number(n.substring(s+1)),l=Lf(a,t),u=i.h/l.length,v=u*o,f=i.y1+v;return{x1:i.x1,w:i.w,y1:f,h:u,yOffset:v}}}return i}};function dm(r){{var e=r.render;r.render=function(i){i=i||{};var s=r.cy;r.webgl&&(s.zoom()>Sf?(hm(r),e.call(r,i)):(gm(r),Of(r,i,Ea.SCREEN)))}}{var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0}}r.findNearestElements=function(i,s,o,l){return xm(r,i,s)};{var a=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){a.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var n=r.notify;r.notify=function(i,s){n.call(r,i,s),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(s,{type:"node-body"})}}}function hm(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function gm(r){var e=function(a){a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,r.canvasWidth,r.canvasHeight),a.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}function pm(r){var e=r.canvasWidth,t=r.canvasHeight,a=bo(r),n=a.pan,i=a.zoom,s=Es();yn(s,s,[n.x,n.y]),Ws(s,s,[i,i]);var o=Es();rm(o,e,t);var l=Es();return em(l,o,s),l}function If(r,e){var t=r.canvasWidth,a=r.canvasHeight,n=bo(r),i=n.pan,s=n.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,a),e.translate(i.x,i.y),e.scale(s,s)}function ym(r,e){r.drawSelectionRectangle(e,function(t){return If(r,t)})}function mm(r){var e=r.data.contexts[r.NODE];e.save(),If(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function bm(r){var e=function(n,i,s){for(var o=n.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=o.atlases,v=0;v=0&&w.add(x)}return w}function xm(r,e,t){var a=wm(r,e,t),n=r.getCachedZSortedEles(),i,s,o=kr(a),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,v=n[u];if(!i&&v.isNode()&&(i=v),!s&&v.isEdge()&&(s=v),i&&s)break}}catch(f){o.e(f)}finally{o.f()}return[i,s].filter(Boolean)}function Ds(r,e,t){var a=r.drawing;e+=1,t.isNode()?(a.drawNode(t,e,"node-underlay"),a.drawNode(t,e,"node-body"),a.drawTexture(t,e,"label"),a.drawNode(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"label"),a.drawTexture(t,e,"edge-source-label"),a.drawTexture(t,e,"edge-target-label"))}function Of(r,e,t){var a;r.webglDebug&&(a=performance.now());var n=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&ym(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=pm(r),l=r.getCachedZSortedEles();if(i=l.length,n.startFrame(o,t),t.screen){for(var u=0;u0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*u,-a.y1*u),h.scale(u,u),this.drawElements(h,d),h.scale(1/u,1/u),h.translate(a.x1*u,a.y1*u);else{var y=e.pan(),g={x:y.x*u,y:y.y*u};u*=e.zoom(),h.translate(g.x,g.y),h.scale(u,u),this.drawElements(h,d),h.scale(1/u,1/u),h.translate(-g.x,-g.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return c};function Em(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i"u"?"undefined":ar(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var a=this.cy.window(),n=a.document;t=n.createElement("canvas"),t.width=r,t.height=e}return t};[Df,Hr,Jr,mo,Lt,yt,xr,Mf,mt,Wa,Ff].forEach(function(r){be(ke,r)});var Sm=[{name:"null",impl:df},{name:"base",impl:Cf},{name:"canvas",impl:Cm}],km=[{type:"layout",extensions:Qp},{type:"renderer",extensions:Sm}],qf={},_f={};function Gf(r,e,t){var a=t,n=function(T){Ve("Can not register `"+e+"` for `"+r+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(Ra.prototype[e])return n(e);Ra.prototype[e]=t}else if(r==="collection"){if(fr.prototype[e])return n(e);fr.prototype[e]=t}else if(r==="layout"){for(var i=function(T){this.options=T,t.call(this,T),Le(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],l=0;l{b.clear(),J.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=b.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),se=w((e,t)=>{const n=b.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{i.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const r=t.children(e)||[];e!==a&&r.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);i.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(i.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",a,"data",t.node(e),a),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);i.debug("Copying Edges",u),u.forEach(c=>{i.info("Edge",c);const m=t.edge(c.v,c.w,c.name);i.info("Edge data",m,a);try{se(c,a)?(i.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(v){i.error(v)}})}i.debug("Removing node",o),t.removeNode(o)})},"copy"),R=w((e,t)=>{const n=t.children(e);let a=[...n];for(const r of n)J.set(r,e),a=[...a,...R(r,t)];return a},"extractDescendants"),ie=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),r=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=r.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(i.trace("Searching children of id ",e,a),a.length<1)return e;let r;for(const o of a){const l=C(o,t,n),u=ie(t,n,l);if(l)if(u.length>0)r=l;else return l}return r},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),re=w((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),b.set(n,R(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),r=e.edges();a.length>0?(i.debug("Cluster identified",n,b),r.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",b.get(n)),d.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,b)});for(let n of d.keys()){const a=d.get(n).id,r=e.parent(a);r!==n&&d.has(r)&&!d.get(r).externalConnections&&(d.get(n).id=r)}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,o=n.w;if(i.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const l=e.parent(r);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",r,o,n.name),e.setEdge(r,o,a,n.name)}}),i.warn("Adjusted Graph",h(e)),T(e,0),i.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(i.warn("extractor - ",t,h(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),a=!1;for(const r of n){const o=e.children(r);a=a||o.length>0}if(!a){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,d,d.has(r)&&!d.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!d.has(r))i.debug("Not a cluster",r,t);else if(!d.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(r)?.clusterData?.dir&&(l=d.get(r).clusterData.dir,i.warn("Fixing dir",d.get(r).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",h(e)),G(r,e,u,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:d.get(r).clusterData,label:d.get(r).label,graph:u}),i.warn("New graph after copy node: (",r,")",h(u)),i.debug("Old graph after copy",h(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!d.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(d);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const o=e.node(r);i.warn(" Now next level",r,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),M=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const r=e.children(a),o=M(e,r);n=[...n,...o]}),n},"sorter"),oe=w(e=>M(e,e.children()),"sortNodesByHierarchy"),j=w(async(e,t,n,a,r,o)=>{i.warn("Graph in recursive render:XAX",h(t),r);const l=t.graph().rankdir;i.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),v=u.insert("g").attr("class","edgeLabels"),p=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(r!==void 0){const g=JSON.parse(JSON.stringify(r.clusterData));i.trace(`Setting data for parent cluster XXX + Node.id = `,f,` + data=`,g.height,` +Parent cluster`,r.height),t.setNode(r.id,g),t.parent(f)||(i.trace("Setting parent",f,r.id),t.setParent(f,r.id,g))}if(i.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){i.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:y}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:y});const E=await j(p,s.graph,n,a,t.node(f),o),x=E.elem;z(s,x),s.diff=E.diff||0,i.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),K(x,s)}else t.children(f).length>0?(i.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),i.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",f,p,t.node(f),l),await U(p,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await Z(v,g)});await Promise.all(f)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(h(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(h(t)));let O=0,{subGraphTitleTotalMargin:S}=$(o);return await Promise.all(oe(t).map(async function(f){const s=t.node(f);if(i.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,i.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){i.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,y=s?.labelBBox?.height||0,E=y-g||0;i.debug("OffsetY",E,"labelHeight",y,"halfPadding",g),await q(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);i.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var y=t.node(f.w);const E=Q(m,s,d,n,g,y,a);W(s,E)}),t.nodes().forEach(function(f){const s=t.node(f);i.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),i.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ve=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");F(a,e.markers,e.type,e.diagramId),Y(),_(),H(),te(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const v=structuredClone(o),p=structuredClone(o),X=structuredClone(o);v.label="",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-1",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=l+"-cyclic-special-mid",X.label="",m.isGroup&&(v.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,v,l+"-cyclic-special-0"),n.setEdge(u,c,p,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cyc=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function J(n){return n=j(Math.abs(n)),n?n[1]:NaN}function K(n,t){return function(e,i){for(var o=e.length,f=[],c=0,u=n[0],p=0;o>0&&u>0&&(p+u+1>i&&(u=Math.max(1,i-p)),f.push(e.substring(o-=u,o+u)),!((p+=u+1)>i));)u=n[c=(c+1)%n.length];return f.reverse().join(t)}}function Q(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var V=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function N(n){if(!(t=V.exec(n)))throw new Error("invalid format: "+n);var t;return new $({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}N.prototype=$.prototype;function $(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function W(n){n:for(var t=n.length,e=1,i=-1,o;e0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var U;function _(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1],f=o-(U=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return f===c?i:f>c?i+new Array(f-c+1).join("0"):f>0?i.slice(0,f)+"."+i.slice(f):"0."+new Array(1-f).join("0")+j(n,Math.max(0,t+f-1))[0]}function G(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const I={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:H,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>G(n*100,t),r:G,s:_,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function X(n){return n}var O=Array.prototype.map,R=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function v(n){var t=n.grouping===void 0||n.thousands===void 0?X:K(O.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",f=n.numerals===void 0?X:Q(O.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",u=n.minus===void 0?"−":n.minus+"",p=n.nan===void 0?"NaN":n.nan+"";function F(a){a=N(a);var x=a.fill,M=a.align,m=a.sign,w=a.symbol,l=a.zero,S=a.width,E=a.comma,g=a.precision,L=a.trim,d=a.type;d==="n"?(E=!0,d="g"):I[d]||(g===void 0&&(g=12),L=!0,d="g"),(l||x==="0"&&M==="=")&&(l=!0,x="0",M="=");var Z=w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",q=w==="$"?i:/[%p]/.test(d)?c:"",T=I[d],B=/[defgprs%]/.test(d);g=g===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function C(r){var y=Z,h=q,b,D,k;if(d==="c")h=T(r)+h,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?p:T(Math.abs(r),g),L&&(r=W(r)),P&&+r==0&&m!=="+"&&(P=!1),y=(P?m==="("?m:u:m==="-"||m==="("?"":m)+y,h=(d==="s"?R[8+U/3]:"")+h+(P&&m==="("?")":""),B){for(b=-1,D=r.length;++bk||k>57){h=(k===46?o+r.slice(b+1):r.slice(b))+h,r=r.slice(0,b);break}}}E&&!l&&(r=t(r,1/0));var z=y.length+r.length+h.length,s=z>1)+y+r+h+s.slice(z);break;default:r=s+y+r+h;break}return f(r)}return C.toString=function(){return a+""},C}function Y(a,x){var M=F((a=N(a),a.type="f",a)),m=Math.max(-8,Math.min(8,Math.floor(J(x)/3)))*3,w=Math.pow(10,-m),l=R[8+m/3];return function(S){return M(w*S)+l}}return{format:F,formatPrefix:Y}}var A,nn,tn;rn({thousands:",",grouping:[3],currency:["$",""]});function rn(n){return A=v(n),nn=A.format,tn=A.formatPrefix,A}export{tn as a,nn as b,J as e,N as f}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-PSM6KHXK-CDDrBtG2.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-PSM6KHXK-CDDrBtG2.js new file mode 100644 index 0000000000..caaa0eef78 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-PSM6KHXK-CDDrBtG2.js @@ -0,0 +1,24 @@ +import{_ as w,a4 as te,a5 as ae,a8 as he,G as pe,E as K,bY as B,B as j,y as ue,x as fe,U as me,V as ge,w as ye,v as Se,a6 as ve,bZ as xe,$ as be}from"./index-DpOBiJiD.js";import{s as we}from"./chunk-QN33PNHL-Cb84mGB3.js";import{p as Ce}from"./chunk-4BX2VUAB-D7HUlyWF.js";import{p as Te}from"./treemap-KMMF4GRG-BN7IEAji.js";import{b as O}from"./defaultLocale-C4B-KCzX.js";import{o as J}from"./ordinal-Cboi1Yqb.js";import"./forEach-CTOHlvm6.js";import"./difference-CEM8oPgu.js";import"./_basePickBy-DTjWYYGV.js";import"./min-De9wrADv.js";import"./isUndefined-B80uo2Th.js";import"./clone-CQ2NOoIB.js";import"./init-Gi6I4Gst.js";function Le(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function $e(){return this.eachAfter(Le)}function Ae(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Fe(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function ke(t,a){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d=0;)l+=n[o].value;a.value=l})}function _e(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,l=Ve(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Ve(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function De(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Be(){return Array.from(this)}function Pe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ee(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Re(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o=0;--h)o.push(s=d[h]=new U(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ge)}function We(){return Q(this).eachBefore(Oe)}function He(t){return t.children}function Ie(t){return Array.isArray(t)?t[1]:null}function Oe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ge(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=Q.prototype={constructor:U,count:$e,each:Ae,eachAfter:ke,eachBefore:Fe,find:Ne,sum:Me,sort:_e,path:ze,ancestors:De,descendants:Be,leaves:Pe,links:Ee,copy:We,[Symbol.iterator]:Re};function qe(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Xe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ye(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(n-a)/t.value;++hN&&(N=c),M=u*u*R,k=Math.max(N/M,M/g),k>V){u-=c;break}V=k}d.push(m={value:u,dice:x1?n:1)},l})(Ue);function Ke(){var t=Je,a=!1,l=1,n=1,o=[0],s=G,d=G,h=G,m=G,c=G;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(b),o=[0],a&&r.eachBefore(Xe),r}function b(r){var x=o[r.depth],S=r.x0+x,v=r.y0+x,u=r.x1-x,g=r.y1-x;u{xe(s)&&(n?.textStyles?n.textStyles.push(s):n.textStyles=[s]),n?.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(E,"TreeMapDB"),E);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n?.classSelector,n?.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}w(le,"buildHierarchy");var Qe=w((t,a)=>{Ce(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(b)}const n=le(l),o=w((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),et=w(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:w(async t=>{try{const l=await Te("treemap",t);K.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(l,n)}catch(a){throw K.error("Error parsing treemap:",a),a}},"parse")},tt=10,P=10,X=25,at=w((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??tt,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=ae();if(!m)return;const p=h?30:0,b=he(a),r=s.nodeWidth?s.nodeWidth*P:960,x=s.nodeHeight?s.nodeHeight*P:500,S=r,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),pe(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(i=>"$"+O(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),f=i?i[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);u=w(f=>"$"+O(i||"")(f),"valueFormat")}else u=O(e)}catch(e){K.error("Error creating format function:",e),u=O(",")}const g=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),ee=Ke().size([r,x]).paddingTop(e=>e.children&&e.children.length>0?X+P:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?P:0).paddingRight(e=>e.children&&e.children.length>0?P:0).paddingBottom(e=>e.children&&e.children.length>0?P:0).round(!0)(R),se=ee.descendants().filter(e=>e.children&&e.children.length>0),W=V.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),W.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>g(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=B({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=j(this),f=e.data.name;i.text(f);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const ie=ee.leaves(),Y=V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=j(this),f=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,z=6,H=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(z,Math.min(F,Math.round(y*T))),Z=y+H+I;for(;Z>A&&y>_&&(y--,I=Math.max(z,Math.min(F,Math.round(y*T))),!(ID||y<_||A(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const z=(i.y1-i.y0)/2+$/2+_;f.attr("y",z);const H=i.x1-i.x0,ce=i.y1-i.y0-4,de=H-8;f.node().getComputedTextLength()>de||z+F>ce||F{const a=te(rt,t);return` + .treemapNode.section { + stroke: ${a.sectionStrokeColor}; + stroke-width: ${a.sectionStrokeWidth}; + fill: ${a.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${a.leafStrokeColor}; + stroke-width: ${a.leafStrokeWidth}; + fill: ${a.leafFillColor}; + } + .treemapLabel { + fill: ${a.labelColor}; + font-size: ${a.labelFontSize}; + } + .treemapValue { + fill: ${a.valueColor}; + font-size: ${a.valueFontSize}; + } + .treemapTitle { + fill: ${a.titleColor}; + font-size: ${a.titleFontSize}; + } + `},"getStyles"),it=st,wt={parser:re,get db(){return new ne},renderer:lt,styles:it};export{wt as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-QEK2KX5R-NGpX9WNy.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-QEK2KX5R-NGpX9WNy.js new file mode 100644 index 0000000000..23e3033657 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-QEK2KX5R-NGpX9WNy.js @@ -0,0 +1,43 @@ +import{_ as l,v as k,w as R,V as E,U as I,x as _,y as F,a8 as D,$ as G,a4 as f,a5 as w,a6 as P,E as z,aa as V}from"./index-DpOBiJiD.js";import{p as W}from"./chunk-4BX2VUAB-D7HUlyWF.js";import{p as B}from"./treemap-KMMF4GRG-BN7IEAji.js";import"./forEach-CTOHlvm6.js";import"./difference-CEM8oPgu.js";import"./_basePickBy-DTjWYYGV.js";import"./min-De9wrADv.js";import"./isUndefined-B80uo2Th.js";import"./clone-CQ2NOoIB.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},C={axes:[],curves:[],options:h},m=structuredClone(C),H=P.radar,j=l(()=>f({...H,...w().radar}),"getConfig"),b=l(()=>m.axes,"getAxes"),U=l(()=>m.curves,"getCurves"),N=l(()=>m.options,"getOptions"),X=l(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=l(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),q=l(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule}},"setOptions"),J=l(()=>{G(),m=structuredClone(C)},"clear"),$={getAxes:b,getCurves:U,getOptions:N,setAxes:X,setCurves:Y,setOptions:q,getConfig:j,clear:J,setAccTitle:F,getAccTitle:_,setDiagramTitle:I,getDiagramTitle:E,getAccDescription:R,setAccDescription:k},K=l(a=>{W(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),Q={parse:l(async a=>{const t=await B("radar",a);z.debug(t),K(t)},"parse")},tt=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),u=D(t),p=et(u,c),g=n.max??Math.max(...i.map(y=>Math.max(...y.entries))),x=n.min,v=Math.min(c.width,c.height)/2;at(p,o,v,n.ticks,n.graticule),rt(p,o,v,c),M(p,o,i,x,g,n.graticule,c),T(p,i,n.showLegend,c),p.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),et=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return a.attr("viewbox",`0 0 ${e} ${r}`).attr("width",e).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),at=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o{const p=2*u*Math.PI/o-Math.PI/2,g=n*Math.cos(p),x=n*Math.sin(p);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),rt=l((a,t,e,r)=>{const s=t.length;for(let o=0;o{if(d.entries.length!==n)return;const p=d.entries.map((g,x)=>{const v=2*Math.PI*x/n-Math.PI/2,y=A(g,r,s,c),O=y*Math.cos(v),S=y*Math.sin(v);return{x:O,y:S}});o==="circle"?a.append("path").attr("d",L(p,i.curveTension)).attr("class",`radarCurve-${u}`):o==="polygon"&&a.append("polygon").attr("points",p.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${u}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var st={draw:tt},nt=l((a,t)=>{let e="";for(let r=0;r{const t=V(),e=w(),r=f(t,e.themeVariables),s=f(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),it=l(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=ot(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + dominant-baseline: middle; + text-anchor: middle; + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${nt(t,e)} + `},"styles"),vt={parser:Q,db:$,renderer:st,styles:it};export{vt as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-S2PKOQOG-CYzJ72WI.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-S2PKOQOG-CYzJ72WI.js new file mode 100644 index 0000000000..af79f4a9db --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/diagram-S2PKOQOG-CYzJ72WI.js @@ -0,0 +1,24 @@ +import{_ as b,a4 as u,a8 as B,G as C,E as w,y as S,x as D,U as T,V as E,w as P,v as z,a5 as F,a6 as A,$ as W}from"./index-DpOBiJiD.js";import{p as _}from"./chunk-4BX2VUAB-D7HUlyWF.js";import{p as N}from"./treemap-KMMF4GRG-BN7IEAji.js";import"./forEach-CTOHlvm6.js";import"./difference-CEM8oPgu.js";import"./_basePickBy-DTjWYYGV.js";import"./min-De9wrADv.js";import"./isUndefined-B80uo2Th.js";import"./clone-CQ2NOoIB.js";var L=A.packet,m,v=(m=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=E,this.getAccDescription=P,this.setAccDescription=z}getConfig(){const t=u({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},b(m,"PacketDB"),m),M=1e4,Y=b((e,t)=>{_(e,t);let r=-1,o=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const o=t*r-1,n=t*r;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},I=b((e,t,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=B(t);f.attr("viewbox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())O(f,$,y,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((e,t,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(o+l)+l;for(const s of t){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),U={draw:I},j={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:e}={})=>{const t=u(j,e);return` + .packetByte { + font-size: ${t.byteFontSize}; + } + .packetByte.start { + fill: ${t.startByteColor}; + } + .packetByte.end { + fill: ${t.endByteColor}; + } + .packetLabel { + fill: ${t.labelColor}; + font-size: ${t.labelFontSize}; + } + .packetTitle { + fill: ${t.titleColor}; + font-size: ${t.titleFontSize}; + } + .packetBlock { + stroke: ${t.blockStrokeColor}; + stroke-width: ${t.blockStrokeWidth}; + fill: ${t.blockFillColor}; + } + `},"styles"),et={parser:x,get db(){return new v},renderer:U,styles:H};export{et as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/difference-CEM8oPgu.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/difference-CEM8oPgu.js new file mode 100644 index 0000000000..6925367141 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/difference-CEM8oPgu.js @@ -0,0 +1 @@ +import{bG as l,bF as p,bH as A,aL as m,aM as h}from"./index-DpOBiJiD.js";import{b as S,i as L,j as k,g as w,S as y,l as R,m as G,a as I}from"./forEach-CTOHlvm6.js";import{b as j}from"./_basePickBy-DTjWYYGV.js";function H(n,i,r){var s=-1,e=n.length;i<0&&(i=-i>e?0:e+i),r=r>e?e:r,r<0&&(r+=e),e=i>r?0:r-i>>>0,i>>>=0;for(var f=Array(e);++s=x&&(f=G,o=!1,i=new y(i));n:for(;++e"u"&&(f.yylloc={});var ot=f.yylloc;t.push(ot);var Ct=f.options&&f.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(b){c.length=c.length-2*b,p.length=p.length-b,t.length=t.length-b}u(vt,"popStack");function Ot(){var b;return b=r.pop()||f.lex()||Tt,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}u(Ot,"lex");for(var g,I,m,ht,v={},J,k,At,$;;){if(I=c[c.length-1],this.defaultActions[I]?m=this.defaultActions[I]:((g===null||typeof g>"u")&&(g=Ot()),m=K[I]&&K[I][g]),typeof m>"u"||!m.length||!m[0]){var ut="";$=[];for(J in K[I])this.terminals_[J]&&J>xt&&$.push("'"+this.terminals_[J]+"'");f.showPosition?ut="Parse error on line "+(H+1)+`: +`+f.showPosition()+` +Expecting `+$.join(", ")+", got '"+(this.terminals_[g]||g)+"'":ut="Parse error on line "+(H+1)+": Unexpected "+(g==Tt?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(ut,{text:f.match,token:this.terminals_[g]||g,line:f.yylineno,loc:ot,expected:$})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+g);switch(m[0]){case 1:c.push(g),p.push(f.yytext),t.push(f.yylloc),c.push(m[1]),g=null,St=f.yyleng,e=f.yytext,H=f.yylineno,ot=f.yylloc;break;case 2:if(k=this.productions_[m[1]][1],v.$=p[p.length-k],v._$={first_line:t[t.length-(k||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(k||1)].first_column,last_column:t[t.length-1].last_column},Ct&&(v._$.range=[t[t.length-(k||1)].range[0],t[t.length-1].range[1]]),ht=this.performAction.apply(v,[e,St,H,x.yy,m[1],p,t].concat(It)),typeof ht<"u")return ht;k&&(c=c.slice(0,-1*k*2),p=p.slice(0,-1*k),t=t.slice(0,-1*k)),c.push(this.productions_[m[1]][0]),p.push(v.$),t.push(v._$),At=K[c[c.length-2]][c[c.length-1]],c.push(At);break;case 3:return!0}}return!0},"parse")},Rt=(function(){var R={EOF:1,parseError:u(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:u(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:u(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:u(function(n){var a=n.length,c=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===r.length?this.yylloc.first_column:0)+r[r.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(n){this.unput(this.match.slice(n))},"less"),pastInput:u(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:u(function(n,a){var c,r,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in p)this[t]=p[t];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,c,r;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),t=0;ta[0].length)){if(a=c,r=t,this.options.backtrack_lexer){if(n=this.test_match(c,p[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,p[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var a=this.next();return a||this.lex()},"lex"),begin:u(function(a){this.conditionStack.push(a)},"begin"),popState:u(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:u(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:u(function(a){this.begin(a)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(a,c,r,p){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return c.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return c.yytext[0];case 74:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74],inclusive:!0}}};return R})();ct.lexer=Rt;function q(){this.yy={}}return u(q,"Parser"),q.prototype=ct,ct.Parser=q,new q})();dt.parser=dt;var Xt=dt,w,qt=(w=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Vt,this.getAccTitle=Lt,this.setAccDescription=Mt,this.getAccDescription=Bt,this.setDiagramTitle=Ft,this.getDiagramTitle=Yt,this.getConfig=u(()=>tt().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,l=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&l&&(this.entities.get(i).alias=l,D.info(`Add alias '${l}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:l,shape:"erBox",look:tt().look??"default",cssClasses:"default",cssStyles:[]}),D.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,l){const d=this.addEntity(i);let o;for(o=l.length-1;o>=0;o--)l[o].keys||(l[o].keys=[]),l[o].comment||(l[o].comment=""),d.attributes.push(l[o]),D.debug("Added attribute ",l[o].name)}addRelationship(i,l,d,o){const h=this.entities.get(i),y=this.entities.get(d);if(!h||!y)return;const _={entityA:h.id,roleA:l,entityB:y.id,relSpec:o};this.relationships.push(_),D.debug("Added new relationship :",_)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let l=[];for(const d of i){const o=this.classes.get(d);o?.styles&&(l=[...l,...o.styles??[]].map(h=>h.trim())),o?.textStyles&&(l=[...l,...o.textStyles??[]].map(h=>h.trim()))}return l}addCssStyles(i,l){for(const d of i){const o=this.entities.get(d);if(!l||!o)return;for(const h of l)o.cssStyles.push(h)}}addClass(i,l){i.forEach(d=>{let o=this.classes.get(d);o===void 0&&(o={id:d,styles:[],textStyles:[]},this.classes.set(d,o)),l&&l.forEach(function(h){if(/color/.exec(h)){const y=h.replace("fill","bgFill");o.textStyles.push(y)}o.styles.push(h)})})}setClass(i,l){for(const d of i){const o=this.entities.get(d);if(o)for(const h of l)o.cssClasses+=" "+h}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Pt()}getData(){const i=[],l=[],d=tt();for(const h of this.entities.keys()){const y=this.entities.get(h);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),i.push(y))}let o=0;for(const h of this.relationships){const y={id:zt(h.entityA,h.entityB,{prefix:"id",counter:o++}),type:"normal",curve:"basis",start:h.entityA,end:h.entityB,label:h.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:h.relSpec.cardB.toLowerCase(),arrowTypeEnd:h.relSpec.cardA.toLowerCase(),pattern:h.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look};l.push(y)}return{nodes:i,edges:l,other:{},config:d,direction:"TB"}}},u(w,"ErDB"),w),Nt={};Kt(Nt,{draw:()=>Ht});var Ht=u(async function(s,i,l,d){D.info("REF0:"),D.info("Drawing er diagram (unified)",i);const{securityLevel:o,er:h,layout:y}=tt(),_=d.db.getData(),E=Dt(i,o);_.type=d.type,_.layoutAlgorithm=Zt(y),_.config.flowchart.nodeSpacing=h?.nodeSpacing||140,_.config.flowchart.rankSpacing=h?.rankSpacing||80,_.direction=d.db.getDirection(),_.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],_.diagramId=i,await Ut(_,E),_.layoutAlgorithm==="elk"&&E.select(".edges").lower();const V=E.selectAll('[id*="-background"]');Array.from(V).length>0&&V.each(function(){const S=jt(this),U=S.attr("id").replace("-background",""),T=E.select(`#${CSS.escape(U)}`);if(!T.empty()){const L=T.attr("transform");S.attr("transform",L)}});const Z=8;Wt.insertTitle(E,"erDiagramTitleText",h?.titleTopMargin??25,d.db.getDiagramTitle()),wt(E,Z,"erDiagram",h?.useMaxWidth??!0)},"draw"),Jt=u((s,i)=>{const l=Qt,d=l(s,"r"),o=l(s,"g"),h=l(s,"b");return Gt(d,o,h,i)},"fade"),$t=u(s=>` + .entityBox { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${s.tertiaryColor}; + opacity: 0.7; + background-color: ${s.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${Jt(s.tertiaryColor,.5)}; + } + + .edgeLabel .label { + fill: ${s.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${s.fontFamily}; + color: ${s.nodeTextColor||s.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: 1px; + } + + .relationshipLine { + stroke: ${s.lineColor}; + stroke-width: 1; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${s.lineColor} !important; + stroke-width: 1; + } +`,"getStyles"),te=$t,ne={parser:Xt,get db(){return new qt},renderer:Nt,styles:te};export{ne as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/flowDiagram-NV44I4VS-DkyMNO5I.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/flowDiagram-NV44I4VS-DkyMNO5I.js new file mode 100644 index 0000000000..494898b833 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/flowDiagram-NV44I4VS-DkyMNO5I.js @@ -0,0 +1,162 @@ +import{g as Ht}from"./chunk-FMBD7UC4-fSM8np9_.js";import{_ as m,Q as Ot,E as $,z as b1,B as E1,R as qt,S as Xt,T as it,y as Qt,v as Zt,U as Jt,x as $t,w as te,V as ee,O as se,W as ie,X as re,Y as ae,Z as st,$ as ne,a0 as ue,a1 as oe}from"./index-DpOBiJiD.js";import{g as le}from"./chunk-55IACEB6-DUaTCW0f.js";import{s as ce}from"./chunk-QN33PNHL-Cb84mGB3.js";import{c as he}from"./channel-D6izjHHp.js";var de="flowchart-",G1,pe=(G1=class{constructor(){this.vertexCounter=0,this.config=b1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qt,this.setAccDescription=Zt,this.setDiagramTitle=Jt,this.getAccTitle=$t,this.getAccDescription=te,this.getDiagramTitle=ee,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return se.sanitizeText(i,this.config)}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return r.domId;return i}addVertex(i,r,a,n,l,g,c={},b){if(!i||i.trim().length===0)return;let u;if(b!==void 0){let k;b.includes(` +`)?k=b+` +`:k=`{ +`+b+` +}`,u=ie(k,{schema:re})}const A=this.edges.find(k=>k.id===i);if(A){const k=u;k?.animate!==void 0&&(A.animate=k.animate),k?.animation!==void 0&&(A.animation=k.animation),k?.curve!==void 0&&(A.interpolate=k.curve);return}let y,f=this.vertices.get(i);if(f===void 0&&(f={id:i,labelType:"text",domId:de+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,f)),this.vertexCounter++,r!==void 0?(this.config=b1(),y=this.sanitizeText(r.text.trim()),f.labelType=r.type,y.startsWith('"')&&y.endsWith('"')&&(y=y.substring(1,y.length-1)),f.text=y):f.text===void 0&&(f.text=i),a!==void 0&&(f.type=a),n?.forEach(k=>{f.styles.push(k)}),l?.forEach(k=>{f.classes.push(k)}),g!==void 0&&(f.dir=g),f.props===void 0?f.props=c:c!==void 0&&Object.assign(f.props,c),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!ae(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u?.shape}u?.label&&(f.text=u?.label),u?.icon&&(f.icon=u?.icon,!u.label?.trim()&&f.text===i&&(f.text="")),u?.form&&(f.form=u?.form),u?.pos&&(f.pos=u?.pos),u?.img&&(f.img=u?.img,!u.label?.trim()&&f.text===i&&(f.text="")),u?.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(i,r,a,n){const c={start:i,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};$.info("abc78 Got edge...",c);const b=a.text;if(b!==void 0&&(c.text=this.sanitizeText(b.text.trim()),c.text.startsWith('"')&&c.text.endsWith('"')&&(c.text=c.text.substring(1,c.text.length-1)),c.labelType=b.type),a!==void 0&&(c.type=a.type,c.stroke=a.stroke,c.length=a.length>10?10:a.length),n&&!this.edges.some(u=>u.id===n))c.id=n,c.isUserDefinedId=!0;else{const u=this.edges.filter(A=>A.start===c.start&&A.end===c.end);u.length===0?c.id=st(c.start,c.end,{counter:0,prefix:"L"}):c.id=st(c.start,c.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))$.info("Pushing edge..."),this.edges.push(c);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,r,a){const n=this.isLinkData(a)?a.id.replace("@",""):void 0;$.info("addLink",i,r,n);for(const l of i)for(const g of r){const c=l===i[i.length-1],b=g===r[0];c&&b?this.addSingleLink(l,g,a,n):this.addSingleLink(l,g,a,void 0)}}updateLinkInterpolate(i,r){i.forEach(a=>{a==="default"?this.edges.defaultInterpolate=r:this.edges[a].interpolate=r})}updateLink(i,r){i.forEach(a=>{if(typeof a=="number"&&a>=this.edges.length)throw new Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);a==="default"?this.edges.defaultStyle=r:(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[a]?.style?.push("fill:none"))})}addClass(i,r){const a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(n=>{let l=this.classes.get(n);l===void 0&&(l={id:n,styles:[],textStyles:[]},this.classes.set(n,l)),a?.forEach(g=>{if(/color/.exec(g)){const c=g.replace("fill","bgFill");l.textStyles.push(c)}l.styles.push(g)})})}setDirection(i){this.direction=i.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,r){for(const a of i.split(",")){const n=this.vertices.get(a);n&&n.classes.push(r);const l=this.edges.find(c=>c.id===a);l&&l.classes.push(r);const g=this.subGraphLookup.get(a);g&&g.classes.push(r)}}setTooltip(i,r){if(r!==void 0){r=this.sanitizeText(r);for(const a of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}}setClickFun(i,r,a){const n=this.lookUpDomId(i);if(b1().securityLevel!=="loose"||r===void 0)return;let l=[];if(typeof a=="string"){l=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let c=0;c{const c=document.querySelector(`[id="${n}"]`);c!==null&&c.addEventListener("click",()=>{it.runFunc(r,...l)},!1)}))}setLink(i,r,a){i.split(",").forEach(n=>{const l=this.vertices.get(n);l!==void 0&&(l.link=it.formatUrl(r,this.config),l.linkTarget=a)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,r,a){i.split(",").forEach(n=>{this.setClickFun(n,r,a)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(r=>{r(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(i){let r=E1(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=E1("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),E1(i).select("svg").selectAll("g.node").on("mouseover",l=>{const g=E1(l.currentTarget);if(g.attr("title")===null)return;const b=l.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(g.attr("title")).style("left",window.scrollX+b.left+(b.right-b.left)/2+"px").style("top",window.scrollY+b.bottom+"px"),r.html(r.html().replace(/<br\/>/g,"
")),g.classed("hover",!0)}).on("mouseout",l=>{r.transition().duration(500).style("opacity",0),E1(l.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=b1(),ne()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,r,a){let n=i.text.trim(),l=a.text;i===a&&/\s/.exec(a.text)&&(n=void 0);const c=m(f=>{const k={boolean:{},number:{},string:{}},x=[];let T;return{nodeList:f.filter(function(W){const Z=typeof W;return W.stmt&&W.stmt==="dir"?(T=W.value,!1):W.trim()===""?!1:Z in k?k[Z].hasOwnProperty(W)?!1:k[Z][W]=!0:x.includes(W)?!1:x.push(W)}),dir:T}},"uniq")(r.flat()),b=c.nodeList;let u=c.dir;const A=b1().flowchart??{};if(u=u??(A.inheritDir?this.getDirection()??b1().direction??void 0:void 0),this.version==="gen-1")for(let f=0;f2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===i)return{result:!0,count:0};let n=0,l=1;for(;n=0){const c=this.indexNodes2(i,g);if(c.result)return{result:!0,count:l+c.count};l=l+c.count}n=n+1}return{result:!1,count:l}}getDepthFirstPos(i){return this.posCrossRef[i]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(i){let r=i.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";return r.includes("=")&&(n="thick"),r.includes(".")&&(n="dotted"),{type:a,stroke:n}}countChar(i,r){const a=r.length;let n=0;for(let l=0;l":n="arrow_point",r.startsWith("<")&&(n="double_"+n,a=a.slice(1));break;case"o":n="arrow_circle",r.startsWith("o")&&(n="double_"+n,a=a.slice(1));break}let l="normal",g=a.length-1;a.startsWith("=")&&(l="thick"),a.startsWith("~")&&(l="invisible");const c=this.countChar(".",a);return c&&(l="dotted",g=c),{type:n,stroke:l,length:g}}destructLink(i,r){const a=this.destructEndLink(i);let n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return n.type==="double_arrow"&&(n.type="double_arrow_point"),n.length=a.length,n}return a}exists(i,r){for(const a of i)if(a.nodes.includes(r))return!0;return!1}makeUniq(i,r){const a=[];return i.nodes.forEach((n,l)=>{this.exists(r,n)||a.push(i.nodes[l])}),{nodes:a}}getTypeFromVertex(i){if(i.img)return"imageSquare";if(i.icon)return i.form==="circle"?"iconCircle":i.form==="square"?"iconSquare":i.form==="rounded"?"iconRounded":"icon";switch(i.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return i.type}}findNode(i,r){return i.find(a=>a.id===r)}destructEdgeType(i){let r="none",a="arrow_point";switch(i){case"arrow_point":case"arrow_circle":case"arrow_cross":a=i;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=i.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(i,r,a,n,l,g){const c=a.get(i.id),b=n.get(i.id)??!1,u=this.findNode(r,i.id);if(u)u.cssStyles=i.styles,u.cssCompiledStyles=this.getCompiledStyles(i.classes),u.cssClasses=i.classes.join(" ");else{const A={id:i.id,label:i.text,labelStyle:"",parentId:c,padding:l.flowchart?.padding||8,cssStyles:i.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...i.classes]),cssClasses:"default "+i.classes.join(" "),dir:i.dir,domId:i.domId,look:g,link:i.link,linkTarget:i.linkTarget,tooltip:this.getTooltip(i.id),icon:i.icon,pos:i.pos,img:i.img,assetWidth:i.assetWidth,assetHeight:i.assetHeight,constraint:i.constraint};b?r.push({...A,isGroup:!0,shape:"rect"}):r.push({...A,isGroup:!1,shape:this.getTypeFromVertex(i)})}}getCompiledStyles(i){let r=[];for(const a of i){const n=this.classes.get(a);n?.styles&&(r=[...r,...n.styles??[]].map(l=>l.trim())),n?.textStyles&&(r=[...r,...n.textStyles??[]].map(l=>l.trim()))}return r}getData(){const i=b1(),r=[],a=[],n=this.getSubGraphs(),l=new Map,g=new Map;for(let u=n.length-1;u>=0;u--){const A=n[u];A.nodes.length>0&&g.set(A.id,!0);for(const y of A.nodes)l.set(y,A.id)}for(let u=n.length-1;u>=0;u--){const A=n[u];r.push({id:A.id,label:A.title,labelStyle:"",parentId:l.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:i.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,l,g,i,i.look||"classic")});const b=this.getEdges();return b.forEach((u,A)=>{const{arrowTypeStart:y,arrowTypeEnd:f}=this.destructEdgeType(u.type),k=[...b.defaultStyle??[]];u.style&&k.push(...u.style);const x={id:st(u.start,u.end,{counter:A,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:u?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":y,arrowTypeEnd:u?.stroke==="invisible"||u?.type==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:k,style:k,pattern:u.stroke,look:i.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||i.flowchart?.curve};a.push(x)}),{nodes:r,edges:a,other:{},config:i}}defaultConfig(){return ue.flowchart}},m(G1,"FlowDB"),G1),fe=m(function(s,i){return i.db.getClasses()},"getClasses"),ge=m(async function(s,i,r,a){$.info("REF0:"),$.info("Drawing state diagram (v2)",i);const{securityLevel:n,flowchart:l,layout:g}=b1();let c;n==="sandbox"&&(c=E1("#i"+i));const b=n==="sandbox"?c.nodes()[0].contentDocument:document;$.debug("Before getData: ");const u=a.db.getData();$.debug("Data: ",u);const A=le(i,n),y=a.db.getDirection();u.type=a.type,u.layoutAlgorithm=qt(g),u.layoutAlgorithm==="dagre"&&g==="elk"&&$.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),u.direction=y,u.nodeSpacing=l?.nodeSpacing||50,u.rankSpacing=l?.rankSpacing||50,u.markers=["point","circle","cross"],u.diagramId=i,$.debug("REF1:",u),await Xt(u,A);const f=u.config.flowchart?.diagramPadding??8;it.insertTitle(A,"flowchartTitleText",l?.titleTopMargin||0,a.db.getDiagramTitle()),ce(A,f,"flowchart",l?.useMaxWidth||!1);for(const k of u.nodes){const x=E1(`#${i} [id="${k.id}"]`);if(!x||!k.link)continue;const T=b.createElementNS("http://www.w3.org/2000/svg","a");T.setAttributeNS("http://www.w3.org/2000/svg","class",k.cssClasses),T.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),n==="sandbox"?T.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):k.linkTarget&&T.setAttributeNS("http://www.w3.org/2000/svg","target",k.linkTarget);const d1=x.insert(function(){return T},":first-child"),W=x.select(".label-container");W&&d1.append(function(){return W.node()});const Z=x.select(".label");Z&&d1.append(function(){return Z.node()})}},"draw"),be={getClasses:fe,draw:ge},rt=(function(){var s=m(function(g1,h,d,p){for(d=d||{},p=g1.length;p--;d[g1[p]]=h);return d},"o"),i=[1,4],r=[1,3],a=[1,5],n=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],l=[2,2],g=[1,13],c=[1,14],b=[1,15],u=[1,16],A=[1,23],y=[1,25],f=[1,26],k=[1,27],x=[1,49],T=[1,48],d1=[1,29],W=[1,30],Z=[1,31],O1=[1,32],M1=[1,33],L=[1,44],w=[1,46],I=[1,42],R=[1,47],N=[1,43],G=[1,50],P=[1,45],O=[1,51],M=[1,52],U1=[1,34],W1=[1,35],z1=[1,36],j1=[1,37],p1=[1,57],F=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],t1=[1,61],e1=[1,60],s1=[1,62],C1=[8,9,11,75,77,78],at=[1,78],S1=[1,91],D1=[1,96],x1=[1,95],T1=[1,92],y1=[1,88],F1=[1,94],_1=[1,90],B1=[1,97],v1=[1,93],V1=[1,98],L1=[1,89],A1=[8,9,10,11,40,75,77,78],z=[8,9,10,11,40,46,75,77,78],H=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],nt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],w1=[44,60,89,102,105,106,109,111,114,115,116],ut=[1,121],ot=[1,122],K1=[1,124],Y1=[1,123],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,133],ht=[1,147],dt=[1,148],pt=[1,149],ft=[1,150],gt=[1,135],bt=[1,137],At=[1,141],kt=[1,142],mt=[1,143],Et=[1,144],Ct=[1,145],St=[1,146],Dt=[1,151],xt=[1,152],Tt=[1,131],yt=[1,132],Ft=[1,139],_t=[1,134],Bt=[1,138],vt=[1,136],Q1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],Vt=[1,154],Lt=[1,156],v=[8,9,11],q=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],E=[1,176],j=[1,172],K=[1,173],C=[1,177],S=[1,174],D=[1,175],I1=[77,116,119],_=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],wt=[10,106],f1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],i1=[1,247],r1=[1,245],a1=[1,249],n1=[1,243],u1=[1,244],o1=[1,246],l1=[1,248],c1=[1,250],R1=[1,268],It=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Z1={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:m(function(h,d,p,o,B,t,P1){var e=t.length-1;switch(B){case 2:this.$=[];break;case 3:(!Array.isArray(t[e])||t[e].length>0)&&t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 183:this.$=t[e];break;case 11:o.setDirection("TB"),this.$="TB";break;case 12:o.setDirection(t[e-1]),this.$=t[e-1];break;case 27:this.$=t[e-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=o.addSubGraph(t[e-6],t[e-1],t[e-4]);break;case 34:this.$=o.addSubGraph(t[e-3],t[e-1],t[e-3]);break;case 35:this.$=o.addSubGraph(void 0,t[e-1],void 0);break;case 37:this.$=t[e].trim(),o.setAccTitle(this.$);break;case 38:case 39:this.$=t[e].trim(),o.setAccDescription(this.$);break;case 43:this.$=t[e-1]+t[e];break;case 44:this.$=t[e];break;case 45:o.addVertex(t[e-1][t[e-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[e]),o.addLink(t[e-3].stmt,t[e-1],t[e-2]),this.$={stmt:t[e-1],nodes:t[e-1].concat(t[e-3].nodes)};break;case 46:o.addLink(t[e-2].stmt,t[e],t[e-1]),this.$={stmt:t[e],nodes:t[e].concat(t[e-2].nodes)};break;case 47:o.addLink(t[e-3].stmt,t[e-1],t[e-2]),this.$={stmt:t[e-1],nodes:t[e-1].concat(t[e-3].nodes)};break;case 48:this.$={stmt:t[e-1],nodes:t[e-1]};break;case 49:o.addVertex(t[e-1][t[e-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[e]),this.$={stmt:t[e-1],nodes:t[e-1],shapeData:t[e]};break;case 50:this.$={stmt:t[e],nodes:t[e]};break;case 51:this.$=[t[e]];break;case 52:o.addVertex(t[e-5][t[e-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[e-4]),this.$=t[e-5].concat(t[e]);break;case 53:this.$=t[e-4].concat(t[e]);break;case 54:this.$=t[e];break;case 55:this.$=t[e-2],o.setClass(t[e-2],t[e]);break;case 56:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"square");break;case 57:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"doublecircle");break;case 58:this.$=t[e-5],o.addVertex(t[e-5],t[e-2],"circle");break;case 59:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"ellipse");break;case 60:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"stadium");break;case 61:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"subroutine");break;case 62:this.$=t[e-7],o.addVertex(t[e-7],t[e-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[e-5],t[e-3]]]));break;case 63:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"cylinder");break;case 64:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"round");break;case 65:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"diamond");break;case 66:this.$=t[e-5],o.addVertex(t[e-5],t[e-2],"hexagon");break;case 67:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"odd");break;case 68:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"trapezoid");break;case 69:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"inv_trapezoid");break;case 70:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"lean_right");break;case 71:this.$=t[e-3],o.addVertex(t[e-3],t[e-1],"lean_left");break;case 72:this.$=t[e],o.addVertex(t[e]);break;case 73:t[e-1].text=t[e],this.$=t[e-1];break;case 74:case 75:t[e-2].text=t[e-1],this.$=t[e-2];break;case 76:this.$=t[e];break;case 77:var V=o.destructLink(t[e],t[e-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[e-1]};break;case 78:var V=o.destructLink(t[e],t[e-2]);this.$={type:V.type,stroke:V.stroke,length:V.length,text:t[e-1],id:t[e-3]};break;case 79:this.$={text:t[e],type:"text"};break;case 80:this.$={text:t[e-1].text+""+t[e],type:t[e-1].type};break;case 81:this.$={text:t[e],type:"string"};break;case 82:this.$={text:t[e],type:"markdown"};break;case 83:var V=o.destructLink(t[e]);this.$={type:V.type,stroke:V.stroke,length:V.length};break;case 84:var V=o.destructLink(t[e]);this.$={type:V.type,stroke:V.stroke,length:V.length,id:t[e-1]};break;case 85:this.$=t[e-1];break;case 86:this.$={text:t[e],type:"text"};break;case 87:this.$={text:t[e-1].text+""+t[e],type:t[e-1].type};break;case 88:this.$={text:t[e],type:"string"};break;case 89:case 104:this.$={text:t[e],type:"markdown"};break;case 101:this.$={text:t[e],type:"text"};break;case 102:this.$={text:t[e-1].text+""+t[e],type:t[e-1].type};break;case 103:this.$={text:t[e],type:"text"};break;case 105:this.$=t[e-4],o.addClass(t[e-2],t[e]);break;case 106:this.$=t[e-4],o.setClass(t[e-2],t[e]);break;case 107:case 115:this.$=t[e-1],o.setClickEvent(t[e-1],t[e]);break;case 108:case 116:this.$=t[e-3],o.setClickEvent(t[e-3],t[e-2]),o.setTooltip(t[e-3],t[e]);break;case 109:this.$=t[e-2],o.setClickEvent(t[e-2],t[e-1],t[e]);break;case 110:this.$=t[e-4],o.setClickEvent(t[e-4],t[e-3],t[e-2]),o.setTooltip(t[e-4],t[e]);break;case 111:this.$=t[e-2],o.setLink(t[e-2],t[e]);break;case 112:this.$=t[e-4],o.setLink(t[e-4],t[e-2]),o.setTooltip(t[e-4],t[e]);break;case 113:this.$=t[e-4],o.setLink(t[e-4],t[e-2],t[e]);break;case 114:this.$=t[e-6],o.setLink(t[e-6],t[e-4],t[e]),o.setTooltip(t[e-6],t[e-2]);break;case 117:this.$=t[e-1],o.setLink(t[e-1],t[e]);break;case 118:this.$=t[e-3],o.setLink(t[e-3],t[e-2]),o.setTooltip(t[e-3],t[e]);break;case 119:this.$=t[e-3],o.setLink(t[e-3],t[e-2],t[e]);break;case 120:this.$=t[e-5],o.setLink(t[e-5],t[e-4],t[e]),o.setTooltip(t[e-5],t[e-2]);break;case 121:this.$=t[e-4],o.addVertex(t[e-2],void 0,void 0,t[e]);break;case 122:this.$=t[e-4],o.updateLink([t[e-2]],t[e]);break;case 123:this.$=t[e-4],o.updateLink(t[e-2],t[e]);break;case 124:this.$=t[e-8],o.updateLinkInterpolate([t[e-6]],t[e-2]),o.updateLink([t[e-6]],t[e]);break;case 125:this.$=t[e-8],o.updateLinkInterpolate(t[e-6],t[e-2]),o.updateLink(t[e-6],t[e]);break;case 126:this.$=t[e-6],o.updateLinkInterpolate([t[e-4]],t[e]);break;case 127:this.$=t[e-6],o.updateLinkInterpolate(t[e-4],t[e]);break;case 128:case 130:this.$=[t[e]];break;case 129:case 131:t[e-2].push(t[e]),this.$=t[e-2];break;case 133:this.$=t[e-1]+t[e];break;case 181:this.$=t[e];break;case 182:this.$=t[e-1]+""+t[e];break;case 184:this.$=t[e-1]+""+t[e];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},s(n,l,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:g,9:c,10:b,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,33:24,34:y,36:f,38:k,42:28,43:38,44:x,45:39,47:40,60:T,84:d1,85:W,86:Z,87:O1,88:M1,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M,121:U1,122:W1,123:z1,124:j1},s(n,[2,9]),s(n,[2,10]),s(n,[2,11]),{8:[1,54],9:[1,55],10:p1,15:53,18:56},s(F,[2,3]),s(F,[2,4]),s(F,[2,5]),s(F,[2,6]),s(F,[2,7]),s(F,[2,8]),{8:t1,9:e1,11:s1,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:t1,9:e1,11:s1,21:67},{8:t1,9:e1,11:s1,21:68},{8:t1,9:e1,11:s1,21:69},{8:t1,9:e1,11:s1,21:70},{8:t1,9:e1,11:s1,21:71},{8:t1,9:e1,10:[1,72],11:s1,21:73},s(F,[2,36]),{35:[1,74]},{37:[1,75]},s(F,[2,39]),s(C1,[2,50],{18:76,39:77,10:p1,40:at}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:S1,44:D1,60:x1,80:[1,86],89:T1,95:[1,83],97:[1,84],101:85,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1,120:87},s(F,[2,185]),s(F,[2,186]),s(F,[2,187]),s(F,[2,188]),s(A1,[2,51]),s(A1,[2,54],{46:[1,99]}),s(z,[2,72],{113:112,29:[1,100],44:x,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:T,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:L,102:w,105:I,106:R,109:N,111:G,114:P,115:O,116:M}),s(H,[2,181]),s(H,[2,142]),s(H,[2,143]),s(H,[2,144]),s(H,[2,145]),s(H,[2,146]),s(H,[2,147]),s(H,[2,148]),s(H,[2,149]),s(H,[2,150]),s(H,[2,151]),s(H,[2,152]),s(n,[2,12]),s(n,[2,18]),s(n,[2,19]),{9:[1,113]},s(nt,[2,26],{18:114,10:p1}),s(F,[2,27]),{42:115,43:38,44:x,45:39,47:40,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},s(F,[2,40]),s(F,[2,41]),s(F,[2,42]),s(w1,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:ut,81:ot,116:K1,119:Y1},{75:[1,125],77:[1,126]},s(lt,[2,83]),s(F,[2,28]),s(F,[2,29]),s(F,[2,30]),s(F,[2,31]),s(F,[2,32]),{10:ct,12:ht,14:dt,27:pt,28:127,32:ft,44:gt,60:bt,75:At,80:[1,129],81:[1,130],83:140,84:kt,85:mt,86:Et,87:Ct,88:St,89:Dt,90:xt,91:128,105:Tt,109:yt,111:Ft,114:_t,115:Bt,116:vt},s(Q1,l,{5:153}),s(F,[2,37]),s(F,[2,38]),s(C1,[2,48],{44:Vt}),s(C1,[2,49],{18:155,10:p1,40:Lt}),s(A1,[2,44]),{44:x,47:157,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},{102:[1,158],103:159,105:[1,160]},{44:x,47:161,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},{44:x,47:162,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},s(v,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},s(v,[2,115],{120:167,10:[1,166],14:S1,44:D1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1}),s(v,[2,117],{10:[1,168]}),s(q,[2,183]),s(q,[2,170]),s(q,[2,171]),s(q,[2,172]),s(q,[2,173]),s(q,[2,174]),s(q,[2,175]),s(q,[2,176]),s(q,[2,177]),s(q,[2,178]),s(q,[2,179]),s(q,[2,180]),{44:x,47:169,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},{30:170,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:178,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:180,50:[1,179],67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:181,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:182,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:183,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{109:[1,184]},{30:185,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:186,65:[1,187],67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:188,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:189,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{30:190,67:E,80:j,81:K,82:171,116:C,117:S,118:D},s(H,[2,182]),s(n,[2,20]),s(nt,[2,25]),s(C1,[2,46],{39:191,18:192,10:p1,40:at}),s(w1,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{77:[1,196],79:197,116:K1,119:Y1},s(I1,[2,79]),s(I1,[2,81]),s(I1,[2,82]),s(I1,[2,168]),s(I1,[2,169]),{76:198,79:120,80:ut,81:ot,116:K1,119:Y1},s(lt,[2,84]),{8:t1,9:e1,10:ct,11:s1,12:ht,14:dt,21:200,27:pt,29:[1,199],32:ft,44:gt,60:bt,75:At,83:140,84:kt,85:mt,86:Et,87:Ct,88:St,89:Dt,90:xt,91:201,105:Tt,109:yt,111:Ft,114:_t,115:Bt,116:vt},s(_,[2,101]),s(_,[2,103]),s(_,[2,104]),s(_,[2,157]),s(_,[2,158]),s(_,[2,159]),s(_,[2,160]),s(_,[2,161]),s(_,[2,162]),s(_,[2,163]),s(_,[2,164]),s(_,[2,165]),s(_,[2,166]),s(_,[2,167]),s(_,[2,90]),s(_,[2,91]),s(_,[2,92]),s(_,[2,93]),s(_,[2,94]),s(_,[2,95]),s(_,[2,96]),s(_,[2,97]),s(_,[2,98]),s(_,[2,99]),s(_,[2,100]),{6:11,7:12,8:g,9:c,10:b,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,202],33:24,34:y,36:f,38:k,42:28,43:38,44:x,45:39,47:40,60:T,84:d1,85:W,86:Z,87:O1,88:M1,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M,121:U1,122:W1,123:z1,124:j1},{10:p1,18:203},{44:[1,204]},s(A1,[2,43]),{10:[1,205],44:x,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:112,114:P,115:O,116:M},{10:[1,206]},{10:[1,207],106:[1,208]},s(wt,[2,128]),{10:[1,209],44:x,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:112,114:P,115:O,116:M},{10:[1,210],44:x,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:112,114:P,115:O,116:M},{80:[1,211]},s(v,[2,109],{10:[1,212]}),s(v,[2,111],{10:[1,213]}),{80:[1,214]},s(q,[2,184]),{80:[1,215],98:[1,216]},s(A1,[2,55],{113:112,44:x,60:T,89:L,102:w,105:I,106:R,109:N,111:G,114:P,115:O,116:M}),{31:[1,217],67:E,82:218,116:C,117:S,118:D},s(f1,[2,86]),s(f1,[2,88]),s(f1,[2,89]),s(f1,[2,153]),s(f1,[2,154]),s(f1,[2,155]),s(f1,[2,156]),{49:[1,219],67:E,82:218,116:C,117:S,118:D},{30:220,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{51:[1,221],67:E,82:218,116:C,117:S,118:D},{53:[1,222],67:E,82:218,116:C,117:S,118:D},{55:[1,223],67:E,82:218,116:C,117:S,118:D},{57:[1,224],67:E,82:218,116:C,117:S,118:D},{60:[1,225]},{64:[1,226],67:E,82:218,116:C,117:S,118:D},{66:[1,227],67:E,82:218,116:C,117:S,118:D},{30:228,67:E,80:j,81:K,82:171,116:C,117:S,118:D},{31:[1,229],67:E,82:218,116:C,117:S,118:D},{67:E,69:[1,230],71:[1,231],82:218,116:C,117:S,118:D},{67:E,69:[1,233],71:[1,232],82:218,116:C,117:S,118:D},s(C1,[2,45],{18:155,10:p1,40:Lt}),s(C1,[2,47],{44:Vt}),s(w1,[2,75]),s(w1,[2,74]),{62:[1,234],67:E,82:218,116:C,117:S,118:D},s(w1,[2,77]),s(I1,[2,80]),{77:[1,235],79:197,116:K1,119:Y1},{30:236,67:E,80:j,81:K,82:171,116:C,117:S,118:D},s(Q1,l,{5:237}),s(_,[2,102]),s(F,[2,35]),{43:238,44:x,45:39,47:40,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},{10:p1,18:239},{10:i1,60:r1,84:a1,92:240,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:251,104:[1,252],105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:253,104:[1,254],105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{105:[1,255]},{10:i1,60:r1,84:a1,92:256,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{44:x,47:257,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},s(v,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},s(v,[2,116]),s(v,[2,118],{10:[1,261]}),s(v,[2,119]),s(z,[2,56]),s(f1,[2,87]),s(z,[2,57]),{51:[1,262],67:E,82:218,116:C,117:S,118:D},s(z,[2,64]),s(z,[2,59]),s(z,[2,60]),s(z,[2,61]),{109:[1,263]},s(z,[2,63]),s(z,[2,65]),{66:[1,264],67:E,82:218,116:C,117:S,118:D},s(z,[2,67]),s(z,[2,68]),s(z,[2,70]),s(z,[2,69]),s(z,[2,71]),s([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),s(w1,[2,78]),{31:[1,265],67:E,82:218,116:C,117:S,118:D},{6:11,7:12,8:g,9:c,10:b,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,266],33:24,34:y,36:f,38:k,42:28,43:38,44:x,45:39,47:40,60:T,84:d1,85:W,86:Z,87:O1,88:M1,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M,121:U1,122:W1,123:z1,124:j1},s(A1,[2,53]),{43:267,44:x,45:39,47:40,60:T,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M},s(v,[2,121],{106:R1}),s(It,[2,130],{108:269,10:i1,60:r1,84:a1,105:n1,109:u1,110:o1,111:l1,112:c1}),s(J,[2,132]),s(J,[2,134]),s(J,[2,135]),s(J,[2,136]),s(J,[2,137]),s(J,[2,138]),s(J,[2,139]),s(J,[2,140]),s(J,[2,141]),s(v,[2,122],{106:R1}),{10:[1,270]},s(v,[2,123],{106:R1}),{10:[1,271]},s(wt,[2,129]),s(v,[2,105],{106:R1}),s(v,[2,106],{113:112,44:x,60:T,89:L,102:w,105:I,106:R,109:N,111:G,114:P,115:O,116:M}),s(v,[2,110]),s(v,[2,112],{10:[1,272]}),s(v,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:t1,9:e1,11:s1,21:277},s(F,[2,34]),s(A1,[2,52]),{10:i1,60:r1,84:a1,105:n1,107:278,108:242,109:u1,110:o1,111:l1,112:c1},s(J,[2,133]),{14:S1,44:D1,60:x1,89:T1,101:279,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1,120:87},{14:S1,44:D1,60:x1,89:T1,101:280,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1,120:87},{98:[1,281]},s(v,[2,120]),s(z,[2,58]),{30:282,67:E,80:j,81:K,82:171,116:C,117:S,118:D},s(z,[2,66]),s(Q1,l,{5:283}),s(It,[2,131],{108:269,10:i1,60:r1,84:a1,105:n1,109:u1,110:o1,111:l1,112:c1}),s(v,[2,126],{120:167,10:[1,284],14:S1,44:D1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1}),s(v,[2,127],{120:167,10:[1,285],14:S1,44:D1,60:x1,89:T1,105:y1,106:F1,109:_1,111:B1,114:v1,115:V1,116:L1}),s(v,[2,114]),{31:[1,286],67:E,82:218,116:C,117:S,118:D},{6:11,7:12,8:g,9:c,10:b,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:A,32:[1,287],33:24,34:y,36:f,38:k,42:28,43:38,44:x,45:39,47:40,60:T,84:d1,85:W,86:Z,87:O1,88:M1,89:L,102:w,105:I,106:R,109:N,111:G,113:41,114:P,115:O,116:M,121:U1,122:W1,123:z1,124:j1},{10:i1,60:r1,84:a1,92:288,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},{10:i1,60:r1,84:a1,92:289,105:n1,107:241,108:242,109:u1,110:o1,111:l1,112:c1},s(z,[2,62]),s(F,[2,33]),s(v,[2,124],{106:R1}),s(v,[2,125],{106:R1})],defaultActions:{},parseError:m(function(h,d){if(d.recoverable)this.trace(h);else{var p=new Error(h);throw p.hash=d,p}},"parseError"),parse:m(function(h){var d=this,p=[0],o=[],B=[null],t=[],P1=this.table,e="",V=0,Rt=0,zt=2,Nt=1,jt=t.slice.call(arguments,1),U=Object.create(this.lexer),k1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(k1.yy[J1]=this.yy[J1]);U.setInput(h,k1.yy),k1.yy.lexer=U,k1.yy.parser=this,typeof U.yylloc>"u"&&(U.yylloc={});var $1=U.yylloc;t.push($1);var Kt=U.options&&U.options.ranges;typeof k1.yy.parseError=="function"?this.parseError=k1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Yt(X){p.length=p.length-2*X,B.length=B.length-X,t.length=t.length-X}m(Yt,"popStack");function Gt(){var X;return X=o.pop()||U.lex()||Nt,typeof X!="number"&&(X instanceof Array&&(o=X,X=o.pop()),X=d.symbols_[X]||X),X}m(Gt,"lex");for(var Y,m1,Q,tt,N1={},q1,h1,Pt,X1;;){if(m1=p[p.length-1],this.defaultActions[m1]?Q=this.defaultActions[m1]:((Y===null||typeof Y>"u")&&(Y=Gt()),Q=P1[m1]&&P1[m1][Y]),typeof Q>"u"||!Q.length||!Q[0]){var et="";X1=[];for(q1 in P1[m1])this.terminals_[q1]&&q1>zt&&X1.push("'"+this.terminals_[q1]+"'");U.showPosition?et="Parse error on line "+(V+1)+`: +`+U.showPosition()+` +Expecting `+X1.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":et="Parse error on line "+(V+1)+": Unexpected "+(Y==Nt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(et,{text:U.match,token:this.terminals_[Y]||Y,line:U.yylineno,loc:$1,expected:X1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m1+", token: "+Y);switch(Q[0]){case 1:p.push(Y),B.push(U.yytext),t.push(U.yylloc),p.push(Q[1]),Y=null,Rt=U.yyleng,e=U.yytext,V=U.yylineno,$1=U.yylloc;break;case 2:if(h1=this.productions_[Q[1]][1],N1.$=B[B.length-h1],N1._$={first_line:t[t.length-(h1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(h1||1)].first_column,last_column:t[t.length-1].last_column},Kt&&(N1._$.range=[t[t.length-(h1||1)].range[0],t[t.length-1].range[1]]),tt=this.performAction.apply(N1,[e,Rt,V,k1.yy,Q[1],B,t].concat(jt)),typeof tt<"u")return tt;h1&&(p=p.slice(0,-1*h1*2),B=B.slice(0,-1*h1),t=t.slice(0,-1*h1)),p.push(this.productions_[Q[1]][0]),B.push(N1.$),t.push(N1._$),Pt=P1[p[p.length-2]][p[p.length-1]],p.push(Pt);break;case 3:return!0}}return!0},"parse")},Wt=(function(){var g1={EOF:1,parseError:m(function(d,p){if(this.yy.parser)this.yy.parser.parseError(d,p);else throw new Error(d)},"parseError"),setInput:m(function(h,d){return this.yy=d||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:m(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var d=h.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:m(function(h){var d=h.length,p=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===o.length?this.yylloc.first_column:0)+o[o.length-p.length].length-p[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:m(function(h){this.unput(this.match.slice(h))},"less"),pastInput:m(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var h=this.pastInput(),d=new Array(h.length+1).join("-");return h+this.upcomingInput()+` +`+d+"^"},"showPosition"),test_match:m(function(h,d){var p,o,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),o=h[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],p=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in B)this[t]=B[t];return!1}return!1},"test_match"),next:m(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,d,p,o;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),t=0;td[0].length)){if(d=p,o=t,this.options.backtrack_lexer){if(h=this.test_match(p,B[t]),h!==!1)return h;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(h=this.test_match(d,B[o]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:m(function(){var d=this.next();return d||this.lex()},"lex"),begin:m(function(d){this.conditionStack.push(d)},"begin"),popState:m(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:m(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:m(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:m(function(d){this.begin(d)},"pushState"),stateStackSize:m(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:m(function(d,p,o,B){switch(o){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return d.lex.firstGraph()&&this.begin("dir"),12;case 36:return d.lex.firstGraph()&&this.begin("dir"),12;case 37:return d.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:return 119;case 71:return this.popState(),77;case 72:return this.pushState("thickEdgeText"),75;case 73:return 119;case 74:return this.popState(),77;case 75:return this.pushState("dottedEdgeText"),75;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;case 79:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 101:return 115;case 102:return 111;case 103:return 44;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return g1})();Z1.lexer=Wt;function H1(){this.yy={}}return m(H1,"Parser"),H1.prototype=Z1,Z1.Parser=H1,new H1})();rt.parser=rt;var Mt=rt,Ut=Object.assign({},Mt);Ut.parse=s=>{const i=s.replace(/}\s*\n/g,`} +`);return Mt.parse(i)};var Ae=Ut,ke=m((s,i)=>{const r=he,a=r(s,"r"),n=r(s,"g"),l=r(s,"b");return oe(a,n,l,i)},"fade"),me=m(s=>`.label { + font-family: ${s.fontFamily}; + color: ${s.nodeTextColor||s.textColor}; + } + .cluster-label text { + fill: ${s.titleColor}; + } + .cluster-label span { + color: ${s.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${s.nodeTextColor||s.textColor}; + color: ${s.nodeTextColor||s.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${s.mainBkg}; + stroke: ${s.nodeBorder}; + stroke-width: 1px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${s.lineColor} !important; + stroke-width: 0; + stroke: ${s.lineColor}; + } + + .arrowheadPath { + fill: ${s.arrowheadColor}; + } + + .edgePath .path { + stroke: ${s.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${s.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${s.edgeLabelBackground}; + p { + background-color: ${s.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${s.edgeLabelBackground}; + fill: ${s.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${ke(s.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${s.clusterBkg}; + stroke: ${s.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${s.titleColor}; + } + + .cluster span { + color: ${s.titleColor}; + } + /* .cluster div { + color: ${s.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${s.fontFamily}; + font-size: 12px; + background: ${s.tertiaryColor}; + border: 1px solid ${s.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${s.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${s.edgeLabelBackground}; + p { + background-color: ${s.edgeLabelBackground}; + padding: 2px; + } + rect { + opacity: 0.5; + background-color: ${s.edgeLabelBackground}; + fill: ${s.edgeLabelBackground}; + } + text-align: center; + } + ${Ht()} +`,"getStyles"),Ee=me,ye={parser:Ae,get db(){return new pe},renderer:be,styles:Ee,init:m(s=>{s.flowchart||(s.flowchart={}),s.layout&&Ot({layout:s.layout}),s.flowchart.arrowMarkerAbsolute=s.arrowMarkerAbsolute,Ot({flowchart:{arrowMarkerAbsolute:s.arrowMarkerAbsolute}})},"init")};export{ye as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/forEach-CTOHlvm6.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/forEach-CTOHlvm6.js new file mode 100644 index 0000000000..7cfb0686d2 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/forEach-CTOHlvm6.js @@ -0,0 +1 @@ +import{c_ as In,c$ as w,bN as vn,d0 as Z,bF as h,d1 as Ln,d2 as Rn,bO as an,d3 as _,d4 as D,d5 as $,d6 as xn,bG as S,bH as Mn,d7 as Cn,d8 as x,bM as N,d9 as Fn,da as sn,db as mn,cY as un,dc as R,bQ as gn,dd as Dn,de as Gn,df as Nn,bS as Bn,dg as on,dh as Un,bR as Kn,cW as Hn,bP as ln,di as C}from"./index-DpOBiJiD.js";var jn="__lodash_hash_undefined__";function Yn(n){return this.__data__.set(n,jn),this}function qn(n){return this.__data__.has(n)}function E(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new In;++rs))return!1;var d=i.get(n),l=i.get(r);if(d&&l)return d==r&&l==n;var g=-1,c=!0,T=e&Xn?new E:void 0;for(i.set(n,r),i.set(r,n);++g0&&e(s)?r>1?je(s,r-1,e,t,f):U(f,s):t||(f[f.length]=s)}return f}function Ye(n,r,e){r=yn(r,n);for(var t=-1,f=r.length,i=!1;++t-1}function At(){}var pt=1/0,yt=C&&1/B(new C([,-0]))[1]==pt?function(n){return new C(n)}:At,Tt=200;function Ot(n,r,e){var t=-1,f=bt,i=n.length,a=!0,s=[],u=s;if(i>=Tt){var d=r?null:yt(n);if(d)return B(d);a=!1,f=cn,u=new E}else u=r?[]:s;n:for(;++t=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function er(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function nr(t){return t}var Xt=1,ue=2,Te=3,Zt=4,Ne=1e-6;function rr(t){return"translate("+t+",0)"}function ir(t){return"translate(0,"+t+")"}function sr(t){return e=>+t(e)}function ar(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function or(){return!this.__axis}function ln(t,e){var n=[],r=null,i=null,a=6,c=6,m=3,Y=typeof window<"u"&&window.devicePixelRatio>1?0:.5,C=t===Xt||t===Zt?-1:1,k=t===Zt||t===ue?"x":"y",L=t===Xt||t===Te?rr:ir;function _(S){var B=r??(e.ticks?e.ticks.apply(e,n):e.domain()),A=i??(e.tickFormat?e.tickFormat.apply(e,n):nr),U=Math.max(a,0)+m,I=e.range(),N=+I[0]+Y,W=+I[I.length-1]+Y,q=(e.bandwidth?ar:sr)(e.copy(),Y),j=S.selection?S.selection():S,p=j.selectAll(".domain").data([null]),g=j.selectAll(".tick").data(B,e).order(),y=g.exit(),h=g.enter().append("g").attr("class","tick"),D=g.select("line"),w=g.select("text");p=p.merge(p.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),g=g.merge(h),D=D.merge(h.append("line").attr("stroke","currentColor").attr(k+"2",C*a)),w=w.merge(h.append("text").attr("fill","currentColor").attr(k,C*U).attr("dy",t===Xt?"0em":t===Te?"0.71em":"0.32em")),S!==j&&(p=p.transition(S),g=g.transition(S),D=D.transition(S),w=w.transition(S),y=y.transition(S).attr("opacity",Ne).attr("transform",function(T){return isFinite(T=q(T))?L(T+Y):this.getAttribute("transform")}),h.attr("opacity",Ne).attr("transform",function(T){var v=this.parentNode.__axis;return L((v&&isFinite(v=v(T))?v:q(T))+Y)})),y.remove(),p.attr("d",t===Zt||t===ue?c?"M"+C*c+","+N+"H"+Y+"V"+W+"H"+C*c:"M"+Y+","+N+"V"+W:c?"M"+N+","+C*c+"V"+Y+"H"+W+"V"+C*c:"M"+N+","+Y+"H"+W),g.attr("opacity",1).attr("transform",function(T){return L(q(T)+Y)}),D.attr(k+"2",C*a),w.attr(k,C*U).text(A),j.filter(or).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ue?"start":t===Zt?"end":"middle"),j.each(function(){this.__axis=q})}return _.scale=function(S){return arguments.length?(e=S,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(S){return arguments.length?(n=S==null?[]:Array.from(S),_):n.slice()},_.tickValues=function(S){return arguments.length?(r=S==null?null:Array.from(S),_):r&&r.slice()},_.tickFormat=function(S){return arguments.length?(i=S,_):i},_.tickSize=function(S){return arguments.length?(a=c=+S,_):a},_.tickSizeInner=function(S){return arguments.length?(a=+S,_):a},_.tickSizeOuter=function(S){return arguments.length?(c=+S,_):c},_.tickPadding=function(S){return arguments.length?(m=+S,_):m},_.offset=function(S){return arguments.length?(Y=+S,_):Y},_}function cr(t){return ln(Xt,t)}function ur(t){return ln(Te,t)}const lr=Math.PI/180,fr=180/Math.PI,ee=18,fn=.96422,dn=1,hn=.82521,mn=4/29,Ft=6/29,gn=3*Ft*Ft,dr=Ft*Ft*Ft;function yn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return kn(t);t instanceof an||(t=Wn(t));var e=he(t.r),n=he(t.g),r=he(t.b),i=le((.2225045*e+.7168786*n+.0606169*r)/dn),a,c;return e===n&&n===r?a=c=i:(a=le((.4360747*e+.3850649*n+.1430804*r)/fn),c=le((.0139322*e+.0971045*n+.7141733*r)/hn)),new ft(116*i-16,500*(a-i),200*(i-c),t.opacity)}function hr(t,e,n,r){return arguments.length===1?yn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}on(ft,hr,cn(un,{brighter(t){return new ft(this.l+ee*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ee*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=fn*fe(e),t=dn*fe(t),n=hn*fe(n),new an(de(3.1338561*e-1.6168667*t-.4906146*n),de(-.9787684*e+1.9161415*t+.033454*n),de(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function le(t){return t>dr?Math.pow(t,1/3):t/gn+mn}function fe(t){return t>Ft?t*t*t:gn*(t-mn)}function de(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function he(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function mr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=yn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const c=i(a),m=i.ceil(a);return a-c(e(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,m)=>{const Y=[];if(a=i.ceil(a),m=m==null?1:Math.floor(m),!(a0))return Y;let C;do Y.push(C=new Date(+a)),e(a,m),t(a);while(Cet(c=>{if(c>=c)for(;t(c),!a(c);)c.setTime(c-1)},(c,m)=>{if(c>=c)if(m<0)for(;++m<=0;)for(;e(c,-1),!a(c););else for(;--m>=0;)for(;e(c,1),!a(c););}),n&&(i.count=(a,c)=>(me.setTime(+a),ge.setTime(+c),t(me),t(ge),Math.floor(n(me,ge))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const Ut=et(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Ut.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?et(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Ut);Ut.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Ce=yt*7,Pe=yt*30,ye=yt*365,vt=et(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const $t=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());$t.range;const pr=et(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());pr.range;const Ot=et(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Ot.range;const vr=et(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());vr.range;const xt=et(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const Se=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);Se.range;const Tr=et(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));Tr.range;function Dt(t){return et(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Ce)}const Pt=Dt(0),Ht=Dt(1),pn=Dt(2),vn=Dt(3),bt=Dt(4),Tn=Dt(5),xn=Dt(6);Pt.range;Ht.range;pn.range;vn.range;bt.range;Tn.range;xn.range;function Mt(t){return et(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Ce)}const bn=Mt(0),ne=Mt(1),xr=Mt(2),br=Mt(3),Et=Mt(4),wr=Mt(5),Dr=Mt(6);bn.range;ne.range;xr.range;br.range;Et.range;wr.range;Dr.range;const Nt=et(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Nt.range;const Mr=et(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Mr.range;const kt=et(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=et(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:et(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function Cr(t,e,n,r,i,a){const c=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[a,1,ct],[a,5,5*ct],[a,15,15*ct],[a,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Ce],[e,1,Pe],[e,3,3*Pe],[t,1,ye]];function m(C,k,L){const _=kU).right(c,_);if(S===c.length)return t.every(He(C/ye,k/ye,L));if(S===0)return Ut.every(Math.max(He(C,k,L),1));const[B,A]=c[_/c[S-1][2]53)return null;"w"in l||(l.w=1),"Z"in l?($=pe(Lt(l.y,0,1)),Q=$.getUTCDay(),$=Q>4||Q===0?ne.ceil($):ne($),$=Se.offset($,(l.V-1)*7),l.y=$.getUTCFullYear(),l.m=$.getUTCMonth(),l.d=$.getUTCDate()+(l.w+6)%7):($=ke(Lt(l.y,0,1)),Q=$.getDay(),$=Q>4||Q===0?Ht.ceil($):Ht($),$=xt.offset($,(l.V-1)*7),l.y=$.getFullYear(),l.m=$.getMonth(),l.d=$.getDate()+(l.w+6)%7)}else("W"in l||"U"in l)&&("w"in l||(l.w="u"in l?l.u%7:"W"in l?1:0),Q="Z"in l?pe(Lt(l.y,0,1)).getUTCDay():ke(Lt(l.y,0,1)).getDay(),l.m=0,l.d="W"in l?(l.w+6)%7+l.W*7-(Q+5)%7:l.w+l.U*7-(Q+6)%7);return"Z"in l?(l.H+=l.Z/100|0,l.M+=l.Z%100,pe(l)):ke(l)}}function y(M,H,V,l){for(var J=0,$=H.length,Q=V.length,G,it;J<$;){if(l>=Q)return-1;if(G=H.charCodeAt(J++),G===37){if(G=H.charAt(J++),it=j[G in Ve?H.charAt(J++):G],!it||(l=it(M,V,l))<0)return-1}else if(G!=V.charCodeAt(l++))return-1}return l}function h(M,H,V){var l=C.exec(H.slice(V));return l?(M.p=k.get(l[0].toLowerCase()),V+l[0].length):-1}function D(M,H,V){var l=S.exec(H.slice(V));return l?(M.w=B.get(l[0].toLowerCase()),V+l[0].length):-1}function w(M,H,V){var l=L.exec(H.slice(V));return l?(M.w=_.get(l[0].toLowerCase()),V+l[0].length):-1}function T(M,H,V){var l=I.exec(H.slice(V));return l?(M.m=N.get(l[0].toLowerCase()),V+l[0].length):-1}function v(M,H,V){var l=A.exec(H.slice(V));return l?(M.m=U.get(l[0].toLowerCase()),V+l[0].length):-1}function u(M,H,V){return y(M,e,H,V)}function f(M,H,V){return y(M,n,H,V)}function x(M,H,V){return y(M,r,H,V)}function b(M){return c[M.getDay()]}function F(M){return a[M.getDay()]}function o(M){return Y[M.getMonth()]}function X(M){return m[M.getMonth()]}function s(M){return i[+(M.getHours()>=12)]}function E(M){return 1+~~(M.getMonth()/3)}function R(M){return c[M.getUTCDay()]}function z(M){return a[M.getUTCDay()]}function P(M){return Y[M.getUTCMonth()]}function K(M){return m[M.getUTCMonth()]}function O(M){return i[+(M.getUTCHours()>=12)]}function st(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var H=p(M+="",W);return H.toString=function(){return M},H},parse:function(M){var H=g(M+="",!1);return H.toString=function(){return M},H},utcFormat:function(M){var H=p(M+="",q);return H.toString=function(){return M},H},utcParse:function(M){var H=g(M+="",!0);return H.toString=function(){return M},H}}}var Ve={"-":"",_:" ",0:"0"},nt=/^\s*\d+/,Yr=/^%/,Ur=/[\\^$*+?|[\]().{}]/g;function Z(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a[e.toLowerCase(),n]))}function Ir(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Lr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Ar(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Re(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Hr(t,e,n){var r=nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Nr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function qe(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Pr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Be(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Vr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Br(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Zr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xr(t,e,n){var r=nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Ze(t,e){return Z(t.getDate(),e,2)}function Gr(t,e){return Z(t.getHours(),e,2)}function jr(t,e){return Z(t.getHours()%12||12,e,2)}function Qr(t,e){return Z(1+xt.count(kt(t),t),e,3)}function wn(t,e){return Z(t.getMilliseconds(),e,3)}function Jr(t,e){return wn(t,e)+"000"}function Kr(t,e){return Z(t.getMonth()+1,e,2)}function ti(t,e){return Z(t.getMinutes(),e,2)}function ei(t,e){return Z(t.getSeconds(),e,2)}function ni(t){var e=t.getDay();return e===0?7:e}function ri(t,e){return Z(Pt.count(kt(t)-1,t),e,2)}function Dn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ii(t,e){return t=Dn(t),Z(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function si(t){return t.getDay()}function ai(t,e){return Z(Ht.count(kt(t)-1,t),e,2)}function oi(t,e){return Z(t.getFullYear()%100,e,2)}function ci(t,e){return t=Dn(t),Z(t.getFullYear()%100,e,2)}function ui(t,e){return Z(t.getFullYear()%1e4,e,4)}function li(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),Z(t.getFullYear()%1e4,e,4)}function fi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Z(e/60|0,"0",2)+Z(e%60,"0",2)}function Xe(t,e){return Z(t.getUTCDate(),e,2)}function di(t,e){return Z(t.getUTCHours(),e,2)}function hi(t,e){return Z(t.getUTCHours()%12||12,e,2)}function mi(t,e){return Z(1+Se.count(wt(t),t),e,3)}function Mn(t,e){return Z(t.getUTCMilliseconds(),e,3)}function gi(t,e){return Mn(t,e)+"000"}function yi(t,e){return Z(t.getUTCMonth()+1,e,2)}function ki(t,e){return Z(t.getUTCMinutes(),e,2)}function pi(t,e){return Z(t.getUTCSeconds(),e,2)}function vi(t){var e=t.getUTCDay();return e===0?7:e}function Ti(t,e){return Z(bn.count(wt(t)-1,t),e,2)}function Cn(t){var e=t.getUTCDay();return e>=4||e===0?Et(t):Et.ceil(t)}function xi(t,e){return t=Cn(t),Z(Et.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function bi(t){return t.getUTCDay()}function wi(t,e){return Z(ne.count(wt(t)-1,t),e,2)}function Di(t,e){return Z(t.getUTCFullYear()%100,e,2)}function Mi(t,e){return t=Cn(t),Z(t.getUTCFullYear()%100,e,2)}function Ci(t,e){return Z(t.getUTCFullYear()%1e4,e,4)}function Si(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Et(t):Et.ceil(t),Z(t.getUTCFullYear()%1e4,e,4)}function _i(){return"+0000"}function Ge(){return"%"}function je(t){return+t}function Qe(t){return Math.floor(+t/1e3)}var St,re;Fi({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fi(t){return St=Fr(t),re=St.format,St.parse,St.utcFormat,St.utcParse,St}function Yi(t){return new Date(t)}function Ui(t){return t instanceof Date?+t:+new Date(+t)}function Sn(t,e,n,r,i,a,c,m,Y,C){var k=jn(),L=k.invert,_=k.domain,S=C(".%L"),B=C(":%S"),A=C("%I:%M"),U=C("%I %p"),I=C("%a %d"),N=C("%b %d"),W=C("%B"),q=C("%Y");function j(p){return(Y(p)4&&(S+=7),_.add(S,n));return B.diff(A,"week")+1},m.isoWeekday=function(C){return this.$utils().u(C)?this.day()||7:this.day(this.day()%7?C:C-7)};var Y=m.startOf;m.startOf=function(C,k){var L=this.$utils(),_=!!L.u(k)||k;return L.p(C)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):Y.bind(this)(C,k)}}}))})(Gt)),Gt.exports}var Ai=Li();const Wi=ae(Ai);var jt={exports:{}},$i=jt.exports,Ke;function Oi(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})($i,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,c=/\d\d?/,m=/\d*[^-_:/,()\s\d]+/,Y={},C=function(U){return(U=+U)+(U>68?1900:2e3)},k=function(U){return function(I){this[U]=+I}},L=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(I){if(!I||I==="Z")return 0;var N=I.match(/([+-]|\d\d)/g),W=60*N[1]+(+N[2]||0);return W===0?0:N[0]==="+"?-W:W})(U)}],_=function(U){var I=Y[U];return I&&(I.indexOf?I:I.s.concat(I.f))},S=function(U,I){var N,W=Y.meridiem;if(W){for(var q=1;q<=24;q+=1)if(U.indexOf(W(q,0,I))>-1){N=q>12;break}}else N=U===(I?"pm":"PM");return N},B={A:[m,function(U){this.afternoon=S(U,!1)}],a:[m,function(U){this.afternoon=S(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],s:[c,k("seconds")],ss:[c,k("seconds")],m:[c,k("minutes")],mm:[c,k("minutes")],H:[c,k("hours")],h:[c,k("hours")],HH:[c,k("hours")],hh:[c,k("hours")],D:[c,k("day")],DD:[a,k("day")],Do:[m,function(U){var I=Y.ordinal,N=U.match(/\d+/);if(this.day=N[0],I)for(var W=1;W<=31;W+=1)I(W).replace(/\[|\]/g,"")===U&&(this.day=W)}],w:[c,k("week")],ww:[a,k("week")],M:[c,k("month")],MM:[a,k("month")],MMM:[m,function(U){var I=_("months"),N=(_("monthsShort")||I.map((function(W){return W.slice(0,3)}))).indexOf(U)+1;if(N<1)throw new Error;this.month=N%12||N}],MMMM:[m,function(U){var I=_("months").indexOf(U)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,k("year")],YY:[a,function(U){this.year=C(U)}],YYYY:[/\d{4}/,k("year")],Z:L,ZZ:L};function A(U){var I,N;I=U,N=Y&&Y.formats;for(var W=(U=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,w,T){var v=T&&T.toUpperCase();return w||N[T]||n[T]||N[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(u,f,x){return f||x.slice(1)}))}))).match(r),q=W.length,j=0;j-1)return new Date((F==="X"?1e3:1)*b);var s=A(F)(b),E=s.year,R=s.month,z=s.day,P=s.hours,K=s.minutes,O=s.seconds,st=s.milliseconds,M=s.zone,H=s.week,V=new Date,l=z||(E||R?1:V.getDate()),J=E||V.getFullYear(),$=0;E&&!R||($=R>0?R-1:V.getMonth());var Q,G=P||0,it=K||0,at=O||0,pt=st||0;return M?new Date(Date.UTC(J,$,l,G,it,at,pt+60*M.offset*1e3)):o?new Date(Date.UTC(J,$,l,G,it,at,pt)):(Q=new Date(J,$,l,G,it,at,pt),H&&(Q=X(Q).week(H).toDate()),Q)}catch{return new Date("")}})(p,h,g,N),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),T&&p!=this.format(h)&&(this.$d=new Date("")),Y={}}else if(h instanceof Array)for(var u=h.length,f=1;f<=u;f+=1){y[1]=h[f-1];var x=N.apply(this,y);if(x.isValid()){this.$d=x.$d,this.$L=x.$L,this.init();break}f===u&&(this.$d=new Date(""))}else q.call(this,j)}}}))})(jt)),jt.exports}var Hi=Oi();const Ni=ae(Hi);var Qt={exports:{}},Pi=Qt.exports,tn;function Vi(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Pi,(function(){return function(n,r){var i=r.prototype,a=i.format;i.format=function(c){var m=this,Y=this.$locale();if(!this.isValid())return a.bind(this)(c);var C=this.$utils(),k=(c||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(L){switch(L){case"Q":return Math.ceil((m.$M+1)/3);case"Do":return Y.ordinal(m.$D);case"gggg":return m.weekYear();case"GGGG":return m.isoWeekYear();case"wo":return Y.ordinal(m.week(),"W");case"w":case"ww":return C.s(m.week(),L==="w"?1:2,"0");case"W":case"WW":return C.s(m.isoWeek(),L==="W"?1:2,"0");case"k":case"kk":return C.s(String(m.$H===0?24:m.$H),L==="k"?1:2,"0");case"X":return Math.floor(m.$d.getTime()/1e3);case"x":return m.$d.getTime();case"z":return"["+m.offsetName()+"]";case"zzz":return"["+m.offsetName("long")+"]";default:return L}}));return a.bind(this)(k)}}}))})(Qt)),Qt.exports}var zi=Vi();const Ri=ae(zi);var Jt={exports:{}},qi=Jt.exports,en;function Bi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(qi,(function(){var n,r,i=1e3,a=6e4,c=36e5,m=864e5,Y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C=31536e6,k=2628e6,L=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,_={years:C,months:k,days:m,hours:c,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},S=function(p){return p instanceof q},B=function(p,g,y){return new q(p,y,g.$l)},A=function(p){return r.p(p)+"s"},U=function(p){return p<0},I=function(p){return U(p)?Math.ceil(p):Math.floor(p)},N=function(p){return Math.abs(p)},W=function(p,g){return p?U(p)?{negative:!0,format:""+N(p)+g}:{negative:!1,format:""+p+g}:{negative:!1,format:""}},q=(function(){function p(y,h,D){var w=this;if(this.$d={},this.$l=D,y===void 0&&(this.$ms=0,this.parseFromMilliseconds()),h)return B(y*_[A(h)],this);if(typeof y=="number")return this.$ms=y,this.parseFromMilliseconds(),this;if(typeof y=="object")return Object.keys(y).forEach((function(u){w.$d[A(u)]=y[u]})),this.calMilliseconds(),this;if(typeof y=="string"){var T=y.match(L);if(T){var v=T.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=v[0],this.$d.months=v[1],this.$d.weeks=v[2],this.$d.days=v[3],this.$d.hours=v[4],this.$d.minutes=v[5],this.$d.seconds=v[6],this.calMilliseconds(),this}}return this}var g=p.prototype;return g.calMilliseconds=function(){var y=this;this.$ms=Object.keys(this.$d).reduce((function(h,D){return h+(y.$d[D]||0)*_[D]}),0)},g.parseFromMilliseconds=function(){var y=this.$ms;this.$d.years=I(y/C),y%=C,this.$d.months=I(y/k),y%=k,this.$d.days=I(y/m),y%=m,this.$d.hours=I(y/c),y%=c,this.$d.minutes=I(y/a),y%=a,this.$d.seconds=I(y/i),y%=i,this.$d.milliseconds=y},g.toISOString=function(){var y=W(this.$d.years,"Y"),h=W(this.$d.months,"M"),D=+this.$d.days||0;this.$d.weeks&&(D+=7*this.$d.weeks);var w=W(D,"D"),T=W(this.$d.hours,"H"),v=W(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var f=W(u,"S"),x=y.negative||h.negative||w.negative||T.negative||v.negative||f.negative,b=T.format||v.format||f.format?"T":"",F=(x?"-":"")+"P"+y.format+h.format+w.format+b+T.format+v.format+f.format;return F==="P"||F==="-P"?"P0D":F},g.toJSON=function(){return this.toISOString()},g.format=function(y){var h=y||"YYYY-MM-DDTHH:mm:ss",D={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return h.replace(Y,(function(w,T){return T||String(D[w])}))},g.as=function(y){return this.$ms/_[A(y)]},g.get=function(y){var h=this.$ms,D=A(y);return D==="milliseconds"?h%=1e3:h=D==="weeks"?I(h/_[D]):this.$d[D],h||0},g.add=function(y,h,D){var w;return w=h?y*_[A(h)]:S(y)?y.$ms:B(y,this).$ms,B(this.$ms+w*(D?-1:1),this)},g.subtract=function(y,h){return this.add(y,h,!0)},g.locale=function(y){var h=this.clone();return h.$l=y,h},g.clone=function(){return B(this.$ms,this)},g.humanize=function(y){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!y)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},p})(),j=function(p,g,y){return p.add(g.years()*y,"y").add(g.months()*y,"M").add(g.days()*y,"d").add(g.hours()*y,"h").add(g.minutes()*y,"m").add(g.seconds()*y,"s").add(g.milliseconds()*y,"ms")};return function(p,g,y){n=y,r=y().$utils(),y.duration=function(w,T){var v=y.locale();return B(w,{$l:v},T)},y.isDuration=S;var h=g.prototype.add,D=g.prototype.subtract;g.prototype.add=function(w,T){return S(w)?j(this,w,1):h.bind(this)(w,T)},g.prototype.subtract=function(w,T){return S(w)?j(this,w,-1):D.bind(this)(w,T)}}}))})(Jt)),Jt.exports}var Zi=Bi();const Xi=ae(Zi);var be=(function(){var t=d(function(v,u,f,x){for(f=f||{},x=v.length;x--;f[v[x]]=u);return f},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],c=[1,30],m=[1,31],Y=[1,32],C=[1,33],k=[1,34],L=[1,9],_=[1,10],S=[1,11],B=[1,12],A=[1,13],U=[1,14],I=[1,15],N=[1,16],W=[1,19],q=[1,20],j=[1,21],p=[1,22],g=[1,23],y=[1,25],h=[1,35],D={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(u,f,x,b,F,o,X){var s=o.length-1;switch(F){case 1:return o[s-1];case 2:this.$=[];break;case 3:o[s-1].push(o[s]),this.$=o[s-1];break;case 4:case 5:this.$=o[s];break;case 6:case 7:this.$=[];break;case 8:b.setWeekday("monday");break;case 9:b.setWeekday("tuesday");break;case 10:b.setWeekday("wednesday");break;case 11:b.setWeekday("thursday");break;case 12:b.setWeekday("friday");break;case 13:b.setWeekday("saturday");break;case 14:b.setWeekday("sunday");break;case 15:b.setWeekend("friday");break;case 16:b.setWeekend("saturday");break;case 17:b.setDateFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 18:b.enableInclusiveEndDates(),this.$=o[s].substr(18);break;case 19:b.TopAxis(),this.$=o[s].substr(8);break;case 20:b.setAxisFormat(o[s].substr(11)),this.$=o[s].substr(11);break;case 21:b.setTickInterval(o[s].substr(13)),this.$=o[s].substr(13);break;case 22:b.setExcludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 23:b.setIncludes(o[s].substr(9)),this.$=o[s].substr(9);break;case 24:b.setTodayMarker(o[s].substr(12)),this.$=o[s].substr(12);break;case 27:b.setDiagramTitle(o[s].substr(6)),this.$=o[s].substr(6);break;case 28:this.$=o[s].trim(),b.setAccTitle(this.$);break;case 29:case 30:this.$=o[s].trim(),b.setAccDescription(this.$);break;case 31:b.addSection(o[s].substr(8)),this.$=o[s].substr(8);break;case 33:b.addTask(o[s-1],o[s]),this.$="task";break;case 34:this.$=o[s-1],b.setClickEvent(o[s-1],o[s],null);break;case 35:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],o[s]);break;case 36:this.$=o[s-2],b.setClickEvent(o[s-2],o[s-1],null),b.setLink(o[s-2],o[s]);break;case 37:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-2],o[s-1]),b.setLink(o[s-3],o[s]);break;case 38:this.$=o[s-2],b.setClickEvent(o[s-2],o[s],null),b.setLink(o[s-2],o[s-1]);break;case 39:this.$=o[s-3],b.setClickEvent(o[s-3],o[s-1],o[s]),b.setLink(o[s-3],o[s-2]);break;case 40:this.$=o[s-1],b.setLink(o[s-1],o[s]);break;case 41:case 47:this.$=o[s-1]+" "+o[s];break;case 42:case 43:case 45:this.$=o[s-2]+" "+o[s-1]+" "+o[s];break;case 44:case 46:this.$=o[s-3]+" "+o[s-2]+" "+o[s-1]+" "+o[s];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:k,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:p,36:g,37:24,38:y,40:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:c,17:m,18:Y,19:18,20:C,21:k,22:L,23:_,24:S,25:B,26:A,27:U,28:I,29:N,30:W,31:q,33:j,35:p,36:g,37:24,38:y,40:h},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(u,f){if(f.recoverable)this.trace(u);else{var x=new Error(u);throw x.hash=f,x}},"parseError"),parse:d(function(u){var f=this,x=[0],b=[],F=[null],o=[],X=this.table,s="",E=0,R=0,z=2,P=1,K=o.slice.call(arguments,1),O=Object.create(this.lexer),st={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(st.yy[M]=this.yy[M]);O.setInput(u,st.yy),st.yy.lexer=O,st.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var H=O.yylloc;o.push(H);var V=O.options&&O.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function l(ot){x.length=x.length-2*ot,F.length=F.length-ot,o.length=o.length-ot}d(l,"popStack");function J(){var ot;return ot=b.pop()||O.lex()||P,typeof ot!="number"&&(ot instanceof Array&&(b=ot,ot=b.pop()),ot=f.symbols_[ot]||ot),ot}d(J,"lex");for(var $,Q,G,it,at={},pt,ut,Oe,qt;;){if(Q=x[x.length-1],this.defaultActions[Q]?G=this.defaultActions[Q]:(($===null||typeof $>"u")&&($=J()),G=X[Q]&&X[Q][$]),typeof G>"u"||!G.length||!G[0]){var oe="";qt=[];for(pt in X[Q])this.terminals_[pt]&&pt>z&&qt.push("'"+this.terminals_[pt]+"'");O.showPosition?oe="Parse error on line "+(E+1)+`: +`+O.showPosition()+` +Expecting `+qt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":oe="Parse error on line "+(E+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(oe,{text:O.match,token:this.terminals_[$]||$,line:O.yylineno,loc:H,expected:qt})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+$);switch(G[0]){case 1:x.push($),F.push(O.yytext),o.push(O.yylloc),x.push(G[1]),$=null,R=O.yyleng,s=O.yytext,E=O.yylineno,H=O.yylloc;break;case 2:if(ut=this.productions_[G[1]][1],at.$=F[F.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),it=this.performAction.apply(at,[s,R,E,st.yy,G[1],F,o].concat(K)),typeof it<"u")return it;ut&&(x=x.slice(0,-1*ut*2),F=F.slice(0,-1*ut),o=o.slice(0,-1*ut)),x.push(this.productions_[G[1]][0]),F.push(at.$),o.push(at._$),Oe=X[x[x.length-2]][x[x.length-1]],x.push(Oe);break;case 3:return!0}}return!0},"parse")},w=(function(){var v={EOF:1,parseError:d(function(f,x){if(this.yy.parser)this.yy.parser.parseError(f,x);else throw new Error(f)},"parseError"),setInput:d(function(u,f){return this.yy=f||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var f=u.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},"input"),unput:d(function(u){var f=u.length,x=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===b.length?this.yylloc.first_column:0)+b[b.length-x.length].length-x[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(u){this.unput(this.match.slice(u))},"less"),pastInput:d(function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var u=this.pastInput(),f=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+f+"^"},"showPosition"),test_match:d(function(u,f){var x,b,F;if(this.options.backtrack_lexer&&(F={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(F.yylloc.range=this.yylloc.range.slice(0))),b=u[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],x=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in F)this[o]=F[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,f,x,b;this._more||(this.yytext="",this.match="");for(var F=this._currentRules(),o=0;of[0].length)){if(f=x,b=o,this.options.backtrack_lexer){if(u=this.test_match(x,F[o]),u!==!1)return u;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(u=this.test_match(f,F[b]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var f=this.next();return f||this.lex()},"lex"),begin:d(function(f){this.conditionStack.push(f)},"begin"),popState:d(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:d(function(f){this.begin(f)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(f,x,b,F){switch(b){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return v})();D.lexer=w;function T(){this.yy={}}return d(T,"Parser"),T.prototype=D,D.Parser=T,new T})();be.parser=be;var Gi=be;rt.extend(Wi);rt.extend(Ni);rt.extend(Ri);var nn={friday:5,saturday:6},lt="",_e="",Fe=void 0,Ye="",Vt=[],zt=[],Ue=new Map,Ee=[],ie=[],It="",Ie="",_n=["active","done","crit","milestone","vert"],Le=[],Rt=!1,Ae=!1,We="sunday",se="saturday",we=0,ji=d(function(){Ee=[],ie=[],It="",Le=[],Kt=0,Me=void 0,te=void 0,tt=[],lt="",_e="",Ie="",Fe=void 0,Ye="",Vt=[],zt=[],Rt=!1,Ae=!1,we=0,Ue=new Map,Zn(),We="sunday",se="saturday"},"clear"),Qi=d(function(t){_e=t},"setAxisFormat"),Ji=d(function(){return _e},"getAxisFormat"),Ki=d(function(t){Fe=t},"setTickInterval"),ts=d(function(){return Fe},"getTickInterval"),es=d(function(t){Ye=t},"setTodayMarker"),ns=d(function(){return Ye},"getTodayMarker"),rs=d(function(t){lt=t},"setDateFormat"),is=d(function(){Rt=!0},"enableInclusiveEndDates"),ss=d(function(){return Rt},"endDatesAreInclusive"),as=d(function(){Ae=!0},"enableTopAxis"),os=d(function(){return Ae},"topAxisEnabled"),cs=d(function(t){Ie=t},"setDisplayMode"),us=d(function(){return Ie},"getDisplayMode"),ls=d(function(){return lt},"getDateFormat"),fs=d(function(t){Vt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),ds=d(function(){return Vt},"getIncludes"),hs=d(function(t){zt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),ms=d(function(){return zt},"getExcludes"),gs=d(function(){return Ue},"getLinks"),ys=d(function(t){It=t,Ee.push(t)},"addSection"),ks=d(function(){return Ee},"getSections"),ps=d(function(){let t=rn();const e=10;let n=0;for(;!t&&n{const Y=m.trim();return Y==="x"||Y==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const a=/^after\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let m=null;for(const C of a.groups.ids.split(" ")){let k=Ct(C);k!==void 0&&(!m||k.endTime>m.endTime)&&(m=k)}if(m)return m.endTime;const Y=new Date;return Y.setHours(0,0,0,0),Y}let c=rt(n,e.trim(),!0);if(c.isValid())return c.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const m=new Date(n);if(m===void 0||isNaN(m.getTime())||m.getFullYear()<-1e4||m.getFullYear()>1e4)throw new Error("Invalid date:"+n);return m}},"getStartDate"),Un=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),En=d(function(t,e,n,r=!1){n=n.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(n);if(a!==null){let k=null;for(const _ of a.groups.ids.split(" ")){let S=Ct(_);S!==void 0&&(!k||S.startTime{window.open(n,"_self")}),Ue.set(r,n))}),Ln(t,"clickable")},"setLink"),Ln=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),_s=d(function(t,e,n){if(_t().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Xn.runFunc(e,...r)})},"setClickFun"),An=d(function(t,e){Le.push(function(){const n=document.querySelector(`[id="${t}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const n=document.querySelector(`[id="${t}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),Fs=d(function(t,e,n){t.split(",").forEach(function(r){_s(r,e,n)}),Ln(t,"clickable")},"setClickEvent"),Ys=d(function(t){Le.forEach(function(e){e(t)})},"bindFunctions"),Us={getConfig:d(()=>_t().gantt,"getConfig"),clear:ji,setDateFormat:rs,getDateFormat:ls,enableInclusiveEndDates:is,endDatesAreInclusive:ss,enableTopAxis:as,topAxisEnabled:os,setAxisFormat:Qi,getAxisFormat:Ji,setTickInterval:Ki,getTickInterval:ts,setTodayMarker:es,getTodayMarker:ns,setAccTitle:zn,getAccTitle:Vn,setDiagramTitle:Pn,getDiagramTitle:Nn,setDisplayMode:cs,getDisplayMode:us,setAccDescription:Hn,getAccDescription:On,addSection:ys,getSections:ks,getTasks:ps,addTask:Ms,findTaskById:Ct,addTaskOrg:Cs,setIncludes:fs,getIncludes:ds,setExcludes:hs,getExcludes:ms,setClickEvent:Fs,setLink:Ss,getLinks:gs,bindFunctions:Ys,parseDuration:Un,isInvalidDate:Fn,setWeekday:vs,getWeekday:Ts,setWeekend:xs};function $e(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const a="^\\s*"+i+"\\s*$",c=new RegExp(a);t[0].match(c)&&(e[i]=!0,t.shift(1),r=!0)})}d($e,"getTaskTags");rt.extend(Xi);var Es=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),sn={monday:Ht,tuesday:pn,wednesday:vn,thursday:bt,friday:Tn,saturday:xn,sunday:Pt},Is=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((a,c)=>a.startTime-c.startTime||a.order-c.order),i=0;for(const a of r)for(let c=0;c=n[c]){n[c]=a.endTime,a.order=c+e,c>i&&(i=c);break}return i},"getMaxIntersections"),dt,ve=1e4,Ls=d(function(t,e,n,r){const i=_t().gantt,a=_t().securityLevel;let c;a==="sandbox"&&(c=Bt("#i"+e));const m=a==="sandbox"?Bt(c.nodes()[0].contentDocument.body):Bt("body"),Y=a==="sandbox"?c.nodes()[0].contentDocument:document,C=Y.getElementById(e);dt=C.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const k=r.db.getTasks();let L=[];for(const h of k)L.push(h.type);L=y(L);const _={};let S=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const h={};for(const w of k)h[w.section]===void 0?h[w.section]=[w]:h[w.section].push(w);let D=0;for(const w of Object.keys(h)){const T=Is(h[w],D)+1;D+=T,S+=T*(i.barHeight+i.barGap),_[w]=T}}else{S+=k.length*(i.barHeight+i.barGap);for(const h of L)_[h]=k.filter(D=>D.type===h).length}C.setAttribute("viewBox","0 0 "+dt+" "+S);const B=m.select(`[id="${e}"]`),A=Ei().domain([er(k,function(h){return h.startTime}),tr(k,function(h){return h.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(h,D){const w=h.startTime,T=D.startTime;let v=0;return w>T?v=1:ws.vert===E.vert?0:s.vert?1:-1);const b=[...new Set(h.map(s=>s.order))].map(s=>h.find(E=>E.order===s));B.append("g").selectAll("rect").data(b).enter().append("rect").attr("x",0).attr("y",function(s,E){return E=s.order,E*D+w-2}).attr("width",function(){return f-i.rightPadding/2}).attr("height",D).attr("class",function(s){for(const[E,R]of L.entries())if(s.type===R)return"section section"+E%i.numberSectionStyles;return"section section0"}).enter();const F=B.append("g").selectAll("rect").data(h).enter(),o=r.db.getLinks();if(F.append("rect").attr("id",function(s){return s.id}).attr("rx",3).attr("ry",3).attr("x",function(s){return s.milestone?A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))-.5*v:A(s.startTime)+T}).attr("y",function(s,E){return E=s.order,s.vert?i.gridLineStartPadding:E*D+w}).attr("width",function(s){return s.milestone?v:s.vert?.08*v:A(s.renderEndTime||s.endTime)-A(s.startTime)}).attr("height",function(s){return s.vert?k.length*(i.barHeight+i.barGap)+i.barHeight*2:v}).attr("transform-origin",function(s,E){return E=s.order,(A(s.startTime)+T+.5*(A(s.endTime)-A(s.startTime))).toString()+"px "+(E*D+w+.5*v).toString()+"px"}).attr("class",function(s){const E="task";let R="";s.classes.length>0&&(R=s.classes.join(" "));let z=0;for(const[K,O]of L.entries())s.type===O&&(z=K%i.numberSectionStyles);let P="";return s.active?s.crit?P+=" activeCrit":P=" active":s.done?s.crit?P=" doneCrit":P=" done":s.crit&&(P+=" crit"),P.length===0&&(P=" task"),s.milestone&&(P=" milestone "+P),s.vert&&(P=" vert "+P),P+=z,P+=" "+R,E+P}),F.append("text").attr("id",function(s){return s.id+"-text"}).text(function(s){return s.task}).attr("font-size",i.fontSize).attr("x",function(s){let E=A(s.startTime),R=A(s.renderEndTime||s.endTime);if(s.milestone&&(E+=.5*(A(s.endTime)-A(s.startTime))-.5*v,R=E+v),s.vert)return A(s.startTime)+T;const z=this.getBBox().width;return z>R-E?R+z+1.5*i.leftPadding>f?E+T-5:R+T+5:(R-E)/2+E+T}).attr("y",function(s,E){return s.vert?i.gridLineStartPadding+k.length*(i.barHeight+i.barGap)+60:(E=s.order,E*D+i.barHeight/2+(i.fontSize/2-2)+w)}).attr("text-height",v).attr("class",function(s){const E=A(s.startTime);let R=A(s.endTime);s.milestone&&(R=E+v);const z=this.getBBox().width;let P="";s.classes.length>0&&(P=s.classes.join(" "));let K=0;for(const[st,M]of L.entries())s.type===M&&(K=st%i.numberSectionStyles);let O="";return s.active&&(s.crit?O="activeCritText"+K:O="activeText"+K),s.done?s.crit?O=O+" doneCritText"+K:O=O+" doneText"+K:s.crit&&(O=O+" critText"+K),s.milestone&&(O+=" milestoneText"),s.vert&&(O+=" vertText"),z>R-E?R+z+1.5*i.leftPadding>f?P+" taskTextOutsideLeft taskTextOutside"+K+" "+O:P+" taskTextOutsideRight taskTextOutside"+K+" "+O+" width-"+z:P+" taskText taskText"+K+" "+O+" width-"+z}),_t().securityLevel==="sandbox"){let s;s=Bt("#i"+e);const E=s.nodes()[0].contentDocument;F.filter(function(R){return o.has(R.id)}).each(function(R){var z=E.querySelector("#"+R.id),P=E.querySelector("#"+R.id+"-text");const K=z.parentNode;var O=E.createElement("a");O.setAttribute("xlink:href",o.get(R.id)),O.setAttribute("target","_top"),K.appendChild(O),O.appendChild(z),O.appendChild(P)})}}d(N,"drawRects");function W(h,D,w,T,v,u,f,x){if(f.length===0&&x.length===0)return;let b,F;for(const{startTime:z,endTime:P}of u)(b===void 0||zF)&&(F=P);if(!b||!F)return;if(rt(F).diff(rt(b),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const o=r.db.getDateFormat(),X=[];let s=null,E=rt(b);for(;E.valueOf()<=F;)r.db.isInvalidDate(E,o,f,x)?s?s.end=E:s={start:E,end:E}:s&&(X.push(s),s=null),E=E.add(1,"d");B.append("g").selectAll("rect").data(X).enter().append("rect").attr("id",z=>"exclude-"+z.start.format("YYYY-MM-DD")).attr("x",z=>A(z.start.startOf("day"))+w).attr("y",i.gridLineStartPadding).attr("width",z=>A(z.end.endOf("day"))-A(z.start.startOf("day"))).attr("height",v-D-i.gridLineStartPadding).attr("transform-origin",function(z,P){return(A(z.start)+w+.5*(A(z.end)-A(z.start))).toString()+"px "+(P*h+.5*v).toString()+"px"}).attr("class","exclude-range")}d(W,"drawExcludeDays");function q(h,D,w,T){if(w<=0||h>D)return 1/0;const v=D-h,u=rt.duration({[T??"day"]:w}).asMilliseconds();return u<=0?1/0:Math.ceil(v/u)}d(q,"getEstimatedTickCount");function j(h,D,w,T){const v=r.db.getDateFormat(),u=r.db.getAxisFormat();let f;u?f=u:v==="D"?f="%d":f=i.axisFormat??"%Y-%m-%d";let x=ur(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(re(f));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(F!==null){const o=parseInt(F[1],10);if(isNaN(o)||o<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const X=F[2],s=r.db.getWeekday()||i.weekday,E=A.domain(),R=E[0],z=E[1],P=q(R,z,o,X);if(P>ve)Tt.warn(`The tick interval "${o}${X}" would generate ${P} ticks, which exceeds the maximum allowed (${ve}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(X){case"millisecond":x.ticks(Ut.every(o));break;case"second":x.ticks(vt.every(o));break;case"minute":x.ticks($t.every(o));break;case"hour":x.ticks(Ot.every(o));break;case"day":x.ticks(xt.every(o));break;case"week":x.ticks(sn[s].every(o));break;case"month":x.ticks(Nt.every(o));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+h+", "+(T-50)+")").call(x).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let o=cr(A).tickSize(-T+D+i.gridLineStartPadding).tickFormat(re(f));if(F!==null){const X=parseInt(F[1],10);if(isNaN(X)||X<=0)Tt.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const s=F[2],E=r.db.getWeekday()||i.weekday,R=A.domain(),z=R[0],P=R[1];if(q(z,P,X,s)<=ve)switch(s){case"millisecond":o.ticks(Ut.every(X));break;case"second":o.ticks(vt.every(X));break;case"minute":o.ticks($t.every(X));break;case"hour":o.ticks(Ot.every(X));break;case"day":o.ticks(xt.every(X));break;case"week":o.ticks(sn[E].every(X));break;case"month":o.ticks(Nt.every(X));break}}}B.append("g").attr("class","grid").attr("transform","translate("+h+", "+D+")").call(o).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(j,"makeGrid");function p(h,D){let w=0;const T=Object.keys(_).map(v=>[v,_[v]]);B.append("g").selectAll("text").data(T).enter().append(function(v){const u=v[0].split(qn.lineBreakRegex),f=-(u.length-1)/2,x=Y.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("dy",f+"em");for(const[b,F]of u.entries()){const o=Y.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttribute("alignment-baseline","central"),o.setAttribute("x","10"),b>0&&o.setAttribute("dy","1em"),o.textContent=F,x.appendChild(o)}return x}).attr("x",10).attr("y",function(v,u){if(u>0)for(let f=0;f` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),$s=Ws,Vs={parser:Gi,db:Us,renderer:As,styles:$s};export{Vs as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/gitGraphDiagram-NY62KEGX-zhbq6Y1j.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/gitGraphDiagram-NY62KEGX-zhbq6Y1j.js new file mode 100644 index 0000000000..f2963e9608 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/gitGraphDiagram-NY62KEGX-zhbq6Y1j.js @@ -0,0 +1,65 @@ +import{p as U}from"./chunk-4BX2VUAB-D7HUlyWF.js";import{I as Y}from"./chunk-QZHKN3VN-D5XXShj3.js";import{_ as l,V as K,U as V,v as X,w as J,x as Q,y as Z,E as m,z as rr,B as er,T as tr,a3 as ar,$ as sr,O as C,a4 as nr,a5 as or,a6 as cr,a7 as ir}from"./index-DpOBiJiD.js";import{p as dr}from"./treemap-KMMF4GRG-BN7IEAji.js";import"./forEach-CTOHlvm6.js";import"./difference-CEM8oPgu.js";import"./_basePickBy-DTjWYYGV.js";import"./min-De9wrADv.js";import"./isUndefined-B80uo2Th.js";import"./clone-CQ2NOoIB.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},hr=cr.gitGraph,I=l(()=>nr({...hr,...or().gitGraph}),"getConfig"),c=new Y(()=>{const t=I(),r=t.mainBranchName,s=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:s}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function q(){return ir({length:7})}l(q,"getID");function D(t,r){const s=Object.create(null);return t.reduce((n,e)=>{const a=r(e);return s[a]||(s[a]=!0,n.push(e)),n},[])}l(D,"uniqBy");var lr=l(function(t){c.records.direction=t},"setDirection"),$r=l(function(t){m.debug("options str",t),t=t?.trim(),t=t||"{}";try{c.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),fr=l(function(){return c.records.options},"getOptions"),gr=l(function(t){let r=t.msg,s=t.id;const n=t.type;let e=t.tags;m.info("commit",r,s,n,e),m.debug("Entering commit:",r,s,n,e);const a=I();s=C.sanitizeText(s,a),r=C.sanitizeText(r,a),e=e?.map(o=>C.sanitizeText(o,a));const d={id:s||c.records.seq+"-"+q(),message:r,seq:c.records.seq++,type:n??x.NORMAL,tags:e??[],parents:c.records.head==null?[]:[c.records.head.id],branch:c.records.currBranch};c.records.head=d,m.info("main branch",a.mainBranchName),c.records.commits.has(d.id)&&m.warn(`Commit ID ${d.id} already exists`),c.records.commits.set(d.id,d),c.records.branches.set(c.records.currBranch,d.id),m.debug("in pushCommit "+d.id)},"commit"),yr=l(function(t){let r=t.name;const s=t.order;if(r=C.sanitizeText(r,I()),c.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);c.records.branches.set(r,c.records.head!=null?c.records.head.id:null),c.records.branchConfig.set(r,{name:r,order:s}),F(r),m.debug("in createBranch")},"branch"),ur=l(t=>{let r=t.branch,s=t.id;const n=t.type,e=t.tags,a=I();r=C.sanitizeText(r,a),s&&(s=C.sanitizeText(s,a));const d=c.records.branches.get(c.records.currBranch),o=c.records.branches.get(r),f=d?c.records.commits.get(d):void 0,h=o?c.records.commits.get(o):void 0;if(f&&h&&f.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(c.records.currBranch===r){const i=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(f===void 0||!f){const i=new Error(`Incorrect usage of "merge". Current branch (${c.records.currBranch})has no commits`);throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},i}if(!c.records.branches.has(r)){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},i}if(h===void 0||!h){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},i}if(f===h){const i=new Error('Incorrect usage of "merge". Both branches have same head');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(s&&c.records.commits.has(s)){const i=new Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom id");throw i.hash={text:`merge ${r} ${s} ${n} ${e?.join(" ")}`,token:`merge ${r} ${s} ${n} ${e?.join(" ")}`,expected:[`merge ${r} ${s}_UNIQUE ${n} ${e?.join(" ")}`]},i}const $=o||"",g={id:s||`${c.records.seq}-${q()}`,message:`merged branch ${r} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,$],branch:c.records.currBranch,type:x.MERGE,customType:n,customId:!!s,tags:e??[]};c.records.head=g,c.records.commits.set(g.id,g),c.records.branches.set(c.records.currBranch,g.id),m.debug(c.records.branches),m.debug("in mergeBranch")},"merge"),pr=l(function(t){let r=t.id,s=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,s,n);const a=I();if(r=C.sanitizeText(r,a),s=C.sanitizeText(s,a),n=n?.map(f=>C.sanitizeText(f,a)),e=C.sanitizeText(e,a),!r||!c.records.commits.has(r)){const f=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw f.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},f}const d=c.records.commits.get(r);if(d===void 0||!d)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(d.parents)&&d.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=d.branch;if(d.type===x.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||!c.records.commits.has(s)){if(o===c.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const f=c.records.branches.get(c.records.currBranch);if(f===void 0||!f){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const h=c.records.commits.get(f);if(h===void 0||!h){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const $={id:c.records.seq+"-"+q(),message:`cherry-picked ${d?.message} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,d.id],branch:c.records.currBranch,type:x.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${d.id}${d.type===x.MERGE?`|parent:${e}`:""}`]};c.records.head=$,c.records.commits.set($.id,$),c.records.branches.set(c.records.currBranch,$.id),m.debug(c.records.branches),m.debug("in cherryPick")}},"cherryPick"),F=l(function(t){if(t=C.sanitizeText(t,I()),c.records.branches.has(t)){c.records.currBranch=t;const r=c.records.branches.get(c.records.currBranch);r===void 0||!r?c.records.head=null:c.records.head=c.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function H(t,r,s){const n=t.indexOf(r);n===-1?t.push(s):t.splice(n,1,s)}l(H,"upsert");function P(t){const r=t.reduce((e,a)=>e.seq>a.seq?e:a,t[0]);let s="";t.forEach(function(e){e===r?s+=" *":s+=" |"});const n=[s,r.id,r.seq];for(const e in c.records.branches)c.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=c.records.commits.get(r.parents[0]);H(t,r,e),r.parents[1]&&t.push(c.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=c.records.commits.get(r.parents[0]);H(t,r,e)}}t=D(t,e=>e.id),P(t)}l(P,"prettyPrintCommitHistory");var xr=l(function(){m.debug(c.records.commits);const t=N()[0];P([t])},"prettyPrint"),mr=l(function(){c.reset(),sr()},"clear"),br=l(function(){return[...c.records.branchConfig.values()].map((r,s)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${s}`)}).sort((r,s)=>(r.order??0)-(s.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),wr=l(function(){return c.records.branches},"getBranches"),vr=l(function(){return c.records.commits},"getCommits"),N=l(function(){const t=[...c.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,s)=>r.seq-s.seq),t},"getCommitsArray"),Cr=l(function(){return c.records.currBranch},"getCurrentBranch"),Er=l(function(){return c.records.direction},"getDirection"),Tr=l(function(){return c.records.head},"getHead"),S={commitType:x,getConfig:I,setDirection:lr,setOptions:$r,getOptions:fr,commit:gr,branch:yr,merge:ur,cherryPick:pr,checkout:F,prettyPrint:xr,clear:mr,getBranchesAsObjArray:br,getBranches:wr,getCommits:vr,getCommitsArray:N,getCurrentBranch:Cr,getDirection:Er,getHead:Tr,setAccTitle:Z,getAccTitle:Q,getAccDescription:J,setAccDescription:X,setDiagramTitle:V,getDiagramTitle:K},Br=l((t,r)=>{U(t,r),t.dir&&r.setDirection(t.dir);for(const s of t.statements)Lr(s,r)},"populate"),Lr=l((t,r)=>{const n={Commit:l(e=>r.commit(kr(e)),"Commit"),Branch:l(e=>r.branch(Mr(e)),"Branch"),Merge:l(e=>r.merge(Ir(e)),"Merge"),Checkout:l(e=>r.checkout(Rr(e)),"Checkout"),CherryPicking:l(e=>r.cherryPick(Gr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),kr=l(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),Mr=l(t=>({name:t.name,order:t.order??0}),"parseBranch"),Ir=l(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Rr=l(t=>t.branch,"parseCheckout"),Gr=l(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Or={parse:l(async t=>{const r=await dr("gitGraph",t);m.debug(r),Br(r,S)},"parse")},Ar=rr(),v=Ar?.gitGraph,L=10,k=40,E=4,T=2,M=8,b=new Map,w=new Map,O=30,R=new Map,A=[],B=0,u="LR",qr=l(()=>{b.clear(),w.clear(),R.clear(),B=0,A=[],u="LR"},"clear"),W=l(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=n.trim(),r.appendChild(e)}),r},"drawText"),j=l(t=>{let r,s,n;return u==="BT"?(s=l((e,a)=>e<=a,"comparisonFunc"),n=1/0):(s=l((e,a)=>e>=a,"comparisonFunc"),n=0),t.forEach(e=>{const a=u==="TB"||u=="BT"?w.get(e)?.y:w.get(e)?.x;a!==void 0&&s(a,n)&&(r=e,n=a)}),r},"findClosestParent"),_r=l(t=>{let r="",s=1/0;return t.forEach(n=>{const e=w.get(n).y;e<=s&&(r=n,s=e)}),r||void 0},"findClosestParentBT"),Hr=l((t,r,s)=>{let n=s,e=s;const a=[];t.forEach(d=>{const o=r.get(d);if(!o)throw new Error(`Commit not found for key ${d}`);o.parents.length?(n=zr(o),e=Math.max(n,e)):a.push(o),Dr(o,n)}),n=e,a.forEach(d=>{Fr(d,n,s)}),t.forEach(d=>{const o=r.get(d);if(o?.parents.length){const f=_r(o.parents);n=w.get(f).y-k,n<=e&&(e=n);const h=b.get(o.branch).pos,$=n-L;w.set(o.id,{x:h,y:$})}})},"setParallelBTPos"),Pr=l(t=>{const r=j(t.parents.filter(n=>n!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const s=w.get(r)?.y;if(s===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return s},"findClosestParentPos"),zr=l(t=>Pr(t)+k,"calculateCommitPosition"),Dr=l((t,r)=>{const s=b.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const n=s.pos,e=r+L;return w.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),Fr=l((t,r,s)=>{const n=b.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+s,a=n.pos;w.set(t.id,{x:a,y:e})},"setRootPosition"),Nr=l((t,r,s,n,e,a)=>{if(a===x.HIGHLIGHT)t.append("rect").attr("x",s.x-10).attr("y",s.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%M} ${n}-outer`),t.append("rect").attr("x",s.x-6).attr("y",s.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%M} ${n}-inner`);else if(a===x.CHERRY_PICK)t.append("circle").attr("cx",s.x).attr("cy",s.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x-3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x+3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x+3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x-3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const d=t.append("circle");if(d.attr("cx",s.x),d.attr("cy",s.y),d.attr("r",r.type===x.MERGE?9:10),d.attr("class",`commit ${r.id} commit${e%M}`),a===x.MERGE){const o=t.append("circle");o.attr("cx",s.x),o.attr("cy",s.y),o.attr("r",6),o.attr("class",`commit ${n} ${r.id} commit${e%M}`)}a===x.REVERSE&&t.append("path").attr("d",`M ${s.x-5},${s.y-5}L${s.x+5},${s.y+5}M${s.x-5},${s.y+5}L${s.x+5},${s.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%M}`)}},"drawCommitBullet"),Sr=l((t,r,s,n)=>{if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&v?.showCommitLabel){const e=t.append("g"),a=e.insert("rect").attr("class","commit-label-bkg"),d=e.append("text").attr("x",n).attr("y",s.y+25).attr("class","commit-label").text(r.id),o=d.node()?.getBBox();if(o&&(a.attr("x",s.posWithOffset-o.width/2-T).attr("y",s.y+13.5).attr("width",o.width+2*T).attr("height",o.height+2*T),u==="TB"||u==="BT"?(a.attr("x",s.x-(o.width+4*E+5)).attr("y",s.y-12),d.attr("x",s.x-(o.width+4*E)).attr("y",s.y+o.height-12)):d.attr("x",s.posWithOffset-o.width/2),v.rotateCommitLabel))if(u==="TB"||u==="BT")d.attr("transform","rotate(-45, "+s.x+", "+s.y+")"),a.attr("transform","rotate(-45, "+s.x+", "+s.y+")");else{const f=-7.5-(o.width+10)/25*9.5,h=10+o.width/25*8.5;e.attr("transform","translate("+f+", "+h+") rotate(-45, "+n+", "+s.y+")")}}},"drawCommitLabel"),Wr=l((t,r,s,n)=>{if(r.tags.length>0){let e=0,a=0,d=0;const o=[];for(const f of r.tags.reverse()){const h=t.insert("polygon"),$=t.append("circle"),g=t.append("text").attr("y",s.y-16-e).attr("class","tag-label").text(f),i=g.node()?.getBBox();if(!i)throw new Error("Tag bbox not found");a=Math.max(a,i.width),d=Math.max(d,i.height),g.attr("x",s.posWithOffset-i.width/2),o.push({tag:g,hole:$,rect:h,yOffset:e}),e+=20}for(const{tag:f,hole:h,rect:$,yOffset:g}of o){const i=d/2,y=s.y-19.2-g;if($.attr("class","tag-label-bkg").attr("points",` + ${n-a/2-E/2},${y+T} + ${n-a/2-E/2},${y-T} + ${s.posWithOffset-a/2-E},${y-i-T} + ${s.posWithOffset+a/2+E},${y-i-T} + ${s.posWithOffset+a/2+E},${y+i+T} + ${s.posWithOffset-a/2-E},${y+i+T}`),h.attr("cy",y).attr("cx",n-a/2+E/2).attr("r",1.5).attr("class","tag-hole"),u==="TB"||u==="BT"){const p=n+g;$.attr("class","tag-label-bkg").attr("points",` + ${s.x},${p+2} + ${s.x},${p-2} + ${s.x+L},${p-i-2} + ${s.x+L+a+4},${p-i-2} + ${s.x+L+a+4},${p+i+2} + ${s.x+L},${p+i+2}`).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),h.attr("cx",s.x+E/2).attr("cy",p).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),f.attr("x",s.x+5).attr("y",p+3).attr("transform","translate(14,14) rotate(45, "+s.x+","+n+")")}}}},"drawCommitTags"),jr=l(t=>{switch(t.customType??t.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Ur=l((t,r,s,n)=>{const e={x:0,y:0};if(t.parents.length>0){const a=j(t.parents);if(a){const d=n.get(a)??e;return r==="TB"?d.y+k:r==="BT"?(n.get(t.id)??e).y-k:d.x+k}}else return r==="TB"?O:r==="BT"?(n.get(t.id)??e).y-k:0;return 0},"calculatePosition"),Yr=l((t,r,s)=>{const n=u==="BT"&&s?r:r+L,e=u==="TB"||u==="BT"?n:b.get(t.branch)?.pos,a=u==="TB"||u==="BT"?b.get(t.branch)?.pos:n;if(a===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:e,posWithOffset:n}},"getCommitPosition"),z=l((t,r,s)=>{if(!v)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),e=t.append("g").attr("class","commit-labels");let a=u==="TB"||u==="BT"?O:0;const d=[...r.keys()],o=v?.parallelCommits??!1,f=l(($,g)=>{const i=r.get($)?.seq,y=r.get(g)?.seq;return i!==void 0&&y!==void 0?i-y:0},"sortKeys");let h=d.sort(f);u==="BT"&&(o&&Hr(h,r,a),h=h.reverse()),h.forEach($=>{const g=r.get($);if(!g)throw new Error(`Commit not found for key ${$}`);o&&(a=Ur(g,u,a,w));const i=Yr(g,a,o);if(s){const y=jr(g),p=g.customType??g.type,_=b.get(g.branch)?.index??0;Nr(n,g,i,y,_,p),Sr(e,g,i,a),Wr(e,g,i,a)}u==="TB"||u==="BT"?w.set(g.id,{x:i.x,y:i.posWithOffset}):w.set(g.id,{x:i.posWithOffset,y:i.y}),a=u==="BT"&&o?a+k:a+k+L,a>B&&(B=a)})},"drawCommits"),Kr=l((t,r,s,n,e)=>{const d=(u==="TB"||u==="BT"?s.xh.branch===d,"isOnBranchToGetCurve"),f=l(h=>h.seq>t.seq&&h.seqf(h)&&o(h))},"shouldRerouteArrow"),G=l((t,r,s=0)=>{const n=t+Math.abs(t-r)/2;if(s>5)return n;if(A.every(d=>Math.abs(d-n)>=10))return A.push(n),n;const a=Math.abs(t-r);return G(t,r-a/5,s+1)},"findLane"),Vr=l((t,r,s,n)=>{const e=w.get(r.id),a=w.get(s.id);if(e===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${s.id}`);const d=Kr(r,s,e,a,n);let o="",f="",h=0,$=0,g=b.get(s.branch)?.index;s.type===x.MERGE&&r.id!==s.parents[0]&&(g=b.get(r.branch)?.index);let i;if(d){o="A 10 10, 0, 0, 0,",f="A 10 10, 0, 0, 1,",h=10,$=10;const y=e.ya.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y-h} ${f} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x+h} ${e.y} ${o} ${a.x} ${e.y+$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):u==="BT"?(e.xa.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${o} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):(e.ya.y&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${f} ${e.x+$} ${a.y} L ${a.x} ${a.y}`),e.y===a.y&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`));if(i===void 0)throw new Error("Line definition not found");t.append("path").attr("d",i).attr("class","arrow arrow"+g%M)},"drawArrow"),Xr=l((t,r)=>{const s=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(n=>{const e=r.get(n);e.parents&&e.parents.length>0&&e.parents.forEach(a=>{Vr(s,r.get(a),e,r)})})},"drawArrows"),Jr=l((t,r)=>{const s=t.append("g");r.forEach((n,e)=>{const a=e%M,d=b.get(n.name)?.pos;if(d===void 0)throw new Error(`Position not found for branch ${n.name}`);const o=s.append("line");o.attr("x1",0),o.attr("y1",d),o.attr("x2",B),o.attr("y2",d),o.attr("class","branch branch"+a),u==="TB"?(o.attr("y1",O),o.attr("x1",d),o.attr("y2",B),o.attr("x2",d)):u==="BT"&&(o.attr("y1",B),o.attr("x1",d),o.attr("y2",O),o.attr("x2",d)),A.push(d);const f=n.name,h=W(f),$=s.insert("rect"),i=s.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);i.node().appendChild(h);const y=h.getBBox();$.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-y.width-4-(v?.rotateCommitLabel===!0?30:0)).attr("y",-y.height/2+8).attr("width",y.width+18).attr("height",y.height+4),i.attr("transform","translate("+(-y.width-14-(v?.rotateCommitLabel===!0?30:0))+", "+(d-y.height/2-1)+")"),u==="TB"?($.attr("x",d-y.width/2-10).attr("y",0),i.attr("transform","translate("+(d-y.width/2-5)+", 0)")):u==="BT"?($.attr("x",d-y.width/2-10).attr("y",B),i.attr("transform","translate("+(d-y.width/2-5)+", "+B+")")):$.attr("transform","translate(-19, "+(d-y.height/2)+")")})},"drawBranches"),Qr=l(function(t,r,s,n,e){return b.set(t,{pos:r,index:s}),r+=50+(e?40:0)+(u==="TB"||u==="BT"?n.width/2:0),r},"setBranchPosition"),Zr=l(function(t,r,s,n){if(qr(),m.debug("in gitgraph renderer",t+` +`,"id:",r,s),!v)throw new Error("GitGraph config not found");const e=v.rotateCommitLabel??!1,a=n.db;R=a.getCommits();const d=a.getBranchesAsObjArray();u=a.getDirection();const o=er(`[id="${r}"]`);let f=0;d.forEach((h,$)=>{const g=W(h.name),i=o.append("g"),y=i.insert("g").attr("class","branchLabel"),p=y.insert("g").attr("class","label branch-label");p.node()?.appendChild(g);const _=g.getBBox();f=Qr(h.name,f,$,_,e),p.remove(),y.remove(),i.remove()}),z(o,R,!1),v.showBranches&&Jr(o,d),Xr(o,R),z(o,R,!0),tr.insertTitle(o,"gitTitleText",v.titleTopMargin??0,a.getDiagramTitle()),ar(void 0,o,v.diagramPadding,v.useMaxWidth)},"draw"),re={draw:Zr},ee=l(t=>` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + ${[0,1,2,3,4,5,6,7].map(r=>` + .branch-label${r} { fill: ${t["gitBranchLabel"+r]}; } + .commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } + .commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } + .label${r} { fill: ${t["git"+r]}; } + .arrow${r} { stroke: ${t["git"+r]}; } + `).join(` +`)} + + .branch { + stroke-width: 1; + stroke: ${t.lineColor}; + stroke-dasharray: 2; + } + .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};} + .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; } + .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} + .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; } + .tag-hole { fill: ${t.textColor}; } + + .commit-merge { + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; + } + .commit-reverse { + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; + stroke-width: 3; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${t.primaryColor}; + fill: ${t.primaryColor}; + } + + .arrow { stroke-width: 8; stroke-linecap: round; fill: none} + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; + } +`,"getStyles"),te=ee,fe={parser:Or,db:S,renderer:re,styles:te};export{fe as diagram}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/graph-C2pZo5Z6.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/graph-C2pZo5Z6.js new file mode 100644 index 0000000000..64ea28cfca --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/graph-C2pZo5Z6.js @@ -0,0 +1 @@ +import{aP as c,aQ as b,aR as E}from"./index-DpOBiJiD.js";import{k as _,f as d,r as L}from"./forEach-CTOHlvm6.js";import{f as g,i as l,v as p}from"./isUndefined-B80uo2Th.js";import{u as j}from"./union-CR4sFk7V.js";var v="\0",a="\0",O="";class N{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=c(void 0),this._defaultEdgeLabelFn=c(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return b(e)||(e=c(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return _(this._nodes)}sources(){var e=this;return g(this.nodes(),function(t){return E(e._in[t])})}sinks(){var e=this;return g(this.nodes(),function(t){return E(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return d(e,function(r){s.length>1?i.setNode(r,t):i.setNode(r)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],d(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),d(_(this._in[e]),t),delete this._in[e],delete this._preds[e],d(_(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l(t))t=a;else{t+="";for(var s=t;!l(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}}children(e){if(l(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return _(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return _(t)}successors(e){var t=this._sucs[e];if(t)return _(t)}neighbors(e){var t=this.predecessors(e);if(t)return j(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;d(this._nodes,function(n,h){e(h)&&t.setNode(h,n)}),d(this._edgeObjs,function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,s.edge(n))});var i={};function r(n){var h=s.parent(n);return h===void 0||t.hasNode(h)?(i[n]=h,h):h in i?i[h]:r(h)}return this._isCompound&&d(t.nodes(),function(n){t.setParent(n,r(n))}),t}setDefaultEdgeLabel(e){return b(e)||(e=c(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return L(e,function(r,n){return i.length>1?s.setEdge(r,n,t):s.setEdge(r,n),n}),this}setEdge(){var e,t,s,i,r=!1,n=arguments[0];typeof n=="object"&&n!==null&&"v"in n?(e=n.v,t=n.w,s=n.name,arguments.length===2&&(i=arguments[1],r=!0)):(e=n,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),e=""+e,t=""+t,l(s)||(s=""+s);var h=f(this._isDirected,e,t,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,h))return r&&(this._edgeLabels[h]=i),this;if(!l(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[h]=r?i:this._defaultEdgeLabelFn(e,t,s);var u=P(this._isDirected,e,t,s);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[h]=u,C(this._preds[t],e),C(this._sucs[e],t),this._in[t][h]=u,this._out[e][h]=u,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):f(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):f(this._isDirected,e,t,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):f(this._isDirected,e,t,s),r=this._edgeObjs[i];return r&&(e=r.v,t=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],y(this._preds[t],e),y(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=p(s);return t?g(i,function(r){return r.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=p(s);return t?g(i,function(r){return r.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}N.prototype._nodeCount=0;N.prototype._edgeCount=0;function C(o,e){o[e]?o[e]++:o[e]=1}function y(o,e){--o[e]||delete o[e]}function f(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}return i+O+r+O+(l(s)?v:s)}function P(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}var h={v:i,w:r};return s&&(h.name=s),h}function m(o,e){return f(o,e.v,e.w,e.name)}export{N as G}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BZLU40Mk.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BZLU40Mk.js deleted file mode 100644 index 6ccc491df6..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BZLU40Mk.js +++ /dev/null @@ -1,83 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedbackForm-oSbly5oN.js","assets/index-Be0kkf3d.js","assets/chunk-SSA7SXE4-CJa0HuAU.js","assets/useMenuTriggerState-SaFmATkk.js","assets/useSelectableItem-DhuFnc0W.js","assets/index-Ceq7Rkzy.js","assets/chunk-IGSAU2ZA-NXd1g0Qd.js","assets/ChatOptionsForm-bfNG8UIW.js","assets/ShareButton-B7DyIVH0.js","assets/UsageButton-BABA7a-w.js","assets/ChatHistory-B2hLBYMJ.js","assets/CredentialsLogin-0g5-w2vR.js","assets/authStore-BfGlL8rp.js","assets/useInitializeUserStore-DyHP7g8x.js","assets/AuthGuard-Bq7UOJ7y.js","assets/LogoutButton-BQE8NNsg.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ig=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zy={exports:{}},pp={},jy={exports:{}},ht={};var o1;function sL(){if(o1)return ht;o1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function b(U){return U===null||typeof U!="object"?null:(U=g&&U[g]||U["@@iterator"],typeof U=="function"?U:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,P={};function T(U,oe,z){this.props=U,this.context=oe,this.refs=P,this.updater=z||x}T.prototype.isReactComponent={},T.prototype.setState=function(U,oe){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,oe,"setState")},T.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function _(){}_.prototype=T.prototype;function A(U,oe,z){this.props=U,this.context=oe,this.refs=P,this.updater=z||x}var M=A.prototype=new _;M.constructor=A,k(M,T.prototype),M.isPureReactComponent=!0;var F=Array.isArray,j=Object.prototype.hasOwnProperty,$={current:null},Y={key:!0,ref:!0,__self:!0,__source:!0};function te(U,oe,z){var me,Ce={},ye=null,Fe=null;if(oe!=null)for(me in oe.ref!==void 0&&(Fe=oe.ref),oe.key!==void 0&&(ye=""+oe.key),oe)j.call(oe,me)&&!Y.hasOwnProperty(me)&&(Ce[me]=oe[me]);var Ne=arguments.length-2;if(Ne===1)Ce.children=z;else if(1>>1,oe=V[U];if(0>>1;Ui(Ce,D))yei(Fe,Ce)?(V[U]=Fe,V[ye]=D,U=ye):(V[U]=Ce,V[me]=D,U=me);else if(yei(Fe,D))V[U]=Fe,V[ye]=D,U=ye;else break e}}return ae}function i(V,ae){var D=V.sortIndex-ae.sortIndex;return D!==0?D:V.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],h=[],m=1,g=null,b=3,x=!1,k=!1,P=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(V){for(var ae=n(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=V)r(h),ae.sortIndex=ae.expirationTime,t(d,ae);else break;ae=n(h)}}function F(V){if(P=!1,M(V),!k)if(n(d)!==null)k=!0,J(j);else{var ae=n(h);ae!==null&&X(F,ae.startTime-V)}}function j(V,ae){k=!1,P&&(P=!1,_(te),te=-1),x=!0;var D=b;try{for(M(ae),g=n(d);g!==null&&(!(g.expirationTime>ae)||V&&!W());){var U=g.callback;if(typeof U=="function"){g.callback=null,b=g.priorityLevel;var oe=U(g.expirationTime<=ae);ae=e.unstable_now(),typeof oe=="function"?g.callback=oe:g===n(d)&&r(d),M(ae)}else r(d);g=n(d)}if(g!==null)var z=!0;else{var me=n(h);me!==null&&X(F,me.startTime-ae),z=!1}return z}finally{g=null,b=D,x=!1}}var $=!1,Y=null,te=-1,ie=5,B=-1;function W(){return!(e.unstable_now()-BV||125U?(V.sortIndex=D,t(h,V),n(d)===null&&V===n(h)&&(P?(_(te),te=-1):P=!0,X(F,D-U))):(V.sortIndex=oe,t(d,V),k||x||(k=!0,J(j))),V},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(V){var ae=b;return function(){var D=b;b=ae;try{return V.apply(this,arguments)}finally{b=D}}}})(Uy)),Uy}var c1;function cL(){return c1||(c1=1,Vy.exports=uL()),Vy.exports}var f1;function fL(){if(f1)return ii;f1=1;var e=ix(),t=cL();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,p=1;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},g={};function b(o){return d.call(g,o)?!0:d.call(m,o)?!1:h.test(o)?g[o]=!0:(m[o]=!0,!1)}function x(o,l,p,v){if(p!==null&&p.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:p!==null?!p.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function k(o,l,p,v){if(l===null||typeof l>"u"||x(o,l,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function P(o,l,p,v,w,C,R){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=R}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){T[o]=new P(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];T[l]=new P(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){T[o]=new P(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){T[o]=new P(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){T[o]=new P(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){T[o]=new P(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){T[o]=new P(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){T[o]=new P(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){T[o]=new P(o,5,!1,o.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function A(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!1,!1)}),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!0,!0)});function M(o,l,p,v){var w=T.hasOwnProperty(l)?T[l]:null;(w!==null?w.type!==0:v||!(2K||w[R]!==C[K]){var Q=` -`+w[R].replace(" at new "," at ");return o.displayName&&Q.includes("")&&(Q=Q.replace("",o.displayName)),Q}while(1<=R&&0<=K);break}}}finally{z=!1,Error.prepareStackTrace=p}return(o=o?o.displayName||o.name:"")?oe(o):""}function Ce(o){switch(o.tag){case 5:return oe(o.type);case 16:return oe("Lazy");case 13:return oe("Suspense");case 19:return oe("SuspenseList");case 0:case 2:case 15:return o=me(o.type,!1),o;case 11:return o=me(o.type.render,!1),o;case 1:return o=me(o.type,!0),o;default:return""}}function ye(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case Y:return"Fragment";case $:return"Portal";case ie:return"Profiler";case te:return"StrictMode";case ee:return"Suspense";case H:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case W:return(o.displayName||"Context")+".Consumer";case B:return(o._context.displayName||"Context")+".Provider";case G:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case le:return l=o.displayName||null,l!==null?l:ye(o.type)||"Memo";case J:l=o._payload,o=o._init;try{return ye(o(l))}catch{}}return null}function Fe(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(l);case 8:return l===te?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ne(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function _e(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Qe(o){var l=_e(o)?"checked":"value",p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),v=""+o[l];if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,C=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(R){v=""+R,C.call(this,R)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(R){v=""+R},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function at(o){o._valueTracker||(o._valueTracker=Qe(o))}function Ie(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var p=l.getValue(),v="";return o&&(v=_e(o)?o.checked?"true":"false":o.value),o=v,o!==p?(l.setValue(o),!0):!1}function mt(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function pt(o,l){var p=l.checked;return D({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??o._wrapperState.initialChecked})}function Ut(o,l){var p=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;p=Ne(l.value!=null?l.value:p),o._wrapperState={initialChecked:v,initialValue:p,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ue(o,l){l=l.checked,l!=null&&M(o,"checked",l,!1)}function it(o,l){Ue(o,l);var p=Ne(l.value),v=l.type;if(p!=null)v==="number"?(p===0&&o.value===""||o.value!=p)&&(o.value=""+p):o.value!==""+p&&(o.value=""+p);else if(v==="submit"||v==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?tr(o,l.type,p):l.hasOwnProperty("defaultValue")&&tr(o,l.type,Ne(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Kt(o,l,p){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,p||l===o.value||(o.value=l),o.defaultValue=l}p=o.name,p!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,p!==""&&(o.name=p)}function tr(o,l,p){(l!=="number"||mt(o.ownerDocument)!==o)&&(p==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+p&&(o.defaultValue=""+p))}var an=Array.isArray;function _t(o,l,p,v){if(o=o.options,l){l={};for(var w=0;w"+l.valueOf().toString()+"",l=ze.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function lt(o,l){if(l){var p=o.firstChild;if(p&&p===o.lastChild&&p.nodeType===3){p.nodeValue=l;return}}o.textContent=l}var Wt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vn=["Webkit","ms","Moz","O"];Object.keys(Wt).forEach(function(o){Vn.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Wt[l]=Wt[o]})});function Jt(o,l,p){return l==null||typeof l=="boolean"||l===""?"":p||typeof l!="number"||l===0||Wt.hasOwnProperty(o)&&Wt[o]?(""+l).trim():l+"px"}function Pt(o,l){o=o.style;for(var p in l)if(l.hasOwnProperty(p)){var v=p.indexOf("--")===0,w=Jt(p,l[p],v);p==="float"&&(p="cssFloat"),v?o.setProperty(p,w):o[p]=w}}var Pr=D({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ot(o,l){if(l){if(Pr[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function nr(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=null;function aa(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ms=null,pi=null,hi=null;function cl(o){if(o=Wn(o)){if(typeof ms!="function")throw Error(n(280));var l=o.stateNode;l&&(l=cc(l),ms(o.stateNode,o.type,l))}}function Du(o){pi?hi?hi.push(o):hi=[o]:pi=o}function gs(){if(pi){var o=pi,l=hi;if(hi=pi=null,cl(o),l)for(o=0;o>>=0,o===0?32:31-(Oh(o)/Fh|0)|0}var ca=64,Fu=4194304;function fa(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function xs(o,l){var p=o.pendingLanes;if(p===0)return 0;var v=0,w=o.suspendedLanes,C=o.pingedLanes,R=p&268435455;if(R!==0){var K=R&~w;K!==0?v=fa(K):(C&=R,C!==0&&(v=fa(C)))}else R=p&~w,R!==0?v=fa(R):C!==0&&(v=fa(C));if(v===0)return 0;if(l!==0&&l!==v&&(l&w)===0&&(w=v&-v,C=l&-l,w>=C||w===16&&(C&4194240)!==0))return l;if((v&4)!==0&&(v|=p&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=v;0p;p++)l.push(o);return l}function vl(o,l,p){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-mi(l),o[l]=p}function Bh(o,l){var p=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var v=o.eventTimes;for(o=o.expirationTimes;0=ao),tm=" ",nm=!1;function rm(o,l){switch(o){case"keyup":return Tr.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function im(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var va=!1;function ya(o,l){switch(o){case"compositionend":return im(l);case"keypress":return l.which!==32?null:(nm=!0,tm);case"textInput":return o=l.data,o===tm&&nm?null:o;default:return null}}function Zv(o,l){if(va)return o==="compositionend"||!Sl&&rm(o,l)?(o=ed(),Di=wl=Gt=null,va=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:p,offset:l-o};o=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=rt(p)}}function pn(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?pn(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function $t(){for(var o=window,l=mt();l instanceof o.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)o=l.contentWindow;else break;l=mt(o.document)}return l}function kl(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function oy(o){var l=$t(),p=o.focusedElem,v=o.selectionRange;if(l!==p&&p&&p.ownerDocument&&pn(p.ownerDocument.documentElement,p)){if(v!==null&&kl(p)){if(l=v.start,o=v.end,o===void 0&&(o=l),"selectionStart"in p)p.selectionStart=l,p.selectionEnd=Math.min(o,p.value.length);else if(o=(l=p.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=p.textContent.length,C=Math.min(v.start,w);v=v.end===void 0?C:Math.min(v.end,w),!o.extend&&C>v&&(w=v,v=C,C=w),w=wt(p,C);var R=wt(p,v);w&&R&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==R.node||o.focusOffset!==R.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),C>v?(o.addRange(l),o.extend(R.node,R.offset)):(l.setEnd(R.node,R.offset),o.addRange(l)))}}for(l=[],o=p;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,lo=null,pd=null,Ni=null,xa=!1;function Cl(o,l,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;xa||lo==null||lo!==mt(v)||(v=lo,"selectionStart"in v&&kl(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Ni&&Re(Ni,v)||(Ni=v,v=sc(pd,"onSelect"),0_a||(o.current=yd[_a],yd[_a]=null,_a--)}function Mt(o,l){_a++,yd[_a]=o.current,o.current=l}var Ko={},Hn=hr(Ko),mr=hr(!1),or=Ko;function Ia(o,l){var p=o.type.contextTypes;if(!p)return Ko;var v=o.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var w={},C;for(C in p)w[C]=l[C];return v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function gr(o){return o=o.childContextTypes,o!=null}function fc(){zt(mr),zt(Hn)}function hm(o,l,p){if(Hn.current!==Ko)throw Error(n(168));Mt(Hn,l),Mt(mr,p)}function mm(o,l,p){var v=o.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return p;v=v.getChildContext();for(var w in v)if(!(w in l))throw Error(n(108,Fe(o)||"Unknown",w));return D({},p,v)}function Wr(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ko,or=Hn.current,Mt(Hn,o),Mt(mr,mr.current),!0}function gm(o,l,p){var v=o.stateNode;if(!v)throw Error(n(169));p?(o=mm(o,l,or),v.__reactInternalMemoizedMergedChildContext=o,zt(mr),zt(Hn),Mt(Hn,o)):zt(mr),Mt(mr,p)}var fo=null,dc=!1,bd=!1;function vm(o){fo===null?fo=[o]:fo.push(o)}function _s(o){dc=!0,vm(o)}function Wo(){if(!bd&&fo!==null){bd=!0;var o=0,l=Et;try{var p=fo;for(Et=1;o>=R,w-=R,zi=1<<32-mi(l)+w|p<Je?(An=We,We=null):An=We.sibling;var kt=be(ue,We,ce[Je],Ee);if(kt===null){We===null&&(We=An);break}o&&We&&kt.alternate===null&&l(ue,We),ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt,We=An}if(Je===ce.length)return p(ue,We),jt&&$s(ue,Je),Ve;if(We===null){for(;JeJe?(An=We,We=null):An=We.sibling;var rs=be(ue,We,kt.value,Ee);if(rs===null){We===null&&(We=An);break}o&&We&&rs.alternate===null&&l(ue,We),ne=C(rs,ne,Je),Ge===null?Ve=rs:Ge.sibling=rs,Ge=rs,We=An}if(kt.done)return p(ue,We),jt&&$s(ue,Je),Ve;if(We===null){for(;!kt.done;Je++,kt=ce.next())kt=ke(ue,kt.value,Ee),kt!==null&&(ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt);return jt&&$s(ue,Je),Ve}for(We=v(ue,We);!kt.done;Je++,kt=ce.next())kt=Le(We,ue,Je,kt.value,Ee),kt!==null&&(o&&kt.alternate!==null&&We.delete(kt.key===null?Je:kt.key),ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt);return o&&We.forEach(function(Ty){return l(ue,Ty)}),jt&&$s(ue,Je),Ve}function cn(ue,ne,ce,Ee){if(typeof ce=="object"&&ce!==null&&ce.type===Y&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case j:e:{for(var Ve=ce.key,Ge=ne;Ge!==null;){if(Ge.key===Ve){if(Ve=ce.type,Ve===Y){if(Ge.tag===7){p(ue,Ge.sibling),ne=w(Ge,ce.props.children),ne.return=ue,ue=ne;break e}}else if(Ge.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===J&&wm(Ve)===Ge.type){p(ue,Ge.sibling),ne=w(Ge,ce.props),ne.ref=Dl(ue,Ge,ce),ne.return=ue,ue=ne;break e}p(ue,Ge);break}else l(ue,Ge);Ge=Ge.sibling}ce.type===Y?(ne=Us(ce.props.children,ue.mode,Ee,ce.key),ne.return=ue,ue=ne):(Ee=Xc(ce.type,ce.key,ce.props,null,ue.mode,Ee),Ee.ref=Dl(ue,ne,ce),Ee.return=ue,ue=Ee)}return R(ue);case $:e:{for(Ge=ce.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){p(ue,ne.sibling),ne=w(ne,ce.children||[]),ne.return=ue,ue=ne;break e}else{p(ue,ne);break}else l(ue,ne);ne=ne.sibling}ne=lp(ce,ue.mode,Ee),ne.return=ue,ue=ne}return R(ue);case J:return Ge=ce._init,cn(ue,ne,Ge(ce._payload),Ee)}if(an(ce))return De(ue,ne,ce,Ee);if(ae(ce))return Oe(ue,ne,ce,Ee);Rs(ue,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,ne!==null&&ne.tag===6?(p(ue,ne.sibling),ne=w(ne,ce),ne.return=ue,ue=ne):(p(ue,ne),ne=ap(ce,ue.mode,Ee),ne.return=ue,ue=ne),R(ue)):p(ue,ne)}return cn}var on=wd(!0),gc=wd(!1),Nl=hr(null),Ar=null,Ho=null,Aa=null;function ho(){Aa=Ho=Ar=null}function vc(o){var l=Nl.current;zt(Nl),o._currentValue=l}function Nn(o,l,p){for(;o!==null;){var v=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),o===p)break;o=o.return}}function Go(o,l){Ar=o,Aa=Ho=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(ar=!0),o.firstContext=null)}function qr(o){var l=o._currentValue;if(Aa!==o)if(o={context:o,memoizedValue:l,next:null},Ho===null){if(Ar===null)throw Error(n(308));Ho=o,Ar.dependencies={lanes:0,firstContext:o}}else Ho=Ho.next=o;return l}var Ls=null;function Sd(o){Ls===null?Ls=[o]:Ls.push(o)}function yc(o,l,p,v){var w=l.interleaved;return w===null?(p.next=p,Sd(l)):(p.next=w.next,w.next=p),l.interleaved=p,mo(o,v)}function mo(o,l){o.lanes|=l;var p=o.alternate;for(p!==null&&(p.lanes|=l),p=o,o=o.return;o!==null;)o.childLanes|=l,p=o.alternate,p!==null&&(p.childLanes|=l),p=o,o=o.return;return p.tag===3?p.stateNode:null}var Yr=!1;function bc(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sm(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function go(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Xr(o,l,p){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(bt&2)!==0){var w=v.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),v.pending=l,mo(o,p)}return w=v.interleaved,w===null?(l.next=l,Sd(v)):(l.next=w.next,w.next=l),v.interleaved=l,mo(o,p)}function xc(o,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194240)!==0)){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,yl(o,p)}}function km(o,l){var p=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var w=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var R={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};C===null?w=C=R:C=C.next=R,p=p.next}while(p!==null);C===null?w=C=l:C=C.next=l}else w=C=l;p={baseState:v.baseState,firstBaseUpdate:w,lastBaseUpdate:C,shared:v.shared,effects:v.effects},o.updateQueue=p;return}o=p.lastBaseUpdate,o===null?p.firstBaseUpdate=l:o.next=l,p.lastBaseUpdate=l}function Ra(o,l,p,v){var w=o.updateQueue;Yr=!1;var C=w.firstBaseUpdate,R=w.lastBaseUpdate,K=w.shared.pending;if(K!==null){w.shared.pending=null;var Q=K,de=Q.next;Q.next=null,R===null?C=de:R.next=de,R=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,K=xe.lastBaseUpdate,K!==R&&(K===null?xe.firstBaseUpdate=de:K.next=de,xe.lastBaseUpdate=Q))}if(C!==null){var ke=w.baseState;R=0,xe=de=Q=null,K=C;do{var be=K.lane,Le=K.eventTime;if((v&be)===be){xe!==null&&(xe=xe.next={eventTime:Le,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var De=o,Oe=K;switch(be=l,Le=p,Oe.tag){case 1:if(De=Oe.payload,typeof De=="function"){ke=De.call(Le,ke,be);break e}ke=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Oe.payload,be=typeof De=="function"?De.call(Le,ke,be):De,be==null)break e;ke=D({},ke,be);break e;case 2:Yr=!0}}K.callback!==null&&K.lane!==0&&(o.flags|=64,be=w.effects,be===null?w.effects=[K]:be.push(K))}else Le={eventTime:Le,lane:be,tag:K.tag,payload:K.payload,callback:K.callback,next:null},xe===null?(de=xe=Le,Q=ke):xe=xe.next=Le,R|=be;if(K=K.next,K===null){if(K=w.shared.pending,K===null)break;be=K,K=be.next,be.next=null,w.lastBaseUpdate=be,w.shared.pending=null}}while(!0);if(xe===null&&(Q=ke),w.baseState=Q,w.firstBaseUpdate=de,w.lastBaseUpdate=xe,l=w.shared.interleaved,l!==null){w=l;do R|=w.lane,w=w.next;while(w!==l)}else C===null&&(w.shared.lanes=0);Jo|=R,o.lanes=R,o.memoizedState=ke}}function kd(o,l,p){if(o=l.effects,l.effects=null,o!==null)for(l=0;lp?p:4,o(!0);var v=Td.transition;Td.transition={};try{o(!1),l()}finally{Et=p,Td.transition=v}}function Dd(){return Qr().memoizedState}function ay(o,l,p){var v=ts(o);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},Nd(o))sr(l,p);else if(p=yc(o,l,p,v),p!==null){var w=cr();ki(p,o,v,w),yi(p,l,v)}}function Im(o,l,p){var v=ts(o),w={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(Nd(o))sr(l,w);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var R=l.lastRenderedState,K=C(R,p);if(w.hasEagerState=!0,w.eagerState=K,fe(K,R)){var Q=l.interleaved;Q===null?(w.next=w,Sd(l)):(w.next=Q.next,Q.next=w),l.interleaved=w;return}}catch{}p=yc(o,l,w,v),p!==null&&(w=cr(),ki(p,o,v,w),yi(p,l,v))}}function Nd(o){var l=o.alternate;return o===en||l!==null&&l===en}function sr(o,l){jl=Ma=!0;var p=o.pending;p===null?l.next=l:(l.next=p.next,p.next=l),o.pending=l}function yi(o,l,p){if((p&4194240)!==0){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,yl(o,p)}}var _c={readContext:qr,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},ly={readContext:qr,useCallback:function(o,l){return Wi().memoizedState=[o,l===void 0?null:l],o},useContext:qr,useEffect:Tc,useImperativeHandle:function(o,l,p){return p=p!=null?p.concat([o]):null,Vl(4194308,4,Ld.bind(null,l,o),p)},useLayoutEffect:function(o,l){return Vl(4194308,4,o,l)},useInsertionEffect:function(o,l){return Vl(4,2,o,l)},useMemo:function(o,l){var p=Wi();return l=l===void 0?null:l,o=o(),p.memoizedState=[o,l],o},useReducer:function(o,l,p){var v=Wi();return l=p!==void 0?p(l):l,v.memoizedState=v.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},v.queue=o,o=o.dispatch=ay.bind(null,en,o),[v.memoizedState,o]},useRef:function(o){var l=Wi();return o={current:o},l.memoizedState=o},useState:Bl,useDebugValue:Ul,useDeferredValue:function(o){return Wi().memoizedState=o},useTransition:function(){var o=Bl(!1),l=o[0];return o=_m.bind(null,o[1]),Wi().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,p){var v=en,w=Wi();if(jt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=l(),$n===null)throw Error(n(349));(Yo&30)!==0||Ad(v,l,p)}w.memoizedState=p;var C={value:p,getSnapshot:l};return w.queue=C,Tc(yo.bind(null,v,C,o),[o]),v.flags|=2048,Na(9,yr.bind(null,v,C,p,l),void 0,null),p},useId:function(){var o=Wi(),l=$n.identifierPrefix;if(jt){var p=ji,v=zi;p=(v&~(1<<32-mi(v)-1)).toString(32)+p,l=":"+l+"R"+p,p=Ds++,0<\/script>",o=o.removeChild(o.firstChild)):typeof v.is=="string"?o=R.createElement(p,{is:v.is}):(o=R.createElement(p),p==="select"&&(R=o,v.multiple?R.multiple=!0:v.size&&(R.size=v.size))):o=R.createElementNS(o,p),o[Oi]=l,o[Uo]=v,Fn(o,l,!1,!1),l.stateNode=o;e:{switch(R=nr(p,v),p){case"dialog":Ft("cancel",o),Ft("close",o),w=v;break;case"iframe":case"object":case"embed":Ft("load",o),w=v;break;case"video":case"audio":for(w=0;wzs&&(l.flags|=128,v=!0,Xl(C,!1),l.lanes=4194304)}else{if(!v)if(o=Ms(R),o!==null){if(l.flags|=128,v=!0,p=o.updateQueue,p!==null&&(l.updateQueue=p,l.flags|=4),Xl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!R.alternate&&!jt)return zn(l),null}else 2*Ht()-C.renderingStartTime>zs&&p!==1073741824&&(l.flags|=128,v=!0,Xl(C,!1),l.lanes=4194304);C.isBackwards?(R.sibling=l.child,l.child=R):(p=C.last,p!==null?p.sibling=R:l.child=R,C.last=R)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Ht(),l.sibling=null,p=qt.current,Mt(qt,v?p&1|2:p&1),l):(zn(l),null);case 22:case 23:return op(),v=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==v&&(l.flags|=8192),v&&(l.mode&1)!==0?(Lr&1073741824)!==0&&(zn(l),l.subtreeFlags&6&&(l.flags|=8192)):zn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function cy(o,l){switch(As(l),l.tag){case 1:return gr(l.type)&&fc(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return qo(),zt(mr),zt(Hn),Sc(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return wc(l),null;case 13:if(zt(qt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Vi()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return zt(qt),null;case 4:return qo(),null;case 10:return vc(l.type._context),null;case 22:case 23:return op(),null;case 24:return null;default:return null}}var Oc=!1,Yt=!1,lr=typeof WeakSet=="function"?WeakSet:Set,Me=null;function Va(o,l){var p=o.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){tn(o,l,v)}else p.current=null}function Ql(o,l,p){try{p()}catch(v){tn(o,l,v)}}var Nm=!1;function fy(o,l){if($l=Uu,o=$t(),kl(o)){if("selectionStart"in o)var p={start:o.selectionStart,end:o.selectionEnd};else e:{p=(p=o.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var w=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var R=0,K=-1,Q=-1,de=0,xe=0,ke=o,be=null;t:for(;;){for(var Le;ke!==p||w!==0&&ke.nodeType!==3||(K=R+w),ke!==C||v!==0&&ke.nodeType!==3||(Q=R+v),ke.nodeType===3&&(R+=ke.nodeValue.length),(Le=ke.firstChild)!==null;)be=ke,ke=Le;for(;;){if(ke===o)break t;if(be===p&&++de===w&&(K=R),be===C&&++xe===v&&(Q=R),(Le=ke.nextSibling)!==null)break;ke=be,be=ke.parentNode}ke=Le}p=K===-1||Q===-1?null:{start:K,end:Q}}else p=null}p=p||{start:0,end:0}}else p=null;for(Ts={focusedElem:o,selectionRange:p},Uu=!1,Me=l;Me!==null;)if(l=Me,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Me=o;else for(;Me!==null;){l=Me;try{var De=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Oe=De.memoizedProps,cn=De.memoizedState,ue=l.stateNode,ne=ue.getSnapshotBeforeUpdate(l.elementType===l.type?Oe:Jr(l.type,Oe),cn);ue.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var ce=l.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){tn(l,l.return,Ee)}if(o=l.sibling,o!==null){o.return=l.return,Me=o;break}Me=l.return}return De=Nm,Nm=!1,De}function wo(o,l,p){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var w=v=v.next;do{if((w.tag&o)===o){var C=w.destroy;w.destroy=void 0,C!==void 0&&Ql(l,p,C)}w=w.next}while(w!==v)}}function Jl(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&o)===o){var v=p.create;p.destroy=v()}p=p.next}while(p!==l)}}function Fc(o){var l=o.ref;if(l!==null){var p=o.stateNode;o.tag,o=p,typeof l=="function"?l(o):l.current=o}}function Om(o){var l=o.alternate;l!==null&&(o.alternate=null,Om(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Oi],delete l[Uo],delete l[uc],delete l[N],delete l[Ta])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Fm(o){return o.tag===5||o.tag===3||o.tag===4}function zm(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Fm(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function qd(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.nodeType===8?p.parentNode.insertBefore(o,l):p.insertBefore(o,l):(p.nodeType===8?(l=p.parentNode,l.insertBefore(o,p)):(l=p,l.appendChild(o)),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=ac));else if(v!==4&&(o=o.child,o!==null))for(qd(o,l,p),o=o.sibling;o!==null;)qd(o,l,p),o=o.sibling}function zc(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.insertBefore(o,l):p.appendChild(o);else if(v!==4&&(o=o.child,o!==null))for(zc(o,l,p),o=o.sibling;o!==null;)zc(o,l,p),o=o.sibling}var In=null,xi=!1;function Yi(o,l,p){for(p=p.child;p!==null;)Yd(o,l,p),p=p.sibling}function Yd(o,l,p){if(Mi&&typeof Mi.onCommitFiberUnmount=="function")try{Mi.onCommitFiberUnmount(Ou,p)}catch{}switch(p.tag){case 5:Yt||Va(p,l);case 6:var v=In,w=xi;In=null,Yi(o,l,p),In=v,xi=w,In!==null&&(xi?(o=In,p=p.stateNode,o.nodeType===8?o.parentNode.removeChild(p):o.removeChild(p)):In.removeChild(p.stateNode));break;case 18:In!==null&&(xi?(o=In,p=p.stateNode,o.nodeType===8?vd(o.parentNode,p):o.nodeType===1&&vd(o,p),Tt(o)):vd(In,p.stateNode));break;case 4:v=In,w=xi,In=p.stateNode.containerInfo,xi=!0,Yi(o,l,p),In=v,xi=w;break;case 0:case 11:case 14:case 15:if(!Yt&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){w=v=v.next;do{var C=w,R=C.destroy;C=C.tag,R!==void 0&&((C&2)!==0||(C&4)!==0)&&Ql(p,l,R),w=w.next}while(w!==v)}Yi(o,l,p);break;case 1:if(!Yt&&(Va(p,l),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(K){tn(p,l,K)}Yi(o,l,p);break;case 21:Yi(o,l,p);break;case 22:p.mode&1?(Yt=(v=Yt)||p.memoizedState!==null,Yi(o,l,p),Yt=v):Yi(o,l,p);break;default:Yi(o,l,p)}}function Ua(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var p=o.stateNode;p===null&&(p=o.stateNode=new lr),l.forEach(function(v){var w=yy.bind(null,o,v);p.has(v)||(p.add(v),v.then(w,w))})}}function Rr(o,l){var p=l.deletions;if(p!==null)for(var v=0;vw&&(w=R),v&=~C}if(v=w,v=Ht()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Bm(v/1960))-v,10o?16:o,es===null)var v=!1;else{if(o=es,es=null,ur=0,(bt&6)!==0)throw Error(n(331));var w=bt;for(bt|=4,Me=o.current;Me!==null;){var C=Me,R=C.child;if((Me.flags&16)!==0){var K=C.deletions;if(K!==null){for(var Q=0;QHt()-Zd?Bs(o,0):Vc|=p),xr(o,l)}function Gm(o,l){l===0&&((o.mode&1)===0?l=1:(l=Fu,Fu<<=1,(Fu&130023424)===0&&(Fu=4194304)));var p=cr();o=mo(o,l),o!==null&&(vl(o,l,p),xr(o,p))}function vy(o){var l=o.memoizedState,p=0;l!==null&&(p=l.retryLane),Gm(o,p)}function yy(o,l){var p=0;switch(o.tag){case 13:var v=o.stateNode,w=o.memoizedState;w!==null&&(p=w.retryLane);break;case 19:v=o.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),Gm(o,p)}var qm;qm=function(o,l,p){if(o!==null)if(o.memoizedProps!==l.pendingProps||mr.current)ar=!0;else{if((o.lanes&p)===0&&(l.flags&128)===0)return ar=!1,Mm(o,l,p);ar=(o.flags&131072)!==0}else ar=!1,jt&&(l.flags&1048576)!==0&&ym(l,hc,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;Nc(o,l),o=l.pendingProps;var w=Ia(l,Hn.current);Go(l,p),w=Ns(null,l,v,o,w,p);var C=kc();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,gr(v)?(C=!0,Wr(l)):C=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,bc(l),w.updater=Ac,l.stateNode=w,w._reactInternals=l,Fd(l,v,o,p),l=Wd(null,l,v,!0,C,p)):(l.tag=0,jt&&C&&Ll(l),On(null,l,w,p),l=l.child),l;case 16:v=l.elementType;e:{switch(Nc(o,l),o=l.pendingProps,w=v._init,v=w(v._payload),l.type=v,w=l.tag=xy(v),o=Jr(v,o),w){case 0:l=Ud(null,l,v,o,p);break e;case 1:l=Kd(null,l,v,o,p);break e;case 11:l=Rm(null,l,v,o,p);break e;case 14:l=jd(null,l,v,Jr(v.type,o),p);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Ud(o,l,v,w,p);case 1:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Kd(o,l,v,w,p);case 3:e:{if(Lm(l),o===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,w=C.element,Sm(o,l),Ra(l,v,null,p);var R=l.memoizedState;if(v=R.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){w=Fs(Error(n(423)),l),l=qi(o,l,v,p,w);break e}else if(v!==w){w=Fs(Error(n(424)),l),l=qi(o,l,v,p,w);break e}else for($r=Vo(l.stateNode.containerInfo.firstChild),qn=l,jt=!0,vi=null,p=gc(l,null,v,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Vi(),v===w){l=bi(o,l,p);break e}On(o,l,v,p)}l=l.child}return l;case 5:return Ed(l),o===null&&vr(l),v=l.type,w=l.pendingProps,C=o!==null?o.memoizedProps:null,R=w.children,Al(v,w)?R=null:C!==null&&Al(v,C)&&(l.flags|=32),Vd(o,l),On(o,l,R,p),l.child;case 6:return o===null&&vr(l),null;case 13:return Dc(o,l,p);case 4:return Cd(l,l.stateNode.containerInfo),v=l.pendingProps,o===null?l.child=on(l,null,v,p):On(o,l,v,p),l.child;case 11:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Rm(o,l,v,w,p);case 7:return On(o,l,l.pendingProps,p),l.child;case 8:return On(o,l,l.pendingProps.children,p),l.child;case 12:return On(o,l,l.pendingProps.children,p),l.child;case 10:e:{if(v=l.type._context,w=l.pendingProps,C=l.memoizedProps,R=w.value,Mt(Nl,v._currentValue),v._currentValue=R,C!==null)if(fe(C.value,R)){if(C.children===w.children&&!mr.current){l=bi(o,l,p);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var K=C.dependencies;if(K!==null){R=C.child;for(var Q=K.firstContext;Q!==null;){if(Q.context===v){if(C.tag===1){Q=go(-1,p&-p),Q.tag=2;var de=C.updateQueue;if(de!==null){de=de.shared;var xe=de.pending;xe===null?Q.next=Q:(Q.next=xe.next,xe.next=Q),de.pending=Q}}C.lanes|=p,Q=C.alternate,Q!==null&&(Q.lanes|=p),Nn(C.return,p,l),K.lanes|=p;break}Q=Q.next}}else if(C.tag===10)R=C.type===l.type?null:C.child;else if(C.tag===18){if(R=C.return,R===null)throw Error(n(341));R.lanes|=p,K=R.alternate,K!==null&&(K.lanes|=p),Nn(R,p,l),R=C.sibling}else R=C.child;if(R!==null)R.return=C;else for(R=C;R!==null;){if(R===l){R=null;break}if(C=R.sibling,C!==null){C.return=R.return,R=C;break}R=R.return}C=R}On(o,l,w.children,p),l=l.child}return l;case 9:return w=l.type,v=l.pendingProps.children,Go(l,p),w=qr(w),v=v(w),l.flags|=1,On(o,l,v,p),l.child;case 14:return v=l.type,w=Jr(v,l.pendingProps),w=Jr(v.type,w),jd(o,l,v,w,p);case 15:return Gi(o,l,l.type,l.pendingProps,p);case 17:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Nc(o,l),l.tag=1,gr(v)?(o=!0,Wr(l)):o=!1,Go(l,p),Os(l,v,w),Fd(l,v,w,p),Wd(null,l,v,!0,o,p);case 19:return Xo(o,l,p);case 22:return Bd(o,l,p)}throw Error(n(156,l.tag))};function Ym(o,l){return Lh(o,l)}function by(o,l,p,v){this.tag=o,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(o,l,p,v){return new by(o,l,p,v)}function Yc(o){return o=o.prototype,!(!o||!o.isReactComponent)}function xy(o){if(typeof o=="function")return Yc(o)?1:0;if(o!=null){if(o=o.$$typeof,o===G)return 11;if(o===le)return 14}return 2}function Ci(o,l){var p=o.alternate;return p===null?(p=ei(o.tag,l,o.key,o.mode),p.elementType=o.elementType,p.type=o.type,p.stateNode=o.stateNode,p.alternate=o,o.alternate=p):(p.pendingProps=l,p.type=o.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=o.flags&14680064,p.childLanes=o.childLanes,p.lanes=o.lanes,p.child=o.child,p.memoizedProps=o.memoizedProps,p.memoizedState=o.memoizedState,p.updateQueue=o.updateQueue,l=o.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=o.sibling,p.index=o.index,p.ref=o.ref,p}function Xc(o,l,p,v,w,C){var R=2;if(v=o,typeof o=="function")Yc(o)&&(R=1);else if(typeof o=="string")R=5;else e:switch(o){case Y:return Us(p.children,w,C,l);case te:R=8,w|=8;break;case ie:return o=ei(12,p,l,w|2),o.elementType=ie,o.lanes=C,o;case ee:return o=ei(13,p,l,w),o.elementType=ee,o.lanes=C,o;case H:return o=ei(19,p,l,w),o.elementType=H,o.lanes=C,o;case X:return Qc(p,w,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case B:R=10;break e;case W:R=9;break e;case G:R=11;break e;case le:R=14;break e;case J:R=16,v=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ei(R,p,l,w),l.elementType=o,l.type=v,l.lanes=C,l}function Us(o,l,p,v){return o=ei(7,o,v,l),o.lanes=p,o}function Qc(o,l,p,v){return o=ei(22,o,v,l),o.elementType=X,o.lanes=p,o.stateNode={isHidden:!1},o}function ap(o,l,p){return o=ei(6,o,null,l),o.lanes=p,o}function lp(o,l,p){return l=ei(4,o.children!==null?o.children:[],o.key,l),l.lanes=p,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function wy(o,l,p,v,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gl(0),this.expirationTimes=gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gl(0),this.identifierPrefix=v,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function up(o,l,p,v,w,C,R,K,Q){return o=new wy(o,l,p,K,Q),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ei(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},bc(C),o}function Sy(o,l,p){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=fL(),By.exports}var p1;function dL(){if(p1)return og;p1=1;var e=mE();return og.createRoot=e.createRoot,og.hydrateRoot=e.hydrateRoot,og}var pL=dL();function pv(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function s(){var a;const c=S.useContext(i);if(!c&&t){const d=new Error(n);throw d.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,d,s),d}return c}return[i.Provider,s,i]}function hL(e){return{UNSAFE_getDOMNode(){return e.current}}}function $i(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current),t}function ox(e){return Array.isArray(e)}function mL(e){return ox(e)&&e.length===0}function sx(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!ox(e)}function gL(e){return sx(e)&&Object.keys(e).length===0}function vL(e){return ox(e)?mL(e):sx(e)?gL(e):e==null||e===""}function yL(e){return typeof e=="function"}var Ae=e=>e?"true":void 0;function gE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tsx(e)?e instanceof Array?[...e]:e[t]:e,vE=(...e)=>{let t=" ";for(const n of e)if(typeof n=="string"&&n.length>0){t=n;break}return t},bL=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"";function h1(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function xL(e){return`${e}-${Math.floor(Math.random()*1e6)}`}function WG(e){for(const t in e)t.startsWith("on")&&delete e[t];return e}function ds(e){if(!e||typeof e!="object")return"";try{return JSON.stringify(e)}catch{return""}}function wL(e,t,n){return Math.min(Math.max(e,t),n)}function SL(e,t=100){return Math.min(Math.max(e,0),t)}var m1={};function kL(e,t,...n){const i=`[Hero UI] : ${e}`;typeof console>"u"||m1[i]||(m1[i]=!0)}function tl(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}var g1=new Map;function CL(e,t){if(e===t)return e;let n=g1.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=g1.get(t);return r?(r.forEach(i=>i.current=e),e):t}function nn(...e){let t={...e[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?t[i]=tl(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=Bt(s,a):i==="id"&&s&&a?t.id=CL(s,a):t[i]=a!==void 0?a:s}}return t}function yE(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const r=e.map(i=>{const s=v1(i,t);return n||(n=typeof s=="function"),s});if(n)return()=>{r.forEach((i,s)=>{typeof i=="function"?i?.():v1(e[s],null)})}}}function v1(e,t){if(typeof e=="function")return()=>e(t);e!=null&&"current"in e&&(e.current=t)}function EL(e,t){if(e!=null){if(yL(e)){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function bE(...e){return t=>{e.forEach(n=>EL(n,t))}}function PL(){const e=()=>()=>{};return S.useSyncExternalStore(e,()=>!0,()=>!1)}var TL=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),_L=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]),y1=/^(data-.*)$/,IL=/^(aria-.*)$/,sg=/^(on[A-Z].*)$/;function Ef(e,t={}){let{labelable:n=!0,enabled:r=!0,propNames:i,omitPropNames:s,omitEventNames:a,omitDataProps:c,omitEventProps:d}=t,h={};if(!r)return e;for(const m in e)s?.has(m)||a?.has(m)&&sg.test(m)||sg.test(m)&&!_L.has(m)||c&&y1.test(m)||d&&sg.test(m)||(Object.prototype.hasOwnProperty.call(e,m)&&(TL.has(m)||n&&IL.test(m)||i?.has(m)||y1.test(m))||sg.test(m))&&(h[m]=e[m]);return h}var[$L,ci]=pv({name:"ProviderContext",strict:!1});const AL=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),RL=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function xE(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return AL.has(n.script)}let t=e.split("-")[0];return RL.has(t)}const wE={prefix:String(Math.round(Math.random()*1e10)),current:0},SE=He.createContext(wE),LL=He.createContext(!1);let Ky=new WeakMap;function ML(e=!1){let t=S.useContext(SE),n=S.useRef(null);if(n.current===null&&!e){var r,i;let s=(i=He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(s){let a=Ky.get(s);a==null?Ky.set(s,{id:t.current,state:s.memoizedState}):s.memoizedState!==a.state&&(t.current=a.id,Ky.delete(s))}n.current=++t.current}return n.current}function DL(e){let t=S.useContext(SE),n=ML(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function NL(e){let t=He.useId(),[n]=S.useState(ph()),r=n?"react-aria":`react-aria${wE.prefix}`;return e||`${r}-${t}`}const OL=typeof He.useId=="function"?NL:DL;function FL(){return!1}function zL(){return!0}function jL(e){return()=>{}}function ph(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(jL,FL,zL):S.useContext(LL)}const BL=Symbol.for("react-aria.i18n.locale");function kE(){let e=typeof window<"u"&&window[BL]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:xE(e)?"rtl":"ltr"}}let K0=kE(),_p=new Set;function b1(){K0=kE();for(let e of _p)e(K0)}function CE(){let e=ph(),[t,n]=S.useState(K0);return S.useEffect(()=>(_p.size===0&&window.addEventListener("languagechange",b1),_p.add(n),()=>{_p.delete(n),_p.size===0&&window.removeEventListener("languagechange",b1)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const EE=He.createContext(null);function VL(e){let{locale:t,children:n}=e,r=CE(),i=He.useMemo(()=>t?{locale:t,direction:xE(t)?"rtl":"ltr"}:r,[r,t]);return He.createElement(EE.Provider,{value:i},n)}function hh(){let e=CE();return S.useContext(EE)||e}const UL=Symbol.for("react-aria.i18n.locale"),KL=Symbol.for("react-aria.i18n.strings");let sf;class hv{getStringForLocale(t,n){let i=this.getStringsForLocale(n)[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}getStringsForLocale(t){let n=this.strings[t];return n||(n=WL(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[UL];if(sf===void 0){let i=window[KL];if(!i)return null;sf={};for(let s in i)sf[s]=new hv({[n]:i[s]},n)}let r=sf?.[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function WL(e,t,n="en-US"){if(t[e])return t[e];let r=HL(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function HL(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const x1=new Map,w1=new Map;class GL{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let i=n["="+t];if(i)return typeof i=="function"?i():i;let s=this.locale+":"+r,a=x1.get(s);a||(a=new Intl.PluralRules(this.locale,{type:r}),x1.set(s,a));let c=a.select(t);return i=n[c]||n.other,typeof i=="function"?i():i}number(t){let n=w1.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),w1.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const S1=new WeakMap;function qL(e){let t=S1.get(e);return t||(t=new hv(e),S1.set(e,t)),t}function YL(e,t){return t&&hv.getGlobalDictionaryForPackage(t)||qL(e)}function XL(e,t){let{locale:n}=hh(),r=YL(e,t);return S.useMemo(()=>new GL(n,r),[n,r])}function QL(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JL(e,t,n){QL(e,t),t.set(e,n)}const sn=typeof document<"u"?He.useLayoutEffect:()=>{};function Bn(e){const t=S.useRef(null);return sn(()=>{t.current=e},[e]),S.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function ZL(e){let[t,n]=S.useState(e),r=S.useRef(null),i=Bn(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}t===a.value?i():n(a.value)});sn(()=>{r.current&&i()});let s=Bn(a=>{r.current=a(t),i()});return[t,s]}let eM=!!(typeof window<"u"&&window.document&&window.document.createElement),xf=new Map,Ip;typeof FinalizationRegistry<"u"&&(Ip=new FinalizationRegistry(e=>{xf.delete(e)}));function Pf(e){let[t,n]=S.useState(e),r=S.useRef(null),i=OL(t),s=S.useRef(null);if(Ip&&Ip.register(s,i),eM){const a=xf.get(i);a&&!a.includes(r)?a.push(r):xf.set(i,[r])}return sn(()=>{let a=i;return()=>{Ip&&Ip.unregister(s),xf.delete(a)}},[i]),S.useEffect(()=>{let a=r.current;return a&&n(a),()=>{a&&(r.current=null)}}),i}function tM(e,t){if(e===t)return e;let n=xf.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=xf.get(t);return r?(r.forEach(i=>i.current=e),e):t}function W0(e=[]){let t=Pf(),[n,r]=ZL(t),i=S.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return sn(i,[t,i,...e]),n}function Tf(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Dt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},no=e=>e&&"window"in e&&e.window===e?e:Dt(e).defaultView||window;function nM(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function rM(e){return nM(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let iM=!1,oM=!1;function HG(){return iM}function mv(){return oM}function ai(e,t){if(!mv())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:rM(n)?n=n.host:n=n.parentNode}return!1}const zr=(e=document)=>{var t;if(!mv())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function En(e){return mv()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class sM{get currentNode(){return this._currentNode}set currentNode(t){if(!ai(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,i=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const a=r,c=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});n.push(c),c.currentNode=i,this._currentSetFor.add(c),r=i=a.host}else r=r.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=i,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ai(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let i;if(typeof this.filter=="function"?i=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(i=this.filter.acceptNode(t)),i===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let s=this.nextNode();return s&&(this.currentNode=s),s}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(n)),s===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let a=this.lastChild();return a&&(this.currentNode=a),a}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,n,r,i){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=a=>{if(a.nodeType===Node.ELEMENT_NODE){const d=a.shadowRoot;if(d){const h=this._doc.createTreeWalker(d,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(h),NodeFilter.FILTER_ACCEPT}else{var c;if(typeof this.filter=="function")return this.filter(a);if(!((c=this.filter)===null||c===void 0)&&c.acceptNode)return this.filter.acceptNode(a);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=i??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const s=n.shadowRoot;if(s){const a=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(a)}}}function aM(e,t,n,r){return mv()?new sM(e,t,n,r):e.createTreeWalker(t,n,r)}function PE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t=65&&i.charCodeAt(2)<=90?t[i]=Tf(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=lM(s,a):i==="id"&&s&&a?t.id=tM(s,a):t[i]=a!==void 0?a:s}}return t}const uM=new Set(["id"]),cM=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),fM=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),dM=/^(data-.*)$/;function Au(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,s={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(uM.has(a)||n&&cM.has(a)||r&&fM.has(a)||i?.has(a)||dM.test(a))&&(s[a]=e[a]);return s}function nl(e){if(pM())e.focus({preventScroll:!0});else{let t=hM(e);e.focus(),mM(t)}}let ag=null;function pM(){if(ag==null){ag=!1;try{document.createElement("div").focus({get preventScroll(){return ag=!0,!0}})}catch{}}return ag}function hM(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function ax(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ia(e){let t=null;return()=>(t==null&&(t=e()),t)}const Su=ia(function(){return ax(/^Mac/i)}),gM=ia(function(){return ax(/^iPhone/i)}),TE=ia(function(){return ax(/^iPad/i)||Su()&&navigator.maxTouchPoints>1}),vv=ia(function(){return gM()||TE()}),vM=ia(function(){return Su()||vv()}),_E=ia(function(){return gv(/AppleWebKit/i)&&!IE()}),IE=ia(function(){return gv(/Chrome/i)}),lx=ia(function(){return gv(/Android/i)}),yM=ia(function(){return gv(/Firefox/i)}),$E=S.createContext({isNative:!0,open:wM,useHref:e=>e});function bM(e){let{children:t,navigate:n,useHref:r}=e,i=S.useMemo(()=>({isNative:!1,open:(s,a,c,d)=>{AE(s,h=>{xM(h,a)?n(c,d):ku(h,a)})},useHref:r||(s=>s)}),[n,r]);return He.createElement($E.Provider,{value:i},t)}function ux(){return S.useContext($E)}function xM(e,t){let n=e.getAttribute("target");return(!n||n==="_self")&&e.origin===location.origin&&!e.hasAttribute("download")&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function ku(e,t,n=!0){var r,i;let{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}=t;yM()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Su()?s=!0:a=!0);let h=_E()&&Su()&&!TE()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}):new MouseEvent("click",{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d,bubbles:!0,cancelable:!0});ku.isOpening=n,nl(e),e.dispatchEvent(h),ku.isOpening=!1}ku.isOpening=!1;function AE(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function wM(e,t){AE(e,n=>ku(n,t))}function GG(e){let t=ux();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function qG(e){let t=ux();var n;const r=t.useHref((n=e?.href)!==null&&n!==void 0?n:"");return{href:e?.href?r:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}let Xa=new Map,H0=new Set;function k1(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=Xa.get(r.target);i||(i=new Set,Xa.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=Xa.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),Xa.delete(r.target)),Xa.size===0)){for(let s of H0)s();H0.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?k1():document.addEventListener("DOMContentLoaded",k1));function SM(){for(const[e]of Xa)"isConnected"in e&&!e.isConnected&&Xa.delete(e)}function RE(e){requestAnimationFrame(()=>{SM(),Xa.size===0?e():H0.add(e)})}function cx(){let e=S.useRef(new Map),t=S.useCallback((i,s,a,c)=>{let d=c?.once?(...h)=>{e.current.delete(a),a(...h)}:a;e.current.set(a,{type:s,eventTarget:i,fn:d,options:c}),i.addEventListener(s,d,c)},[]),n=S.useCallback((i,s,a,c)=>{var d;let h=((d=e.current.get(a))===null||d===void 0?void 0:d.fn)||a;i.removeEventListener(s,h,c),e.current.delete(a)},[]),r=S.useCallback(()=>{e.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return S.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function LE(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Pf(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function C1(e,t){const n=S.useRef(!0),r=S.useRef(null);sn(()=>(n.current=!0,()=>{n.current=!1}),[]),sn(()=>{n.current?n.current=!1:(!r.current||t.some((i,s)=>!Object.is(i,r[s])))&&e(),r.current=t},t)}function kM(){return typeof window.ResizeObserver<"u"}function E1(e){const{ref:t,box:n,onResize:r}=e;S.useEffect(()=>{let i=t?.current;if(i)if(kM()){const s=new window.ResizeObserver(a=>{a.length&&r()});return s.observe(i,{box:n}),()=>{i&&s.unobserve(i)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,t,n])}function ME(e,t){sn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function qp(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function DE(e,t){let n=e;for(qp(n,t)&&(n=n.parentElement);n&&!qp(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function CM(e,t){const n=[];for(;e&&e!==document.documentElement;)qp(e,t)&&n.push(e),e=e.parentElement;return n}function lg(e,t,n,r){let i=Bn(n),s=n==null;S.useEffect(()=>{if(s||!e.current)return;let a=e.current;return a.addEventListener(t,i,r),()=>{a.removeEventListener(t,i,r)}},[e,t,r,s,i])}function NE(e,t){let n=P1(e,t,"left"),r=P1(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight,a=e.scrollLeft,c=e.scrollTop,{borderTopWidth:d,borderLeftWidth:h,scrollPaddingTop:m,scrollPaddingRight:g,scrollPaddingBottom:b,scrollPaddingLeft:x}=getComputedStyle(e),k=a+parseInt(h,10),P=c+parseInt(d,10),T=k+e.clientWidth,_=P+e.clientHeight,A=parseInt(m,10)||0,M=parseInt(b,10)||0,F=parseInt(g,10)||0,j=parseInt(x,10)||0;n<=a+j?a=n-parseInt(h,10)-j:n+i>T-F&&(a+=n+i-T+F),r<=P+A?c=r-parseInt(d,10)-A:r+s>_-M&&(c+=r+s-_+M),e.scrollLeft=a,e.scrollTop=c}function P1(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function T1(e,t){if(e&&document.contains(e)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let d=CM(e);for(let h of d)NE(h,e)}else{var n;let{left:d,top:h}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:m,top:g}=e.getBoundingClientRect();if(Math.abs(d-m)>1||Math.abs(h-g)>1){var r,i,s;t==null||(i=t.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(s=e.scrollIntoView)===null||s===void 0||s.call(e,{block:"nearest"})}}}}function OE(e){return e.mozInputSource===0&&e.isTrusted?!0:lx()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function EM(e){return!lx()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function FE(e,t,n){let r=S.useRef(t),i=Bn(()=>{n&&n(r.current)});S.useEffect(()=>{var s;let a=e==null||(s=e.current)===null||s===void 0?void 0:s.form;return a?.addEventListener("reset",i),()=>{a?.removeEventListener("reset",i)}},[e,i])}const PM="react-aria-clear-focus",TM="react-aria-focus";function hp(e){return Su()?e.metaKey:e.ctrlKey}var zE=mE();const jE=dv(zE),fx=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],_M=fx.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";fx.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const IM=fx.join(':not([hidden]):not([tabindex="-1"]),');function BE(e){return e.matches(_M)}function $M(e){return e.matches(IM)}function Ru(e,t,n){let[r,i]=S.useState(e||t),s=S.useRef(e!==void 0),a=e!==void 0;S.useEffect(()=>{s.current,s.current=a},[a]);let c=a?e:r,d=S.useCallback((h,...m)=>{let g=(b,...x)=>{n&&(Object.is(c,b)||n(b,...x)),a||(c=b)};typeof h=="function"?i((x,...k)=>{let P=h(a?c:x,...k);return g(P,...m),a?x:P}):(a||i(h),g(h,...m))},[a,c,n]);return[c,d]}function Bg(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}let Wy=new Map,G0=!1;try{G0=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Vg=!1;try{Vg=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const VE={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class AM{format(t){let n="";if(!G0&&this.options.signDisplay!=null?n=LM(this.numberFormatter,this.options.signDisplay,t):n=this.numberFormatter.format(t),this.options.style==="unit"&&!Vg){var r;let{unit:i,unitDisplay:s="short",locale:a}=this.resolvedOptions();if(!i)return n;let c=(r=VE[i])===null||r===void 0?void 0:r[s];n+=c[a]||c.default}return n}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,n);if(n= start date");return`${this.format(t)} – ${this.format(n)}`}formatRangeToParts(t,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,n);if(n= start date");let r=this.numberFormatter.formatToParts(t),i=this.numberFormatter.formatToParts(n);return[...r.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!G0&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!Vg&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,n={}){this.numberFormatter=RM(t,n),this.options=n}}function RM(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),t.style==="unit"&&!Vg){var r;let{unit:a,unitDisplay:c="short"}=t;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=VE[a])===null||r===void 0)&&r[c]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${c}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((a,c)=>a[0]0||Object.is(n,0):t==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let i=e.format(-n),s=e.format(n),a=i.replace(s,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(s,"!!!").replace(a,"+").replace("!!!",s)}else return e.format(n)}}function MM(e={}){let{locale:t}=hh();return S.useMemo(()=>new AM(t,e),[t,e])}let Hy=new Map;function DM(e){let{locale:t}=hh(),n=t+(e?Object.entries(e).sort((i,s)=>i[0]-1&&e.splice(n,1)}const ta=(e,t,n)=>n>t?t:n{};const fs={},UE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function KE(e){return typeof e=="object"&&e!==null}const WE=e=>/^0[^.\s]+$/u.test(e);function vx(e){let t;return()=>(t===void 0&&(t=e()),t)}const ro=e=>e,NM=(e,t)=>n=>t(e(n)),gh=(...e)=>e.reduce(NM),Xp=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class yx{constructor(){this.subscriptions=[]}add(t){return hx(this.subscriptions,t),()=>mx(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;se*1e3,us=e=>e/1e3;function HE(e,t){return t?e*(1e3/t):0}const GE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,OM=1e-7,FM=12;function zM(e,t,n,r,i){let s,a,c=0;do a=t+(n-t)/2,s=GE(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>OM&&++czM(s,0,1,e,n);return s=>s===0||s===1?s:GE(i(s),t,r)}const qE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,YE=e=>t=>1-e(1-t),XE=vh(.33,1.53,.69,.99),bx=YE(XE),QE=qE(bx),JE=e=>(e*=2)<1?.5*bx(e):.5*(2-Math.pow(2,-10*(e-1))),xx=e=>1-Math.sin(Math.acos(e)),ZE=YE(xx),eP=qE(xx),jM=vh(.42,0,1,1),BM=vh(0,0,.58,1),tP=vh(.42,0,.58,1),VM=e=>Array.isArray(e)&&typeof e[0]!="number",nP=e=>Array.isArray(e)&&typeof e[0]=="number",UM={linear:ro,easeIn:jM,easeInOut:tP,easeOut:BM,circIn:xx,circInOut:eP,circOut:ZE,backIn:bx,backInOut:QE,backOut:XE,anticipate:JE},KM=e=>typeof e=="string",_1=e=>{if(nP(e)){gx(e.length===4);const[t,n,r,i]=e;return vh(t,n,r,i)}else if(KM(e))return UM[e];return e},ug=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function WM(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(m){a.has(m)&&(h.schedule(m),e()),m(c)}const h={schedule:(m,g=!1,b=!1)=>{const k=b&&i?n:r;return g&&a.add(m),k.has(m)||k.add(m),m},cancel:m=>{r.delete(m),a.delete(m)},process:m=>{if(c=m,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(d),n.clear(),i=!1,s&&(s=!1,h.process(m))}};return h}const HM=40;function rP(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=ug.reduce((M,F)=>(M[F]=WM(s),M),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:m,update:g,preRender:b,render:x,postRender:k}=a,P=()=>{const M=fs.useManualTiming?i.timestamp:performance.now();n=!1,fs.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(M-i.timestamp,HM),1)),i.timestamp=M,i.isProcessing=!0,c.process(i),d.process(i),h.process(i),m.process(i),g.process(i),b.process(i),x.process(i),k.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(P))},T=()=>{n=!0,r=!0,i.isProcessing||e(P)};return{schedule:ug.reduce((M,F)=>{const j=a[F];return M[F]=($,Y=!1,te=!1)=>(n||T(),j.schedule($,Y,te)),M},{}),cancel:M=>{for(let F=0;F(Ig===void 0&&li.set(dr.isProcessing||fs.useManualTiming?dr.timestamp:performance.now()),Ig),set:e=>{Ig=e,queueMicrotask(GM)}},iP=e=>t=>typeof t=="string"&&t.startsWith(e),wx=iP("--"),qM=iP("var(--"),Sx=e=>qM(e)?YM.test(e.split("/*")[0].trim()):!1,YM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Nf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qp={...Nf,transform:e=>ta(0,1,e)},cg={...Nf,default:1},Dp=e=>Math.round(e*1e5)/1e5,kx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function XM(e){return e==null}const QM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Cx=(e,t)=>n=>!!(typeof n=="string"&&QM.test(n)&&n.startsWith(e)||t&&!XM(n)&&Object.prototype.hasOwnProperty.call(n,t)),oP=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,c]=r.match(kx);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},JM=e=>ta(0,255,e),qy={...Nf,transform:e=>Math.round(JM(e))},gu={test:Cx("rgb","red"),parse:oP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+qy.transform(e)+", "+qy.transform(t)+", "+qy.transform(n)+", "+Dp(Qp.transform(r))+")"};function ZM(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const q0={test:Cx("#"),parse:ZM,transform:gu.transform},yh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ya=yh("deg"),cs=yh("%"),tt=yh("px"),eD=yh("vh"),tD=yh("vw"),I1={...cs,parse:e=>cs.parse(e)/100,transform:e=>cs.transform(e*100)},hf={test:Cx("hsl","hue"),parse:oP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+cs.transform(Dp(t))+", "+cs.transform(Dp(n))+", "+Dp(Qp.transform(r))+")"},Ln={test:e=>gu.test(e)||q0.test(e)||hf.test(e),parse:e=>gu.test(e)?gu.parse(e):hf.test(e)?hf.parse(e):q0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?gu.transform(e):hf.transform(e),getAnimatableNone:e=>{const t=Ln.parse(e);return t.alpha=0,Ln.transform(t)}},nD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rD(e){return isNaN(e)&&typeof e=="string"&&(e.match(kx)?.length||0)+(e.match(nD)?.length||0)>0}const sP="number",aP="color",iD="var",oD="var(",$1="${}",sD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const c=t.replace(sD,d=>(Ln.test(d)?(r.color.push(s),i.push(aP),n.push(Ln.parse(d))):d.startsWith(oD)?(r.var.push(s),i.push(iD),n.push(d)):(r.number.push(s),i.push(sP),n.push(parseFloat(d))),++s,$1)).split($1);return{values:n,split:c,indexes:r,types:i}}function lP(e){return Jp(e).values}function uP(e){const{split:t,types:n}=Jp(e),r=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:Ln.test(e)?Ln.getAnimatableNone(e):e;function lD(e){const t=lP(e);return uP(e)(t.map(aD))}const il={test:rD,parse:lP,createTransformer:uP,getAnimatableNone:lD};function Yy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function uD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;i=Yy(d,c,e+1/3),s=Yy(d,c,e),a=Yy(d,c,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Ug(e,t){return n=>n>0?t:e}const dn=(e,t,n)=>e+(t-e)*n,Xy=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},cD=[q0,gu,hf],fD=e=>cD.find(t=>t.test(e));function A1(e){const t=fD(e);if(!t)return!1;let n=t.parse(e);return t===hf&&(n=uD(n)),n}const R1=(e,t)=>{const n=A1(e),r=A1(t);if(!n||!r)return Ug(e,t);const i={...n};return s=>(i.red=Xy(n.red,r.red,s),i.green=Xy(n.green,r.green,s),i.blue=Xy(n.blue,r.blue,s),i.alpha=dn(n.alpha,r.alpha,s),gu.transform(i))},Y0=new Set(["none","hidden"]);function dD(e,t){return Y0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function pD(e,t){return n=>dn(e,t,n)}function Ex(e){return typeof e=="number"?pD:typeof e=="string"?Sx(e)?Ug:Ln.test(e)?R1:gD:Array.isArray(e)?cP:typeof e=="object"?Ln.test(e)?R1:hD:Ug}function cP(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>Ex(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in r)n[s]=r[s](i);return n}}function mD(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i{const n=il.createTransformer(t),r=Jp(e),i=Jp(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Y0.has(e)&&!i.values.length||Y0.has(t)&&!r.values.length?dD(e,t):gh(cP(mD(r,i),i.values),n):Ug(e,t)};function fP(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?dn(e,t,n):Ex(e)(e,t)}const vD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rn.update(t,n),stop:()=>rl(t),now:()=>dr.isProcessing?dr.timestamp:li.now()}},dP=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s=Kg?1/0:t}function yD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Px(r),Kg);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:us(i)}}const bD=5;function pP(e,t,n){const r=Math.max(t-bD,0);return HE(n-e(r),t-r)}const vn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Qy=.001;function xD({duration:e=vn.duration,bounce:t=vn.bounce,velocity:n=vn.velocity,mass:r=vn.mass}){let i,s,a=1-t;a=ta(vn.minDamping,vn.maxDamping,a),e=ta(vn.minDuration,vn.maxDuration,us(e)),a<1?(i=h=>{const m=h*a,g=m*e,b=m-n,x=X0(h,a),k=Math.exp(-g);return Qy-b/x*k},s=h=>{const g=h*a*e,b=g*n+n,x=Math.pow(a,2)*Math.pow(h,2)*e,k=Math.exp(-g),P=X0(Math.pow(h,2),a);return(-i(h)+Qy>0?-1:1)*((b-x)*k)/P}):(i=h=>{const m=Math.exp(-h*e),g=(h-n)*e+1;return-Qy+m*g},s=h=>{const m=Math.exp(-h*e),g=(n-h)*(e*e);return m*g});const c=5/e,d=SD(i,s,c);if(e=ls(e),isNaN(d))return{stiffness:vn.stiffness,damping:vn.damping,duration:e};{const h=Math.pow(d,2)*r;return{stiffness:h,damping:a*2*Math.sqrt(r*h),duration:e}}}const wD=12;function SD(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function ED(e){let t={velocity:vn.velocity,stiffness:vn.stiffness,damping:vn.damping,mass:vn.mass,isResolvedFromDuration:!1,...e};if(!L1(e,CD)&&L1(e,kD))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*ta(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:vn.mass,stiffness:i,damping:s}}else{const n=xD(e);t={...t,...n,mass:vn.mass},t.isResolvedFromDuration=!0}return t}function Wg(e=vn.visualDuration,t=vn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:d,damping:h,mass:m,duration:g,velocity:b,isResolvedFromDuration:x}=ED({...n,velocity:-us(n.velocity||0)}),k=b||0,P=h/(2*Math.sqrt(d*m)),T=a-s,_=us(Math.sqrt(d/m)),A=Math.abs(T)<5;r||(r=A?vn.restSpeed.granular:vn.restSpeed.default),i||(i=A?vn.restDelta.granular:vn.restDelta.default);let M;if(P<1){const j=X0(_,P);M=$=>{const Y=Math.exp(-P*_*$);return a-Y*((k+P*_*T)/j*Math.sin(j*$)+T*Math.cos(j*$))}}else if(P===1)M=j=>a-Math.exp(-_*j)*(T+(k+_*T)*j);else{const j=_*Math.sqrt(P*P-1);M=$=>{const Y=Math.exp(-P*_*$),te=Math.min(j*$,300);return a-Y*((k+P*_*T)*Math.sinh(te)+j*T*Math.cosh(te))/j}}const F={calculatedDuration:x&&g||null,next:j=>{const $=M(j);if(x)c.done=j>=g;else{let Y=j===0?k:0;P<1&&(Y=j===0?ls(k):pP(M,j,$));const te=Math.abs(Y)<=r,ie=Math.abs(a-$)<=i;c.done=te&&ie}return c.value=c.done?a:$,c},toString:()=>{const j=Math.min(Px(F),Kg),$=dP(Y=>F.next(j*Y).value,j,30);return j+"ms "+$},toTransition:()=>{}};return F}Wg.applyToOptions=e=>{const t=yD(e,100,Wg);return e.ease=t.ease,e.duration=ls(t.duration),e.type="keyframes",e};function Q0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:c,max:d,restDelta:h=.5,restSpeed:m}){const g=e[0],b={done:!1,value:g},x=te=>c!==void 0&&ted,k=te=>c===void 0?d:d===void 0||Math.abs(c-te)-P*Math.exp(-te/r),M=te=>_+A(te),F=te=>{const ie=A(te),B=M(te);b.done=Math.abs(ie)<=h,b.value=b.done?_:B};let j,$;const Y=te=>{x(b.value)&&(j=te,$=Wg({keyframes:[b.value,k(b.value)],velocity:pP(M,te,b.value),damping:i,stiffness:s,restDelta:h,restSpeed:m}))};return Y(0),{calculatedDuration:null,next:te=>{let ie=!1;return!$&&j===void 0&&(ie=!0,F(te),Y(te)),j!==void 0&&te>=j?$.next(te-j):(!ie&&F(te),b)}}}function PD(e,t,n){const r=[],i=n||fs.mix||fP,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=PD(t,r,i),d=c.length,h=m=>{if(a&&m1)for(;gh(ta(e[0],e[s-1],m)):h}function _D(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xp(0,t,r);e.push(dn(n,1,i))}}function ID(e){const t=[0];return _D(t,e.length-1),t}function $D(e,t){return e.map(n=>n*t)}function AD(e,t){return e.map(()=>t||tP).splice(0,e.length-1)}function Np({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=VM(r)?r.map(_1):_1(r),s={done:!1,value:t[0]},a=$D(n&&n.length===t.length?n:ID(t),e),c=TD(a,t,{ease:Array.isArray(i)?i:AD(t,i)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const RD=e=>e!==null;function Tx(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(RD),c=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||r===void 0?s[c]:r}const LD={decay:Q0,inertia:Q0,tween:Np,keyframes:Np,spring:Wg};function hP(e){typeof e.type=="string"&&(e.type=LD[e.type])}class _x{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const MD=e=>e/100;class Ix extends _x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==li.now()&&this.tick(li.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;hP(t);const{type:n=Np,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:c}=t;const d=n||Np;d!==Np&&typeof c[0]!="number"&&(this.mixKeyframes=gh(MD,fP(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=Px(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:h=0,keyframes:m,repeat:g,repeatType:b,repeatDelay:x,type:k,onUpdate:P,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-h*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let M=this.currentTime,F=r;if(g){const te=Math.min(this.currentTime,i)/c;let ie=Math.floor(te),B=te%1;!B&&te>=1&&(B=1),B===1&&ie--,ie=Math.min(ie,g+1),ie%2&&(b==="reverse"?(B=1-B,x&&(B-=x/c)):b==="mirror"&&(F=a)),M=ta(0,1,B)*c}const j=A?{done:!1,value:m[0]}:F.next(M);s&&(j.value=s(j.value));let{done:$}=j;!A&&d!==null&&($=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return Y&&k!==Q0&&(j.value=Tx(m,this.options,T,this.speed)),P&&P(j.value),Y&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return us(this.calculatedDuration)}get time(){return us(this.currentTime)}set time(t){t=ls(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(li.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=us(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=vD,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(li.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function DD(e){for(let t=1;te*180/Math.PI,J0=e=>{const t=vu(Math.atan2(e[1],e[0]));return Z0(t)},ND={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:J0,rotateZ:J0,skewX:e=>vu(Math.atan(e[1])),skewY:e=>vu(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Z0=e=>(e=e%360,e<0&&(e+=360),e),M1=J0,D1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),N1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),OD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:D1,scaleY:N1,scale:e=>(D1(e)+N1(e))/2,rotateX:e=>Z0(vu(Math.atan2(e[6],e[5]))),rotateY:e=>Z0(vu(Math.atan2(-e[2],e[0]))),rotateZ:M1,rotate:M1,skewX:e=>vu(Math.atan(e[4])),skewY:e=>vu(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eb(e){return e.includes("scale")?1:0}function tb(e,t){if(!e||e==="none")return eb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=OD,i=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ND,i=c}if(!i)return eb(t);const s=r[t],a=i[1].split(",").map(zD);return typeof s=="function"?s(a):a[s]}const FD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tb(n,t)};function zD(e){return parseFloat(e.trim())}const Of=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Lu=new Set(Of),O1=e=>e===Nf||e===tt,jD=new Set(["x","y","z"]),BD=Of.filter(e=>!jD.has(e));function VD(e){const t=[];return BD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const xu={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tb(t,"x"),y:(e,{transform:t})=>tb(t,"y")};xu.translateX=xu.x;xu.translateY=xu.y;const wu=new Set;let nb=!1,rb=!1,ib=!1;function mP(){if(rb){const e=Array.from(wu).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=VD(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{r.getValue(s)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rb=!1,nb=!1,wu.forEach(e=>e.complete(ib)),wu.clear()}function gP(){wu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rb=!0)})}function UD(){ib=!0,gP(),mP(),ib=!1}class $x{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(wu.add(this),nb||(nb=!0,rn.read(gP),rn.resolveKeyframes(mP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i?.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}DD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),wu.delete(this)}cancel(){this.state==="scheduled"&&(wu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const KD=e=>e.startsWith("--");function WD(e,t,n){KD(t)?e.style.setProperty(t,n):e.style[t]=n}const HD=vx(()=>window.ScrollTimeline!==void 0),GD={};function qD(e,t){const n=vx(e);return()=>GD[t]??n()}const vP=qD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$p=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,F1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$p([0,.65,.55,1]),circOut:$p([.55,0,1,.45]),backIn:$p([.31,.01,.66,-.59]),backOut:$p([.33,1.53,.69,.99])};function yP(e,t){if(e)return typeof e=="function"?vP()?dP(e,t):"ease-out":nP(e)?$p(e):Array.isArray(e)?e.map(n=>yP(n,t)||F1.easeOut):F1[e]}function YD(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:c="easeOut",times:d}={},h=void 0){const m={[t]:n};d&&(m.offset=d);const g=yP(c,i);Array.isArray(g)&&(m.easing=g);const b={delay:r,duration:i,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(m,b)}function bP(e){return typeof e=="function"&&"applyToOptions"in e}function XD({type:e,...t}){return bP(e)&&vP()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class QD extends _x{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,gx(typeof t.type!="string");const h=XD(t);this.animation=YD(n,r,i,h,s),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Tx(i,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):WD(n,r,m),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return us(Number(t))}get time(){return us(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ls(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&HD()?(this.animation.timeline=t,ro):n(this)}}const xP={anticipate:JE,backInOut:QE,circInOut:eP};function JD(e){return e in xP}function ZD(e){typeof e.ease=="string"&&JD(e.ease)&&(e.ease=xP[e.ease])}const z1=10;class e3 extends QD{constructor(t){ZD(t),hP(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Ix({...a,autoplay:!1}),d=ls(this.finishedTime??this.time);n.setWithVelocity(c.sample(d-z1).value,c.sample(d).value,z1),c.stop()}}const j1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(il.test(e)||e==="0")&&!e.startsWith("url("));function t3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function o3(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return i3()&&n&&r3.has(n)&&(n!=="transform"||!h)&&!d&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const s3=40;class a3 extends _x{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:c,name:d,motionValue:h,element:m,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=li.now();const b={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:d,motionValue:h,element:m,...g},x=m?.KeyframeResolver||$x;this.keyframeResolver=new x(c,(k,P,T)=>this.onKeyframesResolved(k,P,b,!T),d,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:a,velocity:c,delay:d,isHandoff:h,onUpdate:m}=r;this.resolvedAt=li.now(),n3(t,s,a,c)||((fs.instantAnimations||!d)&&m?.(Tx(t,r,n)),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const b={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>s3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=!h&&o3(b)?new e3({...b,element:b.motionValue.owner.current}):new Ix(b);x.finished.then(()=>this.notifyFinished()).catch(ro),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),UD()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const l3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function u3(e){const t=l3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function wP(e,t,n=1){const[r,i]=u3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return UE(a)?parseFloat(a):a}return Sx(i)?wP(i,t,n+1):i}function Ax(e,t){return e?.[t]??e?.default??e}const SP=new Set(["width","height","top","left","right","bottom",...Of]),c3={test:e=>e==="auto",parse:e=>e},kP=e=>t=>t.test(e),CP=[Nf,tt,cs,Ya,tD,eD,c3],B1=e=>CP.find(kP(e));function f3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||WE(e):!0}const d3=new Set(["brightness","contrast","saturate","opacity"]);function p3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(kx)||[];if(!r)return e;const i=n.replace(r,"");let s=d3.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const h3=/\b([a-z-]*)\(.*?\)/gu,ob={...il,getAnimatableNone:e=>{const t=e.match(h3);return t?t.map(p3).join(" "):e}},V1={...Nf,transform:Math.round},m3={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:cg,scaleX:cg,scaleY:cg,scaleZ:cg,skew:Ya,skewX:Ya,skewY:Ya,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:Qp,originX:I1,originY:I1,originZ:tt},Rx={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,backgroundPositionX:tt,backgroundPositionY:tt,...m3,zIndex:V1,fillOpacity:Qp,strokeOpacity:Qp,numOctaves:V1},g3={...Rx,color:Ln,backgroundColor:Ln,outlineColor:Ln,fill:Ln,stroke:Ln,borderColor:Ln,borderTopColor:Ln,borderRightColor:Ln,borderBottomColor:Ln,borderLeftColor:Ln,filter:ob,WebkitFilter:ob},EP=e=>g3[e];function PP(e,t){let n=EP(e);return n!==ob&&(n=il),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const v3=new Set(["auto","none","0"]);function y3(e,t,n){let r=0,i;for(;r{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const x3=new Set(["opacity","clipPath","filter","transform"]);function w3(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const TP=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function _P(e){return KE(e)&&"offsetHeight"in e}const U1=30,S3=e=>!isNaN(parseFloat(e));class IP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=li.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty();i&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=li.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=S3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new yx);const r=this.events[t].add(n);return t==="change"?()=>{r(),rn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=li.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>U1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,U1);return HE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _f(e,t){return new IP(e,t)}const{schedule:Lx}=rP(queueMicrotask,!1),Eo={x:!1,y:!1};function $P(){return Eo.x||Eo.y}function k3(e){return e==="x"||e==="y"?Eo[e]?null:(Eo[e]=!0,()=>{Eo[e]=!1}):Eo.x||Eo.y?null:(Eo.x=Eo.y=!0,()=>{Eo.x=Eo.y=!1})}function AP(e,t){const n=w3(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function K1(e){return!(e.pointerType==="touch"||$P())}function C3(e,t,n={}){const[r,i,s]=AP(e,n),a=c=>{if(!K1(c))return;const{target:d}=c,h=t(d,c);if(typeof h!="function"||!d)return;const m=g=>{K1(g)&&(h(g),d.removeEventListener("pointerleave",m))};d.addEventListener("pointerleave",m,i)};return r.forEach(c=>{c.addEventListener("pointerenter",a,i)}),s}const RP=(e,t)=>t?e===t?!0:RP(e,t.parentElement):!1,Mx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,E3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function P3(e){return E3.has(e.tagName)||e.tabIndex!==-1}const $g=new WeakSet;function W1(e){return t=>{t.key==="Enter"&&e(t)}}function Jy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const T3=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=W1(()=>{if($g.has(n))return;Jy(n,"down");const i=W1(()=>{Jy(n,"up")}),s=()=>Jy(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function H1(e){return Mx(e)&&!$P()}function _3(e,t,n={}){const[r,i,s]=AP(e,n),a=c=>{const d=c.currentTarget;if(!H1(c))return;$g.add(d);const h=t(d,c),m=(x,k)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",b),$g.has(d)&&$g.delete(d),H1(x)&&typeof h=="function"&&h(x,{success:k})},g=x=>{m(x,d===window||d===document||n.useGlobalTarget||RP(d,x.target))},b=x=>{m(x,!1)};window.addEventListener("pointerup",g,i),window.addEventListener("pointercancel",b,i)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,i),_P(c)&&(c.addEventListener("focus",h=>T3(h,i)),!P3(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function LP(e){return KE(e)&&"ownerSVGElement"in e}function I3(e){return LP(e)&&e.tagName==="svg"}const Sr=e=>!!(e&&e.getVelocity),$3=[...CP,Ln,il],A3=e=>$3.find(kP(e)),Zp=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class R3 extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=_P(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function L3({children:e,isPresent:t,anchorX:n,root:r}){const i=S.useId(),s=S.useRef(null),a=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=S.useContext(Zp);return S.useInsertionEffect(()=>{const{width:d,height:h,top:m,left:g,right:b}=a.current;if(t||!s.current||!d||!h)return;const x=n==="left"?`left: ${g}`:`right: ${b}`;s.current.dataset.motionPopId=i;const k=document.createElement("style");c&&(k.nonce=c);const P=r??document.head;return P.appendChild(k),k.sheet&&k.sheet.insertRule(` - [data-motion-pop-id="${i}"] { - position: absolute !important; - width: ${d}px !important; - height: ${h}px !important; - ${x}px !important; - top: ${m}px !important; - } - `),()=>{P.removeChild(k),P.contains(k)&&P.removeChild(k)}},[t]),L.jsx(R3,{isPresent:t,childRef:s,sizeRef:a,children:S.cloneElement(e,{ref:s})})}const M3=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:c,root:d})=>{const h=mh(D3),m=S.useId();let g=!0,b=S.useMemo(()=>(g=!1,{id:m,initial:t,isPresent:n,custom:i,onExitComplete:x=>{h.set(x,!0);for(const k of h.values())if(!k)return;r&&r()},register:x=>(h.set(x,!1),()=>h.delete(x))}),[n,h,r]);return s&&g&&(b={...b}),S.useMemo(()=>{h.forEach((x,k)=>h.set(k,!1))},[n]),S.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),a==="popLayout"&&(e=L.jsx(L3,{isPresent:n,anchorX:c,root:d,children:e})),L.jsx(yv.Provider,{value:b,children:e})};function D3(){return new Map}function MP(e=!0){const t=S.useContext(yv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=S.useId();S.useEffect(()=>{if(e)return i(s)},[e]);const a=S.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const fg=e=>e.key||"";function G1(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const sl=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:c="left",root:d})=>{const[h,m]=MP(a),g=S.useMemo(()=>G1(e),[e]),b=a&&!h?[]:g.map(fg),x=S.useRef(!0),k=S.useRef(g),P=mh(()=>new Map),[T,_]=S.useState(g),[A,M]=S.useState(g);px(()=>{x.current=!1,k.current=g;for(let $=0;${const Y=fg($),te=a&&!h?!1:g===A||b.includes(Y),ie=()=>{if(P.has(Y))P.set(Y,!0);else return;let B=!0;P.forEach(W=>{W||(B=!1)}),B&&(j?.(),M(k.current),a&&m?.(),r&&r())};return L.jsx(M3,{isPresent:te,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:d,onExitComplete:te?void 0:ie,anchorX:c,children:$},Y)})})},N3=S.createContext(null);function O3(){const e=S.useRef(!1);return px(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function F3(){const e=O3(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>rn.postRender(r),[r]),t]}const z3=e=>!e.isLayoutDirty&&e.willUpdate(!1);function q1(){const e=new Set,t=new WeakMap,n=()=>e.forEach(z3);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}const DP=e=>e===!0,j3=e=>DP(e===!0)||e==="id",B3=({children:e,id:t,inherit:n=!0})=>{const r=S.useContext(Yp),i=S.useContext(N3),[s,a]=F3(),c=S.useRef(null),d=r.id||i;c.current===null&&(j3(n)&&d&&(t=t?d+"-"+t:d),c.current={id:t,group:DP(n)&&r.group||q1()});const h=S.useMemo(()=>({...c.current,forceRender:s}),[a]);return L.jsx(Yp.Provider,{value:h,children:e})},Dx=S.createContext({strict:!1}),Y1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},If={};for(const e in Y1)If[e]={isEnabled:t=>Y1[e].some(n=>!!t[n])};function sb(e){for(const t in e)If[t]={...If[t],...e[t]}}function $f({children:e,features:t,strict:n=!1}){const[,r]=S.useState(!Zy(t)),i=S.useRef(void 0);if(!Zy(t)){const{renderer:s,...a}=t;i.current=s,sb(a)}return S.useEffect(()=>{Zy(t)&&t().then(({renderer:s,...a})=>{sb(a),i.current=s,r(!0)})},[]),L.jsx(Dx.Provider,{value:{renderer:i.current,strict:n},children:e})}function Zy(e){return typeof e=="function"}const V3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||V3.has(e)}let NP=e=>!Hg(e);function OP(e){typeof e=="function"&&(NP=t=>t.startsWith("on")?!Hg(t):e(t))}try{OP(require("@emotion/is-prop-valid").default)}catch{}function U3(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(NP(i)||n===!0&&Hg(i)||!t&&!Hg(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function K3({children:e,isValidProp:t,...n}){t&&OP(t),n={...S.useContext(Zp),...n},n.isStatic=mh(()=>n.isStatic);const r=S.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return L.jsx(Zp.Provider,{value:r,children:e})}const bv=S.createContext({});function xv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function eh(e){return typeof e=="string"||Array.isArray(e)}const Nx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ox=["initial",...Nx];function wv(e){return xv(e.animate)||Ox.some(t=>eh(e[t]))}function FP(e){return!!(wv(e)||e.variants)}function W3(e,t){if(wv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||eh(n)?n:void 0,animate:eh(r)?r:void 0}}return e.inherit!==!1?t:{}}function H3(e){const{initial:t,animate:n}=W3(e,S.useContext(bv));return S.useMemo(()=>({initial:t,animate:n}),[X1(t),X1(n)])}function X1(e){return Array.isArray(e)?e.join(" "):e}const th={};function G3(e){for(const t in e)th[t]=e[t],wx(t)&&(th[t].isCSSVariable=!0)}function zP(e,{layout:t,layoutId:n}){return Lu.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!th[e]||e==="opacity")}const q3={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Y3=Of.length;function X3(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}});function jP(e,t,n){for(const r in t)!Sr(t[r])&&!zP(r,n)&&(e[r]=t[r])}function Q3({transformTemplate:e},t){return S.useMemo(()=>{const n=zx();return Fx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function J3(e,t){const n=e.style||{},r={};return jP(r,n,e),Object.assign(r,Q3(e,t)),r}function Z3(e,t){const n={},r=J3(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const e4={offset:"stroke-dashoffset",array:"stroke-dasharray"},t4={offset:"strokeDashoffset",array:"strokeDasharray"};function n4(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?e4:t4;e[s.offset]=tt.transform(-r);const a=tt.transform(t),c=tt.transform(n);e[s.array]=`${a} ${c}`}function BP(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...c},d,h,m){if(Fx(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;g.transform&&(b.transform=g.transform,delete g.transform),(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=m?.transformBox??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),i!==void 0&&n4(g,i,s,a,!1)}const VP=()=>({...zx(),attrs:{}}),UP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function r4(e,t,n,r){const i=S.useMemo(()=>{const s=VP();return BP(s,t,UP(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};jP(s,e.style,e),i.style={...s,...i.style}}return i}const i4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jx(e){return typeof e!="string"||e.includes("-")?!1:!!(i4.indexOf(e)>-1||/[A-Z]/u.test(e))}function o4(e,t,n,{latestValues:r},i,s=!1){const c=(jx(e)?r4:Z3)(t,r,i,e),d=U3(t,typeof e=="string",s),h=e!==S.Fragment?{...d,...c,ref:n}:{},{children:m}=t,g=S.useMemo(()=>Sr(m)?m.get():m,[m]);return S.createElement(e,{...h,children:g})}function Q1(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bx(e,t,n,r){if(typeof t=="function"){const[i,s]=Q1(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Q1(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function Ag(e){return Sr(e)?e.get():e}function s4({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:a4(n,r,i,e),renderState:t()}}function a4(e,t,n,r){const i={},s=r(e,{});for(const b in s)i[b]=Ag(s[b]);let{initial:a,animate:c}=e;const d=wv(e),h=FP(e);t&&h&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const g=m?c:a;if(g&&typeof g!="boolean"&&!xv(g)){const b=Array.isArray(g)?g:[g];for(let x=0;x(t,n)=>{const r=S.useContext(bv),i=S.useContext(yv),s=()=>s4(e,t,r,i);return n?s():mh(s)};function Vx(e,t,n){const{style:r}=e,i={};for(const s in r)(Sr(r[s])||t.style&&Sr(t.style[s])||zP(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(i[s]=r[s]);return i}const l4=KP({scrapeMotionValuesFromProps:Vx,createRenderState:zx});function WP(e,t,n){const r=Vx(e,t,n);for(const i in e)if(Sr(e[i])||Sr(t[i])){const s=Of.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const u4=KP({scrapeMotionValuesFromProps:WP,createRenderState:VP}),c4=Symbol.for("motionComponentSymbol");function mf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function f4(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):mf(n)&&(n.current=r))},[t])}const Ux=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),d4="framerAppearId",HP="data-"+Ux(d4),GP=S.createContext({});function p4(e,t,n,r,i){const{visualElement:s}=S.useContext(bv),a=S.useContext(Dx),c=S.useContext(yv),d=S.useContext(Zp).reducedMotion,h=S.useRef(null);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const m=h.current,g=S.useContext(GP);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&h4(h.current,n,i,g);const b=S.useRef(!1);S.useInsertionEffect(()=>{m&&b.current&&m.update(n,c)});const x=n[HP],k=S.useRef(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return px(()=>{m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),k.current&&m.animationState&&m.animationState.animateChanges())}),S.useEffect(()=>{m&&(!k.current&&m.animationState&&m.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),k.current=!1))}),m}function h4(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qP(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||c&&mf(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:d,layoutRoot:h})}function qP(e){if(e)return e.options.allowProjection!==!1?e.projection:qP(e.parent)}function e0(e,{forwardMotionProps:t=!1}={},n,r){n&&sb(n);const i=jx(e)?u4:l4;function s(c,d){let h;const m={...S.useContext(Zp),...c,layoutId:m4(c)},{isStatic:g}=m,b=H3(c),x=i(c,g);if(!g&&dx){g4();const k=v4(m);h=k.MeasureLayout,b.visualElement=p4(e,x,m,r,k.ProjectionNode)}return L.jsxs(bv.Provider,{value:b,children:[h&&b.visualElement?L.jsx(h,{visualElement:b.visualElement,...m}):null,o4(e,c,f4(x,b.visualElement,d),x,g,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=S.forwardRef(s);return a[c4]=e,a}function m4({layoutId:e}){const t=S.useContext(Yp).id;return t&&e!==void 0?t+"-"+e:e}function g4(e,t){S.useContext(Dx).strict}function v4(e){const{drag:t,layout:n}=If;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function YP(e,t){if(typeof Proxy>"u")return e0;const n=new Map,r=(s,a)=>e0(s,a,e,t),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,e0(a,void 0,e,t)),n.get(a))})}const Af=YP();function XP({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function y4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function b4(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function t0(e){return e===void 0||e===1}function ab({scale:e,scaleX:t,scaleY:n}){return!t0(e)||!t0(t)||!t0(n)}function hu(e){return ab(e)||QP(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function QP(e){return J1(e.x)||J1(e.y)}function J1(e){return e&&e!=="0%"}function Gg(e,t,n){const r=e-n,i=t*r;return n+i}function Z1(e,t,n,r,i){return i!==void 0&&(e=Gg(e,i,r)),Gg(e,n,r)+t}function lb(e,t=0,n=1,r,i){e.min=Z1(e.min,t,n,r,i),e.max=Z1(e.max,t,n,r,i)}function JP(e,{x:t,y:n}){lb(e.x,t.translate,t.scale,t.originPoint),lb(e.y,n.translate,n.scale,n.originPoint)}const eS=.999999999999,tS=1.0000000000001;function x4(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let c=0;ceS&&(t.x=1),t.yeS&&(t.y=1)}function gf(e,t){e.min=e.min+t,e.max=e.max+t}function nS(e,t,n,r,i=.5){const s=dn(e.min,e.max,i);lb(e,t,n,s,r)}function vf(e,t){nS(e.x,t.x,t.scaleX,t.scale,t.originX),nS(e.y,t.y,t.scaleY,t.scale,t.originY)}function ZP(e,t){return XP(b4(e.getBoundingClientRect(),t))}function w4(e,t,n){const r=ZP(e,n),{scroll:i}=t;return i&&(gf(r.x,i.offset.x),gf(r.y,i.offset.y)),r}const rS=()=>({translate:0,scale:1,origin:0,originPoint:0}),yf=()=>({x:rS(),y:rS()}),iS=()=>({min:0,max:0}),Cn=()=>({x:iS(),y:iS()}),ub={current:null},eT={current:!1};function S4(){if(eT.current=!0,!!dx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ub.current=e.matches;e.addEventListener("change",t),t()}else ub.current=!1}const k4=new WeakMap;function C4(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Sr(i))e.addValue(r,i);else if(Sr(s))e.addValue(r,_f(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,_f(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class E4{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$x,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=li.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),eT.current||S4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ub.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),rl(this.notifyUpdate),rl(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Lu.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&rn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in If){const n=If[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_f(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(UE(r)||WE(r))?r=parseFloat(r):!A3(r)&&il.test(n)&&(r=PP(t,n)),this.setBaseTarget(t,Sr(r)?r.get():r)),Sr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=Bx(this.props,n,this.presenceContext?.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Sr(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new yx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Lx.render(this.render)}}class tT extends E4{constructor(){super(...arguments),this.KeyframeResolver=b3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Sr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function nT(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i?.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function P4(e){return window.getComputedStyle(e)}class T4 extends tT{constructor(){super(...arguments),this.type="html",this.renderInstance=nT}readValueFromInstance(t,n){if(Lu.has(n))return this.projection?.isProjecting?eb(n):FD(t,n);{const r=P4(t),i=(wx(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ZP(t,n)}build(t,n,r){Fx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Vx(t,n,r)}}const rT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function _4(e,t,n,r){nT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(rT.has(i)?i:Ux(i),t.attrs[i])}class I4 extends tT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Lu.has(n)){const r=EP(n);return r&&r.default||0}return n=rT.has(n)?n:Ux(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return WP(t,n,r)}build(t,n,r){BP(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){_4(t,n,r,i)}mount(t){this.isSVGTag=UP(t.tagName),super.mount(t)}}const $4=(e,t)=>jx(e)?new I4(t):new T4(t,{allowProjection:e!==S.Fragment});function nh(e,t,n){const r=e.getProps();return Bx(r,t,n!==void 0?n:r.custom,e)}const cb=e=>Array.isArray(e);function A4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_f(n))}function R4(e){return cb(e)?e[e.length-1]||0:e}function L4(e,t){const n=nh(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const c=R4(s[a]);A4(e,a,c)}}function M4(e){return!!(Sr(e)&&e.add)}function fb(e,t){const n=e.getValue("willChange");if(M4(n))return n.add(t);if(!n&&fs.WillChange){const r=new fs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function iT(e){return e.props[HP]}const D4=e=>e!==null;function N4(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(D4),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[s]}const O4={type:"spring",stiffness:500,damping:25,restSpeed:10},F4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),z4={type:"keyframes",duration:.8},j4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B4=(e,{keyframes:t})=>t.length>2?z4:Lu.has(e)?e.startsWith("scale")?F4(t[1]):O4:j4;function V4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:c,from:d,elapsed:h,...m}){return!!Object.keys(m).length}const Kx=(e,t,n,r={},i,s)=>a=>{const c=Ax(r,e)||{},d=c.delay||r.delay||0;let{elapsed:h=0}=r;h=h-ls(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:b=>{t.set(b),c.onUpdate&&c.onUpdate(b)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:i};V4(c)||Object.assign(m,B4(e,m)),m.duration&&(m.duration=ls(m.duration)),m.repeatDelay&&(m.repeatDelay=ls(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(g=!0)),(fs.instantAnimations||fs.skipAnimations)&&(g=!0,m.duration=0,m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!s&&t.get()!==void 0){const b=N4(m.keyframes,c);if(b!==void 0){rn.update(()=>{m.onUpdate(b),m.onComplete()});return}}return c.isSync?new Ix(m):new a3(m)};function U4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...c}=t;r&&(s=r);const d=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in c){const g=e.getValue(m,e.latestValues[m]??null),b=c[m];if(b===void 0||h&&U4(h,m))continue;const x={delay:n,...Ax(s||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating&&!Array.isArray(b)&&b===k&&!x.velocity)continue;let P=!1;if(window.MotionHandoffAnimation){const _=iT(e);if(_){const A=window.MotionHandoffAnimation(_,m,rn);A!==null&&(x.startTime=A,P=!0)}}fb(e,m),g.start(Kx(m,g,b,e.shouldReduceMotion&&SP.has(m)?{type:!1}:x,e,P));const T=g.animation;T&&d.push(T)}return a&&Promise.all(d).then(()=>{rn.update(()=>{a&&L4(e,a)})}),d}function db(e,t,n={}){const r=nh(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(oT(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:g}=i;return K4(e,t,d,h,m,g,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,h]=c==="beforeChildren"?[s,a]:[a,s];return d().then(()=>h())}else return Promise.all([s(),a(n.delay)])}function K4(e,t,n=0,r=0,i=0,s=1,a){const c=[],d=e.variantChildren.size,h=(d-1)*i,m=typeof r=="function",g=m?b=>r(b,d):s===1?(b=0)=>b*i:(b=0)=>h-b*i;return Array.from(e.variantChildren).sort(W4).forEach((b,x)=>{b.notify("AnimationStart",t),c.push(db(b,t,{...a,delay:n+(m?0:r)+g(x)}).then(()=>b.notify("AnimationComplete",t)))}),Promise.all(c)}function W4(e,t){return e.sortNodePosition(t)}function H4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>db(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=db(e,t,n);else{const i=typeof t=="function"?nh(e,t,n.custom):t;r=Promise.all(oT(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function sT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>H4(e,n,r)))}function Q4(e){let t=X4(e),n=sS(),r=!0;const i=d=>(h,m)=>{const g=nh(e,m,d==="exit"?e.presenceContext?.custom:void 0);if(g){const{transition:b,transitionEnd:x,...k}=g;h={...h,...k,...x}}return h};function s(d){t=d(e)}function a(d){const{props:h}=e,m=aT(e.parent)||{},g=[],b=new Set;let x={},k=1/0;for(let T=0;Tk&&F,ie=!1;const B=Array.isArray(M)?M:[M];let W=B.reduce(i(_),{});j===!1&&(W={});const{prevResolvedValues:G={}}=A,ee={...G,...W},H=X=>{te=!0,b.has(X)&&(ie=!0,b.delete(X)),A.needsAnimating[X]=!0;const V=e.getValue(X);V&&(V.liveStyle=!1)};for(const X in ee){const V=W[X],ae=G[X];if(x.hasOwnProperty(X))continue;let D=!1;cb(V)&&cb(ae)?D=!sT(V,ae):D=V!==ae,D?V!=null?H(X):b.add(X):V!==void 0&&b.has(X)?H(X):A.protectedKeys[X]=!0}A.prevProp=M,A.prevResolvedValues=W,A.isActive&&(x={...x,...W}),r&&e.blockInitialAnimation&&(te=!1),te&&(!($&&Y)||ie)&&g.push(...B.map(X=>({animation:X,options:{type:_}})))}if(b.size){const T={};if(typeof h.initial!="boolean"){const _=nh(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(T.transition=_.transition)}b.forEach(_=>{const A=e.getBaseTarget(_),M=e.getValue(_);M&&(M.liveStyle=!0),T[_]=A??null}),g.push({animation:T})}let P=!!g.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(P=!1),r=!1,P?t(g):Promise.resolve()}function c(d,h){if(n[d].isActive===h)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(d,h)),n[d].isActive=h;const m=a(d);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:a,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=sS(),r=!0}}}function J4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sT(t,e):!1}function au(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sS(){return{animate:au(!0),whileInView:au(),whileHover:au(),whileTap:au(),whileDrag:au(),whileFocus:au(),exit:au()}}class al{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Z4 extends al{constructor(t){super(t),t.animationState||(t.animationState=Q4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let eN=0;class tN extends al{constructor(){super(...arguments),this.id=eN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nN={animation:{Feature:Z4},exit:{Feature:tN}};function rh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function bh(e){return{point:{x:e.pageX,y:e.pageY}}}const rN=e=>t=>Mx(t)&&e(t,bh(t));function Op(e,t,n,r){return rh(e,t,rN(n),r)}const lT=1e-4,iN=1-lT,oN=1+lT,uT=.01,sN=0-uT,aN=0+uT;function Fr(e){return e.max-e.min}function lN(e,t,n){return Math.abs(e-t)<=n}function aS(e,t,n,r=.5){e.origin=r,e.originPoint=dn(t.min,t.max,e.origin),e.scale=Fr(n)/Fr(t),e.translate=dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=iN&&e.scale<=oN||isNaN(e.scale))&&(e.scale=1),(e.translate>=sN&&e.translate<=aN||isNaN(e.translate))&&(e.translate=0)}function Fp(e,t,n,r){aS(e.x,t.x,n.x,r?r.originX:void 0),aS(e.y,t.y,n.y,r?r.originY:void 0)}function lS(e,t,n){e.min=n.min+t.min,e.max=e.min+Fr(t)}function uN(e,t,n){lS(e.x,t.x,n.x),lS(e.y,t.y,n.y)}function uS(e,t,n){e.min=t.min-n.min,e.max=e.min+Fr(t)}function zp(e,t,n){uS(e.x,t.x,n.x),uS(e.y,t.y,n.y)}function Zi(e){return[e("x"),e("y")]}const cT=({current:e})=>e?e.ownerDocument.defaultView:null,cS=(e,t)=>Math.abs(e-t);function cN(e,t){const n=cS(e.x,t.x),r=cS(e.y,t.y);return Math.sqrt(n**2+r**2)}class fT{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=r0(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,k=cN(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!k)return;const{point:P}=b,{timestamp:T}=dr;this.history.push({...P,timestamp:T});const{onStart:_,onMove:A}=this.handlers;x||(_&&_(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=n0(x,this.transformPagePoint),rn.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:k,onSessionEnd:P,resumeAnimation:T}=this.handlers;if(this.dragSnapToOrigin&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=r0(b.type==="pointercancel"?this.lastMoveEventInfo:n0(x,this.transformPagePoint),this.history);this.startEvent&&k&&k(b,_),P&&P(b,_)},!Mx(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const c=bh(t),d=n0(c,this.transformPagePoint),{point:h}=d,{timestamp:m}=dr;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(t,r0(d,this.history)),this.removeListeners=gh(Op(this.contextWindow,"pointermove",this.handlePointerMove),Op(this.contextWindow,"pointerup",this.handlePointerUp),Op(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),rl(this.updatePoint)}}function n0(e,t){return t?{point:t(e.point)}:e}function fS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function r0({point:e},t){return{point:e,delta:fS(e,dT(t)),offset:fS(e,fN(t)),velocity:dN(t,.1)}}function fN(e){return e[0]}function dT(e){return e[e.length-1]}function dN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=dT(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ls(t)));)n--;if(!r)return{x:0,y:0};const s=us(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function pN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?dn(n,e,r.max):Math.min(e,n)),e}function dS(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function hN(e,{top:t,left:n,bottom:r,right:i}){return{x:dS(e.x,n,i),y:dS(e.y,t,r)}}function pS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Xp(t.min,t.max-r,e.min):r>i&&(n=Xp(e.min,e.max-i,t.min)),ta(0,1,n)}function vN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const pb=.35;function yN(e=pb){return e===!1?e=0:e===!0&&(e=pb),{x:hS(e,"left","right"),y:hS(e,"top","bottom")}}function hS(e,t,n){return{min:mS(e,t),max:mS(e,n)}}function mS(e,t){return typeof e=="number"?e:e[t]||0}const bN=new WeakMap;class xN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(bh(g).point)},a=(g,b)=>{const{drag:x,dragPropagation:k,onDragStart:P}=this.getProps();if(x&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=k3(x),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zi(_=>{let A=this.getAxisMotionValue(_).get()||0;if(cs.test(A)){const{projection:M}=this.visualElement;if(M&&M.layout){const F=M.layout.layoutBox[_];F&&(A=Fr(F)*(parseFloat(A)/100))}}this.originPoint[_]=A}),P&&rn.postRender(()=>P(g,b)),fb(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:x,dragDirectionLock:k,onDirectionLock:P,onDrag:T}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:_}=b;if(k&&this.currentDirection===null){this.currentDirection=wN(_),this.currentDirection!==null&&P&&P(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),T&&T(g,b)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>Zi(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:m}=this.getProps();this.panSession=new fT(t,{onSessionStart:s,onStart:a,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:cT(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&rn.postRender(()=>c(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!dg(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=pN(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&mf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=hN(r.layoutBox,t):this.constraints=!1,this.elastic=yN(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Zi(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=vN(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!mf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=w4(r,i.root,this.visualElement.getTransformPagePoint());let a=mN(i.layout.layoutBox,s);if(n){const c=n(y4(a));this.hasMutatedConstraints=!!c,c&&(a=XP(c))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=Zi(m=>{if(!dg(m,n,this.currentDirection))return;let g=d&&d[m]||{};a&&(g={min:0,max:0});const b=i?200:1e6,x=i?40:1e7,k={type:"inertia",velocity:r?t[m]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(m,k)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return fb(this.visualElement,t),r.start(Kx(t,r,0,n,this.visualElement,!1))}stopAnimation(){Zi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Zi(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Zi(n=>{const{drag:r}=this.getProps();if(!dg(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:c}=i.layout.layoutBox[n];s.set(t[n]-dn(a,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!mf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Zi(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const d=c.get();i[a]=gN({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Zi(a=>{if(!dg(a,t,null))return;const c=this.getAxisMotionValue(a),{min:d,max:h}=this.constraints[a];c.set(dn(d,h,i[a]))})}addListeners(){if(!this.visualElement.current)return;bN.set(this.visualElement,this);const t=this.visualElement.current,n=Op(t,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps();h&&m&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();mf(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rn.read(r);const a=rh(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Zi(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=d[m].translate,g.set(g.get()+d[m].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=pb,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:c}}}function dg(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class SN extends al{constructor(t){super(t),this.removeGroupControls=ro,this.removeListeners=ro,this.controls=new xN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ro}unmount(){this.removeGroupControls(),this.removeListeners()}}const gS=e=>(t,n)=>{e&&rn.postRender(()=>e(t,n))};class kN extends al{constructor(){super(...arguments),this.removePointerDownListener=ro}onPointerDown(t){this.session=new fT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cT(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:gS(t),onStart:gS(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&rn.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Op(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Rg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function vS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(tt.test(e))e=parseFloat(e);else return e;const n=vS(e,t.target.x),r=vS(e,t.target.y);return`${n}% ${r}%`}},CN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=il.parse(e);if(i.length>5)return r;const s=il.createTransformer(e),a=typeof i[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;i[0+a]/=c,i[1+a]/=d;const h=dn(c,d,.5);return typeof i[2+a]=="number"&&(i[2+a]/=h),typeof i[3+a]=="number"&&(i[3+a]/=h),s(i)}};let yS=!1;class EN extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;G3(PN),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),yS&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Rg.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,yS=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||rn.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Lx.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function pT(e){const[t,n]=MP(),r=S.useContext(Yp);return L.jsx(EN,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(GP),isPresent:t,safeToRemove:n})}const PN={borderRadius:{...mp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mp,borderTopRightRadius:mp,borderBottomLeftRadius:mp,borderBottomRightRadius:mp,boxShadow:CN};function TN(e,t,n){const r=Sr(e)?e:_f(e);return r.start(Kx("",r,t,n)),r.animation}const _N=(e,t)=>e.depth-t.depth;class IN{constructor(){this.children=[],this.isDirty=!1}add(t){hx(this.children,t),this.isDirty=!0}remove(t){mx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_N),this.isDirty=!1,this.children.forEach(t)}}function $N(e,t){const n=li.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(rl(r),e(s-t))};return rn.setup(r,!0),()=>rl(r)}const hT=["TopLeft","TopRight","BottomLeft","BottomRight"],AN=hT.length,bS=e=>typeof e=="string"?parseFloat(e):e,xS=e=>typeof e=="number"||tt.test(e);function RN(e,t,n,r,i,s){i?(e.opacity=dn(0,n.opacity??1,LN(r)),e.opacityExit=dn(t.opacity??1,0,MN(r))):s&&(e.opacity=dn(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(Xp(e,t,r))}function SS(e,t){e.min=t.min,e.max=t.max}function Qi(e,t){SS(e.x,t.x),SS(e.y,t.y)}function kS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function CS(e,t,n,r,i){return e-=t,e=Gg(e,1/n,r),i!==void 0&&(e=Gg(e,1/i,r)),e}function DN(e,t=0,n=1,r=.5,i,s=e,a=e){if(cs.test(t)&&(t=parseFloat(t),t=dn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=dn(s.min,s.max,r);e===s&&(c-=t),e.min=CS(e.min,t,n,c,i),e.max=CS(e.max,t,n,c,i)}function ES(e,t,[n,r,i],s,a){DN(e,t[n],t[r],t[i],t.scale,s,a)}const NN=["x","scaleX","originX"],ON=["y","scaleY","originY"];function PS(e,t,n,r){ES(e.x,t,NN,n?n.x:void 0,r?r.x:void 0),ES(e.y,t,ON,n?n.y:void 0,r?r.y:void 0)}function TS(e){return e.translate===0&&e.scale===1}function gT(e){return TS(e.x)&&TS(e.y)}function _S(e,t){return e.min===t.min&&e.max===t.max}function FN(e,t){return _S(e.x,t.x)&&_S(e.y,t.y)}function IS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vT(e,t){return IS(e.x,t.x)&&IS(e.y,t.y)}function $S(e){return Fr(e.x)/Fr(e.y)}function AS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zN{constructor(){this.members=[]}add(t){hx(this.members,t),t.scheduleRender()}remove(t){if(mx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jN(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=n?.z||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,rotateX:g,rotateY:b,skewX:x,skewY:k}=n;h&&(r=`perspective(${h}px) ${r}`),m&&(r+=`rotate(${m}deg) `),g&&(r+=`rotateX(${g}deg) `),b&&(r+=`rotateY(${b}deg) `),x&&(r+=`skewX(${x}deg) `),k&&(r+=`skewY(${k}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const i0=["","X","Y","Z"],BN=1e3;let VN=0;function o0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yT(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=iT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rn,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yT(r)}function bT({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},c=t?.()){this.id=VN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(WN),this.nodes.forEach(YN),this.nodes.forEach(XN),this.nodes.forEach(HN)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;dthis.root.updateBlockedByResize=!1;rn.read(()=>{g=window.innerWidth}),e(a,()=>{const x=window.innerWidth;x!==g&&(g=x,this.root.updateBlockedByResize=!0,m&&m(),m=$N(b,250),Rg.hasAnimatedSinceResize&&(Rg.hasAnimatedSinceResize=!1,this.nodes.forEach(MS)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||h.getDefaultTransition()||t5,{onLayoutAnimationStart:P,onLayoutAnimationComplete:T}=h.getProps(),_=!this.targetLayout||!vT(this.targetLayout,x),A=!g&&b;if(this.options.layoutRoot||this.resumeFrom||A||g&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...Ax(k,"layout"),onPlay:P,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(m,A)}else g||MS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(QN),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Fr(this.snapshot.measuredBox.x)&&!Fr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{const j=F/1e3;DS(g.x,a.x,j),DS(g.y,a.y,j),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zp(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ZN(this.relativeTarget,this.relativeTargetOrigin,b,j),M&&FN(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=Cn()),Qi(M,this.relativeTarget)),P&&(this.animationValues=m,RN(m,h,this.latestValues,j,A,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(rl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rn.update(()=>{Rg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_f(0)),this.currentAnimation=TN(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(BN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:m}=a;if(!(!c||!d||!h)){if(this!==a&&this.layout&&h&&xT(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||Cn();const g=Fr(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+g;const b=Fr(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+b}Qi(c,d),vf(c,m),Fp(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new zN),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&o0("z",a,h,this.animationValues);for(let m=0;ma.currentAnimation?.stop()),this.root.nodes.forEach(RS),this.root.sharedNodes.clear()}}}function UN(e){e.updateLayout()}function KN(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?Zi(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=Fr(g);g.min=n[m].min,g.max=g.min+b}):xT(i,t.layoutBox,n)&&Zi(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=Fr(n[m]);g.max=g.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+b)});const a=yf();Fp(a,n,t.layoutBox);const c=yf();s?Fp(c,e.applyTransform(r,!0),t.measuredBox):Fp(c,n,t.layoutBox);const d=!gT(a);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:b}=m;if(g&&b){const x=Cn();zp(x,t.layoutBox,g.layoutBox);const k=Cn();zp(k,n,b.layoutBox),vT(x,k)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=k,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function WN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function HN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function GN(e){e.clearSnapshot()}function RS(e){e.clearMeasurements()}function LS(e){e.isLayoutDirty=!1}function qN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function MS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YN(e){e.resolveTargetDelta()}function XN(e){e.calcProjection()}function QN(e){e.resetSkewAndRotation()}function JN(e){e.removeLeadSnapshot()}function DS(e,t,n){e.translate=dn(t.translate,0,n),e.scale=dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function NS(e,t,n,r){e.min=dn(t.min,n.min,r),e.max=dn(t.max,n.max,r)}function ZN(e,t,n,r){NS(e.x,t.x,n.x,r),NS(e.y,t.y,n.y,r)}function e5(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const t5={duration:.45,ease:[.4,0,.1,1]},OS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),FS=OS("applewebkit/")&&!OS("chrome/")?Math.round:ro;function zS(e){e.min=FS(e.min),e.max=FS(e.max)}function n5(e){zS(e.x),zS(e.y)}function xT(e,t,n){return e==="position"||e==="preserve-aspect"&&!lN($S(t),$S(n),.2)}function r5(e){return e!==e.root&&e.scroll?.wasRoot}const i5=bT({attachResizeListener:(e,t)=>rh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),s0={current:void 0},wT=bT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!s0.current){const e=new i5({});e.mount(window),e.setOptions({layoutScroll:!0}),s0.current=e}return s0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),o5={pan:{Feature:kN},drag:{Feature:SN,ProjectionNode:wT,MeasureLayout:pT}};function jS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&rn.postRender(()=>s(t,bh(t)))}class s5 extends al{mount(){const{current:t}=this.node;t&&(this.unmount=C3(t,(n,r)=>(jS(this.node,r,"Start"),i=>jS(this.node,i,"End"))))}unmount(){}}class a5 extends al{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gh(rh(this.node.current,"focus",()=>this.onFocus()),rh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function BS(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&rn.postRender(()=>s(t,bh(t)))}class l5 extends al{mount(){const{current:t}=this.node;t&&(this.unmount=_3(t,(n,r)=>(BS(this.node,r,"Start"),(i,{success:s})=>BS(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hb=new WeakMap,a0=new WeakMap,u5=e=>{const t=hb.get(e.target);t&&t(e)},c5=e=>{e.forEach(u5)};function f5({root:e,...t}){const n=e||document;a0.has(n)||a0.set(n,{});const r=a0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(c5,{root:e,...t})),r[i]}function d5(e,t,n){const r=f5(t);return hb.set(e,n),r.observe(e),()=>{hb.delete(e),r.unobserve(e)}}const p5={some:0,all:1};class h5 extends al{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:p5[i]},c=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),b=h?m:g;b&&b(d)};return d5(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(m5(t,n))&&this.startObserver()}unmount(){}}function m5({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g5={inView:{Feature:h5},tap:{Feature:l5},focus:{Feature:a5},hover:{Feature:s5}},v5={layout:{ProjectionNode:wT,MeasureLayout:pT}},y5={...nN,...g5,...o5,...v5},Zs=YP(y5,$4);class b5 extends IP{constructor(){super(...arguments),this.isEnabled=!1}add(t){(Lu.has(t)||x3.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function x5(){return mh(()=>new b5("auto"))}const as={top:"top",bottom:"top",left:"left",right:"left"},qg={top:"bottom",bottom:"top",left:"right",right:"left"},w5={top:"left",left:"top"},mb={top:"height",left:"width"},ST={width:"totalWidth",height:"totalHeight"},pg={};let Jn=typeof document<"u"?window.visualViewport:null;function VS(e){let t=0,n=0,r=0,i=0,s=0,a=0,c={};var d;let h=((d=Jn?.scale)!==null&&d!==void 0?d:1)>1;if(e.tagName==="BODY"){let k=document.documentElement;r=k.clientWidth,i=k.clientHeight;var m;t=(m=Jn?.width)!==null&&m!==void 0?m:r;var g;n=(g=Jn?.height)!==null&&g!==void 0?g:i,c.top=k.scrollTop||e.scrollTop,c.left=k.scrollLeft||e.scrollLeft,Jn&&(s=Jn.offsetTop,a=Jn.offsetLeft)}else({width:t,height:n,top:s,left:a}=wf(e)),c.top=e.scrollTop,c.left=e.scrollLeft,r=t,i=n;if(_E()&&(e.tagName==="BODY"||e.tagName==="HTML")&&h){c.top=0,c.left=0;var b;s=(b=Jn?.pageTop)!==null&&b!==void 0?b:0;var x;a=(x=Jn?.pageLeft)!==null&&x!==void 0?x:0}return{width:t,height:n,totalWidth:r,totalHeight:i,scroll:c,top:s,left:a}}function S5(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function US(e,t,n,r,i,s,a){var c;let d=(c=i.scroll[e])!==null&&c!==void 0?c:0,h=r[mb[e]],m=r.scroll[as[e]]+s,g=h+r.scroll[as[e]]-s,b=t-d+a[e]-r[as[e]],x=t-d+n+a[e]-r[as[e]];return bg?Math.max(g-x,m-b):0}function k5(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function KS(e){if(pg[e])return pg[e];let[t,n]=e.split(" "),r=as[t]||"right",i=w5[r];as[n]||(n="center");let s=mb[r],a=mb[i];return pg[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:s,crossSize:a},pg[e]}function l0(e,t,n,r,i,s,a,c,d,h){let{placement:m,crossPlacement:g,axis:b,crossAxis:x,size:k,crossSize:P}=r,T={};var _;T[x]=(_=e[x])!==null&&_!==void 0?_:0;var A,M,F,j;g==="center"?T[x]+=(((A=e[P])!==null&&A!==void 0?A:0)-((M=n[P])!==null&&M!==void 0?M:0))/2:g!==x&&(T[x]+=((F=e[P])!==null&&F!==void 0?F:0)-((j=n[P])!==null&&j!==void 0?j:0)),T[x]+=s;const $=e[x]-n[P]+d+h,Y=e[x]+e[P]-d-h;if(T[x]=Bg(T[x],$,Y),m===b){const te=c?a[k]:t[ST[k]];T[qg[b]]=Math.floor(te-e[b]+i)}else T[b]=Math.floor(e[b]+e[k]+i);return T}function C5(e,t,n,r,i,s,a,c){const d=r?n.height:t[ST.height];var h;let m=e.top!=null?n.top+e.top:n.top+(d-((h=e.bottom)!==null&&h!==void 0?h:0)-a);var g,b,x,k,P,T;let _=c!=="top"?Math.max(0,t.height+t.top+((g=t.scroll.top)!==null&&g!==void 0?g:0)-m-(((b=i.top)!==null&&b!==void 0?b:0)+((x=i.bottom)!==null&&x!==void 0?x:0)+s)):Math.max(0,m+a-(t.top+((k=t.scroll.top)!==null&&k!==void 0?k:0))-(((P=i.top)!==null&&P!==void 0?P:0)+((T=i.bottom)!==null&&T!==void 0?T:0)+s));return Math.min(t.height-s*2,_)}function WS(e,t,n,r,i,s){let{placement:a,axis:c,size:d}=s;var h,m;if(a===c)return Math.max(0,n[c]-e[c]-((h=e.scroll[c])!==null&&h!==void 0?h:0)+t[c]-((m=r[c])!==null&&m!==void 0?m:0)-r[qg[c]]-i);var g;return Math.max(0,e[d]+e[c]+e.scroll[c]-t[c]-n[c]-n[d]-((g=r[c])!==null&&g!==void 0?g:0)-r[qg[c]]-i)}function E5(e,t,n,r,i,s,a,c,d,h,m,g,b,x,k,P){let T=KS(e),{size:_,crossAxis:A,crossSize:M,placement:F,crossPlacement:j}=T,$=l0(t,c,n,T,m,g,h,b,k,P),Y=m,te=WS(c,h,t,i,s+m,T);if(a&&r[_]>te){let me=KS(`${qg[F]} ${j}`),Ce=l0(t,c,n,me,m,g,h,b,k,P);WS(c,h,t,i,s+m,me)>te&&(T=me,$=Ce,Y=m)}let ie="bottom";T.axis==="top"?T.placement==="top"?ie="top":T.placement==="bottom"&&(ie="bottom"):T.crossAxis==="top"&&(T.crossPlacement==="top"?ie="bottom":T.crossPlacement==="bottom"&&(ie="top"));let B=US(A,$[A],n[M],c,d,s,h);$[A]+=B;let W=C5($,c,h,b,i,s,n.height,ie);x&&x{if(!n||r===null)return;let i=s=>{let a=s.target;if(!t.current||a instanceof Node&&!a.contains(t.current)||s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement)return;let c=r||_5.get(t.current);c&&c()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,t])}let kn=typeof document<"u"?window.visualViewport:null;function $5(e){let{direction:t}=hh(),{arrowSize:n=0,targetRef:r,overlayRef:i,scrollRef:s=i,placement:a="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:h=typeof document<"u"?document.body:null,offset:m=0,crossOffset:g=0,shouldUpdatePosition:b=!0,isOpen:x=!0,onClose:k,maxHeight:P,arrowBoundaryOffset:T=0}=e,[_,A]=S.useState(null),M=[b,a,i.current,r.current,s.current,c,d,h,m,g,x,t,P,T,n],F=S.useRef(kn?.scale);S.useEffect(()=>{x&&(F.current=kn?.scale)},[x]);let j=S.useCallback(()=>{if(b===!1||!x||!i.current||!r.current||!h||kn?.scale!==F.current)return;let B=null;if(s.current&&s.current.contains(document.activeElement)){var W;let V=(W=document.activeElement)===null||W===void 0?void 0:W.getBoundingClientRect(),ae=s.current.getBoundingClientRect();var G;if(B={type:"top",offset:((G=V?.top)!==null&&G!==void 0?G:0)-ae.top},B.offset>ae.height/2){B.type="bottom";var ee;B.offset=((ee=V?.bottom)!==null&&ee!==void 0?ee:0)-ae.bottom}}let H=i.current;if(!P&&i.current){var le;H.style.top="0px",H.style.bottom="";var J;H.style.maxHeight=((J=(le=window.visualViewport)===null||le===void 0?void 0:le.height)!==null&&J!==void 0?J:window.innerHeight)+"px"}let X=P5({placement:R5(a,t),overlayNode:i.current,targetNode:r.current,scrollNode:s.current||i.current,padding:c,shouldFlip:d,boundaryElement:h,offset:m,crossOffset:g,maxHeight:P,arrowSize:n,arrowBoundaryOffset:T});if(X.position){if(H.style.top="",H.style.bottom="",H.style.left="",H.style.right="",Object.keys(X.position).forEach(V=>H.style[V]=X.position[V]+"px"),H.style.maxHeight=X.maxHeight!=null?X.maxHeight+"px":"",B&&document.activeElement&&s.current){let V=document.activeElement.getBoundingClientRect(),ae=s.current.getBoundingClientRect(),D=V[B.type]-ae[B.type];s.current.scrollTop+=D-B.offset}A(X)}},M);sn(j,M),A5(j),E1({ref:i,onResize:j}),E1({ref:r,onResize:j});let $=S.useRef(!1);sn(()=>{let B,W=()=>{$.current=!0,clearTimeout(B),B=setTimeout(()=>{$.current=!1},500),j()},G=()=>{$.current&&W()};return kn?.addEventListener("resize",W),kn?.addEventListener("scroll",G),()=>{kn?.removeEventListener("resize",W),kn?.removeEventListener("scroll",G)}},[j]);let Y=S.useCallback(()=>{$.current||k?.()},[k,$]);I5({triggerRef:r,isOpen:x,onClose:k&&Y});var te,ie;return{overlayProps:{style:{position:"absolute",zIndex:1e5,..._?.position,maxHeight:(te=_?.maxHeight)!==null&&te!==void 0?te:"100vh"}},placement:(ie=_?.placement)!==null&&ie!==void 0?ie:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:_?.arrowOffsetLeft,top:_?.arrowOffsetTop}},updatePosition:j}}function A5(e){sn(()=>(window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e,!1)}),[e])}function R5(e,t){return t==="rtl"?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")}function L5(e){const t=no(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:a,visibility:c}=s(e);i=a!=="none"&&c!=="hidden"&&c!=="collapse"}return i}function M5(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function kT(e,t){return e.nodeName!=="#comment"&&L5(e)&&M5(e,t)&&(!e.parentElement||kT(e.parentElement,e))}function Wx(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function CT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ET(e){let t=S.useRef({isFocused:!1,observer:null});sn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Bn(r=>{e?.(r)});return S.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,s=a=>{if(t.current.isFocused=!1,i.disabled){let c=Wx(a);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var a;(a=t.current.observer)===null||a===void 0||a.disconnect();let c=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Yg=!1;function D5(e){for(;e&&!BE(e);)e=e.parentElement;let t=no(e),n=t.document.activeElement;if(!n||n===e)return;Yg=!0;let r=!1,i=m=>{(m.target===n||r)&&m.stopImmediatePropagation()},s=m=>{(m.target===n||r)&&(m.stopImmediatePropagation(),!e&&!r&&(r=!0,nl(n),d()))},a=m=>{(m.target===e||r)&&m.stopImmediatePropagation()},c=m=>{(m.target===e||r)&&(m.stopImmediatePropagation(),r||(r=!0,nl(n),d()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",c,!0),t.addEventListener("focus",a,!0);let d=()=>{cancelAnimationFrame(h),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",c,!0),t.removeEventListener("focus",a,!0),Yg=!1,r=!1},h=requestAnimationFrame(d);return d}let bf="default",gb="",Lg=new WeakMap;function N5(e){if(vv()){if(bf==="default"){const t=Dt(e);gb=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}bf="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Lg.set(e,e.style[t]),e.style[t]="none"}}function qS(e){if(vv()){if(bf!=="disabled")return;bf="restoring",setTimeout(()=>{RE(()=>{if(bf==="restoring"){const t=Dt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=gb||""),gb="",bf="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Lg.has(e)){let t=Lg.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Lg.delete(e)}}const Hx=He.createContext({register:()=>{}});Hx.displayName="PressResponderContext";function O5(e,t){return t.get?t.get.call(e):t.value}function PT(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function F5(e,t){var n=PT(e,t,"get");return O5(e,n)}function z5(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function YS(e,t,n){var r=PT(e,t,"set");return z5(e,r,n),n}function j5(e){let t=S.useContext(Hx);if(t){let{register:n,...r}=t;e=Tn(r,e),n()}return ME(t,e.ref),e}var hg=new WeakMap;class mg{continuePropagation(){YS(this,hg,!1)}get shouldStopPropagation(){return F5(this,hg)}constructor(t,n,r,i){JL(this,hg,{writable:!0,value:void 0}),YS(this,hg,!0);var s;let a=(s=i?.target)!==null&&s!==void 0?s:r.currentTarget;const c=a?.getBoundingClientRect();let d,h=0,m,g=null;r.clientX!=null&&r.clientY!=null&&(m=r.clientX,g=r.clientY),c&&(m!=null&&g!=null?(d=m-c.left,h=g-c.top):(d=c.width/2,h=c.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=d,this.y=h}}const XS=Symbol("linkClicked"),QS="react-aria-pressable-style",JS="data-react-aria-pressable";function ol(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:s,onClick:a,isDisabled:c,isPressed:d,preventFocusOnPress:h,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:g,ref:b,...x}=j5(e),[k,P]=S.useState(!1),T=S.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:_,removeAllGlobalListeners:A}=cx(),M=Bn((W,G)=>{let ee=T.current;if(c||ee.didFirePressStart)return!1;let H=!0;if(ee.isTriggeringEvent=!0,r){let le=new mg("pressstart",G,W);r(le),H=le.shouldStopPropagation}return n&&n(!0),ee.isTriggeringEvent=!1,ee.didFirePressStart=!0,P(!0),H}),F=Bn((W,G,ee=!0)=>{let H=T.current;if(!H.didFirePressStart)return!1;H.didFirePressStart=!1,H.isTriggeringEvent=!0;let le=!0;if(i){let J=new mg("pressend",G,W);i(J),le=J.shouldStopPropagation}if(n&&n(!1),P(!1),t&&ee&&!c){let J=new mg("press",G,W);t(J),le&&(le=J.shouldStopPropagation)}return H.isTriggeringEvent=!1,le}),j=Bn((W,G)=>{let ee=T.current;if(c)return!1;if(s){ee.isTriggeringEvent=!0;let H=new mg("pressup",G,W);return s(H),ee.isTriggeringEvent=!1,H.shouldStopPropagation}return!0}),$=Bn(W=>{let G=T.current;if(G.isPressed&&G.target){G.didFirePressStart&&G.pointerType!=null&&F(lu(G.target,W),G.pointerType,!1),G.isPressed=!1,G.isOverTarget=!1,G.activePointerId=null,G.pointerType=null,A(),g||qS(G.target);for(let ee of G.disposables)ee();G.disposables=[]}}),Y=Bn(W=>{m&&$(W)}),te=Bn(W=>{a?.(W)}),ie=Bn((W,G)=>{if(a){let ee=new MouseEvent("click",W);CT(ee,G),a(Wx(ee))}}),B=S.useMemo(()=>{let W=T.current,G={onKeyDown(H){if(u0(H.nativeEvent,H.currentTarget)&&ai(H.currentTarget,En(H.nativeEvent))){var le;ZS(En(H.nativeEvent),H.key)&&H.preventDefault();let J=!0;if(!W.isPressed&&!H.repeat){W.target=H.currentTarget,W.isPressed=!0,W.pointerType="keyboard",J=M(H,"keyboard");let X=H.currentTarget,V=ae=>{u0(ae,X)&&!ae.repeat&&ai(X,En(ae))&&W.target&&j(lu(W.target,ae),"keyboard")};_(Dt(H.currentTarget),"keyup",Tf(V,ee),!0)}J&&H.stopPropagation(),H.metaKey&&Su()&&((le=W.metaKeyEvents)===null||le===void 0||le.set(H.key,H.nativeEvent))}else H.key==="Meta"&&(W.metaKeyEvents=new Map)},onClick(H){if(!(H&&!ai(H.currentTarget,En(H.nativeEvent)))&&H&&H.button===0&&!W.isTriggeringEvent&&!ku.isOpening){let le=!0;if(c&&H.preventDefault(),!W.ignoreEmulatedMouseEvents&&!W.isPressed&&(W.pointerType==="virtual"||OE(H.nativeEvent))){let J=M(H,"virtual"),X=j(H,"virtual"),V=F(H,"virtual");te(H),le=J&&X&&V}else if(W.isPressed&&W.pointerType!=="keyboard"){let J=W.pointerType||H.nativeEvent.pointerType||"virtual",X=j(lu(H.currentTarget,H),J),V=F(lu(H.currentTarget,H),J,!0);le=X&&V,W.isOverTarget=!1,te(H),$(H)}W.ignoreEmulatedMouseEvents=!1,le&&H.stopPropagation()}}},ee=H=>{var le;if(W.isPressed&&W.target&&u0(H,W.target)){var J;ZS(En(H),H.key)&&H.preventDefault();let V=En(H),ae=ai(W.target,En(H));F(lu(W.target,H),"keyboard",ae),ae&&ie(H,W.target),A(),H.key!=="Enter"&&Gx(W.target)&&ai(W.target,V)&&!H[XS]&&(H[XS]=!0,ku(W.target,H,!1)),W.isPressed=!1,(J=W.metaKeyEvents)===null||J===void 0||J.delete(H.key)}else if(H.key==="Meta"&&(!((le=W.metaKeyEvents)===null||le===void 0)&&le.size)){var X;let V=W.metaKeyEvents;W.metaKeyEvents=void 0;for(let ae of V.values())(X=W.target)===null||X===void 0||X.dispatchEvent(new KeyboardEvent("keyup",ae))}};if(typeof PointerEvent<"u"){G.onPointerDown=J=>{if(J.button!==0||!ai(J.currentTarget,En(J.nativeEvent)))return;if(EM(J.nativeEvent)){W.pointerType="virtual";return}W.pointerType=J.pointerType;let X=!0;if(!W.isPressed){W.isPressed=!0,W.isOverTarget=!0,W.activePointerId=J.pointerId,W.target=J.currentTarget,g||N5(W.target),X=M(J,W.pointerType);let V=En(J.nativeEvent);"releasePointerCapture"in V&&V.releasePointerCapture(J.pointerId),_(Dt(J.currentTarget),"pointerup",H,!1),_(Dt(J.currentTarget),"pointercancel",le,!1)}X&&J.stopPropagation()},G.onMouseDown=J=>{if(ai(J.currentTarget,En(J.nativeEvent))&&J.button===0){if(h){let X=D5(J.target);X&&W.disposables.push(X)}J.stopPropagation()}},G.onPointerUp=J=>{!ai(J.currentTarget,En(J.nativeEvent))||W.pointerType==="virtual"||J.button===0&&!W.isPressed&&j(J,W.pointerType||J.pointerType)},G.onPointerEnter=J=>{J.pointerId===W.activePointerId&&W.target&&!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,M(lu(W.target,J),W.pointerType))},G.onPointerLeave=J=>{J.pointerId===W.activePointerId&&W.target&&W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,F(lu(W.target,J),W.pointerType,!1),Y(J))};let H=J=>{if(J.pointerId===W.activePointerId&&W.isPressed&&J.button===0&&W.target){if(ai(W.target,En(J))&&W.pointerType!=null){let X=!1,V=setTimeout(()=>{W.isPressed&&W.target instanceof HTMLElement&&(X?$(J):(nl(W.target),W.target.click()))},80);_(J.currentTarget,"click",()=>X=!0,!0),W.disposables.push(()=>clearTimeout(V))}else $(J);W.isOverTarget=!1}},le=J=>{$(J)};G.onDragStart=J=>{ai(J.currentTarget,En(J.nativeEvent))&&$(J)}}return G},[_,c,h,A,g,$,Y,F,M,j,te,ie]);return S.useEffect(()=>{if(!b)return;const W=Dt(b.current);if(!W||!W.head||W.getElementById(QS))return;const G=W.createElement("style");G.id=QS,G.textContent=` -@layer { - [${JS}] { - touch-action: pan-x pan-y pinch-zoom; - } -} - `.trim(),W.head.prepend(G)},[b]),S.useEffect(()=>{let W=T.current;return()=>{var G;g||qS((G=W.target)!==null&&G!==void 0?G:void 0);for(let ee of W.disposables)ee();W.disposables=[]}},[g]),{isPressed:d||k,pressProps:Tn(x,B,{[JS]:!0})}}function Gx(e){return e.tagName==="A"&&e.hasAttribute("href")}function u0(e,t){const{key:n,code:r}=e,i=t,s=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof no(i).HTMLInputElement&&!TT(i,n)||i instanceof no(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&Gx(i))&&n!=="Enter")}function lu(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function B5(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Gx(e)}function ZS(e,t){return e instanceof HTMLInputElement?!TT(e,t):B5(e)}const V5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function TT(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":V5.has(e.type)}let na=null,ih=new Set,jp=new Map,Cu=!1,vb=!1;const U5={Tab:!0,Escape:!0};function Sv(e,t){for(let n of ih)n(e,t)}function K5(e){return!(e.metaKey||!Su()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Xg(e){Cu=!0,K5(e)&&(na="keyboard",Sv("keyboard",e))}function Sf(e){na="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Cu=!0,Sv("pointer",e))}function _T(e){OE(e)&&(Cu=!0,na="virtual")}function IT(e){e.target===window||e.target===document||Yg||!e.isTrusted||(!Cu&&!vb&&(na="virtual",Sv("virtual",e)),Cu=!1,vb=!1)}function $T(){Yg||(Cu=!1,vb=!0)}function Qg(e){if(typeof window>"u"||typeof document>"u"||jp.get(no(e)))return;const t=no(e),n=Dt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Cu=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xg,!0),n.addEventListener("keyup",Xg,!0),n.addEventListener("click",_T,!0),t.addEventListener("focus",IT,!0),t.addEventListener("blur",$T,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Sf,!0),n.addEventListener("pointermove",Sf,!0),n.addEventListener("pointerup",Sf,!0)),t.addEventListener("beforeunload",()=>{AT(e)},{once:!0}),jp.set(t,{focus:r})}const AT=(e,t)=>{const n=no(e),r=Dt(e);t&&r.removeEventListener("DOMContentLoaded",t),jp.has(n)&&(n.HTMLElement.prototype.focus=jp.get(n).focus,r.removeEventListener("keydown",Xg,!0),r.removeEventListener("keyup",Xg,!0),r.removeEventListener("click",_T,!0),n.removeEventListener("focus",IT,!0),n.removeEventListener("blur",$T,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",Sf,!0),r.removeEventListener("pointermove",Sf,!0),r.removeEventListener("pointerup",Sf,!0)),jp.delete(n))};function W5(e){const t=Dt(e);let n;return t.readyState!=="loading"?Qg(e):(n=()=>{Qg(e)},t.addEventListener("DOMContentLoaded",n)),()=>AT(e,n)}typeof document<"u"&&W5();function qx(){return na!=="pointer"}function oh(){return na}function H5(e){na=e,Sv(e,null)}function XG(){Qg();let[e,t]=S.useState(na);return S.useEffect(()=>{let n=()=>{t(na)};return ih.add(n),()=>{ih.delete(n)}},[]),ph()?null:e}const G5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function q5(e,t,n){let r=Dt(n?.target);const i=typeof window<"u"?no(n?.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?no(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?no(n?.target).HTMLElement:HTMLElement,c=typeof window<"u"?no(n?.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof i&&!G5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof a&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!U5[n.key])}function Y5(e,t,n){Qg(),S.useEffect(()=>{let r=(i,s)=>{q5(!!n?.isTextInput,i,s)&&e(qx())};return ih.add(r),()=>{ih.delete(r)}},t)}function Eu(e){const t=Dt(e),n=zr(t);if(oh()==="virtual"){let r=n;RE(()=>{zr(t)===r&&e.isConnected&&nl(e)})}else nl(e)}function RT(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const s=S.useCallback(d=>{if(d.target===d.currentTarget)return r&&r(d),i&&i(!1),!0},[r,i]),a=ET(s),c=S.useCallback(d=>{const h=Dt(d.target),m=h?zr(h):zr();d.target===d.currentTarget&&m===En(d.nativeEvent)&&(n&&n(d),i&&i(!0),a(d))},[i,n,a]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?s:void 0}}}function ek(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function X5(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ek(e.onKeyDown),onKeyUp:ek(e.onKeyUp)}}}let Q5=He.createContext(null);function J5(e){let t=S.useContext(Q5)||{};ME(t,e);let{ref:n,...r}=t;return r}function xh(e,t){let{focusProps:n}=RT(e),{keyboardProps:r}=X5(e),i=Tn(n,r),s=J5(t),a=e.isDisabled?{}:s,c=S.useRef(e.autoFocus);S.useEffect(()=>{c.current&&t.current&&Eu(t.current),c.current=!1},[t]);let d=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(d=void 0),{focusableProps:Tn({...i,tabIndex:d},a)}}function Z5({children:e}){let t=S.useMemo(()=>({register:()=>{}}),[]);return He.createElement(Hx.Provider,{value:t},e)}function kv(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,s=S.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:c}=cx(),d=S.useCallback(g=>{g.currentTarget.contains(g.target)&&s.current.isFocusWithin&&!g.currentTarget.contains(g.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(g),i&&i(!1))},[n,i,s,c]),h=ET(d),m=S.useCallback(g=>{if(!g.currentTarget.contains(g.target))return;const b=Dt(g.target),x=zr(b);if(!s.current.isFocusWithin&&x===En(g.nativeEvent)){r&&r(g),i&&i(!0),s.current.isFocusWithin=!0,h(g);let k=g.currentTarget;a(b,"focus",P=>{if(s.current.isFocusWithin&&!ai(k,P.target)){let T=new b.defaultView.FocusEvent("blur",{relatedTarget:P.target});CT(T,k);let _=Wx(T);d(_)}},{capture:!0})}},[r,i,h,a,d]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:m,onBlur:d}}}let yb=!1,c0=0;function eO(){yb=!0,setTimeout(()=>{yb=!1},50)}function tk(e){e.pointerType==="touch"&&eO()}function tO(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",tk),c0++,()=>{c0--,!(c0>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",tk)}}function Pu(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[s,a]=S.useState(!1),c=S.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;S.useEffect(tO,[]);let{addGlobalListener:d,removeAllGlobalListeners:h}=cx(),{hoverProps:m,triggerHoverEnd:g}=S.useMemo(()=>{let b=(P,T)=>{if(c.pointerType=T,i||T==="touch"||c.isHovered||!P.currentTarget.contains(P.target))return;c.isHovered=!0;let _=P.currentTarget;c.target=_,d(Dt(P.target),"pointerover",A=>{c.isHovered&&c.target&&!ai(c.target,A.target)&&x(A,A.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:_,pointerType:T}),n&&n(!0),a(!0)},x=(P,T)=>{let _=c.target;c.pointerType="",c.target=null,!(T==="touch"||!c.isHovered||!_)&&(c.isHovered=!1,h(),r&&r({type:"hoverend",target:_,pointerType:T}),n&&n(!1),a(!1))},k={};return typeof PointerEvent<"u"&&(k.onPointerEnter=P=>{yb&&P.pointerType==="mouse"||b(P,P.pointerType)},k.onPointerLeave=P=>{!i&&P.currentTarget.contains(P.target)&&x(P,P.pointerType)}),{hoverProps:k,triggerHoverEnd:x}},[t,n,r,i,c,d,h]);return S.useEffect(()=>{i&&g({currentTarget:c.target},c.pointerType)},[i]),{hoverProps:m,isHovered:s}}function nO(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,s=S.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=Bn(d=>{n&&nk(d,t)&&(i&&i(d),s.current.isPointerDown=!0)}),c=Bn(d=>{n&&n(d)});S.useEffect(()=>{let d=s.current;if(r)return;const h=t.current,m=Dt(h);if(typeof PointerEvent<"u"){let g=b=>{d.isPointerDown&&nk(b,t)&&c(b),d.isPointerDown=!1};return m.addEventListener("pointerdown",a,!0),m.addEventListener("click",g,!0),()=>{m.removeEventListener("pointerdown",a,!0),m.removeEventListener("click",g,!0)}}},[t,r,a,c])}function nk(e,t){if(e.button>0)return!1;if(e.target){const n=e.target.ownerDocument;if(!n||!n.documentElement.contains(e.target)||e.target.closest("[data-react-aria-top-layer]"))return!1}return t.current?!e.composedPath().includes(t.current):!1}const rk=He.createContext(null),bb="react-aria-focus-scope-restore";let Qt=null;function rO(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,s=S.useRef(null),a=S.useRef(null),c=S.useRef([]),{parentNode:d}=S.useContext(rk)||{},h=S.useMemo(()=>new wb({scopeRef:c}),[c]);sn(()=>{let b=d||Mn.root;if(Mn.getTreeNode(b.scopeRef)&&Qt&&!Jg(Qt,b.scopeRef)){let x=Mn.getTreeNode(Qt);x&&(b=x)}b.addChild(h),Mn.addNode(h)},[h,d]),sn(()=>{let b=Mn.getTreeNode(c);b&&(b.contain=!!n)},[n]),sn(()=>{var b;let x=(b=s.current)===null||b===void 0?void 0:b.nextSibling,k=[],P=T=>T.stopPropagation();for(;x&&x!==a.current;)k.push(x),x.addEventListener(bb,P),x=x.nextSibling;return c.current=k,()=>{for(let T of k)T.removeEventListener(bb,P)}},[t]),lO(c,r,n),oO(c,n),uO(c,r,n),aO(c,i),S.useEffect(()=>{const b=zr(Dt(c.current?c.current[0]:void 0));let x=null;if(io(b,c.current)){for(let k of Mn.traverse())k.scopeRef&&io(b,k.scopeRef.current)&&(x=k);x===Mn.getTreeNode(c)&&(Qt=x.scopeRef)}},[c]),sn(()=>()=>{var b,x,k;let P=(k=(x=Mn.getTreeNode(c))===null||x===void 0||(b=x.parent)===null||b===void 0?void 0:b.scopeRef)!==null&&k!==void 0?k:null;(c===Qt||Jg(c,Qt))&&(!P||Mn.getTreeNode(P))&&(Qt=P),Mn.removeTreeNode(c)},[c]);let m=S.useMemo(()=>iO(c),[]),g=S.useMemo(()=>({focusManager:m,parentNode:h}),[h,m]);return He.createElement(rk.Provider,{value:g},He.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),t,He.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function iO(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||zr(Dt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[0].previousElementSibling,m=yu(n),g=Js(m,{tabbable:i,accept:a},n);g.currentNode=io(d,n)?d:h;let b=g.nextNode();return!b&&s&&(g.currentNode=h,b=g.nextNode()),b&&Qs(b,!0),b},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||zr(Dt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[n.length-1].nextElementSibling,m=yu(n),g=Js(m,{tabbable:i,accept:a},n);g.currentNode=io(d,n)?d:h;let b=g.previousNode();return!b&&s&&(g.currentNode=h,b=g.previousNode()),b&&Qs(b,!0),b},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=yu(n),a=Js(s,{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let c=a.nextNode();return c&&Qs(c,!0),c},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=yu(n),a=Js(s,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let c=a.previousNode();return c&&Qs(c,!0),c}}}function yu(e){return e[0].parentElement}function Ap(e){let t=Mn.getTreeNode(Qt);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function oO(e,t){let n=S.useRef(void 0),r=S.useRef(void 0);sn(()=>{let i=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const s=Dt(i?i[0]:void 0);let a=h=>{if(h.key!=="Tab"||h.altKey||h.ctrlKey||h.metaKey||!Ap(e)||h.isComposing)return;let m=zr(s),g=e.current;if(!g||!io(m,g))return;let b=yu(g),x=Js(b,{tabbable:!0},g);if(!m)return;x.currentNode=m;let k=h.shiftKey?x.previousNode():x.nextNode();k||(x.currentNode=h.shiftKey?g[g.length-1].nextElementSibling:g[0].previousElementSibling,k=h.shiftKey?x.previousNode():x.nextNode()),h.preventDefault(),k&&Qs(k,!0)},c=h=>{(!Qt||Jg(Qt,e))&&io(En(h),e.current)?(Qt=e,n.current=En(h)):Ap(e)&&!Qa(En(h),e)?n.current?n.current.focus():Qt&&Qt.current&&xb(Qt.current):Ap(e)&&(n.current=En(h))},d=h=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let m=oh(),g=(m==="virtual"||m===null)&&lx()&&IE(),b=zr(s);if(!g&&b&&Ap(e)&&!Qa(b,e)){Qt=e;let k=En(h);if(k&&k.isConnected){var x;n.current=k,(x=n.current)===null||x===void 0||x.focus()}else Qt.current&&xb(Qt.current)}})};return s.addEventListener("keydown",a,!1),s.addEventListener("focusin",c,!1),i?.forEach(h=>h.addEventListener("focusin",c,!1)),i?.forEach(h=>h.addEventListener("focusout",d,!1)),()=>{s.removeEventListener("keydown",a,!1),s.removeEventListener("focusin",c,!1),i?.forEach(h=>h.removeEventListener("focusin",c,!1)),i?.forEach(h=>h.removeEventListener("focusout",d,!1))}},[e,t]),sn(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function LT(e){return Qa(e)}function io(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function Qa(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Mn.traverse(Mn.getTreeNode(t)))if(n&&io(e,n.current))return!0;return!1}function sO(e){return Qa(e,Qt)}function Jg(e,t){var n;let r=(n=Mn.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function Qs(e,t=!1){if(e!=null&&!t)try{Eu(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function MT(e,t=!0){let n=e[0].previousElementSibling,r=yu(e),i=Js(r,{tabbable:t},e);i.currentNode=n;let s=i.nextNode();return t&&!s&&(r=yu(e),i=Js(r,{tabbable:!1},e),i.currentNode=n,s=i.nextNode()),s}function xb(e,t=!0){Qs(MT(e,t))}function aO(e,t){const n=He.useRef(t);S.useEffect(()=>{if(n.current){Qt=e;const r=Dt(e.current?e.current[0]:void 0);!io(zr(r),Qt.current)&&e.current&&xb(e.current)}n.current=!1},[e])}function lO(e,t,n){sn(()=>{if(t||n)return;let r=e.current;const i=Dt(r?r[0]:void 0);let s=a=>{let c=En(a);io(c,e.current)?Qt=e:LT(c)||(Qt=null)};return i.addEventListener("focusin",s,!1),r?.forEach(a=>a.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),r?.forEach(a=>a.removeEventListener("focusin",s,!1))}},[e,t,n])}function ik(e){let t=Mn.getTreeNode(Qt);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function uO(e,t,n){const r=S.useRef(typeof document<"u"?zr(Dt(e.current?e.current[0]:void 0)):null);sn(()=>{let i=e.current;const s=Dt(i?i[0]:void 0);if(!t||n)return;let a=()=>{(!Qt||Jg(Qt,e))&&io(zr(s),e.current)&&(Qt=e)};return s.addEventListener("focusin",a,!1),i?.forEach(c=>c.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),i?.forEach(c=>c.removeEventListener("focusin",a,!1))}},[e,n]),sn(()=>{const i=Dt(e.current?e.current[0]:void 0);if(!t)return;let s=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!Ap(e)||a.isComposing)return;let c=i.activeElement;if(!Qa(c,e)||!ik(e))return;let d=Mn.getTreeNode(e);if(!d)return;let h=d.nodeToRestore,m=Js(i.body,{tabbable:!0});m.currentNode=c;let g=a.shiftKey?m.previousNode():m.nextNode();if((!h||!h.isConnected||h===i.body)&&(h=void 0,d.nodeToRestore=void 0),(!g||!Qa(g,e))&&h){m.currentNode=h;do g=a.shiftKey?m.previousNode():m.nextNode();while(Qa(g,e));a.preventDefault(),a.stopPropagation(),g?Qs(g,!0):LT(h)?Qs(h,!0):c.blur()}};return n||i.addEventListener("keydown",s,!0),()=>{n||i.removeEventListener("keydown",s,!0)}},[e,t,n]),sn(()=>{const i=Dt(e.current?e.current[0]:void 0);if(!t)return;let s=Mn.getTreeNode(e);if(s){var a;return s.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let c=Mn.getTreeNode(e);if(!c)return;let d=c.nodeToRestore,h=zr(i);if(t&&d&&(h&&Qa(h,e)||h===i.body&&ik(e))){let m=Mn.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let g=m.getTreeNode(e);for(;g;){if(g.nodeToRestore&&g.nodeToRestore.isConnected){ok(g.nodeToRestore);return}g=g.parent}for(g=m.getTreeNode(e);g;){if(g.scopeRef&&g.scopeRef.current&&Mn.getTreeNode(g.scopeRef)){let b=MT(g.scopeRef.current,!0);ok(b);return}g=g.parent}}})}}}},[e,t])}function ok(e){e.dispatchEvent(new CustomEvent(bb,{bubbles:!0,cancelable:!0}))&&Qs(e)}function Js(e,t,n){let r=t?.tabbable?$M:BE,i=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Dt(i),a=aM(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(c){var d;return!(t==null||(d=t.from)===null||d===void 0)&&d.contains(c)?NodeFilter.FILTER_REJECT:r(c)&&kT(c)&&(!n||io(c,n))&&(!t?.accept||t.accept(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}class Yx{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let s=new wb({scopeRef:t});i.addChild(s),s.parent=i,this.fastMap.set(t,s),r&&(s.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&io(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(s=>r&&r.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new Yx;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new wb({scopeRef:null}),this.fastMap.set(null,this.root)}}class wb{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let Mn=new Yx;function Tu(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=S.useRef({isFocused:!1,isFocusVisible:t||qx()}),[s,a]=S.useState(!1),[c,d]=S.useState(()=>i.current.isFocused&&i.current.isFocusVisible),h=S.useCallback(()=>d(i.current.isFocused&&i.current.isFocusVisible),[]),m=S.useCallback(x=>{i.current.isFocused=x,a(x),h()},[h]);Y5(x=>{i.current.isFocusVisible=x,h()},[],{isTextInput:n});let{focusProps:g}=RT({isDisabled:r,onFocusChange:m}),{focusWithinProps:b}=kv({isDisabled:!r,onFocusWithinChange:m});return{isFocused:s,isFocusVisible:c,focusProps:r?b:g}}function cO(e){let t=pO(Dt(e));t!==e&&(t&&fO(t,e),e&&dO(e,t))}function fO(e,t){e.dispatchEvent(new FocusEvent("blur",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:t}))}function dO(e,t){e.dispatchEvent(new FocusEvent("focus",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:t}))}function pO(e){let t=zr(e),n=t?.getAttribute("aria-activedescendant");return n&&e.getElementById(n)||t}const f0=typeof document<"u"&&window.visualViewport,hO=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let gg=0,d0;function mO(e={}){let{isDisabled:t}=e;sn(()=>{if(!t)return gg++,gg===1&&(vv()?d0=vO():d0=gO()),()=>{gg--,gg===0&&d0()}},[t])}function gO(){let e=window.innerWidth-document.documentElement.clientWidth;return Tf(e>0&&("scrollbarGutter"in document.documentElement.style?bu(document.documentElement,"scrollbarGutter","stable"):bu(document.documentElement,"paddingRight",`${e}px`)),bu(document.documentElement,"overflow","hidden"))}function vO(){let e,t,n=h=>{e=DE(h.target,!0),!(e===document.documentElement&&e===document.body)&&e instanceof HTMLElement&&window.getComputedStyle(e).overscrollBehavior==="auto"&&(t=bu(e,"overscrollBehavior","contain"))},r=h=>{if(!e||e===document.documentElement||e===document.body){h.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&h.preventDefault()},i=()=>{t&&t()},s=h=>{let m=h.target;yO(m)&&(c(),m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",f0&&(f0.height{sk(m)}):f0.addEventListener("resize",()=>sk(m),{once:!0}))}))},a=null,c=()=>{if(a)return;let h=()=>{window.scrollTo(0,0)},m=window.pageXOffset,g=window.pageYOffset;a=Tf(gp(window,"scroll",h),bu(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),bu(document.documentElement,"overflow","hidden"),bu(document.body,"marginTop",`-${g}px`),()=>{window.scrollTo(m,g)}),window.scrollTo(0,0)},d=Tf(gp(document,"touchstart",n,{passive:!1,capture:!0}),gp(document,"touchmove",r,{passive:!1,capture:!0}),gp(document,"touchend",i,{passive:!1,capture:!0}),gp(document,"focus",s,!0));return()=>{t?.(),a?.(),d()}}function bu(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function gp(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function sk(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let r=DE(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect().top,s=n.getBoundingClientRect().top;s>i+n.clientHeight&&(r.scrollTop+=s-i)}n=r.parentElement}}function yO(e){return e instanceof HTMLInputElement&&!hO.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}const bO=S.createContext({});function DT(){var e;return(e=S.useContext(bO))!==null&&e!==void 0?e:{}}const Sb=He.createContext(null);function xO(e){let{children:t}=e,n=S.useContext(Sb),[r,i]=S.useState(0),s=S.useMemo(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return He.createElement(Sb.Provider,{value:s},t)}function wO(){let e=S.useContext(Sb);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function SO(e){let{modalProviderProps:t}=wO();return He.createElement("div",{"data-overlay-container":!0,...e,...t})}function NT(e){return He.createElement(xO,null,He.createElement(SO,e))}function ak(e){let t=ph(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=DT();if(!e.portalContainer&&i&&(n=i()),He.useEffect(()=>{if(n?.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[n]),!n)return null;let s=He.createElement(NT,r);return jE.createPortal(s,n)}var OT={};OT={dismiss:"تجاهل"};var FT={};FT={dismiss:"Отхвърляне"};var zT={};zT={dismiss:"Odstranit"};var jT={};jT={dismiss:"Luk"};var BT={};BT={dismiss:"Schließen"};var VT={};VT={dismiss:"Απόρριψη"};var UT={};UT={dismiss:"Dismiss"};var KT={};KT={dismiss:"Descartar"};var WT={};WT={dismiss:"Lõpeta"};var HT={};HT={dismiss:"Hylkää"};var GT={};GT={dismiss:"Rejeter"};var qT={};qT={dismiss:"התעלם"};var YT={};YT={dismiss:"Odbaci"};var XT={};XT={dismiss:"Elutasítás"};var QT={};QT={dismiss:"Ignora"};var JT={};JT={dismiss:"閉じる"};var ZT={};ZT={dismiss:"무시"};var e_={};e_={dismiss:"Atmesti"};var t_={};t_={dismiss:"Nerādīt"};var n_={};n_={dismiss:"Lukk"};var r_={};r_={dismiss:"Negeren"};var i_={};i_={dismiss:"Zignoruj"};var o_={};o_={dismiss:"Descartar"};var s_={};s_={dismiss:"Dispensar"};var a_={};a_={dismiss:"Revocare"};var l_={};l_={dismiss:"Пропустить"};var u_={};u_={dismiss:"Zrušiť"};var c_={};c_={dismiss:"Opusti"};var f_={};f_={dismiss:"Odbaci"};var d_={};d_={dismiss:"Avvisa"};var p_={};p_={dismiss:"Kapat"};var h_={};h_={dismiss:"Скасувати"};var m_={};m_={dismiss:"取消"};var g_={};g_={dismiss:"關閉"};var v_={};v_={"ar-AE":OT,"bg-BG":FT,"cs-CZ":zT,"da-DK":jT,"de-DE":BT,"el-GR":VT,"en-US":UT,"es-ES":KT,"et-EE":WT,"fi-FI":HT,"fr-FR":GT,"he-IL":qT,"hr-HR":YT,"hu-HU":XT,"it-IT":QT,"ja-JP":JT,"ko-KR":ZT,"lt-LT":e_,"lv-LV":t_,"nb-NO":n_,"nl-NL":r_,"pl-PL":i_,"pt-BR":o_,"pt-PT":s_,"ro-RO":a_,"ru-RU":l_,"sk-SK":u_,"sl-SI":c_,"sr-SP":f_,"sv-SE":d_,"tr-TR":p_,"uk-UA":h_,"zh-CN":m_,"zh-TW":g_};const lk={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function kO(e={}){let{style:t,isFocusable:n}=e,[r,i]=S.useState(!1),{focusWithinProps:s}=kv({isDisabled:!n,onFocusWithinChange:c=>i(c)}),a=S.useMemo(()=>r?t:t?{...lk,...t}:lk,[r]);return{visuallyHiddenProps:{...s,style:a}}}function CO(e){let{children:t,elementType:n="div",isFocusable:r,style:i,...s}=e,{visuallyHiddenProps:a}=kO(e);return He.createElement(n,Tn(s,a),t)}function EO(e){return e&&e.__esModule?e.default:e}function uk(e){let{onDismiss:t,...n}=e,r=XL(EO(v_),"@react-aria/overlays"),i=LE(n,r.format("dismiss")),s=()=>{t&&t()};return He.createElement(CO,null,He.createElement("button",{...i,tabIndex:-1,onClick:s,style:{width:1,height:1}}))}let vp=new WeakMap,Ji=[];function PO(e,t=document.body){let n=new Set(e),r=new Set,i=d=>{for(let b of d.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(b);let h=b=>{if(n.has(b)||b.parentElement&&r.has(b.parentElement)&&b.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let x of n)if(b.contains(x))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},m=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode:h}),g=h(d);if(g===NodeFilter.FILTER_ACCEPT&&s(d),g!==NodeFilter.FILTER_REJECT){let b=m.nextNode();for(;b!=null;)s(b),b=m.nextNode()}},s=d=>{var h;let m=(h=vp.get(d))!==null&&h!==void 0?h:0;d.getAttribute("aria-hidden")==="true"&&m===0||(m===0&&d.setAttribute("aria-hidden","true"),r.add(d),vp.set(d,m+1))};Ji.length&&Ji[Ji.length-1].disconnect(),i(t);let a=new MutationObserver(d=>{for(let h of d)if(!(h.type!=="childList"||h.addedNodes.length===0)&&![...n,...r].some(m=>m.contains(h.target))){for(let m of h.removedNodes)m instanceof Element&&(n.delete(m),r.delete(m));for(let m of h.addedNodes)(m instanceof HTMLElement||m instanceof SVGElement)&&(m.dataset.liveAnnouncer==="true"||m.dataset.reactAriaTopLayer==="true")?n.add(m):m instanceof Element&&i(m)}});a.observe(t,{childList:!0,subtree:!0});let c={visibleNodes:n,hiddenNodes:r,observe(){a.observe(t,{childList:!0,subtree:!0})},disconnect(){a.disconnect()}};return Ji.push(c),()=>{a.disconnect();for(let d of r){let h=vp.get(d);h!=null&&(h===1?(d.removeAttribute("aria-hidden"),vp.delete(d)):vp.set(d,h-1))}c===Ji[Ji.length-1]?(Ji.pop(),Ji.length&&Ji[Ji.length-1].observe()):Ji.splice(Ji.indexOf(c),1)}}const y_=He.createContext(null);function TO(e){let t=ph(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,s]=S.useState(!1),a=S.useMemo(()=>({contain:i,setContain:s}),[i,s]),{getContainer:c}=DT();if(!e.portalContainer&&c&&(n=c()),!n)return null;let d=e.children;return e.disableFocusManagement||(d=He.createElement(rO,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},d)),d=He.createElement(y_.Provider,{value:a},He.createElement(Z5,null,d)),jE.createPortal(d,n)}function b_(){let e=S.useContext(y_),t=e?.setContain;sn(()=>{t?.(!0)},[t])}var _O=({children:e,navigate:t,disableAnimation:n,useHref:r,disableRipple:i=!1,skipFramerMotionAnimations:s=n,reducedMotion:a="never",validationBehavior:c,locale:d="en-US",labelPlacement:h,defaultDates:m,createCalendar:g,spinnerVariant:b,...x})=>{let k=e;t&&(k=L.jsx(bM,{navigate:t,useHref:r,children:k}));const P=S.useMemo(()=>(n&&s&&(fs.skipAnimations=!0),{createCalendar:g,defaultDates:m,disableAnimation:n,disableRipple:i,validationBehavior:c,labelPlacement:h,spinnerVariant:b}),[g,m?.maxDate,m?.minDate,n,i,c,h,b]);return L.jsx($L,{value:P,children:L.jsx(VL,{locale:d,children:L.jsx(K3,{reducedMotion:a,children:L.jsx(NT,{...x,children:k})})})})};function QG(e){const t=ci(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function IO(e){const t=ci(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function jr(e){return S.forwardRef(e)}var oa=(e,t,n=!0)=>{if(!t)return[e,{}];const r=t.reduce((i,s)=>s in e?{...i,[s]:e[s]}:i,{});return n?[Object.keys(e).filter(s=>!t.includes(s)).reduce((s,a)=>({...s,[a]:e[a]}),{}),r]:[e,r]},$O={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground",foreground:"bg-foreground text-background"},AO={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},RO={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},LO={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-600",secondary:"bg-secondary/20 text-secondary-600",success:"bg-success/20 text-success-700 dark:text-success",warning:"bg-warning/20 text-warning-700 dark:text-warning",danger:"bg-danger/20 text-danger-600 dark:text-danger-500"},MO={default:"border-default bg-default-100 text-default-foreground",primary:"border-default bg-default-100 text-primary",secondary:"border-default bg-default-100 text-secondary",success:"border-default bg-default-100 text-success",warning:"border-default bg-default-100 text-warning",danger:"border-default bg-default-100 text-danger"},DO={default:"bg-transparent text-default-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},NO={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},Te={solid:$O,shadow:AO,bordered:RO,flat:LO,faded:MO,light:DO,ghost:NO},OO={".spinner-bar-animation":{"animation-delay":"calc(-1.2s + (0.1s * var(--bar-index)))",transform:"rotate(calc(30deg * var(--bar-index)))translate(140%)"},".spinner-dot-animation":{"animation-delay":"calc(250ms * var(--dot-index))"},".spinner-dot-blink-animation":{"animation-delay":"calc(200ms * var(--dot-index))"}},FO={".leading-inherit":{"line-height":"inherit"},".bg-img-inherit":{"background-image":"inherit"},".bg-clip-inherit":{"background-clip":"inherit"},".text-fill-inherit":{"-webkit-text-fill-color":"inherit"},".tap-highlight-transparent":{"-webkit-tap-highlight-color":"transparent"},".input-search-cancel-button-none":{"&::-webkit-search-cancel-button":{"-webkit-appearance":"none"}}},zO={".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},jO={".text-tiny":{"font-size":"var(--heroui-font-size-tiny)","line-height":"var(--heroui-line-height-tiny)"},".text-small":{"font-size":"var(--heroui-font-size-small)","line-height":"var(--heroui-line-height-small)"},".text-medium":{"font-size":"var(--heroui-font-size-medium)","line-height":"var(--heroui-line-height-medium)"},".text-large":{"font-size":"var(--heroui-font-size-large)","line-height":"var(--heroui-line-height-large)"}},is="250ms",BO={".transition-background":{"transition-property":"background","transition-timing-function":"ease","transition-duration":is},".transition-colors-opacity":{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":is},".transition-width":{"transition-property":"width","transition-timing-function":"ease","transition-duration":is},".transition-height":{"transition-property":"height","transition-timing-function":"ease","transition-duration":is},".transition-size":{"transition-property":"width, height","transition-timing-function":"ease","transition-duration":is},".transition-left":{"transition-property":"left","transition-timing-function":"ease","transition-duration":is},".transition-transform-opacity":{"transition-property":"transform, scale, opacity rotate","transition-timing-function":"ease","transition-duration":is},".transition-transform-background":{"transition-property":"transform, scale, background","transition-timing-function":"ease","transition-duration":is},".transition-transform-colors":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke","transition-timing-function":"ease","transition-duration":is},".transition-transform-colors-opacity":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":is}},VO={...FO,...BO,...zO,...jO,...OO},vg=["small","medium","large"],kb={theme:{spacing:["divider"],radius:vg},classGroups:{shadow:[{shadow:vg}],opacity:[{opacity:["disabled"]}],"font-size":[{text:["tiny",...vg]}],"border-w":[{border:vg}],"bg-image":["bg-stripe-gradient-default","bg-stripe-gradient-primary","bg-stripe-gradient-secondary","bg-stripe-gradient-success","bg-stripe-gradient-warning","bg-stripe-gradient-danger"],transition:Object.keys(VO).filter(e=>e.includes(".transition")).map(e=>e.replace(".",""))}},ck=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oi=e=>!e||typeof e!="object"||Object.keys(e).length===0,UO=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function x_(e,t){e.forEach(function(n){Array.isArray(n)?x_(n,t):t.push(n)})}function w_(e){let t=[];return x_(e,t),t}var S_=(...e)=>w_(e).filter(Boolean),k_=(e,t)=>{let n={},r=Object.keys(e),i=Object.keys(t);for(let s of r)if(i.includes(s)){let a=e[s],c=t[s];Array.isArray(a)||Array.isArray(c)?n[s]=S_(c,a):typeof a=="object"&&typeof c=="object"?n[s]=k_(a,c):n[s]=c+" "+a}else n[s]=e[s];for(let s of i)r.includes(s)||(n[s]=t[s]);return n},fk=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();const Xx="-",KO=e=>{const t=HO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(Xx);return c[0]===""&&c.length!==1&&c.shift(),C_(c,t)||WO(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},C_=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?C_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Xx);return t.validators.find(({validator:a})=>a(s))?.classGroupId},dk=/^\[(.+)\]$/,WO=e=>{if(dk.test(e)){const t=dk.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},HO=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Cb(n[i],r,i,t);return r},Cb=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:pk(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(GO(i)){Cb(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Cb(a,pk(t,s),n,r)})})},pk=(e,t)=>{let n=e;return t.split(Xx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},GO=e=>e.isThemeGetter,qO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},Eb="!",Pb=":",YO=Pb.length,XO=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,c=0,d=0,h;for(let k=0;kd?h-d:void 0;return{modifiers:s,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:x}};if(t){const i=t+Pb,s=r;r=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},QO=e=>e.endsWith(Eb)?e.substring(0,e.length-1):e.startsWith(Eb)?e.substring(1):e,JO=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},ZO=e=>({cache:qO(e.cacheSize),parseClassName:XO(e),sortModifiers:JO(e),...KO(e)}),eF=/\s+/,tF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],c=e.trim().split(eF);let d="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:g,modifiers:b,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:P}=n(m);if(g){d=m+(d.length>0?" "+d:d);continue}let T=!!P,_=r(T?k.substring(0,P):k);if(!_){if(!T){d=m+(d.length>0?" "+d:d);continue}if(_=r(k),!_){d=m+(d.length>0?" "+d:d);continue}T=!1}const A=s(b).join(":"),M=x?A+Eb:A,F=M+_;if(a.includes(F))continue;a.push(F);const j=i(_,T);for(let $=0;$0?" "+d:d)}return d};function nF(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(m),e());return n=ZO(h),r=n.cache.get,i=n.cache.set,s=c,c(d)}function c(d){const h=r(d);if(h)return h;const m=tF(d,n);return i(d,m),m}return function(){return s(nF.apply(null,arguments))}}const Zn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},P_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,T_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rF=/^\d+\/\d+$/,iF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,aF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,af=e=>rF.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),uu=e=>!!e&&Number.isInteger(Number(e)),hk=e=>e.endsWith("%")&&yt(e.slice(0,-1)),Ga=e=>iF.test(e),uF=()=>!0,cF=e=>oF.test(e)&&!sF.test(e),Qx=()=>!1,fF=e=>aF.test(e),dF=e=>lF.test(e),pF=e=>!je(e)&&!Be(e),hF=e=>Ff(e,$_,Qx),je=e=>P_.test(e),cu=e=>Ff(e,A_,cF),p0=e=>Ff(e,EF,yt),mF=e=>Ff(e,__,Qx),gF=e=>Ff(e,I_,dF),vF=e=>Ff(e,Qx,fF),Be=e=>T_.test(e),yg=e=>zf(e,A_),yF=e=>zf(e,PF),bF=e=>zf(e,__),xF=e=>zf(e,$_),wF=e=>zf(e,I_),SF=e=>zf(e,TF,!0),Ff=(e,t,n)=>{const r=P_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zf=(e,t,n=!1)=>{const r=T_.exec(e);return r?r[1]?t(r[1]):n:!1},__=e=>e==="position",kF=new Set(["image","url"]),I_=e=>kF.has(e),CF=new Set(["length","size","percentage"]),$_=e=>CF.has(e),A_=e=>e==="length",EF=e=>e==="number",PF=e=>e==="family-name",TF=e=>e==="shadow",_b=()=>{const e=Zn("color"),t=Zn("font"),n=Zn("text"),r=Zn("font-weight"),i=Zn("tracking"),s=Zn("leading"),a=Zn("breakpoint"),c=Zn("container"),d=Zn("spacing"),h=Zn("radius"),m=Zn("shadow"),g=Zn("inset-shadow"),b=Zn("drop-shadow"),x=Zn("blur"),k=Zn("perspective"),P=Zn("aspect"),T=Zn("ease"),_=Zn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],$=()=>[Be,je,d],Y=()=>[af,"full","auto",...$()],te=()=>[uu,"none","subgrid",Be,je],ie=()=>["auto",{span:["full",uu,Be,je]},Be,je],B=()=>[uu,"auto",Be,je],W=()=>["auto","min","max","fr",Be,je],G=()=>["start","end","center","between","around","evenly","stretch","baseline"],ee=()=>["start","end","center","stretch"],H=()=>["auto",...$()],le=()=>[af,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],J=()=>[e,Be,je],X=()=>[hk,cu],V=()=>["","none","full",h,Be,je],ae=()=>["",yt,yg,cu],D=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>["","none",x,Be,je],z=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be,je],me=()=>["none",yt,Be,je],Ce=()=>["none",yt,Be,je],ye=()=>[yt,Be,je],Fe=()=>[af,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[uF],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[pF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",yt],text:[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",af,je,Be,P]}],container:["container"],columns:[{columns:[yt,je,Be,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),je,Be]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[uu,"auto",Be,je]}],basis:[{basis:[af,"full","auto",c,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,af,"auto","initial","none",je]}],grow:[{grow:["",yt,Be,je]}],shrink:[{shrink:["",yt,Be,je]}],order:[{order:[uu,"first","last","none",Be,je]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...ee(),"baseline"]}],"align-self":[{self:["auto",...ee(),"baseline"]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],w:[{w:[c,"screen",...le()]}],"min-w":[{"min-w":[c,"screen","none",...le()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...le()]}],h:[{h:["screen",...le()]}],"min-h":[{"min-h":["screen","none",...le()]}],"max-h":[{"max-h":["screen",...le()]}],"font-size":[{text:["base",n,yg,cu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Be,p0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hk,je]}],"font-family":[{font:[yF,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Be,je]}],"line-clamp":[{"line-clamp":[yt,"none",Be,p0]}],leading:[{leading:[s,...$()]}],"list-image":[{"list-image":["none",Be,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Be,cu]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[yt,"auto",Be,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),bF,mF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",xF,hF]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uu,Be,je],radial:["",Be,je],conic:[uu,Be,je]},wF,gF]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Be,je]}],"outline-w":[{outline:["",yt,yg,cu]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,SF,vF]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",Be,je,g]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[yt,cu]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":J()}],opacity:[{opacity:[yt,Be,je]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none",Be,je]}],blur:[{blur:oe()}],brightness:[{brightness:[yt,Be,je]}],contrast:[{contrast:[yt,Be,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Be,je]}],grayscale:[{grayscale:["",yt,Be,je]}],"hue-rotate":[{"hue-rotate":[yt,Be,je]}],invert:[{invert:["",yt,Be,je]}],saturate:[{saturate:[yt,Be,je]}],sepia:[{sepia:["",yt,Be,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,je]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Be,je]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Be,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Be,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Be,je]}],"backdrop-invert":[{"backdrop-invert":["",yt,Be,je]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Be,je]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Be,je]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Be,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Be,je]}],ease:[{ease:["linear","initial",T,Be,je]}],delay:[{delay:[yt,Be,je]}],animate:[{animate:["none",_,Be,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Be,je]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Be,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,je]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[yt,yg,cu,p0]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},_F=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:s={}})=>(Rp(e,"cacheSize",t),Rp(e,"prefix",n),Rp(e,"experimentalParseClassName",r),bg(e.theme,s.theme),bg(e.classGroups,s.classGroups),bg(e.conflictingClassGroups,s.conflictingClassGroups),bg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Rp(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),xg(e.theme,i.theme),xg(e.classGroups,i.classGroups),xg(e.conflictingClassGroups,i.conflictingClassGroups),xg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),R_(e,i,"orderSensitiveModifiers"),e),Rp=(e,t,n)=>{n!==void 0&&(e[t]=n)},bg=(e,t)=>{if(t)for(const n in t)Rp(e,n,t[n])},xg=(e,t)=>{if(t)for(const n in t)R_(e,t,n)},R_=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},L_=(e,...t)=>typeof e=="function"?Tb(_b,e,...t):Tb(()=>_F(_b(),e),...t),IF=Tb(_b);var $F={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},M_=e=>e||void 0,sh=(...e)=>M_(w_(e).filter(Boolean).join(" ")),h0=null,Xs={},Ib=!1,yp=(...e)=>t=>t.twMerge?((!h0||Ib)&&(Ib=!1,h0=oi(Xs)?IF:L_({...Xs,extend:{theme:Xs.theme,classGroups:Xs.classGroups,conflictingClassGroupModifiers:Xs.conflictingClassGroupModifiers,conflictingClassGroups:Xs.conflictingClassGroups,...Xs.extend}})),M_(h0(sh(e)))):sh(e),mk=(e,t)=>{for(let n in t)e.hasOwnProperty(n)?e[n]=sh(e[n],t[n]):e[n]=t[n];return e},AF=(e,t)=>{let{extend:n=null,slots:r={},variants:i={},compoundVariants:s=[],compoundSlots:a=[],defaultVariants:c={}}=e,d={...$F,...t},h=n!=null&&n.base?sh(n.base,e?.base):e?.base,m=n!=null&&n.variants&&!oi(n.variants)?k_(i,n.variants):i,g=n!=null&&n.defaultVariants&&!oi(n.defaultVariants)?{...n.defaultVariants,...c}:c;!oi(d.twMergeConfig)&&!UO(d.twMergeConfig,Xs)&&(Ib=!0,Xs=d.twMergeConfig);let b=oi(n?.slots),x=oi(r)?{}:{base:sh(e?.base,b&&n?.base),...r},k=b?x:mk({...n?.slots},oi(x)?{base:e?.base}:x),P=oi(n?.compoundVariants)?s:S_(n?.compoundVariants,s),T=A=>{if(oi(m)&&oi(r)&&b)return yp(h,A?.class,A?.className)(d);if(P&&!Array.isArray(P))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof P}`);if(a&&!Array.isArray(a))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof a}`);let M=(G,ee,H=[],le)=>{let J=H;if(typeof ee=="string")J=J.concat(fk(ee).split(" ").map(X=>`${G}:${X}`));else if(Array.isArray(ee))J=J.concat(ee.reduce((X,V)=>X.concat(`${G}:${V}`),[]));else if(typeof ee=="object"&&typeof le=="string"){for(let X in ee)if(ee.hasOwnProperty(X)&&X===le){let V=ee[X];if(V&&typeof V=="string"){let ae=fk(V);J[le]?J[le]=J[le].concat(ae.split(" ").map(D=>`${G}:${D}`)):J[le]=ae.split(" ").map(D=>`${G}:${D}`)}else Array.isArray(V)&&V.length>0&&(J[le]=V.reduce((ae,D)=>ae.concat(`${G}:${D}`),[]))}}return J},F=(G,ee=m,H=null,le=null)=>{var J;let X=ee[G];if(!X||oi(X))return null;let V=(J=le?.[G])!=null?J:A?.[G];if(V===null)return null;let ae=ck(V),D=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===!0,U=g?.[G],oe=[];if(typeof ae=="object"&&D)for(let[Ce,ye]of Object.entries(ae)){let Fe=X[ye];if(Ce==="initial"){U=ye;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(Ce)||(oe=M(Ce,Fe,oe,H))}let z=ae!=null&&typeof ae!="object"?ae:ck(U),me=X[z||"false"];return typeof oe=="object"&&typeof H=="string"&&oe[H]?mk(oe,me):oe.length>0?(oe.push(me),H==="base"?oe.join(" "):oe):me},j=()=>m?Object.keys(m).map(G=>F(G,m)):null,$=(G,ee)=>{if(!m||typeof m!="object")return null;let H=new Array;for(let le in m){let J=F(le,m,G,ee),X=G==="base"&&typeof J=="string"?J:J&&J[G];X&&(H[H.length]=X)}return H},Y={};for(let G in A)A[G]!==void 0&&(Y[G]=A[G]);let te=(G,ee)=>{var H;let le=typeof A?.[G]=="object"?{[G]:(H=A[G])==null?void 0:H.initial}:{};return{...g,...Y,...le,...ee}},ie=(G=[],ee)=>{let H=[];for(let{class:le,className:J,...X}of G){let V=!0;for(let[ae,D]of Object.entries(X)){let U=te(ae,ee)[ae];if(Array.isArray(D)){if(!D.includes(U)){V=!1;break}}else{let oe=z=>z==null||z===!1;if(oe(D)&&oe(U))continue;if(U!==D){V=!1;break}}}V&&(le&&H.push(le),J&&H.push(J))}return H},B=G=>{let ee=ie(P,G);if(!Array.isArray(ee))return ee;let H={};for(let le of ee)if(typeof le=="string"&&(H.base=yp(H.base,le)(d)),typeof le=="object")for(let[J,X]of Object.entries(le))H[J]=yp(H[J],X)(d);return H},W=G=>{if(a.length<1)return null;let ee={};for(let{slots:H=[],class:le,className:J,...X}of a){if(!oi(X)){let V=!0;for(let ae of Object.keys(X)){let D=te(ae,G)[ae];if(D===void 0||(Array.isArray(X[ae])?!X[ae].includes(D):X[ae]!==D)){V=!1;break}}if(!V)continue}for(let V of H)ee[V]=ee[V]||[],ee[V].push([le,J])}return ee};if(!oi(r)||!b){let G={};if(typeof k=="object"&&!oi(k))for(let ee of Object.keys(k))G[ee]=H=>{var le,J;return yp(k[ee],$(ee,H),((le=B(H))!=null?le:[])[ee],((J=W(H))!=null?J:[])[ee],H?.class,H?.className)(d)};return G}return yp(h,j(),ie(P),A?.class,A?.className)(d)},_=()=>{if(!(!m||typeof m!="object"))return Object.keys(m)};return T.variantKeys=_(),T.extend=n,T.base=h,T.slots=k,T.variants=m,T.defaultVariants=g,T.compoundSlots=a,T.compoundVariants=P,T},er=(e,t)=>{var n,r,i;return AF(e,{...t,twMerge:(n=t?.twMerge)!=null?n:!0,twMergeConfig:{...t?.twMergeConfig,theme:{...(r=t?.twMergeConfig)==null?void 0:r.theme,...kb.theme},classGroups:{...(i=t?.twMergeConfig)==null?void 0:i.classGroups,...kb.classGroups}}})},gk=er({slots:{base:"relative inline-flex flex-col gap-2 items-center justify-center",wrapper:"relative flex",label:"text-foreground dark:text-foreground-dark font-regular",circle1:"absolute w-full h-full rounded-full",circle2:"absolute w-full h-full rounded-full",dots:"relative rounded-full mx-auto",spinnerBars:["absolute","animate-fade-out","rounded-full","w-[25%]","h-[8%]","left-[calc(37.5%)]","top-[calc(46%)]","spinner-bar-animation"]},variants:{size:{sm:{wrapper:"w-5 h-5",circle1:"border-2",circle2:"border-2",dots:"size-1",label:"text-small"},md:{wrapper:"w-8 h-8",circle1:"border-3",circle2:"border-3",dots:"size-1.5",label:"text-medium"},lg:{wrapper:"w-10 h-10",circle1:"border-3",circle2:"border-3",dots:"size-2",label:"text-large"}},color:{current:{circle1:"border-b-current",circle2:"border-b-current",dots:"bg-current",spinnerBars:"bg-current"},white:{circle1:"border-b-white",circle2:"border-b-white",dots:"bg-white",spinnerBars:"bg-white"},default:{circle1:"border-b-default",circle2:"border-b-default",dots:"bg-default",spinnerBars:"bg-default"},primary:{circle1:"border-b-primary",circle2:"border-b-primary",dots:"bg-primary",spinnerBars:"bg-primary"},secondary:{circle1:"border-b-secondary",circle2:"border-b-secondary",dots:"bg-secondary",spinnerBars:"bg-secondary"},success:{circle1:"border-b-success",circle2:"border-b-success",dots:"bg-success",spinnerBars:"bg-success"},warning:{circle1:"border-b-warning",circle2:"border-b-warning",dots:"bg-warning",spinnerBars:"bg-warning"},danger:{circle1:"border-b-danger",circle2:"border-b-danger",dots:"bg-danger",spinnerBars:"bg-danger"}},labelColor:{foreground:{label:"text-foreground"},primary:{label:"text-primary"},secondary:{label:"text-secondary"},success:{label:"text-success"},warning:{label:"text-warning"},danger:{label:"text-danger"}},variant:{default:{circle1:["animate-spinner-ease-spin","border-solid","border-t-transparent","border-l-transparent","border-r-transparent"],circle2:["opacity-75","animate-spinner-linear-spin","border-dotted","border-t-transparent","border-l-transparent","border-r-transparent"]},gradient:{circle1:["border-0","bg-gradient-to-b","from-transparent","via-transparent","to-primary","animate-spinner-linear-spin","[animation-duration:1s]","[-webkit-mask:radial-gradient(closest-side,rgba(0,0,0,0.0)calc(100%-3px),rgba(0,0,0,1)calc(100%-3px))]"],circle2:["hidden"]},wave:{wrapper:"translate-y-3/4",dots:["animate-sway","spinner-dot-animation"]},dots:{wrapper:"translate-y-2/4",dots:["animate-blink","spinner-dot-blink-animation"]},spinner:{},simple:{wrapper:"text-foreground h-5 w-5 animate-spin",circle1:"opacity-25",circle2:"opacity-75"}}},defaultVariants:{size:"md",color:"primary",labelColor:"foreground",variant:"default"},compoundVariants:[{variant:"gradient",color:"current",class:{circle1:"to-current"}},{variant:"gradient",color:"white",class:{circle1:"to-white"}},{variant:"gradient",color:"default",class:{circle1:"to-default"}},{variant:"gradient",color:"primary",class:{circle1:"to-primary"}},{variant:"gradient",color:"secondary",class:{circle1:"to-secondary"}},{variant:"gradient",color:"success",class:{circle1:"to-success"}},{variant:"gradient",color:"warning",class:{circle1:"to-warning"}},{variant:"gradient",color:"danger",class:{circle1:"to-danger"}},{variant:"wave",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"wave",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"wave",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"dots",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"dots",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"dots",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"simple",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"simple",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",color:"current",class:{wrapper:"text-current"}},{variant:"simple",color:"white",class:{wrapper:"text-white"}},{variant:"simple",color:"default",class:{wrapper:"text-default"}},{variant:"simple",color:"primary",class:{wrapper:"text-primary"}},{variant:"simple",color:"secondary",class:{wrapper:"text-secondary"}},{variant:"simple",color:"success",class:{wrapper:"text-success"}},{variant:"simple",color:"warning",class:{wrapper:"text-warning"}},{variant:"simple",color:"danger",class:{wrapper:"text-danger"}}]}),wh=["outline-hidden","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],D_=["outline-hidden","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],RF=["outline-hidden","ring-2","ring-focus","ring-offset-2","ring-offset-background"],lf={default:["[&+.border-medium.border-default]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],primary:["[&+.border-medium.border-primary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],secondary:["[&+.border-medium.border-secondary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],success:["[&+.border-medium.border-success]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],warning:["[&+.border-medium.border-warning]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],danger:["[&+.border-medium.border-danger]:ms-[calc(var(--heroui-border-width-medium)*-1)]"]},LF=["font-inherit","text-[100%]","leading-[1.15]","m-0","p-0","overflow-visible","box-border","absolute","top-0","w-full","h-full","opacity-[0.0001]","z-[1]","cursor-pointer","disabled:cursor-default"],vk=er({slots:{base:["z-0","relative","bg-transparent","before:content-['']","before:hidden","before:z-[-1]","before:absolute","before:rotate-45","before:w-2.5","before:h-2.5","before:rounded-sm","data-[arrow=true]:before:block","data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top]:before:left-1/2","data-[placement=top]:before:-translate-x-1/2","data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-start]:before:left-3","data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-end]:before:right-3","data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom]:before:left-1/2","data-[placement=bottom]:before:-translate-x-1/2","data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-start]:before:left-3","data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-end]:before:right-3","data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=left]:before:top-1/2","data-[placement=left]:before:-translate-y-1/2","data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-start]:before:top-1/4","data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-end]:before:bottom-1/4","data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=right]:before:top-1/2","data-[placement=right]:before:-translate-y-1/2","data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-start]:before:top-1/4","data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-end]:before:bottom-1/4",...wh],content:["z-10","px-2.5","py-1","w-full","inline-flex","flex-col","items-center","justify-center","box-border","subpixel-antialiased","outline-hidden","box-border"],trigger:["z-10"],backdrop:["hidden"],arrow:[]},variants:{size:{sm:{content:"text-tiny"},md:{content:"text-small"},lg:{content:"text-medium"}},color:{default:{base:"before:bg-content1 before:shadow-small",content:"bg-content1"},foreground:{base:"before:bg-foreground",content:Te.solid.foreground},primary:{base:"before:bg-primary",content:Te.solid.primary},secondary:{base:"before:bg-secondary",content:Te.solid.secondary},success:{base:"before:bg-success",content:Te.solid.success},warning:{base:"before:bg-warning",content:Te.solid.warning},danger:{base:"before:bg-danger",content:Te.solid.danger}},radius:{none:{content:"rounded-none"},sm:{content:"rounded-small"},md:{content:"rounded-medium"},lg:{content:"rounded-large"},full:{content:"rounded-full"}},shadow:{none:{content:"shadow-none"},sm:{content:"shadow-small"},md:{content:"shadow-medium"},lg:{content:"shadow-large"}},backdrop:{transparent:{},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30"}},triggerScaleOnOpen:{true:{trigger:["aria-expanded:scale-[0.97]","aria-expanded:opacity-70","subpixel-antialiased"]},false:{}},disableAnimation:{true:{base:"animate-none"}},isTriggerDisabled:{true:{trigger:"opacity-disabled pointer-events-none"},false:{}}},defaultVariants:{color:"default",radius:"lg",size:"md",shadow:"md",backdrop:"transparent",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"block w-full h-full fixed inset-0 -z-30"}}]});er({slots:{base:"flex flex-col gap-2 w-full",label:"",labelWrapper:"flex justify-between",value:"",track:"z-0 relative bg-default-300/50 overflow-hidden rtl:rotate-180",indicator:"h-full"},variants:{color:{default:{indicator:"bg-default-400"},primary:{indicator:"bg-primary"},secondary:{indicator:"bg-secondary"},success:{indicator:"bg-success"},warning:{indicator:"bg-warning"},danger:{indicator:"bg-danger"}},size:{sm:{label:"text-small",value:"text-small",track:"h-1"},md:{label:"text-medium",value:"text-medium",track:"h-3"},lg:{label:"text-large",value:"text-large",track:"h-5"}},radius:{none:{track:"rounded-none",indicator:"rounded-none"},sm:{track:"rounded-small",indicator:"rounded-small"},md:{track:"rounded-medium",indicator:"rounded-medium"},lg:{track:"rounded-large",indicator:"rounded-large"},full:{track:"rounded-full",indicator:"rounded-full"}},isStriped:{true:{indicator:"bg-stripe-gradient-default bg-stripe-size"}},isIndeterminate:{true:{indicator:["absolute","w-full","origin-left","animate-indeterminate-bar"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-transform !duration-500"}}},defaultVariants:{color:"primary",size:"md",radius:"full",isStriped:!1,isIndeterminate:!1,isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{indicator:"!transition-none motion-reduce:transition-none"}},{color:"primary",isStriped:!0,class:{indicator:"bg-stripe-gradient-primary bg-stripe-size"}},{color:"secondary",isStriped:!0,class:{indicator:"bg-stripe-gradient-secondary bg-stripe-size"}},{color:"success",isStriped:!0,class:{indicator:"bg-stripe-gradient-success bg-stripe-size"}},{color:"warning",isStriped:!0,class:{indicator:"bg-stripe-gradient-warning bg-stripe-size"}},{color:"danger",isStriped:!0,class:{indicator:"bg-stripe-gradient-danger bg-stripe-size"}}]},{twMerge:!0});var yk=er({slots:{base:"flex flex-col justify-center gap-1 max-w-fit items-center",label:"",svgWrapper:"relative block",svg:"z-0 relative overflow-hidden",track:"h-full stroke-default-300/50",indicator:"h-full stroke-current",value:"absolute font-normal inset-0 flex items-center justify-center"},variants:{color:{default:{svg:"text-default-400"},primary:{svg:"text-primary"},secondary:{svg:"text-secondary"},success:{svg:"text-success"},warning:{svg:"text-warning"},danger:{svg:"text-danger"}},size:{sm:{svg:"w-8 h-8",label:"text-small",value:"text-[0.5rem]"},md:{svg:"w-10 h-10",label:"text-small",value:"text-[0.55rem]"},lg:{svg:"w-12 h-12",label:"text-medium",value:"text-[0.6rem]"}},isIndeterminate:{true:{svg:"animate-spinner-ease-spin"}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-all !duration-500"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{svg:"!transition-none motion-reduce:transition-none"}}]}),MF=["data-[top-scroll=true]:[mask-image:linear-gradient(0deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[bottom-scroll=true]:[mask-image:linear-gradient(180deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[top-bottom-scroll=true]:[mask-image:linear-gradient(#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],DF=["data-[left-scroll=true]:[mask-image:linear-gradient(270deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[right-scroll=true]:[mask-image:linear-gradient(90deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[left-right-scroll=true]:[mask-image:linear-gradient(to_right,#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],bk=er({base:[],variants:{orientation:{vertical:["overflow-y-auto",...MF],horizontal:["overflow-x-auto",...DF]},hideScrollBar:{true:"scrollbar-hide",false:""}},defaultVariants:{orientation:"vertical",hideScrollBar:!1}}),xk=er({slots:{base:["group","relative","overflow-hidden","bg-content3 dark:bg-content2","pointer-events-none","before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2","data-[loaded=true]:pointer-events-auto","data-[loaded=true]:overflow-visible","data-[loaded=true]:!bg-transparent","data-[loaded=true]:before:opacity-0 data-[loaded=true]:before:-z-10 data-[loaded=true]:before:animate-none","data-[loaded=true]:after:opacity-0"],content:["opacity-0","group-data-[loaded=true]:opacity-100"]},variants:{disableAnimation:{true:{base:"before:animate-none before:transition-none after:transition-none",content:"transition-none"},false:{base:"transition-background !duration-300",content:"transition-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{}}),wk=er({slots:{base:"group flex flex-col data-[hidden=true]:hidden",label:["absolute","z-10","pointer-events-none","origin-top-left","shrink-0","rtl:origin-top-right","subpixel-antialiased","block","text-small","text-foreground-500"],mainWrapper:"h-full",inputWrapper:"relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-xs px-3 gap-3",innerWrapper:"inline-flex w-full items-center h-full box-border",input:["w-full font-normal bg-transparent !outline-hidden placeholder:text-foreground-500 focus-visible:outline-hidden","data-[has-start-content=true]:ps-1.5","data-[has-end-content=true]:pe-1.5","data-[type=color]:rounded-none","file:cursor-pointer file:bg-transparent file:border-0","autofill:bg-transparent bg-clip-text"],clearButton:["p-2","-m-2","z-10","absolute","end-3","start-auto","pointer-events-none","appearance-none","outline-hidden","select-none","opacity-0","cursor-pointer","active:!opacity-70","rounded-full",...wh],helperWrapper:"hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger"},variants:{variant:{flat:{inputWrapper:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-100"]},faded:{inputWrapper:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 focus-within:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground"},bordered:{inputWrapper:["border-medium","border-default-200","data-[hover=true]:border-default-400","group-data-[focus=true]:border-default-foreground"]},underlined:{inputWrapper:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","group-data-[focus=true]:after:w-full"],innerWrapper:"pb-1",label:"group-data-[filled-within=true]:text-foreground"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{label:"text-tiny",inputWrapper:"h-8 min-h-8 px-2 rounded-small",input:"text-small",clearButton:"text-medium"},md:{inputWrapper:"h-10 min-h-10 rounded-medium",input:"text-small",clearButton:"text-large hover:!opacity-100"},lg:{label:"text-medium",inputWrapper:"h-12 min-h-12 rounded-large",input:"text-medium",clearButton:"text-large hover:!opacity-100"}},radius:{none:{inputWrapper:"rounded-none"},sm:{inputWrapper:"rounded-small"},md:{inputWrapper:"rounded-medium"},lg:{inputWrapper:"rounded-large"},full:{inputWrapper:"rounded-full"}},labelPlacement:{outside:{mainWrapper:"flex flex-col"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",inputWrapper:"flex-1",mainWrapper:"flex flex-col",label:"relative text-foreground pe-2 ps-2 pointer-events-auto"},"outside-top":{mainWrapper:"flex flex-col",label:"relative text-foreground pb-2 pointer-events-auto"},inside:{label:"cursor-text",inputWrapper:"flex-col items-start justify-center gap-0",innerWrapper:"group-data-[has-label=true]:items-end"}},fullWidth:{true:{base:"w-full"},false:{}},isClearable:{true:{input:"peer pe-6 input-search-cancel-button-none",clearButton:["peer-data-[filled=true]:pointer-events-auto","peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block","peer-data-[filled=true]:scale-100"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",inputWrapper:"pointer-events-none",label:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",input:"!placeholder:text-danger !text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",inputWrapper:"!h-auto",innerWrapper:"items-start group-data-[has-label=true]:items-start",input:"resize-none data-[hide-scroll=true]:scrollbar-hide",clearButton:"absolute top-2 right-2 rtl:right-auto rtl:left-2 z-10"}},disableAnimation:{true:{input:"transition-none",inputWrapper:"transition-none",label:"transition-none"},false:{inputWrapper:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","!duration-200","!ease-out","motion-reduce:transition-none","transition-[transform,color,left,opacity,translate,scale]"],clearButton:["scale-90","ease-out","duration-150","transition-[opacity,transform]","motion-reduce:transition-none","motion-reduce:scale-100"]}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1},compoundVariants:[{variant:"flat",color:"default",class:{input:"group-data-[has-value=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{inputWrapper:["bg-primary-100","data-[hover=true]:bg-primary-50","text-primary","group-data-[focus=true]:bg-primary-50","placeholder:text-primary"],input:"placeholder:text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{inputWrapper:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50","placeholder:text-secondary"],input:"placeholder:text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{inputWrapper:["bg-success-100","text-success-600","dark:text-success","placeholder:text-success-600","dark:placeholder:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],input:"placeholder:text-success-600 dark:placeholder:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{inputWrapper:["bg-warning-100","text-warning-600","dark:text-warning","placeholder:text-warning-600","dark:placeholder:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],input:"placeholder:text-warning-600 dark:placeholder:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{inputWrapper:["bg-danger-100","text-danger","dark:text-danger-500","placeholder:text-danger","dark:placeholder:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],input:"placeholder:text-danger dark:placeholder:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{label:"text-primary",inputWrapper:"data-[hover=true]:border-primary focus-within:border-primary"}},{variant:"faded",color:"secondary",class:{label:"text-secondary",inputWrapper:"data-[hover=true]:border-secondary focus-within:border-secondary"}},{variant:"faded",color:"success",class:{label:"text-success",inputWrapper:"data-[hover=true]:border-success focus-within:border-success"}},{variant:"faded",color:"warning",class:{label:"text-warning",inputWrapper:"data-[hover=true]:border-warning focus-within:border-warning"}},{variant:"faded",color:"danger",class:{label:"text-danger",inputWrapper:"data-[hover=true]:border-danger focus-within:border-danger"}},{variant:"underlined",color:"default",class:{input:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{inputWrapper:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{inputWrapper:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{inputWrapper:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{inputWrapper:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{inputWrapper:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{inputWrapper:"group-data-[focus=true]:border-primary",label:"text-primary"}},{variant:"bordered",color:"secondary",class:{inputWrapper:"group-data-[focus=true]:border-secondary",label:"text-secondary"}},{variant:"bordered",color:"success",class:{inputWrapper:"group-data-[focus=true]:border-success",label:"text-success"}},{variant:"bordered",color:"warning",class:{inputWrapper:"group-data-[focus=true]:border-warning",label:"text-warning"}},{variant:"bordered",color:"danger",class:{inputWrapper:"group-data-[focus=true]:border-danger",label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled-within=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled-within=true]:text-foreground"}},{radius:"full",size:["sm"],class:{inputWrapper:"px-3"}},{radius:"full",size:"md",class:{inputWrapper:"px-4"}},{radius:"full",size:"lg",class:{inputWrapper:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{inputWrapper:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{inputWrapper:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{inputWrapper:[...D_]}},{isInvalid:!0,variant:"flat",class:{inputWrapper:["!bg-danger-50","data-[hover=true]:!bg-danger-100","group-data-[focus=true]:!bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{inputWrapper:"!border-danger group-data-[focus=true]:!border-danger"}},{isInvalid:!0,variant:"underlined",class:{inputWrapper:"after:!bg-danger"}},{labelPlacement:"inside",size:"sm",class:{inputWrapper:"h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{inputWrapper:"h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{inputWrapper:"h-16 py-2.5 gap-0"}},{labelPlacement:"inside",size:"sm",variant:["bordered","faded"],class:{inputWrapper:"py-1"}},{labelPlacement:["inside","outside"],class:{label:["group-data-[filled-within=true]:pointer-events-auto"]}},{labelPlacement:"outside",isMultiline:!1,class:{base:"relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled-within=true]:start-0"]}},{labelPlacement:["inside"],class:{label:["group-data-[filled-within=true]:scale-85"]}},{labelPlacement:["inside"],variant:"flat",class:{innerWrapper:"pb-0.5"}},{variant:"underlined",size:"sm",class:{innerWrapper:"pb-1"}},{variant:"underlined",size:["md","lg"],class:{innerWrapper:"pb-1.5"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"lg",isMultiline:!1,class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-tiny)/2_+_16px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",size:"md",isMultiline:!1,class:{label:["start-3","end-auto","text-small","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",size:"lg",isMultiline:!1,class:{label:["start-3","end-auto","text-medium","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:["outside","outside-left"],isMultiline:!0,class:{inputWrapper:"py-2"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:"inside",isMultiline:!0,class:{label:"pb-0.5",input:"pt-0"}},{isMultiline:!0,disableAnimation:!1,class:{input:"transition-height !duration-100 motion-reduce:transition-none"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{isMultiline:!0,radius:"full",class:{inputWrapper:"data-[has-multiple-rows=true]:rounded-large"}},{isClearable:!0,isMultiline:!0,class:{clearButton:["group-data-[has-value=true]:opacity-70 group-data-[has-value=true]:block","group-data-[has-value=true]:scale-100","group-data-[has-value=true]:pointer-events-auto"]}}]}),Sk=er({slots:{wrapper:["flex","w-screen","h-[100dvh]","fixed","inset-0","z-50","overflow-x-auto","justify-center","h-[--visual-viewport-height]"],base:["flex","flex-col","relative","bg-white","z-50","w-full","box-border","bg-content1","outline-hidden","mx-1","my-1","sm:mx-6","sm:my-16"],backdrop:"z-50",header:"flex py-4 px-6 flex-initial text-large font-semibold",body:"flex flex-1 flex-col gap-3 px-6 py-2",footer:"flex flex-row gap-2 px-6 py-4 justify-end",closeButton:["absolute","appearance-none","outline-hidden","select-none","top-1","end-1","p-2","text-foreground-500","rounded-full","hover:bg-default-100","active:bg-default-200","tap-highlight-transparent",...wh]},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"},"3xl":{base:"max-w-3xl"},"4xl":{base:"max-w-4xl"},"5xl":{base:"max-w-5xl"},full:{base:"my-0 mx-0 sm:mx-0 sm:my-0 max-w-full h-[100dvh] min-h-[100dvh] !rounded-none"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},placement:{auto:{wrapper:"items-end sm:items-center"},center:{wrapper:"items-center sm:items-center"},top:{wrapper:"items-start sm:items-start"},"top-center":{wrapper:"items-start sm:items-center"},bottom:{wrapper:"items-end sm:items-end"},"bottom-center":{wrapper:"items-end sm:items-center"}},shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},backdrop:{transparent:{backdrop:"hidden"},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-md backdrop-saturate-150 bg-overlay/30"}},scrollBehavior:{normal:{base:"overflow-y-hidden"},inside:{base:"max-h-[calc(100%_-_8rem)]",body:"overflow-y-auto"},outside:{wrapper:"items-start sm:items-start overflow-y-auto",base:"my-16"}},disableAnimation:{false:{wrapper:["[--scale-enter:100%]","[--scale-exit:100%]","[--slide-enter:0px]","[--slide-exit:80px]","sm:[--scale-enter:100%]","sm:[--scale-exit:103%]","sm:[--slide-enter:0px]","sm:[--slide-exit:0px]"]}}},defaultVariants:{size:"md",radius:"lg",shadow:"sm",placement:"auto",backdrop:"opaque",scrollBehavior:"normal"},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"w-screen h-screen fixed inset-0"}}]}),NF=er({base:"shrink-0 bg-divider border-none",variants:{orientation:{horizontal:"w-full h-divider",vertical:"h-full w-divider"}},defaultVariants:{orientation:"horizontal"}}),OF=er({base:"flex flex-col gap-2 items-start"}),kk=er({slots:{wrapper:"relative shadow-black/5",zoomedWrapper:"relative overflow-hidden rounded-inherit",img:"relative z-10 opacity-0 shadow-black/5 data-[loaded=true]:opacity-100",blurredImg:["absolute","z-0","inset-0","w-full","h-full","object-cover","filter","blur-lg","scale-105","saturate-150","opacity-30","translate-y-1"]},variants:{radius:{none:{},sm:{},md:{},lg:{},full:{}},shadow:{none:{wrapper:"shadow-none",img:"shadow-none"},sm:{wrapper:"shadow-small",img:"shadow-small"},md:{wrapper:"shadow-medium",img:"shadow-medium"},lg:{wrapper:"shadow-large",img:"shadow-large"}},isZoomed:{true:{img:["object-cover","transform","hover:scale-125"]}},showSkeleton:{true:{wrapper:["group","relative","overflow-hidden","bg-content3 dark:bg-content2"],img:"opacity-0"}},disableAnimation:{true:{img:"transition-none"},false:{img:"transition-transform-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{radius:"lg",shadow:"none",isZoomed:!1,isBlurred:!1,showSkeleton:!1},compoundVariants:[{showSkeleton:!0,disableAnimation:!1,class:{wrapper:["before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2"]}}],compoundSlots:[{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"none",class:"rounded-none"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"full",class:"rounded-full"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"sm",class:"rounded-small"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"md",class:"rounded-md"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"lg",class:"rounded-large"}]}),FF=er({base:["z-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-hidden","select-none","whitespace-nowrap","min-w-max","font-normal","subpixel-antialiased","overflow-hidden","tap-highlight-transparent","transform-gpu data-[pressed=true]:scale-[0.97]","cursor-pointer",...wh],variants:{variant:{solid:"",bordered:"border-medium bg-transparent",light:"bg-transparent",flat:"",faded:"border-medium",shadow:"",ghost:"border-medium bg-transparent"},size:{sm:"px-3 min-w-16 h-8 text-tiny gap-2 rounded-small",md:"px-4 min-w-20 h-10 text-small gap-2 rounded-medium",lg:"px-6 min-w-24 h-12 text-medium gap-3 rounded-large"},color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},radius:{none:"rounded-none",sm:"rounded-small",md:"rounded-medium",lg:"rounded-large",full:"rounded-full"},fullWidth:{true:"w-full"},isDisabled:{true:"opacity-disabled pointer-events-none"},isInGroup:{true:"[&:not(:first-child):not(:last-child)]:rounded-none"},isIconOnly:{true:"px-0 !gap-0",false:"[&>svg]:max-w-[theme(spacing.8)]"},disableAnimation:{true:"!transition-none data-[pressed=true]:scale-100",false:"transition-transform-colors-opacity motion-reduce:transition-none"}},defaultVariants:{size:"md",variant:"solid",color:"default",fullWidth:!1,isDisabled:!1,isInGroup:!1},compoundVariants:[{variant:"solid",color:"default",class:Te.solid.default},{variant:"solid",color:"primary",class:Te.solid.primary},{variant:"solid",color:"secondary",class:Te.solid.secondary},{variant:"solid",color:"success",class:Te.solid.success},{variant:"solid",color:"warning",class:Te.solid.warning},{variant:"solid",color:"danger",class:Te.solid.danger},{variant:"shadow",color:"default",class:Te.shadow.default},{variant:"shadow",color:"primary",class:Te.shadow.primary},{variant:"shadow",color:"secondary",class:Te.shadow.secondary},{variant:"shadow",color:"success",class:Te.shadow.success},{variant:"shadow",color:"warning",class:Te.shadow.warning},{variant:"shadow",color:"danger",class:Te.shadow.danger},{variant:"bordered",color:"default",class:Te.bordered.default},{variant:"bordered",color:"primary",class:Te.bordered.primary},{variant:"bordered",color:"secondary",class:Te.bordered.secondary},{variant:"bordered",color:"success",class:Te.bordered.success},{variant:"bordered",color:"warning",class:Te.bordered.warning},{variant:"bordered",color:"danger",class:Te.bordered.danger},{variant:"flat",color:"default",class:Te.flat.default},{variant:"flat",color:"primary",class:Te.flat.primary},{variant:"flat",color:"secondary",class:Te.flat.secondary},{variant:"flat",color:"success",class:Te.flat.success},{variant:"flat",color:"warning",class:Te.flat.warning},{variant:"flat",color:"danger",class:Te.flat.danger},{variant:"faded",color:"default",class:Te.faded.default},{variant:"faded",color:"primary",class:Te.faded.primary},{variant:"faded",color:"secondary",class:Te.faded.secondary},{variant:"faded",color:"success",class:Te.faded.success},{variant:"faded",color:"warning",class:Te.faded.warning},{variant:"faded",color:"danger",class:Te.faded.danger},{variant:"light",color:"default",class:[Te.light.default,"data-[hover=true]:bg-default/40"]},{variant:"light",color:"primary",class:[Te.light.primary,"data-[hover=true]:bg-primary/20"]},{variant:"light",color:"secondary",class:[Te.light.secondary,"data-[hover=true]:bg-secondary/20"]},{variant:"light",color:"success",class:[Te.light.success,"data-[hover=true]:bg-success/20"]},{variant:"light",color:"warning",class:[Te.light.warning,"data-[hover=true]:bg-warning/20"]},{variant:"light",color:"danger",class:[Te.light.danger,"data-[hover=true]:bg-danger/20"]},{variant:"ghost",color:"default",class:[Te.ghost.default,"data-[hover=true]:!bg-default"]},{variant:"ghost",color:"primary",class:[Te.ghost.primary,"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground"]},{variant:"ghost",color:"secondary",class:[Te.ghost.secondary,"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground"]},{variant:"ghost",color:"success",class:[Te.ghost.success,"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground"]},{variant:"ghost",color:"warning",class:[Te.ghost.warning,"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground"]},{variant:"ghost",color:"danger",class:[Te.ghost.danger,"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground"]},{isInGroup:!0,class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,size:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,isRounded:!0,class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,radius:"none",class:"rounded-none first:rounded-s-none last:rounded-e-none"},{isInGroup:!0,radius:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,radius:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,radius:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,radius:"full",class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,variant:["ghost","bordered"],color:"default",className:lf.default},{isInGroup:!0,variant:["ghost","bordered"],color:"primary",className:lf.primary},{isInGroup:!0,variant:["ghost","bordered"],color:"secondary",className:lf.secondary},{isInGroup:!0,variant:["ghost","bordered"],color:"success",className:lf.success},{isInGroup:!0,variant:["ghost","bordered"],color:"warning",className:lf.warning},{isInGroup:!0,variant:["ghost","bordered"],color:"danger",className:lf.danger},{isIconOnly:!0,size:"sm",class:"min-w-8 w-8 h-8"},{isIconOnly:!0,size:"md",class:"min-w-10 w-10 h-10"},{isIconOnly:!0,size:"lg",class:"min-w-12 w-12 h-12"},{variant:["solid","faded","flat","bordered","shadow"],class:"data-[hover=true]:opacity-hover"}]});er({base:"inline-flex items-center justify-center h-auto",variants:{fullWidth:{true:"w-full"}},defaultVariants:{fullWidth:!1}});var zF=er({slots:{base:"group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none",wrapper:["relative","inline-flex","items-center","justify-center","shrink-0","overflow-hidden","before:content-['']","before:absolute","before:inset-0","before:border-solid","before:border-2","before:box-border","before:border-default","after:content-['']","after:absolute","after:inset-0","after:scale-50","after:opacity-0","after:origin-center","group-data-[selected=true]:after:scale-100","group-data-[selected=true]:after:opacity-100","group-data-[hover=true]:before:bg-default-100",...D_],hiddenInput:LF,icon:"z-10 w-4 h-3 opacity-0 group-data-[selected=true]:opacity-100 pointer-events-none",label:"relative text-foreground select-none"},variants:{color:{default:{wrapper:"after:bg-default after:text-default-foreground text-default-foreground"},primary:{wrapper:"after:bg-primary after:text-primary-foreground text-primary-foreground"},secondary:{wrapper:"after:bg-secondary after:text-secondary-foreground text-secondary-foreground"},success:{wrapper:"after:bg-success after:text-success-foreground text-success-foreground"},warning:{wrapper:"after:bg-warning after:text-warning-foreground text-warning-foreground"},danger:{wrapper:"after:bg-danger after:text-danger-foreground text-danger-foreground"}},size:{sm:{wrapper:["w-4 h-4 me-2","rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"],label:"text-small",icon:"w-3 h-2"},md:{wrapper:["w-5 h-5 me-2","rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"],label:"text-medium",icon:"w-4 h-3"},lg:{wrapper:["w-6 h-6 me-2","rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"],label:"text-large",icon:"w-5 h-4"}},radius:{none:{wrapper:"rounded-none before:rounded-none after:rounded-none"},sm:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"]},md:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"]},lg:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"]},full:{wrapper:"rounded-full before:rounded-full after:rounded-full"}},lineThrough:{true:{label:["inline-flex","items-center","justify-center","before:content-['']","before:absolute","before:bg-foreground","before:w-0","before:h-0.5","group-data-[selected=true]:opacity-60","group-data-[selected=true]:before:w-full"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isInvalid:{true:{wrapper:"before:border-danger",label:"text-danger"}},disableAnimation:{true:{wrapper:"transition-none",icon:"transition-none",label:"transition-none"},false:{wrapper:["before:transition-colors","group-data-[pressed=true]:scale-95","transition-transform","after:transition-transform-opacity","after:!ease-linear","after:!duration-200","motion-reduce:transition-none"],icon:"transition-opacity motion-reduce:transition-none",label:"transition-colors-opacity before:transition-width motion-reduce:transition-none"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1,lineThrough:!1}});er({slots:{base:"relative flex flex-col gap-2",label:"relative text-medium text-foreground-500",wrapper:"flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row",description:"text-small text-foreground-400",errorMessage:"text-small text-danger"},variants:{isRequired:{true:{label:"after:content-['*'] after:text-danger after:ml-0.5"}},isInvalid:{true:{description:"text-danger"}},disableAnimation:{true:{},false:{description:"transition-colors !duration-150 motion-reduce:transition-none"}}},defaultVariants:{isInvalid:!1,isRequired:!1}});var Ck=er({slots:{base:["relative","max-w-fit","min-w-min","inline-flex","items-center","justify-between","box-border","whitespace-nowrap"],content:"flex-1 text-inherit font-normal",dot:["w-2","h-2","ml-1","rounded-full"],avatar:"shrink-0",closeButton:["z-10","appearance-none","outline-hidden","select-none","transition-opacity","opacity-70","hover:opacity-100","cursor-pointer","active:opacity-disabled","tap-highlight-transparent"]},variants:{variant:{solid:{},bordered:{base:"border-medium bg-transparent"},light:{base:"bg-transparent"},flat:{},faded:{base:"border-medium"},shadow:{},dot:{base:"border-medium border-default text-foreground bg-transparent"}},color:{default:{dot:"bg-default-400"},primary:{dot:"bg-primary"},secondary:{dot:"bg-secondary"},success:{dot:"bg-success"},warning:{dot:"bg-warning"},danger:{dot:"bg-danger"}},size:{sm:{base:"px-1 h-6 text-tiny",content:"px-1",closeButton:"text-medium",avatar:"w-4 h-4"},md:{base:"px-1 h-7 text-small",content:"px-2",closeButton:"text-large",avatar:"w-5 h-5"},lg:{base:"px-2 h-8 text-medium",content:"px-2",closeButton:"text-xl",avatar:"w-6 h-6"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"},full:{base:"rounded-full"}},isOneChar:{true:{},false:{}},isCloseable:{true:{},false:{}},hasStartContent:{true:{}},hasEndContent:{true:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isCloseButtonFocusVisible:{true:{closeButton:[...RF,"ring-1","rounded-full"]}}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"full",isDisabled:!1},compoundVariants:[{variant:"solid",color:"default",class:{base:Te.solid.default}},{variant:"solid",color:"primary",class:{base:Te.solid.primary}},{variant:"solid",color:"secondary",class:{base:Te.solid.secondary}},{variant:"solid",color:"success",class:{base:Te.solid.success}},{variant:"solid",color:"warning",class:{base:Te.solid.warning}},{variant:"solid",color:"danger",class:{base:Te.solid.danger}},{variant:"shadow",color:"default",class:{base:Te.shadow.default}},{variant:"shadow",color:"primary",class:{base:Te.shadow.primary}},{variant:"shadow",color:"secondary",class:{base:Te.shadow.secondary}},{variant:"shadow",color:"success",class:{base:Te.shadow.success}},{variant:"shadow",color:"warning",class:{base:Te.shadow.warning}},{variant:"shadow",color:"danger",class:{base:Te.shadow.danger}},{variant:"bordered",color:"default",class:{base:Te.bordered.default}},{variant:"bordered",color:"primary",class:{base:Te.bordered.primary}},{variant:"bordered",color:"secondary",class:{base:Te.bordered.secondary}},{variant:"bordered",color:"success",class:{base:Te.bordered.success}},{variant:"bordered",color:"warning",class:{base:Te.bordered.warning}},{variant:"bordered",color:"danger",class:{base:Te.bordered.danger}},{variant:"flat",color:"default",class:{base:Te.flat.default}},{variant:"flat",color:"primary",class:{base:Te.flat.primary}},{variant:"flat",color:"secondary",class:{base:Te.flat.secondary}},{variant:"flat",color:"success",class:{base:Te.flat.success}},{variant:"flat",color:"warning",class:{base:Te.flat.warning}},{variant:"flat",color:"danger",class:{base:Te.flat.danger}},{variant:"faded",color:"default",class:{base:Te.faded.default}},{variant:"faded",color:"primary",class:{base:Te.faded.primary}},{variant:"faded",color:"secondary",class:{base:Te.faded.secondary}},{variant:"faded",color:"success",class:{base:Te.faded.success}},{variant:"faded",color:"warning",class:{base:Te.faded.warning}},{variant:"faded",color:"danger",class:{base:Te.faded.danger}},{variant:"light",color:"default",class:{base:Te.light.default}},{variant:"light",color:"primary",class:{base:Te.light.primary}},{variant:"light",color:"secondary",class:{base:Te.light.secondary}},{variant:"light",color:"success",class:{base:Te.light.success}},{variant:"light",color:"warning",class:{base:Te.light.warning}},{variant:"light",color:"danger",class:{base:Te.light.danger}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"sm",class:{base:"w-5 h-5 min-w-5 min-h-5"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"md",class:{base:"w-6 h-6 min-w-6 min-h-6"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"lg",class:{base:"w-7 h-7 min-w-7 min-h-7"}},{isOneChar:!0,isCloseable:!1,hasStartContent:!1,hasEndContent:!1,class:{base:"px-0 justify-center",content:"px-0 flex-none"}},{isOneChar:!0,isCloseable:!0,hasStartContent:!1,hasEndContent:!1,class:{base:"w-auto"}},{isOneChar:!0,variant:"dot",class:{base:"w-auto h-7 px-1 items-center",content:"px-2"}},{hasStartContent:!0,size:"sm",class:{content:"pl-0.5"}},{hasStartContent:!0,size:["md","lg"],class:{content:"pl-1"}},{hasEndContent:!0,size:"sm",class:{content:"pr-0.5"}},{hasEndContent:!0,size:["md","lg"],class:{content:"pr-1"}}]}),jF=er({base:"px-2",variants:{variant:{light:"",shadow:"px-4 shadow-medium rounded-medium bg-content1",bordered:"px-4 border-medium border-divider rounded-medium",splitted:"flex flex-col gap-2"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"light",fullWidth:!0}}),BF=er({slots:{base:"",heading:"",trigger:["flex py-4 w-full h-full gap-3 outline-hidden items-center tap-highlight-transparent",...wh],startContent:"shrink-0",indicator:"text-default-400",titleWrapper:"flex-1 flex flex-col text-start",title:"text-foreground text-medium",subtitle:"text-small text-foreground-500 font-normal",content:"py-2"},variants:{variant:{splitted:{base:"px-4 bg-content1 shadow-medium rounded-medium"}},isCompact:{true:{trigger:"py-2",title:"text-medium",subtitle:"text-small",indicator:"text-medium",content:"py-1"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},hideIndicator:{true:{indicator:"hidden"}},disableAnimation:{true:{content:"hidden data-[open=true]:block"},false:{indicator:"transition-transform",trigger:"transition-opacity"}},disableIndicatorAnimation:{true:{indicator:"transition-none"},false:{indicator:"rotate-0 data-[open=true]:-rotate-90 rtl:-rotate-180 rtl:data-[open=true]:-rotate-90"}}},defaultVariants:{size:"md",radius:"lg",isDisabled:!1,hideIndicator:!1,disableIndicatorAnimation:!1}});function N_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0){let d=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(h=>{if(h=WF(h),h in Ek)return;Ek[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":KF,m||(b.as="script"),b.crossOrigin="",b.href=h,c&&b.setAttribute("nonce",c),document.head.appendChild(b),m)return new Promise((x,k)=>{b.addEventListener("load",x),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};function HF(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button"}=e,T;n==="button"?T={type:P,disabled:r}:T={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:_,isPressed:A}=ol({onPressStart:s,onPressEnd:a,onPressChange:d,onPress:i,onPressUp:c,onClick:g,isDisabled:r,preventFocusOnPress:h,ref:t}),{focusableProps:M}=xh(e,t);m&&(M.tabIndex=r?-1:M.tabIndex);let F=Tn(M,_,Au(e,{labelable:!0}));return{isPressed:A,buttonProps:Tn(T,F,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}function GF(e,t,n){let{item:r,isDisabled:i}=e,s=r.key,a=t.selectionManager,c=S.useId(),d=S.useId(),h=t.disabledKeys.has(r.key)||i;S.useEffect(()=>{s===t.focusedKey&&document.activeElement!==n.current&&n.current&&Eu(n.current)},[n,s,t.focusedKey]);let m=S.useCallback(P=>{a.canSelectItem(s)&&(a.select(s,P),t.toggleKey(s))},[s,a]);const g=S.useCallback(P=>{a.selectionBehavior==="replace"&&a.extendSelection(P),a.setFocusedKey(P)},[a]),b=S.useCallback(P=>{const _={ArrowDown:()=>{const A=t.collection.getKeyAfter(s);if(A&&t.disabledKeys.has(A)){const M=t.collection.getKeyAfter(A);M&&g(M)}else A&&g(A)},ArrowUp:()=>{const A=t.collection.getKeyBefore(s);if(A&&t.disabledKeys.has(A)){const M=t.collection.getKeyBefore(A);M&&g(M)}else A&&g(A)},Home:()=>{const A=t.collection.getFirstKey();A&&g(A)},End:()=>{const A=t.collection.getLastKey();A&&g(A)}}[P.key];_&&(P.preventDefault(),a.canSelectItem(s)&&_(P))},[s,a]);let{buttonProps:x}=HF({id:c,elementType:"button",isDisabled:h,onKeyDown:b,onPress:m},n),k=t.selectionManager.isSelected(r.key);return{buttonProps:{...x,"aria-expanded":k,"aria-controls":k?d:void 0},regionProps:{id:d,role:"region","aria-labelledby":c}}}function Pk(e){return vM()?e.altKey:e.ctrlKey}function Mg(e,t){var n,r;let i=`[data-key="${CSS.escape(String(t))}"]`,s=(n=e.current)===null||n===void 0?void 0:n.dataset.collection;return s&&(i=`[data-collection="${CSS.escape(s)}"]${i}`),(r=e.current)===null||r===void 0?void 0:r.querySelector(i)}const O_=new WeakMap;function qF(e){let t=Pf();return O_.set(e,t),t}function JG(e){return O_.get(e)}const YF=1e3;function XF(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=S.useRef({search:"",timeout:void 0}).current,s=a=>{let c=QF(a.key);if(!(!c||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target))){if(c===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=c,t.getKeyForSearch!=null){let d=t.getKeyForSearch(i.search,n.focusedKey);d==null&&(d=t.getKeyForSearch(i.search)),d!=null&&(n.setFocusedKey(d),r&&r(d))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},YF)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function QF(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function JF(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:s=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:d="clearSelection",selectOnFocus:h=t.selectionBehavior==="replace",disallowTypeAhead:m=!1,shouldUseVirtualFocus:g,allowsTabNavigation:b=!1,isVirtualized:x,scrollRef:k=r,linkBehavior:P="action"}=e,{direction:T}=hh(),_=ux(),A=X=>{var V;if(X.altKey&&X.key==="Tab"&&X.preventDefault(),!(!((V=r.current)===null||V===void 0)&&V.contains(X.target)))return;const ae=(Ie,mt)=>{if(Ie!=null){if(t.isLink(Ie)&&P==="selection"&&h&&!Pk(X)){zE.flushSync(()=>{t.setFocusedKey(Ie,mt)});let pt=Mg(r,Ie),Ut=t.getItemProps(Ie);pt&&_.open(pt,X,Ut.href,Ut.routerOptions);return}if(t.setFocusedKey(Ie,mt),t.isLink(Ie)&&P==="override")return;X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&!Pk(X)&&t.replaceSelection(Ie)}};switch(X.key){case"ArrowDown":if(n.getKeyBelow){var D,U,oe;let Ie=t.focusedKey!=null?(D=n.getKeyBelow)===null||D===void 0?void 0:D.call(n,t.focusedKey):(U=n.getFirstKey)===null||U===void 0?void 0:U.call(n);Ie==null&&s&&(Ie=(oe=n.getFirstKey)===null||oe===void 0?void 0:oe.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"ArrowUp":if(n.getKeyAbove){var z,me,Ce;let Ie=t.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,t.focusedKey):(me=n.getLastKey)===null||me===void 0?void 0:me.call(n);Ie==null&&s&&(Ie=(Ce=n.getLastKey)===null||Ce===void 0?void 0:Ce.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ye,Fe,Ne;let Ie=t.focusedKey!=null?(ye=n.getKeyLeftOf)===null||ye===void 0?void 0:ye.call(n,t.focusedKey):null;Ie==null&&s&&(Ie=T==="rtl"?(Fe=n.getFirstKey)===null||Fe===void 0?void 0:Fe.call(n,t.focusedKey):(Ne=n.getLastKey)===null||Ne===void 0?void 0:Ne.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie,T==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var _e,Qe,at;let Ie=t.focusedKey!=null?(_e=n.getKeyRightOf)===null||_e===void 0?void 0:_e.call(n,t.focusedKey):null;Ie==null&&s&&(Ie=T==="rtl"?(Qe=n.getLastKey)===null||Qe===void 0?void 0:Qe.call(n,t.focusedKey):(at=n.getFirstKey)===null||at===void 0?void 0:at.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie,T==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Ie=n.getFirstKey(t.focusedKey,hp(X));t.setFocusedKey(Ie),Ie!=null&&(hp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&t.replaceSelection(Ie))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Ie=n.getLastKey(t.focusedKey,hp(X));t.setFocusedKey(Ie),Ie!=null&&(hp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&t.replaceSelection(Ie))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let Ie=n.getKeyPageBelow(t.focusedKey);Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let Ie=n.getKeyPageAbove(t.focusedKey);Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"a":hp(X)&&t.selectionMode==="multiple"&&c!==!0&&(X.preventDefault(),t.selectAll());break;case"Escape":d==="clearSelection"&&!a&&t.selectedKeys.size!==0&&(X.stopPropagation(),X.preventDefault(),t.clearSelection());break;case"Tab":if(!b){if(X.shiftKey)r.current.focus();else{let Ie=Js(r.current,{tabbable:!0}),mt,pt;do pt=Ie.lastChild(),pt&&(mt=pt);while(pt);mt&&!mt.contains(document.activeElement)&&nl(mt)}break}}},M=S.useRef({top:0,left:0});lg(k,"scroll",x?void 0:()=>{var X,V,ae,D;M.current={top:(ae=(X=k.current)===null||X===void 0?void 0:X.scrollTop)!==null&&ae!==void 0?ae:0,left:(D=(V=k.current)===null||V===void 0?void 0:V.scrollLeft)!==null&&D!==void 0?D:0}});let F=X=>{if(t.isFocused){X.currentTarget.contains(X.target)||t.setFocused(!1);return}if(X.currentTarget.contains(X.target)){if(t.setFocused(!0),t.focusedKey==null){var V,ae;let oe=me=>{me!=null&&(t.setFocusedKey(me),h&&!t.isSelected(me)&&t.replaceSelection(me))},z=X.relatedTarget;var D,U;z&&X.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?oe((D=t.lastSelectedKey)!==null&&D!==void 0?D:(V=n.getLastKey)===null||V===void 0?void 0:V.call(n)):oe((U=t.firstSelectedKey)!==null&&U!==void 0?U:(ae=n.getFirstKey)===null||ae===void 0?void 0:ae.call(n))}else!x&&k.current&&(k.current.scrollTop=M.current.top,k.current.scrollLeft=M.current.left);if(t.focusedKey!=null&&k.current){let oe=Mg(r,t.focusedKey);oe instanceof HTMLElement&&(!oe.contains(document.activeElement)&&!g&&nl(oe),oh()==="keyboard"&&T1(oe,{containingElement:r.current}))}}},j=X=>{X.currentTarget.contains(X.relatedTarget)||t.setFocused(!1)},$=S.useRef(!1);lg(r,TM,g?X=>{let{detail:V}=X;X.stopPropagation(),t.setFocused(!0),V?.focusStrategy==="first"&&($.current=!0)}:void 0);let Y=Bn(()=>{var X,V;let ae=(V=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&V!==void 0?V:null;ae==null?(cO(r.current),t.collection.size>0&&($.current=!1)):(t.setFocusedKey(ae),$.current=!1)});C1(()=>{$.current&&Y()},[t.collection,Y]);let te=Bn(()=>{t.collection.size>0&&($.current=!1)});C1(()=>{te()},[t.focusedKey,te]),lg(r,PM,g?X=>{var V;X.stopPropagation(),t.setFocused(!1),!((V=X.detail)===null||V===void 0)&&V.clearFocusKey&&t.setFocusedKey(null)}:void 0);const ie=S.useRef(i),B=S.useRef(!1);S.useEffect(()=>{if(ie.current){var X,V;let U=null;var ae;i==="first"&&(U=(ae=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&ae!==void 0?ae:null);var D;i==="last"&&(U=(D=(V=n.getLastKey)===null||V===void 0?void 0:V.call(n))!==null&&D!==void 0?D:null);let oe=t.selectedKeys;if(oe.size){for(let z of oe)if(t.canSelectItem(z)){U=z;break}}t.setFocused(!0),t.setFocusedKey(U),U==null&&!g&&r.current&&Eu(r.current),t.collection.size>0&&(ie.current=!1,B.current=!0)}});let W=S.useRef(t.focusedKey),G=S.useRef(null);S.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==W.current||B.current)&&k.current&&r.current){let X=oh(),V=Mg(r,t.focusedKey);if(!(V instanceof HTMLElement))return;(X==="keyboard"||B.current)&&(G.current&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{k.current&&(NE(k.current,V),X!=="virtual"&&T1(V,{containingElement:r.current}))}))}!g&&t.isFocused&&t.focusedKey==null&&W.current!=null&&r.current&&Eu(r.current),W.current=t.focusedKey,B.current=!1}),S.useEffect(()=>()=>{G.current&&cancelAnimationFrame(G.current)},[]),lg(r,"react-aria-focus-scope-restore",X=>{X.preventDefault(),t.setFocused(!0)});let ee={onKeyDown:A,onFocus:F,onBlur:j,onMouseDown(X){k.current===X.target&&X.preventDefault()}},{typeSelectProps:H}=XF({keyboardDelegate:n,selectionManager:t});m||(ee=Tn(H,ee));let le;g||(le=t.focusedKey==null?0:-1);let J=qF(t.collection);return{collectionProps:Tn(ee,{tabIndex:le,"data-collection":J})}}class Tk{getItemRect(t){let n=this.ref.current;if(!n)return null;let r=t!=null?Mg(this.ref,t):null;if(!r)return null;let i=n.getBoundingClientRect(),s=r.getBoundingClientRect();return{x:s.left-i.left+n.scrollLeft,y:s.top-i.top+n.scrollTop,width:s.width,height:s.height}}getContentSize(){let t=this.ref.current;var n,r;return{width:(n=t?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=t?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let t=this.ref.current;var n,r,i,s;return{x:(n=t?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=t?.scrollTop)!==null&&r!==void 0?r:0,width:(i=t?.offsetWidth)!==null&&i!==void 0?i:0,height:(s=t?.offsetHeight)!==null&&s!==void 0?s:0}}constructor(t){this.ref=t}}class ZF{isDisabled(t){var n;return this.disabledBehavior==="all"&&(((n=t.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,n){let r=t;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(t){let n=t;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(t){let n=t;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(t,n,r){let i=t,s=this.layoutDelegate.getItemRect(i);if(!s||i==null)return null;let a=s;do{if(i=n(i),i==null)break;s=this.layoutDelegate.getItemRect(i)}while(s&&r(a,s)&&i!=null);return i}isSameRow(t,n){return t.y===n.y||t.x!==n.x}isSameColumn(t,n){return t.x===n.x||t.y!==n.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,n){return n?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyAfter(n))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!qp(n))return this.getFirstKey();let i=t;if(this.orientation==="horizontal"){let s=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!qp(n))return this.getLastKey();let i=t;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xs||new ZF({collection:n,disabledKeys:r,disabledBehavior:d,ref:i,collator:c,layoutDelegate:a}),[s,a,n,r,i,c,d]),{collectionProps:m}=JF({...e,ref:i,selectionManager:t,keyboardDelegate:h});return{listProps:m}}function t6(e,t,n){let{listProps:r}=e6({...e,...t,allowsTabNavigation:!0,disallowSelectAll:!0,ref:n});return delete r.onKeyDownCapture,{accordionProps:{...r,tabIndex:void 0}}}function n6(e){var t,n;const r=ci(),{ref:i,as:s,item:a,onFocusChange:c}=e,{state:d,className:h,indicator:m,children:g,title:b,subtitle:x,startContent:k,motionProps:P,focusedKey:T,variant:_,isCompact:A=!1,classNames:M={},isDisabled:F=!1,hideIndicator:j=!1,disableAnimation:$=(t=r?.disableAnimation)!=null?t:!1,keepContentMounted:Y=!1,disableIndicatorAnimation:te=!1,HeadingComponent:ie=s||"h2",onPress:B,onPressStart:W,onPressEnd:G,onPressChange:ee,onPressUp:H,onClick:le,...J}=e,X=s||"div",V=typeof X=="string",ae=$i(i),D=d.disabledKeys.has(a.key)||F,U=d.selectionManager.isSelected(a.key),{buttonProps:oe,regionProps:z}=GF({item:a,isDisabled:D},{...d,focusedKey:T},ae),{onFocus:me,onBlur:Ce,...ye}=oe,{isFocused:Fe,isFocusVisible:Ne,focusProps:_e}=Tu({autoFocus:(n=a.props)==null?void 0:n.autoFocus}),{isHovered:Qe,hoverProps:at}=Pu({isDisabled:D}),{pressProps:Ie,isPressed:mt}=ol({ref:ae,isDisabled:D,onPress:B,onPressStart:W,onPressEnd:G,onPressChange:ee,onPressUp:H}),pt=S.useCallback(()=>{c?.(!0,a.key)},[]),Ut=S.useCallback(()=>{c?.(!1,a.key)},[]),Ue=S.useMemo(()=>({...M}),[ds(M)]),it=S.useMemo(()=>BF({isCompact:A,isDisabled:D,hideIndicator:j,disableAnimation:$,disableIndicatorAnimation:te,variant:_}),[A,D,j,$,te,_]),Kt=Bt(Ue?.base,h),tr=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"base",className:it.base({class:Kt}),...nn(Ef(J,{enabled:V}),pe)}),[Kt,V,J,it,a.props,U,D]),an=(pe={})=>{var Se,ze;return{ref:ae,"data-open":Ae(U),"data-focus":Ae(Fe),"data-focus-visible":Ae(Ne),"data-disabled":Ae(D),"data-hover":Ae(Qe),"data-pressed":Ae(mt),"data-slot":"trigger",className:it.trigger({class:Ue?.trigger}),onFocus:h1(pt,me,_e.onFocus,J.onFocus,(Se=a.props)==null?void 0:Se.onFocus),onBlur:h1(Ut,Ce,_e.onBlur,J.onBlur,(ze=a.props)==null?void 0:ze.onBlur),...nn(ye,at,Ie,pe,{onClick:tl(Ie.onClick,le)})}},_t=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"content",className:it.content({class:Ue?.content}),...nn(z,pe)}),[it,Ue,z,U,D,Ue?.content]),Rt=S.useCallback((pe={})=>({"aria-hidden":Ae(!0),"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"indicator",className:it.indicator({class:Ue?.indicator}),...pe}),[it,Ue?.indicator,U,D,Ue?.indicator]),_n=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"heading",className:it.heading({class:Ue?.heading}),...pe}),[it,Ue?.heading,U,D,Ue?.heading]),Er=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"title",className:it.title({class:Ue?.title}),...pe}),[it,Ue?.title,U,D,Ue?.title]),Nt=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(D),"data-slot":"subtitle",className:it.subtitle({class:Ue?.subtitle}),...pe}),[it,Ue,U,D,Ue?.subtitle]);return{Component:X,HeadingComponent:ie,item:a,slots:it,classNames:Ue,domRef:ae,indicator:m,children:g,title:b,subtitle:x,startContent:k,isOpen:U,isDisabled:D,hideIndicator:j,keepContentMounted:Y,disableAnimation:$,motionProps:P,getBaseProps:tr,getHeadingProps:_n,getButtonProps:an,getContentProps:_t,getIndicatorProps:Rt,getTitleProps:Er,getSubtitleProps:Nt}}var _k=e=>L.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:L.jsx("path",{d:"M15.5 19l-7-7 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),F_=e=>L.jsx("svg",{"aria-hidden":"true",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:L.jsx("path",{d:"M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",fill:"currentColor"})}),r6=e=>{const{isSelected:t,isIndeterminate:n,disableAnimation:r,...i}=e;return L.jsx("svg",{"aria-hidden":"true",className:"fill-current",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...i,children:L.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})},Bp={ease:[.36,.66,.4,1]},Zg={scaleSpring:{enter:{transform:"scale(1)",opacity:1,transition:{type:"spring",bounce:0,duration:.2}},exit:{transform:"scale(0.85)",opacity:0,transition:{type:"easeOut",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:"scale(0.8)"},enter:{opacity:1,transform:"scale(1)",transition:{type:"spring",bounce:0,duration:.3}},exit:{opacity:0,transform:"scale(0.96)",transition:{type:"easeOut",bounce:0,duration:.15}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:Bp.ease}},exit:{opacity:0,transition:{duration:.3,ease:Bp.ease}}},collapse:{enter:{opacity:1,height:"auto",transition:{height:{type:"spring",bounce:0,duration:.3},opacity:{easings:"ease",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:"ease",duration:.3}}}},Ik=()=>fi(()=>import("./index-Bvn9K6h_.js"),[]).then(e=>e.default),z_=jr((e,t)=>{const{Component:n,HeadingComponent:r,classNames:i,slots:s,indicator:a,children:c,title:d,subtitle:h,startContent:m,isOpen:g,isDisabled:b,hideIndicator:x,keepContentMounted:k,disableAnimation:P,motionProps:T,getBaseProps:_,getHeadingProps:A,getButtonProps:M,getTitleProps:F,getSubtitleProps:j,getContentProps:$,getIndicatorProps:Y}=n6({...e,ref:t}),te=x5(),B=S.useMemo(()=>typeof a=="function"?a({indicator:L.jsx(_k,{}),isOpen:g,isDisabled:b}):a||null,[a,g,b])||L.jsx(_k,{}),W=S.useMemo(()=>{if(P)return k?L.jsx("div",{...$(),children:c}):g&&L.jsx("div",{...$(),children:c});const G={exit:{...Zg.collapse.exit,overflowY:"hidden"},enter:{...Zg.collapse.enter,overflowY:"unset"}};return k?L.jsx($f,{features:Ik,children:L.jsx(Af.section,{animate:g?"enter":"exit",exit:"exit",initial:"exit",style:{willChange:te},variants:G,onKeyDown:ee=>{ee.stopPropagation()},...T,children:L.jsx("div",{...$(),children:c})},"accordion-content")}):L.jsx(sl,{initial:!1,children:g&&L.jsx($f,{features:Ik,children:L.jsx(Af.section,{animate:"enter",exit:"exit",initial:"exit",style:{willChange:te},variants:G,onKeyDown:ee=>{ee.stopPropagation()},...T,children:L.jsx("div",{...$(),children:c})},"accordion-content")})})},[g,P,k,c,T]);return L.jsxs(n,{..._(),children:[L.jsx(r,{...A(),children:L.jsxs("button",{...M(),children:[m&&L.jsx("div",{className:s.startContent({class:i?.startContent}),children:m}),L.jsxs("div",{className:s.titleWrapper({class:i?.titleWrapper}),children:[d&&L.jsx("span",{...F(),children:d}),h&&L.jsx("span",{...j(),children:h})]}),!x&&B&&L.jsx("span",{...Y(),children:B})]})}),W]})});z_.displayName="HeroUI.AccordionItem";var i6=z_;class o6{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(t){let n=this.keyMap.get(t);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var n;return(n=this.keyMap.get(t))!==null&&n!==void 0?n:null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}constructor(t,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,n=n||new Set;let r=c=>{if(this.keyMap.set(c.key,c),c.childNodes&&(c.type==="section"||n.has(c.key)))for(let d of c.childNodes)r(d)};for(let c of t)r(c);let i=null,s=0;for(let[c,d]of this.keyMap)i?(i.nextKey=c,d.prevKey=i.key):(this.firstKey=c,d.prevKey=void 0),d.type==="item"&&(d.index=s++),i=d,i.nextKey=void 0;var a;this.lastKey=(a=i?.key)!==null&&a!==void 0?a:null}}class Po extends Set{constructor(t,n,r){super(t),t instanceof Po?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function s6(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function a6(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:s="all"}=e,a=S.useRef(!1),[,c]=S.useState(!1),d=S.useRef(null),h=S.useRef(null),[,m]=S.useState(null),g=S.useMemo(()=>$k(e.selectedKeys),[e.selectedKeys]),b=S.useMemo(()=>$k(e.defaultSelectedKeys,new Po),[e.defaultSelectedKeys]),[x,k]=Ru(g,b,e.onSelectionChange),P=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[T,_]=S.useState(i);i==="replace"&&T==="toggle"&&typeof x=="object"&&x.size===0&&_("replace");let A=S.useRef(i);return S.useEffect(()=>{i!==A.current&&(_(i),A.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:T,setSelectionBehavior:_,get isFocused(){return a.current},setFocused(M){a.current=M,c(M)},get focusedKey(){return d.current},get childFocusStrategy(){return h.current},setFocusedKey(M,F="first"){d.current=M,h.current=F,m(M)},selectedKeys:x,setSelectedKeys(M){(r||!s6(M,x))&&k(M)},disabledKeys:P,disabledBehavior:s}}function $k(e,t){return e?e==="all"?"all":new Po(e):t}function j_(e){return null}j_.getCollectionNode=function*(t,n){let{childItems:r,title:i,children:s}=t,a=t.title||t.children,c=t.textValue||(typeof a=="string"?a:"")||t["aria-label"]||"";!c&&n?.suppressTextValueWarning,yield{type:"item",props:t,rendered:a,textValue:c,"aria-label":t["aria-label"],hasChildNodes:l6(t),*childNodes(){if(r)for(let d of r)yield{type:"item",value:d};else if(i){let d=[];He.Children.forEach(s,h=>{d.push({type:"item",element:h})}),yield*d}}}};function l6(e){return e.hasChildItems!=null?e.hasChildItems:!!(e.childItems||e.title&&He.Children.count(e.children)>0)}let u6=j_;class c6{build(t,n){return this.context=n,Ak(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:r}=t;if(He.isValidElement(n)&&n.type===He.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let s of r)yield*this.getFullNode({value:s,index:i},{renderer:n}),i++}else{let i=[];He.Children.forEach(n,a=>{a&&i.push(a)});let s=0;for(let a of i){let c=this.getFullNode({element:a,index:s},{});for(let d of c)s++,yield d}}}getKey(t,n,r,i){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let s=n.value;if(s!=null){var a;let c=(a=s.key)!==null&&a!==void 0?a:s.id;if(c==null)throw new Error("No key found for item");return c}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,r,i){if(He.isValidElement(t.element)&&t.element.type===He.Fragment){let T=[];He.Children.forEach(t.element.props.children,A=>{T.push(A)});var s;let _=(s=t.index)!==null&&s!==void 0?s:0;for(const A of T)yield*this.getFullNode({element:A,index:_++},n,r,i);return}let a=t.element;if(!a&&t.value&&n&&n.renderer){let T=this.cache.get(t.value);if(T&&(!T.shouldInvalidate||!T.shouldInvalidate(this.context))){T.index=t.index,T.parentKey=i?i.key:null,yield T;return}a=n.renderer(t.value)}if(He.isValidElement(a)){let T=a.type;if(typeof T!="function"&&typeof T.getCollectionNode!="function"){let F=a.type;throw new Error(`Unknown element <${F}> in collection.`)}let _=T.getCollectionNode(a.props,this.context);var c;let A=(c=t.index)!==null&&c!==void 0?c:0,M=_.next();for(;!M.done&&M.value;){let F=M.value;t.index=A;var d;let j=(d=F.key)!==null&&d!==void 0?d:null;j==null&&(j=F.element?null:this.getKey(a,t,n,r));let Y=[...this.getFullNode({...F,key:j,index:A,wrapper:f6(t.wrapper,F.wrapper)},this.getChildState(n,F),r?`${r}${a.key}`:a.key,i)];for(let te of Y){var h,m;te.value=(m=(h=F.value)!==null&&h!==void 0?h:t.value)!==null&&m!==void 0?m:null,te.value&&this.cache.set(te.value,te);var g;if(t.type&&te.type!==t.type)throw new Error(`Unsupported type <${m0(te.type)}> in <${m0((g=i?.type)!==null&&g!==void 0?g:"unknown parent type")}>. Only <${m0(t.type)}> is supported.`);A++,yield te}M=_.next(Y)}return}if(t.key==null||t.type==null)return;let b=this;var x,k;let P={type:t.type,props:t.props,key:t.key,parentKey:i?i.key:null,value:(x=t.value)!==null&&x!==void 0?x:null,level:i?i.level+1:0,index:t.index,rendered:t.rendered,textValue:(k=t.textValue)!==null&&k!==void 0?k:"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:Ak(function*(){if(!t.hasChildNodes||!t.childNodes)return;let T=0;for(let _ of t.childNodes()){_.key!=null&&(_.key=`${P.key}${_.key}`);let A=b.getFullNode({..._,index:T},b.getChildState(n,_),P.key,P);for(let M of A)T++,yield M}})};yield P}constructor(){this.cache=new WeakMap}}function Ak(e){let t=[],n=null;return{*[Symbol.iterator](){for(let r of t)yield r;n||(n=e());for(let r of n)t.push(r),yield r}}}function f6(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function m0(e){return e[0].toUpperCase()+e.slice(1)}function d6(e,t,n){let r=S.useMemo(()=>new c6,[]),{children:i,items:s,collection:a}=e;return S.useMemo(()=>{if(a)return a;let d=r.build({children:i,items:s},n);return t(d)},[r,i,s,a,n,t])}function p6(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function h6(e){return m6(e,0)}function m6(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function ZG(e){let t;for(let n of e)t=n;return t}function g0(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...Rk(e,t),t],i=[...Rk(e,n),n],s=r.slice(0,i.length).findIndex((a,c)=>a!==i[c]);return s!==-1?(t=r[s],n=i[s],t.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===t)>=0,-1)}function Rk(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}class Jx{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&g0(this.collection,i,t)<0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&g0(this.collection,i,t)>0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Po([n],n,n);else{let a=this.state.selectedKeys;var i;let c=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new Po(a,c,n);var s;for(let d of this.getKeyRange(c,(s=a.currentKey)!==null&&s!==void 0?s:n))r.delete(d);for(let d of this.getKeyRange(n,c))this.canSelectItem(d)&&r.add(d)}this.state.setSelectedKeys(r)}getKeyRange(t,n){let r=this.collection.getItem(t),i=this.collection.getItem(n);return r&&i?g0(this.collection,r,i)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let i=[],s=t;for(;s!=null;){let a=this.collection.getItem(s);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(s),s===n)return i;s=this.collection.getKeyAfter(s)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r=new Po(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let r=this.canSelectItem(n)?new Po([n],n,n):new Po;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new Po;for(let r of t){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=[],n=r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&t.push(r);var s;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((s=(i=h6(p6(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&s!==void 0?s:null)}r=this.collection.getKeyAfter(r)}};return n(this.collection.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Po)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let r of t)if(!n.has(r))return!1;for(let r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let r=this.collection.getItem(t);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(t){var n,r;return!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(t){var n;return(n=this.collection.getItem(t))===null||n===void 0?void 0:n.props}withCollection(t){return new Jx(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(t,n,r){this.collection=t,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}}function g6(e){let{onExpandedChange:t}=e,[n,r]=Ru(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=a6(e),s=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=d6(e,S.useCallback(d=>new o6(d,{expandedKeys:n}),[n]),null);return S.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:s,toggleKey:d=>{r(v6(n,d))},setExpandedKeys:r,selectionManager:new Jx(a,i)}}function v6(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function y6(e){var t;const n=ci(),{ref:r,as:i,className:s,items:a,variant:c,motionProps:d,expandedKeys:h,disabledKeys:m,selectedKeys:g,children:b,defaultExpandedKeys:x,selectionMode:k="single",selectionBehavior:P="toggle",keepContentMounted:T=!1,disallowEmptySelection:_,defaultSelectedKeys:A,onExpandedChange:M,onSelectionChange:F,dividerProps:j={},isCompact:$=!1,isDisabled:Y=!1,showDivider:te=!0,hideIndicator:ie=!1,disableAnimation:B=(t=n?.disableAnimation)!=null?t:!1,disableIndicatorAnimation:W=!1,itemClasses:G,...ee}=e,[H,le]=S.useState(null),J=i||"div",X=typeof J=="string",V=$i(r),ae=S.useMemo(()=>jF({variant:c,className:s}),[c,s]),U={children:S.useMemo(()=>{let _e=[];return He.Children.map(b,Qe=>{var at;if(He.isValidElement(Qe)&&typeof((at=Qe.props)==null?void 0:at.children)!="string"){const Ie=He.cloneElement(Qe,{hasChildItems:!1});_e.push(Ie)}else _e.push(Qe)}),_e},[b]),items:a},oe={expandedKeys:h,defaultExpandedKeys:x,onExpandedChange:M},z={disabledKeys:m,selectedKeys:g,selectionMode:k,selectionBehavior:P,disallowEmptySelection:_,defaultSelectedKeys:A??x,onSelectionChange:F,...U,...oe},me=g6(z);me.selectionManager.setFocusedKey=_e=>{le(_e)};const{accordionProps:Ce}=t6({...U,...oe},me,V),ye=S.useMemo(()=>({state:me,focusedKey:H,motionProps:d,isCompact:$,isDisabled:Y,hideIndicator:ie,disableAnimation:B,keepContentMounted:T,disableIndicatorAnimation:W}),[H,$,Y,ie,g,B,T,me?.expandedKeys.values,W,me.expandedKeys.size,me.disabledKeys.size,d]),Fe=S.useCallback((_e={})=>({ref:V,className:ae,"data-orientation":"vertical",...nn(Ce,Ef(ee,{enabled:X}),_e)}),[]),Ne=S.useCallback((_e,Qe)=>{_e&&le(Qe)},[]);return{Component:J,values:ye,state:me,focusedKey:H,getBaseProps:Fe,isSplitted:c==="splitted",classNames:ae,showDivider:te,dividerProps:j,disableAnimation:B,handleFocusChanged:Ne,itemClasses:G}}function b6(e){let t=Ef(e,{enabled:typeof e.elementType=="string"}),n;return e.orientation==="vertical"&&(n="vertical"),e.elementType!=="hr"?{separatorProps:{...t,role:"separator","aria-orientation":n}}:{separatorProps:t}}function x6(e){const{as:t,className:n,orientation:r,...i}=e;let s=t||"hr";s==="hr"&&r==="vertical"&&(s="div");const{separatorProps:a}=b6({elementType:typeof s=="string"?s:"hr",orientation:r}),c=S.useMemo(()=>NF({orientation:r,className:n}),[r,n]),d=S.useCallback((h={})=>({className:c,role:"separator","data-orientation":r,...a,...i,...h}),[c,r,a,i]);return{Component:s,getDividerProps:d}}var B_=jr((e,t)=>{const{Component:n,getDividerProps:r}=x6({...e});return L.jsx(n,{ref:t,...r()})});B_.displayName="HeroUI.Divider";var w6=B_,V_=jr((e,t)=>{const{Component:n,values:r,state:i,isSplitted:s,showDivider:a,getBaseProps:c,disableAnimation:d,handleFocusChanged:h,itemClasses:m,dividerProps:g}=y6({...e,ref:t}),b=S.useCallback((k,P)=>h(k,P),[h]),x=S.useMemo(()=>[...i.collection].map((k,P)=>{const T={...m,...k.props.classNames||{}};return L.jsxs(S.Fragment,{children:[L.jsx(i6,{item:k,variant:e.variant,onFocusChange:b,...r,...k.props,classNames:T}),!k.props.hidden&&!s&&a&&P{const t={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}};return t?.[e]||{}},k6=e=>({top:"top",bottom:"bottom",left:"left",right:"right","top-start":"top start","top-end":"top end","bottom-start":"bottom start","bottom-end":"bottom end","left-start":"left top","left-end":"left bottom","right-start":"right top","right-end":"right bottom"})[e],eq=(e,t)=>{if(t.includes("-")){const[n]=t.split("-");if(n.includes(e))return!1}return!0},Mk=(e,t)=>{if(t.includes("-")){const[,n]=t.split("-");return`${e}-${n}`}return e},C6=u6,bp=C6,Sh=globalThis?.document?S.useLayoutEffect:S.useEffect;function E6(e={}){const{onLoad:t,onError:n,ignoreFallback:r,src:i,crossOrigin:s,srcSet:a,sizes:c,loading:d,shouldBypassImageLoad:h=!1}=e,m=PL(),g=S.useRef(m?new Image:null),[b,x]=S.useState("pending");S.useEffect(()=>{g.current&&(g.current.onload=T=>{k(),x("loaded"),t?.(T)},g.current.onerror=T=>{k(),x("failed"),n?.(T)})},[g.current]);const k=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)},P=S.useCallback(()=>{if(!i)return"pending";if(r||h)return"loaded";const T=new Image;return T.src=i,s&&(T.crossOrigin=s),a&&(T.srcset=a),c&&(T.sizes=c),d&&(T.loading=d),g.current=T,T.complete&&T.naturalWidth?"loaded":"loading"},[i,s,a,c,t,n,d,h]);return Sh(()=>{m&&x(P())},[m,P]),r?"loaded":b}var[tq,P6]=pv({name:"ButtonGroupContext",strict:!1});function U_(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button",allowTextSelectionOnPress:T}=e,_;n==="button"?_={type:P,disabled:r}:_={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:A,isPressed:M}=ol({onClick:g,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,onPress:i,isDisabled:r,preventFocusOnPress:h,allowTextSelectionOnPress:T,ref:t}),{focusableProps:F}=xh(e,t);m&&(F.tabIndex=r?-1:F.tabIndex);let j=Tn(F,A,Au(e,{labelable:!0}));return{isPressed:M,buttonProps:Tn(_,j,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}var T6=()=>fi(()=>import("./index-Bvn9K6h_.js"),[]).then(e=>e.default),K_=e=>{const{ripples:t=[],motionProps:n,color:r="currentColor",style:i,onClear:s}=e;return L.jsx(L.Fragment,{children:t.map(a=>{const c=wL(.01*a.size,.2,a.size>100?.75:.5);return L.jsx($f,{features:T6,children:L.jsx(sl,{mode:"popLayout",children:L.jsx(Af.span,{animate:{transform:"scale(2)",opacity:0},className:"heroui-ripple",exit:{opacity:0},initial:{transform:"scale(0)",opacity:.35},style:{position:"absolute",backgroundColor:r,borderRadius:"100%",transformOrigin:"center",pointerEvents:"none",overflow:"hidden",inset:0,zIndex:0,top:a.y,left:a.x,width:`${a.size}px`,height:`${a.size}px`,...i},transition:{duration:c},onAnimationComplete:()=>{s(a.key)},...n})})},a.key)})})};K_.displayName="HeroUI.Ripple";var _6=K_;function I6(e={}){const[t,n]=S.useState([]),r=S.useCallback(s=>{const a=s.target,c=Math.max(a.clientWidth,a.clientHeight);n(d=>[...d,{key:xL(d.length.toString()),size:c,x:s.x-c/2,y:s.y-c/2}])},[]),i=S.useCallback(s=>{n(a=>a.filter(c=>c.key!==s))},[]);return{ripples:t,onClear:i,onPress:r,...e}}function $6(e){var t,n,r,i,s,a,c,d,h;const m=P6(),g=ci(),b=!!m,{ref:x,as:k,children:P,startContent:T,endContent:_,autoFocus:A,className:M,spinner:F,isLoading:j=!1,disableRipple:$=!1,fullWidth:Y=(t=m?.fullWidth)!=null?t:!1,radius:te=m?.radius,size:ie=(n=m?.size)!=null?n:"md",color:B=(r=m?.color)!=null?r:"default",variant:W=(i=m?.variant)!=null?i:"solid",disableAnimation:G=(a=(s=m?.disableAnimation)!=null?s:g?.disableAnimation)!=null?a:!1,isDisabled:ee=(c=m?.isDisabled)!=null?c:!1,isIconOnly:H=(d=m?.isIconOnly)!=null?d:!1,spinnerPlacement:le="start",onPress:J,onClick:X,...V}=e,ae=k||"button",D=typeof ae=="string",U=$i(x),oe=(h=$||g?.disableRipple)!=null?h:G,{isFocusVisible:z,isFocused:me,focusProps:Ce}=Tu({autoFocus:A}),ye=ee||j,Fe=S.useMemo(()=>FF({size:ie,color:B,variant:W,radius:te,fullWidth:Y,isDisabled:ye,isInGroup:b,disableAnimation:G,isIconOnly:H,className:M}),[ie,B,W,te,Y,ye,b,H,G,M]),{onPress:Ne,onClear:_e,ripples:Qe}=I6(),at=S.useCallback(Rt=>{oe||ye||G||U.current&&Ne(Rt)},[oe,ye,G,U,Ne]),{buttonProps:Ie,isPressed:mt}=U_({elementType:k,isDisabled:ye,onPress:tl(J,at),onClick:X,...V},U),{isHovered:pt,hoverProps:Ut}=Pu({isDisabled:ye}),Ue=S.useCallback((Rt={})=>({"data-disabled":Ae(ye),"data-focus":Ae(me),"data-pressed":Ae(mt),"data-focus-visible":Ae(z),"data-hover":Ae(pt),"data-loading":Ae(j),...nn(Ie,Ce,Ut,Ef(V,{enabled:D}),Ef(Rt)),className:Fe}),[j,ye,me,mt,D,z,pt,Ie,Ce,Ut,V,Fe]),it=Rt=>S.isValidElement(Rt)?S.cloneElement(Rt,{"aria-hidden":!0,focusable:!1}):null,Kt=it(T),tr=it(_),an=S.useMemo(()=>({sm:"sm",md:"sm",lg:"md"})[ie],[ie]),_t=S.useCallback(()=>({ripples:Qe,onClear:_e}),[Qe,_e]);return{Component:ae,children:P,domRef:U,spinner:F,styles:Fe,startContent:Kt,endContent:tr,isLoading:j,spinnerPlacement:le,spinnerSize:an,disableRipple:oe,getButtonProps:Ue,getRippleProps:_t,isIconOnly:H}}function A6(e){var t,n;const[r,i]=oa(e,gk.variantKeys),s=ci(),a=(n=(t=e?.variant)!=null?t:s?.spinnerVariant)!=null?n:"default",{children:c,className:d,classNames:h,label:m,...g}=r,b=S.useMemo(()=>gk({...i}),[ds(i)]),x=Bt(h?.base,d),k=m||c,P=S.useMemo(()=>k&&typeof k=="string"?k:g["aria-label"]?"":"Loading",[c,k,g["aria-label"]]),T=S.useCallback(()=>({"aria-label":P,className:b.base({class:x}),...g}),[P,b,x,g]);return{label:k,slots:b,classNames:h,variant:a,getSpinnerProps:T}}var W_=jr((e,t)=>{const{slots:n,classNames:r,label:i,variant:s,getSpinnerProps:a}=A6({...e});return s==="wave"||s==="dots"?L.jsxs("div",{ref:t,...a(),children:[L.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(3)].map((c,d)=>L.jsx("i",{className:n.dots({class:r?.dots}),style:{"--dot-index":d}},`dot-${d}`))}),i&&L.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="simple"?L.jsxs("div",{ref:t,...a(),children:[L.jsxs("svg",{className:n.wrapper({class:r?.wrapper}),fill:"none",viewBox:"0 0 24 24",children:[L.jsx("circle",{className:n.circle1({class:r?.circle1}),cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),L.jsx("path",{className:n.circle2({class:r?.circle2}),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})]}),i&&L.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="spinner"?L.jsxs("div",{ref:t,...a(),children:[L.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(12)].map((c,d)=>L.jsx("i",{className:n.spinnerBars({class:r?.spinnerBars}),style:{"--bar-index":d}},`star-${d}`))}),i&&L.jsx("span",{className:n.label({class:r?.label}),children:i})]}):L.jsxs("div",{ref:t,...a(),children:[L.jsxs("div",{className:n.wrapper({class:r?.wrapper}),children:[L.jsx("i",{className:n.circle1({class:r?.circle1})}),L.jsx("i",{className:n.circle2({class:r?.circle2})})]}),i&&L.jsx("span",{className:n.label({class:r?.label}),children:i})]})});W_.displayName="HeroUI.Spinner";var R6=W_,H_=jr((e,t)=>{const{Component:n,domRef:r,children:i,spinnerSize:s,spinner:a=L.jsx(R6,{color:"current",size:s}),spinnerPlacement:c,startContent:d,endContent:h,isLoading:m,disableRipple:g,getButtonProps:b,getRippleProps:x,isIconOnly:k}=$6({...e,ref:t});return L.jsxs(n,{ref:r,...b(),children:[d,m&&c==="start"&&a,m&&k?null:i,m&&c==="end"&&a,h,!g&&L.jsx(_6,{...x()})]})});H_.displayName="HeroUI.Button";var wr=H_;function L6(e){const[t,n]=oa(e,Ck.variantKeys),{ref:r,as:i,children:s,avatar:a,startContent:c,endContent:d,onClose:h,classNames:m,className:g,...b}=t,x=i||"div",k=$i(r),P=Bt(m?.base,g),T=!!h,_=e.variant==="dot",{focusProps:A,isFocusVisible:M}=Tu(),F=S.useMemo(()=>typeof s=="string"&&s?.length===1,[s]),j=S.useMemo(()=>!!a||!!c,[a,c]),$=S.useMemo(()=>!!d||T,[d,T]),Y=S.useMemo(()=>Ck({...n,hasStartContent:j,hasEndContent:$,isOneChar:F,isCloseable:T,isCloseButtonFocusVisible:M}),[ds(n),M,j,$,F,T]),{pressProps:te}=ol({isDisabled:!!e?.isDisabled,onPress:h}),ie=()=>({ref:k,className:Y.base({class:P}),...b}),B=()=>({role:"button",tabIndex:0,className:Y.closeButton({class:m?.closeButton}),"aria-label":"close chip",...nn(te,A)}),W=ee=>S.isValidElement(ee)?S.cloneElement(ee,{className:Y.avatar({class:m?.avatar})}):null,G=ee=>S.isValidElement(ee)?S.cloneElement(ee,{className:Bt("max-h-[80%]",ee.props.className)}):null;return{Component:x,children:s,slots:Y,classNames:m,isDot:_,isCloseable:T,startContent:W(a)||G(c),endContent:G(d),getCloseButtonProps:B,getChipProps:ie}}var G_=jr((e,t)=>{const{Component:n,children:r,slots:i,classNames:s,isDot:a,isCloseable:c,startContent:d,endContent:h,getCloseButtonProps:m,getChipProps:g}=L6({...e,ref:t}),b=S.useMemo(()=>a&&!d?L.jsx("span",{className:i.dot({class:s?.dot})}):d,[i,d,a]),x=S.useMemo(()=>c?L.jsx("span",{...m(),children:h||L.jsx(F_,{})}):h,[h,c,m]);return L.jsxs(n,{...g(),children:[b,L.jsx("span",{className:i.content({class:s?.content}),children:r}),x]})});G_.displayName="HeroUI.Chip";var wg=G_;const q_={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Y_={...q_,customError:!0,valid:!1},df={isInvalid:!1,validationDetails:q_,validationErrors:[]},X_=S.createContext({}),ev="__formValidationState"+Date.now();function Zx(e){if(e[ev]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}=e[ev];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}}return M6(e)}function M6(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:s,validate:a,validationBehavior:c="aria"}=e;n&&(t||(t=n==="invalid"));let d=t!==void 0?{isInvalid:t,validationErrors:[],validationDetails:Y_}:null,h=S.useMemo(()=>{if(!a||i==null)return null;let B=D6(a,i);return Dk(B)},[a,i]);s?.validationDetails.valid&&(s=void 0);let m=S.useContext(X_),g=S.useMemo(()=>r?Array.isArray(r)?r.flatMap(B=>$b(m[B])):$b(m[r]):[],[m,r]),[b,x]=S.useState(m),[k,P]=S.useState(!1);m!==b&&(x(m),P(!1));let T=S.useMemo(()=>Dk(k?[]:g),[k,g]),_=S.useRef(df),[A,M]=S.useState(df),F=S.useRef(df),j=()=>{if(!$)return;Y(!1);let B=h||s||_.current;v0(B,F.current)||(F.current=B,M(B))},[$,Y]=S.useState(!1);return S.useEffect(j),{realtimeValidation:d||T||h||s||df,displayValidation:c==="native"?d||T||A:d||T||h||s||A,updateValidation(B){c==="aria"&&!v0(A,B)?M(B):_.current=B},resetValidation(){let B=df;v0(B,F.current)||(F.current=B,M(B)),c==="native"&&Y(!1),P(!0)},commitValidation(){c==="native"&&Y(!0),P(!0)}}}function $b(e){return e?Array.isArray(e)?e:[e]:[]}function D6(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return $b(n)}return[]}function Dk(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Y_}:null}function v0(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function Q_(e,t,n){let{validationBehavior:r,focus:i}=e;sn(()=>{if(r==="native"&&n?.current&&!n.current.disabled){let d=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(d),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation(O6(n.current))}});let s=Bn(()=>{t.resetValidation()}),a=Bn(d=>{var h;t.displayValidation.isInvalid||t.commitValidation();let m=n==null||(h=n.current)===null||h===void 0?void 0:h.form;if(!d.defaultPrevented&&n&&m&&F6(m)===n.current){var g;i?i():(g=n.current)===null||g===void 0||g.focus(),H5("keyboard")}d.preventDefault()}),c=Bn(()=>{t.commitValidation()});S.useEffect(()=>{let d=n?.current;if(!d)return;let h=d.form;return d.addEventListener("invalid",a),d.addEventListener("change",c),h?.addEventListener("reset",s),()=>{d.removeEventListener("invalid",a),d.removeEventListener("change",c),h?.removeEventListener("reset",s)}},[n,a,c,s,r])}function N6(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function O6(e){return{isInvalid:!e.validity.valid,validationDetails:N6(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function F6(e){for(let t=0;t{F.stopPropagation(),t.setSelected(F.target.checked)},{pressProps:x,isPressed:k}=ol({isDisabled:r}),{pressProps:P,isPressed:T}=ol({onPress(){var F;t.toggle(),(F=n.current)===null||F===void 0||F.focus()},isDisabled:r||i}),{focusableProps:_}=xh(e,n),A=Tn(x,_),M=Au(e,{labelable:!0});return FE(n,t.isSelected,t.setSelected),{labelProps:Tn(P,{onClick:F=>F.preventDefault()}),inputProps:Tn(M,{"aria-invalid":g||m==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-controls":e["aria-controls"],"aria-readonly":i||void 0,onChange:b,disabled:r,...s==null?{}:{value:s},name:a,type:"checkbox",...A}),isSelected:t.isSelected,isPressed:k||T,isDisabled:r,isReadOnly:i,isInvalid:g||m==="invalid"}}function J_(e,t,n){let r=Zx({...e,value:t.isSelected}),{isInvalid:i,validationErrors:s,validationDetails:a}=r.displayValidation,{labelProps:c,inputProps:d,isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b}=z6({...e,isInvalid:i},t,n);Q_(e,r,n);let{isIndeterminate:x,isRequired:k,validationBehavior:P="aria"}=e;S.useEffect(()=>{n.current&&(n.current.indeterminate=!!x)});let{pressProps:T}=ol({isDisabled:g||b,onPress(){let{[ev]:_}=e,{commitValidation:A}=_||r;A()}});return{labelProps:Tn(c,T),inputProps:{...d,checked:h,"aria-required":k&&P==="aria"||void 0,required:k&&P==="native"},isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b,isInvalid:i,validationErrors:s,validationDetails:a}}const j6=new WeakMap;function Z_(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:s="label"}=e;t=Pf(t);let a=Pf(),c={};n&&(r=r?`${a} ${r}`:a,c={id:a,htmlFor:s==="label"?t:void 0});let d=LE({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:c,fieldProps:d}}function B6(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:s,fieldProps:a}=Z_(e),c=W0([!!t,!!n,r,i]),d=W0([!!t,!!n,r,i]);return a=Tn(a,{"aria-describedby":[c,d,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:s,fieldProps:a,descriptionProps:{id:c},errorMessageProps:{id:d}}}function e2(e={}){let{isReadOnly:t}=e,[n,r]=Ru(e.isSelected,e.defaultSelected||!1,e.onChange);function i(a){t||r(a)}function s(){t||r(!n)}return{isSelected:n,setSelected:i,toggle:s}}function V6(e,t,n){const r=e2({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),onChange(T){T?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(T)}});let{name:i,descriptionId:s,errorMessageId:a,validationBehavior:c}=j6.get(t);var d;c=(d=e.validationBehavior)!==null&&d!==void 0?d:c;let{realtimeValidation:h}=Zx({...e,value:r.isSelected,name:void 0,validationBehavior:"aria"}),m=S.useRef(df),g=()=>{t.setInvalid(e.value,h.isInvalid?h:m.current)};S.useEffect(g);let b=t.realtimeValidation.isInvalid?t.realtimeValidation:h,x=c==="native"?t.displayValidation:b;var k;let P=J_({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,isRequired:(k=e.isRequired)!==null&&k!==void 0?k:t.isRequired,validationBehavior:c,[ev]:{realtimeValidation:b,displayValidation:x,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(T){m.current=T,g()}}},r,n);return{...P,inputProps:{...P.inputProps,"aria-describedby":[e["aria-describedby"],t.isInvalid?a:null,s].filter(Boolean).join(" ")||void 0}}}var Nk=Symbol("default");function U6(e){const t=S.useRef(null),n=S.useRef(void 0),r=S.useCallback(i=>{if(typeof e=="function"){const s=e,a=s(i);return()=>{typeof a=="function"?a():s(null)}}else if(e)return e.current=i,()=>{e.current=null}},[e]);return S.useMemo(()=>({get current(){return t.current},set current(i){t.current=i,n.current&&(n.current(),n.current=void 0),i!=null&&(n.current=r(i))}}),[r])}function ew(e,t){let n=S.useContext(e);if(t===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!t&&!n.slots[Nk])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=t||Nk;if(!n.slots[i])throw new Error(`Invalid slot "${t}". Valid slot names are ${r}.`);return n.slots[i]}return n}function K6(e,t,n){let r=ew(n,e.slot)||{},{ref:i,...s}=r,a=U6(S.useMemo(()=>yE(t,i),[t,i])),c=nn(s,e);return"style"in s&&s.style&&"style"in e&&e.style&&(typeof s.style=="function"||typeof e.style=="function"?c.style=d=>{let h=typeof s.style=="function"?s.style(d):s.style,m={...d.defaultStyle,...h},g=typeof e.style=="function"?e.style({...d,defaultStyle:m}):e.style;return{...m,...g}}:c.style={...s.style,...e.style}),[c,a]}var tv=S.createContext(null),W6=S.forwardRef(function(t,n){[t,n]=K6(t,n,tv);let{validationErrors:r,validationBehavior:i="native",children:s,className:a,...c}=t;const d=S.useMemo(()=>OF({className:a}),[a]);return L.jsx("form",{noValidate:i!=="native",...c,ref:n,className:d,children:L.jsx(tv.Provider,{value:{...t,validationBehavior:i},children:L.jsx(X_.Provider,{value:r??{},children:s})})})}),H6=S.forwardRef(function(t,n){var r,i;const s=ci(),a=(i=(r=t.validationBehavior)!=null?r:s?.validationBehavior)!=null?i:"native";return L.jsx(W6,{...t,ref:n,validationBehavior:a})}),[nq,G6]=pv({name:"CheckboxGroupContext",strict:!1});function q6(e){const{isSelected:t,disableAnimation:n,...r}=e;return L.jsx("svg",{"aria-hidden":"true",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,style:!n&&t?{transition:"stroke-dashoffset 250ms linear 0.2s"}:{},viewBox:"0 0 17 18",...r,children:L.jsx("polyline",{points:"1 9 7 14 15 4"})})}function Y6(e){const{isSelected:t,disableAnimation:n,...r}=e;return L.jsx("svg",{stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",...r,children:L.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function X6(e){const{isIndeterminate:t,...n}=e,r=t?Y6:q6;return L.jsx(r,{...n})}function Ab(e,t=[]){const n=S.useRef(e);return Sh(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Q6(e={}){var t,n,r,i,s,a,c,d;const h=ci(),m=G6(),{validationBehavior:g}=ew(tv)||{},b=!!m,{as:x,ref:k,value:P="",children:T,icon:_,name:A,isRequired:M,isReadOnly:F=!1,autoFocus:j=!1,isSelected:$,size:Y=(t=m?.size)!=null?t:"md",color:te=(n=m?.color)!=null?n:"primary",radius:ie=m?.radius,lineThrough:B=(r=m?.lineThrough)!=null?r:!1,isDisabled:W=(i=m?.isDisabled)!=null?i:!1,disableAnimation:G=(a=(s=m?.disableAnimation)!=null?s:h?.disableAnimation)!=null?a:!1,validationState:ee,isInvalid:H=ee?ee==="invalid":(c=m?.isInvalid)!=null?c:!1,isIndeterminate:le=!1,validationBehavior:J=b?m.validationBehavior:(d=g??h?.validationBehavior)!=null?d:"native",defaultSelected:X,classNames:V,className:ae,onValueChange:D,validate:U,...oe}=e,z=x||"label",me=S.useRef(null),Ce=S.useRef(null);let ye=e.onChange;b&&(ye=tl(()=>{m.groupState.resetValidation()},ye));const Fe=S.useId(),Ne=S.useMemo(()=>({name:A,value:P,children:T,autoFocus:j,defaultSelected:X,isIndeterminate:le,isRequired:M,isInvalid:H,isSelected:$,isDisabled:W,isReadOnly:F,"aria-label":vE(oe["aria-label"],T),"aria-labelledby":oe["aria-labelledby"]||Fe,onChange:D}),[A,P,T,j,X,le,M,H,$,W,F,oe["aria-label"],oe["aria-labelledby"],Fe,D]),_e=e2(Ne),Qe={isInvalid:H,isRequired:M,validate:U,validationState:ee,validationBehavior:J},{inputProps:at,isSelected:Ie,isDisabled:mt,isReadOnly:pt,isPressed:Ut,isInvalid:Ue}=b?V6({...Ne,...Qe},m.groupState,Ce):J_({...Ne,...Qe},_e,Ce),it=mt||pt,Kt=ee==="invalid"||H||Ue,tr=it?!1:Ut,{hoverProps:an,isHovered:_t}=Pu({isDisabled:at.disabled}),{focusProps:Rt,isFocused:_n,isFocusVisible:Er}=Tu({autoFocus:at.autoFocus}),Nt=S.useMemo(()=>zF({color:te,size:Y,radius:ie,isInvalid:Kt,lineThrough:B,isDisabled:mt,disableAnimation:G}),[te,Y,ie,Kt,B,mt,G]);Sh(()=>{if(!Ce.current)return;const Pt=!!Ce.current.checked;_e.setSelected(Pt)},[Ce.current]);const pe=Ab(ye),Se=S.useCallback(Pt=>{if(pt||mt){Pt.preventDefault();return}pe?.(Pt)},[pt,mt,pe]),ze=Bt(V?.base,ae),nt=S.useCallback(()=>({ref:me,className:Nt.base({class:ze}),"data-disabled":Ae(mt),"data-selected":Ae(Ie||le),"data-invalid":Ae(Kt),"data-hover":Ae(_t),"data-focus":Ae(_n),"data-pressed":Ae(tr),"data-readonly":Ae(at.readOnly),"data-focus-visible":Ae(Er),"data-indeterminate":Ae(le),...nn(an,oe)}),[Nt,ze,mt,Ie,le,Kt,_t,_n,tr,at.readOnly,Er,an,oe]),lt=S.useCallback((Pt={})=>({...Pt,"aria-hidden":!0,className:Bt(Nt.wrapper({class:Bt(V?.wrapper,Pt?.className)}))}),[Nt,V?.wrapper]),Wt=S.useCallback(()=>({ref:bE(Ce,k),...nn(at,Rt),className:Nt.hiddenInput({class:V?.hiddenInput}),onChange:tl(at.onChange,Se)}),[at,Rt,Se,V?.hiddenInput]),Vn=S.useCallback(()=>({id:Fe,className:Nt.label({class:V?.label})}),[Nt,V?.label,mt,Ie,Kt]),Jt=S.useCallback(()=>({isSelected:Ie,isIndeterminate:le,disableAnimation:G,className:Nt.icon({class:V?.icon})}),[Nt,V?.icon,Ie,le,G]);return{Component:z,icon:_,children:T,isSelected:Ie,isDisabled:mt,isInvalid:Kt,isFocused:_n,isHovered:_t,isFocusVisible:Er,getBaseProps:nt,getWrapperProps:lt,getInputProps:Wt,getLabelProps:Vn,getIconProps:Jt}}var t2=jr((e,t)=>{const{Component:n,children:r,icon:i=L.jsx(X6,{}),getBaseProps:s,getWrapperProps:a,getInputProps:c,getIconProps:d,getLabelProps:h}=Q6({...e,ref:t}),m=typeof i=="function"?i(d()):S.cloneElement(i,d());return L.jsxs(n,{...s(),children:[L.jsx("input",{...c()}),L.jsx("span",{...a(),children:m}),r&&L.jsx("span",{...h(),children:r})]})});t2.displayName="HeroUI.Checkbox";var n2=t2;function r2(e){let[t,n]=Ru(e.isOpen,e.defaultOpen||!1,e.onOpenChange);const r=S.useCallback(()=>{n(!0)},[n]),i=S.useCallback(()=>{n(!1)},[n]),s=S.useCallback(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:i,toggle:s}}const J6=1500,Ok=500;let fu={},Z6=0,xp=!1,qs=null,du=null;function ez(e={}){let{delay:t=J6,closeDelay:n=Ok}=e,{isOpen:r,open:i,close:s}=r2(e),a=S.useMemo(()=>`${++Z6}`,[]),c=S.useRef(null),d=S.useRef(s),h=()=>{fu[a]=b},m=()=>{for(let k in fu)k!==a&&(fu[k](!0),delete fu[k])},g=()=>{c.current&&clearTimeout(c.current),c.current=null,m(),h(),xp=!0,i(),qs&&(clearTimeout(qs),qs=null),du&&(clearTimeout(du),du=null)},b=k=>{k||n<=0?(c.current&&clearTimeout(c.current),c.current=null,d.current()):c.current||(c.current=setTimeout(()=>{c.current=null,d.current()},n)),qs&&(clearTimeout(qs),qs=null),xp&&(du&&clearTimeout(du),du=setTimeout(()=>{delete fu[a],du=null,xp=!1},Math.max(Ok,n)))},x=()=>{m(),h(),!r&&!qs&&!xp?qs=setTimeout(()=>{qs=null,xp=!0,g()},t):r||g()};return S.useEffect(()=>{d.current=s},[s]),S.useEffect(()=>()=>{c.current&&clearTimeout(c.current),fu[a]&&delete fu[a]},[a]),{isOpen:r,open:k=>{!k&&t>0&&!c.current?x():g()},close:b}}function tz(e,t){let n=Au(e,{labelable:!0}),{hoverProps:r}=Pu({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:Tn(n,r,{role:"tooltip"})}}function nz(e,t,n){let{isDisabled:r,trigger:i}=e,s=Pf(),a=S.useRef(!1),c=S.useRef(!1),d=()=>{(a.current||c.current)&&t.open(c.current)},h=_=>{!a.current&&!c.current&&t.close(_)};S.useEffect(()=>{let _=A=>{n&&n.current&&A.key==="Escape"&&(A.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0)}},[n,t]);let m=()=>{i!=="focus"&&(oh()==="pointer"?a.current=!0:a.current=!1,d())},g=()=>{i!=="focus"&&(c.current=!1,a.current=!1,h())},b=()=>{c.current=!1,a.current=!1,h(!0)},x=()=>{qx()&&(c.current=!0,d())},k=()=>{c.current=!1,a.current=!1,h(!0)},{hoverProps:P}=Pu({isDisabled:r,onHoverStart:m,onHoverEnd:g}),{focusableProps:T}=xh({isDisabled:r,onFocus:x,onBlur:k},n);return{triggerProps:{"aria-describedby":t.isOpen?s:void 0,...Tn(T,P,{onPointerDown:b,onKeyDown:b,tabIndex:void 0})},tooltipProps:{id:s}}}var Ys=[];function i2(e,t){const{disableOutsideEvents:n=!0,isDismissable:r=!1,isKeyboardDismissDisabled:i=!1,isOpen:s,onClose:a,shouldCloseOnBlur:c,shouldCloseOnInteractOutside:d}=e;S.useEffect(()=>(s&&Ys.push(t),()=>{const P=Ys.indexOf(t);P>=0&&Ys.splice(P,1)}),[s,t]);const h=()=>{Ys[Ys.length-1]===t&&a&&a()},m=P=>{(!d||d(P.target))&&(Ys[Ys.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),P.pointerType!=="touch"&&h())},g=P=>{P.pointerType==="touch"&&(!d||d(P.target))&&(Ys[Ys.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),h())},b=P=>{P.key==="Escape"&&!i&&!P.nativeEvent.isComposing&&(P.stopPropagation(),P.preventDefault(),h())};nO({isDisabled:!(r&&s),onInteractOutside:r&&s?g:void 0,onInteractOutsideStart:m,ref:t});const{focusWithinProps:x}=kv({isDisabled:!c,onBlurWithin:P=>{!P.relatedTarget||sO(P.relatedTarget)||(!d||d(P.relatedTarget))&&h()}}),k=P=>{P.target===P.currentTarget&&P.preventDefault()};return{overlayProps:{onKeyDown:b,...x},underlayProps:{onPointerDown:k}}}function rz(e){var t,n;const r=ci(),[i,s]=oa(e,vk.variantKeys),{ref:a,as:c,isOpen:d,content:h,children:m,defaultOpen:g,onOpenChange:b,isDisabled:x,trigger:k,shouldFlip:P=!0,containerPadding:T=12,placement:_="top",delay:A=0,closeDelay:M=500,showArrow:F=!1,offset:j=7,crossOffset:$=0,isDismissable:Y,shouldCloseOnBlur:te=!0,portalContainer:ie,isKeyboardDismissDisabled:B=!1,updatePositionDeps:W=[],shouldCloseOnInteractOutside:G,className:ee,onClose:H,motionProps:le,classNames:J,...X}=i,V=c||"div",ae=(n=(t=e?.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,D=ez({delay:A,closeDelay:M,isDisabled:x,defaultOpen:g,isOpen:d,onOpenChange:Ue=>{b?.(Ue),Ue||H?.()}}),U=S.useRef(null),oe=S.useRef(null),z=S.useId(),me=D.isOpen&&!x;S.useImperativeHandle(a,()=>hL(oe));const{triggerProps:Ce,tooltipProps:ye}=nz({isDisabled:x,trigger:k},D,U),{tooltipProps:Fe}=tz({isOpen:me,...nn(i,ye)},D),{overlayProps:Ne,placement:_e,updatePosition:Qe}=$5({isOpen:me,targetRef:U,placement:k6(_),overlayRef:oe,offset:F?j+3:j,crossOffset:$,shouldFlip:P,containerPadding:T});Sh(()=>{W.length&&Qe()},W);const{overlayProps:at}=i2({isOpen:me,onClose:D.close,isDismissable:Y,shouldCloseOnBlur:te,isKeyboardDismissDisabled:B,shouldCloseOnInteractOutside:G},oe),Ie=S.useMemo(()=>{var Ue,it,Kt;return vk({...s,disableAnimation:ae,radius:(Ue=e?.radius)!=null?Ue:"md",size:(it=e?.size)!=null?it:"md",shadow:(Kt=e?.shadow)!=null?Kt:"sm"})},[ds(s),ae,e?.radius,e?.size,e?.shadow]),mt=S.useCallback((Ue={},it=null)=>({...nn(Ce,Ue),ref:bE(it,U),"aria-describedby":me?z:void 0}),[Ce,me,z,D]),pt=S.useCallback(()=>({ref:oe,"data-slot":"base","data-open":Ae(me),"data-arrow":Ae(F),"data-disabled":Ae(x),"data-placement":Mk(_e||"top",_),...nn(Fe,at,X),style:nn(Ne.style,X.style,i.style),className:Ie.base({class:J?.base}),id:z}),[Ie,me,F,x,_e,_,Fe,at,X,Ne,i,z]),Ut=S.useCallback(()=>({"data-slot":"content","data-open":Ae(me),"data-arrow":Ae(F),"data-disabled":Ae(x),"data-placement":Mk(_e||"top",_),className:Ie.content({class:Bt(J?.content,ee)})}),[Ie,me,F,x,_e,_,J]);return{Component:V,content:h,children:m,isOpen:me,triggerRef:U,showArrow:F,portalContainer:ie,placement:_,disableAnimation:ae,isDisabled:x,motionProps:le,getTooltipContentProps:Ut,getTriggerProps:mt,getTooltipProps:pt}}var iz=()=>fi(()=>import("./index-Bvn9K6h_.js"),[]).then(e=>e.default),o2=jr((e,t)=>{var n;const{Component:r,children:i,content:s,isOpen:a,portalContainer:c,placement:d,disableAnimation:h,motionProps:m,getTriggerProps:g,getTooltipProps:b,getTooltipContentProps:x}=rz({...e,ref:t});let k;try{if(S.Children.count(i)!==1)throw new Error;if(!S.isValidElement(i))k=L.jsx("p",{...g(),children:i});else{const j=i,$=(n=j.props.ref)!=null?n:j.ref;k=S.cloneElement(j,g(j.props,$))}}catch{k=L.jsx("span",{}),kL("Tooltip must have only one child node. Please, check your code.")}const{ref:P,id:T,style:_,...A}=b(),M=L.jsx("div",{ref:P,id:T,style:_,children:L.jsx(Af.div,{animate:"enter",exit:"exit",initial:"exit",variants:Zg.scaleSpring,...nn(m,A),style:{...S6(d)},children:L.jsx(r,{...x(),children:s})},`${T}-tooltip-inner`)},`${T}-tooltip-content`);return L.jsxs(L.Fragment,{children:[k,h?a&&L.jsx(ak,{portalContainer:c,children:L.jsx("div",{ref:P,id:T,style:_,...A,children:L.jsx(r,{...x(),children:s})})}):L.jsx($f,{features:iz,children:L.jsx(sl,{children:a&&L.jsx(ak,{portalContainer:c,children:M})})})]})});o2.displayName="HeroUI.Tooltip";var oz=o2;function sz(e={}){const{rerender:t=!1,delay:n=0}=e,r=S.useRef(!1),[i,s]=S.useState(!1);return S.useEffect(()=>{r.current=!0;let a=null;return t&&(n>0?a=setTimeout(()=>{s(!0)},n):s(!0)),()=>{r.current=!1,t&&s(!1),a&&clearTimeout(a)}},[t]),[S.useCallback(()=>r.current,[]),i]}function az(e){let{value:t=0,minValue:n=0,maxValue:r=100,valueLabel:i,isIndeterminate:s,formatOptions:a={style:"percent"}}=e,c=Au(e,{labelable:!0}),{labelProps:d,fieldProps:h}=Z_({...e,labelElementType:"span"});t=Bg(t,n,r);let m=(t-n)/(r-n),g=MM(a);if(!s&&!i){let b=a.style==="percent"?m:t;i=g.format(b)}return{progressBarProps:Tn(c,{...h,"aria-valuenow":s?void 0:t,"aria-valuemin":n,"aria-valuemax":r,"aria-valuetext":s?void 0:i,role:"progressbar"}),labelProps:d}}function lz(e){var t,n,r;const i=ci(),[s,a]=oa(e,yk.variantKeys),{ref:c,as:d,id:h,className:m,classNames:g,label:b,valueLabel:x,value:k=void 0,minValue:P=0,maxValue:T=100,strokeWidth:_,showValueLabel:A=!1,formatOptions:M={style:"percent"},...F}=s,j=d||"div",$=$i(c),Y=Bt(g?.base,m),[,te]=sz({rerender:!0,delay:100}),ie=((t=e.isIndeterminate)!=null?t:!0)&&k===void 0,B=(r=(n=e.disableAnimation)!=null?n:i?.disableAnimation)!=null?r:!1,{progressBarProps:W,labelProps:G}=az({id:h,label:b,value:k,minValue:P,maxValue:T,valueLabel:x,formatOptions:M,isIndeterminate:ie,"aria-labelledby":e["aria-labelledby"],"aria-label":e["aria-label"]}),ee=S.useMemo(()=>yk({...a,disableAnimation:B,isIndeterminate:ie}),[ds(a),B,ie]),H=B?!0:te,le=16,J=_||(e.size==="sm"?2:3),X=16-J,V=2*X*Math.PI,ae=S.useMemo(()=>H?ie?.25:k?SL((k-P)/(T-P),1):0:0,[H,k,P,T,ie]),D=V-ae*V,U=S.useCallback((ye={})=>({ref:$,"data-indeterminate":Ae(ie),"data-disabled":Ae(e.isDisabled),className:ee.base({class:Y}),...nn(W,F,ye)}),[$,ee,ie,e.isDisabled,Y,W,F]),oe=S.useCallback((ye={})=>({className:ee.label({class:g?.label}),...nn(G,ye)}),[ee,g,G]),z=S.useCallback((ye={})=>({viewBox:"0 0 32 32",fill:"none",strokeWidth:J,className:ee.svg({class:g?.svg}),...ye}),[J,ee,g]),me=S.useCallback((ye={})=>({cx:le,cy:le,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:D,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:ee.indicator({class:g?.indicator}),...ye}),[ee,g,D,V,X]),Ce=S.useCallback((ye={})=>({cx:le,cy:le,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:0,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:ee.track({class:g?.track}),...ye}),[ee,g,V,X]);return{Component:j,domRef:$,slots:ee,classNames:g,label:b,showValueLabel:A,getProgressBarProps:U,getLabelProps:oe,getSvgProps:z,getIndicatorProps:me,getTrackProps:Ce}}var s2=jr((e,t)=>{const{Component:n,slots:r,classNames:i,label:s,showValueLabel:a,getProgressBarProps:c,getLabelProps:d,getSvgProps:h,getIndicatorProps:m,getTrackProps:g}=lz({ref:t,...e}),b=c();return L.jsxs(n,{...b,children:[L.jsxs("div",{className:r.svgWrapper({class:i?.svgWrapper}),children:[L.jsxs("svg",{...h(),children:[L.jsx("circle",{...g()}),L.jsx("circle",{...m()})]}),a&&L.jsx("span",{className:r.value({class:i?.value}),children:b["aria-valuetext"]})]}),s&&L.jsx("span",{...d(),children:s})]})});s2.displayName="HeroUI.CircularProgress";var a2=s2;function uz(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:i=!1,isReadOnly:s=!1,type:a="text",validationBehavior:c="aria"}=e,[d,h]=Ru(e.value,e.defaultValue||"",e.onChange),{focusableProps:m}=xh(e,t),g=Zx({...e,value:d}),{isInvalid:b,validationErrors:x,validationDetails:k}=g.displayValidation,{labelProps:P,fieldProps:T,descriptionProps:_,errorMessageProps:A}=B6({...e,isInvalid:b,errorMessage:e.errorMessage||x}),M=Au(e,{labelable:!0});const F={type:a,pattern:e.pattern};return FE(t,d,h),Q_(e,g,t),S.useEffect(()=>{if(t.current instanceof no(t.current).HTMLTextAreaElement){let j=t.current;Object.defineProperty(j,"defaultValue",{get:()=>j.value,set:()=>{},configurable:!0})}},[t]),{labelProps:P,inputProps:Tn(M,n==="input"?F:void 0,{disabled:r,readOnly:s,required:i&&c==="native","aria-required":i&&c==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:d,onChange:j=>h(j.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(He.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...m,...T}),descriptionProps:_,errorMessageProps:A,isInvalid:b,validationErrors:x,validationDetails:k}}function cz(e){var t,n,r,i,s,a,c;const d=ci(),{validationBehavior:h}=ew(tv)||{},[m,g]=oa(e,wk.variantKeys),{ref:b,as:x,type:k,label:P,baseRef:T,wrapperRef:_,description:A,className:M,classNames:F,autoFocus:j,startContent:$,endContent:Y,onClear:te,onChange:ie,validationState:B,validationBehavior:W=(t=h??d?.validationBehavior)!=null?t:"native",innerWrapperRef:G,onValueChange:ee=()=>{},...H}=m,le=S.useCallback(Xe=>{ee(Xe??"")},[ee]),[J,X]=S.useState(!1),V=x||"div",ae=(r=(n=e.disableAnimation)!=null?n:d?.disableAnimation)!=null?r:!1,D=$i(b),U=$i(T),oe=$i(_),z=$i(G),[me,Ce]=Ru(m.value,(i=m.defaultValue)!=null?i:"",le),ye=k==="file",Fe=((c=(a=(s=D?.current)==null?void 0:s.files)==null?void 0:a.length)!=null?c:0)>0,Ne=["date","time","month","week","range"].includes(k),_e=!vL(me)||Ne||Fe,Qe=_e||J,at=k==="hidden",Ie=e.isMultiline,mt=Bt(F?.base,M,_e?"is-filled":""),pt=S.useCallback(()=>{var Xe;ye?D.current.value="":Ce(""),te?.(),(Xe=D.current)==null||Xe.focus()},[Ce,te,ye]);Sh(()=>{D.current&&Ce(D.current.value)},[D.current]);const{labelProps:Ut,inputProps:Ue,isInvalid:it,validationErrors:Kt,validationDetails:tr,descriptionProps:an,errorMessageProps:_t}=uz({...e,validationBehavior:W,autoCapitalize:e.autoCapitalize,value:me,"aria-label":e.label?e["aria-label"]:vE(e["aria-label"],e.placeholder),inputElementType:Ie?"textarea":"input",onChange:Ce},D);ye&&(delete Ue.value,delete Ue.onChange);const{isFocusVisible:Rt,isFocused:_n,focusProps:Er}=Tu({autoFocus:j,isTextInput:!0}),{isHovered:Nt,hoverProps:pe}=Pu({isDisabled:!!e?.isDisabled}),{isHovered:Se,hoverProps:ze}=Pu({isDisabled:!!e?.isDisabled}),{focusProps:nt,isFocusVisible:lt}=Tu(),{focusWithinProps:Wt}=kv({onFocusWithinChange:X}),{pressProps:Vn}=ol({isDisabled:!!e?.isDisabled||!!e?.isReadOnly,onPress:pt}),Jt=B==="invalid"||it,Pt=IO({labelPlacement:e.labelPlacement,label:P}),Pr=typeof m.errorMessage=="function"?m.errorMessage({isInvalid:Jt,validationErrors:Kt,validationDetails:tr}):m.errorMessage||Kt?.join(" "),Ot=!!te||e.isClearable,nr=!!P||!!A||!!Pr,ln=!!m.placeholder,aa=!!P,ms=!!A||!!Pr,pi=Pt==="outside-left",hi=Pt==="outside-top",cl=Pt==="outside"||pi||hi,Du=Pt==="inside",gs=D.current?(!D.current.value||D.current.value===""||!me||me==="")&&ln:!1,Vr=!!$,fl=cl?pi||hi||ln||Pt==="outside"&&Vr:!1,dl=Pt==="outside"&&!ln&&!Vr,Zt=S.useMemo(()=>wk({...g,isInvalid:Jt,labelPlacement:Pt,isClearable:Ot,disableAnimation:ae}),[ds(g),Jt,Pt,Ot,Vr,ae]),vs=S.useCallback((Xe={})=>({ref:U,className:Zt.base({class:mt}),"data-slot":"base","data-filled":Ae(_e||ln||Vr||gs||ye),"data-filled-within":Ae(Qe||ln||Vr||gs||ye),"data-focus-within":Ae(J),"data-focus-visible":Ae(Rt),"data-readonly":Ae(e.isReadOnly),"data-focus":Ae(_n),"data-hover":Ae(Nt||Se),"data-required":Ae(e.isRequired),"data-invalid":Ae(Jt),"data-disabled":Ae(e.isDisabled),"data-has-elements":Ae(nr),"data-has-helper":Ae(ms),"data-has-label":Ae(aa),"data-has-value":Ae(!gs),"data-hidden":Ae(at),...Wt,...Xe}),[Zt,mt,_e,_n,Nt,Se,Jt,ms,aa,nr,gs,Vr,J,Rt,Qe,ln,Wt,at,e.isReadOnly,e.isRequired,e.isDisabled]),ys=S.useCallback((Xe={})=>({"data-slot":"label",className:Zt.label({class:F?.label}),...nn(Ut,ze,Xe)}),[Zt,Se,Ut,F?.label]),Ro=S.useCallback(Xe=>{Xe.key==="Escape"&&me&&(Ot||te)&&!e.isReadOnly&&(Ce(""),te?.())},[me,Ce,te,Ot,e.isReadOnly]),pl=S.useCallback((Xe={})=>({"data-slot":"input","data-filled":Ae(_e),"data-filled-within":Ae(Qe),"data-has-start-content":Ae(Vr),"data-has-end-content":Ae(!!Y),"data-type":k,className:Zt.input({class:Bt(F?.input,_e?"is-filled":"",Ie?"pe-0":"",k==="password"?"[&::-ms-reveal]:hidden":"")}),...nn(Er,Ue,Ef(H,{enabled:!0,labelable:!0,omitEventNames:new Set(Object.keys(Ue))}),Xe),"aria-readonly":Ae(e.isReadOnly),onChange:tl(Ue.onChange,ie),onKeyDown:tl(Ue.onKeyDown,Xe.onKeyDown,Ro),ref:D}),[Zt,me,Er,Ue,H,_e,Qe,Vr,Y,F?.input,e.isReadOnly,e.isRequired,ie,Ro]),bs=S.useCallback((Xe={})=>({ref:oe,"data-slot":"input-wrapper","data-hover":Ae(Nt||Se),"data-focus-visible":Ae(Rt),"data-focus":Ae(_n),className:Zt.inputWrapper({class:Bt(F?.inputWrapper,_e?"is-filled":"")}),...nn(Xe,pe),onClick:so=>{D.current&&so.currentTarget===so.target&&D.current.focus()},style:{cursor:"text",...Xe.style}}),[Zt,Nt,Se,Rt,_n,me,F?.inputWrapper]),la=S.useCallback((Xe={})=>({...Xe,ref:z,"data-slot":"inner-wrapper",onClick:so=>{D.current&&so.currentTarget===so.target&&D.current.focus()},className:Zt.innerWrapper({class:Bt(F?.innerWrapper,Xe?.className)})}),[Zt,F?.innerWrapper]),ua=S.useCallback((Xe={})=>({...Xe,"data-slot":"main-wrapper",className:Zt.mainWrapper({class:Bt(F?.mainWrapper,Xe?.className)})}),[Zt,F?.mainWrapper]),hl=S.useCallback((Xe={})=>({...Xe,"data-slot":"helper-wrapper",className:Zt.helperWrapper({class:Bt(F?.helperWrapper,Xe?.className)})}),[Zt,F?.helperWrapper]),Kf=S.useCallback((Xe={})=>({...Xe,...an,"data-slot":"description",className:Zt.description({class:Bt(F?.description,Xe?.className)})}),[Zt,F?.description]),Wf=S.useCallback((Xe={})=>({...Xe,..._t,"data-slot":"error-message",className:Zt.errorMessage({class:Bt(F?.errorMessage,Xe?.className)})}),[Zt,_t,F?.errorMessage]),Hf=S.useCallback((Xe={})=>({...Xe,type:"button",tabIndex:-1,disabled:e.isDisabled,"aria-label":"clear input","data-slot":"clear-button","data-focus-visible":Ae(lt),className:Zt.clearButton({class:Bt(F?.clearButton,Xe?.className)}),...nn(Vn,nt)}),[Zt,lt,Vn,nt,F?.clearButton]);return{Component:V,classNames:F,domRef:D,label:P,description:A,startContent:$,endContent:Y,labelPlacement:Pt,isClearable:Ot,hasHelper:ms,hasStartContent:Vr,isLabelOutside:fl,isOutsideLeft:pi,isOutsideTop:hi,isLabelOutsideAsPlaceholder:dl,shouldLabelBeOutside:cl,shouldLabelBeInside:Du,hasPlaceholder:ln,isInvalid:Jt,errorMessage:Pr,getBaseProps:vs,getLabelProps:ys,getInputProps:pl,getMainWrapperProps:ua,getInputWrapperProps:bs,getInnerWrapperProps:la,getHelperWrapperProps:hl,getDescriptionProps:Kf,getErrorMessageProps:Wf,getClearButtonProps:Hf}}function Rb(){return Rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{Component:d,label:h,description:m,startContent:g,endContent:b,hasHelper:x,shouldLabelBeOutside:k,shouldLabelBeInside:P,isInvalid:T,errorMessage:_,getBaseProps:A,getLabelProps:M,getInputProps:F,getInnerWrapperProps:j,getInputWrapperProps:$,getHelperWrapperProps:Y,getDescriptionProps:te,getErrorMessageProps:ie,isClearable:B,getClearButtonProps:W}=cz({...a,ref:c,isMultiline:!0}),[G,ee]=S.useState(t>1),[H,le]=S.useState(!1),J=h?L.jsx("label",{...M(),children:h}):null,X=F(),V=(me,Ce)=>{if(t===1&&ee(me>=Ce.rowHeight*2),n>t){const ye=me>=n*Ce.rowHeight;le(ye)}s?.(me,Ce)},ae=i?L.jsx("textarea",{...X,style:nn(X.style,e??{})}):L.jsx(Tz,{...X,cacheMeasurements:r,"data-hide-scroll":Ae(!H),maxRows:n,minRows:t,style:nn(X.style,e??{}),onHeightChange:V}),D=S.useMemo(()=>B?L.jsx("button",{...W(),children:L.jsx(F_,{})}):null,[B,W]),U=S.useMemo(()=>g||b?L.jsxs("div",{...j(),children:[g,ae,b]}):L.jsx("div",{...j(),children:ae}),[g,X,b,j]),oe=T&&_,z=oe||m;return L.jsxs(d,{...A(),children:[k?J:null,L.jsxs("div",{...$(),"data-has-multiple-rows":Ae(G),children:[P?J:null,U,D]}),x&&z?L.jsx("div",{...Y(),children:oe?L.jsx("div",{...ie(),children:_}):L.jsx("div",{...te(),children:m})}):null]})});l2.displayName="HeroUI.Textarea";var _z=l2;function Iz(e,t){let{role:n="dialog"}=e,r=W0();r=e["aria-label"]?void 0:r;let i=S.useRef(!1);return S.useEffect(()=>{if(t.current&&!t.current.contains(document.activeElement)){Eu(t.current);let s=setTimeout(()=>{document.activeElement===t.current&&(i.current=!0,t.current&&(t.current.blur(),Eu(t.current)),i.current=!1)},500);return()=>{clearTimeout(s)}}},[t]),b_(),{dialogProps:{...Au(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||r,onBlur:s=>{i.current&&s.stopPropagation()}},titleProps:{id:r}}}function $z(e){var t,n;const r=ci(),[i,s]=oa(e,kk.variantKeys),{ref:a,as:c,src:d,className:h,classNames:m,loading:g,isBlurred:b,fallbackSrc:x,isLoading:k,disableSkeleton:P=!!x,removeWrapper:T=!1,onError:_,onLoad:A,srcSet:M,sizes:F,crossOrigin:j,...$}=i,Y=E6({src:d,loading:g,onError:_,onLoad:A,ignoreFallback:!1,srcSet:M,sizes:F,crossOrigin:j,shouldBypassImageLoad:c!==void 0}),te=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,ie=Y==="loaded"&&!k,B=Y==="loading"||k,W=e.isZoomed,G=c||"img",ee=$i(a),{w:H,h:le}=S.useMemo(()=>({w:i.width?typeof i.width=="number"?`${i.width}px`:i.width:"fit-content",h:i.height?typeof i.height=="number"?`${i.height}px`:i.height:"auto"}),[i?.width,i?.height]),J=(!d||!ie)&&!!x,X=B&&!P,V=S.useMemo(()=>kk({...s,disableAnimation:te,showSkeleton:X}),[ds(s),te,X]),ae=Bt(h,m?.img),D=(z={})=>{const me=Bt(ae,z?.className);return{src:d,ref:ee,"data-loaded":Ae(ie),className:V.img({class:me}),loading:g,srcSet:M,sizes:F,crossOrigin:j,...$,style:{...$?.height&&{height:le},...z.style,...$.style}}},U=S.useCallback(()=>{const z=J?{backgroundImage:`url(${x})`}:{};return{className:V.wrapper({class:m?.wrapper}),style:{...z,maxWidth:H}}},[V,J,x,m?.wrapper,H]),oe=S.useCallback(()=>({src:d,"aria-hidden":Ae(!0),className:V.blurredImg({class:m?.blurredImg})}),[V,d,m?.blurredImg]);return{Component:G,domRef:ee,slots:V,classNames:m,isBlurred:b,disableSkeleton:P,fallbackSrc:x,removeWrapper:T,isZoomed:W,isLoading:B,getImgProps:D,getWrapperProps:U,getBlurredImgProps:oe}}var u2=jr((e,t)=>{const{Component:n,domRef:r,slots:i,classNames:s,isBlurred:a,isZoomed:c,fallbackSrc:d,removeWrapper:h,disableSkeleton:m,getImgProps:g,getWrapperProps:b,getBlurredImgProps:x}=$z({...e,ref:t}),k=L.jsx(n,{ref:r,...g()});if(h)return k;const P=L.jsx("div",{className:i.zoomedWrapper({class:s?.zoomedWrapper}),children:k});return a?L.jsxs("div",{...b(),children:[c?P:k,S.cloneElement(k,x())]}):c||!m||d?L.jsxs("div",{...b(),children:[" ",c?P:k]}):k});u2.displayName="HeroUI.Image";var y0=u2,[Az,c2]=pv({name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),f2=jr((e,t)=>{const{as:n,children:r,className:i,...s}=e,{slots:a,classNames:c,bodyId:d,setBodyMounted:h}=c2(),m=$i(t),g=n||"div";return S.useEffect(()=>(h(!0),()=>h(!1)),[h]),L.jsx(g,{ref:m,className:a.body({class:Bt(c?.body,i)}),id:d,...s,children:r})});f2.displayName="HeroUI.ModalBody";var Rz=f2,Lz={enter:{scale:"var(--scale-enter)",y:"var(--slide-enter)",opacity:1,willChange:"auto",transition:{scale:{duration:.4,ease:Bp.ease},opacity:{duration:.4,ease:Bp.ease},y:{type:"spring",bounce:0,duration:.6}}},exit:{scale:"var(--scale-exit)",y:"var(--slide-exit)",opacity:0,willChange:"transform",transition:{duration:.3,ease:Bp.ease}}},ss=typeof document<"u"&&window.visualViewport,Mz=He.createContext(!1);function Dz(){return!1}function Nz(){return!0}function Oz(e){return()=>{}}function Fz(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(Oz,Dz,Nz):S.useContext(Mz)}function zz(){let e=Fz(),[t,n]=S.useState(()=>e?{width:0,height:0}:Uk());return S.useEffect(()=>{let r=()=>{n(i=>{let s=Uk();return s.width===i.width&&s.height===i.height?i:s})};return ss?ss.addEventListener("resize",r):window.addEventListener("resize",r),()=>{ss?ss.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),t}function Uk(){return{width:ss&&ss?.width||window.innerWidth,height:ss&&ss?.height||window.innerHeight}}var Kk=()=>fi(()=>import("./index-Bvn9K6h_.js"),[]).then(e=>e.default),d2=e=>{const{as:t,children:n,role:r="dialog",...i}=e,{Component:s,domRef:a,slots:c,classNames:d,motionProps:h,backdrop:m,closeButton:g,hideCloseButton:b,disableAnimation:x,getDialogProps:k,getBackdropProps:P,getCloseButtonProps:T,onClose:_}=c2(),A=t||s||"div",M=zz(),{dialogProps:F}=Iz({role:r},a),j=S.isValidElement(g)?S.cloneElement(g,T()):L.jsx("button",{...T(),children:L.jsx(r6,{})}),$=S.useCallback(G=>{G.key==="Tab"&&G.nativeEvent.isComposing&&(G.stopPropagation(),G.preventDefault())},[]),Y=k(nn(F,i)),te=L.jsxs(A,{...Y,onKeyDown:tl(Y.onKeyDown,$),children:[L.jsx(uk,{onDismiss:_}),!b&&j,typeof n=="function"?n(_):n,L.jsx(uk,{onDismiss:_})]}),ie=S.useMemo(()=>m==="transparent"?null:x?L.jsx("div",{...P()}):L.jsx($f,{features:Kk,children:L.jsx(Af.div,{animate:"enter",exit:"exit",initial:"exit",variants:Zg.fade,...P()})}),[m,x,P]),B={"--visual-viewport-height":M.height+"px"},W=x?L.jsx("div",{className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",style:B,children:te}):L.jsx($f,{features:Kk,children:L.jsx(Af.div,{animate:"enter",className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",exit:"exit",initial:"exit",variants:Lz,...h,style:B,children:te})});return L.jsxs("div",{tabIndex:-1,children:[ie,W]})};d2.displayName="HeroUI.ModalContent";var jz=d2;function Bz(e={shouldBlockScroll:!0},t,n){let{overlayProps:r,underlayProps:i}=i2({...e,isOpen:t.isOpen,onClose:t.close},n);return mO({isDisabled:!t.isOpen||!e.shouldBlockScroll}),b_(),S.useEffect(()=>{if(t.isOpen&&n.current)return PO([n.current])},[t.isOpen,n]),{modalProps:Tn(r),underlayProps:i}}function Vz(e){var t,n,r;const i=ci(),[s,a]=oa(e,Sk.variantKeys),{ref:c,as:d,className:h,classNames:m,isOpen:g,defaultOpen:b,onOpenChange:x,motionProps:k,closeButton:P,isDismissable:T=!0,hideCloseButton:_=!1,shouldBlockScroll:A=!0,portalContainer:M,isKeyboardDismissDisabled:F=!1,onClose:j,...$}=s,Y=d||"section",te=$i(c),ie=S.useRef(null),[B,W]=S.useState(!1),[G,ee]=S.useState(!1),H=(n=(t=e.disableAnimation)!=null?t:i?.disableAnimation)!=null?n:!1,le=S.useId(),J=S.useId(),X=S.useId(),V=r2({isOpen:g,defaultOpen:b,onOpenChange:_e=>{x?.(_e),_e||j?.()}}),{modalProps:ae,underlayProps:D}=Bz({isDismissable:T,shouldBlockScroll:A,isKeyboardDismissDisabled:F},V,te),{buttonProps:U}=U_({onPress:V.close},ie),{isFocusVisible:oe,focusProps:z}=Tu(),me=Bt(m?.base,h),Ce=S.useMemo(()=>Sk({...a,disableAnimation:H}),[ds(a),H]),ye=(_e={},Qe=null)=>{var at;return{ref:yE(Qe,te),...nn(ae,$,_e),className:Ce.base({class:Bt(me,_e.className)}),id:le,"data-open":Ae(V.isOpen),"data-dismissable":Ae(T),"aria-modal":Ae(!0),"data-placement":(at=e?.placement)!=null?at:"right","aria-labelledby":B?J:void 0,"aria-describedby":G?X:void 0}},Fe=S.useCallback((_e={})=>({className:Ce.backdrop({class:m?.backdrop}),...D,..._e}),[Ce,m,D]),Ne=()=>({role:"button",tabIndex:0,"aria-label":"Close","data-focus-visible":Ae(oe),className:Ce.closeButton({class:m?.closeButton}),...nn(U,z)});return{Component:Y,slots:Ce,domRef:te,headerId:J,bodyId:X,motionProps:k,classNames:m,isDismissable:T,closeButton:P,hideCloseButton:_,portalContainer:M,shouldBlockScroll:A,backdrop:(r=e.backdrop)!=null?r:"opaque",isOpen:V.isOpen,onClose:V.close,disableAnimation:H,setBodyMounted:ee,setHeaderMounted:W,getDialogProps:ye,getBackdropProps:Fe,getCloseButtonProps:Ne}}var p2=jr((e,t)=>{const{children:n,...r}=e,i=Vz({...r,ref:t}),s=L.jsx(TO,{portalContainer:i.portalContainer,children:n});return L.jsx(Az,{value:i,children:i.disableAnimation&&i.isOpen?s:L.jsx(sl,{children:i.isOpen?s:null})})});p2.displayName="HeroUI.Modal";var Uz=p2;function Kz(e={}){const{id:t,defaultOpen:n,isOpen:r,onClose:i,onOpen:s,onChange:a=()=>{}}=e,c=Ab(s),d=Ab(i),[h,m]=Ru(r,n||!1,a),g=S.useId(),b=t||g,x=r!==void 0,k=S.useCallback(()=>{x||m(!1),d?.()},[x,d]),P=S.useCallback(()=>{x||m(!0),c?.()},[x,c]),T=S.useCallback(()=>{(h?k:P)()},[h,P,k]);return{isOpen:!!h,onOpen:P,onClose:k,onOpenChange:T,isControlled:x,getButtonProps:(_={})=>({..._,"aria-expanded":h,"aria-controls":b,onClick:Tf(_.onClick,T)}),getDisclosureProps:(_={})=>({..._,hidden:!h,id:b})}}function Wz(e){var t,n;const r=ci(),[i,s]=oa(e,xk.variantKeys),{as:a,children:c,isLoaded:d=!1,className:h,classNames:m,...g}=i,b=a||"div",x=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,k=S.useMemo(()=>xk({...s,disableAnimation:x}),[ds(s),x,c]),P=Bt(m?.base,h);return{Component:b,children:c,slots:k,classNames:m,getSkeletonProps:(A={})=>({"data-loaded":Ae(d),className:k.base({class:Bt(P,A?.className)}),...g}),getContentProps:(A={})=>({className:k.content({class:Bt(m?.content,A?.className)})})}}var h2=jr((e,t)=>{const{Component:n,children:r,getSkeletonProps:i,getContentProps:s}=Wz({...e});return L.jsx(n,{ref:t,...i(),children:L.jsx("div",{...s(),children:r})})});h2.displayName="HeroUI.Skeleton";var Hz=h2;function Gz(e={}){const{domRef:t,isEnabled:n=!0,overflowCheck:r="vertical",visibility:i="auto",offset:s=0,onVisibilityChange:a,updateDeps:c=[]}=e,d=S.useRef(i);S.useEffect(()=>{const h=t?.current;if(!h||!n)return;const m=(x,k,P,T,_)=>{if(i==="auto"){const A=`${T}${bL(_)}Scroll`;k&&P?(h.dataset[A]="true",h.removeAttribute(`data-${T}-scroll`),h.removeAttribute(`data-${_}-scroll`)):(h.dataset[`${T}Scroll`]=k.toString(),h.dataset[`${_}Scroll`]=P.toString(),h.removeAttribute(`data-${T}-${_}-scroll`))}else{const A=k&&P?"both":k?T:P?_:"none";A!==d.current&&(a?.(A),d.current=A)}},g=()=>{var x,k;const P=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],T=h.querySelector('ul[data-slot="list"]'),_=+((x=T?.getAttribute("data-virtual-scroll-height"))!=null?x:h.scrollHeight),A=+((k=T?.getAttribute("data-virtual-scroll-top"))!=null?k:h.scrollTop);for(const{type:M,prefix:F,suffix:j}of P)if(r===M||r==="both"){const $=M==="vertical"?A>s:h.scrollLeft>s,Y=M==="vertical"?A+h.clientHeight+s<_:h.scrollLeft+h.clientWidth+s{["top","bottom","top-bottom","left","right","left-right"].forEach(x=>{h.removeAttribute(`data-${x}-scroll`)})};return g(),h.addEventListener("scroll",g,!0),i!=="auto"&&(b(),i==="both"?(h.dataset.topBottomScroll=String(r==="vertical"),h.dataset.leftRightScroll=String(r==="horizontal")):(h.dataset.topBottomScroll="false",h.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(x=>{h.dataset[`${x}Scroll`]=String(i===x)}))),()=>{h.removeEventListener("scroll",g,!0),b()}},[...c,n,i,r,a,t])}function qz(e){var t;const[n,r]=oa(e,bk.variantKeys),{ref:i,as:s,children:a,className:c,style:d,size:h=40,offset:m=0,visibility:g="auto",isEnabled:b=!0,onVisibilityChange:x,...k}=n,P=s||"div",T=$i(i);Gz({domRef:T,offset:m,visibility:g,isEnabled:b,onVisibilityChange:x,updateDeps:[a],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const _=S.useMemo(()=>bk({...r,className:c}),[ds(r),c]);return{Component:P,styles:_,domRef:T,children:a,getBaseProps:(M={})=>{var F;return{ref:T,className:_,"data-orientation":(F=e.orientation)!=null?F:"vertical",style:{"--scroll-shadow-size":`${h}px`,...d,...M.style},...k,...M}}}}var m2=jr((e,t)=>{const{Component:n,children:r,getBaseProps:i}=qz({...e,ref:t});return L.jsx(n,{...i(),children:r})});m2.displayName="HeroUI.ScrollShadow";var g2=m2;const rq={Like:"like",Dislike:"dislike"},Yz={Start:"START"},kf={User:"user",Assistant:"assistant"},uf={Pending:"pending",InProgress:"in_progress",Completed:"completed"};class v2{constructor(t={}){if(this.chunkQueue=new Map,this.baseUrl=t.baseUrl??"",this.auth=t.auth,this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.slice(0,-1)),!!this.baseUrl)try{new URL(this.baseUrl)}catch{throw new Error(`Invalid base URL: ${this.baseUrl}. Please provide a valid URL.`)}}getBaseUrl(){return this.baseUrl}_buildApiUrl(t){return`${this.baseUrl}${t}`}async _makeRequest(t,n={}){const i={...{"Content-Type":"application/json"},...this.normalizeHeaders(n.headers)};this.auth?.getToken&&(i.Authorization=`Bearer ${this.auth.getToken()}`);const s=await fetch(t,{...n,headers:i,...this.auth?.credentials?{credentials:this.auth?.credentials}:{}});if(s.status===401&&this.auth?.onUnauthorized?.(),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}async makeRequest(t,...n){const r=n[0],{method:i="GET",body:s,pathParams:a,queryParams:c,headers:d={},...h}=r||{},m={method:i,headers:d,...h};s&&i!=="GET"&&(m.body=typeof s=="string"?s:JSON.stringify(s));let g=t.toString();if(a&&typeof a=="object"&&(g=g.replace(/:([^/]+)/g,(x,k)=>{if(k in a){const P=a[k];return encodeURIComponent(String(P))}else throw new Error(`Path parameter ${k} is required`)})),c&&Object.keys(c).length>0){const x=new URLSearchParams;for(const[k,P]of Object.entries(c))P!=null&&x.append(k,String(P));g+=`?${x.toString()}`}return g=this._buildApiUrl(g),(await this._makeRequest(g,m)).json()}makeStreamRequest(t,n,r,i,s){let a=!1;const c=async h=>{const m=h.body?.pipeThrough(new TextDecoderStream).getReader();if(!m)throw new Error("Response body is null");let g="";for(;!a&&!i?.aborted;)try{const{value:b,done:x}=await m.read();if(x){r.onClose?.();break}g+=b;const k=g.split(` -`);g=k.pop()??"";for(const P of k)if(P.startsWith("data: "))try{const T=P.replace("data: ","").trim(),_=JSON.parse(T);if(!this.isChatResponse(_)){console.warn("Received response that isn't ChatResponse, skipping.",_);continue}if(_.type==="chunked_content"){this.handleChunkedContent(_,r);continue}await r.onMessage(_),await new Promise(A=>setTimeout(A,0))}catch(T){console.error("Error parsing JSON:",T),await r.onError(new Error("Error processing server response"))}}catch(b){if(i?.aborted)return;console.error("Stream error:",b),await r.onError(new Error("Error reading stream"));break}},d=async()=>{try{const m={...{"Content-Type":"application/json",Accept:"text/event-stream"},...s};this.auth?.getToken&&(m.Authorization=`Bearer ${this.auth.getToken()}`);const g=await fetch(this._buildApiUrl(t.toString()),{method:"POST",headers:m,body:JSON.stringify(n),signal:i,...this.auth?.credentials?{credentials:this.auth?.credentials}:{}});if(g.status===401&&this.auth?.onUnauthorized?.(),!g.ok)throw new Error(`HTTP error! status: ${g.status}`);await c(g)}catch(h){if(i?.aborted)return;console.error("Request error:",h);const m=h instanceof Error?h.message:"Error connecting to server";await r.onError(new Error(m))}};try{d()}catch(h){const m=h instanceof Error?h.message:"Failed to start stream";r.onError(new Error(m))}return()=>{a=!0}}isChatResponse(t){return t!==null&&typeof t=="object"&&"type"in t&&"content"in t}normalizeHeaders(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):t:{}}async handleChunkedContent(t,n){const i=t.content,{content_type:s,id:a,chunk_index:c,total_chunks:d,mime_type:h,data:m}=i;this.chunkQueue.has(a)||this.chunkQueue.set(a,{chunks:new Map,totalChunks:d,mimeType:h});const g=this.chunkQueue.get(a);if(g.chunks.set(c,m),g.chunks.size!==d)return;const x=Array.from({length:d},(k,P)=>g.chunks.get(P)).join("");try{atob(x)}catch(k){this.chunkQueue.delete(a),console.error("❌ Invalid base64 data: ",k),await n.onError(new Error("Error reading stream"))}if(s==="image"){const k={type:"image",content:{id:a,url:`${g.mimeType},${x}`}};await n.onMessage(k)}this.chunkQueue.delete(a)}}const y2=S.createContext(null);function Xz({children:e,...t}){const n=S.useMemo(()=>new v2(t),[t]),r=S.useMemo(()=>({client:n}),[n]);return L.jsx(y2.Provider,{value:r,children:e})}function nw(){const e=S.useContext(y2);if(!e)throw new Error("useRagbitsContext must be used within a RagbitsProvider");return e}function Qz(e,t){const{client:n}=nw(),[r,i]=S.useState(null),[s,a]=S.useState(null),[c,d]=S.useState(!1),h=S.useRef(null),m=S.useCallback(()=>{if(!h.current)return null;h.current.abort(),h.current=null,d(!1)},[]),g=S.useCallback(async(...x)=>{const k=x[0];h.current&&c&&h.current.abort();const P=new AbortController;h.current=P,d(!0),a(null);try{const _={...{...t,...k||{},headers:{...t?.headers,...k?.headers||{}}},signal:P.signal},A=await n.makeRequest(e,_);return P.signal.aborted||(i(A),h.current=null),A}catch(T){if(!P.signal.aborted){const _=T instanceof Error?T:new Error("API call failed");throw a(_),h.current=null,_}throw T}finally{P.signal.aborted||d(!1)}},[n,e,t,c]),b=S.useCallback(()=>{m(),i(null),a(null),d(!1)},[m]);return{data:r,error:s,isLoading:c,call:g,reset:b,abort:m}}var To=(e=>(e.LIGHT="light",e.DARK="dark",e))(To||{});const b2=S.createContext(null),Jz="🐰",Zz="Ragbits Chat",e8="by deepsense.ai",t8="Loading...",x2="";function n8(){return window.matchMedia("(prefers-color-scheme: dark)").matches?To.DARK:To.LIGHT}function Wk(){const e=window.localStorage.getItem("theme");return e===To.DARK||e===To.LIGHT?e:n8()}function r8(e){return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}const i8=({children:e})=>{const t=S.useSyncExternalStore(r8,Wk,Wk),n=S.useRef(!1),r=new v2({baseUrl:x2});S.useEffect(()=>{if(n.current)return;(async()=>{try{const c=r.getBaseUrl(),d=await fetch(`${c}/api/theme`);if(d.ok){const h=await d.text(),m=document.getElementById("heroui-custom-theme");m&&m.remove();const g=document.createElement("style");g.id="heroui-custom-theme",g.textContent=h,document.head.appendChild(g),console.log("Custom HeroUI theme loaded successfully"),n.current=!0}}catch(c){console.warn("No custom theme available:",c),n.current=!0}})()},[]),S.useEffect(()=>{document.documentElement.classList.toggle("dark",t===To.DARK)},[t]);const i=S.useCallback(a=>{window.localStorage.setItem("theme",a),window.dispatchEvent(new Event("storage"))},[]),s=S.useMemo(()=>({theme:t,setTheme:i}),[t,i]);return L.jsx(b2.Provider,{value:s,children:e})},w2=Object.freeze({left:0,top:0,width:16,height:16}),nv=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),rw=Object.freeze({...w2,...nv}),Lb=Object.freeze({...rw,body:"",hidden:!1});function o8(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Hk(e,t){const n=o8(e,t);for(const r in Lb)r in nv?r in e&&!(r in n)&&(n[r]=nv[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function s8(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,d=c&&s(c);d&&(i[a]=[c].concat(d))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function a8(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=Hk(r[c]||i[c],s)}return a(t),n.forEach(a),Hk(e,s)}function S2(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=s8(e);for(const i in r){const s=r[i];s&&(t(i,a8(e,i,s)),n.push(i))}return n}const l8={provider:"",aliases:{},not_found:{},...w2};function b0(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function k2(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!b0(e,l8))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!b0(s,Lb))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!b0(s,Lb))return null}return t}const C2=/^[a-z0-9]+(-[a-z0-9]+)*$/,Cv=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),d=i.pop(),h={provider:i.length>0?i[0]:r,prefix:d,name:c};return t&&!Dg(h)?null:h}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Dg(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Dg(c,n)?null:c}return null},Dg=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Gk=Object.create(null);function u8(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Rf(e,t){const n=Gk[e]||(Gk[e]=Object.create(null));return n[t]||(n[t]=u8(e,t))}function E2(e,t){return k2(t)?S2(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function c8(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let ah=!1;function P2(e){return typeof e=="boolean"&&(ah=e),ah}function qk(e){const t=typeof e=="string"?Cv(e,!0,ah):e;if(t){const n=Rf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function f8(e,t){const n=Cv(e,!0,ah);if(!n)return!1;const r=Rf(n.provider,n.prefix);return t?c8(r,n.name,t):(r.missing.add(n.name),!0)}function d8(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ah&&!t&&!e.prefix){let i=!1;return k2(e)&&(e.prefix="",S2(e,(s,a)=>{f8(s,a)&&(i=!0)})),i}const n=e.prefix;if(!Dg({prefix:n,name:"a"}))return!1;const r=Rf(t,n);return!!E2(r,e)}const T2=Object.freeze({width:null,height:null}),_2=Object.freeze({...T2,...nv}),p8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,h8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Yk(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(p8);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=h8.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}function m8(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("",s);if(a===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function g8(e,t){return e?""+e+""+t:t}function v8(e,t,n){const r=m8(e);return g8(r.defs,t+r.content+n)}const y8=e=>e==="unset"||e==="undefined"||e==="none";function b8(e,t){const n={...rw,...e},r={..._2,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(P=>{const T=[],_=P.hFlip,A=P.vFlip;let M=P.rotate;_?A?M+=2:(T.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),T.push("scale(-1 1)"),i.top=i.left=0):A&&(T.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),T.push("scale(1 -1)"),i.top=i.left=0);let F;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:F=i.height/2+i.top,T.unshift("rotate(90 "+F.toString()+" "+F.toString()+")");break;case 2:T.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:F=i.width/2+i.left,T.unshift("rotate(-90 "+F.toString()+" "+F.toString()+")");break}M%2===1&&(i.left!==i.top&&(F=i.left,i.left=i.top,i.top=F),i.width!==i.height&&(F=i.width,i.width=i.height,i.height=F)),T.length&&(s=v8(s,'',""))});const a=r.width,c=r.height,d=i.width,h=i.height;let m,g;a===null?(g=c===null?"1em":c==="auto"?h:c,m=Yk(g,d/h)):(m=a==="auto"?d:a,g=c===null?Yk(m,h/d):c==="auto"?h:c);const b={},x=(P,T)=>{y8(T)||(b[P]=T.toString())};x("width",m),x("height",g);const k=[i.left,i.top,d,h];return b.viewBox=k.join(" "),{attributes:b,viewBox:k,body:s}}const x8=/\sid="(\S+)"/g,w8="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let S8=0;function k8(e,t=w8){const n=[];let r;for(;r=x8.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(S8++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const Mb=Object.create(null);function C8(e,t){Mb[e]=t}function Db(e){return Mb[e]||Mb[""]}function iw(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ow=Object.create(null),wp=["https://api.simplesvg.com","https://api.unisvg.com"],Ng=[];for(;wp.length>0;)wp.length===1||Math.random()>.5?Ng.push(wp.shift()):Ng.push(wp.pop());ow[""]=iw({resources:["https://api.iconify.design"].concat(Ng)});function E8(e,t){const n=iw(t);return n===null?!1:(ow[e]=n,!0)}function sw(e){return ow[e]}const P8=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Xk=P8();function T8(e,t){const n=sw(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function _8(e){return e===404}const I8=(e,t,n)=>{const r=[],i=T8(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((d,h)=>{c+=d.length+1,c>=i&&h>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=d.length),a.icons.push(d)}),r.push(a),r};function $8(e){if(typeof e=="string"){const t=sw(e);if(t)return t.path}return"/"}const A8=(e,t,n)=>{if(!Xk){n("abort",424);return}let r=$8(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),d=new URLSearchParams({icons:c});r+=s+".json?"+d.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;Xk(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(_8(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},R8={prepare:I8,send:A8};function L8(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,d=n[s]||(n[s]=Object.create(null)),h=d[a]||(d[a]=Rf(s,a));let m;c in h.icons?m=t.loaded:a===""||h.missing.has(c)?m=t.missing:m=t.pending;const g={provider:s,prefix:a,name:c};m.push(g)}),t}function I2(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function M8(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const h=d.name;if(e.icons[h])a.loaded.push({provider:r,prefix:i,name:h});else if(e.missing.has(h))a.missing.push({provider:r,prefix:i,name:h});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||I2([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let D8=0;function N8(e,t,n){const r=D8++,i=I2.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function O8(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?Cv(i,t,n):i;s&&r.push(s)}),r}var F8={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function z8(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let $=e.resources.slice(0);for(a=[];$.length>1;){const Y=Math.floor(Math.random()*$.length);a.push($[Y]),$=$.slice(0,Y).concat($.slice(Y+1))}a=a.concat($)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let d="pending",h=0,m,g=null,b=[],x=[];typeof r=="function"&&x.push(r);function k(){g&&(clearTimeout(g),g=null)}function P(){d==="pending"&&(d="aborted"),k(),b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function T($,Y){Y&&(x=[]),typeof $=="function"&&x.push($)}function _(){return{startTime:c,payload:t,status:d,queriesSent:h,queriesPending:b.length,subscribe:T,abort:P}}function A(){d="failed",x.forEach($=>{$(void 0,m)})}function M(){b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function F($,Y,te){const ie=Y!=="success";switch(b=b.filter(B=>B!==$),d){case"pending":break;case"failed":if(ie||!e.dataAfterTimeout)return;break;default:return}if(Y==="abort"){m=te,A();return}if(ie){m=te,b.length||(a.length?j():A());return}if(k(),M(),!e.random){const B=e.resources.indexOf($.resource);B!==-1&&B!==e.index&&(e.index=B)}d="completed",x.forEach(B=>{B(te)})}function j(){if(d!=="pending")return;k();const $=a.shift();if($===void 0){if(b.length){g=setTimeout(()=>{k(),d==="pending"&&(M(),A())},e.timeout);return}A();return}const Y={status:"pending",resource:$,callback:(te,ie)=>{F(Y,te,ie)}};b.push(Y),h++,g=setTimeout(j,e.rotate),n($,t,Y.callback)}return setTimeout(j),_}function $2(e){const t={...F8,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,d,h){const m=z8(t,c,d,(g,b)=>{r(),h&&h(g,b)});return n.push(m),m}function s(c){return n.find(d=>c(d))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Qk(){}const x0=Object.create(null);function j8(e){if(!x0[e]){const t=sw(e);if(!t)return;const n=$2(t),r={config:t,redundancy:n};x0[e]=r}return x0[e]}function B8(e,t,n){let r,i;if(typeof e=="string"){const s=Db(e);if(!s)return n(void 0,424),Qk;i=s.send;const a=j8(e);a&&(r=a.redundancy)}else{const s=iw(e);if(s){r=$2(s);const a=e.resources?e.resources[0]:"",c=Db(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),Qk):r.query(t,i,n)().abort}function Jk(){}function V8(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,M8(e)}))}function U8(e){const t=[],n=[];return e.forEach(r=>{(r.match(C2)?t:n).push(r)}),{valid:t,invalid:n}}function Sp(e,t,n){function r(){const i=e.pendingIcons;t.forEach(s=>{i&&i.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!E2(e,n).length){r();return}}catch(i){console.error(i)}r(),V8(e)}function Zk(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function K8(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){Zk(e.loadIcons(i,r,n),m=>{Sp(e,i,m)});return}if(s){i.forEach(m=>{const g=s(m,r,n);Zk(g,b=>{const x=b?{prefix:r,icons:{[m]:b}}:null;Sp(e,[m],x)})});return}const{valid:a,invalid:c}=U8(i);if(c.length&&Sp(e,c,null),!a.length)return;const d=r.match(C2)?Db(n):null;if(!d){Sp(e,a,null);return}d.prepare(n,r,a).forEach(m=>{B8(n,m,g=>{Sp(e,m.icons,g)})})}))}const A2=(e,t)=>{const n=O8(e,!0,P2()),r=L8(n);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,Jk)}),()=>{d=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(d=>{const{provider:h,prefix:m}=d;if(m===c&&h===a)return;a=h,c=m,s.push(Rf(h,m));const g=i[h]||(i[h]=Object.create(null));g[m]||(g[m]=[])}),r.pending.forEach(d=>{const{provider:h,prefix:m,name:g}=d,b=Rf(h,m),x=b.pendingIcons||(b.pendingIcons=new Set);x.has(g)||(x.add(g),i[h][m].push(g))}),s.forEach(d=>{const h=i[d.provider][d.prefix];h.length&&K8(d,h)}),t?N8(t,r,s):Jk};function W8(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in T2?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const H8=/[\s,]+/;function G8(e,t){t.split(H8).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function q8(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Y8(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function X8(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Q8(e){return"data:image/svg+xml,"+X8(e)}function J8(e){return'url("'+Q8(e)+'")'}let Vp;function Z8(){try{Vp=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Vp=null}}function e7(e){return Vp===void 0&&Z8(),Vp?Vp.createHTML(e):e}const R2={..._2,inline:!1},t7={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},n7={display:"inline-block"},Nb={backgroundColor:"currentColor"},L2={backgroundColor:"transparent"},eC={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},tC={WebkitMask:Nb,mask:Nb,background:L2};for(const e in tC){const t=tC[e];for(const n in eC)t[e+n]=eC[n]}const r7={...R2,inline:!0};function nC(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const i7=(e,t,n)=>{const r=t.inline?r7:R2,i=W8(r,t),s=t.mode||"svg",a={},c=t.style||{},d={...s==="svg"?t7:{}};if(n){const T=Cv(n,!1,!0);if(T){const _=["iconify"],A=["provider","prefix"];for(const M of A)T[M]&&_.push("iconify--"+T[M]);d.className=_.join(" ")}}for(let T in t){const _=t[T];if(_!==void 0)switch(T){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":d.ref=_;break;case"className":d[T]=(d[T]?d[T]+" ":"")+_;break;case"inline":case"hFlip":case"vFlip":i[T]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&G8(i,_);break;case"color":a.color=_;break;case"rotate":typeof _=="string"?i[T]=q8(_):typeof _=="number"&&(i[T]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete d["aria-hidden"];break;default:r[T]===void 0&&(d[T]=_)}}const h=b8(e,i),m=h.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),s==="svg"){d.style={...a,...c},Object.assign(d,m);let T=0,_=t.id;return typeof _=="string"&&(_=_.replace(/-/g,"_")),d.dangerouslySetInnerHTML={__html:e7(k8(h.body,_?()=>_+"ID"+T++:"iconifyReact"))},S.createElement("svg",d)}const{body:g,width:b,height:x}=e,k=s==="mask"||(s==="bg"?!1:g.indexOf("currentColor")!==-1),P=Y8(g,{...m,width:b+"",height:x+""});return d.style={...a,"--svg":J8(P),width:nC(m.width),height:nC(m.height),...n7,...k?Nb:L2,...c},S.createElement("span",d)};P2(!0);C8("",R8);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!d8(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;E8(n,i)||console.error(r)}catch{console.error(r)}}}}function M2(e){const[t,n]=S.useState(!!e.ssr),[r,i]=S.useState({});function s(x){if(x){const k=e.icon;if(typeof k=="object")return{name:"",data:k};const P=qk(k);if(P)return{name:k,data:P}}return{name:""}}const[a,c]=S.useState(s(!!e.ssr));function d(){const x=r.callback;x&&(x(),i({}))}function h(x){if(JSON.stringify(a)!==JSON.stringify(x))return d(),c(x),!0}function m(){var x;const k=e.icon;if(typeof k=="object"){h({name:"",data:k});return}const P=qk(k);if(h({name:k,data:P}))if(P===void 0){const T=A2([k],m);i({callback:T})}else P&&((x=e.onLoad)===null||x===void 0||x.call(e,k))}S.useEffect(()=>(n(!0),d),[]),S.useEffect(()=>{t&&m()},[e.icon,t]);const{name:g,data:b}=a;return b?i7({...rw,...b},e,g):e.children?e.children:e.fallback?e.fallback:S.createElement("span",{})}const ui=S.forwardRef((e,t)=>M2({...e,_ref:t}));S.forwardRef((e,t)=>M2({inline:!0,...e,_ref:t}));var Lp={exports:{}};var o7=Lp.exports,rC;function s7(){return rC||(rC=1,(function(e,t){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",g=1,b=2,x=4,k=1,P=2,T=1,_=2,A=4,M=8,F=16,j=32,$=64,Y=128,te=256,ie=512,B=30,W="...",G=800,ee=16,H=1,le=2,J=3,X=1/0,V=9007199254740991,ae=17976931348623157e292,D=NaN,U=4294967295,oe=U-1,z=U>>>1,me=[["ary",Y],["bind",T],["bindKey",_],["curry",M],["curryRight",F],["flip",ie],["partial",j],["partialRight",$],["rearg",te]],Ce="[object Arguments]",ye="[object Array]",Fe="[object AsyncFunction]",Ne="[object Boolean]",_e="[object Date]",Qe="[object DOMException]",at="[object Error]",Ie="[object Function]",mt="[object GeneratorFunction]",pt="[object Map]",Ut="[object Number]",Ue="[object Null]",it="[object Object]",Kt="[object Promise]",tr="[object Proxy]",an="[object RegExp]",_t="[object Set]",Rt="[object String]",_n="[object Symbol]",Er="[object Undefined]",Nt="[object WeakMap]",pe="[object WeakSet]",Se="[object ArrayBuffer]",ze="[object DataView]",nt="[object Float32Array]",lt="[object Float64Array]",Wt="[object Int8Array]",Vn="[object Int16Array]",Jt="[object Int32Array]",Pt="[object Uint8Array]",Pr="[object Uint8ClampedArray]",Ot="[object Uint16Array]",nr="[object Uint32Array]",ln=/\b__p \+= '';/g,aa=/\b(__p \+=) '' \+/g,ms=/(__e\(.*?\)|\b__t\)) \+\n'';/g,pi=/&(?:amp|lt|gt|quot|#39);/g,hi=/[&<>"']/g,cl=RegExp(pi.source),Du=RegExp(hi.source),gs=/<%-([\s\S]+?)%>/g,Vr=/<%([\s\S]+?)%>/g,fl=/<%=([\s\S]+?)%>/g,dl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zt=/^\w*$/,vs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,Ro=RegExp(ys.source),pl=/^\s+/,bs=/\s/,la=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ua=/\{\n\/\* \[wrapped with (.+)\] \*/,hl=/,? & /,Kf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wf=/[()=,{}\[\]\/\s]/,Hf=/\\(\\)?/g,Xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,so=/\w*$/,$h=/^[-+]0x[0-9a-f]+$/i,Fv=/^0b[01]+$/i,Ah=/^\[object .+?Constructor\]$/,Rh=/^0o[0-7]+$/i,Lh=/^(?:0|[1-9]\d*)$/,Mh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nu=/($^)/,zv=/['\n\r\u2028\u2029\\]/g,Ht="\\ud800-\\udfff",jv="\\u0300-\\u036f",Gf="\\ufe20-\\ufe2f",Dh="\\u20d0-\\u20ff",ml=jv+Gf+Dh,Nh="\\u2700-\\u27bf",qf="a-z\\xdf-\\xf6\\xf8-\\xff",Ou="\\xac\\xb1\\xd7\\xf7",Mi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bv="\\u2000-\\u206f",mi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oh="A-Z\\xc0-\\xd6\\xd8-\\xde",Fh="\\ufe0e\\ufe0f",zh=Ou+Mi+Bv+mi,ca="['’]",Fu="["+Ht+"]",fa="["+zh+"]",xs="["+ml+"]",jh="\\d+",Vv="["+Nh+"]",zu="["+qf+"]",Yf="[^"+Ht+zh+jh+Nh+qf+Oh+"]",gl="\\ud83c[\\udffb-\\udfff]",vl="(?:"+xs+"|"+gl+")",Bh="[^"+Ht+"]",yl="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",ws="["+Oh+"]",Xf="\\u200d",ju="(?:"+zu+"|"+Yf+")",Vh="(?:"+ws+"|"+Yf+")",Qf="(?:"+ca+"(?:d|ll|m|re|s|t|ve))?",Jf="(?:"+ca+"(?:D|LL|M|RE|S|T|VE))?",Bu=vl+"?",bl="["+Fh+"]?",Lo="(?:"+Xf+"(?:"+[Bh,yl,Et].join("|")+")"+bl+Bu+")*",Mo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Do="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",da=bl+Bu+Lo,xl="(?:"+[Vv,yl,Et].join("|")+")"+da,No="(?:"+[Bh+xs+"?",xs,yl,Et,Fu].join("|")+")",Uv=RegExp(ca,"g"),Uh=RegExp(xs,"g"),Ss=RegExp(gl+"(?="+gl+")|"+No+da,"g"),Kv=RegExp([ws+"?"+zu+"+"+Qf+"(?="+[fa,ws,"$"].join("|")+")",Vh+"+"+Jf+"(?="+[fa,ws+ju,"$"].join("|")+")",ws+"?"+ju+"+"+Qf,ws+"+"+Jf,Do,Mo,jh,xl].join("|"),"g"),Kh=RegExp("["+Xf+Ht+ml+Fh+"]"),Vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Wv=-1,It={};It[nt]=It[lt]=It[Wt]=It[Vn]=It[Jt]=It[Pt]=It[Pr]=It[Ot]=It[nr]=!0,It[Ce]=It[ye]=It[Se]=It[Ne]=It[ze]=It[_e]=It[at]=It[Ie]=It[pt]=It[Ut]=It[it]=It[an]=It[_t]=It[Rt]=It[Nt]=!1;var Tt={};Tt[Ce]=Tt[ye]=Tt[Se]=Tt[ze]=Tt[Ne]=Tt[_e]=Tt[nt]=Tt[lt]=Tt[Wt]=Tt[Vn]=Tt[Jt]=Tt[pt]=Tt[Ut]=Tt[it]=Tt[an]=Tt[_t]=Tt[Rt]=Tt[_n]=Tt[Pt]=Tt[Pr]=Tt[Ot]=Tt[nr]=!0,Tt[at]=Tt[Ie]=Tt[Nt]=!1;var pa={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Uu={"&":"&","<":"<",">":">",'"':""","'":"'"},Hv={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zf=parseFloat,Ku=parseInt,Wu=typeof ig=="object"&&ig&&ig.Object===Object&&ig,Hh=typeof self=="object"&&self&&self.Object===Object&&self,Gt=Wu||Hh||Function("return this")(),wl=t&&!t.nodeType&&t,Di=wl&&!0&&e&&!e.nodeType&&e,ed=Di&&Di.exports===wl,ha=ed&&Wu.process,rr=(function(){try{var re=Di&&Di.require&&Di.require("util").types;return re||ha&&ha.binding&&ha.binding("util")}catch{}})(),td=rr&&rr.isArrayBuffer,pr=rr&&rr.isDate,ks=rr&&rr.isMap,Hu=rr&&rr.isRegExp,ma=rr&&rr.isSet,Gh=rr&&rr.isTypedArray;function ir(re,he,fe){switch(fe.length){case 0:return re.call(he);case 1:return re.call(he,fe[0]);case 2:return re.call(he,fe[0],fe[1]);case 3:return re.call(he,fe[0],fe[1],fe[2])}return re.apply(he,fe)}function nd(re,he,fe,Re){for(var rt=-1,wt=re==null?0:re.length;++rt-1}function id(re,he,fe){for(var Re=-1,rt=re==null?0:re.length;++Re-1;);return fe}function fd(re,he){for(var fe=re.length;fe--&&ga(he,re[fe],0)>-1;);return fe}function tm(re,he){for(var fe=re.length,Re=0;fe--;)re[fe]===he&&++Re;return Re}var nm=Xu(pa),rm=Xu(Uu);function im(re){return"\\"+Gv[re]}function va(re,he){return re==null?n:re[he]}function ya(re){return Kh.test(re)}function Zv(re){return Vu.test(re)}function ey(re){for(var he,fe=[];!(he=re.next()).done;)fe.push(he.value);return fe}function Qu(re){var he=-1,fe=Array(re.size);return re.forEach(function(Re,rt){fe[++he]=[rt,Re]}),fe}function dd(re,he){return function(fe){return re(he(fe))}}function Ur(re,he){for(var fe=-1,Re=re.length,rt=0,wt=[];++fe-1}function mm(u,f){var y=this.__data__,E=qn(y,u);return E<0?(++this.size,y.push([u,f])):y[E][1]=f,this}or.prototype.clear=Ia,or.prototype.delete=gr,or.prototype.get=fc,or.prototype.has=hm,or.prototype.set=mm;function Wr(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f=f?u:f)),u}function vr(u,f,y,E,I,O){var q,Z=f&g,se=f&b,ge=f&x;if(y&&(q=I?y(u,E,I,O):y(u)),q!==n)return q;if(!fn(u))return u;var ve=st(u);if(ve){if(q=Xl(u),!Z)return sr(u,q)}else{var we=Fn(u),$e=we==Ie||we==mt;if(Ha(u))return Md(u,Z);if(we==it||we==Ce||$e&&!I){if(q=se||$e?{}:zn(u),!Z)return se?ly(u,vi(q,u)):_c(u,jt(q,u))}else{if(!Tt[we])return I?u:{};q=uy(u,we,Z)}}O||(O=new Gn);var Ke=O.get(u);if(Ke)return Ke;O.set(u,q),Kw(u)?u.forEach(function(et){q.add(vr(et,f,y,et,u,O))}):Vw(u)&&u.forEach(function(et,gt){q.set(gt,vr(et,f,y,gt,u,O))});var Ze=ge?se?Gl:Hl:se?ni:Qn,dt=ve?n:Ze(u);return Un(dt||u,function(et,gt){dt&&(gt=et,et=u[gt]),As(q,gt,vr(et,f,y,gt,u,O))}),q}function bm(u){var f=Qn(u);return function(y){return Ml(y,u,f)}}function Ml(u,f,y){var E=y.length;if(u==null)return!E;for(u=$t(u);E--;){var I=y[E],O=f[I],q=u[I];if(q===n&&!(I in u)||!O(q))return!1}return!0}function xd(u,f,y){if(typeof u!="function")throw new Kr(a);return Ua(function(){u.apply(n,y)},f)}function Vi(u,f,y,E){var I=-1,O=qu,q=!0,Z=u.length,se=[],ge=f.length;if(!Z)return se;y&&(f=Lt(f,Tr(y))),E?(O=id,q=!1):f.length>=i&&(O=ao,q=!1,f=new _s(f));e:for(;++II?0:I+y),E=E===n||E>I?I:ct(E),E<0&&(E+=I),E=y>E?0:Hw(E);y0&&y(Z)?f>1?on(Z,f-1,y,E,I):Fo(I,Z):E||(I[I.length]=Z)}return I}var gc=$c(),Nl=$c(!0);function Ar(u,f){return u&&gc(u,f,Qn)}function Ho(u,f){return u&&Nl(u,f,Qn)}function Aa(u,f){return Oo(f,function(y){return Ws(u[y])})}function ho(u,f){f=Hi(f,u);for(var y=0,E=f.length;u!=null&&yf}function qr(u,f){return u!=null&&St.call(u,f)}function Ls(u,f){return u!=null&&f in $t(u)}function Sd(u,f,y){return u>=Kn(f,y)&&u=120&&ve.length>=120)?new _s(q&&ve):n}ve=u[0];var we=-1,$e=Z[0];e:for(;++we-1;)Z!==u&&ic.call(Z,se,1),ic.call(u,se,1);return u}function bn(u,f){for(var y=u?f.length:0,E=y-1;y--;){var I=f[y];if(y==E||I!==O){var O=I;Yt(I)?ic.call(u,I,1):Ec(u,I)}}return u}function Ma(u,f){return u+jo(Il()*(f-u+1))}function jl(u,f,y,E){for(var I=-1,O=hn(Ps((f-u)/(y||1)),0),q=fe(O);O--;)q[E?O:++I]=u,u+=y;return q}function Ds(u,f){var y="";if(!u||f<1||f>V)return y;do f%2&&(y+=u),f=jo(f/2),f&&(u+=u);while(f);return y}function ut(u,f){return Rr(zc(u,f,ri),u+"")}function Yn(u){return ji(of(u))}function _d(u,f){var y=of(u);return jc(y,po(f,0,y.length))}function Ns(u,f,y,E){if(!fn(u))return u;f=Hi(f,u);for(var I=-1,O=f.length,q=O-1,Z=u;Z!=null&&++II?0:I+f),y=y>I?I:y,y<0&&(y+=I),I=f>y?0:y-f>>>0,f>>>=0;for(var O=fe(I);++E>>1,q=u[O];q!==null&&!Ei(q)&&(y?q<=f:q=i){var ge=f?null:Rm(u);if(ge)return zo(ge);q=!1,I=ao,se=new _s}else se=f?[]:Z;e:for(;++E=E?u:Xn(u,f,y)}var Ld=fm||function(u){return Gt.clearTimeout(u)};function Md(u,f){if(f)return u.slice();var y=u.length,E=hd?hd(y):new u.constructor(y);return u.copy(E),E}function Ul(u){var f=new u.constructor(u.byteLength);return new Tl(f).set(new Tl(u)),f}function Em(u,f){var y=f?Ul(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function Pm(u){var f=new u.constructor(u.source,so.exec(u));return f.lastIndex=u.lastIndex,f}function Tm(u){return Ir?$t(Ir.call(u)):{}}function _m(u,f){var y=f?Ul(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function Dd(u,f){if(u!==f){var y=u!==n,E=u===null,I=u===u,O=Ei(u),q=f!==n,Z=f===null,se=f===f,ge=Ei(f);if(!Z&&!ge&&!O&&u>f||O&&q&&se&&!Z&&!ge||E&&q&&se||!y&&se||!I)return 1;if(!E&&!O&&!ge&&u=Z)return se;var ge=y[E];return se*(ge=="desc"?-1:1)}}return u.index-f.index}function Im(u,f,y,E){for(var I=-1,O=u.length,q=y.length,Z=-1,se=f.length,ge=hn(O-q,0),ve=fe(se+ge),we=!E;++Z1?y[I-1]:n,q=I>2?y[2]:n;for(O=u.length>3&&typeof O=="function"?(I--,O):n,q&&lr(y[0],y[1],q)&&(O=I<3?n:O,I=1),f=$t(f);++E-1?I[O?f[q]:q]:n}}function Rc(u){return qi(function(f){var y=f.length,E=y,I=Wn.prototype.thru;for(u&&f.reverse();E--;){var O=f[E];if(typeof O!="function")throw new Kr(a);if(I&&!q&&Ba(O)=="wrapper")var q=new Wn([],!0)}for(E=q?E:y;++E1&&xt.reverse(),ve&&seZ))return!1;var ge=O.get(u),ve=O.get(f);if(ge&&ve)return ge==f&&ve==u;var we=-1,$e=!0,Ke=y&P?new _s:n;for(O.set(u,f),O.set(f,u);++we1?"& ":"")+f[E],f=f.join(y>2?", ":" "),u.replace(la,`{ -/* [wrapped with `+f+`] */ -`)}function Oc(u){return st(u)||su(u)||!!(cm&&u&&u[cm])}function Yt(u,f){var y=typeof u;return f=f??V,!!f&&(y=="number"||y!="symbol"&&Lh.test(u))&&u>-1&&u%1==0&&u0){if(++f>=G)return arguments[0]}else f=0;return u.apply(n,arguments)}}function jc(u,f){var y=-1,E=u.length,I=E-1;for(f=f===n?E:f;++y1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,tn(u,y)});function Yc(u){var f=N(u);return f.__chain__=!0,f}function xy(u,f){return f(u),u}function Ci(u,f){return f(u)}var Xc=qi(function(u){var f=u.length,y=f?u[0]:0,E=this.__wrapped__,I=function(O){return mc(O,u)};return f>1||this.__actions__.length||!(E instanceof ot)||!Yt(y)?this.thru(I):(E=E.slice(y,+y+(f?1:0)),E.__actions__.push({func:Ci,args:[I],thisArg:n}),new Wn(E,this.__chain__).thru(function(O){return f&&!O.length&&O.push(n),O}))});function Us(){return Yc(this)}function Qc(){return new Wn(this.value(),this.__chain__)}function ap(){this.__values__===n&&(this.__values__=Ww(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function lp(){return this}function wy(u){for(var f,y=this;y instanceof Fi;){var E=Bm(y);E.__index__=0,E.__values__=n,f?I.__wrapped__=E:f=E;var I=E;y=y.__wrapped__}return I.__wrapped__=u,f}function up(){var u=this.__wrapped__;if(u instanceof ot){var f=u;return this.__actions__.length&&(f=new ot(this)),f=f.reverse(),f.__actions__.push({func:Ci,args:[Hc],thisArg:n}),new Wn(f,this.__chain__)}return this.thru(Hc)}function Sy(){return Na(this.__wrapped__,this.__actions__)}var Xm=Ic(function(u,f,y){St.call(u,y)?++u[y]:Bi(u,y,1)});function Qm(u,f,y){var E=st(u)?rd:Dl;return y&&lr(u,f,y)&&(f=n),E(u,qe(f,3))}function Jc(u,f){var y=st(u)?Oo:wd;return y(u,qe(f,3))}var Zc=Fs(Jo),Jm=Fs(eu);function cp(u,f){return on(Ks(u,f),1)}function ky(u,f){return on(Ks(u,f),X)}function Zm(u,f,y){return y=y===n?1:ct(y),on(Ks(u,f),y)}function ef(u,f){var y=st(u)?Un:Ui;return y(u,qe(f,3))}function iu(u,f){var y=st(u)?Gu:xm;return y(u,qe(f,3))}var fp=Ic(function(u,f,y){St.call(u,y)?u[y].push(f):Bi(u,y,[f])});function tf(u,f,y,E){u=ti(u)?u:of(u),y=y&&!E?ct(y):0;var I=u.length;return y<0&&(y=hn(I+y,0)),ng(u)?y<=I&&u.indexOf(f,y)>-1:!!I&&ga(u,f,y)>-1}var eg=ut(function(u,f,y){var E=-1,I=typeof f=="function",O=ti(u)?fe(u.length):[];return Ui(u,function(q){O[++E]=I?ir(f,q,y):Yr(q,f,y)}),O}),Cy=Ic(function(u,f,y){Bi(u,y,f)});function Ks(u,f){var y=st(u)?Lt:Ed;return y(u,qe(f,3))}function Ey(u,f,y,E){return u==null?[]:(st(f)||(f=f==null?[]:[f]),y=E?n:y,st(y)||(y=y==null?[]:[y]),zl(u,f,y))}var ou=Ic(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function Py(u,f,y){var E=st(u)?od:Jh,I=arguments.length<3;return E(u,qe(f,4),y,I,Ui)}function nf(u,f,y){var E=st(u)?qv:Jh,I=arguments.length<3;return E(u,qe(f,4),y,I,xm)}function o(u,f){var y=st(u)?Oo:wd;return y(u,Ee(qe(f,3)))}function l(u){var f=st(u)?ji:Yn;return f(u)}function p(u,f,y){(y?lr(u,f,y):f===n)?f=1:f=ct(f);var E=st(u)?$s:_d;return E(u,f)}function v(u){var f=st(u)?ym:Qr;return f(u)}function w(u){if(u==null)return 0;if(ti(u))return ng(u)?Cs(u):u.length;var f=Fn(u);return f==pt||f==_t?u.size:vo(u).length}function C(u,f,y){var E=st(u)?sd:Id;return y&&lr(u,f,y)&&(f=n),E(u,qe(f,3))}var R=ut(function(u,f){if(u==null)return[];var y=f.length;return y>1&&lr(u,f[0],f[1])?f=[]:y>2&&lr(f[0],f[1],f[2])&&(f=[f[0]]),zl(u,on(f,1),[])}),K=Ft||function(){return Gt.Date.now()};function Q(u,f){if(typeof f!="function")throw new Kr(a);return u=ct(u),function(){if(--u<1)return f.apply(this,arguments)}}function de(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Gi(u,Y,n,n,n,n,f)}function xe(u,f){var y;if(typeof f!="function")throw new Kr(a);return u=ct(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var ke=ut(function(u,f,y){var E=T;if(y.length){var I=Ur(y,xo(ke));E|=j}return Gi(u,E,f,y,I)}),be=ut(function(u,f,y){var E=T|_;if(y.length){var I=Ur(y,xo(be));E|=j}return Gi(f,E,u,y,I)});function Le(u,f,y){f=y?n:f;var E=Gi(u,M,n,n,n,n,n,f);return E.placeholder=Le.placeholder,E}function De(u,f,y){f=y?n:f;var E=Gi(u,F,n,n,n,n,n,f);return E.placeholder=De.placeholder,E}function Oe(u,f,y){var E,I,O,q,Z,se,ge=0,ve=!1,we=!1,$e=!0;if(typeof u!="function")throw new Kr(a);f=Xi(f)||0,fn(y)&&(ve=!!y.leading,we="maxWait"in y,O=we?hn(Xi(y.maxWait)||0,f):O,$e="trailing"in y?!!y.trailing:$e);function Ke(Sn){var Co=E,Gs=I;return E=I=n,ge=Sn,q=u.apply(Gs,Co),q}function Ze(Sn){return ge=Sn,Z=Ua(gt,f),ve?Ke(Sn):q}function dt(Sn){var Co=Sn-se,Gs=Sn-ge,i1=f-Co;return we?Kn(i1,O-Gs):i1}function et(Sn){var Co=Sn-se,Gs=Sn-ge;return se===n||Co>=f||Co<0||we&&Gs>=O}function gt(){var Sn=K();if(et(Sn))return xt(Sn);Z=Ua(gt,dt(Sn))}function xt(Sn){return Z=n,$e&&E?Ke(Sn):(E=I=n,q)}function Pi(){Z!==n&&Ld(Z),ge=0,E=se=I=Z=n}function Mr(){return Z===n?q:xt(K())}function Ti(){var Sn=K(),Co=et(Sn);if(E=arguments,I=this,se=Sn,Co){if(Z===n)return Ze(se);if(we)return Ld(Z),Z=Ua(gt,f),Ke(se)}return Z===n&&(Z=Ua(gt,f)),q}return Ti.cancel=Pi,Ti.flush=Mr,Ti}var cn=ut(function(u,f){return xd(u,1,f)}),ue=ut(function(u,f,y){return xd(u,Xi(f)||0,y)});function ne(u){return Gi(u,ie)}function ce(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new Kr(a);var y=function(){var E=arguments,I=f?f.apply(this,E):E[0],O=y.cache;if(O.has(I))return O.get(I);var q=u.apply(this,E);return y.cache=O.set(I,q)||O,q};return y.cache=new(ce.Cache||Wr),y}ce.Cache=Wr;function Ee(u){if(typeof u!="function")throw new Kr(a);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function Ve(u){return xe(2,u)}var Ge=Cm(function(u,f){f=f.length==1&&st(f[0])?Lt(f[0],Tr(qe())):Lt(on(f,1),Tr(qe()));var y=f.length;return ut(function(E){for(var I=-1,O=Kn(E.length,y);++I=f}),su=bc((function(){return arguments})())?bc:function(u){return gn(u)&&St.call(u,"callee")&&!rc.call(u,"callee")},st=fe.isArray,G$=td?Tr(td):Sm;function ti(u){return u!=null&&tg(u.length)&&!Ws(u)}function wn(u){return gn(u)&&ti(u)}function q$(u){return u===!0||u===!1||gn(u)&&Nn(u)==Ne}var Ha=gd||Fy,Y$=pr?Tr(pr):go;function X$(u){return gn(u)&&u.nodeType===1&&!dp(u)}function Q$(u){if(u==null)return!0;if(ti(u)&&(st(u)||typeof u=="string"||typeof u.splice=="function"||Ha(u)||rf(u)||su(u)))return!u.length;var f=Fn(u);if(f==pt||f==_t)return!u.size;if(wo(u))return!vo(u).length;for(var y in u)if(St.call(u,y))return!1;return!0}function J$(u,f){return Xr(u,f)}function Z$(u,f,y){y=typeof y=="function"?y:n;var E=y?y(u,f):n;return E===n?Xr(u,f,n,y):!!E}function _y(u){if(!gn(u))return!1;var f=Nn(u);return f==at||f==Qe||typeof u.message=="string"&&typeof u.name=="string"&&!dp(u)}function eA(u){return typeof u=="number"&&Sa(u)}function Ws(u){if(!fn(u))return!1;var f=Nn(u);return f==Ie||f==mt||f==Fe||f==tr}function Bw(u){return typeof u=="number"&&u==ct(u)}function tg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=V}function fn(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function gn(u){return u!=null&&typeof u=="object"}var Vw=ks?Tr(ks):km;function tA(u,f){return u===f||Ra(u,f,Yl(f))}function nA(u,f,y){return y=typeof y=="function"?y:n,Ra(u,f,Yl(f),y)}function rA(u){return Uw(u)&&u!=+u}function iA(u){if(fy(u))throw new rt(s);return kd(u)}function oA(u){return u===null}function sA(u){return u==null}function Uw(u){return typeof u=="number"||gn(u)&&Nn(u)==Ut}function dp(u){if(!gn(u)||Nn(u)!=it)return!1;var f=gi(u);if(f===null)return!0;var y=St.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&Cl.call(y)==tc}var Iy=Hu?Tr(Hu):Ol;function aA(u){return Bw(u)&&u>=-V&&u<=V}var Kw=ma?Tr(ma):Ki;function ng(u){return typeof u=="string"||!st(u)&&gn(u)&&Nn(u)==Rt}function Ei(u){return typeof u=="symbol"||gn(u)&&Nn(u)==_n}var rf=Gh?Tr(Gh):Fl;function lA(u){return u===n}function uA(u){return gn(u)&&Fn(u)==Nt}function cA(u){return gn(u)&&Nn(u)==pe}var fA=Mc(qo),dA=Mc(function(u,f){return u<=f});function Ww(u){if(!u)return[];if(ti(u))return ng(u)?_r(u):sr(u);if(co&&u[co])return ey(u[co]());var f=Fn(u),y=f==pt?Qu:f==_t?zo:of;return y(u)}function Hs(u){if(!u)return u===0?u:0;if(u=Xi(u),u===X||u===-X){var f=u<0?-1:1;return f*ae}return u===u?u:0}function ct(u){var f=Hs(u),y=f%1;return f===f?y?f-y:f:0}function Hw(u){return u?po(ct(u),0,U):0}function Xi(u){if(typeof u=="number")return u;if(Ei(u))return D;if(fn(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=fn(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=Zh(u);var y=Fv.test(u);return y||Rh.test(u)?Ku(u.slice(2),y?2:8):$h.test(u)?D:+u}function Gw(u){return yi(u,ni(u))}function pA(u){return u?po(ct(u),-V,V):u===0?u:0}function At(u){return u==null?"":yr(u)}var hA=Fa(function(u,f){if(wo(f)||ti(f)){yi(f,Qn(f),u);return}for(var y in f)St.call(f,y)&&As(u,y,f[y])}),qw=Fa(function(u,f){yi(f,ni(f),u)}),rg=Fa(function(u,f,y,E){yi(f,ni(f),u,E)}),mA=Fa(function(u,f,y,E){yi(f,Qn(f),u,E)}),gA=qi(mc);function vA(u,f){var y=Ta(u);return f==null?y:jt(y,f)}var yA=ut(function(u,f){u=$t(u);var y=-1,E=f.length,I=E>2?f[2]:n;for(I&&lr(f[0],f[1],I)&&(E=1);++y1),O}),yi(u,Gl(u),y),E&&(y=vr(y,g|b|x,Ud));for(var I=f.length;I--;)Ec(y,f[I]);return y});function NA(u,f){return Xw(u,Ee(qe(f)))}var OA=qi(function(u,f){return u==null?{}:Td(u,f)});function Xw(u,f){if(u==null)return{};var y=Lt(Gl(u),function(E){return[E]});return f=qe(f),Yo(u,y,function(E,I){return f(E,I[0])})}function FA(u,f,y){f=Hi(f,u);var E=-1,I=f.length;for(I||(I=1,u=n);++Ef){var E=u;u=f,f=E}if(y||u%1||f%1){var I=Il();return Kn(u+I*(f-u+Zf("1e-"+((I+"").length-1))),f)}return Ma(u,f)}var YA=Os(function(u,f,y){return f=f.toLowerCase(),u+(y?Zw(f):f)});function Zw(u){return Ry(At(u).toLowerCase())}function e1(u){return u=At(u),u&&u.replace(Mh,nm).replace(Uh,"")}function XA(u,f,y){u=At(u),f=yr(f);var E=u.length;y=y===n?E:po(ct(y),0,E);var I=y;return y-=f.length,y>=0&&u.slice(y,I)==f}function QA(u){return u=At(u),u&&Du.test(u)?u.replace(hi,rm):u}function JA(u){return u=At(u),u&&Ro.test(u)?u.replace(ys,"\\$&"):u}var ZA=Os(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),eR=Os(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),tR=Od("toLowerCase");function nR(u,f,y){u=At(u),f=ct(f);var E=f?Cs(u):0;if(!f||E>=f)return u;var I=(f-E)/2;return Wl(jo(I),y)+u+Wl(Ps(I),y)}function rR(u,f,y){u=At(u),f=ct(f);var E=f?Cs(u):0;return f&&E>>0,y?(u=At(u),u&&(typeof f=="string"||f!=null&&!Iy(f))&&(f=yr(f),!f&&ya(u))?bo(_r(u),0,y):u.split(f,y)):[]}var cR=Os(function(u,f,y){return u+(y?" ":"")+Ry(f)});function fR(u,f,y){return u=At(u),y=y==null?0:po(ct(y),0,u.length),f=yr(f),u.slice(y,y+f.length)==f}function dR(u,f,y){var E=N.templateSettings;y&&lr(u,f,y)&&(f=n),u=At(u),f=rg({},f,E,Bd);var I=rg({},f.imports,E.imports,Bd),O=Qn(I),q=Sl(I,O),Z,se,ge=0,ve=f.interpolate||Nu,we="__p += '",$e=kl((f.escape||Nu).source+"|"+ve.source+"|"+(ve===fl?Xe:Nu).source+"|"+(f.evaluate||Nu).source+"|$","g"),Ke="//# sourceURL="+(St.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Wv+"]")+` -`;u.replace($e,function(et,gt,xt,Pi,Mr,Ti){return xt||(xt=Pi),we+=u.slice(ge,Ti).replace(zv,im),gt&&(Z=!0,we+=`' + -__e(`+gt+`) + -'`),Mr&&(se=!0,we+=`'; -`+Mr+`; -__p += '`),xt&&(we+=`' + -((__t = (`+xt+`)) == null ? '' : __t) + -'`),ge=Ti+et.length,et}),we+=`'; -`;var Ze=St.call(f,"variable")&&f.variable;if(!Ze)we=`with (obj) { -`+we+` -} -`;else if(Wf.test(Ze))throw new rt(c);we=(se?we.replace(ln,""):we).replace(aa,"$1").replace(ms,"$1;"),we="function("+(Ze||"obj")+`) { -`+(Ze?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(se?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+we+`return __p -}`;var dt=n1(function(){return wt(O,Ke+"return "+we).apply(n,q)});if(dt.source=we,_y(dt))throw dt;return dt}function pR(u){return At(u).toLowerCase()}function hR(u){return At(u).toUpperCase()}function mR(u,f,y){if(u=At(u),u&&(y||f===n))return Zh(u);if(!u||!(f=yr(f)))return u;var E=_r(u),I=_r(f),O=em(E,I),q=fd(E,I)+1;return bo(E,O,q).join("")}function gR(u,f,y){if(u=At(u),u&&(y||f===n))return u.slice(0,Zu(u)+1);if(!u||!(f=yr(f)))return u;var E=_r(u),I=fd(E,_r(f))+1;return bo(E,0,I).join("")}function vR(u,f,y){if(u=At(u),u&&(y||f===n))return u.replace(pl,"");if(!u||!(f=yr(f)))return u;var E=_r(u),I=em(E,_r(f));return bo(E,I).join("")}function yR(u,f){var y=B,E=W;if(fn(f)){var I="separator"in f?f.separator:I;y="length"in f?ct(f.length):y,E="omission"in f?yr(f.omission):E}u=At(u);var O=u.length;if(ya(u)){var q=_r(u);O=q.length}if(y>=O)return u;var Z=y-Cs(E);if(Z<1)return E;var se=q?bo(q,0,Z).join(""):u.slice(0,Z);if(I===n)return se+E;if(q&&(Z+=se.length-Z),Iy(I)){if(u.slice(Z).search(I)){var ge,ve=se;for(I.global||(I=kl(I.source,At(so.exec(I))+"g")),I.lastIndex=0;ge=I.exec(ve);)var we=ge.index;se=se.slice(0,we===n?Z:we)}}else if(u.indexOf(yr(I),Z)!=Z){var $e=se.lastIndexOf(I);$e>-1&&(se=se.slice(0,$e))}return se+E}function bR(u){return u=At(u),u&&cl.test(u)?u.replace(pi,om):u}var xR=Os(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),Ry=Od("toUpperCase");function t1(u,f,y){return u=At(u),f=y?n:f,f===n?Zv(u)?ry(u):Xv(u):u.match(f)||[]}var n1=ut(function(u,f){try{return ir(u,n,f)}catch(y){return _y(y)?y:new rt(y)}}),wR=qi(function(u,f){return Un(f,function(y){y=Si(y),Bi(u,y,ke(u[y],u))}),u});function SR(u){var f=u==null?0:u.length,y=qe();return u=f?Lt(u,function(E){if(typeof E[1]!="function")throw new Kr(a);return[y(E[0]),E[1]]}):[],ut(function(E){for(var I=-1;++IV)return[];var y=U,E=Kn(u,U);f=qe(f),u-=U;for(var I=cd(E,f);++y0||f<0)?new ot(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=ct(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},ot.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ot.prototype.toArray=function(){return this.take(U)},Ar(ot.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),E=/^(?:head|last)$/.test(f),I=N[E?"take"+(f=="last"?"Right":""):f],O=E||/^find/.test(f);I&&(N.prototype[f]=function(){var q=this.__wrapped__,Z=E?[1]:arguments,se=q instanceof ot,ge=Z[0],ve=se||st(q),we=function(gt){var xt=I.apply(N,Fo([gt],Z));return E&&$e?xt[0]:xt};ve&&y&&typeof ge=="function"&&ge.length!=1&&(se=ve=!1);var $e=this.__chain__,Ke=!!this.__actions__.length,Ze=O&&!$e,dt=se&&!Ke;if(!O&&ve){q=dt?q:new ot(this);var et=u.apply(q,Z);return et.__actions__.push({func:Ci,args:[we],thisArg:n}),new Wn(et,$e)}return Ze&&dt?u.apply(this,Z):(et=this.thru(we),Ze?E?et.value()[0]:et.value():et)})}),Un(["pop","push","shift","sort","splice","unshift"],function(u){var f=lo[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var I=arguments;if(E&&!this.__chain__){var O=this.value();return f.apply(st(O)?O:[],I)}return this[y](function(q){return f.apply(st(q)?q:[],I)})}}),Ar(ot.prototype,function(u,f){var y=N[f];if(y){var E=y.name+"";St.call(Ea,E)||(Ea[E]=[]),Ea[E].push({name:f,func:y})}}),Ea[ja(n,_).name]=[{name:"wrapper",func:n}],ot.prototype.clone=cc,ot.prototype.reverse=yd,ot.prototype.value=_a,N.prototype.at=Xc,N.prototype.chain=Us,N.prototype.commit=Qc,N.prototype.next=ap,N.prototype.plant=wy,N.prototype.reverse=up,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Sy,N.prototype.first=N.prototype.head,co&&(N.prototype[co]=lp),N}),ba=iy();Di?((Di.exports=ba)._=ba,wl._=ba):Gt._=ba}).call(o7)})(Lp,Lp.exports)),Lp.exports}var D2=s7();class a7{plugins={};activePlugins=[];listeners=new Set;register(t){this.plugins[t.name]={isActivated:!1,config:t},this.notify()}activate(t){const n=this.plugins[t];!n||n.isActivated||(n.isActivated=!0,n.config.onActivate&&n.config.onActivate(),this.produceActivePlugins(),this.notify())}deactivate(t){const n=this.plugins[t];!n||!n.isActivated||(n.isActivated=!1,n.config.onDeactivate&&n.config.onDeactivate(),this.produceActivePlugins(),this.notify())}isPluginActivated(t){const n=this.plugins[t];return!!n&&n.isActivated}getPlugin(t){const n=this.plugins[t];return!n||!n.isActivated?null:n}getActivePlugins(){return this.activePlugins}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t())}produceActivePlugins(){this.activePlugins=D2.transform(this.plugins,(t,n)=>{n.isActivated&&t.push(n.config)},[])}}const Pn=new a7;const N2="FeedbackFormPlugin",O2={name:N2,components:{FeedbackForm:S.lazy(()=>fi(()=>import("./FeedbackForm-oSbly5oN.js"),__vite__mapDeps([0,1,2,3,4,5,6])))}},F2="ChatOptionsPlugin",z2={name:F2,components:{ChatOptionsForm:S.lazy(()=>fi(()=>import("./ChatOptionsForm-bfNG8UIW.js"),__vite__mapDeps([7,1,2,3,4,5,6])))}},aw=()=>{const e=S.useContext(j2);if(!e)throw new Error("useChat must be used within a ConfigContextProvider");return e},j2=S.createContext(void 0),B2="SharePluginName",V2={name:B2,components:{ShareButton:S.lazy(()=>fi(()=>import("./ShareButton-B7DyIVH0.js"),__vite__mapDeps([8,6])))}},iC=e=>{let t;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const b=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(x=>x(t,b))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,i,c);return c},oC=e=>e?iC(e):iC,l7=e=>e;function U2(e,t=l7){const n=He.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return He.useDebugValue(n),n}const fr=[];for(let e=0;e<256;++e)fr.push((e+256).toString(16).slice(1));function u7(e,t=0){return(fr[e[t+0]]+fr[e[t+1]]+fr[e[t+2]]+fr[e[t+3]]+"-"+fr[e[t+4]]+fr[e[t+5]]+"-"+fr[e[t+6]]+fr[e[t+7]]+"-"+fr[e[t+8]]+fr[e[t+9]]+"-"+fr[e[t+10]]+fr[e[t+11]]+fr[e[t+12]]+fr[e[t+13]]+fr[e[t+14]]+fr[e[t+15]]).toLowerCase()}let w0;const c7=new Uint8Array(16);function f7(){if(!w0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");w0=crypto.getRandomValues.bind(crypto)}return w0(c7)}const d7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sC={randomUUID:d7};function K2(e,t,n){if(sC.randomUUID&&!e)return sC.randomUUID();e=e||{};const r=e.random??e.rng?.()??f7();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,u7(r)}function aC(e){return Object.values(e).map(t=>({role:t.role,content:t.content,extra:t.extra||null}))}var W2=Symbol.for("immer-nothing"),lC=Symbol.for("immer-draftable"),Ri=Symbol.for("immer-state");function _o(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lf=Object.getPrototypeOf;function Mf(e){return!!e&&!!e[Ri]}function _u(e){return e?H2(e)||Array.isArray(e)||!!e[lC]||!!e.constructor?.[lC]||Pv(e)||Tv(e):!1}var p7=Object.prototype.constructor.toString();function H2(e){if(!e||typeof e!="object")return!1;const t=Lf(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===p7}function rv(e,t){Ev(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ev(e){const t=e[Ri];return t?t.type_:Array.isArray(e)?1:Pv(e)?2:Tv(e)?3:0}function Ob(e,t){return Ev(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function G2(e,t,n){const r=Ev(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function h7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Pv(e){return e instanceof Map}function Tv(e){return e instanceof Set}function mu(e){return e.copy_||e.base_}function Fb(e,t){if(Pv(e))return new Map(e);if(Tv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=H2(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ri];let i=Reflect.ownKeys(r);for(let s=0;s1&&(e.set=e.add=e.clear=e.delete=m7),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>lw(r,!0))),e}function m7(){_o(2)}function _v(e){return Object.isFrozen(e)}var g7={};function Iu(e){const t=g7[e];return t||_o(0,e),t}var lh;function q2(){return lh}function v7(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function uC(e,t){t&&(Iu("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function zb(e){jb(e),e.drafts_.forEach(y7),e.drafts_=null}function jb(e){e===lh&&(lh=e.parent_)}function cC(e){return lh=v7(lh,e)}function y7(e){const t=e[Ri];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ri].modified_&&(zb(t),_o(4)),_u(e)&&(e=iv(t,e),t.parent_||ov(t,e)),t.patches_&&Iu("Patches").generateReplacementPatches_(n[Ri].base_,e,t.patches_,t.inversePatches_)):e=iv(t,n,[]),zb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==W2?e:void 0}function iv(e,t,n){if(_v(t))return t;const r=t[Ri];if(!r)return rv(t,(i,s)=>dC(e,r,t,i,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ov(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let s=i,a=!1;r.type_===3&&(s=new Set(i),i.clear(),a=!0),rv(s,(c,d)=>dC(e,r,i,c,d,n,a)),ov(e,i,!1),n&&e.patches_&&Iu("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function dC(e,t,n,r,i,s,a){if(Mf(i)){const c=s&&t&&t.type_!==3&&!Ob(t.assigned_,r)?s.concat(r):void 0,d=iv(e,i,c);if(G2(n,r,d),Mf(d))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(_u(i)&&!_v(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;iv(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ov(e,i)}}function ov(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lw(t,n)}function b7(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:q2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=uw;n&&(i=[r],s=uh);const{revoke:a,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=a,c}var uw={get(e,t){if(t===Ri)return e;const n=mu(e);if(!Ob(n,t))return x7(e,n,t);const r=n[t];return e.finalized_||!_u(r)?r:r===S0(e.base_,t)?(k0(e),e.copy_[t]=Vb(r,e)):r},has(e,t){return t in mu(e)},ownKeys(e){return Reflect.ownKeys(mu(e))},set(e,t,n){const r=Y2(mu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=S0(mu(e),t),s=i?.[Ri];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(h7(n,i)&&(n!==void 0||Ob(e.base_,t)))return!0;k0(e),Bb(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return S0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,k0(e),Bb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=mu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_o(11)},getPrototypeOf(e){return Lf(e.base_)},setPrototypeOf(){_o(12)}},uh={};rv(uw,(e,t)=>{uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});uh.deleteProperty=function(e,t){return uh.set.call(this,e,t,void 0)};uh.set=function(e,t,n){return uw.set.call(this,e[0],t,n,e[0])};function S0(e,t){const n=e[Ri];return(n?mu(n):e)[t]}function x7(e,t,n){const r=Y2(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function Y2(e,t){if(!(t in e))return;let n=Lf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Lf(n)}}function Bb(e){e.modified_||(e.modified_=!0,e.parent_&&Bb(e.parent_))}function k0(e){e.copy_||(e.copy_=Fb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var w7=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const a=this;return function(d=s,...h){return a.produce(d,m=>n.call(this,m,...h))}}typeof n!="function"&&_o(6),r!==void 0&&typeof r!="function"&&_o(7);let i;if(_u(t)){const s=cC(this),a=Vb(t,void 0);let c=!0;try{i=n(a),c=!1}finally{c?zb(s):jb(s)}return uC(s,r),fC(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===W2&&(i=void 0),this.autoFreeze_&&lw(i,!0),r){const s=[],a=[];Iu("Patches").generateReplacementPatches_(t,i,s,a),r(s,a)}return i}else _o(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...c)=>this.produceWithPatches(a,d=>t(d,...c));let r,i;return[this.produce(t,n,(a,c)=>{r=a,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){_u(e)||_o(8),Mf(e)&&(e=S7(e));const t=cC(this),n=Vb(e,void 0);return n[Ri].isManual_=!0,jb(t),n}finishDraft(e,t){const n=e&&e[Ri];(!n||!n.isManual_)&&_o(9);const{scope_:r}=n;return uC(r,t),fC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Iu("Patches").applyPatches_;return Mf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Vb(e,t){const n=Pv(e)?Iu("MapSet").proxyMap_(e,t):Tv(e)?Iu("MapSet").proxySet_(e,t):b7(e,t);return(t?t.scope_:q2()).drafts_.push(n),n}function S7(e){return Mf(e)||_o(10,e),X2(e)}function X2(e){if(!_u(e)||_v(e))return e;const t=e[Ri];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Fb(e,!0);return rv(n,(r,i)=>{G2(n,r,X2(i))}),t&&(t.finalized_=!1),n}var Li=new w7,kh=Li.produce;Li.produceWithPatches.bind(Li);Li.setAutoFreeze.bind(Li);Li.setUseStrictShallowCopy.bind(Li);Li.applyPatches.bind(Li);Li.createDraft.bind(Li);Li.finishDraft.bind(Li);const k7=e=>(t,n,r)=>(r.setState=(i,s,...a)=>{const c=typeof i=="function"?kh(i):i;return t(c,s,...a)},e(r.setState,n,r)),C7=k7,E7=({content:e},t)=>{t.serverState=e},P7=({content:e},t,n)=>{const r=n.conversationIdRef.current;return t.conversationId=e.conversation_id,n.conversationIdRef.current=e.conversation_id,{originalConversationId:r}},T7=(e,t,{originalConversationId:n,conversationIdRef:r})=>{const i=t.conversations[n];if(!i)throw new Error("Received events for non-existent conversation");t.conversations[r.current]=i,t.currentConversation===n&&(t.currentConversation=r.current),delete t.conversations[n]},_7=({content:e},t)=>{t.followupMessages=e.messages},I7=({content:e},t)=>{t.summary=e.summary},$7=(e,t,n)=>{const r=t.history[n.messageId];r.hasConfirmationBreak&&(r.hasConfirmationBreak=!1,r.content.endsWith(` - -`)||(r.content+=` - -`)),r.content+=e.content.text},A7=(e,t,n)=>{const r=t.history[n.messageId];r.references=[...r.references??[],e.content]},R7=(e,t,n)=>{const r=t.history[n.messageId];r.serverId=e.content.message_id},L7=(e,t,n)=>{const r=t.history[n.messageId],{update_id:i,content:s,type:a}=e.content,c=kh(r.liveUpdates??{},d=>{a===Yz.Start&&i in d&&console.error(`Got duplicate start event for update_id: ${i}. Ignoring the event.`),d[i]=s});r.liveUpdates=c},M7=(e,t,n)=>{const r=t.history[n.messageId],i=e.content;r.images=kh(r.images??{},s=>{s[i.id]&&console.error(`Got duplicate image event for image_id: ${i.id}. Ignoring the event.`),s[i.id]=i.url})},D7=(e,t,n)=>{const r=t.history[n.messageId];t.history[n.messageId]={id:r.id,role:r.role,content:""}},N7=(e,t,n)=>{const r=t.history[n.messageId];r.usage=e.content.usage},O7=({content:e},t,n)=>{const r=t.history[n.messageId],i=r.tasks??[],s=e.task,a=kh(i,c=>{const d=c.findIndex(h=>h.id===s.id);d===-1?c.push(s):c[d]=s});r.tasks=a},F7=(e,t,n)=>{const r=t.history[n.messageId],i=e.content.confirmation_request.confirmation_id;r.confirmationRequests||(r.confirmationRequests={}),r.confirmationStates||(r.confirmationStates={}),!(i in r.confirmationRequests)&&(r.confirmationRequests[i]=e.content.confirmation_request,r.confirmationStates[i]="pending")},z7=(e,t,n)=>{const r=t.history[n.messageId];r.error=e.content.message};class j7{handlers=new Map;register(t,n){this.handlers.has(t)&&console.warn(`Handler for ${String(t)} already registered - overwriting.`),this.handlers.set(t,n)}get(t){const n=this.handlers.get(t);return n||(console.warn(`No handler registered for type: ${String(t)}`),console.warn("Continuing with empty handler..."),{handle:()=>{},after:()=>{}})}}const Br=new j7;Br.register("state_update",{handle:E7});Br.register("conversation_id",{handle:P7,after:T7});Br.register("followup_messages",{handle:_7});Br.register("text",{handle:$7});Br.register("reference",{handle:A7});Br.register("message_id",{handle:R7});Br.register("live_update",{handle:L7});Br.register("image",{handle:M7});Br.register("clear_message",{handle:D7});Br.register("usage",{handle:N7});Br.register("todo_item",{handle:O7});Br.register("conversation_summary",{handle:I7});Br.register("confirmation_request",{handle:F7});Br.register("error",{handle:z7});const Q2="temp-",J2=()=>`${Q2}${K2()}`,Ub=()=>({history:{},followupMessages:null,serverState:null,conversationId:J2(),eventsLog:[],lastMessageId:null,context:void 0,chatOptions:void 0,isLoading:!1,abortController:null}),B7=()=>{const e=Ub();return{conversations:{[e.conversationId]:e},currentConversation:e.conversationId}},_i=(e,t)=>n=>{const r=n.conversations[e];if(!r)throw new Error(`Conversation with ID '${e}' does not exist`);t(r)},pC=e=>e.startsWith(Q2),hC=C7((e,t)=>({...B7(),computed:{getContext:()=>{const{primitives:{getCurrentConversation:n}}=t(),r=n(),{serverState:i,conversationId:s,chatOptions:a}=r;return{...i??{},...s&&!pC(r.conversationId)?{conversation_id:s}:{},...a?{user_settings:a}:{}}}},_internal:{_hasHydrated:!1,_setHasHydrated:n=>{e(r=>{r._internal._hasHydrated=n})},handleResponse:(n,r,i)=>{let s;const a=Br.get(i.type);e(_i(n.current,c=>{if(!c.history[r])throw new Error(`Message ID ${r} not found in history`);s=a.handle(i,c,{conversationIdRef:n,messageId:r})})),e(c=>{a.after?.(i,c,{conversationIdRef:n,messageId:r,...s})}),e(_i(n.current,c=>{c.eventsLog[c.eventsLog.length-1].push(i)}))}},primitives:{getCurrentConversation:()=>{const{currentConversation:n,conversations:r}=t(),i=r[n];if(!i)throw new Error("Tried to get conversation that doesn't exist.");return i},restore:(n,r,i,s)=>{const a=J2(),c={...Ub(),followupMessages:r,chatOptions:i,serverState:s,history:n,conversationId:a},d=Object.values(n).filter(h=>h.role!==kf.User);c.eventsLog=d.map(()=>[]),e(h=>{h.conversations[a]=c,h.currentConversation=a})},addMessage:(n,r)=>{const i=K2(),s={...r,id:i};return e(_i(n,a=>{a.followupMessages=null,a.lastMessageId=i,a.history[i]=s})),i},deleteMessage:(n,r)=>{e(_i(n,i=>{const{history:s}=i,a=Object.keys(s);a.at(-1)===r&&(i.lastMessageId=a.at(-2)??null),delete i.history[r]}))},stopAnswering:n=>{const r=t().conversations[n];if(!r)throw new Error("Tried to stop answering for conversation that doesn't exist");r.abortController?.abort(),e(_i(n,i=>{i.abortController=null,i.isLoading=!1}))}},actions:{selectConversation:n=>{e(r=>{if(r.currentConversation===n)return;if(!r.conversations[n])throw new Error(`Tried to select conversation that doesn't exist, id: ${n}`);r.currentConversation=n})},deleteConversation:n=>{const{actions:{newConversation:r},primitives:{stopAnswering:i},currentConversation:s}=t();if(i(n),e(a=>{delete a.conversations[n]}),n===s)return r()},mergeExtensions:(n,r)=>{const{currentConversation:i}=t();e(_i(i,s=>{if(!(n in s.history))throw new Error("Attempted to set extensions for a message that does not exist.");const a=s.history[n];a.extensions={...a.extensions,...r},s.history[n]=a}))},initializeChatOptions:n=>{const{currentConversation:r}=t();e(_i(r,i=>{const s=i.chatOptions??{};Object.keys(s).forEach(a=>{a in n||delete s[a]}),Object.keys(n).forEach(a=>{a in s||(s[a]=n[a])}),i.chatOptions=s}))},setConversationProperties:(n,r)=>{e(_i(n,i=>{Object.assign(i,r)}))},stopAnswering:()=>{const{currentConversation:n,primitives:{stopAnswering:r}}=t();r(n)},newConversation:()=>{const n=Ub();return e(r=>{r.conversations[n.conversationId]=n,r.currentConversation=n.conversationId,r.conversations=D2.omitBy(r.conversations,i=>pC(i.conversationId)&&i.conversationId!==r.currentConversation)}),n.conversationId},sendMessage:(n,r,i)=>{const{_internal:{handleResponse:s},primitives:{addMessage:a,getCurrentConversation:c,stopAnswering:d},computed:{getContext:h}}=t(),{history:m,conversationId:g}=c();a(g,{role:kf.User,content:n});const b=a(g,{role:kf.Assistant,content:""}),x={message:n,history:aC(m),context:{...h(),...i}};e(_i(g,T=>{T.eventsLog.push([])}));const k=new AbortController,P={current:g};e(_i(g,T=>{T.abortController=k,T.isLoading=!0})),r.makeStreamRequest("/api/chat",x,{onMessage:T=>s(P,b,T),onError:T=>{s(P,b,{type:"text",content:{text:T.message}}),d(P.current)},onClose:()=>{d(P.current)}},k.signal)},sendSilentConfirmation:(n,r,i,s)=>{const{_internal:{handleResponse:a},primitives:{getCurrentConversation:c,stopAnswering:d},computed:{getContext:h}}=t(),{history:m,conversationId:g}=c(),b=Array.isArray(r)?r:[r],x=typeof i=="boolean"?b.reduce((M,F)=>({...M,[F]:i}),{}):i;e(_i(g,M=>{const F=M.history[n];F&&F.confirmationStates&&(b.forEach(j=>{j in F.confirmationStates&&(F.confirmationStates[j]=x[j]?"confirmed":"declined")}),F.hasConfirmationBreak=!0,F.liveUpdates=void 0)}));const k=n,P=b.map(M=>({confirmation_id:M,confirmed:x[M]})),T={message:"",history:aC(m),context:{...h(),confirmed_tools:P}};e(_i(g,M=>{M.eventsLog.push([])}));const _=new AbortController,A={current:g};e(_i(g,M=>{M.abortController=_,M.isLoading=!0})),s.makeStreamRequest("/api/chat",T,{onMessage:M=>a(A,k,M),onError:M=>{a(A,k,{type:"text",content:{text:M.message}}),d(A.current)},onClose:()=>{d(A.current)}},_.signal)}}}));function Z2(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const a=d=>d===null?null:JSON.parse(d,void 0),c=(s=n.getItem(i))!=null?s:null;return c instanceof Promise?c.then(a):a(c)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const Kb=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Kb(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Kb(r)(n)}}}},V7=(e,t)=>(n,r,i)=>{let s={storage:Z2(()=>localStorage),partialize:P=>P,version:0,merge:(P,T)=>({...T,...P}),...t},a=!1;const c=new Set,d=new Set;let h=s.storage;if(!h)return e((...P)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...P)},r,i);const m=()=>{const P=s.partialize({...r()});return h.setItem(s.name,{state:P,version:s.version})},g=i.setState;i.setState=(P,T)=>{g(P,T),m()};const b=e((...P)=>{n(...P),m()},r,i);i.getInitialState=()=>b;let x;const k=()=>{var P,T;if(!h)return;a=!1,c.forEach(A=>{var M;return A((M=r())!=null?M:b)});const _=((T=s.onRehydrateStorage)==null?void 0:T.call(s,(P=r())!=null?P:b))||void 0;return Kb(h.getItem.bind(h))(s.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==s.version){if(s.migrate){const M=s.migrate(A.state,A.version);return M instanceof Promise?M.then(F=>[!0,F]):[!0,M]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var M;const[F,j]=A;if(x=s.merge(j,(M=r())!=null?M:b),n(x,!0),F)return m()}).then(()=>{_?.(x,void 0),x=r(),a=!0,d.forEach(A=>A(x))}).catch(A=>{_?.(void 0,A)})};return i.persist={setOptions:P=>{s={...s,...P},P.storage&&(h=P.storage)},clearStorage:()=>{h?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>k(),hasHydrated:()=>a,onHydrate:P=>(c.add(P),()=>{c.delete(P)}),onFinishHydration:P=>(d.add(P),()=>{d.delete(P)})},s.skipHydration||k(),x||b},U7=V7;function Iv(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function K7(e,t){let n;const r=()=>{if(n)return n;const i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),n=Iv(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(t,i).objectStore(t)))}let C0;function cw(){return C0||(C0=K7("keyval-store","keyval")),C0}function W7(e,t=cw()){return t("readonly",n=>Iv(n.get(e)))}function H7(e,t,n=cw()){return n("readwrite",r=>(r.put(t,e),Iv(r.transaction)))}function G7(e,t=cw()){return t("readwrite",n=>(n.delete(e),Iv(n.transaction)))}const q7={getItem:async e=>await W7(e)||null,setItem:async(e,t)=>{await H7(e,t)},removeItem:async e=>{await G7(e)}},eI=S.createContext(null);function tI(){return L.jsx("div",{className:yn("bg-background flex h-screen w-screen items-start justify-center"),children:L.jsxs("div",{className:"text-default-900 m-auto flex flex-col items-center gap-4",children:[L.jsx(a2,{size:"lg","aria-label":"Progress indicator"}),L.jsx("p",{children:"Initializing..."})]})})}const mC="ragbits-history-store";function Y7(e,t){if(e)return oC(U7(hC,{name:t,partialize:r=>({conversations:r.conversations}),onRehydrateStorage:r=>()=>r._internal._setHasHydrated(!0),merge:(r,i)=>{const s=r?.conversations??{},{conversations:a,currentConversation:c}=i,d=Object.values(s).reduce((h,m)=>(m.conversationId===null||(h[m.conversationId]={...m,isLoading:!1,abortController:null}),h),{});return{...i,currentConversation:c,conversations:{...d,...a}}},storage:Z2(()=>q7)}));const n=oC(hC);return n.getState()._internal._setHasHydrated(!0),n}function X7({children:e,shouldStoreHistory:t}){const[n,r]=S.useState(mC),i=S.useMemo(()=>Y7(t,n),[t,n]),s=U2(i,d=>d._internal._hasHydrated),a=d=>{r(`${mC}-${d}`)},c=S.useMemo(()=>({store:i,initializeUserStore:a}),[i]);return t&&!s?L.jsx(tI,{}):L.jsx(eI.Provider,{value:c,children:e})}var gC="popstate";function Q7(e={}){function t(r,i){let{pathname:s,search:a,hash:c}=r.location;return Wb("",{pathname:s,search:a,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ch(i)}return Z7(t,n,null,e)}function Dn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $o(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function J7(){return Math.random().toString(36).substring(2,10)}function vC(e,t){return{usr:e.state,key:e.key,idx:t}}function Wb(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ch(t):t,state:n,key:t&&t.key||r||J7()}}function ch({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ch(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Z7(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,c="POP",d=null,h=m();h==null&&(h=0,a.replaceState({...a.state,idx:h},""));function m(){return(a.state||{idx:null}).idx}function g(){c="POP";let T=m(),_=T==null?null:T-h;h=T,d&&d({action:c,location:P.location,delta:_})}function b(T,_){c="PUSH";let A=Wb(P.location,T,_);h=m()+1;let M=vC(A,h),F=P.createHref(A);try{a.pushState(M,"",F)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(F)}s&&d&&d({action:c,location:P.location,delta:1})}function x(T,_){c="REPLACE";let A=Wb(P.location,T,_);h=m();let M=vC(A,h),F=P.createHref(A);a.replaceState(M,"",F),s&&d&&d({action:c,location:P.location,delta:0})}function k(T){return ej(T)}let P={get action(){return c},get location(){return e(i,a)},listen(T){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(gC,g),d=T,()=>{i.removeEventListener(gC,g),d=null}},createHref(T){return t(i,T)},createURL:k,encodeLocation(T){let _=k(T);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:x,go(T){return a.go(T)}};return P}function ej(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Dn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ch(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function nI(e,t,n="/"){return tj(e,t,n,!1)}function tj(e,t,n,r){let i=typeof t=="string"?Ch(t):t,s=ra(i.pathname||"/",n);if(s==null)return null;let a=rI(e);nj(a);let c=null;for(let d=0;c==null&&d{let d={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};d.relativePath.startsWith("/")&&(Dn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length));let h=ea([r,d.relativePath]),m=n.concat(d);s.children&&s.children.length>0&&(Dn(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),rI(s.children,t,m,h)),!(s.path==null&&!s.index)&&t.push({path:h,score:uj(h,s.index),routesMeta:m})};return e.forEach((s,a)=>{if(s.path===""||!s.path?.includes("?"))i(s,a);else for(let c of iI(s.path))i(s,a,c)}),t}function iI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=iI(r.join("/")),c=[];return c.push(...a.map(d=>d===""?s:[s,d].join("/"))),i&&c.push(...a),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function nj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var rj=/^:[\w-]+$/,ij=3,oj=2,sj=1,aj=10,lj=-2,yC=e=>e==="*";function uj(e,t){let n=e.split("/"),r=n.length;return n.some(yC)&&(r+=lj),t&&(r+=oj),n.filter(i=>!yC(i)).reduce((i,s)=>i+(rj.test(s)?ij:s===""?sj:aj),r)}function cj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function fj(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",a=[];for(let c=0;c{if(m==="*"){let k=c[b]||"";a=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const x=c[b];return g&&!x?h[m]=void 0:h[m]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:a,pattern:e}}function dj(e,t=!1,n=!0){$o(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function pj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $o(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ra(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function hj(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ch(e):e;return{pathname:n?n.startsWith("/")?n:mj(n,t):t,search:yj(r),hash:bj(i)}}function mj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function E0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function gj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fw(e){let t=gj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function dw(e,t,n,r=!1){let i;typeof e=="string"?i=Ch(e):(i={...e},Dn(!i.pathname||!i.pathname.includes("?"),E0("?","pathname","search",i)),Dn(!i.pathname||!i.pathname.includes("#"),E0("#","pathname","hash",i)),Dn(!i.search||!i.search.includes("#"),E0("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,c;if(a==null)c=n;else{let g=t.length-1;if(!r&&a.startsWith("..")){let b=a.split("/");for(;b[0]==="..";)b.shift(),g-=1;i.pathname=b.join("/")}c=g>=0?t[g]:"/"}let d=hj(i,c),h=a&&a!=="/"&&a.endsWith("/"),m=(s||a===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||m)&&(d.pathname+="/"),d}var ea=e=>e.join("/").replace(/\/\/+/g,"/"),vj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var oI=["POST","PUT","PATCH","DELETE"];new Set(oI);var wj=["GET",...oI];new Set(wj);var jf=S.createContext(null);jf.displayName="DataRouter";var $v=S.createContext(null);$v.displayName="DataRouterState";S.createContext(!1);var sI=S.createContext({isTransitioning:!1});sI.displayName="ViewTransition";var Sj=S.createContext(new Map);Sj.displayName="Fetchers";var kj=S.createContext(null);kj.displayName="Await";var Ao=S.createContext(null);Ao.displayName="Navigation";var Av=S.createContext(null);Av.displayName="Location";var oo=S.createContext({outlet:null,matches:[],isDataRoute:!1});oo.displayName="Route";var pw=S.createContext(null);pw.displayName="RouteError";function Cj(e,{relative:t}={}){Dn(Bf(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=S.useContext(Ao),{hash:i,pathname:s,search:a}=Eh(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:ea([n,s])),r.createHref({pathname:c,search:a,hash:i})}function Bf(){return S.useContext(Av)!=null}function ll(){return Dn(Bf(),"useLocation() may be used only in the context of a component."),S.useContext(Av).location}var aI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function lI(e){S.useContext(Ao).static||S.useLayoutEffect(e)}function hw(){let{isDataRoute:e}=S.useContext(oo);return e?zj():Ej()}function Ej(){Dn(Bf(),"useNavigate() may be used only in the context of a component.");let e=S.useContext(jf),{basename:t,navigator:n}=S.useContext(Ao),{matches:r}=S.useContext(oo),{pathname:i}=ll(),s=JSON.stringify(fw(r)),a=S.useRef(!1);return lI(()=>{a.current=!0}),S.useCallback((d,h={})=>{if($o(a.current,aI),!a.current)return;if(typeof d=="number"){n.go(d);return}let m=dw(d,JSON.parse(s),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ea([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,i,e])}var Pj=S.createContext(null);function Tj(e){let t=S.useContext(oo).outlet;return t&&S.createElement(Pj.Provider,{value:e},t)}function uI(){let{matches:e}=S.useContext(oo),t=e[e.length-1];return t?t.params:{}}function Eh(e,{relative:t}={}){let{matches:n}=S.useContext(oo),{pathname:r}=ll(),i=JSON.stringify(fw(n));return S.useMemo(()=>dw(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function _j(e,t){return cI(e)}function cI(e,t,n,r){Dn(Bf(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=S.useContext(Ao),{matches:s}=S.useContext(oo),a=s[s.length-1],c=a?a.params:{},d=a?a.pathname:"/",h=a?a.pathnameBase:"/",m=a&&a.route;{let _=m&&m.path||"";fI(d,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let g=ll(),b;b=g;let x=b.pathname||"/",k=x;if(h!=="/"){let _=h.replace(/^\//,"").split("/");k="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let P=nI(e,{pathname:k});return $o(m||P!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),$o(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),Lj(P&&P.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:ea([h,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?h:ea([h,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),s,n,r)}function Ij(){let e=Fj(),t=xj(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,a)}var $j=S.createElement(Ij,null),Aj=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?S.createElement(oo.Provider,{value:this.props.routeContext},S.createElement(pw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Rj({routeContext:e,match:t,children:n}){let r=S.useContext(jf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(oo.Provider,{value:e},n)}function Lj(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n?.errors;if(s!=null){let d=i.findIndex(h=>h.route.id&&s?.[h.route.id]!==void 0);Dn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let a=!1,c=-1;if(n)for(let d=0;d=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,h,m)=>{let g,b=!1,x=null,k=null;n&&(g=s&&h.route.id?s[h.route.id]:void 0,x=h.route.errorElement||$j,a&&(c<0&&m===0?(fI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,k=null):c===m&&(b=!0,k=h.route.hydrateFallbackElement||null)));let P=t.concat(i.slice(0,m+1)),T=()=>{let _;return g?_=x:b?_=k:h.route.Component?_=S.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=d,S.createElement(Rj,{match:h,routeContext:{outlet:d,matches:P,isDataRoute:n!=null},children:_})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?S.createElement(Aj,{location:n.location,revalidation:n.revalidation,component:x,error:g,children:T(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):T()},null)}function mw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mj(e){let t=S.useContext(jf);return Dn(t,mw(e)),t}function Dj(e){let t=S.useContext($v);return Dn(t,mw(e)),t}function Nj(e){let t=S.useContext(oo);return Dn(t,mw(e)),t}function gw(e){let t=Nj(e),n=t.matches[t.matches.length-1];return Dn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Oj(){return gw("useRouteId")}function Fj(){let e=S.useContext(pw),t=Dj("useRouteError"),n=gw("useRouteError");return e!==void 0?e:t.errors?.[n]}function zj(){let{router:e}=Mj("useNavigate"),t=gw("useNavigate"),n=S.useRef(!1);return lI(()=>{n.current=!0}),S.useCallback(async(i,s={})=>{$o(n.current,aI),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var bC={};function fI(e,t,n){!t&&!bC[e]&&(bC[e]=!0,$o(!1,n))}S.memo(jj);function jj({routes:e,future:t,state:n}){return cI(e,void 0,n,t)}function iq({to:e,replace:t,state:n,relative:r}){Dn(Bf()," may be used only in the context of a component.");let{static:i}=S.useContext(Ao);$o(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(oo),{pathname:a}=ll(),c=hw(),d=dw(e,fw(s),a,r==="path"),h=JSON.stringify(d);return S.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function Bj(e){return Tj(e.context)}function Vj({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){Dn(!Bf(),"You cannot render a inside another . You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=S.useMemo(()=>({basename:a,navigator:i,static:s,future:{}}),[a,i,s]);typeof n=="string"&&(n=Ch(n));let{pathname:d="/",search:h="",hash:m="",state:g=null,key:b="default"}=n,x=S.useMemo(()=>{let k=ra(d,a);return k==null?null:{location:{pathname:k,search:h,hash:m,state:g,key:b},navigationType:r}},[a,d,h,m,g,b,r]);return $o(x!=null,` is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the won't render anything.`),x==null?null:S.createElement(Ao.Provider,{value:c},S.createElement(Av.Provider,{children:t,value:x}))}var Og="get",Fg="application/x-www-form-urlencoded";function Rv(e){return e!=null&&typeof e.tagName=="string"}function Uj(e){return Rv(e)&&e.tagName.toLowerCase()==="button"}function Kj(e){return Rv(e)&&e.tagName.toLowerCase()==="form"}function Wj(e){return Rv(e)&&e.tagName.toLowerCase()==="input"}function Hj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gj(e,t){return e.button===0&&(!t||t==="_self")&&!Hj(e)}var Sg=null;function qj(){if(Sg===null)try{new FormData(document.createElement("form"),0),Sg=!1}catch{Sg=!0}return Sg}var Yj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function P0(e){return e!=null&&!Yj.has(e)?($o(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Fg}"`),null):e}function Xj(e,t){let n,r,i,s,a;if(Kj(e)){let c=e.getAttribute("action");r=c?ra(c,t):null,n=e.getAttribute("method")||Og,i=P0(e.getAttribute("enctype"))||Fg,s=new FormData(e)}else if(Uj(e)||Wj(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a + + ); +}); + +MermaidDiagram.displayName = "MermaidDiagram"; + +export default MermaidDiagram; diff --git a/typescript/ui/src/globals.css b/typescript/ui/src/globals.css index 683cdfcde3..b9b2dd049d 100644 --- a/typescript/ui/src/globals.css +++ b/typescript/ui/src/globals.css @@ -22,6 +22,26 @@ if you are using a copy of the UI for your own project. opacity: 1; } } + + @keyframes shimmer { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(100%); + } + } + + @keyframes fadeIn { + 0% { + opacity: 0; + transform: translateY(10px); + } + 100% { + opacity: 1; + transform: translateY(0); + } + } } .markdown-container code::before, @@ -32,3 +52,23 @@ if you are using a copy of the UI for your own project. .prose { overflow-wrap: break-word; } + +.prose .mermaid-container { + max-width: none; +} + +/* Mermaid diagram container styling */ +.mermaid-container { + /* Center diagram and allow horizontal scroll if needed */ + display: flex; + justify-content: center; + overflow-x: auto; + width: 100%; +} + +.mermaid-container svg { + /* Display at natural size to prevent text clipping */ + height: auto; + display: block; + margin: 0 auto; +} diff --git a/uv.lock b/uv.lock index 318766a842..749b9df9e2 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.10" resolution-markers = [ "python_full_version < '3.11' and platform_machine == 'x86_64' and sys_platform == 'darwin'", @@ -5057,7 +5057,7 @@ wheels = [ [[package]] name = "ragbits-agents" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-agents" } dependencies = [ { name = "ragbits-core" }, @@ -5093,7 +5093,7 @@ provides-extras = ["a2a", "mcp", "openai", "cli"] [[package]] name = "ragbits-chat" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-chat" } dependencies = [ { name = "bcrypt" }, @@ -5141,7 +5141,7 @@ dev = [ [[package]] name = "ragbits-cli" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-cli" } dependencies = [ { name = "ragbits-core" }, @@ -5156,7 +5156,7 @@ requires-dist = [ [[package]] name = "ragbits-core" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-core" } dependencies = [ { name = "aiohttp" }, @@ -5294,7 +5294,7 @@ dev = [ [[package]] name = "ragbits-document-search" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-document-search" } dependencies = [ { name = "docling" }, @@ -5350,7 +5350,7 @@ dev = [ [[package]] name = "ragbits-evaluate" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-evaluate" } dependencies = [ { name = "datasets" }, @@ -5400,7 +5400,7 @@ dev = [ [[package]] name = "ragbits-guardrails" -version = "1.4.0.dev202512100237" +version = "1.4.0.dev202601010248" source = { editable = "packages/ragbits-guardrails" } dependencies = [ { name = "ragbits-core" },