intlayer-editor 9.4.1 → 9.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/CodeBlockShiki-C2jZfupZ.js +2 -0
- package/client/dist/assets/MarkDownRender-CiKQVquM.js +1 -0
- package/client/dist/assets/MarkDownRender-OKmQ5wkB.js +23 -0
- package/client/dist/assets/MarkdownEditor-QEPrPZ-E.js +160 -0
- package/client/dist/assets/{astro-CP_fXwLT.js → astro-JHDYjn39.js} +1 -1
- package/client/dist/assets/bash-CLZ0U2zV.js +1 -0
- package/client/dist/assets/css-CdtkT07m.js +1 -0
- package/client/dist/assets/css-LbU1hoFO.js +1 -0
- package/client/dist/assets/{dist-BMR831Ty.js → dist-CMBnegHe.js} +1 -1
- package/client/dist/assets/dist-DmXGrB9_.js +1 -0
- package/client/dist/assets/dynamic-Cu9eK9Sn.js +41 -0
- package/client/dist/assets/html-B2cKP6UN.js +1 -0
- package/client/dist/assets/html-DYtkB_T1.js +1 -0
- package/client/dist/assets/index-CIl3DRiy.js +108 -0
- package/client/dist/assets/index-DAo12t9O.css +2 -0
- package/client/dist/assets/javascript-BzbQS41l.js +1 -0
- package/client/dist/assets/javascript-Yelw-5ZN.js +1 -0
- package/client/dist/assets/json-B88Oqtu5.js +1 -0
- package/client/dist/assets/json-CaljABEy.js +1 -0
- package/client/dist/assets/postcss-D_Wz94rJ.js +1 -0
- package/client/dist/assets/purify.es-ChwZkWde.js +3 -0
- package/client/dist/assets/react-SIfiwpqq.js +1 -0
- package/client/dist/assets/shikiBundle-DErVn1dN.js +12 -0
- package/client/dist/assets/{svelte-ilNq7Lfa.js → svelte-tEuLYt3E.js} +1 -1
- package/client/dist/assets/tsx-5f3ulCja.js +1 -0
- package/client/dist/assets/tsx-BOvsFOI6.js +1 -0
- package/client/dist/assets/typescript-Utq2Cl8c.js +1 -0
- package/client/dist/assets/typescript-j_1H8WHN.js +1 -0
- package/client/dist/assets/vue-Bg0byEaI.js +1 -0
- package/client/dist/assets/xml-DMbpbO54.js +1 -0
- package/client/dist/assets/yaml-rwi0_p6S.js +1 -0
- package/client/dist/index.html +5 -6
- package/package.json +18 -18
- package/client/dist/assets/CodeBlockShiki-BLho0YfQ.js +0 -2
- package/client/dist/assets/MarkDownRender-B_EX6v-r.js +0 -1
- package/client/dist/assets/MarkDownRender-BtLP6PlU.js +0 -22
- package/client/dist/assets/MarkdownEditor-C2G7YjL1.js +0 -195
- package/client/dist/assets/abap-CLvhMVsD.js +0 -1
- package/client/dist/assets/actionscript-3-Cs6JJXT5.js +0 -1
- package/client/dist/assets/ada-C5qYipkI.js +0 -1
- package/client/dist/assets/ahk-CA9gdOdF.js +0 -1
- package/client/dist/assets/ahk2-_6rzW9BS.js +0 -1
- package/client/dist/assets/andromeeda-vGVdxbeo.js +0 -1
- package/client/dist/assets/angular-html-B8mrqUL5.js +0 -1
- package/client/dist/assets/angular-html-DdvhLupu.js +0 -1
- package/client/dist/assets/angular-ts-Bzix210W.js +0 -1
- package/client/dist/assets/angular-ts-D1ZzN69u.js +0 -1
- package/client/dist/assets/apache-U0d_L8uA.js +0 -1
- package/client/dist/assets/apex-KFGFyKwG.js +0 -1
- package/client/dist/assets/apl-Dhin1L29.js +0 -1
- package/client/dist/assets/applescript-CCn79oCD.js +0 -1
- package/client/dist/assets/ara-4CJ0cIlV.js +0 -1
- package/client/dist/assets/asciidoc-SCjQUq34.js +0 -1
- package/client/dist/assets/asm-Cmm7eHzH.js +0 -1
- package/client/dist/assets/astro-BOigG5MK.js +0 -1
- package/client/dist/assets/aurora-x-CDeNXAV0.js +0 -1
- package/client/dist/assets/awk-BWXHIvNe.js +0 -1
- package/client/dist/assets/ayu-dark-DluEY0Gj.js +0 -1
- package/client/dist/assets/ayu-light-C3h-C4tm.js +0 -1
- package/client/dist/assets/ayu-mirage-Bqwy1Gya.js +0 -1
- package/client/dist/assets/ballerina-B7ZEbQpA.js +0 -1
- package/client/dist/assets/bash-DJPw08Gl.js +0 -1
- package/client/dist/assets/bat-qdxAdBWQ.js +0 -1
- package/client/dist/assets/beancount-D-usSTwE.js +0 -1
- package/client/dist/assets/berry-DKpUyyne.js +0 -1
- package/client/dist/assets/bibtex-Ci_nEsc7.js +0 -1
- package/client/dist/assets/bicep-CUHmPFLl.js +0 -1
- package/client/dist/assets/bird2-CYIUgYqB.js +0 -1
- package/client/dist/assets/blade-C9OtwYXd.js +0 -1
- package/client/dist/assets/bsl-_VjlB9mv.js +0 -1
- package/client/dist/assets/bundle-web-C6ZY4vfl.js +0 -2
- package/client/dist/assets/c-BXFGequq.js +0 -1
- package/client/dist/assets/c-iCihek07.js +0 -1
- package/client/dist/assets/c3-D0apG41V.js +0 -1
- package/client/dist/assets/cadence-CQ2zXKGN.js +0 -1
- package/client/dist/assets/cairo-DLTphjLi.js +0 -1
- package/client/dist/assets/catppuccin-frappe-C9Q5zVZY.js +0 -1
- package/client/dist/assets/catppuccin-latte-CtsyrtPq.js +0 -1
- package/client/dist/assets/catppuccin-macchiato-R8nAf1vR.js +0 -1
- package/client/dist/assets/catppuccin-mocha-DjuaAJKi.js +0 -1
- package/client/dist/assets/chapel-DmtgEXO_.js +0 -1
- package/client/dist/assets/clarity-CtfBBspg.js +0 -1
- package/client/dist/assets/clojure-DqKBuwfJ.js +0 -1
- package/client/dist/assets/cmake-Bj61d0ZC.js +0 -1
- package/client/dist/assets/cobol-Cw2-KvLW.js +0 -1
- package/client/dist/assets/codeowners-C8r90Shi.js +0 -1
- package/client/dist/assets/codeql-oeQT6MSM.js +0 -1
- package/client/dist/assets/coffee-CiiSLhB6.js +0 -1
- package/client/dist/assets/common-lisp-Cv5bFMCO.js +0 -1
- package/client/dist/assets/coq-DuBRPxYg.js +0 -1
- package/client/dist/assets/cpp-71xkOQct.js +0 -1
- package/client/dist/assets/cpp-B-FuqbHP.js +0 -1
- package/client/dist/assets/crystal-DGPAtLeY.js +0 -1
- package/client/dist/assets/csharp-D87KiH5q.js +0 -1
- package/client/dist/assets/csharp-oqKa8noW.js +0 -1
- package/client/dist/assets/css-B4wZOiGx.js +0 -1
- package/client/dist/assets/css-CNuuLpMC.js +0 -1
- package/client/dist/assets/csv-BjES08DR.js +0 -1
- package/client/dist/assets/csv-Dx-8-gkx.js +0 -1
- package/client/dist/assets/cue-CE9AQfxI.js +0 -1
- package/client/dist/assets/cypher-ClKdZ_lG.js +0 -1
- package/client/dist/assets/d-qD-0Kul2.js +0 -1
- package/client/dist/assets/dark-plus-Cs2F2srj.js +0 -1
- package/client/dist/assets/dart-CnvKMtbv.js +0 -1
- package/client/dist/assets/dart-D76ST_ms.js +0 -1
- package/client/dist/assets/dax-BkyTk9wS.js +0 -1
- package/client/dist/assets/desktop-Dlh5hvp9.js +0 -1
- package/client/dist/assets/diff-CGoPSmAs.js +0 -1
- package/client/dist/assets/diff-woXpYk--.js +0 -1
- package/client/dist/assets/dist-Dx0ApjIF.js +0 -12
- package/client/dist/assets/dist-KPVyyi8J.js +0 -1
- package/client/dist/assets/docker-B0VNDs-l.js +0 -1
- package/client/dist/assets/docker-IyjqRm3v.js +0 -1
- package/client/dist/assets/dotenv-_5a1GRtc.js +0 -1
- package/client/dist/assets/dracula-BHWKrbxM.js +0 -1
- package/client/dist/assets/dracula-soft-5eyTD99u.js +0 -1
- package/client/dist/assets/dream-maker-DW3nJb8Q.js +0 -1
- package/client/dist/assets/dynamic-BEUMYIIS.js +0 -41
- package/client/dist/assets/edge-BssoORKC.js +0 -1
- package/client/dist/assets/elixir-DP304Xio.js +0 -1
- package/client/dist/assets/elm-o4NJxfws.js +0 -1
- package/client/dist/assets/emacs-lisp-c_oH4hRZ.js +0 -1
- package/client/dist/assets/erb-C7MPl934.js +0 -1
- package/client/dist/assets/erlang-Cphh6RMH.js +0 -1
- package/client/dist/assets/everforest-dark-sB-x3p7T.js +0 -1
- package/client/dist/assets/everforest-light-Df2xbC6M.js +0 -1
- package/client/dist/assets/fennel-DQxkIbk2.js +0 -1
- package/client/dist/assets/fish-BJitypiv.js +0 -1
- package/client/dist/assets/fluent-C03EYrpw.js +0 -1
- package/client/dist/assets/fortran-fixed-form-DEKoE2YW.js +0 -1
- package/client/dist/assets/fortran-free-form-CYNrtFtB.js +0 -1
- package/client/dist/assets/fsharp-D13ZGOAj.js +0 -1
- package/client/dist/assets/gdresource-xMC7jr7x.js +0 -1
- package/client/dist/assets/gdscript-DYvRD3hg.js +0 -1
- package/client/dist/assets/gdshader-CBce3t8t.js +0 -1
- package/client/dist/assets/genie-CV2tkWYe.js +0 -1
- package/client/dist/assets/gherkin-DExj1W_8.js +0 -1
- package/client/dist/assets/git-commit-BSykSTBG.js +0 -1
- package/client/dist/assets/git-rebase-BDPpS8w6.js +0 -1
- package/client/dist/assets/github-dark-BXcQsJYB.js +0 -1
- package/client/dist/assets/github-dark-default-DXG-b-1a.js +0 -1
- package/client/dist/assets/github-dark-dimmed-Bx1FflLF.js +0 -1
- package/client/dist/assets/github-dark-high-contrast-B_tTalzw.js +0 -1
- package/client/dist/assets/github-light-DnUD0JAn.js +0 -1
- package/client/dist/assets/github-light-default-BXViO-2h.js +0 -1
- package/client/dist/assets/github-light-high-contrast-B68TUdTA.js +0 -1
- package/client/dist/assets/gleam-CSRkHgEL.js +0 -1
- package/client/dist/assets/glimmer-js-BONyzAsu.js +0 -1
- package/client/dist/assets/glimmer-ts-f9c0GCOe.js +0 -1
- package/client/dist/assets/glsl-D5MA2a_X.js +0 -1
- package/client/dist/assets/gn-ilITqXS6.js +0 -1
- package/client/dist/assets/gnuplot-7GGW24-e.js +0 -1
- package/client/dist/assets/go-ByX_zvWx.js +0 -1
- package/client/dist/assets/go-rLFTqkRN.js +0 -1
- package/client/dist/assets/graphql-BhltWPVB.js +0 -1
- package/client/dist/assets/graphql-Ctjuxyvl.js +0 -1
- package/client/dist/assets/groovy-CacY0gHj.js +0 -1
- package/client/dist/assets/gruvbox-dark-hard-C820rvS2.js +0 -1
- package/client/dist/assets/gruvbox-dark-medium-BPjhmG05.js +0 -1
- package/client/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +0 -1
- package/client/dist/assets/gruvbox-light-hard-BC_s9l72.js +0 -1
- package/client/dist/assets/gruvbox-light-medium-BAWPOn9u.js +0 -1
- package/client/dist/assets/gruvbox-light-soft-BSMLrYjP.js +0 -1
- package/client/dist/assets/hack-Dh_ZLRbs.js +0 -1
- package/client/dist/assets/haml-CwEpbK1d.js +0 -1
- package/client/dist/assets/handlebars-ryMP1rBR.js +0 -1
- package/client/dist/assets/haskell-D8IpX4py.js +0 -1
- package/client/dist/assets/haxe-C8oCnwJJ.js +0 -1
- package/client/dist/assets/hcl-Dh228itO.js +0 -1
- package/client/dist/assets/hjson-CxZEssPk.js +0 -1
- package/client/dist/assets/hlsl-Cvrh5tZx.js +0 -1
- package/client/dist/assets/horizon-CE9ld1lL.js +0 -1
- package/client/dist/assets/horizon-bright-DSNQnXHK.js +0 -1
- package/client/dist/assets/houston-CsvMBhTu.js +0 -1
- package/client/dist/assets/html-C8J32C4L.js +0 -1
- package/client/dist/assets/html-XwrE-1r6.js +0 -1
- package/client/dist/assets/html-derivative-CZmrFNOW.js +0 -1
- package/client/dist/assets/http-NCBdpUR_.js +0 -1
- package/client/dist/assets/http-kmH8AyfE.js +0 -1
- package/client/dist/assets/hurl-DCZHXKU4.js +0 -1
- package/client/dist/assets/hxml-Dcm88srW.js +0 -1
- package/client/dist/assets/hy-CZbG8q4J.js +0 -1
- package/client/dist/assets/imba-DsUTQ-LC.js +0 -1
- package/client/dist/assets/index-BreD6vF9.js +0 -122
- package/client/dist/assets/index-DWNHyE4L.css +0 -2
- package/client/dist/assets/ini-B5eOa1yu.js +0 -1
- package/client/dist/assets/ini-CxAuzHS9.js +0 -1
- package/client/dist/assets/java-DacLdzTj.js +0 -1
- package/client/dist/assets/java-DdHNQ9hk.js +0 -1
- package/client/dist/assets/javascript-D3QwfYpG.js +0 -1
- package/client/dist/assets/javascript-obGGvMPs.js +0 -1
- package/client/dist/assets/jinja-B-tLrNsM.js +0 -1
- package/client/dist/assets/jison-CBjhYtSs.js +0 -1
- package/client/dist/assets/json-BEKLEUsd.js +0 -1
- package/client/dist/assets/json-DAgxKhMr.js +0 -1
- package/client/dist/assets/json5-CAt3W1dj.js +0 -1
- package/client/dist/assets/jsonl-CmCQp5Yx.js +0 -1
- package/client/dist/assets/jsonnet-CJTPZ8u_.js +0 -1
- package/client/dist/assets/jssm-DXw9l8Rf.js +0 -1
- package/client/dist/assets/jsx-gTgmArGx.js +0 -1
- package/client/dist/assets/julia-CXJVy74_.js +0 -1
- package/client/dist/assets/just-B9Xn_Dp4.js +0 -1
- package/client/dist/assets/kanagawa-dragon-Bozd7klA.js +0 -1
- package/client/dist/assets/kanagawa-lotus-BmuOG9ZW.js +0 -1
- package/client/dist/assets/kanagawa-wave-BML5mF2J.js +0 -1
- package/client/dist/assets/kdl-CsD5j6eV.js +0 -1
- package/client/dist/assets/kotlin-DFAlwc6n.js +0 -1
- package/client/dist/assets/kotlin-DhhofPvG.js +0 -1
- package/client/dist/assets/kusto-C7mF5XQf.js +0 -1
- package/client/dist/assets/laserwave-C_8bwKvT.js +0 -1
- package/client/dist/assets/latex-o9DRzaEe.js +0 -1
- package/client/dist/assets/lean-CewbzKMR.js +0 -1
- package/client/dist/assets/less-BAH4QT9G.js +0 -1
- package/client/dist/assets/less-DVTAwKKz.js +0 -1
- package/client/dist/assets/light-plus-DVQuIRkW.js +0 -1
- package/client/dist/assets/liquid-G0MH4h_m.js +0 -1
- package/client/dist/assets/llvm-DqHOMS-s.js +0 -1
- package/client/dist/assets/log-BNLmms1o.js +0 -1
- package/client/dist/assets/logo-Cluzi2Zq.js +0 -1
- package/client/dist/assets/lua-9Gg56-4d.js +0 -1
- package/client/dist/assets/lua-FONpmTUP.js +0 -1
- package/client/dist/assets/luau-C2pBCSgt.js +0 -1
- package/client/dist/assets/make-Dixweg8N.js +0 -1
- package/client/dist/assets/markdown-BK4fiefF.js +0 -1
- package/client/dist/assets/marko-DV5GrDmo.js +0 -1
- package/client/dist/assets/material-theme-Bm3Qr25_.js +0 -1
- package/client/dist/assets/material-theme-darker-2IIEA8gg.js +0 -1
- package/client/dist/assets/material-theme-lighter-uhdI0v04.js +0 -1
- package/client/dist/assets/material-theme-ocean-CHQ94UKr.js +0 -1
- package/client/dist/assets/material-theme-palenight-B5W6OYN7.js +0 -1
- package/client/dist/assets/matlab-D7qyCx1q.js +0 -1
- package/client/dist/assets/mdc-DDp9N6h-.js +0 -1
- package/client/dist/assets/mdx-DQZ5AkYe.js +0 -1
- package/client/dist/assets/mermaid-BxpfTIzt.js +0 -1
- package/client/dist/assets/min-dark-BSWPekZh.js +0 -1
- package/client/dist/assets/min-light-DDpmG2fV.js +0 -1
- package/client/dist/assets/mipsasm-BMqwQI7S.js +0 -1
- package/client/dist/assets/mojo-fg40_ntQ.js +0 -1
- package/client/dist/assets/monokai-B_bV9PQ9.js +0 -1
- package/client/dist/assets/moonbit-DgjMoLWr.js +0 -1
- package/client/dist/assets/move-BYnGhZoM.js +0 -1
- package/client/dist/assets/narrat-_X_XdTYD.js +0 -1
- package/client/dist/assets/nextflow-BJtWHP5T.js +0 -1
- package/client/dist/assets/nextflow-groovy-DJMQeKeT.js +0 -1
- package/client/dist/assets/nginx-BTMw9COX.js +0 -1
- package/client/dist/assets/nginx-D0i2Z83b.js +0 -1
- package/client/dist/assets/night-owl-DhmEMT88.js +0 -1
- package/client/dist/assets/night-owl-light-eJ-hLW7d.js +0 -1
- package/client/dist/assets/nim-B6yJ_yaC.js +0 -1
- package/client/dist/assets/nix-IvuFDN5E.js +0 -1
- package/client/dist/assets/nord-Cb4Vim4T.js +0 -1
- package/client/dist/assets/nsis-CjNLYCLg.js +0 -1
- package/client/dist/assets/nushell-DHYfO66s.js +0 -1
- package/client/dist/assets/objective-c-D1A_Heim.js +0 -1
- package/client/dist/assets/objective-cpp-BsSzOQcm.js +0 -1
- package/client/dist/assets/ocaml-O90oeIOV.js +0 -1
- package/client/dist/assets/odin-B1RWQWA5.js +0 -1
- package/client/dist/assets/one-dark-pro-CLwyXe_n.js +0 -1
- package/client/dist/assets/one-light-D7Lr4KcI.js +0 -1
- package/client/dist/assets/openscad-BUDT5pXO.js +0 -1
- package/client/dist/assets/org-Ddi8Gs6E.js +0 -1
- package/client/dist/assets/pascal-4ZHwLPI5.js +0 -1
- package/client/dist/assets/perl-DEgXgjuC.js +0 -1
- package/client/dist/assets/php-B3WFIgcK.js +0 -1
- package/client/dist/assets/php-B9UPq-vz.js +0 -1
- package/client/dist/assets/pkl-ot-7Btpt.js +0 -1
- package/client/dist/assets/plastic-DQwYfKfQ.js +0 -1
- package/client/dist/assets/plsql-DGHpHOYJ.js +0 -1
- package/client/dist/assets/po-BiJDBrnU.js +0 -1
- package/client/dist/assets/poimandres-DRFjx7u4.js +0 -1
- package/client/dist/assets/polar-C7UOKdEL.js +0 -1
- package/client/dist/assets/postcss-DjpeKS93.js +0 -1
- package/client/dist/assets/powerquery-DNMTfnFr.js +0 -1
- package/client/dist/assets/powershell-CCSX75yM.js +0 -1
- package/client/dist/assets/powershell-npZ7I2uH.js +0 -1
- package/client/dist/assets/prisma-DMUTjaHc.js +0 -1
- package/client/dist/assets/prisma-DMgNhnYS.js +0 -1
- package/client/dist/assets/prolog-iXnhIJG7.js +0 -1
- package/client/dist/assets/proto-DB4EqR-F.js +0 -1
- package/client/dist/assets/pug-DkgDHZci.js +0 -1
- package/client/dist/assets/puppet-CDv2pdJW.js +0 -1
- package/client/dist/assets/purescript-9MfHhQsQ.js +0 -1
- package/client/dist/assets/purify.es-JEAr64Sr.js +0 -3
- package/client/dist/assets/python-6UJTEiNq.js +0 -1
- package/client/dist/assets/python-gzcpVVnB.js +0 -1
- package/client/dist/assets/qml-_a-QhfPD.js +0 -1
- package/client/dist/assets/qmldir-DCQb3MpD.js +0 -1
- package/client/dist/assets/qss-Fe1Jh2GI.js +0 -1
- package/client/dist/assets/r-BHcO8Vjq.js +0 -1
- package/client/dist/assets/racket-DcIDlBhZ.js +0 -1
- package/client/dist/assets/raku-B3gFvitq.js +0 -1
- package/client/dist/assets/razor-BMJ0eI3p.js +0 -1
- package/client/dist/assets/rbs-C0MpOrj4.js +0 -1
- package/client/dist/assets/react-CwJFpaho.js +0 -1
- package/client/dist/assets/red-DX1BQOs8.js +0 -1
- package/client/dist/assets/reg-CRGYupPL.js +0 -1
- package/client/dist/assets/regexp-DR20uMnK.js +0 -1
- package/client/dist/assets/rel-BtDbiS_P.js +0 -1
- package/client/dist/assets/riscv-Ckw8ddFX.js +0 -1
- package/client/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
- package/client/dist/assets/ron-VUp2lXgN.js +0 -1
- package/client/dist/assets/rose-pine-aMsaMD1D.js +0 -1
- package/client/dist/assets/rose-pine-dawn-8PwUyIlP.js +0 -1
- package/client/dist/assets/rose-pine-moon-DO-qXg-I.js +0 -1
- package/client/dist/assets/rosmsg-CAekHB0j.js +0 -1
- package/client/dist/assets/rst-D_zF0oSf.js +0 -1
- package/client/dist/assets/ruby-B8JcIHv0.js +0 -1
- package/client/dist/assets/ruby-BwZ6L1bt.js +0 -1
- package/client/dist/assets/rust-Cfkwpbl8.js +0 -1
- package/client/dist/assets/rust-hysUUyJr.js +0 -1
- package/client/dist/assets/sas-CBpMWA2M.js +0 -1
- package/client/dist/assets/sass-DXrisJhu.js +0 -1
- package/client/dist/assets/scala-BiFt_7mu.js +0 -1
- package/client/dist/assets/scheme-DQCgrYNe.js +0 -1
- package/client/dist/assets/scss-BcTpOuGQ.js +0 -1
- package/client/dist/assets/scss-YesllqfO.js +0 -1
- package/client/dist/assets/sdbl-bTVj8UrX.js +0 -1
- package/client/dist/assets/shaderlab-TOUzSsQk.js +0 -1
- package/client/dist/assets/shellscript-Da78Ox-3.js +0 -1
- package/client/dist/assets/shellsession-CVsQGYfZ.js +0 -1
- package/client/dist/assets/slack-dark-DnToyrRv.js +0 -1
- package/client/dist/assets/slack-ochin-B2OO5cIa.js +0 -1
- package/client/dist/assets/smalltalk-BHpQb5nM.js +0 -1
- package/client/dist/assets/smithy-Dgaz7aur.js +0 -1
- package/client/dist/assets/snazzy-light-4G7pJPwS.js +0 -1
- package/client/dist/assets/solarized-dark-UdsmMDCL.js +0 -1
- package/client/dist/assets/solarized-light-C1IUL_tW.js +0 -1
- package/client/dist/assets/solidity-Bj7E1mRn.js +0 -1
- package/client/dist/assets/soy-DEd-qcad.js +0 -1
- package/client/dist/assets/sparql-D_iOobhT.js +0 -1
- package/client/dist/assets/splunk-BC2Px7Mm.js +0 -1
- package/client/dist/assets/sql-DdD7vxS4.js +0 -1
- package/client/dist/assets/sql-cVYxS3zp.js +0 -1
- package/client/dist/assets/ssh-config-BgfXC-Er.js +0 -1
- package/client/dist/assets/stata-CMv7m7Gi.js +0 -1
- package/client/dist/assets/stylus-B6D30XZt.js +0 -1
- package/client/dist/assets/surrealql-BZoq2lXR.js +0 -1
- package/client/dist/assets/svelte-BfB1UVP4.js +0 -1
- package/client/dist/assets/swift-CyEgAFGc.js +0 -1
- package/client/dist/assets/swift-DD8iODVb.js +0 -1
- package/client/dist/assets/synthwave-84-nFMaYfgc.js +0 -1
- package/client/dist/assets/system-verilog-Dh5ihWbf.js +0 -1
- package/client/dist/assets/systemd-BxMlprV5.js +0 -1
- package/client/dist/assets/talonscript-CohzipZa.js +0 -1
- package/client/dist/assets/tasl-DMoTqEGO.js +0 -1
- package/client/dist/assets/tcl-CZd0xW_V.js +0 -1
- package/client/dist/assets/templ-TjxbArHn.js +0 -1
- package/client/dist/assets/terraform-DswuEJGm.js +0 -1
- package/client/dist/assets/tex-BK-H2Wn4.js +0 -1
- package/client/dist/assets/tokyo-night-oM2G3aXe.js +0 -1
- package/client/dist/assets/toml-CcmNWLt0.js +0 -1
- package/client/dist/assets/toml-ClfFv0hG.js +0 -1
- package/client/dist/assets/ts-tags-Cc5do7zu.js +0 -1
- package/client/dist/assets/tsv-sltzmVWM.js +0 -1
- package/client/dist/assets/tsx-CUOciP0b.js +0 -1
- package/client/dist/assets/tsx-pz6HK4Kt.js +0 -1
- package/client/dist/assets/turtle-ByJddavk.js +0 -1
- package/client/dist/assets/twig-BVSnuTf-.js +0 -1
- package/client/dist/assets/typescript-BydbNFcO.js +0 -1
- package/client/dist/assets/typescript-C1HUSq0F.js +0 -1
- package/client/dist/assets/typespec-BRdr0IET.js +0 -1
- package/client/dist/assets/typst-C40W_gC6.js +0 -1
- package/client/dist/assets/v-DBj4K9d_.js +0 -1
- package/client/dist/assets/vala-zf12oZj6.js +0 -1
- package/client/dist/assets/vb-DOwzaHZ0.js +0 -1
- package/client/dist/assets/verilog-B2gwz-sJ.js +0 -1
- package/client/dist/assets/vesper-DdrHHSXu.js +0 -1
- package/client/dist/assets/vhdl-BroJfC0k.js +0 -1
- package/client/dist/assets/viml-DvXPmvsu.js +0 -1
- package/client/dist/assets/vitesse-black-fwtXNY1n.js +0 -1
- package/client/dist/assets/vitesse-dark-BZCL-v6S.js +0 -1
- package/client/dist/assets/vitesse-light-VbXTXTou.js +0 -1
- package/client/dist/assets/vue-CPLyymta.js +0 -1
- package/client/dist/assets/vue-Dp3wEN59.js +0 -1
- package/client/dist/assets/vue-html-DkKkQnZL.js +0 -1
- package/client/dist/assets/vue-vine-BQzmGpSB.js +0 -1
- package/client/dist/assets/vyper-CgoNMtux.js +0 -1
- package/client/dist/assets/wasm-ByWQv1Qj.js +0 -1
- package/client/dist/assets/wenyan-C8pVoKbM.js +0 -1
- package/client/dist/assets/wgsl-BsKzXJz4.js +0 -1
- package/client/dist/assets/wikitext-ClFFjSW2.js +0 -1
- package/client/dist/assets/wit-DdvCle-K.js +0 -1
- package/client/dist/assets/wolfram-DLL8P-h_.js +0 -1
- package/client/dist/assets/xml-BlnrEAEy.js +0 -1
- package/client/dist/assets/xml-CgBKDvjc.js +0 -1
- package/client/dist/assets/xsl-BOPS8gLt.js +0 -1
- package/client/dist/assets/yaml-CxGkb6KZ.js +0 -1
- package/client/dist/assets/yaml-Du_6cdrH.js +0 -1
- package/client/dist/assets/zenscript-BnlCZFoB.js +0 -1
- package/client/dist/assets/zig-CMLA9XwU.js +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkDownRender-CiKQVquM.js","assets/MarkDownRender-OKmQ5wkB.js","assets/react-SIfiwpqq.js","assets/dynamic-Cu9eK9Sn.js","assets/dist-DmXGrB9_.js","assets/MarkdownEditor-QEPrPZ-E.js","assets/shikiBundle-DErVn1dN.js","assets/dist-CMBnegHe.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./react-SIfiwpqq.js";import{$ as i,$t as a,A as o,At as s,B as c,Bt as l,Ct as u,D as d,Dt as f,Et as p,F as m,Ft as h,G as g,Gt as _,H as v,Ht as y,I as b,It as x,J as S,Jt as C,K as w,Kt as T,L as E,Lt as D,M as O,Mt as k,N as ee,Nt as A,O as j,Ot as te,P as M,Pt as N,Q as P,Qt as ne,R as re,Rt as ie,St as F,Tt as I,U as ae,Ut as oe,V as se,Vt as ce,W as le,Wt as ue,X as de,Xt as fe,Y as pe,Yt as me,Z as he,Zt as ge,_t as _e,at as ve,bt as ye,ct as be,d as xe,dt as Se,en as Ce,et as we,f as Te,ft as Ee,g as De,gt as Oe,h as ke,ht as Ae,i as je,it as Me,j as Ne,jt as Pe,k as Fe,kt as Ie,lt as Le,m as L,mt as Re,n as ze,ot as Be,p as Ve,pt as He,q as Ue,qt as We,r as Ge,rt as Ke,s as qe,st as Je,t as Ye,tn as Xe,tt as Ze,ut as Qe,vt as $e,wt as et,xt as tt,yt as nt,z as rt,zt as it}from"./dynamic-Cu9eK9Sn.js";import{n as at,r as ot,t as R}from"./dist-DmXGrB9_.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var st=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ct=t(((e,t)=>{t.exports=st()})),lt=t((e=>{var t=ct(),n=r(),i=Xe();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var te=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function F(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function I(e,t){re++,ne[re]=e.current,e.current=t}var ae=ie(null),oe=ie(null),se=ie(null),ce=ie(null);function le(e,t){switch(I(se,t),I(oe,e),I(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(ae),I(ae,e)}function ue(){F(ae),F(oe),F(se)}function de(e){e.memoizedState!==null&&I(ce,e);var t=ae.current,n=Kd(t,e.type);t!==n&&(I(oe,e),I(ae,n))}function fe(e){oe.current===e&&(F(ae),F(oe)),ce.current===e&&(F(ce),np._currentValue=P)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:ze,L=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(L(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function it(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,R=`__reactProps$`+at,st=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[R],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[ot])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[: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]*$`),Tt={},Et={};function Dt(e){return be.call(Et,e)?!0:be.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):z(e,o,jt(n)):z(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function z(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(te(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Kt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Kt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Xt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[R]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[R]||null;if(!i)throw Error(a(90));zt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(Cu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[R]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function hn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function gn(){return!0}function _n(){return!1}function vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?gn:_n,this.isPropagationStopped=_n,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),t}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bn=vn(yn),xn=p({},yn,{view:0,detail:0}),Sn=vn(xn),Cn,wn,Tn,En=p({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=vn(En),On=vn(p({},En,{dataTransfer:0})),kn=vn(p({},xn,{relatedTarget:0})),An=vn(p({},yn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=vn(p({},yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=vn(p({},yn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=vn(p({},xn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=vn(p({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=vn(p({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=vn(p({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=vn(p({},En,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Un=vn(p({},yn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=cn&&`CompositionEvent`in window,Kn=null;cn&&`documentMode`in document&&(Kn=document.documentMode);var qn=cn&&`TextEvent`in window&&!Kn,Jn=cn&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=kd(t,`onChange`),0<t.length&&(n=new bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){Cd(e,0)}function cr(e){if(Ft(_t(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(cn){var dr;if(cn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,en(e)),on(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!be.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==It(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=kd(Ar,`onSelect`),0<r.length&&(t=new bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};cn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),St(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<mu)throw mu=0,hu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=si(31,n,t,i),e.elementType=D,e.lanes=o,e;case _:return fi(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=si(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=si(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=si(19,n,t,i),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Le(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,B=!1,Pi=null,Fi=!1,Ii=Error(a(519));function Li(e){throw Vi(_i(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ii}function Ri(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[R]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Fd(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Li(e,!0)}function V(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Fi=!1;return;case 27:case 3:Fi=!0;return;default:Mi=Mi.return}}function H(e){if(e!==Mi)return!1;if(!B)return V(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||qd(e.type,e.memoizedProps)),n=!n),n&&Ni&&Li(e),V(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ni=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ni=mf(e)}else t===27?(t=Ni,tf(e.type)?(e=pf,pf=null,Ni=e):Ni=t):Ni=Mi?ff(e.stateNode.nextSibling):null;return!0}function zi(){Ni=Mi=null,B=!1}function Bi(){var e=Pi;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Pi=null),e}function Vi(e){Pi===null?Pi=[e]:Pi.push(e)}var Hi=ie(null),Ui=null,Wi=null;function Gi(e,t,n){I(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,F(Hi)}function qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ji(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),qi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Yi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;xr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===ce.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}i=i.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(a(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,ia={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new ta,data:new Map,refCount:0}}function oa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var sa=null,ca=0,la=0,ua=null;function da(e,t){if(sa===null){var n=sa=[];ca=0,la=hd(),ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ca++,t.then(fa,fa),t}function fa(){if(--ca===0&&sa!==null){ua!==null&&(ua.status=`fulfilled`);var e=sa;sa=null,la=0,ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ma=M.S;M.S=function(e,t){ru=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&da(e,t),ma!==null&&ma(e,t)};var ha=ie(null);function ga(){var e=ha.current;return e===null?Bl.pooledCache:e}function _a(e,t){t===null?I(ha,ha.current):I(ha,t.pool)}function va(){var e=ga();return e===null?null:{parent:ia._currentValue,pool:e}}var ya=Error(a(460)),ba=Error(a(474)),xa=Error(a(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e}throw Ea=t,ya}}function Ta(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ea=e,ya):e}}var Ea=null;function Da(){if(Ea===null)throw Error(a(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(a(483))}var ka=null,Aa=0;function ja(e){var t=Aa;return Aa+=1,ka===null&&(ka=[]),wa(ka,e,t)}function Ma(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Na(e,t){throw t.$$typeof===m?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Pa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&Ta(a)===t.type)?(t=i(t,n.props),Ma(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Ma(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=fi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=di(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case g:return t=hi(t,e.mode,n),t.return=e,t;case E:return t=Ta(t),f(e,t,n)}if(te(t)||ee(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ja(t),n);if(t.$$typeof===x)return f(e,$i(e,t),n);Na(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=Ta(n),p(e,t,n,r)}if(te(n)||ee(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ja(n),r);if(n.$$typeof===x)return p(e,t,$i(e,n),r);Na(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Ta(r),m(e,t,n,r,i)}if(te(r)||ee(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ja(r),i);if(r.$$typeof===x)return m(e,t,n,$i(t,r),i);Na(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&Di(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),B&&Di(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&Di(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),B&&Di(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Ta(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ma(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===_?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Ma(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Ta(o),b(e,r,o,c)}if(te(o))return v(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ja(o),c);if(o.$$typeof===x)return b(e,r,$i(e,o),c);Na(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Aa=0;var i=b(e,t,n,r);return ka=null,i}catch(t){if(t===ya||t===xa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Fa=Pa(!0),Ia=Pa(!1),La=!1;function Ra(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ha(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wa=!1;function Ga(){if(Wa){var e=ua;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;La=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(q&f)===f:(r&f)===f){f!==0&&f===la&&(Wa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:La=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=ie(null),Xa=ie(0);function Za(e,t){e=Kl,I(Xa,e),I(Ya,t),Kl=e|t.baseLanes}function Qa(){I(Xa,Kl),I(Ya,Ya.current)}function $a(){Kl=Xa.current,F(Ya),F(Xa)}var eo=ie(null),to=null;function no(e){var t=e.alternate;I(so,so.current&1),I(eo,e),to===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){I(so,so.current),I(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(I(so,so.current),I(eo,e),to===null&&(to=e)):ao(e)}function ao(){I(so,so.current),I(eo,eo.current)}function oo(e){F(eo),to===e&&(to=null),F(so)}var so=ie(0);function co(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lo=0,U=null,uo=null,fo=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(a(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?zs:Bs,ho=!1,a=n(r,i),ho=!1,mo&&(a=wo(t,n,r,i)),Co(e),a}function Co(e){M.H=Rs;var t=uo!==null&&uo.next!==null;if(lo=0,fo=uo=U=null,po=!1,_o=0,vo=null,t)throw Error(a(300));e===null||rc||(e=e.dependencies,e!==null&&Xi(e)&&(rc=!0))}function wo(e,t,n,r){U=e;var i=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=i)throw Error(a(301));if(i+=1,fo=uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Vs,o=t(n,r)}while(mo);return o}function To(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(U.flags|=1024),t}function Eo(){var e=go!==0;return go=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}lo=0,fo=uo=U=null,mo=!1,_o=go=0,vo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fo===null?U.memoizedState=fo=e:fo=fo.next=e,fo}function Ao(){if(uo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=fo===null?U.memoizedState:fo.next;if(t!==null)fo=t,uo=e;else{if(e===null)throw U.alternate===null?Error(a(467)):Error(a(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},fo===null?U.memoizedState=fo=e:fo=fo.next=e}return fo}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=wa(vo,e,t),t=U,(fo===null?t.memoizedState:fo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?zs:Bs),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===x)return Qi(e)}throw Error(a(438,String(e)))}function Po(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=jo(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),uo,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===la&&(d=!0);else if((lo&p)===p){u=u.next,p===la&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,Jl|=p;f=u.action,ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(rc=!0,d&&(n=ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ro(e){var t=Ao(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);xr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=U,i=Ao(),o=B;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!xr((uo||i).memoizedState,n);if(s&&(i.memoizedState=n,rc=!0),i=i.queue,us(Ho.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||fo!==null&&fo.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,i,n,t),null),Bl===null)throw Error(a(349));o||lo&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=jo(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Wo(e){var t=ni(e,2);t!==null&&vu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),ho){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,uo,typeof r==`function`?r:Fo)}function qo(e,t,n,r,i){if(Fs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(B){var n=Bl.formState;if(n!==null){a:{var r=U;if(B){if(Ni){b:{for(var i=Ni,a=Fi;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=ff(i.nextSibling),r=i.data===`F!`;break a}}Li(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,U,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,U,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(Ao(),uo,e)}function ns(e,t,n){if(t=Lo(e,t,$o)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===ya?xa:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=Ao(),n=uo;if(n!==null)return ns(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=jo(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function os(){return Ao().memoizedState}function ss(e,t,n,r){var i=ko();U.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&xo(r,uo.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(U.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=jo(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=Ao().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(G&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||lo&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),U.lanes|=e,Jl|=e,n)}function xs(e,t,n,r){return xr(n,t)?n:Ya.current===null?!(lo&42)||lo&1073741824&&!(q&261930)?(rc=!0,e.memoizedState=n):(e=_u(),U.lanes|=e,Jl|=e,t):(e=bs(e,n,r),xr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,Ps(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,pa(c,r),gu(e)):Ns(e,t,r,gu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ts(e).queue;Ss(e,i,t,P,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},gu())}function Ds(){return Qi(np)}function Os(){return Ao().memoizedState}function ks(){return Ao().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Ba(n);var r=Va(t,e,n);r!==null&&(vu(r,t,n),Ha(r,t,n)),t={cache:aa()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=ti(e,t,n,r),n!==null&&(vu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,gu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Bl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return vu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(a(479))}else t=ti(e,n,r,2),t!==null&&vu(t,e,2)}function Fs(e){var t=e.alternate;return e===U||t!==null&&t===U}function Is(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Rs={readContext:Qi,use:No,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Rs.useEffectEvent=bo;var zs={readContext:Qi,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(ho){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(ho){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,U,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,i=ko();if(B){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Bl===null)throw Error(a(349));q&127||Bo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=Bl.identifierPrefix;if(B){var n=Ei,r=Ti;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=As.bind(null,U)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:Qi,use:No,useCallback:vs,useContext:Qi,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Io,useRef:os,useState:function(){return Io(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(Ao(),uo.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(Ao(),uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:Qi,use:No,useCallback:vs,useContext:Qi,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Ro,useRef:os,useState:function(){return Ro(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){var n=Ao();return uo===null?bs(n,e,t):xs(n,uo.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=Ao();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ba(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(vu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Ba(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(vu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Ba(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(vu(t,e,n),Ha(t,e,n))}};function Ws(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Gs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){Yr(e)}function Js(e){console.error(e)}function Ys(e){Yr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Ba(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,i,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,i)),!1;case 22:return n.flags|=65536,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,i)),!1}throw Error(a(435,n.tag))}return Yu(e,r,i),Au(),!1}if(B)return t=eo.current,t===null?(r!==Ii&&(t=Error(a(423),{cause:r}),Vi(_i(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=_i(r,n),i=Qs(e.stateNode,r,i),Ua(e,i),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ii&&(e=Error(a(422),{cause:r}),Vi(_i(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=_i(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Qs(n.stateNode,r,e),Ua(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=$s(i),ec(i,e,n,r),Ua(n,i),!1}n=n.return}while(n!==null);return!1}var nc=Error(a(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Zi(t),r=So(e,t,n,o,a,i),s=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(B&&s&&ki(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref){if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&_a(t,null),Qa(),ao(t)):(_a(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ga();return a=a===null?null:{parent:ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&_a(t,null),Qa(),io(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Fa(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(ro(t),(e=Ni)?(e=cf(e,Fi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),i){if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(rc||Yi(e,t,n,!1),i=(n&e.childLanes)!==0,rc||i){if(r=Bl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),vu(r,e,s),nc;Au(),t=fc(e,t,n)}else e=o.treeContext,Ni=ff(s.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=dc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return Zi(t),n=So(e,t,n,r,void 0,i),r=Eo(),e!==null&&!rc?(Do(e,t,i),kc(e,t,i)):(B&&r&&ki(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=wo(t,r,n,i),Co(e),r=Eo(),e!==null&&!rc?(Do(e,t,a),kc(e,t,a)):(B&&r&&ki(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ra(t),o=n.contextType,a.context=typeof o==`object`&&o?Qi(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Us.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=Qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),La=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||La?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=La||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,za(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=Qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),La=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||La||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=La||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Fa(t,e.child,null,i),t.child=Fa(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return zi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:va()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function Sc(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(so.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?no(t):ao(t),(e=Ni)?(e=cf(e,Fi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Li(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(ao(t),i=t.mode,c=wc({mode:`hidden`,children:c},i),r=fi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(no(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,i=t.mode,r=wc({mode:`visible`,children:r.children},i),c=fi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Fa(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Bl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),vu(s,e,r),nc;lf(c)||Au(),t=Tc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=ff(c.nextSibling),Mi=t,B=!0,Pi=null,Fi=!1,e!==null&&ji(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return i?(ao(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,i,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(i=c.cachePool,i===null?i=va():(l=ia._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Fa(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function Dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,I(so,o),ic(e,t,r,n),r=B?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Yi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Xi(e)))}function jc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Gi(t,ia,e.memoizedState.cache),zi();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(so,so.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Gi(t,ia,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}}else rc=!1,B&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ta(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===S){t.tag=11,t=ac(null,t,e,r,n);break a}if(i===T){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(a(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ks(r,t.pendingProps),_c(e,t,r,i,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,za(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,ia,r),r!==o.cache&&Ji(t,[ia],n,!0),Ga(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}if(r!==i){i=_i(Error(a(424)),t),Vi(i),t=vc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=ff(e.firstChild),Mi=t,B=!0,Pi=null,Fi=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===i){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(n=t.type,e=t.pendingProps,r=Wd(se.current).createElement(n),r[ot]=t,r[R]=e,Rd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&B&&(r=t.stateNode=gf(t.type,t.pendingProps,se.current),Mi=t,Fi=!0,i=Ni,tf(t.type)?(pf=i,Ni=ff(r.firstChild)):Ni=i),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((i=r=Ni)&&(r=of(r,t.type,t.pendingProps,Fi),r===null?i=!1:(t.stateNode=r,Mi=t,Ni=ff(r.firstChild),Fi=!1,i=!0)),i||Li(t)),de(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(i,o)?r=null:s!==null&&qd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=So(e,t,To,null,null,n),np._currentValue=i),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=Ni)&&(n=sf(n,t.pendingProps,Fi),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Li(t)),null;case 13:return Sc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Zi(t),i=Qi(i),r=r(i),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(ia),e===null?(i=ga(),i===null&&(i=Bl,o=aa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ra(t),Gi(t,ia,i)):((e.lanes&n)!==0&&(za(e,t),Ka(t,null,null,n),Ga()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Gi(t,ia,r),r!==i.cache&&Ji(t,[ia],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Gi(t,ia,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ea=Sa,ba}}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t)){if(Du())e.flags|=8192;else throw Ea=Sa,ba}}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,Ql|=t)}function Lc(e,t){if(!B)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function W(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(t),null;case 1:return W(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ia),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(H(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),W(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(W(t),Pc(t,i,null,r,n)):(W(t),Fc(t,o))):o?o===e.memoizedState?(W(t),t.flags&=-16777217):(Nc(t),W(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),W(t),Pc(t,i,e,r,n)),null;case 27:if(fe(t),n=se.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return W(t),null}e=ae.current,H(t)?Ri(t,e):(e=gf(i,r,n),t.stateNode=e,Nc(t))}return W(t),null;case 5:if(fe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return W(t),null}if(o=ae.current,H(t))Ri(t,o);else{var s=Wd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[ot]=t,o[R]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Rd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return W(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=se.current,H(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Mi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Li(t,!0)}else e=Wd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return W(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=H(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ot]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(a(558))}return W(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=H(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[ot]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),i=!1}else i=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),W(t),null);case 4:return ue(),e===null&&Y(t.stateNode.containerInfo),W(t),null;case 10:return Ki(t.type),W(t),null;case 19:if(F(so),r=t.memoizedState,r===null)return W(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Lc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return I(so,so.current&1|2),B&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>iu&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=co(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!B)return W(t),null}else 2*Te()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(W(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=so.current,I(so,i?n&1|2:n&1),B&&Di(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ia),W(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function zc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ia),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(oo(t),t.alternate===null)throw Error(a(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(so),null;case 4:return ue(),null;case 10:return Ki(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&F(ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ia),null;case 25:return null;default:return null}}function Bc(e,t){switch(Ai(t),t.tag){case 3:Ki(ia),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:F(so);break;case 10:Ki(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&F(ha);break;case 24:Ki(ia)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Ju(e,e.return,t)}}}function Wc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[R]=t}catch(t){Ju(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[ot]=e,t[R]=n}catch(t){Ju(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Hd=dp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ud={focusedElem:e,selectionRange:n},dp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ja(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,!!(n.subtreeFlags&8772)):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;tf(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),_f(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null){if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}}break;case 18:cl!==null&&(ll?(e=cl,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):nf(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Ju(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Ju(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(a(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(tf(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(a(160));dl(o,s,i),cl=null,ll=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Rd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Rd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Rd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Kf(i,e.type,e.stateNode)}else e.stateNode=Bf(i,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(i,e.type,e.stateNode):Bf(i,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){i=e.stateNode;try{Wt(i,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Jc(e,i,n===null?i:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Wf=null,i=_l,_l=bf(t.containerInfo),gl(t,e),_l=i,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Ju(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=bf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||i,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Qc(e,Xc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(a(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:_f(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)qa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&oa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&Yf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=bf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Rl={getCacheForType:function(e){var t=Qi(ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(ia).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,G=0,Bl=null,K=null,q=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return G&2&&q!==0?q&-q:M.T===null?rt():hd()}function _u(){if(Zl===0){if(!(q&536870912)||B){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),Zl=e}else Zl=536870912}return e=eo.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Bl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,q,Zl,!1)),Ye(e,n),(!(G&2)||e!==Bl)&&(e===Bl&&(!(G&2)&&(Yl|=n),ql===4&&Su(e,q,Zl,!1)),sd(e))}function yu(e,t,n){if(G&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ge(e,t),i=r?Nu(e,t):ju(e,t,!0),o=r;do{if(i===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n)){i=ju(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,i=4;break a}o=eu,eu=i,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=nu+300-Te(),10<i)){if(Su(r,t,Zl,!Ul),We(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Xd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),i);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},Ml(t,a,d);var m=(a&62914560)===a?nu-Te():(a&4194048)===a?ru-Te():0;if(m=Zf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Cu(){return G&6?!0:(cd(0,!1),!1)}function wu(){if(K!==null){if(Vl===0)var e=K.return;else e=K,Wi=Ui=null,Oo(e),ka=null,Aa=0,e=K;for(;e!==null;)Bc(e.alternate,e),e=e.return;K=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Bl=e,K=n=li(e.current,null),q=t,Vl=0,Hl=null,Ul=!1,Wl=Ge(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,$r(),n}function Eu(e,t){U=null,M.H=Rs,t===ya||t===xa?(t=Da(),Vl=3):t===ba?(t=Da(),Vl=4):Vl=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,K===null&&(ql=1,Xs(e,_i(t,e.current)))}function Du(){var e=eo.current;return e===null?!0:(q&4194048)===q?to===null:(q&62914560)===q||q&536870912?e===to:!1}function Ou(){var e=M.H;return M.H=Rs,e===null?Rs:e}function ku(){var e=M.A;return M.A=Rl,e}function Au(){ql=4,Ul||(q&4194048)!==q&&eo.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Bl===null||Su(Bl,q,Zl,!1)}function ju(e,t,n){var r=G;G|=2;var i=Ou(),a=ku();(Bl!==e||q!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&K!==null){var s=K,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,G=r,M.H=i,M.A=a,K===null&&(Bl=null,q=0,$r()),o}function Mu(){for(;K!==null;)Fu(K)}function Nu(e,t){var n=G;G|=2;var r=Ou(),i=ku();Bl!==e||q!==t?(au=null,iu=Te()+500,Tu(e,t)):Wl=Ge(e,t);a:do try{if(Vl!==0&&K!==null){t=K;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(Ca(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Bl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Ca(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Jf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(a(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Wi=Ui=null,M.H=r,M.A=i,G=n,K===null?(Bl=null,q=0,$r(),ql):0}function Pu(){for(;K!==null&&!Ce();)Fu(K)}function Fu(e){var t=Mc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:Oo(t);default:Bc(n,t),t=K=ui(t,Kl),t=Mc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Lu(e,t,n,r){Wi=Ui=null,Oo(t),ka=null,Aa=0;var i=t.return;try{if(tc(e,i,t,n,q)){ql=1,Xs(e,_i(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;ql=1,Xs(e,_i(n,e.current)),K=null;return}t.flags&32768?(B||r===1?e=!0:Wl||q&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Rc(t.alternate,t,Kl);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);ql=6,K=null}function Bu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(G&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Qr,Ze(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=0),lu=t,cu=e,uu=n,du=o,fu=i,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(ke,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,s=G,G|=4;try{al(e,t,n)}finally{G=s,N.p=i,M.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=G;G|=4;try{vl(t,e);var a=Ud,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Hd,Ud=Hd=null}finally{G=i,N.p=r,M.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=G;G|=4;try{ol(e,t.alternate,t)}finally{G=i,N.p=r,M.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,we();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=nt(uu),r=M.T,i=N.p;try{N.p=32>n?32:n,M.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,G&6)throw Error(a(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,cd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{N.p=i,M.T=r,Wu(e,t)}}function qu(e,t,n){t=_i(n,t),t=Qs(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(Ye(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=_i(n,e),n=$s(2),r=Va(t,n,2),r!==null&&(ec(n,r,t,e),Ye(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(ql===4||ql===3&&(q&62914560)===q&&300>Te()-nu?!(G&2)&&Tu(e,0):Xl|=n,Ql===q&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=qe()),e=ni(e,t),e!==null&&(Ye(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return xe(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=q,a=We(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,pd(r,a))}r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Yd()&&(e=od);for(var t=Te(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=q,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Se(r),nt(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=fd.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=q;return r=We(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){$d(function(){G&6?xe(De,ld):ud()})}function hd(){if(od===0){var e=la;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[R]||null).action),o=r.submitter;o&&(t=(t=o[R]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<qr.length;yd++){var bd=qr[yd];Jr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Y(e){if(!e[Td]){e[Td]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Dd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=ht(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}on(function(){var r=a,i=en(n),o=[];a:{var c=Kr.get(e);if(c!==void 0){var l=bn,u=e;switch(e){case`keypress`:if(hn(n)===0)break a;case`keydown`:case`keyup`:l=Rn;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Bn;break;case zr:case Br:case Vr:l=An;break;case Gr:l=Vn;break;case`scroll`:case`scrollend`:l=Sn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=zn;break;case`toggle`:case`beforetoggle`:l=Un}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Od(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ad,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&jd(o,c,l,d,!1),u!==null&&f!==null&&jd(o,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c)){if(ur)v=yr;else{v=_r;var y=gr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Jt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&z(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(o,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(o,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,$n=!0)),y=kd(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),vd(o,e,r,n,i)}Cd(o,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=sn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
|
|
10
|
+
`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,i.name,i,null),Id(e,t,`formEncType`,i.formEncType,i,null),Id(e,t,`formMethod`,i.formMethod,i,null),Id(e,t,`formTarget`,i.formTarget,i,null)):(Id(e,t,`encType`,i.encType,i,null),Id(e,t,`method`,i.method,i,null),Id(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:J(`beforetoggle`,e),J(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Ot(e,n,r))}}function Ld(e,t,n,r,i,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[R]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Id(e,t,o,s,n,null)}}i&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:J(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Id(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in J(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Id(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in J(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Id(e,t,s,c,n,null)}Ut(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Id(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Id(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Id(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Id(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Id(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Id(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Id(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Id(e,t,s,i,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Id(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Id(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Id(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Id(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Bd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Bd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Kd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function qd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e!==Jd&&(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body)}n=i}while(n);Lp(t)}function rf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function af(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:af(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function ff(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function gf(e,t,n){switch(t=Wd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=N.d;N.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=Cu();return e||t}function Cf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}vf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!vf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=vt(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);yt(c),Rd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=vt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=p({src:e,async:!0},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),yt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=vt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),yt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var i=(i=se.current)?bf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Pf(n.href),n=vt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pf(n.href);var o=vt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vf.set(e,n),o||Lf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Rf(n),n=vt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pf(e){return`href="`+Rt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Rd(t,`link`,n),yt(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Rt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Rd(r,`style`,i),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pf(n.href);var o=e.querySelector(Ff(i));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=If(n),(i=vf.get(i))&&Hf(r,i),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(i=e.querySelector(zf(o)))?(t.instance=i,yt(i),i):(r=n,(i=vf.get(o))&&(r=p({},n),Uf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),yt(i),Rd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=If(r),(i=vf.get(i))&&Hf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var np={$$typeof:x,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function rp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function ap(e){return e?(e=ai,e):ai}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=Ba(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(vu(n,e,t),Ha(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&vu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=gu();t=tt(t);var n=ni(e,t);n!==null&&vu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,mp(e,t,n,r)}finally{N.p=a,M.T=i}}function pp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,mp(e,t,n,r)}finally{N.p=a,M.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)Dd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}sd(a),!(G&6)&&(iu=Te()+500,cd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&vu(s,a,2),Cu(),cp(a,2)}if(a=hp(r),a===null&&Dd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function hp(e){return e=en(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=ht(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return gp=e,null}function vp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=ht(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){up(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,it(e.priority,function(){up(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=gt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(_p(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[R]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[R]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;op(n,gu(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),Cu(),t[st]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.8`)throw Error(a(527,Vp,`19.2.8`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Pe=Up.inject(Hp),Fe=Up}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ip(e,1,!1,null,null,n,r,null,i,s,c,Rp),e[st]=t.current,Y(e),new zp(t)}})),ut=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=lt()})),dt=50,ft=new Map,pt=new Set,mt=e=>{pt.has(e)||(pt.add(e),console.warn(`[intlayer] \`Intl.${e}\` is not available in this JavaScript engine. A degraded fallback is used instead. On React Native, load a polyfill (e.g. \`@formatjs/intl-${e.toLowerCase()}/polyfill\`) before rendering your app.`))},ht={DisplayNames:class{of(e){return e}},ListFormat:class{format(e){return Array.from(e).join(`, `)}formatToParts(e){return Array.from(e).flatMap((e,t)=>t===0?[{type:`element`,value:e}]:[{type:`literal`,value:`, `},{type:`element`,value:e}])}},Segmenter:class{segment(e){let t=0;return Array.from(e).map(e=>{let n=t;return t+=e.length,{segment:e,index:n}})}}},gt=e=>{let t=Intl[e];return typeof t==`function`?t:(mt(e),ht[e])};function _t(e,t,n){let r=t??Ce?.defaultLocale,i=`${r}|${n?JSON.stringify(n):``}`,a=e,o=ft.get(a);o||(o=new Map,ft.set(a,o));let s=o.get(i);if(!s){let t=typeof e==`string`?gt(e):e;if(typeof t!=`function`)throw Error(`[intlayer] \`Intl.${String(e)}\` is not available in this JavaScript engine and has no fallback. Load the matching polyfill before formatting.`);o.size>dt&&o.clear(),s=new t(r,n),o.set(i,s)}return s}var vt={Collator:function(e,t){return _t(`Collator`,e,t)},DateTimeFormat:function(e,t){return _t(`DateTimeFormat`,e,t)},DisplayNames:function(e,t){return _t(`DisplayNames`,e,t)},ListFormat:function(e,t){return _t(`ListFormat`,e,t)},NumberFormat:function(e,t){return _t(`NumberFormat`,e,t)},PluralRules:function(e,t){return _t(`PluralRules`,e,t)},RelativeTimeFormat:function(e,t){return _t(`RelativeTimeFormat`,e,t)},Segmenter:function(e,t){return _t(`Segmenter`,e,t)}},yt=`https://back.intlayer.org`,bt=`modulepreload`,xt=function(e){return`/`+e},St={},Ct=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=xt(e,n),e=i(e),e in St)return;St[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:bt,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},wt=(e,t)=>{let n=typeof t==`object`&&t?t.locale:t;return f(e,t,p(n))},Tt=e=>typeof e==`object`&&e?.key!==void 0&&e?.props!==void 0,Et=(e,t)=>e.every((e,n)=>t[n]&&t[n].key===e.key&&t[n].type===e.type),Dt=e=>{if(!e||typeof e!=`string`)return``;let t=e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},Ot=[`Arab`,`Hebr`,`Thaa`,`Syrc`,`Mand`,`Adlm`,`Rohg`,`Nkoo`],kt=e=>{if(!e)return`ltr`;try{let t=new Intl.Locale(e);if(`getTextInfo`in t)return t.getTextInfo().direction;if(`textInfo`in t)return t.textInfo.direction;let n=t.maximize();return Ot.includes(n.script??``)?`rtl`:`ltr`}catch{return`ltr`}},At=(e,t=e)=>new vt.DisplayNames(t,{type:`language`}).of(e)??`Unknown locale`,jt=(e,t,n)=>{let r=e,i=null,a=[];if(t.length===0)return n;try{for(let e=0;e<t.length;e++){let o=t[e];if(i=r,(o?.type===`object`||o?.type===`array`)&&(a=[o.key],(!r[o.key]||typeof r[o.key]!=`object`)&&(r[o.key]={}),r=r[o.key]),(o?.type===`translation`||o?.type===`enumeration`||o?.type===`plural`||o?.type===`gender`||o?.type===`select`)&&(a=[o.type,o.key],(!r[o.type]||typeof r[o.type]!=`object`)&&(r[o.type]={}),(!r[o.type][o.key]||typeof r[o.type][o.key]!=`object`)&&(r[o.type][o.key]={}),r=r[o.type][o.key]),(o?.type===`enumeration`||o?.type===`plural`||o?.type===`condition`)&&o.type!==`enumeration`&&o.type!==`plural`&&(a=[o.type,o.key],r=r[o.type][o.key]),(o?.type===`markdown`||o?.type===`html`||o?.type===`insertion`)&&(a=[o.type],r[o.type]??(r[o.type]=``),r=r[o.type]),o?.type===`file`&&(a=[`content`],r=r.content),e===t.length-1&&i&&a.length>0){let e=i;for(let t of a.slice(0,-1))e=e[t];let t=a[a.length-1];if(n===void 0){if(Array.isArray(e)){let n=Number(t);!Number.isNaN(n)&&n>=0&&n<e.length&&e.splice(n,1)}else delete e[t]}else e[t]=n}}return e}catch(r){return console.error(`Cannot edit dictionary by key path`,{dictionaryContent:e,keyPath:t,newValue:n},r),e}},Mt=(e,t,n)=>{let r=structuredClone(e);for(let e of t)n&&r?.nodeType===`translation`&&(r=r?.[ge]?.[n]),(e.type===`object`||e.type===`array`)&&(r=r?.[e.key]),(e.type===`translation`||e.type===`condition`||e.type===`enumeration`||e.type===`plural`||e.type===`gender`||e.type===`select`)&&(r=r?.[e.type]?.[e.key]),(e.type===`markdown`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(r=r?.[e.type]);return r},Nt=(e,t,n)=>{let r=structuredClone(n);switch(e){case ge:return{nodeType:ge,[ge]:Object.assign({},...t.map(e=>({[e]:structuredClone(r)??``})))};case h:return{nodeType:h,[h]:{1:r??``}};case _:return{nodeType:_,[_]:{one:r??``,other:r??``}};case N:return{nodeType:N,[N]:{true:r??``,false:r??``}};case D:return{nodeType:D,[D]:{male:r??``,female:r??``,fallback:r??``}};case C:return{nodeType:C,[C]:{case1:r??``,fallback:r??``}};case it:return{nodeType:it,[it]:{insertion:r??``}};case ce:return{nodeType:ce,[ce]:{dictionaryKey:``}};case l:return{nodeType:l,[l]:r??``};case ie:return{nodeType:ie,[ie]:r??``,customComponents:[]};case x:return{nodeType:x,[x]:r??``};case ue:return{newKey:r??``};case k:return[r??``];case fe:return r??``;case oe:return r??0;case A:return r??!0;default:return r??``}},Pt=e=>{if(typeof e==`string`)return``;if(typeof e==`number`)return 0;if(typeof e==`boolean`)return!0;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`html`?Pt(n):t.nodeType===`nested`?`dictionary-key`:t.nodeType===`file`?`file/path`:t.nodeType===`markdown`?Pt(n):n}if(!e||typeof e!=`object`)return e;if(Array.isArray(e))return e.map(Pt);let t=Object.entries(e).map(([e,t])=>[e,Pt(t)]);return Object.fromEntries(t)},Ft=e=>{if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`markdown`||t.nodeType===`html`?n:t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`file`?n[Object.keys(n)[0]]:t.nodeType===`nested`?void 0:n}return!e||typeof e!=`object`?e:Array.isArray(e)?e[0]:e},It=e=>typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`string`,Lt={[ge]:!0,[h]:!0,[_]:!0,[N]:!0,[it]:!0,[x]:!0,[ue]:!0,[k]:!0,[ce]:!0,[We]:!0,[T]:!0,[me]:!0,[l]:!0,[ie]:!0,[fe]:!0,[oe]:!0,[A]:!0,[D]:!0,[C]:!0,[y]:!0,[ne]:!0},Rt=e=>Object.hasOwn(Lt,e),zt=e=>{if(typeof e==`string`)return fe;if(It(e)){let t=e.nodeType;return Rt(t)?t:ne}return Array.isArray(e)?k:Tt(e)?We:typeof e==`number`?oe:typeof e==`boolean`?A:e&&typeof e==`object`?ue:e===null?y:ne},Bt=(e,t,n)=>{let r=e,i=null,a=null;for(let e of n)i=r,(e.type===`object`||e.type===`array`)&&(a=e.key,r=r[e.key]),(e.type===`translation`||e.type===`enumeration`||e.type===`plural`||e.type===`condition`||e.type===`gender`||e.type===`select`)&&(a=e.type,r=r[e.type][e.key]),(e.type===`markdown`||e.type===`reactNode`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(a=e.type,r=r[e.type]);if(i&&a!==null){if(Array.isArray(i))i[a]=r;else{let e={};for(let n of Object.keys(i))n===a&&t!==void 0?e[t]=r:e[n]=i[n];Object.keys(i).forEach(e=>{delete i[e]}),Object.assign(i,e)}}return e},z=e(r(),1),Vt=(e,t)=>{let{locale:n,variant:r}=(0,z.useContext)(u)??{},i=t??n,a=typeof i==`object`&&i?`${i.locale??``}|${Pe(i)}`:i;return(0,z.useMemo)(()=>wt(e,i),[e.key,a])},Ht=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{defaultLocale:n,locales:r}=Ce??{},{locale:i,setLocale:a,isCookieEnabled:o}=(0,z.useContext)(u)??{};return{locale:i,defaultLocale:n,availableLocales:r,setLocale:(0,z.useCallback)(n=>{if(!r?.map(String).includes(n)){console.error(`Locale ${n} is not available`);return}a(n),I(n,e??o??!0),t?.(n)},[r,t,a,e])}},Ut=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wt=/^[\\/]{2}/;function Gt(e,t){return t+e.replace(/\\/g,`/`)}var Kt=`popstate`;function qt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Jt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return $t(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:en(t)}return nn(t,n,null,e)}function Yt(e,t){if(e===!1||e==null)throw Error(t)}function Xt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Zt(){return Math.random().toString(36).substring(2,10)}function Qt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function $t(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?tn(t):t,state:n,key:t&&t.key||r||Zt(),mask:i}}function en({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 tn(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 nn(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=qt(e)?e:$t(h.location,e,t);n&&n(r,e),l=u()+1;let d=Qt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=qt(e)?e:$t(h.location,e,t);n&&n(r,e),l=u();let i=Qt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return rn(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Kt,d),c=e,()=>{i.removeEventListener(Kt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function rn(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),Yt(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:en(t);return i=i.replace(/ $/,`%20`),!n&&Wt.test(i)&&(i=r+i),new URL(i,r)}function an(e,t,n=`/`){return on(e,t,n,!1)}function on(e,t,n,r,i){let a=Tn((typeof t==`string`?tn(t):t).pathname||`/`,n);if(a==null)return null;let o=i??sn(e),s=null,c=wn(a);for(let e=0;s==null&&e<o.length;++e)s=bn(o[e],c,r);return s}function sn(e){let t=cn(e);return un(t),t}function cn(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Yt(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Nn([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Yt(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),cn(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:vn(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Cn(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ln(e.path))a(e,t,!0,n)}),t}function ln(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ln(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function un(e){e.sort((e,t)=>e.score===t.score?yn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var dn=/^:[\w-]+$/,fn=3,pn=2,mn=1,hn=10,gn=-2,_n=e=>e===`*`;function vn(e,t){let n=e.split(`/`),r=n.length;return n.some(_n)&&(r+=gn),t&&(r+=pn),n.filter(e=>!_n(e)).reduce((e,t)=>e+(dn.test(t)?fn:t===``?mn:hn),r)}function yn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function bn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Sn(u,l,s.matcher,s.compiledParams):xn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Nn([a,d.pathname]),pathnameBase:Fn(Nn([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Nn([a,d.pathnameBase]))}return o}function xn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Cn(e.path,e.caseSensitive,e.end);return Sn(e,t,n,r)}function Sn(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Pn(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Pn(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Cn(e,t=!1,n=!0){Xt(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,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function wn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Xt(!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 Tn(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 En(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?tn(e):e,a;return n?(n=Mn(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Dn(n.substring(1),`/`):Dn(n,t)):a=t,{pathname:a,search:In(r),hash:Ln(i)}}function Dn(e,t){let n=Pn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function On(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 <Link to="..."> and the router will parse it for you.`}function kn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function An(e){let t=kn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function jn(e,t,n,r=!1){let i;typeof e==`string`?i=tn(e):(i={...e},Yt(!i.pathname||!i.pathname.includes(`?`),On(`?`,`pathname`,`search`,i)),Yt(!i.pathname||!i.pathname.includes(`#`),On(`#`,`pathname`,`hash`,i)),Yt(!i.search||!i.search.includes(`#`),On(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=En(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Mn=e=>e.replace(/[\\/]{2,}/g,`/`),Nn=e=>Mn(e.join(`/`));function Pn(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Fn=e=>Pn(e).replace(/^\/*/,`/`),In=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ln=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Rn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Bn(e){return Nn(e.map(e=>e.route.path).filter(Boolean))||`/`}var Vn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Hn(e,t){let n=e;if(typeof n!=`string`||!Ut.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Vn)try{let e=new URL(window.location.href),r=Wt.test(n)?new URL(Gt(n,e.protocol)):new URL(n),a=Tn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Xt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Un=new URL(`http://localhost`);function Wn(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Un)}catch{return Un}}function Gn(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Kn(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qn(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Gn(i,n),s=!Gn(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Kn(e,i)||!Gn(i,a)))throw Error(`External navigation is not allowed`)}var Jn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Jn);var Yn=[`GET`,...Jn];new Set(Yn);var Xn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Zn(e){try{return Xn.includes(new URL(e).protocol)}catch{return!1}}var Qn=z.createContext(null);Qn.displayName=`DataRouter`;var $n=z.createContext(null);$n.displayName=`DataRouterState`;var er=z.createContext(!1);function tr(){return z.useContext(er)}var nr=z.createContext({isTransitioning:!1});nr.displayName=`ViewTransition`;var rr=z.createContext(new Map);rr.displayName=`Fetchers`;var ir=z.createContext(null);ir.displayName=`Await`;var ar=z.createContext(null);ar.displayName=`Navigation`;var or=z.createContext(null);or.displayName=`Location`;var sr=z.createContext({outlet:null,matches:[],isDataRoute:!1});sr.displayName=`Route`;var cr=z.createContext(null);cr.displayName=`RouteError`;var lr=`REACT_ROUTER_ERROR`,ur=`REDIRECT`,dr=`ROUTE_ERROR_RESPONSE`;function fr(e){if(e.startsWith(`${lr}:${ur}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function pr(e){if(e.startsWith(`${lr}:${dr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Rn(t.status,t.statusText,t.data)}catch{}}function mr(e,{relative:t}={}){Yt(hr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=z.useContext(ar),{hash:i,pathname:a,search:o}=xr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Nn([n,a])),r.createHref({pathname:s,search:o,hash:i})}function hr(){return z.useContext(or)!=null}function gr(){return Yt(hr(),`useLocation() may be used only in the context of a <Router> component.`),z.useContext(or).location}var _r=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function vr(e){z.useContext(ar).static||z.useLayoutEffect(e)}function yr(){let{isDataRoute:e}=z.useContext(sr);return e?Rr():br()}function br(){Yt(hr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=z.useContext(Qn),{basename:t,navigator:n}=z.useContext(ar),{matches:r}=z.useContext(sr),{pathname:i}=gr(),a=JSON.stringify(An(r)),o=z.useRef(!1);return vr(()=>{o.current=!0}),z.useCallback((r,s={})=>{if(Xt(o.current,_r),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=jn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Nn([t,c.pathname])),qn(typeof r==`string`?r:en(r),n.createHref(c),Wn(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}z.createContext(null);function xr(e,{relative:t}={}){let{matches:n}=z.useContext(sr),{pathname:r}=gr(),i=JSON.stringify(An(n));return z.useMemo(()=>jn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Sr(e,t){return Cr(e,t)}function Cr(e,t,n){Yt(hr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=z.useContext(ar),{matches:i}=z.useContext(sr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Br(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) 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.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=gr(),d;if(t){let e=typeof t==`string`?tn(t):t;Yt(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):an(e,{pathname:p});Xt(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Xt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Ar(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Nn([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Nn([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?z.createElement(or.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function wr(){let e=Lr(),t=zn(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},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=z.createElement(z.Fragment,null,z.createElement(`p`,null,`💿 Hey developer 👋`),z.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,z.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,z.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),z.createElement(z.Fragment,null,z.createElement(`h2`,null,`Unexpected Application Error!`),z.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?z.createElement(`pre`,{style:i},n):null,o)}var Tr=z.createElement(wr,null),Er=class extends z.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=pr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:z.createElement(sr.Provider,{value:this.props.routeContext},z.createElement(cr.Provider,{value:e,children:this.props.component}));return this.context?z.createElement(Or,{error:e},t):t}};Er.contextType=er;var Dr=new WeakMap;function Or({children:e,error:t}){let{basename:n,navigator:r}=z.useContext(ar);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=fr(t.digest);if(e){let i=Dr.get(t);if(i)throw i;let a=Hn(e.location,n),o=a.absoluteURL||a.to;if(qn(e.location,o,Wn(r),`allow-explicit`),Zn(o))throw Error(`Invalid redirect location`);if(Vn&&!Dr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Dr.set(t,n),n}}return z.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function kr({routeContext:e,match:t,children:n}){let r=z.useContext(Qn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),z.createElement(sr.Provider,{value:e},n)}function Ar(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Yt(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Bn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Tr,o&&(s<0&&c===0?(Br(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?z.createElement(n.route.Component,null):n.route.element?n.route.element:e,z.createElement(kr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?z.createElement(Er,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function jr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mr(e){let t=z.useContext(Qn);return Yt(t,jr(e)),t}function Nr(e){let t=z.useContext($n);return Yt(t,jr(e)),t}function Pr(e){let t=z.useContext(sr);return Yt(t,jr(e)),t}function Fr(e){let t=Pr(e),n=t.matches[t.matches.length-1];return Yt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ir(){return Fr(`useRouteId`)}function Lr(){let e=z.useContext(cr),t=Nr(`useRouteError`),n=Fr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Rr(){let{router:e}=Mr(`useNavigate`),t=Fr(`useNavigate`),n=z.useRef(!1);return vr(()=>{n.current=!0}),z.useCallback(async(r,i={})=>{Xt(n.current,_r),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var zr={};function Br(e,t,n){!t&&!zr[e]&&(zr[e]=!0,Xt(!1,n))}z.memo(Vr);function Vr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Cr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Hr(e){Yt(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ur({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Yt(!hr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=z.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=tn(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=z.useMemo(()=>{let e=Tn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Xt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:z.createElement(ar.Provider,{value:c},z.createElement(or.Provider,{children:t,value:h}))}function Wr({children:e,location:t}){return Sr(Gr(e),t)}z.Component;function Gr(e,t=[]){let n=[];return z.Children.forEach(e,(e,r)=>{if(!z.isValidElement(e))return;let i=[...t,r];if(e.type===z.Fragment){n.push.apply(n,Gr(e.props.children,i));return}Yt(e.type===Hr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Yt(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Gr(e.props.children,i)),n.push(a)}),n}var Kr=`get`,qr=`application/x-www-form-urlencoded`;function Jr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yr(e){return Jr(e)&&e.tagName.toLowerCase()===`button`}function Xr(e){return Jr(e)&&e.tagName.toLowerCase()===`form`}function Zr(e){return Jr(e)&&e.tagName.toLowerCase()===`input`}function Qr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $r(e,t){return e.button===0&&(!t||t===`_self`)&&!Qr(e)}var ei=null;function ti(){if(ei===null)try{new FormData(document.createElement(`form`),0),ei=!1}catch{ei=!0}return ei}var ni=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ri(e){return e!=null&&!ni.has(e)?(Xt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qr}"`),null):e}function ii(e,t){let n,r,i,a,o;if(Xr(e)){let o=e.getAttribute(`action`);r=o?Tn(o,t):null,n=e.getAttribute(`method`)||Kr,i=ri(e.getAttribute(`enctype`))||qr,a=new FormData(e)}else if(Yr(e)||Zr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Tn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Kr,i=ri(e.getAttribute(`formenctype`))||ri(o.getAttribute(`enctype`))||qr,a=new FormData(o,e),!ti()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Kr,r=null,i=qr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ai(e,t){if(e===!1||e==null)throw Error(t)}function oi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Tn(i.pathname,t)===`/`?`${Pn(t)}/_root.${r}`:`${Pn(i.pathname)}.${r}`,i}async function si(e,t){if(e.id in t)return t[e.id];try{let n=await Ct(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ci(e){return e!=null&&typeof e.page==`string`}function li(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ui(e,t,n){return hi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await si(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(li).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function di(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fi(e,t,{includeHydrateFallback:n}={}){return pi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pi(e){return[...new Set(e)]}function mi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ci(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gi(){let e=z.useContext(Qn);return ai(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _i(){let e=z.useContext($n);return ai(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vi=z.createContext(void 0);vi.displayName=`FrameworkContext`;function yi(){let e=z.useContext(vi);return ai(e,`You must render this element inside a <HydratedRouter> element`),e}function bi(e,t){let n=z.useContext(vi),[r,i]=z.useState(!1),[a,o]=z.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=z.useRef(null);z.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),z.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:xi(s,p),onBlur:xi(c,m),onMouseEnter:xi(l,p),onMouseLeave:xi(u,m),onTouchStart:xi(d,p)}]:[a,f,{}]:[!1,f,{}]}function xi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Si({page:e,...t}){let n=tr(),{nonce:r}=yi(),{router:i}=gi(),a=z.useMemo(()=>an(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?z.createElement(wi,{page:e,matches:a,...t}):z.createElement(Ti,{page:e,matches:a,...t})):null}function Ci(e){let{manifest:t,routeModules:n}=yi(),[r,i]=z.useState([]);return z.useEffect(()=>{let r=!1;return ui(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wi({page:e,matches:t,...n}){let r=gr(),{future:i}=yi(),{basename:a}=gi(),o=z.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=oi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return z.createElement(z.Fragment,null,o.map(e=>z.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ti({page:e,matches:t,...n}){let r=gr(),{future:i,manifest:a,routeModules:o}=yi(),{basename:s}=gi(),{loaderData:c,matches:l}=_i(),u=z.useMemo(()=>di(e,t,l,a,r,`data`),[e,t,l,a,r]),d=z.useMemo(()=>di(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=z.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=oi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=z.useMemo(()=>fi(d,a),[d,a]),m=Ci(d);return z.createElement(z.Fragment,null,f.map(e=>z.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>z.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>z.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ei(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}z.Component;var Di=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Di&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Oi({basename:e,children:t,useTransitions:n,window:r}){let i=z.useRef();i.current??=Jt({window:r,v5Compat:!0});let a=i.current,[o,s]=z.useState({action:a.action,location:a.location}),c=z.useCallback(e=>{n===!1?s(e):z.startTransition(()=>s(e))},[n]);return z.useLayoutEffect(()=>a.listen(c),[a,c]),z.createElement(Ur,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var ki=z.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=z.useContext(ar),v=typeof l==`string`&&Ut.test(l),y=Hn(l,h);l=y.to;let b=mr(l,{relative:r}),x=gr(),S=null;if(o){let e=jn(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Nn([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=bi(n,p),E=B(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=z.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Ei(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?z.createElement(z.Fragment,null,k,z.createElement(Si,{page:b})):k});ki.displayName=`Link`;var Ai=z.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=xr(a,{relative:c.relative}),d=gr(),f=z.useContext($n),{navigator:p,basename:m}=z.useContext(ar),h=f!=null&&Ri(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Tn(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return z.createElement(ki,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Ai.displayName=`NavLink`;var ji=z.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Kr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=z.useContext(ar),g=Ii(),_=Li(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ut.test(s);return z.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?z.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ji.displayName=`Form`;function Mi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ni(e){let t=z.useContext(Qn);return Yt(t,Mi(e)),t}function B(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=yr(),d=gr(),f=xr(e,{relative:o});return z.useCallback(p=>{if($r(p,t)){p.preventDefault();let t=n===void 0?en(d)===en(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?z.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Pi=0,Fi=()=>`__${String(++Pi)}__`;function Ii(){let{router:e}=Ni(`useSubmit`),{basename:t}=z.useContext(ar),n=Ir(),r=e.fetch,i=e.navigate;return z.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ii(e,t);if(a.navigate===!1){let e=a.fetcherKey||Fi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Li(e,{relative:t}={}){let{basename:n}=z.useContext(ar),r=z.useContext(sr);Yt(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...xr(e||`.`,{relative:t})},o=gr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Nn([n,a.pathname])),en(a)}function Ri(e,{relative:t}={}){let n=z.useContext(nr);Yt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ni(`useViewTransitionState`),i=xr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Tn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Tn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xn(i.pathname,o)!=null||xn(i.pathname,a)!=null}var V=ot(),H=at(),zi=(0,z.createContext)(!0),Bi=()=>(0,z.useContext)(zi),Vi=1,Hi=9e5,Ui=0,Wi=()=>(Ui=(Ui+1)%(2**53-1),Ui.toString()),Gi=new Map,Ki=e=>{if(Gi.has(e))return;let t=setTimeout(()=>{Gi.delete(e),Xi({type:`REMOVE_TOAST`,toastId:e})},Hi);Gi.set(e,t)},qi=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,Vi)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?Ki(n):e.toasts.forEach(e=>{Ki(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},Ji=[],Yi={toasts:[]},Xi=e=>{Yi=qi(Yi,e),Ji.forEach(e=>{e(Yi)})},Zi=({...e})=>{let t=Wi(),n=e=>Xi({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>Xi({type:`DISMISS_TOAST`,toastId:t});return Xi({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}},Qi=()=>{let e=(0,V.c)(5),[t,n]=(0,z.useState)(Yi),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>(Ji.push(n),()=>{let e=Ji.indexOf(n);e>-1&&Ji.splice(e,1)}),e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=[t],e[1]=t,e[2]=i),(0,z.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a={...t,toast:Zi,dismiss:$i},e[3]=t,e[4]=a),a};function $i(e){return Xi({type:`DISMISS_TOAST`,toastId:e})}function ea(){}var ta={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},na=new class{#e=ta;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ra(e){setTimeout(e,0)}var ia=typeof window>`u`||`Deno`in globalThis;function aa(){}function oa(e,t){return typeof e==`function`?e(t):e}function sa(e){return typeof e==`number`&&e>=0&&e!==1/0}function ca(e,t){return Math.max(e+(t||0)-Date.now(),0)}function la(e,t){return typeof e==`function`?e(t):e}function ua(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==fa(o,t.options))return!1}else if(!ma(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function da(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(pa(t.options.mutationKey)!==pa(a))return!1}else if(!ma(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function fa(e,t){return(t?.queryKeyHashFn||pa)(e)}function pa(e){return JSON.stringify(e,(e,t)=>ya(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ma(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!ma(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ma(e[r],t[r]))return!1;return!0}return!1}var ha=Object.prototype.hasOwnProperty;function ga(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=va(e)&&va(t);if(!r&&!(ya(e)&&ya(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ha.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ga(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function _a(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function va(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ya(e){if(!ba(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ba(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ba(e){return Object.prototype.toString.call(e)===`[object Object]`}function xa(e){return new Promise(t=>{na.setTimeout(t,e)})}function Sa(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ga(e,t)}function Ca(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function wa(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ta=Symbol();function Ea(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ta?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Da(e,t){return typeof e==`function`?e(...t):!!e}function Oa(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ka=()=>ia,Aa=()=>ka(),ja=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ma=new class extends ja{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function Na(e){let t;if(e.then(e=>(t=e,e),aa)?.catch?.(aa),t!==void 0)return{data:t}}function Pa(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Fa(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(aa),r}function Ia(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:Fa(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function La(e){return e.state.isPaused}function Ra(e){return e.state.status===`success`}function za(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??La,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[Pa(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Ra,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Ia(e,o,a)]:[])}}function Ba(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?Na(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l!==void 0&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l??Date.now(),...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l??Date.now()}});c&&!d&&!h&&!g&&(l===void 0||l>m.state.dataUpdatedAt)&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(aa)})}var Va=ra;function Ha(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Va,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ua=Ha(),Wa=new class extends ja{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ga(e){return Math.min(1e3*2**e,3e4)}function Ka(e){return(e??`online`)!==`online`||Wa.isOnline()}var qa=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ja(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(aa);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new qa(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ma.isFocused()&&(e.networkMode===`always`||Wa.isOnline())&&e.canRun(),p=()=>Ka(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Aa()?0:3),a=e.retryDelay??Ga,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),xa(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Ya=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sa(this.gcTime)&&(this.#e=na.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Aa()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(na.clearTimeout(this.#e),this.#e=void 0)}};function Xa(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Oa(e,()=>t.signal,()=>n=!0)},u=Ea(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?wa:Ca;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Qa:Za,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Za(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Za(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Qa(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $a=class extends Ya{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=no(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=no(this.options);e.data!==void 0&&(this.setState(to(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Sa(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(aa).catch(aa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>la(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ta||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>la(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ca(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ea(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Xa(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Ja({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof qa&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof qa){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...eo(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...to(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ua.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function eo(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ka(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function to(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function no(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ro=class extends ja{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ao(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oo(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oo(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof la(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!_a(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&so(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||la(this.options.enabled,this.#t)!==la(t.enabled,this.#t)||la(this.options.staleTime,this.#t)!==la(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||la(this.options.enabled,this.#t)!==la(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return _a(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(aa)),t}#h(e){return!Aa()&&la(this.options.enabled,this.#t)!==!1&&sa(e)}#g(){this.#b();let e=la(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ca(this.#r.dataUpdatedAt,e)+1;this.#u=na.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=na.setInterval(()=>{(this.options.refetchIntervalInBackground||Ma.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(na.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(na.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ao(e,t),o=i&&so(e,n,t,r);(a||o)&&(l={...l,...eo(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Sa(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Sa(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:co(e,t),refetch:this.refetch,isEnabled:la(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),_a(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Ua.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function io(e,t){return la(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||la(t.retryOnMount,e)!==!1)}function ao(e,t){return io(e,t)||e.state.data!==void 0&&oo(e,t,t.refetchOnMount)}function oo(e,t,n){if(la(t.enabled,e)!==!1&&la(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&co(e,t)}return!1}function so(e,t,n,r){return(e!==t||la(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&co(e,n)}function co(e,t){return la(t.enabled,e)!==!1&&e.isStaleByTime(la(t.staleTime,e))}var lo=class extends Ya{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||U(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Ja({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Ua.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var uo=class extends ja{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new lo({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=fo(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=fo(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=fo(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=fo(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ua.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>da(t,e))}findAll(e={}){return this.getAll().filter(t=>da(e,t))}notify(e){Ua.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ua.batch(()=>Promise.all(e.map(e=>e.continue().catch(aa))))}};function fo(e){return e.options.scope?.id}var po=class extends ja{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),_a(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&pa(t.mutationKey)!==pa(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??U();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Ua.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},mo=class extends ja{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??fa(r,t),a=this.get(i);return a||(a=new $a({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ua.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ua(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ua(e,t)):t}notify(e){Ua.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ua.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ua.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ho=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new mo,this.#t=e.mutationCache||new uo,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ma.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Wa.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(la(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=oa(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ua.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ua.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ua.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ua.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(aa).catch(aa)}invalidateQueries(e,t={}){return Ua.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ua.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(aa)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(aa)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(la(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(la(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(aa).catch(aa)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(aa).catch(aa)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Wa.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ma(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ma(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=fa(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Ta&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function go(e,{interval:t=1e3,onError:n=ea}={}){if(typeof e!=`function`)throw Error(`argument is not function.`);let r=0,i=null,a=!1,o=!1;return async(...s)=>{if(i=s,!o){for(o=!0;a;)await new Promise(e=>na.setTimeout(e,t));for(;Date.now()<r;)await new Promise(e=>na.setTimeout(e,r-Date.now()));o=!1,a=!0;try{await e(...i)}catch(e){try{n(e)}catch{}}r=Date.now()+t,a=!1}}}var _o=({storage:e,key:t=`REACT_QUERY_OFFLINE_CACHE`,throttleTime:n=1e3,serialize:r=JSON.stringify,deserialize:i=JSON.parse,retry:a})=>{if(e){let o=async n=>{try{let i=await r(n);await e.setItem(t,i);return}catch(e){return e}};return{persistClient:go(async e=>{let t=e,n=await o(t),r=0;for(;n&&t;)r++,t=await a?.({persistedClient:t,error:n,errorCount:r}),t&&(n=await o(t))},{interval:n}),restoreClient:async()=>{let n=await e.getItem(t);if(n)return await i(n)},removeClient:()=>e.removeItem(t)}}return{persistClient:ea,restoreClient:()=>Promise.resolve(void 0),removeClient:ea}},vo=z.createContext(void 0),yo=e=>{let t=z.useContext(vo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},bo=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,H.jsx)(vo.Provider,{value:e,children:t})),xo=z.createContext(!1),So=()=>z.useContext(xo),Co=xo.Provider;function wo(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var To=z.createContext(wo()),Eo=()=>z.useContext(To),Do=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Da(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Oo=e=>{z.useEffect(()=>{e.clearReset()},[e])},ko=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Da(n,[e.error,r])),Ao=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},jo=(e,t)=>e?.suspense&&t.isPending,Mo=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function No(e,t,n){let r=So(),i=Eo(),a=yo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ao(o),Do(o,i,s),Oo(i);let[l]=z.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(z.useSyncExternalStore(z.useCallback(e=>{let t=d?l.subscribe(Ua.batchCalls(e)):aa;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),z.useEffect(()=>{l.setOptions(o)},[o,l]),jo(o,u))throw Mo(o,l,i);if(ko({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Po(e,t){return No(e,ro,t)}function Fo(e,t){let n=yo(t),[r]=z.useState(()=>new po(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(Ua.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(aa)},[r]);if(i.error&&Da(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Io=[`added`,`removed`,`updated`];function Lo(e){return Io.includes(e)}async function Ro({queryClient:e,persister:t,maxAge:n=864e5,buster:r=``,hydrateOptions:i}){try{let a=await t.restoreClient();if(a){if(a.timestamp){let o=Date.now()-a.timestamp>n,s=a.buster!==r;if(o||s)return t.removeClient();Ba(e,a.clientState,i)}else return t.removeClient()}}catch(e){throw await t.removeClient(),e}}async function zo({queryClient:e,persister:t,buster:n=``,dehydrateOptions:r}){let i={buster:n,timestamp:Date.now(),clientState:za(e,r)};await t.persistClient(i)}function Bo(e){let t=e.queryClient.getQueryCache().subscribe(t=>{Lo(t.type)&&zo(e)}),n=e.queryClient.getMutationCache().subscribe(t=>{Lo(t.type)&&zo(e)});return()=>{t(),n()}}var Vo=({children:e,persistOptions:t,onSuccess:n,onError:r,...i})=>{let[a,o]=z.useState(!0),s=z.useRef({persistOptions:t,onSuccess:n,onError:r}),c=z.useRef(!1);return z.useEffect(()=>{s.current={persistOptions:t,onSuccess:n,onError:r}}),z.useEffect(()=>{let e={...s.current.persistOptions,queryClient:i.client};return c.current||(c.current=!0,Ro(e).then(()=>s.current.onSuccess?.()).catch(()=>s.current.onError?.()).finally(()=>{o(!1)})),a?void 0:Bo(e)},[i.client,a]),(0,H.jsx)(bo,{...i,children:(0,H.jsx)(Co,{value:a,children:e})})},Ho=864e5,Uo=`v1`;if(typeof window>`u`){let e=e=>{typeof e==`object`&&e&&`unref`in e&&typeof e.unref==`function`&&e.unref()};na.setTimeoutProvider({setTimeout:(t,n)=>{let r=setTimeout(t,n);return e(r),r},clearTimeout:e=>clearTimeout(e),setInterval:(t,n)=>{let r=setInterval(t,n);return e(r),r},clearInterval:e=>clearInterval(e)})}var Wo={queries:{retry:1,staleTime:3e4,gcTime:Ho,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:0}},Go=_o({storage:typeof window<`u`?{getItem:e=>Promise.resolve(window.localStorage.getItem(e)),setItem:(e,t)=>Promise.resolve(window.localStorage.setItem(e,t)),removeItem:e=>Promise.resolve(window.localStorage.removeItem(e))}:{getItem:()=>Promise.resolve(null),setItem:()=>Promise.resolve(),removeItem:()=>Promise.resolve()},key:`intlayer-rq-cache`}),Ko=e=>e.split(`_`).join(` `),qo=()=>{let e=(0,V.c)(7),{toast:t}=Qi(),n;e[0]===t?n=e[1]:(n=e=>{[(()=>{try{if(typeof e==`string`)return JSON.parse(e);if(e instanceof Error)return JSON.parse(e.message)}catch{}return e})()].flat().forEach(e=>{let n=e?.error??e;if(n?.code===`RATE_LIMIT_EXCEEDED_UNAUTHENTICATED`){t({title:n.message,variant:`error`});return}t({title:Ko(n?.title??e?.title??`Error`),description:n?.message??e?.message??String(n??`An error occurred`),variant:`error`})})},e[0]=t,e[1]=n);let r=n,i;e[2]===t?i=e[3]:(i=e=>{e?.error&&t({title:Ko(e.error.title??e.error.code??`Error`),description:e.error.message??e.error.code??`An error occurred`,variant:`error`}),e?.message&&t({title:e.message,description:e.description,variant:`success`})},e[2]=t,e[3]=i);let a=i,o;return e[4]!==r||e[5]!==a?(o={onError:r,onSuccess:a},e[4]=r,e[5]=a,e[6]=o):o=e[6],o},Jo=({children:e,client:t})=>{let{onError:n,onSuccess:r}=qo(),i=(0,z.useRef)({onSuccess:r,onError:n});i.current={onSuccess:r,onError:n};let a=(0,z.useRef)(t??null);a.current||=new ho({defaultOptions:Wo,mutationCache:new uo});let o=(0,z.useRef)(!1);if(!o.current){o.current=!0;let e=a.current.getMutationCache(),t=e.config.onSuccess,n=e.config.onError;e.config.onSuccess=(e,n,r,a,o)=>{t?.(e,n,r,a,o),i.current.onSuccess?.(e,n,r,a,o)},e.config.onError=(e,t,r,a,o)=>{n?.(e,t,r,a,o),i.current.onError?.(e,t,r,a,o)},e.config.onSettled=(e,t,n,r,i)=>{i.meta?.invalidateQueries&&i.meta.invalidateQueries.forEach(e=>{a.current?.invalidateQueries({queryKey:e})}),i.meta?.resetQueries&&i.meta.resetQueries.forEach(e=>{a.current?.resetQueries({queryKey:e})})}}return t||typeof window>`u`?(0,H.jsx)(bo,{client:a.current,children:e}):(0,H.jsx)(Vo,{client:a.current,persistOptions:{persister:Go,maxAge:Ho,buster:Uo,dehydrateOptions:{shouldDehydrateQuery:e=>e.state.status===`success`}},children:e})},Yo=n({Action:()=>Ws,Close:()=>Gs,Description:()=>Us,Provider:()=>zs,Root:()=>Vs,Title:()=>Hs,Toast:()=>bs,ToastAction:()=>Os,ToastClose:()=>As,ToastDescription:()=>Es,ToastProvider:()=>ss,ToastTitle:()=>Ts,ToastViewport:()=>fs,Viewport:()=>Bs,createToastScope:()=>is}),Xo=e(Xe(),1),Zo=Object.defineProperty,Qo=(e,t)=>Zo(e,`name`,{value:t,configurable:!0}),$o=`ToastProvider`,[es,ts,ns]=Ae(`Toast`),[rs,is]=$e(`Toast`,[ns]),[as,os]=rs($o),ss=Qo(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=z.useState(null),[u,d]=z.useState(0),f=z.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$o}\`. Expected non-empty \`string\`.`),(0,H.jsx)(es.Provider,{scope:t,children:(0,H.jsx)(as,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:z.useCallback(()=>d(e=>e+1),[]),onToastRemove:z.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),cs=`ToastViewport`,ls=[`F8`],us=`toast.viewportPause`,ds=`toast.viewportResume`,fs=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,hotkey:r=ls,label:i=`Notifications ({hotkey})`,...a}=e,o=os(cs,n),s=ts(n),c=z.useRef(null),l=z.useRef(null),u=z.useRef(null),d=z.useRef(null),f=ye(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;z.useEffect(()=>{let e=Qo(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),z.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=Qo(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(us);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=Qo(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(ds);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=Qo(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=Qo(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=z.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Ls(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return z.useEffect(()=>{let e=d.current;if(e){let t=Qo(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Rs(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,H.jsxs)(be,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,H.jsx)(ms,{ref:l,onFocusFromOutsideViewport:()=>{Rs(h({tabbingDirection:`forwards`}))}}),(0,H.jsx)(es.Slot,{scope:n,children:(0,H.jsx)(He.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,H.jsx)(ms,{ref:u,onFocusFromOutsideViewport:()=>{Rs(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),ps=`ToastFocusProxy`,ms=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=os(ps,n);return(0,H.jsx)(Ke,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),hs=`Toast`,gs=`toast.swipeStart`,_s=`toast.swipeMove`,vs=`toast.swipeCancel`,ys=`toast.swipeEnd`,bs=z.forwardRef(Qo(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Me({prop:r,defaultProp:i??!0,onChange:a,caller:hs});return(0,H.jsx)(ve,{present:n||s,children:(0,H.jsx)(Cs,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Ee(e.onPause),onResume:Ee(e.onResume),onSwipeStart:tt(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:tt(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:tt(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:tt(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[xs,Ss]=rs(hs,{onClose(){}}),Cs=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=os(hs,n),g=ts(n),[_,v]=z.useState(null),y=ye(t,v),b=z.useRef(null),x=z.useRef(null),S=i||h.duration,C=z.useRef(0),w=z.useRef(S),T=z.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=Ee(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=z.useCallback(e=>{!e||e===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);z.useEffect(()=>{let e=h.viewport;if(e){let t=Qo(()=>{k(w.current),l?.()},`handleResume`),n=Qo(()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()},`handlePause`);return e.addEventListener(us,n),e.addEventListener(ds,t),()=>{e.removeEventListener(us,n),e.removeEventListener(ds,t)}}},[h.viewport,S,c,l,k]),z.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),z.useEffect(()=>()=>{window.clearTimeout(T.current)},[]),z.useEffect(()=>(E(),()=>D()),[E,D]);let ee=z.useMemo(()=>_?Ms(_):null,[_]);return h.viewport?(0,H.jsxs)(H.Fragment,{children:[ee&&(0,H.jsx)(ws,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ee}),(0,H.jsx)(xs,{scope:n,onClose:O,children:Xo.createPortal((0,H.jsx)(es.ItemSlot,{scope:n,children:(0,H.jsx)(Qe,{asChild:!0,onEscapeKeyDown:tt(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||O()}),children:(0,H.jsx)(He.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:tt(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||O())}),onPointerDown:tt(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:tt(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Ns(_s,d,f,{discrete:!1})):Ps(l,h.swipeDirection,c)?(x.current=l,Ns(gs,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:tt(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Ps(t,h.swipeDirection,h.swipeThreshold)?Ns(ys,p,r,{discrete:!0}):Ns(vs,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),ws=Qo(e=>{let{__scopeToast:t,children:n,...r}=e,i=os(hs,t),[a,o]=z.useState(!1),[s,c]=z.useState(!1);return Fs(()=>o(!0)),z.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,H.jsx)(Be,{asChild:!0,container:i.announcerContainer||void 0,children:(0,H.jsx)(Ke,{...r,children:a&&(0,H.jsxs)(H.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Ts=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,...r}=e;return(0,H.jsx)(He.div,{...r,ref:t})},`ToastTitle`)),Es=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,...r}=e;return(0,H.jsx)(He.div,{...r,ref:t})},`ToastDescription`)),Ds=`ToastAction`,Os=z.forwardRef(Qo(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,H.jsx)(js,{altText:n,asChild:!0,children:(0,H.jsx)(As,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ds}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),ks=`ToastClose`,As=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,...r}=e,i=Ss(ks,n);return(0,H.jsx)(js,{asChild:!0,children:(0,H.jsx)(He.button,{type:`button`,...r,ref:t,onClick:tt(e.onClick,i.onClose)})})},`ToastClose`)),js=z.forwardRef(Qo(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,H.jsx)(He.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Ms(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Is(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Ms(e))}}}),t}Qo(Ms,`getAnnounceTextContent`);function Ns(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Re(i,a):i.dispatchEvent(a)}Qo(Ns,`handleAndDispatchCustomEvent`);var Ps=Qo((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function Fs(e=()=>{}){let t=Ee(e);Je(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}Qo(Fs,`useNextFrame`);function Is(e){return e.nodeType===e.ELEMENT_NODE}Qo(Is,`isHTMLElement`);function Ls(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Qo(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Qo(Ls,`getTabbableCandidates`);function Rs(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}Qo(Rs,`focusFirst`);var zs=ss,Bs=fs,Vs=bs,Hs=Ts,Us=Es,Ws=Os,Gs=As,Ks=we(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),qs=we(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Js=we(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ys=we(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Xs=we(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Zs=we(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Qs=we(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),$s=we(`move-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]),ec=we(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),tc=we(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),nc=we(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),rc=we(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),ic=we(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),ac=we(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),oc=we(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),sc=we(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),cc=Yo,lc=({className:e,...t})=>(0,H.jsx)(Bs,{className:R(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-105`,e),...t}),uc=Ze(`group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-xl p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all [corner-shape:squircle] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none supports-[corner-shape:squircle]:rounded-3xl`,{variants:{variant:{error:`bg-error/40 text-foreground`,success:`bg-success/30 text-foreground`,default:`bg-card/80 text-foreground`}},defaultVariants:{variant:`default`}}),dc=({className:e,variant:t,...n})=>(0,H.jsx)(Vs,{className:R(uc({variant:t}),e),...n}),fc=({className:e,...t})=>(0,H.jsx)(Gs,{className:R(`absolute top-1 right-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.error]:text-red-300 group-[.error]:focus:ring-red-400 group-[.error]:focus:ring-offset-red-600 group-[.error]:hover:text-red-50`,e),"toast-close":``,...t,children:(0,H.jsx)(pe,{className:`size-5`})}),pc=({className:e,...t})=>(0,H.jsx)(Hs,{className:R(`font-semibold text-sm [&+div]:text-xs`,e),...t}),mc=({className:e,...t})=>(0,H.jsx)(Us,{className:R(`overflow-scroll text-sm opacity-90`,e),...t}),hc=()=>{let e=(0,V.c)(2),{toasts:t}=Qi(),n;return e[0]===t?n=e[1]:(n=(0,H.jsxs)(cc.Provider,{children:[t.map(gc),(0,H.jsx)(lc,{})]}),e[0]=t,e[1]=n),n};function gc(e){let{id:t,title:n,description:r,action:i,...a}=e;return(0,H.jsxs)(dc,{...a,children:[(0,H.jsxs)(`div`,{className:`grid gap-1`,children:[n&&(0,H.jsx)(pc,{children:n}),r&&(0,H.jsx)(mc,{children:r})]}),i,(0,H.jsx)(fc,{})]},t)}function _c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function vc(...e){return t=>{let n=!1,r=e.map(e=>{let r=_c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_c(e[t],null)}}}}function yc(...e){return z.useCallback(vc(...e),e)}var bc=class extends z.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(le(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=le(e)&&e.offsetWidth||0,r=le(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function xc({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,z.useId)(),s=(0,z.useRef)(null),c=(0,z.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,z.useContext)(ae),u=yc(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,z.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
13
|
+
[data-motion-pop-id="${o}"] {
|
|
14
|
+
position: absolute !important;
|
|
15
|
+
width: ${e}px !important;
|
|
16
|
+
height: ${u}px !important;
|
|
17
|
+
${_}px !important;
|
|
18
|
+
${v}px !important;
|
|
19
|
+
}
|
|
20
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,H.jsx)(bc,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:z.cloneElement(e,{ref:u})})}var Sc=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Ue(Cc),d=(0,z.useId)(),f=(0,z.useRef)(n),p=(0,z.useRef)(r);w(()=>{f.current=n,p.current=r});let m=!0,h=(0,z.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,z.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),z.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,H.jsx)(xc,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,H.jsx)(g.Provider,{value:h,children:e})};function Cc(){return new Map}var wc=e=>e.key||``;function Tc(e){let t=[];return z.Children.forEach(e,e=>{(0,z.isValidElement)(e)&&t.push(e)}),t}var Ec=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=v(o),f=(0,z.useMemo)(()=>Tc(e),[e]),p=o&&!u?[]:f.map(wc),m=(0,z.useRef)(!0),h=(0,z.useRef)(f),g=Ue(()=>new Map),_=(0,z.useRef)(new Set),[y,b]=(0,z.useState)(f),[x,C]=(0,z.useState)(f);w(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),w(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=wc(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let T=[];if(f!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf(wc(n));r===-1?(e.splice(t++,0,n),T.push(n)):t=r+T.length+1}return a===`wait`&&T.length&&(e=T),C(Tc(e)),b(f),null}let{forceRender:E}=(0,z.useContext)(S);return(0,H.jsx)(H.Fragment,{children:x.map(e=>{let v=wc(e),y=o&&!u?!1:f===x||p.includes(v);return(0,H.jsx)(Sc,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(E?.(),C(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})};function Dc({children:e,features:t,strict:n=!1}){let[,r]=(0,z.useState)(!Oc(t)),i=(0,z.useRef)(void 0);if(!Oc(t)){let{renderer:e,...n}=t;i.current=e,c(n)}return(0,z.useEffect)(()=>{Oc(t)&&t().then(({renderer:e,...t})=>{c(t),i.current=e,r(!0)})},[]),(0,H.jsx)(se.Provider,{value:{renderer:i.current,strict:n},children:e})}function Oc(e){return typeof e==`function`}var kc={renderer:rt,...re,...E},Ac=ut(),jc=e=>{let t=(0,V.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,H.jsx)(Dc,{features:kc,children:n}),t[0]=n,t[1]=r),r},Mc=e=>{let t=(0,V.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,H.jsx)(hc,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,H.jsx)(jc,{children:(0,H.jsxs)(Jo,{children:[r,n]})}),t[1]=n,t[2]=i),i},Nc=e=>{let t=(0,V.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,H.jsx)(Oi,{children:(0,H.jsx)(Wr,{children:(0,H.jsx)(Hr,{path:`*`,element:n})})}),t[0]=n,t[1]=r),r},Pc={key:`dictionary-edition-drawer`,content:{nodeType:`translation`,translation:{en:{openDictionaryEditor:{popoverContent:`Open Dictionary in Editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},"en-GB":{openDictionaryEditor:{popoverContent:`Click to open the dictionary in the editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},fr:{openDictionaryEditor:{popoverContent:`Ouvrir le dictionnaire dans l’éditeur`,label:`Cliquez pour ouvrir le dictionnaire dans l’éditeur`},backButtonText:`Liste des dictionnaires`,modalTitle:`Modifier le dictionnaire`,noDictionaryFocused:`Aucun dictionnaire sélectionné`,focusedDictionaryNotFound:`Dictionnaire focalisé non trouvé`},es:{openDictionaryEditor:{popoverContent:`Abrir el diccionario en el editor`,label:`Haga clic para abrir el diccionario en el editor`},backButtonText:`Lista de diccionarios`,modalTitle:`Editar el diccionario`,noDictionaryFocused:`No hay diccionario enfocado`,focusedDictionaryNotFound:`Diccionario enfocado no encontrado`},de:{openDictionaryEditor:{popoverContent:`Wörterbuch im Editor öffnen`,label:`Klicken Sie hier, um das Wörterbuch im Editor zu öffnen`},backButtonText:`Wörterbuchliste`,modalTitle:`Wörterbuch bearbeiten`,noDictionaryFocused:`Kein Wörterbuch ausgewählt`,focusedDictionaryNotFound:`Ausgewähltes Wörterbuch nicht gefunden`},ja:{openDictionaryEditor:{popoverContent:`エディターで辞書を開く`,label:`エディターで辞書を開く`},backButtonText:`辞書リスト`,modalTitle:`辞書を編集`,noDictionaryFocused:`フォーカスされた辞書がありません`,focusedDictionaryNotFound:`フォーカスされた辞書が見つかりません`},ko:{openDictionaryEditor:{popoverContent:`편집기에서 사전 열기`,label:`편집기에서 사전 열기`},backButtonText:`사전 목록`,modalTitle:`사전 편집`,noDictionaryFocused:`포커스가 있는 사전이 없습니다`,focusedDictionaryNotFound:`포커스가 있는 사전이 없습니다`},zh:{openDictionaryEditor:{popoverContent:`点击打开词典到编辑器`,label:`点击打开词典到编辑器`},backButtonText:`词典列表`,modalTitle:`编辑词典`,noDictionaryFocused:`没有聚焦的词典`,focusedDictionaryNotFound:`没有聚焦的词典`},it:{openDictionaryEditor:{popoverContent:`Apri il dizionario nell’editor`,label:`Fai clic per aprire il dizionario nell’editor`},backButtonText:`Elenco di dizionari`,modalTitle:`Modifica dizionario`,noDictionaryFocused:`Nessun dizionario selezionato`,focusedDictionaryNotFound:`Nessun dizionario selezionato`},pt:{openDictionaryEditor:{popoverContent:`Abrir o dicionário no editor`,label:`Clique para abrir o dicionário no editor`},backButtonText:`Lista de dicionários`,modalTitle:`Editar dicionário`,noDictionaryFocused:`Nenhum dicionário focalizado`,focusedDictionaryNotFound:`Nenhum dicionário focalizado`},hi:{openDictionaryEditor:{popoverContent:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`,label:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`},backButtonText:`शब्दकोश सूची`,modalTitle:`शब्दकोश संपादित करें`,noDictionaryFocused:`कोई फोकस शब्दकोश नहीं है`,focusedDictionaryNotFound:`कोई फोकस शब्दकोश नहीं है`},ar:{openDictionaryEditor:{popoverContent:`انقر لفتح قاموس في المحرر`,label:`انقر لفتح قاموس في المحرر`},backButtonText:`قائمة القوامل`,modalTitle:`تحرير قاموس`,noDictionaryFocused:`لا يوجد قاموس مرتبط`,focusedDictionaryNotFound:`لا يوجد قاموس مرتبط`},ru:{openDictionaryEditor:{popoverContent:`Нажмите, чтобы открыть словарь в редакторе`,label:`Нажмите, чтобы открыть словарь в редакторе`},backButtonText:`Список словарей`,modalTitle:`Редактировать словарь`,noDictionaryFocused:`Нет фокусированного словаря`,focusedDictionaryNotFound:`Нет фокусированного словаря`}}},location:`local`,localId:`dictionary-edition-drawer::local::client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`};function Fc(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var Ic=Fc({CHALLENGE_NOT_FOUND:`Challenge not found`,YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:`You are not allowed to register this passkey`,FAILED_TO_VERIFY_REGISTRATION:`Failed to verify registration`,PASSKEY_NOT_FOUND:`Passkey not found`,AUTHENTICATION_FAILED:`Authentication failed`,UNABLE_TO_CREATE_SESSION:`Unable to create session`,USER_NOT_FOUND:`User not found`,FAILED_TO_UPDATE_PASSKEY:`Failed to update passkey`,PREVIOUSLY_REGISTERED:`Previously registered`,REGISTRATION_CANCELLED:`Registration cancelled`,AUTH_CANCELLED:`Auth cancelled`,UNKNOWN_ERROR:`Unknown error`,SESSION_REQUIRED:`Passkey registration requires an authenticated session`,RESOLVE_USER_REQUIRED:`Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false`,RESOLVED_USER_INVALID:`Resolved user is invalid`}),Lc=`1.7.2`;function W(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Rc(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function zc(){return Bc.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var Bc={stubThis:e=>e};function Vc(e){let{id:t}=e;return{...e,id:Rc(t),transports:e.transports}}function Hc(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var Uc=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function Wc({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Uc({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Uc({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Uc({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Uc({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Uc({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Uc({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Uc({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Uc({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Hc(t))return new Uc({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Uc({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Uc({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Uc({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var Gc=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Kc=[`cross-platform`,`platform`];function qc(e){if(e&&!(Kc.indexOf(e)<0))return e}async function Jc(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!zc())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:Rc(t.challenge),user:{...t.user,id:Rc(t.user.id)},excludeCredentials:t.excludeCredentials?.map(Vc)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=Gc.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw Wc({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){Yc(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=W(e))}catch(e){Yc(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=W(c.getAuthenticatorData())}catch(e){Yc(`getAuthenticatorData()`,e)}return{id:o,rawId:W(s),response:{attestationObject:W(c.attestationObject),clientDataJSON:W(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:qc(a.authenticatorAttachment)}}function Yc(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function Xc(){if(!zc())return Zc.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Zc.stubThis(new Promise(e=>e(!1))):Zc.stubThis(e.isConditionalMediationAvailable())}var Zc={stubThis:e=>e};function Qc({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Uc({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Uc({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Hc(t))return new Uc({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Uc({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Uc({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function $c(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!zc())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(Vc));let a={...t,challenge:Rc(t.challenge),allowCredentials:i},o={};if(n){if(!await Xc())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Gc.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Qc({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=W(u.userHandle)),{id:c,rawId:W(l),response:{authenticatorData:W(u.authenticatorData),clientDataJSON:W(u.clientDataJSON),signature:W(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:qc(s.authenticatorAttachment)}}var el=`1.7.2`,tl=Symbol.for(`better-auth:broadcast-channel`),nl=()=>Math.floor(Date.now()/1e3),rl=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:nl()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function il(e=`better-auth.message`){return globalThis[tl]||(globalThis[tl]=new rl(e)),globalThis[tl]}var al=[],ol=0,sl=null,cl=4,ll=globalThis.nanostoresGlobal||={epoch:0},ul=()=>{let e;for(ol=0;ol<al.length;ol+=cl)try{al[ol](al[ol+1].value,al[ol+2],al[ol+3])}catch(t){e=t}if(al.length=0,e)throw e},dl=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=ol+cl;t<al.length;)al[t]===e?al.splice(t,cl):t+=cl;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){ll.epoch++;let i=!al.length&&!0;for(let i of t)sl?.has(i)||(sl?.add(i),al.push(i,n,e,r));i&&ul()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},fl=2,pl=5,ml=6,hl=10,gl=(e,t,n,r)=>(e.events=e.events||{},e.events[n+hl]||(e.events[n+hl]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+hl](),delete e.events[n+hl])}),_l=(e,t)=>gl(e,t,fl,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),vl=1e3,yl=(e,t)=>gl(e,n=>{let r=t(n);r&&e.events[ml].push(r)},pl,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[ml]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ml])t();e.events[ml]=[]}},vl)},()=>{e.listen=n,e.off=r}});function bl(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function xl(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xl(e[n],t[n]))return!1;return!0}if(bl(e)&&bl(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!xl(e[r],t[r]))return!1;return!0}return!1}function Sl(e,t){return _l(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Cl=Symbol.for(`better-auth:focus-manager`),wl=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Tl(){return globalThis[Cl]||(globalThis[Cl]=new wl),globalThis[Cl]}var El=Symbol.for(`better-auth:online-manager`),Dl=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Ol(){return globalThis[El]||(globalThis[El]=new Dl),globalThis[El]}var kl={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Al=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,jl={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Ml=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Nl(e){return e instanceof Date&&!isNaN(e.getTime())}function Pl(e){let t=Ml.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Nl(f)?f:null}function Fl(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in jl)return jl[s];if(!Al.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(kl).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Pl(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Il(e,t={strict:!0}){return Fl(e,t)}var Ll=()=>typeof window>`u`;function Rl(e,t){return xl(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var zl=(e,t,n,r)=>{let i=dl({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});yl(i,()=>Sl(i,Rl));let a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){let t=i.get(),n=t.data!=null&&e.data!=null&&xl(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1,s=!1,c=!1,l=()=>{if(o){c=!0;return}o=!0,a().finally(()=>{o=!1;let e=c&&s;c=!1,e&&l()})};return yl(i,()=>{if(Ll())return;s=!0;let t=!1,n,r=e.map(e=>e.listen(()=>{t?a():(t=!0,clearTimeout(n),l())}));return n=setTimeout(()=>{t=!0,l()},0),()=>{s=!1;for(let e of r)e();clearTimeout(n)}}),i},G=()=>Math.floor(Date.now()/1e3),Bl=5;function K(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||Ol().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=G(),t();return}if(e?.event===`visibilitychange`){if(G()-c.lastSessionRequest<Bl)return;c.lastSessionRequest=G(),t();return}t()}},d=e=>{il().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=il().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Tl().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Ol().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=il().setup(),c.cleanupFocusSetup=Tl().setup(),c.cleanupOnlineSetup=Ol().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var q=Object.create(null),Vl=e=>({}),Hl=new Proxy(q,{get(e,t){return Vl()[t]??q[t]},has(e,t){return t in Vl()||t in q},set(e,t,n){let r=Vl(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Vl(!0);return delete n[t],!0},ownKeys(){let e=Vl(!0);return Object.keys(e)}});Hl.NODE_ENV;function Ul(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Ul(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Ul(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Ul(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Ul(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Ul(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Ul(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Ul(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function Wl(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Gl(e){let t=e.split(`
|
|
21
|
+
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
22
|
+
at `))}function Kl(e,t){class n extends e{#e;constructor(...e){if(Wl()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Gl(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var ql={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Kl(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:ql[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var Jl=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Yl=47;function Xl(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Yl;)t--;return t===e.length?e:e.slice(0,t)}function Zl(e){try{return(Xl(new URL(e).pathname)||`/`)!==`/`}catch{throw new Jl(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Ql(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Jl(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Jl?t:new Jl(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function $l(e,t=`/api/auth`){if(Ql(e),Zl(e))return e;let n=Xl(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function eu(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function tu(e,t,n,r,i){if(e)return $l(e,t);if(r!==!1){let e=Hl.BETTER_AUTH_URL||Hl.NEXT_PUBLIC_BETTER_AUTH_URL||Hl.PUBLIC_BETTER_AUTH_URL||Hl.NUXT_PUBLIC_BETTER_AUTH_URL||Hl.NUXT_PUBLIC_AUTH_URL||(Hl.BASE_URL===`/`?void 0:Hl.BASE_URL);if(e)return $l(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&eu(o,`proto`)&&eu(a,`host`))try{return $l(`${o}://${a}`,t)}catch{}if(n){let e=nu(n.url);if(!e)throw new Jl(`Could not get origin from request. Please provide a valid base URL.`);return $l(e,t)}if(typeof window<`u`&&window.location)return $l(window.location.origin,t)}function nu(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var ru=[`javascript:`,`data:`,`vbscript:`];function iu(e){let t;try{t=new URL(e)}catch{return!0}return!ru.includes(t.protocol)}var au={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&iu(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ou=()=>typeof window>`u`,su=vl;function cu(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function lu(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function uu(e){return!e||e.session===null&&e.user===null?null:e}function du(e,t){return xl(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function fu(e,t){let n=dl(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=dl({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Sl(s,du);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=lu(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=lu(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=uu(i),u=s.value,d=u.data!=null&&l!=null&&xl(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+su,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return yl(s,()=>{let e;ou()||(e=setTimeout(()=>{d()},0));let r=K({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function pu(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function mu(e,t,n=`.`,r){if(!pu(t))return mu(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:pu(a)&&pu(i[t])?mu(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function hu(e){return(...t)=>t.reduce((t,n)=>mu(t,n,``,e),{})}var gu=hu(),_u=Object.defineProperty,vu=Object.defineProperties,yu=Object.getOwnPropertyDescriptors,bu=Object.getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,Cu=(e,t,n)=>t in e?_u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||={})xu.call(t,n)&&Cu(e,n,t[n]);if(bu)for(var n of bu(t))Su.call(t,n)&&Cu(e,n,t[n]);return e},Tu=(e,t)=>vu(e,yu(t)),Eu=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Du=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Ou=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},ku=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function Au(e){if(typeof e==`number`)return new Ou({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Ou(e);case`exponential`:return new ku(e);default:throw Error(`Invalid retry strategy`)}}var ju=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Mu=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Nu(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Mu.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Pu(e){try{return JSON.parse(e),!0}catch{return!1}}function Fu(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function Iu(e){try{return JSON.parse(e)}catch{return e}}function Lu(e){return typeof e==`function`}function Ru(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&Lu(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&Lu(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function zu(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function Bu(e){let t=new Headers(zu(e?.headers,await ju(e)));if(!t.has(`content-type`)){let n=Vu(e?.body);n&&t.set(`content-type`,n)}return t}function Vu(e){return Fu(e)?`application/json`:null}function Hu(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function Uu(e,t){let{body:n}=e;return n?!Fu(n)||typeof n==`string`?n:Hu(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function Wu(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return Ju.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function Gu(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Ku=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function qu(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Ku(n.issues);return n.value}var Ju=[`get`,`post`,`put`,`patch`,`delete`],Yu=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await qu(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=Tu(wu({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=Tu(wu({},r),{body:i.input?await qu(i.input,n?.body):n?.body,params:i.params?await qu(i.params,n?.params):n?.params,query:i.query?await qu(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),Xu=e=>{async function t(t,n){let r=Tu(wu(wu({},e),n),{headers:zu(e?.headers,n?.headers),plugins:[...e?.plugins||[],Yu(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await ed(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await ed(t,r)}return t},Zu=e=>e===`.`||e===`..`;function Qu(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(Zu(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function $u(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];Ju.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r){if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t))}o=o.split(`/`).map(e=>Qu(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var ed=async(e,t)=>{let{hooks:n,url:r,options:i}=await Du(e,t),a=Ru(i),o=new AbortController,s=i.signal??o.signal,c=$u(r,i),l=await Bu(i),u=Uu(i,l),d=Wu(r,i),f=Tu(wu({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=Gu(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(Tu(wu({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=Nu(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??Iu)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await qu(f.output,r.data));for(let e of n.onSuccess)e&&await e(Tu(wu({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??Iu,_=await m.text(),v=Pu(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:Tu(wu({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(Tu(wu({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=Au(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await ed(e,Tu(wu({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Eu(m.status,m.statusText,v?y:_);return{data:null,error:Tu(wu({},y),{status:m.status,statusText:m.statusText})}},td=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},nd=(e,t)=>{let n=`credentials`in Request.prototype,r=tu(e?.baseURL,e?.basePath,void 0,t)??td(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Xu({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Il(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[au],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=fu(d,e),h=!1,g=e=>{h||e===null||(h=!0,cu(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=gu(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$fetch:d,$store:S}};function rd(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function id(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ad=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,od=/['\u2019]/g;function sd(e){return e.replace(od,``).match(ad)??[]}function cd(e){return sd(e).map(e=>e.toLowerCase()).join(`-`)}function ld(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function ud(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||rd(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(cd).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=ld(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function dd(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,atomListeners:o,$store:s}=nd(e),c={};for(let[e,t]of Object.entries(r))c[`use${id(e)}`]=t;return ud({...n,...c,hydrateSession:i,$fetch:a,$store:s},a,t,r,o)}var fd=(e,{$listPasskeys:t,$store:n})=>({signIn:{passkey:async(r,i)=>{let a=await e(`/passkey/generate-authenticate-options`,{method:`GET`,throw:!1});if(!a.data)return a;let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s;try{s=await $c({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof Uc?e.code:`AUTH_CANCELLED`,message:Ic.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}try{let{clientExtensionResults:a,...o}=s,c=await e(`/passkey/verify-authentication`,{body:{response:o},...r?.fetchOptions,...i,method:`POST`,throw:!1});return t.set(Math.random()),n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...c,webauthn:{response:s,clientExtensionResults:a}}:c}catch(e){return console.error(`[Better Auth] Error verifying passkey`,e),{data:null,error:{code:`AUTH_CANCELLED`,message:Ic.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}}},passkey:{addPasskey:async(r,i)=>{let a=await e(`/passkey/generate-register-options`,{method:`GET`,query:{...r?.authenticatorAttachment&&{authenticatorAttachment:r.authenticatorAttachment},...r?.name&&{name:r.name},...r?.context&&{context:r.context}},throw:!1});if(!a.data)return a;try{let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s=await Jc({optionsJSON:{...a.data,extensions:o},useAutoRegister:r?.useAutoRegister}),{clientExtensionResults:c,...l}=s,u=await e(`/passkey/verify-registration`,{...r?.fetchOptions,...i,body:{response:l,name:r?.name,...r?.createSession&&{createSession:!0}},method:`POST`,throw:!1});return u.data?(t.set(Math.random()),u.data.session&&n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...u,webauthn:{response:s,clientExtensionResults:c}}:u):u}catch(e){return e instanceof Uc?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:Ic.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:Ic.REGISTRATION_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:e.code,message:e.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:`UNKNOWN_ERROR`,message:e instanceof Error?e.message:Ic.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),pd=()=>{let e=dl();return{id:`passkey`,version:Lc,$InferServerPlugin:{},getActions:(t,n)=>fd(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:zl(e,`/passkey/list-user-passkeys`,t,{method:`GET`}),$listPasskeys:e}},pathMethods:{"/passkey/register":`POST`,"/passkey/authenticate":`POST`},atomListeners:[{matcher(e){return e===`/passkey/verify-registration`||e===`/passkey/delete-passkey`||e===`/passkey/update-passkey`||e===`/sign-out`},signal:`$listPasskeys`},{matcher:e=>e===`/passkey/verify-authentication`,signal:`$sessionSignal`}],$ERROR_CODES:Ic}},md=`1.7.2`,hd=e=>({id:`sso-client`,version:md,$InferServerPlugin:{},pathMethods:{"/sso/providers":`GET`,"/sso/get-provider":`GET`}}),gd=()=>({id:`magic-link`,version:el,$InferServerPlugin:{}}),_d=Fc({INVALID_SESSION_TOKEN:`Invalid session token`}),vd=()=>({id:`multi-session`,version:el,$InferServerPlugin:{},atomListeners:[{matcher(e){return e===`/multi-session/set-active`},signal:`$sessionSignal`}],$ERROR_CODES:_d}),yd=Fc({OTP_NOT_ENABLED:`OTP not enabled`,OTP_NOT_CONFIGURED:`OTP is not available`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TOTP_NOT_CONFIGURED:`TOTP is not available`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,ACCOUNT_TEMPORARILY_LOCKED:`Too many failed verification attempts. Your account is temporarily locked. Please try again later.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),bd=e=>({id:`two-factor`,version:el,$InferServerPlugin:{},atomListeners:[{matcher:e=>e.startsWith(`/two-factor/`),signal:`$sessionSignal`}],pathMethods:{"/two-factor/disable":`POST`,"/two-factor/enable":`POST`,"/two-factor/send-otp":`POST`,"/two-factor/generate-backup-codes":`POST`,"/two-factor/get-totp-uri":`POST`,"/two-factor/verify-totp":`POST`,"/two-factor/verify-otp":`POST`,"/two-factor/verify-backup-code":`POST`},fetchPlugins:[{id:`two-factor`,name:`two-factor`,hooks:{async onSuccess(t){if(t.data?.twoFactorRedirect){if(e?.onTwoFactorRedirect){await e.onTwoFactorRedirect({twoFactorMethods:t.data.twoFactorMethods});return}e?.twoFactorPage&&typeof window<`u`&&iu(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:yd}),xd=e=>dd({baseURL:e,withCredentials:!0,plugins:[bd({onTwoFactorRedirect:()=>{let e=new URLSearchParams(window.location.search).get(`redirect_url`),t=e?`/auth/2fa?redirect_url=${encodeURIComponent(e)}`:`/auth/2fa`;window.location.href=t}}),pd(),gd(),hd(),vd()]}),Sd=e=>{let t=e?.editor?.backendURL??a?.backendURL;t||(t=yt,console.error(`Backend URL is not defined in the Intlayer configuration.`));let n=xd(t);return{getAuthClient:()=>n,signInEmail:async(...e)=>n.signIn.email(...e),signUpEmail:async(...e)=>n.signUp.email(...e),signOut:async(...e)=>n.signOut(...e),signInSocial:async(...e)=>n.signIn.social(...e),linkSocial:async(...e)=>n.linkSocial(...e),changePasswordSession:async(...e)=>n.changePassword(...e),requestPasswordResetSession:async(...e)=>n.requestPasswordReset(...e),resetPassword:async(...e)=>n.resetPassword(...e),verifyEmailSession:async(...e)=>n.verifyEmail(...e),getSession:async(...e)=>n.getSession(...e),forgetPassword:async(...e)=>n.requestPasswordReset(...e),sendVerificationEmail:async(...e)=>n.sendVerificationEmail(...e),changeEmail:async(...e)=>n.changeEmail(...e),deleteUser:async(...e)=>n.deleteUser(...e),revokeSession:async(...e)=>n.revokeSession(...e),revokeSessions:async(...e)=>n.revokeSessions(...e),revokeOtherSessions:async(...e)=>n.revokeOtherSessions(...e),listAccounts:async(...e)=>n.listAccounts(...e),unlinkAccount:async(...e)=>n.unlinkAccount(...e),refreshToken:async(...e)=>n.refreshToken(...e),getAccessToken:async(...e)=>n.getAccessToken(...e),accountInfo:async(...e)=>n.accountInfo(...e),updateUser:async(...e)=>n.updateUser(...e),listSessions:async(...e)=>n.listSessions(...e),enableTwoFactor:async(...e)=>n.twoFactor.enable(...e),disableTwoFactor:async(...e)=>n.twoFactor.disable(...e),verifyTotp:async(...e)=>n.twoFactor.verifyTotp(...e),verifyBackupCode:async(...e)=>n.twoFactor.verifyBackupCode(...e),addPasskey:async(...e)=>n.passkey.addPasskey(...e),signInPasskey:async(...e)=>n.signIn.passkey(...e),deletePasskey:async(...e)=>n.passkey.deletePasskey(...e),listPasskeys:async()=>n.$fetch(`/passkey/list-user-passkeys`,{method:`GET`}),signInMagicLink:async(...e)=>n.signIn.magicLink(...e),signInSSO:async(...e)=>n.signIn.sso(...e),registerSSO:async(...e)=>n.sso.register(...e),listSSOProviders:async()=>({data:(await n.sso.providers())?.data?.providers??[]}),deleteSSOProvider:async e=>n.sso.deleteProvider({providerId:e.providerId}),listDeviceSessions:async(...e)=>n.multiSession.listDeviceSessions(...e),revokeDeviceSession:async(...e)=>n.multiSession.revoke(...e),setActiveSession:async(...e)=>n.multiSession.setActive(...e)}},Cd=class extends Error{status;code;data;constructor(e,t){super(e),this.name=`FetcherError`,this.status=t.status,this.code=t.code,this.data=t.data}},J={method:`GET`,headers:{"Content-Type":`application/json`},credentials:`include`},wd=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),Td=e=>e.reduce((e,t)=>{let n=e??{},r=wd(t??{});return typeof n==`object`&&typeof r==`object`?{...n,...r}:r??n},{}),Y=async(e,...t)=>{let{signal:n}=new AbortController,r=``,i,a=Td([J,...t.map(({body:e,params:t,headers:n,...r})=>r)]),o=Td([J.headers,...t.map(e=>e.headers)]),s=Td(t.map(e=>e.params)),c=a.method;if(c!==`GET`&&c!==`HEAD`){let e=Td(t.map(e=>e.body));i=o?.[`Content-Type`]===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}Object.entries(s).length>0&&(r=`?${new URLSearchParams(s).toString()}`);let l={...a,headers:o,body:i,signal:n},u=`${e}${r}`,d=await fetch(u,l);if(!d.ok){let e=await d.json().catch(()=>void 0);throw new Cd(JSON.stringify(e?.error)??`An error occurred`,{status:d.status,code:e?.error?.code,data:e?.error})}return await d.json()},Ed=(e={},t)=>{let n=t?.editor?.backendURL??a.backendURL,{clientId:r,clientSecret:i}=t?.editor??{};return{getOAuth2AccessToken:async(e={})=>await Y(`${n}/oauth2/token`,{},e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:{grant_type:`client_credentials`,client_id:r,client_secret:i}}),createCliSessionToken:async(t={})=>await Y(`${n}/api/cli-session`,e,t,{method:`POST`}),getCliSessionMe:async(t={})=>await Y(`${n}/api/cli-session/me`,e,t)}},Dd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/ai`;return{customQuery:async(t,r={})=>await Y(n,e,r,{method:`POST`,body:t}),translateJSON:async(t,r={})=>await Y(`${n}/translate/json`,e,r,{method:`POST`,body:t}),auditContentDeclaration:async(t,r={})=>await Y(`${n}/audit/dictionary`,e,r,{method:`POST`,body:t}),auditContentDeclarationField:async(t,r={})=>await Y(`${n}/audit/dictionary/field`,e,r,{method:`POST`,body:t}),auditContentDeclarationMetadata:async(t,r={})=>await Y(`${n}/audit/dictionary/metadata`,e,r,{method:`POST`,body:t}),auditTag:async(t,r={})=>await Y(`${n}/audit/tag`,e,r,{method:`POST`,body:t}),askDocQuestion:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,...o}=t,s=new AbortController;try{let t=await fetch(`${n}/ask`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...o,...e.body,...r.body}),signal:s.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let c=t.body?.getReader();if(!c)throw Error(`No reader available`);let l=new TextDecoder,u=``;for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let n=u.split(`
|
|
23
|
+
`);u=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in askDocQuestion:`,e),e}},chat:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,onAction:o,...s}=t,c=new AbortController;try{let t=await fetch(`${n}/chat`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...s,...e.body,...r.body}),signal:c.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let l=t.body?.getReader();if(!l)throw Error(`No reader available`);let u=new TextDecoder,d=``;for(;;){let{done:e,value:t}=await l.read();if(e)break;d+=u.decode(t,{stream:!0});let n=d.split(`
|
|
24
|
+
`);d=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.action&&o?.(t.action),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in chat:`,e),e}},autocomplete:async(t,r={})=>await Y(`${n}/autocomplete`,e,r,{method:`POST`,body:t}),getDiscussions:async(t,r={})=>await Y(`${n}/discussions`,e,r,{method:`GET`,params:t}),getAIStats:async(t={})=>await Y(`${n}/stats`,e,t,{method:`GET`})}},Od=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/dictionary`;return{getDictionaries:async(t,r={})=>await Y(n,e,r,{cache:`no-store`,params:t}),getDictionariesKeys:async(t={})=>await Y(`${n}/keys`,e,t,{cache:`no-store`}),getDictionariesUpdateTimestamp:async(t={})=>await Y(`${n}/update`,e,t,{cache:`no-store`}),getDictionary:async(t,r,i={})=>await Y(`${n}/${t}`,e,i,{params:r?{version:r.toString()}:void 0}),getDictionariesByKeys:async(t,r,i={})=>await Y(`${n}/by-keys`,e,i,{cache:`no-store`,params:{keys:t.join(`,`),version:r?.toString()}}),pushDictionaries:async(t,r={})=>await Y(`${n}`,e,r,{method:`PATCH`,body:{dictionaries:t}}),addDictionary:async(t,r={})=>await Y(`${n}`,e,r,{method:`POST`,body:t}),updateDictionary:async(t,r={})=>await Y(`${n}/${t.id}`,e,r,{method:`PUT`,body:t}),deleteDictionary:async(t,r={})=>await Y(`${n}/${t}`,e,r,{method:`DELETE`})}},kd=(e={},t)=>{let n=`${t?.editor?.editorURL??a.editorURL}/api`;return{getDictionaries:async(t={})=>(await Y(`${n}/dictionary`,e,t)).data,getConfiguration:async(t={})=>(await Y(`${n}/config`,e,t)).data,writeDictionary:async(t,r={})=>await Y(`${n}/dictionary`,e,r,{method:`POST`,body:t})}},Ad=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/project`;return{getProjects:async(t,r={})=>await Y(n,e,r,{cache:`no-store`,params:t}),getProjectInsights:async(t={})=>await Y(`${n}/insights`,e,t,{cache:`no-store`,method:`GET`}),addProject:async(t,r={})=>await Y(`${n}`,e,r,{method:`POST`,body:t}),updateProject:async(t,r={})=>await Y(`${n}`,e,r,{method:`PUT`,body:t}),updateProjectMembers:async(t,r={})=>await Y(`${n}/members`,e,r,{method:`PUT`,body:t}),pushProjectConfiguration:async(t,r={})=>await Y(`${n}/configuration`,e,r,{method:`PUT`,body:t}),deleteProject:async(t={})=>await Y(`${n}`,e,t,{method:`DELETE`}),deleteProjectByIdAdmin:async(t,r={})=>Y(`${n}/${t}/admin`,e,r,{method:`DELETE`}),selectProject:async(t,r={})=>await Y(`${n}/${String(t)}`,e,r,{method:`PUT`}),unselectProject:async(t={})=>await Y(`${n}/logout`,e,t,{method:`POST`}),addNewAccessKey:async(t,r={})=>await Y(`${n}/access_key`,e,r,{method:`POST`,body:t}),deleteAccessKey:async(t,r={})=>await Y(`${n}/access_key`,e,r,{method:`DELETE`,body:{clientId:t}}),refreshAccessKey:async(t,r={})=>await Y(`${n}/access_key`,e,r,{method:`PATCH`,body:{clientId:t}}),triggerBuild:async(t={})=>await Y(`${n}/build`,e,t,{method:`POST`}),triggerWebhook:async(t,r={})=>await Y(`${n}/webhook`,e,r,{method:`POST`,body:{webhookIndex:t}}),getCIConfig:async(t={})=>await Y(`${n}/ci`,e,t,{method:`GET`}),pushCIConfig:async(t={})=>await Y(`${n}/ci`,e,t,{method:`POST`}),updateMemberAccess:async(t,r,i={})=>await Y(`${n}/member/${t}/access`,e,i,{method:`PUT`,body:r})}},jd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/tag`;return{getTags:async(t,r={})=>await Y(n,e,r,{cache:`no-store`,params:t}),addTag:async(t,r={})=>await Y(`${n}`,e,r,{method:`POST`,body:t}),updateTag:async(t,r,i={})=>await Y(`${n}/${t}`,e,i,{method:`PUT`,body:r}),deleteTag:async(t,r={})=>await Y(`${n}/${t}`,e,r,{method:`DELETE`})}},Md=(0,z.createContext)(null),Nd=({children:e,manager:t})=>(0,H.jsx)(Md.Provider,{value:t,children:e}),Pd=()=>(0,z.useContext)(Md),Fd=(0,z.createContext)(void 0),Id=()=>{let e=(0,V.c)(16),t=Pd(),n=(0,z.useContext)(Fd),[r,i]=(0,z.useState)(t?.focusedContent.value??n?.focusedContent??null),a;e[0]!==t||e[1]!==n?.focusedContent?(a=()=>{if(!t){i(n?.focusedContent??null);return}let e=e=>i(e.detail);return t.focusedContent.addEventListener(`change`,e),()=>t.focusedContent.removeEventListener(`change`,e)},e[0]=t,e[1]=n?.focusedContent,e[2]=a):a=e[2];let o=n?.focusedContent,s;e[3]!==t||e[4]!==o?(s=[t,o],e[3]=t,e[4]=o,e[5]=s):s=e[5],(0,z.useEffect)(a,s);let c;e[6]!==t||e[7]!==n?(c=e=>{n?n.setFocusedContent(e):t&&t.focusedContent.set(e)},e[6]=t,e[7]=n,e[8]=c):c=e[8];let l=c,u;e[9]!==t||e[10]!==n?(u=e=>{n?n.setFocusedContentKeyPath(e):t&&t.setFocusedContentKeyPath(e)},e[9]=t,e[10]=n,e[11]=u):u=e[11];let d=u,f;return e[12]!==r||e[13]!==l||e[14]!==d?(f={focusedContent:r,setFocusedContent:l,setFocusedContentKeyPath:d},e[12]=r,e[13]=l,e[14]=d,e[15]=f):f=e[15],f},Ld=(e,t)=>{try{let n=new URL(e),r=new URL(t);if(n.protocol!==r.protocol||n.hostname!==r.hostname||n.port!==r.port)return!1;let i=n.pathname.replace(/\/$/,``),a=r.pathname.replace(/\/$/,``);return i===``||a===``||i===a}catch(n){return console.error(`Invalid URL(s)`,n,{url1:e,url2:t}),!1}},Rd=function(e){return e.INTLAYER_CLIENT_READY=`INTLAYER_CLIENT_READY`,e.INTLAYER_ARE_YOU_THERE=`INTLAYER_ARE_YOU_THERE`,e.INTLAYER_EDITOR_ACTIVATE=`INTLAYER_EDITOR_ACTIVATE`,e.INTLAYER_EDITOR_ENABLED=`INTLAYER_EDITOR_ENABLED`,e.INTLAYER_CONFIGURATION=`INTLAYER_CONFIGURATION`,e.INTLAYER_CURRENT_LOCALE=`INTLAYER_CURRENT_LOCALE`,e.INTLAYER_URL_CHANGE=`INTLAYER_URL_CHANGE`,e.INTLAYER_LOCALE_DICTIONARIES_CHANGED=`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,e.INTLAYER_DISTANT_DICTIONARIES_CHANGED=`INTLAYER_DISTANT_DICTIONARIES_CHANGED`,e.INTLAYER_HOVERED_CONTENT_CHANGED=`INTLAYER_HOVERED_CONTENT_CHANGED`,e.INTLAYER_FOCUSED_CONTENT_CHANGED=`INTLAYER_FOCUSED_CONTENT_CHANGED`,e.INTLAYER_EDITED_CONTENT_CHANGED=`INTLAYER_EDITED_CONTENT_CHANGED`,e.INTLAYER_IFRAME_CLICKED=`INTLAYER_IFRAME_CLICKED`,e.INTLAYER_DISPLAYED_DICTIONARY_KEYS=`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,e}({}),zd=e=>{let t=new MouseEvent(`mousedown`,{bubbles:!0,cancelable:!0,view:window}),n=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window});Object.assign(n,{iframeData:e}),Object.assign(t,{iframeData:e}),window.dispatchEvent(n),window.dispatchEvent(t)},Bd=`__intlayer_editor_manager__`,Vd=`__intlayer_editor_manager_events__`,Hd=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[Vd]||(e[Vd]=new EventTarget),e[Vd]},Ud=()=>typeof window>`u`?null:window[Bd]??null,Wd=e=>{if(typeof window<`u`){let t=window;t[Bd]=e}Hd().dispatchEvent(new CustomEvent(`change`,{detail:e}))},Gd=e=>{let t=Hd(),n=t=>{e(t.detail)};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},Kd=typeof HTMLElement<`u`?HTMLElement:class{},qd=class extends Kd{_keyPathJson=`[]`;_dictionaryKey=``;_editorEnabled=!1;_isInIframe=!1;_isSelected=!1;_editedValue=void 0;_renderState=null;_selector=null;_unsubManager=null;_unsubEnabled=null;_unsubFocused=null;_unsubEditedContent=null;static get observedAttributes(){return[`key-path`,`dictionary-key`]}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e;let t=Ud();t&&this._updateEditedValue(t)}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e;let t=Ud();t&&this._updateEditedValue(t)}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t)}attributeChangedCallback(e,t,n){if(e===`key-path`){this._keyPathJson=n??`[]`;let e=Ud();e&&this._updateEditedValue(e)}else if(e===`dictionary-key`){this._dictionaryKey=n??``;let e=Ud();e&&this._updateEditedValue(e)}}connectedCallback(){typeof window<`u`&&(this._isInIframe=window.self!==window.top),this._subscribeToManager(),this._render()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null}_getRawKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_getFilteredKeyPath(){return this._getRawKeyPath().filter(e=>e.type!==ge)}_updateEditedValue(e){let t=this._getFilteredKeyPath();if(!this._dictionaryKey||t.length===0){this._editedValue=void 0,this._render();return}let n=this._getRawKeyPath(),r=n[n.length-1]?.type;if(r===`markdown`||r===`html`||r===`insertion`||r===`file`){this._editedValue=void 0,this._render();return}let i=e.getContentValue(this._dictionaryKey,t);if(typeof i==`object`&&i&&i.nodeType===`translation`){let t=e.currentLocale.value;i=t?i[ge][t]:void 0}this._editedValue=i,this._render()}_updateIsSelected(e){if(!e){this._isSelected=!1,this._updateSelectorAttr();return}let t=this._getFilteredKeyPath(),n=this._isSelected;this._isSelected=e.dictionaryKey===this._dictionaryKey&&(e.keyPath?.length??0)>0&&Et(e.keyPath??[],t),this._updateSelectorAttr(),this._isSelected&&!n&&this._scrollIntoViewIfNeeded()}_scrollIntoViewIfNeeded(){try{let e;if(this._selector){let t=this._selector.shadowRoot?.querySelector(`.wrapper`);if(t){let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}}if(!e&&this.childNodes.length>0){let t=document.createRange();t.selectNodeContents(this);let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}e||=this.getBoundingClientRect();let t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth;if(!(e.width>0&&e.height>0&&e.bottom>0&&e.right>0&&e.top<t&&e.left<n)){let n=window.scrollY??document.documentElement.scrollTop,r=e.top+n-t*.25;window.scrollTo({top:Math.max(0,r),behavior:`smooth`})}}catch{}}_updateSelectorAttr(){this._selector&&(this._isSelected?this._selector.setAttribute(`is-selecting`,``):this._selector.removeAttribute(`is-selecting`))}_subscribeToManager(){let e=Ud();e&&this._setupManagerSubscriptions(e),this._unsubManager=Gd(e=>{this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editorEnabled=!1,this._isSelected=!1,this._editedValue=void 0,this._render())})}_setupManagerSubscriptions(e){this._editorEnabled=e.editorEnabled.value??!1,this._updateIsSelected(e.focusedContent.value),this._updateEditedValue(e);let t=e=>{this._editorEnabled=e.detail,this._render()},n=e=>{this._updateIsSelected(e.detail)},r=()=>{this._updateEditedValue(e)};e.editorEnabled.addEventListener(`change`,t),e.focusedContent.addEventListener(`change`,n),e.editedContent.addEventListener(`change`,r),this._unsubEnabled=()=>e.editorEnabled.removeEventListener(`change`,t),this._unsubFocused=()=>e.focusedContent.removeEventListener(`change`,n),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,r)}_handlePress(e){e.stopPropagation();let t=Ud();t&&t.focusedContent.set({dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleHover(e){e.stopPropagation(),Ud()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,{dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleUnhover(e){e.stopPropagation(),Ud()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,null)}_render(){let e=this._isInIframe&&this._editorEnabled,t=this._editedValue,n=e?typeof t==`string`||typeof t==`number`||typeof t==`boolean`?`wrapped-text`:`wrapped-slot`:`simple`;if(this._renderState!==n){this._rebuildContent(n);return}n!==`simple`&&this._selector&&(this._updateSelectorAttr(),n===`wrapped-text`&&this._selector.firstChild?.nodeType===Node.TEXT_NODE&&(this._selector.firstChild.data=String(t)))}_rebuildContent(e){let t=this.shadowRoot;for(;t.childNodes.length>1;)t.removeChild(t.lastChild);if(this._selector=null,e===`simple`)t.appendChild(document.createElement(`slot`));else{let n=document.createElement(`intlayer-content-selector`);this._selector=n,this._isSelected&&n.setAttribute(`is-selecting`,``),n.addEventListener(`intlayer:press`,e=>this._handlePress(e)),n.addEventListener(`intlayer:hover`,e=>this._handleHover(e)),n.addEventListener(`intlayer:unhover`,e=>this._handleUnhover(e)),e===`wrapped-text`?n.appendChild(document.createTextNode(String(this._editedValue))):n.appendChild(document.createElement(`slot`)),t.appendChild(n)}this._renderState=e}},Jd=()=>{typeof customElements>`u`||customElements.get(`intlayer-content-selector-wrapper`)||customElements.define(`intlayer-content-selector-wrapper`,qd)},Yd=typeof HTMLElement<`u`?HTMLElement:class{},Xd=class extends Yd{_dictionaryKey=``;_keyPathJson=`[]`;_locale=``;_editedText=null;_unsubManager=null;_unsubEditedContent=null;_selectorWrapper;_slot;static get observedAttributes(){return[`dictionary-key`,`key-path`,`locale`]}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e,this._selectorWrapper.setAttribute(`dictionary-key`,e)}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e,this._selectorWrapper.setAttribute(`key-path`,e)}get locale(){return this._locale}set locale(e){this._locale=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t),this._selectorWrapper=document.createElement(`intlayer-content-selector-wrapper`),this._slot=document.createElement(`slot`),this._selectorWrapper.appendChild(this._slot),e.appendChild(this._selectorWrapper)}attributeChangedCallback(e,t,n){let r=n??``;e===`dictionary-key`?(this._dictionaryKey=r,this._selectorWrapper.setAttribute(`dictionary-key`,r)):e===`key-path`?(this._keyPathJson=r||`[]`,this._selectorWrapper.setAttribute(`key-path`,this._keyPathJson)):e===`locale`&&(this._locale=r)}connectedCallback(){this._subscribeToManager()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEditedContent=null}_getKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_render(){for(;this._selectorWrapper.firstChild;)this._selectorWrapper.removeChild(this._selectorWrapper.firstChild);this._editedText===null?this._selectorWrapper.appendChild(this._slot):this._selectorWrapper.appendChild(document.createTextNode(this._editedText))}_resolveEditedText(e){let t=this._getKeyPath(),n=e.getContentValue(this._dictionaryKey,t);if(n==null){this._editedText=null,this._render();return}if(typeof n==`string`||typeof n==`number`){this._editedText=String(n),this._render();return}if(typeof n==`object`){let e=this._locale||void 0,r=Ie(n,{locale:e,dictionaryKey:this._dictionaryKey,keyPath:t},te(e));typeof r==`string`||typeof r==`number`?this._editedText=String(r):(console.error(`[intlayer-edited-content] Incorrect edited content format. Expected string. Value: ${JSON.stringify(r)}`),this._editedText=null),this._render();return}this._editedText=null,this._render()}_setupManagerSubscriptions(e){this._resolveEditedText(e);let t=()=>this._resolveEditedText(e);e.editedContent.addEventListener(`change`,t),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,t)}_subscribeToManager(){let e=Ud();e&&this._setupManagerSubscriptions(e),this._unsubManager=Gd(e=>{this._unsubEditedContent?.(),this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editedText=null,this._render())})}},Zd=()=>{typeof customElements>`u`||customElements.get(`intlayer-edited-content`)||customElements.define(`intlayer-edited-content`,Xd)},Qd=()=>Math.random().toString(36).slice(2),$d=class{senderId;_config;_subscribers=new Map;_windowHandler=null;_seenMessageIds=new Set;_warnedRejectedOrigins=new Set;constructor(e){this._config=e,this.senderId=Qd()}start(){typeof window>`u`||this._windowHandler||(this._windowHandler=e=>{this._handleMessage(e)},window.addEventListener(`message`,this._windowHandler))}stop(){this._windowHandler&&=(window.removeEventListener(`message`,this._windowHandler),null)}send(e,t){let n={type:e,data:t,senderId:this.senderId,messageId:Qd()};for(let e of this._config.allowedOrigins)e&&this._config.postMessageFn(n,e)}subscribe(e,t){return this._subscribers.has(e)||this._subscribers.set(e,new Set),this._subscribers.get(e).add(t),()=>{this._subscribers.get(e)?.delete(t)}}_handleMessage(e){let t=e.data;if(!t||typeof t!=`object`)return;let{type:n,data:r,senderId:i,messageId:a}=t;if(!n||typeof n!=`string`||i===this.senderId)return;if(a){if(this._seenMessageIds.has(a))return;this._seenMessageIds.add(a),this._seenMessageIds.size>200&&this._seenMessageIds.clear()}let{allowedOrigins:o}=this._config;if(!(!o||o.length===0||o.includes(`*`)||o.filter(e=>!!e&&e!==``).some(t=>Ld(t,e.origin)))){n.startsWith(`INTLAYER`)&&!this._warnedRejectedOrigins.has(e.origin)&&(this._warnedRejectedOrigins.add(e.origin),console.warn(`[intlayer] Ignored editor message "${n}" from origin "${e.origin}" — not in allowed origins [${o.join(`, `)}]. Check the editor.editorURL / editor.cmsURL configuration.`));return}let s=this._subscribers.get(n);if(s)for(let e of s)e(r,i)}},ef=class extends EventTarget{_value;_key;_messenger;_options;_unsubscribers=[];constructor(e,t,n={}){super(),this._key=e,this._messenger=t,this._options={emit:n.emit??!0,receive:n.receive??!0},n.initialValue!==void 0&&(this._value=n.initialValue)}get value(){return this._value}set(e){let t=typeof e==`function`?e(this._value):e;this._value=t,this.dispatchEvent(new CustomEvent(`change`,{detail:t})),this._options.emit&&this._messenger.send(`${this._key}/post`,t)}start(){if(this._options.receive){let e=this._messenger.subscribe(`${this._key}/post`,e=>{this._value=e,this.dispatchEvent(new CustomEvent(`change`,{detail:e}))});this._unsubscribers.push(e)}if(this._options.emit){let e=this._messenger.subscribe(`${this._key}/get`,(e,t)=>{t!==this._messenger.senderId&&this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)});this._unsubscribers.push(e)}this._options.receive&&this._value===void 0&&this._messenger.send(`${this._key}/get`)}stop(){for(let e of this._unsubscribers)e();this._unsubscribers.length=0}postCurrentValue(){this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)}},tf=`__intlayer_edited_content_bus__`,nf=`__intlayer_edited_content_bus_events__`,rf=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[nf]||(e[nf]=new EventTarget),e[nf]},af=()=>typeof window>`u`?{}:window[tf]??{},of=(e,t)=>{typeof window<`u`&&(window[tf]=e),rf().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},sf=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=rf();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},cf=`__intlayer_focused_content_bus__`,lf=`__intlayer_focused_content_bus_events__`,uf=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[lf]||(e[lf]=new EventTarget),e[lf]},df=()=>{if(typeof window>`u`)return;let e=window;if(e.__intlayer_focused_content_bus_set__)return e[cf]??null},ff=(e,t)=>{if(typeof window<`u`){let t=window;t[cf]=e,t.__intlayer_focused_content_bus_set__=!0}uf().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},pf=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=uf();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},mf=class{_messenger;_mousedownHandler=null;_unsubscribeMerge=null;constructor(e){this._messenger=e}startInterceptor(){typeof window>`u`||(this._mousedownHandler=()=>{this._messenger.send(`INTLAYER_IFRAME_CLICKED`)},window.addEventListener(`mousedown`,this._mousedownHandler))}startMerger(){this._unsubscribeMerge=this._messenger.subscribe(`INTLAYER_IFRAME_CLICKED`,zd)}stopInterceptor(){this._mousedownHandler&&=(window.removeEventListener(`mousedown`,this._mousedownHandler),null)}stopMerger(){this._unsubscribeMerge?.(),this._unsubscribeMerge=null}},hf=class{_messenger;_originalPushState=null;_originalReplaceState=null;_listeners=[];constructor(e){this._messenger=e}start(){if(typeof window>`u`)return;let e=()=>{this._messenger.send(`INTLAYER_URL_CHANGE/post`,window.location.pathname)};this._originalPushState=history.pushState,this._originalReplaceState=history.replaceState;let t=e=>function(...t){e.apply(this,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=t(this._originalPushState),history.replaceState=t(this._originalReplaceState);for(let t of[`locationchange`,`popstate`,`hashchange`,`load`]){let n=e;window.addEventListener(t,n),this._listeners.push([t,n])}e()}stop(){if(!(typeof window>`u`)){for(let[e,t]of this._listeners)window.removeEventListener(e,t);this._listeners=[],this._originalPushState&&=(history.pushState=this._originalPushState,null),this._originalReplaceState&&=(history.replaceState=this._originalReplaceState,null)}}},gf=class{messenger;editorEnabled;focusedContent;localeDictionaries;editedContent;configuration;currentLocale;displayedDictionaryKeys;_urlManager;_iframeInterceptor;_mode;_configuration;_unsubAreYouThere=null;_unsubActivate=null;_unsubClientReady=null;_displayedKeysObserver=null;_displayedKeysTimer=null;_displayedKeysListeners=[];_editedContentFromBus=!1;_unsubGlobalEditedContent=null;_editedContentBusHandler=null;_focusedContentFromBus=!1;_unsubGlobalFocusedContent=null;_focusedContentBusHandler=null;constructor(e){this._mode=e.mode,this._configuration=e.configuration,this.messenger=new $d(e.messenger),this.editorEnabled=new ef(`INTLAYER_EDITOR_ENABLED`,this.messenger,{emit:!1,receive:!0,initialValue:!1}),this.focusedContent=new ef(`INTLAYER_FOCUSED_CONTENT_CHANGED`,this.messenger,{emit:!0,receive:!0,initialValue:null}),this.localeDictionaries=new ef(`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,this.messenger),this.editedContent=new ef(`INTLAYER_EDITED_CONTENT_CHANGED`,this.messenger),this.configuration=new ef(`INTLAYER_CONFIGURATION`,this.messenger,{emit:!0,receive:!1,...e.configuration?{initialValue:e.configuration}:{}}),this.currentLocale=new ef(`INTLAYER_CURRENT_LOCALE`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`}),this.displayedDictionaryKeys=new ef(`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`,initialValue:[]}),this._urlManager=new hf(this.messenger),this._iframeInterceptor=new mf(this.messenger)}start(){this.messenger.start(),this.editorEnabled.start(),this.focusedContent.start(),this.localeDictionaries.start(),this.editedContent.start(),this.configuration.start(),this.currentLocale.start(),this.displayedDictionaryKeys.start(),this._startEditedContentBusSync(),this._startFocusedContentBusSync(),this._mode===`client`?(this._urlManager.start(),this._iframeInterceptor.startInterceptor(),this._loadDictionaries(),this._startDisplayedDictionariesTracking(),this.messenger.send(`INTLAYER_EDITED_CONTENT_CHANGED/get`),this._configuration?.editor?.enabled!==!1&&this._setupActivationHandshake()):(this._iframeInterceptor.startMerger(),this._setupEditorHandshake())}stop(){this._unsubAreYouThere?.(),this._unsubActivate?.(),this._unsubClientReady?.(),this._unsubAreYouThere=null,this._unsubActivate=null,this._unsubClientReady=null,this.messenger.stop(),this.editorEnabled.stop(),this.focusedContent.stop(),this.localeDictionaries.stop(),this.editedContent.stop(),this.configuration.stop(),this.currentLocale.stop(),this.displayedDictionaryKeys.stop(),this._stopDisplayedDictionariesTracking(),this._stopEditedContentBusSync(),this._stopFocusedContentBusSync(),this._urlManager.stop(),this._iframeInterceptor.stopInterceptor(),this._iframeInterceptor.stopMerger()}pingClient(){this._mode===`editor`&&this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}setFocusedContentKeyPath(e){let t=e.filter(e=>e.type!==ge),n=this.focusedContent.value;n&&this.focusedContent.set({...n,keyPath:t})}setLocaleDictionary(e){if(!e.localId)return;let t=this.localeDictionaries.value??{};this.localeDictionaries.set({...t,[e.localId]:e})}setEditedDictionary(e){if(!e.localId){console.error(`setEditedDictionary: missing localId`,e);return}let t=this.editedContent.value??{};this.editedContent.set({...t,[e.localId]:e})}setEditedContent(e,t){let n=this.editedContent.value??{};this.editedContent.set({...n,[e]:{...n[e],content:t}})}addContent(e,t,n=[],r=!0){let i=this.editedContent.value??{},a=(this.localeDictionaries.value??{})[e]?.content,o=structuredClone(i[e]?.content??a),s=n;if(!r){let e=0,t=n.slice(0,-1),r=n[n.length-1],i=r.key;for(;Mt(o,s)!==void 0;)e++,i=e===0?r.key:`${r.key} (${e})`,s=[...t,{...r,key:i}]}let c=jt(o,s,t);this.editedContent.set({...i,[e]:{...i[e],content:c}})}renameContent(e,t,n=[]){let r=this.editedContent.value??{},i=(this.localeDictionaries.value??{})[e]?.content,a=Bt(structuredClone(r[e]?.content??i),t,n);this.editedContent.set({...r,[e]:{...r[e],content:a}})}removeContent(e,t){let n=this.editedContent.value??{},r=(this.localeDictionaries.value??{})[e]?.content,i=jt(structuredClone(n[e]?.content??r),t,Mt(r,t));this.editedContent.set({...n,[e]:{...n[e],content:i}})}restoreContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearAllContent(){this.editedContent.set({})}getContentValue(e,t){let n=this.editedContent.value;if(!n)return;let r=t.filter(e=>e.type!==ge),i=this.localeDictionaries.value;if(e.includes(`:local:`)||e.includes(`:remote:`))return i&&!(e in i)?void 0:Mt(n[e]?.content??{},r,this.currentLocale.value);let a=Object.keys(n).filter(t=>t.startsWith(`${e}:`)&&(!i||t in i));for(let e of a){let t=Mt(n[e]?.content??{},r,this.currentLocale.value);if(t)return t}}_startEditedContentBusSync(){this._editedContentBusHandler=e=>{if(this._editedContentFromBus)return;let t=e.detail;of(t,this.messenger.senderId)},this.editedContent.addEventListener(`change`,this._editedContentBusHandler),this._unsubGlobalEditedContent=sf((e,t)=>{t!==this.messenger.senderId&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)});let e=af();Object.keys(e).length>0&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)}_stopEditedContentBusSync(){this._editedContentBusHandler&&=(this.editedContent.removeEventListener(`change`,this._editedContentBusHandler),null),this._unsubGlobalEditedContent?.(),this._unsubGlobalEditedContent=null}_startFocusedContentBusSync(){this._focusedContentBusHandler=e=>{if(this._focusedContentFromBus)return;let t=e.detail;ff(t,this.messenger.senderId)},this.focusedContent.addEventListener(`change`,this._focusedContentBusHandler),this._unsubGlobalFocusedContent=pf((e,t)=>{t!==this.messenger.senderId&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)});let e=df();e!==void 0&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)}_stopFocusedContentBusSync(){this._focusedContentBusHandler&&=(this.focusedContent.removeEventListener(`change`,this._focusedContentBusHandler),null),this._unsubGlobalFocusedContent?.(),this._unsubGlobalFocusedContent=null}_scanDisplayedDictionaryKeys(){if(typeof document>`u`)return;let e=document.querySelectorAll(`intlayer-content-selector-wrapper[dictionary-key]`),t=Array.from(new Set(Array.from(e).map(e=>e.getAttribute(`dictionary-key`)??``).filter(Boolean)));this.displayedDictionaryKeys.set(t)}_startDisplayedDictionariesTracking(){if(typeof document>`u`||typeof MutationObserver>`u`)return;let e=()=>{this._displayedKeysTimer&&clearTimeout(this._displayedKeysTimer),this._displayedKeysTimer=setTimeout(()=>this._scanDisplayedDictionaryKeys(),100)};this._displayedKeysObserver=new MutationObserver(e),this._displayedKeysObserver.observe(document.body,{childList:!0,subtree:!0});for(let t of[`locationchange`,`popstate`]){let n=e;window.addEventListener(t,n),this._displayedKeysListeners.push([t,n])}this._scanDisplayedDictionaryKeys()}_stopDisplayedDictionariesTracking(){this._displayedKeysObserver?.disconnect(),this._displayedKeysObserver=null,this._displayedKeysTimer&&=(clearTimeout(this._displayedKeysTimer),null);for(let[e,t]of this._displayedKeysListeners)window.removeEventListener(e,t);this._displayedKeysListeners=[]}_setupEditorHandshake(){this._unsubClientReady=this.messenger.subscribe(`INTLAYER_CLIENT_READY`,()=>{this.editorEnabled.set(!0),this.messenger.send(`INTLAYER_EDITOR_ACTIVATE`)}),this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}_setupActivationHandshake(){this.messenger.send(`INTLAYER_CLIENT_READY`),this._unsubAreYouThere=this.messenger.subscribe(`INTLAYER_ARE_YOU_THERE`,()=>{this.messenger.send(`INTLAYER_CLIENT_READY`)}),this._unsubActivate=this.messenger.subscribe(`INTLAYER_EDITOR_ACTIVATE`,()=>{this.editorEnabled.set(!0),this._broadcastData()})}_broadcastData(){let e=this.configuration.value;e&&this.messenger.send(`INTLAYER_CONFIGURATION/post`,e);let t=this.currentLocale.value;t&&this.messenger.send(`INTLAYER_CURRENT_LOCALE/post`,t);let n=this.localeDictionaries.value;n&&this.messenger.send(`INTLAYER_LOCALE_DICTIONARIES_CHANGED/post`,n)}async _loadDictionaries(){try{let e=(await Ct(async()=>{let{getUnmergedDictionaries:e}=await import(`./unmerged_dictionaries-DWe4YFkq.js`);return{getUnmergedDictionaries:e}},[])).getUnmergedDictionaries(),t=Object.fromEntries(Object.values(e).flat().map(e=>[e.localId,e]));this.localeDictionaries.set(t),this.editorEnabled.value&&this._broadcastData()}catch(e){console.warn(`[intlayer] Failed to load unmerged dictionaries:`,e)}}},_f=typeof HTMLElement<`u`?HTMLElement:class{},vf=class extends _f{_configuration=void 0;_locale=void 0;_initialized=!1;_unsubManager=null;static get observedAttributes(){return[`locale`]}get configuration(){return this._configuration}set configuration(e){this._configuration=e,this._initialized||this._init()}get locale(){return this._locale}set locale(e){this._locale=e,e&&this._initialized&&this._syncLocale(e)}attributeChangedCallback(e,t,n){e===`locale`&&n!==null&&(this._locale=n,this._initialized&&this._syncLocale(n))}connectedCallback(){this._init()}disconnectedCallback(){this._unsubManager?.(),this._unsubManager=null,this._initialized&&=(Of(),!1)}_init(){this._initialized||(Df(),this._initialized=!0,this._locale&&this._syncLocale(this._locale))}_syncLocale(e){let t=Ud();t?t.currentLocale.set(e):(this._unsubManager?.(),this._unsubManager=Gd(t=>{t&&(this._unsubManager?.(),this._unsubManager=null,t.currentLocale.set(e))}))}},yf=()=>{typeof customElements>`u`||customElements.get(`intlayer-editor`)||customElements.define(`intlayer-editor`,vf)},bf=250,xf=`
|
|
25
|
+
:host {
|
|
26
|
+
display: contents;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.wrapper {
|
|
30
|
+
display: inline-block;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
user-select: none;
|
|
33
|
+
border-radius: 0.375rem;
|
|
34
|
+
outline-width: 2px;
|
|
35
|
+
outline-offset: 4px;
|
|
36
|
+
outline-style: solid;
|
|
37
|
+
outline-color: transparent;
|
|
38
|
+
transition: all 100ms 50ms ease-in-out;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.wrapper[data-active] {
|
|
42
|
+
outline-color: inherit;
|
|
43
|
+
}
|
|
44
|
+
`,Sf=typeof HTMLElement<`u`?HTMLElement:class{},Cf=class extends Sf{_isSelecting=!1;_pressDuration=bf;_isHovered=!1;_isSelectingState=!1;_wrapper;_pressTimer=null;_clickOutsideHandler=null;static get observedAttributes(){return[`is-selecting`,`press-duration`]}get isSelecting(){return this._isSelecting}set isSelecting(e){this._isSelecting=e,this._updateActiveState()}get pressDuration(){return this._pressDuration}set pressDuration(e){this._pressDuration=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=xf,e.appendChild(t);let n=document.createElement(`span`);n.className=`wrapper`,n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.appendChild(document.createElement(`slot`)),e.appendChild(n),this._wrapper=n,n.addEventListener(`mousedown`,()=>this._handleMouseDown()),n.addEventListener(`mouseup`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseleave`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseenter`,()=>this._handleMouseEnter()),n.addEventListener(`click`,e=>this._handleClick(e)),n.addEventListener(`touchstart`,()=>this._handleMouseDown()),n.addEventListener(`touchend`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`touchcancel`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`blur`,()=>this._handleBlur())}attributeChangedCallback(e,t,n){e===`is-selecting`?(this._isSelecting=n!==null,this._updateActiveState()):e===`press-duration`&&(this._pressDuration=n===null?bf:parseInt(n,10))}connectedCallback(){this._clickOutsideHandler=e=>{e.composedPath().includes(this)||(this._isSelectingState=!1,this._dispatch(`intlayer:click-outside`),this._updateActiveState())},document.addEventListener(`mousedown`,this._clickOutsideHandler)}disconnectedCallback(){this._clickOutsideHandler&&=(document.removeEventListener(`mousedown`,this._clickOutsideHandler),null),this._clearPressTimer()}_updateActiveState(){this._isSelecting||this._isSelectingState||this._isHovered?this._wrapper.setAttribute(`data-active`,``):this._wrapper.removeAttribute(`data-active`)}_clearPressTimer(){this._pressTimer!==null&&(clearTimeout(this._pressTimer),this._pressTimer=null)}_dispatch(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}_handleMouseDown(){this._clearPressTimer(),this._pressTimer=setTimeout(()=>{this._isSelectingState=!0,this._updateActiveState(),this._dispatch(`intlayer:press`)},this._pressDuration)}_handleMouseEnter(){this._isHovered=!0,this._updateActiveState(),this._dispatch(`intlayer:hover`)}_handleMouseUpOrLeave(){this._isHovered&&(this._isHovered=!1,this._dispatch(`intlayer:unhover`)),this._clearPressTimer(),this._updateActiveState()}_handleClick(e){(this._isSelecting||this._isSelectingState)&&(e.preventDefault(),e.stopPropagation())}_handleBlur(){this._isSelectingState=!1,this._updateActiveState()}},wf=()=>{typeof customElements>`u`||(customElements.get(`intlayer-content-selector`)||customElements.define(`intlayer-content-selector`,Cf),Jd(),Zd(),yf())},Tf=()=>{let e=typeof window<`u`?window.location.origin:void 0;return{allowedOrigins:[...new Set([a?.editorURL,a?.cmsURL,e].filter(Boolean))],postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&window.parent?.postMessage(e,t)}}},Ef=0,Df=()=>{Ef++;let e=Ud();if(e)return e;let t=new gf({mode:`client`,messenger:Tf(),configuration:{editor:a}});return Wd(t),wf(),t.start(),t},Of=()=>{Ef=Math.max(0,Ef-1),!(Ef>0)&&(Ud()?.stop(),Wd(null))},kf=(e,t,n)=>{let r=Pd(),i=typeof t==`function`?t():t,[a,o]=(0,z.useState)(i),s=(0,z.useRef)(i),c=(0,z.useRef)(null);return(0,z.useEffect)(()=>{let{emit:t=!0,receive:a=!0}=n??{},l=new ef(e,r?.messenger,{emit:t,receive:a,initialValue:i});c.current=l;let u=e=>{let t=e.detail;s.current=t,o(t)};return l.addEventListener(`change`,u),l.start(),()=>{l.removeEventListener(`change`,u),l.stop(),c.current=null}},[e,r?.messenger,n?.emit,n?.receive]),[a,e=>{o(t=>{let n=typeof e==`function`?e(t):e;return s.current=n,c.current?.set(n),n})},()=>{c.current?.postCurrentValue()}]},Af=(e,t)=>kf(Rd.INTLAYER_URL_CHANGE,e,t),jf=()=>{let e=(0,V.c)(13),t=Pd(),n;e[0]===t?.localeDictionaries.value?n=e[1]:(n=t?.localeDictionaries.value??{},e[0]=t?.localeDictionaries.value,e[1]=n);let[r,i]=(0,z.useState)(n),a,o;e[2]===t?(a=e[3],o=e[4]):(a=()=>{if(!t)return;let e=e=>i(e.detail??{});return t.localeDictionaries.addEventListener(`change`,e),()=>t.localeDictionaries.removeEventListener(`change`,e)},o=[t],e[2]=t,e[3]=a,e[4]=o),(0,z.useEffect)(a,o);let s;e[5]===t?.localeDictionaries?s=e[6]:(s=e=>t?.localeDictionaries.set(e),e[5]=t?.localeDictionaries,e[6]=s);let c=s,l;e[7]===t?l=e[8]:(l=e=>t?.setLocaleDictionary(e),e[7]=t,e[8]=l);let u=l,d;return e[9]!==r||e[10]!==c||e[11]!==u?(d={localeDictionaries:r,setLocaleDictionaries:c,setLocaleDictionary:u},e[9]=r,e[10]=c,e[11]=u,e[12]=d):d=e[12],d},Mf=()=>{let e=(0,V.c)(3),{setLocaleDictionaries:t,setLocaleDictionary:n}=jf(),r;return e[0]!==t||e[1]!==n?(r={setLocaleDictionaries:t,setLocaleDictionary:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r},Nf=()=>{let e=(0,V.c)(3),t=Pd(),[n,r]=(0,z.useState)(t?.currentLocale.value),i,a;return e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.currentLocale.addEventListener(`change`,e),()=>t.currentLocale.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,z.useEffect)(i,a),n},Pf=(e,t,n)=>{for(let r of t)try{if(Mt(r.content,e??[],n))return{keyPath:e,dictionaryLocalId:r.localId}}catch{}},Ff=()=>{let e=(0,V.c)(12),{localeDictionaries:t}=jf(),n=Nf(),{setFocusedContent:r,setFocusedContentKeyPath:i,focusedContent:a}=Id(),o;bb0:{if(!a){o=a;break bb0}if(!t){o=a;break bb0}if(a.dictionaryLocalId){o=a;break bb0}let r;if(e[0]!==n||e[1]!==t||e[2]!==a.dictionaryKey||e[3]!==a.keyPath){let i=Object.values(t).filter(e=>e.key===a.dictionaryKey);r=Pf(a.keyPath??[],i,n),e[0]=n,e[1]=t,e[2]=a.dictionaryKey,e[3]=a.keyPath,e[4]=r}else r=e[4];let i=r,s;e[5]!==a||e[6]!==i?(s={...a,...i},e[5]=a,e[6]=i,e[7]=s):s=e[7],o=s}let s;return e[8]!==r||e[9]!==i||e[10]!==o?(s={focusedContent:o,setFocusedContent:r,setFocusedContentKeyPath:i},e[8]=r,e[9]=i,e[10]=o,e[11]=s):s=e[11],s},If=({children:e,configuration:t,postMessage:n,allowedOrigins:r})=>{let i=(0,z.useRef)(null);i.current||=new gf({mode:`editor`,messenger:{allowedOrigins:r,postMessageFn:n},configuration:t});let a=i.current;return(0,z.useEffect)(()=>(wf(),Wd(a),a.start(),()=>{a.stop(),Wd(null)}),[a]),(0,z.useEffect)(()=>{!a||!t||Object.keys(t).length===0||a.configuration.set(t)},[a,t]),(0,H.jsx)(Nd,{manager:a,children:e})},Lf=(0,z.createContext)(void 0),Rf=()=>{let e=(0,V.c)(4),t=Pd(),n=(0,z.useContext)(Lf),[r,i]=(0,z.useState)(t?.configuration.value??n),a,o;return e[0]!==t||e[1]!==n?(a=()=>{if(!t){i(n);return}let e=e=>{let t=e.detail;i(t??n)};return t.configuration.addEventListener(`change`,e),()=>t.configuration.removeEventListener(`change`,e)},o=[t,n],e[0]=t,e[1]=n,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,z.useEffect)(a,o),r??n},zf=()=>{let e=(0,V.c)(23),t=Pd(),n;e[0]===t?.editedContent?n=e[1]:(n=e=>t?.editedContent.set(e),e[0]=t?.editedContent,e[1]=n);let r,i,a,o,s,c,l,u,d;e[2]===t?(r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],c=e[8],l=e[9],u=e[10],d=e[11]):(r=e=>t?.setEditedDictionary(e),i=(e,n)=>t?.setEditedContent(e,n),a=(e,n,r,i)=>t?.addContent(e,n,r,i),o=(e,n,r)=>t?.renameContent(e,n,r),s=(e,n)=>t?.removeContent(e,n),c=e=>t?.restoreContent(e),l=e=>t?.clearContent(e),u=()=>t?.clearAllContent(),d=(e,n)=>t?.getContentValue(e,n),e[2]=t,e[3]=r,e[4]=i,e[5]=a,e[6]=o,e[7]=s,e[8]=c,e[9]=l,e[10]=u,e[11]=d);let f;return e[12]!==n||e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==s||e[18]!==c||e[19]!==l||e[20]!==u||e[21]!==d?(f={setEditedContentState:n,setEditedDictionary:r,setEditedContent:i,addEditedContent:a,renameEditedContent:o,removeEditedContent:s,restoreEditedContent:c,clearEditedDictionaryContent:l,clearEditedContent:u,getEditedContentValue:d},e[12]=n,e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=s,e[18]=c,e[19]=l,e[20]=u,e[21]=d,e[22]=f):f=e[22],f},Bf=()=>{let e=(0,V.c)(6),t=Pd(),[n,r]=(0,z.useState)(t?.editedContent.value),i,a;e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.editedContent.addEventListener(`change`,e),()=>t.editedContent.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,z.useEffect)(i,a);let o=zf(),s;return e[3]!==n||e[4]!==o?(s={editedContent:n,...o},e[3]=n,e[4]=o,e[5]=s):s=e[5],s},Vf=()=>{let e=(0,V.c)(5),t=Pd(),[n,r]=(0,z.useState)(t?.editorEnabled.value??!1),i,a;e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.editorEnabled.addEventListener(`change`,e),()=>t.editorEnabled.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,z.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={enabled:n},e[3]=n,e[4]=o),o},Hf=()=>{let e=(0,V.c)(2),t=Pd(),n;return e[0]===t?n=e[1]:(n=()=>t?.pingClient(),e[0]=t,e[1]=n),n},Uf=(e,t,n)=>{let r=(0,V.c)(11),i=Pd(),a;r[0]!==e||r[1]!==i?.messenger||r[2]!==t?(a=()=>{if(t)return i?.messenger.subscribe(e,t)},r[0]=e,r[1]=i?.messenger,r[2]=t,r[3]=a):a=r[3];let o;r[4]!==e||r[5]!==i||r[6]!==n?(o=[i,e,n],r[4]=e,r[5]=i,r[6]=n,r[7]=o):o=r[7],(0,z.useEffect)(a,o);let s;return r[8]!==e||r[9]!==i?.messenger?(s=t=>{i?.messenger.send(e,t)},r[8]=e,r[9]=i?.messenger,r[10]=s):s=r[10],s},Wf=()=>{Uf(Rd.INTLAYER_IFRAME_CLICKED,zd)},Gf=e=>{let t=(0,V.c)(10),n=Rf(),r;t[0]===e?r=t[1]:(r=e?.sessionToken&&{headers:{Authorization:`Bearer ${e.sessionToken}`}},t[0]=e,t[1]=r);let i;t[2]===e?.options?i=t[3]:(i=e?.options??{},t[2]=e?.options,t[3]=i);let a;t[4]!==r||t[5]!==i?(a={...r,...i},t[4]=r,t[5]=i,t[6]=a):a=t[6];let o=a,s=e?.intlayerConfiguration??n,c=s?.editor?s:void 0,l;return t[7]!==o||t[8]!==c?(l={options:o,resolvedConfig:c},t[7]=o,t[8]=c,t[9]=l):l=t[9],l},Kf=e=>{let t=(0,V.c)(2),n=Rf(),r=e?.intlayerConfiguration??n,i;return t[0]===r?i=t[1]:(i=Sd(r),t[0]=r,t[1]=i),i},qf=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=Gf(e),i;return t[0]!==n||t[1]!==r?(i=Ad(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},Jf=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=Gf(e),i;return t[0]!==n||t[1]!==r?(i=Od(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},Yf=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=Gf(e),i;return t[0]!==n||t[1]!==r?(i=Dd(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},Xf=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=Gf(e),i;return t[0]!==n||t[1]!==r?(i=jd(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},Zf=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=Gf(e),i;return t[0]!==n||t[1]!==r?(i=kd(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},Qf=[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]],$f=()=>{let e=(0,V.c)(8),t=Kf(),n=yo(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`logout`],e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=()=>t.signOut(),e[1]=t,e[2]=i);let a;e[3]===n?a=e[4]:(a=()=>{Qf.forEach(e=>{n.removeQueries({queryKey:e})})},e[3]=n,e[4]=a);let o;return e[5]!==i||e[6]!==a?(o={mutationKey:r,mutationFn:i,onSettled:a},e[5]=i,e[6]=a,e[7]=o):o=e[7],Fo(o)},ep=e=>{let t=(0,V.c)(10),n=Rf(),r,i;t[0]!==n||t[1]!==e?(r=gu(e,n,{editor:a}),i=Ed(void 0,r),t[0]=n,t[1]=e,t[2]=r,t[3]=i):(r=t[2],i=t[3]);let o=i,s=Bi(),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`oAuth2AccessToken`],t[4]=c):c=t[4];let l=!!(r.editor.clientId&&r.editor.clientSecret)&&s,u;t[5]!==o.getOAuth2AccessToken||t[6]!==l?(u={queryKey:c,queryFn:o.getOAuth2AccessToken,enabled:l,staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1},t[5]=o.getOAuth2AccessToken,t[6]=l,t[7]=u):u=t[7];let{data:d}=Po(u),f=d?.data,p;return t[8]===f?p=t[9]:(p={oAuth2AccessToken:f},t[8]=f,t[9]=p),p},tp=(e,t)=>{let n=(0,V.c)(17),r=Rf(),i;n[0]!==r||n[1]!==t?(i=t??r??{editor:a},n[0]=r,n[1]=t,n[2]=i):i=n[2];let o=i,s=yo(),c=Bi(),l;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=[`session`],n[3]=l):l=n[3];let u;n[4]===o?u=n[5]:(u=async()=>(await Sd(o).getSession()).data,n[4]=o,n[5]=u);let d=!e&&c,f;n[6]!==u||n[7]!==d?(f={queryKey:l,queryFn:u,staleTime:3e5,gcTime:18e5,refetchInterval:6e5,refetchIntervalInBackground:!1,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,enabled:d},n[6]=u,n[7]=d,n[8]=f):f=n[8];let{data:p,isFetched:m,refetch:h}=Po(f),g=p??(m?null:void 0),_;n[9]===s?_=n[10]:(_=e=>{s.setQueryData([`session`],e)},n[9]=s,n[10]=_);let v=_,y;n[11]===h?y=n[12]:(y=async()=>(await h()).data,n[11]=h,n[12]=y);let b=y,x;return n[13]!==b||n[14]!==g||n[15]!==v?(x={session:g,fetchSession:b,revalidateSession:b,setSession:v},n[13]=b,n[14]=g,n[15]=v,n[16]=x):x=n[16],x},np=e=>{let t=(0,V.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{session:r,intlayerConfiguration:i}=n,{session:a,fetchSession:o,revalidateSession:s,setSession:c}=tp(r,i),{oAuth2AccessToken:l}=ep(i),u=!!(a?.user||l),d;return t[2]!==o||t[3]!==l||t[4]!==s||t[5]!==a||t[6]!==c||t[7]!==u?(d={session:a,fetchSession:o,setSession:c,revalidateSession:s,oAuth2AccessToken:l,isAuthenticated:u},t[2]=o,t[3]=l,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=d):d=t[8],d},rp=()=>{let e=(0,V.c)(9),{session:t,revalidateSession:n,setSession:r}=np(),{mutate:i}=$f(),a=t?.user?`authenticated`:`unauthenticated`,o=a===`authenticated`,s=a===`unauthenticated`,c=t?.user,l;e[0]!==i||e[1]!==r?(l=async()=>{r(null),i()},e[0]=i,e[1]=r,e[2]=l):l=e[2];let u=l,d;return e[3]!==o||e[4]!==s||e[5]!==u||e[6]!==n||e[7]!==c?(d={isAuthenticated:o,isUnauthenticated:s,user:c,revalidateSession:n,logout:u},e[3]=o,e[4]=s,e[5]=u,e[6]=n,e[7]=c,e[8]=d):d=e[8],d},ip=e=>{let t=(0,V.c)(4),{requireUser:n,requireProject:r,requireOrganization:i}=e,a=Rf(),o;t[0]===a?o=t[1]:(o={intlayerConfiguration:a},t[0]=a,t[1]=o);let{oAuth2AccessToken:s,session:c}=np(o),l=c?c.user:s?.user,u=c?c.organization:s?.organization,d=c?c.project:s?.project,f=(!n||!!l)&&(!r||!!d)&&(!i||!!u),p;return t[2]===f?p=t[3]:(p={enable:f},t[2]=f,t[3]=p),p},ap=e=>{let t=(0,V.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({requireUser:i,requireProject:r,requireOrganization:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]!==n||t[6]!==r||t[7]!==i?(o={requireUser:i,requireProject:r,requireOrganization:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8];let{enable:s}=ip(o),c=a?.enabled!==!1&&s,l;return t[9]!==a||t[10]!==c?(l={enabled:c,...a},t[9]=a,t[10]=c,t[11]=l):l=t[11],Po(l)},op=()=>{let e=(0,V.c)(3),t=Yf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-auditContentDeclarationMetadata`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.auditContentDeclarationMetadata(e)},e[1]=t,e[2]=r),Fo(r)},sp=()=>{let e=(0,V.c)(3),t=Yf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-auditContentDeclarationField`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.auditContentDeclarationField(e)},e[1]=t,e[2]=r),Fo(r)},cp=()=>{let e=(0,V.c)(3),t=Yf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-customQuery`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.customQuery(e)},e[1]=t,e[2]=r),Fo(r)},lp=(e,t)=>{let n=(0,V.c)(9),r=Jf(),i;n[0]===e?i=n[1]:(i=[`dictionaries`,e],n[0]=e,n[1]=i);let a;n[2]!==r||n[3]!==e?(a=t=>{let{signal:n}=t;return r.getDictionaries(e,{signal:n})},n[2]=r,n[3]=e,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,requireProject:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],ap(o)},up=()=>{let e=(0,V.c)(6),t=Jf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`dictionaries`],e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=e=>t.pushDictionaries(e.dictionaries),e[1]=t,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]},e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a={mutationKey:n,mutationFn:r,meta:i},e[4]=r,e[5]=a),Fo(a)},dp=()=>{let e=(0,V.c)(6),t=Jf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`dictionaries`],e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=e=>t.deleteDictionary(e.dictionaryId),e[1]=t,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]},e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a={mutationKey:n,mutationFn:r,meta:i},e[4]=r,e[5]=a),Fo(a)},fp=()=>{let e=(0,V.c)(3),t=Zf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`editor`,`dictionaries`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={queryKey:n,queryFn:()=>t.getDictionaries()},e[1]=t,e[2]=r),Po(r)},pp=()=>{let e=(0,V.c)(3),t=Zf(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`editor`,`dictionaries`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.writeDictionary(e)},e[1]=t,e[2]=r),Fo(r)},mp=(e,t)=>{let n=(0,V.c)(9),r=qf(),i;n[0]===e?i=n[1]:(i=[`projects`,e],n[0]=e,n[1]=i);let a;n[2]!==e||n[3]!==r?(a=t=>{let{signal:n}=t;return r.getProjects(e,{signal:n})},n[2]=e,n[3]=r,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],ap(o)},hp=(e,t)=>{let n=(0,V.c)(9),r=Xf(),i;n[0]===e?i=n[1]:(i=[`tags`,e],n[0]=e,n[1]=i);let a;n[2]!==e||n[3]!==r?(a=t=>{let{signal:n}=t;return r.getTags(e,{signal:n})},n[2]=e,n[3]=r,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],ap(o)},gp=({children:e,header:t,isOpen:n,defaultIsOpen:r=!1,onToggle:i,onClick:a,disabled:o=!1,contentClassName:s,headerClassName:c,contentId:l,"aria-label":u,className:d,...f})=>{let p=n!==void 0,[m,h]=(0,z.useState)(r),g=(0,z.useId)(),_=p?n:m,v=!_,y=l??`${g}-accordion-content`,b=e=>{if(o)return;let t=!_;p||h(t),i?.(t),a?.(e)};return(0,H.jsxs)(`div`,{className:R(`w-full`,d),children:[(0,H.jsx)(M,{variant:`hoverable`,color:`text`,onClick:b,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(e))},disabled:o,isFullWidth:!0,className:R(`flex items-center justify-between gap-2`,c),IconRight:P,iconClassName:R(`transform transition-transform duration-500 ease-in-out`,_?`rotate-0`:`-rotate-180`),"aria-expanded":_,"aria-controls":y,"aria-label":u,role:`button`,...f,children:t}),(0,H.jsx)(ee,{id:y,tabIndex:v?-1:void 0,isHidden:v,className:s,role:`region`,"aria-labelledby":y,children:e})]})},_p=({level:e,title:t,description:n,children:r,rightParam:i,isSelected:a,...o})=>(0,H.jsx)(`div`,{className:R(`rounded-md p-2 transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,e===2&&`hover:bg-card/30`,e>=3&&``,a===!0&&`bg-card/40`),...o,children:(0,H.jsx)(gp,{isOpen:a,label:t,header:(0,H.jsxs)(`div`,{className:`flex w-full`,children:[(0,H.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,H.jsx)(`span`,{className:R(e===0&&`text-lg`,e===1&&`text-md`,e===2&&`text-md`,e>=3&&`text-base`),children:t}),i&&(0,H.jsx)(`div`,{className:`flex w-auto items-center justify-between p-3`,children:i})]}),n&&(0,H.jsx)(`p`,{className:`pl-3 text-card-foreground text-sm`,children:n})]}),children:(0,H.jsx)(`div`,{className:`size-full px-2`,children:r})})}),vp=e=>{let{keyPath:t,section:n,onFocusKeyPath:r,focusedKeyPath:i=[]}=e;return n.map((n,a)=>{let o={key:a,type:k},s=[...t,o];return(0,H.jsx)(_p,{level:t.length,title:`${a}`,description:``,isSelected:Et(s,i),onClick:e=>{e.stopPropagation(),r(s)},children:(0,H.jsx)(Zp,{...e,keyPath:s,section:n})},JSON.stringify(n))})},yp=({choices:e=[],value:t,defaultValue:n,onChange:r,hoverable:i=!0,disabled:a=!1},o)=>{let[s,c]=(0,z.useState)(t??n??e[0].value),[l,u]=(0,z.useState)(null),d=(0,z.useRef)([]),f=(0,z.useRef)(null),{choiceIndicatorPosition:p}=O(d,{selector:e=>e?.getAttribute(`data-indicator`)===`true`,isHoverable:!1,orientation:o}),m=e.findIndex(e=>e.value===s),h=i&&l!==null?l:m;return(0,z.useEffect)(()=>{t!==void 0&&c(t)},[t]),{valueState:s,hoveredIndex:l,setHoveredIndex:u,optionsRefs:d,indicatorRef:f,choiceIndicatorPosition:p,selectedIndex:m,indicatorIndex:h,handleChange:e=>{c(e),r?.(e)},disabled:a}},bp=[{content:`Off`,value:!1},{content:`On`,value:!0}],xp=Ze(`flex h-fit w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-0.38`,{variants:{color:{primary:`border-primary text-primary`,secondary:`border-secondary text-secondary`,neutral:`border-neutral text-neutral`,white:`border-white text-white`,black:`border-black text-black`,text:`border-foreground text-foreground`,error:`border-error text-error`},disabled:{true:`cursor-not-allowed opacity-50`,false:``}},defaultVariants:{color:`text`,disabled:!1}}),Sp=Ze(`z-1 flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-background motion-reduce:transition-none`,{variants:{size:{xs:`px-2 py-0.5 text-xs`,sm:`px-2 py-1 text-xs`,md:`p-2 text-sm`,lg:`p-4 text-base`}},defaultVariants:{size:`md`}}),Cp=Ze(`absolute top-0 z-0 h-full w-auto rounded-full transition-all duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{primary:`bg-primary data-[indicator=true]:text-primary-foreground`,secondary:`bg-secondary data-[indicator=true]:text-secondary-foreground`,neutral:`bg-neutral data-[indicator=true]:text-white`,white:`bg-white data-[indicator=true]:text-black`,black:`bg-black data-[indicator=true]:text-white`,text:`bg-foreground data-[indicator=true]:text-background`,error:`bg-error data-[indicator=true]:text-white`}}}),wp=e=>{let{choices:t=bp,color:n=`primary`,size:r=`md`,className:i,itemClassName:a}=e,{selectedIndex:o,indicatorIndex:s,handleChange:c,optionsRefs:l,indicatorRef:u,choiceIndicatorPosition:d,setHoveredIndex:f,disabled:p}=yp({choices:t,value:e.value,defaultValue:e.defaultValue,onChange:e.onChange,hoverable:e.hoverable,disabled:e.disabled},`horizontal`);return(0,H.jsx)(`div`,{className:xp({color:n,disabled:p,className:i}),role:`tablist`,"aria-disabled":p?`true`:void 0,children:(0,H.jsxs)(`div`,{className:`relative flex size-full flex-row items-center justify-center`,children:[t.map((e,t)=>{let{content:n,value:i,...u}=e,d=typeof i==`string`||typeof i==`number`,m=t===o,h=t===s;return(0,z.createElement)(`button`,{...u,type:`button`,className:R(Sp({size:r}),p&&`cursor-not-allowed`,a),key:d?i:t,role:`tab`,onClick:()=>c(i),"aria-selected":m?`true`:void 0,"data-indicator":h?`true`:void 0,disabled:p,tabIndex:m?0:-1,ref:e=>{l.current[t]=e},onMouseEnter:()=>!p&&f(t),onMouseLeave:()=>!p&&f(null)},n)}),d&&(0,H.jsx)(`div`,{className:R(Cp({color:n})),style:d,ref:u})]})})},Tp=e=>{let t=(0,V.c)(15),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Nf(),c,l;if(t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Mt(i,n,s);if(e!==void 0&&typeof e!=`boolean`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(H.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[8]=e):e=t[8],l=e;break bb0}let u=n.length,d=e??r,f;t[9]!==n||t[10]!==o?(f=e=>{e.stopPropagation(),o(n)},t[9]=n,t[10]=o,t[11]=f):f=t[11];let p;t[12]!==n||t[13]!==a?(p=e=>a({keyPath:n,newValue:String(e)}),t[12]=n,t[13]=a,t[14]=p):p=t[14],c=(0,H.jsx)(`button`,{type:`button`,className:R(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,u===2&&`hover:bg-card/30`,u>=3&&``),onClick:f,children:(0,H.jsx)(wp,{value:d,onChange:p})})}t[0]=s,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=c,t[7]=l}else c=t[6],l=t[7];return l===Symbol.for(`react.early_return_sentinel`)?c:l},Ep=e=>{let{keyPath:t,section:n}=e;return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[N]).map(r=>{let i={type:N,key:r},a=[...t,i],o=n[N][r];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,z.createElement)(Zp,{...e,key:r,keyPath:a,section:o})]})})})},Dp=e=>{let{keyPath:t,section:n}=e;return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[h]).map(r=>{let i={type:h,key:r},a=[...t,i],o=n[h][r];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,z.createElement)(Zp,{...e,key:r,keyPath:a,section:o})]})})})},Op=(...e)=>e.filter(Boolean).join(` `),kp=Ze([`w-full select-text resize-none text-base shadow-none outline-none`,`transition-all duration-300 md:text-sm`,`ring-0`,`disabled:opacity-50`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`].join(` `),{variants:{variant:{default:[`text-foreground`,`bg-accent`,`ring-text/20`,`disabled:ring-0`,`hover:ring-3`,`focus-within:ring-4`,`focus-visible:outline-none focus-visible:ring-4`,`[box-shadow:none] focus:[box-shadow:none]`,`aria-invalid:border-error`].join(` `),invisible:`border-none text-inherit outline-none ring-0`},size:{sm:`px-2 py-2 text-sm md:py-1.5 md:text-xs`,md:`px-2 py-3 md:py-2`,lg:`p-4`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,size:`md`,validationStyleEnabled:`disabled`}}),Ap=({validationStyleEnabled:e=!1,variant:t,size:n,className:r,...i})=>(0,H.jsx)(`input`,{className:Op(kp({variant:t,size:n,validationStyleEnabled:e?`enabled`:`disabled`}),r),suppressHydrationWarning:!0,...i}),jp=({className:e,variant:t,validationStyleEnabled:n=!1,...r})=>(0,H.jsx)(`textarea`,{className:R(`resize-none`,kp({variant:t,validationStyleEnabled:n?`enabled`:`disabled`,className:e})),...r}),Mp=24,Np=12,Pp=({className:e,autoSize:t=!0,onChange:n,maxRows:r=999,ref:i,...a})=>{let o=(0,z.useRef)(null);(0,z.useImperativeHandle)(i,()=>o.current);let s=()=>{let e=o.current;if(!e||!t)return;let n=e.style;n.height=`auto`;let i=e.scrollHeight,a=Mp*r+Np;n.height=`${Math.max(Math.min(i,a),36)}px`};return(0,z.useLayoutEffect)(()=>{(a.value??a.defaultValue)&&s()},[a.value,a.defaultValue,t,r]),(0,H.jsx)(jp,{ref:e=>{o.current=e},onChange:e=>{n?.(e),s()},className:R(`overflow-y-auto`,t&&`resize-none`,e),...a})},Fp=({value:e=``,onCancel:t,onSave:n,onClick:r,children:a,isDisabled:o,...s})=>{let[c,l]=(0,z.useState)(!1),u=(0,z.useRef)(null),d=e=>{e.stopPropagation(),l(!1),n()},f=e=>{e.stopPropagation(),l(!1),t()},p=!e||e===``?`-`:e,m=(0,z.useCallback)(e=>{let t=window.getSelection();t&&t.toString().trim()!==``||u.current&&!u.current.contains(e.target)&&(l(!1),n())},[n]);return(0,z.useEffect)(()=>(c?document.addEventListener(`click`,m):document.removeEventListener(`click`,m),()=>document.removeEventListener(`click`,m)),[m,c]),(0,H.jsxs)(`span`,{className:`group/editable-field flex gap-2`,role:`button`,tabIndex:0,onClick:e=>{l(!0),r?.(e)},ref:u,...s,children:[(0,H.jsxs)(`div`,{className:R(`flex flex-1 gap-2`,c?`display`:`hidden`),children:[a,(0,H.jsx)(M,{label:`Save`,variant:`hoverable`,size:`icon-sm`,color:`text`,Icon:i,onClick:d,disabled:o,className:`!text-current`,role:`button`,tabIndex:0,"aria-label":`Save changes`,"data-testid":`editable-field-save-button`}),(0,H.jsx)(M,{label:`Cancel`,color:`text`,variant:`hoverable`,className:`!text-current`,size:`icon-sm`,Icon:pe,onClick:f,disabled:o,role:`button`,tabIndex:0,"aria-label":`Cancel changes`,"data-testid":`editable-field-cancel-button`})]},String(c)),(0,H.jsxs)(`div`,{className:R(`flex flex-1 gap-2`,c?`hidden`:`display`),children:[(0,H.jsx)(`span`,{className:`ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6`,children:p}),(0,H.jsx)(M,{label:`Edit`,Icon:tc,color:`text`,variant:`hoverable`,size:`icon-sm`,className:`!text-current invisible group-hover/editable-field:visible`,disabled:o,onClick:e=>{e.stopPropagation(),l(!0)}})]})]})},Ip=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,z.useRef)(null);(0,z.useImperativeHandle)(n,()=>i.current);let a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},s=r.value??i.current?.value??r.defaultValue??``;return(0,H.jsx)(Fp,{value:s,onCancel:o,onSave:a,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,H.jsx)(Pp,{className:`leading-6`,ref:i,onClick:e=>{e.preventDefault(),e.stopPropagation()},...r})})},Lp=e=>{let t=(0,V.c)(16),{keyPath:n,section:r,editedContent:i,editedContentValue:a,onContentChange:o,onFocusKeyPath:s,renderSection:c}=e,l=Nf(),u;t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==n?(u=a??Mt(i,n,l),t[0]=l,t[1]=i,t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=u;if(d&&typeof d!=`string`){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(H.Fragment,{children:`Error loading section - Edited content Incoherence with the original content format`}),t[5]=e):e=t[5],e}let f=n.length,p=String(d??r),m;if(t[6]!==p||t[7]!==n||t[8]!==f||t[9]!==o||t[10]!==s||t[11]!==c){let e;t[13]!==n||t[14]!==s?(e=e=>{e.stopPropagation(),s(n)},t[13]=n,t[14]=s,t[15]=e):e=t[15],m=(0,H.jsx)(`button`,{type:`button`,className:R(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,f===2&&`hover:bg-card/30`,f>=3&&``),onClick:e,children:typeof c==`function`?c(p):(0,H.jsx)(Ip,{"aria-label":`Editable field`,defaultValue:p,onSave:e=>o({keyPath:n,newValue:e}),onCancel:Rp})}),t[6]=p,t[7]=n,t[8]=f,t[9]=o,t[10]=s,t[11]=c,t[12]=m}else m=t[12];return m};function Rp(){return null}var zp=e=>{let t=(0,V.c)(10),{keyPath:n,section:r}=e,{addEditedContent:i}=Bf(),a;if(t[0]!==i||t[1]!==n||t[2]!==e||t[3]!==r){let o=Mt(e.editedContent,n),s=r[x],{content:c}=r,l=[...n,{type:x}],u;t[5]!==i||t[6]!==n||t[7]!==e.dictionary||t[8]!==r?(u=t=>{i(e.dictionary.localId,{...r,content:t.newValue},n)},t[5]=i,t[6]=n,t[7]=e.dictionary,t[8]=r,t[9]=u):u=t[9],a=(0,H.jsxs)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-neutral text-sm`,children:[s,` `]}),(0,H.jsx)(Lp,{...e,keyPath:l,section:c,editedContentValue:o?.content,onContentChange:u})]}),t[0]=i,t[1]=n,t[2]=e,t[3]=r,t[4]=a}else a=t[4];return a},Bp=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:ie}],i=n[ie];return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,H.jsx)(Zp,{...e,keyPath:r,section:i})})},Vp=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:it}],i=n[it];return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,H.jsx)(Zp,{...e,keyPath:r,section:i})})},Hp=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:l}],i=n[l];return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,H.jsx)(Zp,{...e,keyPath:r,section:i})})},Up=(0,z.memo)(e=>{let{keyPath:t,section:n,focusedKeyPath:r=[],onFocusKeyPath:i}=e;return(0,z.useMemo)(()=>Object.keys(n??{}).filter(e=>!Xp.includes(e)),[n]).map(a=>{let o={key:a,type:ue},s=[...t,o],c=Et(s,r);return(0,H.jsx)(_p,{level:t.length,title:Dt(a),description:``,isSelected:c,onClick:e=>{e.stopPropagation(),i(c?[]:s)},children:(0,H.jsx)(Zp,{...e,keyPath:s,section:n[a]})},a)})}),Wp=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,z.useRef)(null),a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()};(0,z.useImperativeHandle)(n,()=>i.current);let s=(0,z.useMemo)(()=>r.value??i.current?.value??r.defaultValue,[r.value,r.defaultValue,i.current?.value]);return(0,H.jsx)(Fp,{value:s,onCancel:o,onSave:a,children:(0,H.jsx)(Ap,{ref:i,...r})})},Gp=e=>{let t=(0,V.c)(17),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Nf(),c;t[0]!==s||t[1]!==i||t[2]!==n?(c=Mt(i,n,s),t[0]=s,t[1]=i,t[2]=n,t[3]=c):c=t[3];let l=c;if(l!==void 0&&typeof l!=`number`){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(H.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[4]=e):e=t[4],e}let u=n.length,d=String(l??r),f;if(t[5]!==d||t[6]!==n||t[7]!==u||t[8]!==a||t[9]!==o){let e;t[11]!==n||t[12]!==o?(e=e=>{e.stopPropagation(),o(n)},t[11]=n,t[12]=o,t[13]=e):e=t[13];let r;t[14]!==n||t[15]!==a?(r=e=>a({keyPath:n,newValue:e}),t[14]=n,t[15]=a,t[16]=r):r=t[16],f=(0,H.jsx)(`button`,{type:`button`,className:R(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,u===2&&`hover:bg-card/30`,u>=3&&``),onClick:e,children:(0,H.jsx)(Wp,{"aria-label":`Editable number field`,type:`number`,defaultValue:d,onSave:r,onCancel:Kp})}),t[5]=d,t[6]=n,t[7]=u,t[8]=a,t[9]=o,t[10]=f}else f=t[10];return f};function Kp(){return null}var qp=e=>{let{keyPath:t,section:n}=e;return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n).filter(e=>!Xp.includes(e)).map(r=>{let i={type:_,key:r},a=[...t,i],o=n[_][r];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,z.createElement)(Zp,{...e,key:r,keyPath:a,section:o})]})})})},Jp=e=>{let{keyPath:t,section:n}=e,r=n[C];return(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(r).map(n=>{let i={type:C,key:n},a=[...t,i];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex items-center font-bold`,children:n}),(0,z.createElement)(Zp,{...e,key:n,keyPath:a,section:r[n]})]})})})},Yp=e=>{let{keyPath:t,section:n,locale:r}=e,i={type:ge,key:r},a=[...t,i],o=n[ge][r];return(0,H.jsx)(Zp,{...e,keyPath:a,section:o})},Xp=[`filePath`,`id`,`nodeType`],Zp=(0,z.memo)(e=>{let t=Nf(),n=(0,z.useMemo)(()=>Mt(e.editedContent,e.keyPath,t)??e.section,[e.editedContent,e.keyPath,e.section]),r=(0,z.useMemo)(()=>zt(n),[n]);if(typeof n==`object`)return r===`reactNode`?(0,H.jsx)(`span`,{className:`text-neutral text-xs`,children:`React node not editable`}):r===`nested`?(0,H.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:`[Nested] Dictionary`}):r===`markdown`?(0,H.jsx)(Hp,{...e,section:n}):r===`html`?(0,H.jsx)(Bp,{...e,section:n}):r===`translation`?(0,H.jsx)(Yp,{...e,section:n}):r===`enumeration`?(0,H.jsx)(Dp,{...e,section:n}):r===`plural`?(0,H.jsx)(qp,{...e,section:n}):r===`select`?(0,H.jsx)(Jp,{...e,section:n}):r===`condition`?(0,H.jsx)(Ep,{...e,section:n}):r===`insertion`?(0,H.jsx)(Vp,{...e,section:n}):r===`array`?(0,H.jsx)(vp,{...e,section:n}):r===`file`?(0,H.jsx)(zp,{...e,section:n}):(0,H.jsx)(Up,{...e,section:n});if(typeof n==`string`)return(0,H.jsx)(Lp,{...e,section:n});if(typeof n==`number`)return(0,H.jsx)(Gp,{...e,section:n});if(typeof n==`boolean`)return(0,H.jsx)(Tp,{...e,section:n})}),Qp=e=>{let t=(0,V.c)(6),{dictionary:n,...r}=e,i=Nf(),{editedContent:a,addEditedContent:o}=Bf(),{focusedContent:s,setFocusedContentKeyPath:c}=Ff(),l;t[0]!==n||t[1]!==a?(l=JSON.stringify((a?.[n.localId]??n).content),t[0]=n,t[1]=a,t[2]=l):l=t[2];let u;return t[3]!==o||t[4]!==n.localId?(u=e=>{o(n.localId,e.newValue,e.keyPath)},t[3]=o,t[4]=n.localId,t[5]=u):u=t[5],(0,H.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,z.createElement)(Zp,{...r,keyPath:[],locale:i,dictionary:n,key:`${l}${i}`,editedContent:a?.[n.localId]?.content,focusedKeyPath:s?.keyPath,section:n.content,onContentChange:u,onFocusKeyPath:c})})},$p=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:a,validate:o,additionalButtons:s,...c}=e,[l,u]=(0,z.useState)(n),[d,f]=(0,z.useState)(0),p=l!==n,m;t[0]===n?m=t[1]:(m=()=>{u(n),f(em)},t[0]=n,t[1]=m);let h=m,g;t[2]!==l||t[3]!==r?(g=()=>{r(l)},t[2]=l,t[3]=r,t[4]=g):g=t[4];let _=g,v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{u(e.currentTarget.value)},t[5]=v):v=t[5];let y=v,b=e=>{e.key===`Enter`&&!a&&C?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),h())},x,S;t[6]===n?(x=t[7],S=t[8]):(x=()=>{u(n),f(tm)},S=[n],t[6]=n,t[7]=x,t[8]=S),(0,z.useEffect)(x,S);let C=o?.(l)??!0;return(0,H.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor input`,children:[(0,H.jsx)(Ap,{onChange:y,onKeyDown:b,"aria-label":`Editable input value`,"aria-describedby":p||s?`content-editor-input-actions`:void 0,"aria-invalid":!C,variant:`invisible`,className:`size-full`,defaultValue:n,disabled:a,...c},d),(p||s)&&(0,H.jsxs)(`div`,{id:`content-editor-input-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[p&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(M,{Icon:i,label:`Save changes${C?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:a||!C,onClick:_,"aria-describedby":C?void 0:`validation-error`}),(0,H.jsx)(M,{Icon:pe,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:h,disabled:a})]}),s]})]},String(n))};function em(e){return e+1}function tm(e){return e+1}var nm=``,rm=e=>{let t=e.querySelectorAll(`[data-line]`);return t.length===0?(e.textContent??``).split(nm).join(``):Array.from(t).map(e=>{let t=e.querySelector(`[data-editable]`)?.textContent??e.textContent??``;return t===nm?``:t.split(nm).join(``)}).join(`
|
|
45
|
+
`)},im=e=>{let t=e.split(`
|
|
46
|
+
`);return t.length===0?[``]:t},am=(()=>{if(typeof Intl>`u`||!(`Segmenter`in Intl))return null;let e=Intl.Segmenter;return new e(void 0,{granularity:`grapheme`})})(),om=(e,t)=>{if(t<=0)return 0;if(am){let n=[...am.segment(e.slice(0,t))],r=n[n.length-1];return r?t-r.segment.length:t-1}let n=e.charCodeAt(t-1);return n>=56320&&n<=57343&&t>=2?t-2:t-1},sm=(e,t)=>{if(t>=e.length)return e.length;if(am){let n=[...am.segment(e.slice(t))][0];return n?t+n.segment.length:t+1}let n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length?t+2:t+1},cm=(e,t)=>{if(t<=0)return 0;let n=t-1;for(;n>0&&/\s/.test(e[n-1]);)n--;for(;n>0&&/\S/.test(e[n-1]);)n--;return n},lm=(e,t)=>{if(t>=e.length)return e.length;let n=t;for(;n<e.length&&/\S/.test(e[n]);)n++;for(;n<e.length&&/\s/.test(e[n]);)n++;return n},um=(e,t)=>e.slice(0,t).lastIndexOf(`
|
|
47
|
+
`)+1,dm=(e,t)=>{let n=e.indexOf(`
|
|
48
|
+
`,t);return n===-1?e.length:n},fm=({value:e,defaultValue:t,onChange:n,disabled:r=!1})=>{let i=e??t??``,[a,o]=(0,z.useState)(()=>im(i)),s=(0,z.useRef)(null),c=(0,z.useRef)(null),l=e!==void 0,u=(0,z.useRef)(a);u.current=a,(0,z.useEffect)(()=>{l&&e!==void 0&&o(im(e))},[e,l]);let d=()=>u.current.join(`
|
|
49
|
+
`),f=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`);for(let e=0;e<n.length;e++)if(n[e].contains(t.startContainer))return{line:e,offset:t.startOffset};return null},p=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`),r=u.current,i=(e,t)=>{for(let i=0;i<n.length;i++)if(n[i].contains(e)){let e=0;for(let t=0;t<i;t++)e+=r[t].length+1;return e+Math.min(t,r[i]?.length??0)}return e===s.current?t===0?0:r.join(`
|
|
50
|
+
`).length:0},a=i(t.startContainer,t.startOffset),o=i(t.endContainer,t.endOffset);return{start:Math.min(a,o),end:Math.max(a,o),hasSelection:!t.collapsed}},m=e=>{if(!s.current)return;let t=s.current.querySelectorAll(`[data-line]`)[e.line];if(!t)return;let n=t.querySelector(`[data-editable]`),r=n?.firstChild??n??t.firstChild??t,i=window.getSelection();if(!i)return;let a=document.createRange(),o=Math.min(e.offset,r.textContent?.length??0);try{a.setStart(r,o),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}catch{a.selectNodeContents(r),a.collapse(!1),i.removeAllRanges(),i.addRange(a)}};(0,z.useLayoutEffect)(()=>{c.current&&s.current&&(m(c.current),c.current=null)});let h=e=>{let t=u.current,n=0;for(let r=0;r<e.line;r++)n+=t[r].length+1;return n+e.offset},g=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){if(n<=t[e].length)return{line:e,offset:n};n-=t[e].length+1}return{line:t.length-1,offset:t[t.length-1]?.length??0}},_=()=>{let e=f();return e?h(e):0},v=(e,t)=>{let r=im(e);c.current=g(t,r),o(r),n?.(e)};return{lines:a,containerRef:s,getText:d,handleInput:()=>{if(c.current!==null||r||!s.current)return;let e=f(),t=rm(s.current),i=im(t);c.current=e,o(i),n?.(t)},handleBeforeInput:e=>{if(r)return;let t=e.nativeEvent;if(t.isComposing)return;let n=t.inputType;if(n!==`insertParagraph`&&n!==`insertLineBreak`){if(n===`deleteContentBackward`||n===`deleteContentForward`){e.preventDefault();let t=p();if(!t)return;let r=u.current.join(`
|
|
51
|
+
`);if(t.hasSelection){let e=r.slice(0,t.start)+r.slice(t.end);v(e,t.start)}else if(n===`deleteContentBackward`){if(t.start===0)return;let e=om(r,t.start),n=r.slice(0,e)+r.slice(t.start);v(n,e)}else{if(t.start>=r.length)return;let e=sm(r,t.start),n=r.slice(0,t.start)+r.slice(e);v(n,t.start)}return}if(n===`insertReplacementText`){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
52
|
+
`),i=t.data??t.dataTransfer?.getData(`text/plain`)??``,a=r.slice(0,n.start)+i+r.slice(n.end);v(a,n.start+i.length);return}if(n===`insertText`&&t.data){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
53
|
+
`),i=t.data,a=r.slice(0,n.start)+i+r.slice(n.end);v(a,n.start+i.length)}}},handleKeyDown:e=>{if(r){e.preventDefault();return}if(e.nativeEvent.isComposing)return;if((e.metaKey||e.ctrlKey)&&e.key===`z`){e.preventDefault();return}let t=p();if(!t)return;let n=u.current.join(`
|
|
54
|
+
`);if(e.key===`Enter`){e.preventDefault();let r=n.slice(0,t.start)+`
|
|
55
|
+
`+n.slice(t.end);v(r,t.start+1);return}if(e.key===`Backspace`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);v(e,t.start)}else{if(t.start===0)return;let r;r=e.metaKey?um(n,t.start):e.altKey?cm(n,t.start):om(n,t.start);let i=n.slice(0,r)+n.slice(t.start);v(i,r)}return}if(e.key===`Delete`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);v(e,t.start)}else{if(t.start>=n.length)return;let r;r=e.metaKey?dm(n,t.start):e.altKey?lm(n,t.start):sm(n,t.start);let i=n.slice(0,t.start)+n.slice(r);v(i,t.start)}return}},handleCut:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=p();if(!t?.hasSelection)return;let n=u.current.join(`
|
|
56
|
+
`),i=n.slice(t.start,t.end);e.clipboardData.setData(`text/plain`,i);let a=n.slice(0,t.start)+n.slice(t.end);v(a,t.start)},handlePaste:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=e.clipboardData.getData(`text/plain`);if(!t)return;let n=p();if(!n)return;let i=u.current.join(`
|
|
57
|
+
`),a=i.slice(0,n.start)+t+i.slice(n.end);v(a,n.start+t.length)},handleDrop:e=>{e.preventDefault()},handleDragOver:e=>{e.preventDefault()},getCaretPosition:f,setCaretPosition:m,getCursorOffset:_,caretFromFlatOffset:g}},pm=({index:e,text:t,isLast:n,ghostText:r})=>(0,H.jsxs)(`span`,{"data-line":e,className:`block min-h-[1.5rem]`,children:[(0,H.jsx)(`span`,{"data-editable":!0,children:t||``}),r&&(0,H.jsx)(`span`,{"data-ghost":!0,className:`pointer-events-none select-none text-neutral`,"aria-hidden":`true`,children:r}),!n&&(0,H.jsx)(`br`,{})]}),mm=24,hm=12,gm=({value:e,defaultValue:t,onChange:n,placeholder:r,disabled:i=!1,minRows:a=1,maxRows:o=999,autoSize:s=!0,validationStyleEnabled:c=!1,variant:l,ghostText:u,ghostLine:d,ghostOffset:f,onClick:p,className:m,dir:h=`auto`,ref:g,..._})=>{let{lines:v,containerRef:y,getText:b,handleInput:x,handleBeforeInput:S,handleKeyDown:C,handleCut:w,handlePaste:T,handleDrop:E,handleDragOver:D,getCursorOffset:O,setCaretPosition:k,caretFromFlatOffset:ee}=fm({value:e,defaultValue:t,onChange:n,disabled:i}),A=(0,z.useRef)(null),j=e=>{A.current=e,y.current=e};(0,z.useImperativeHandle)(g,()=>({getContainer:()=>A.current,getText:b,focus:()=>A.current?.focus(),getCursorOffset:O,setCursorAtOffset:e=>{k(ee(e,v))}})),(0,z.useLayoutEffect)(()=>{if(!s||!A.current)return;let e=A.current,t=mm*o+hm,n=mm*a+hm;e.style.height=`auto`;let r=e.scrollHeight;e.style.height=`${Math.max(Math.min(r,t),n)}px`,e.style.overflowY=r>t?`auto`:`hidden`},[v,s,o,a]);let te=v.length===1&&v[0]===``,M=u&&d!==void 0&&f!==void 0;return(0,H.jsxs)(`div`,{className:`relative w-full`,children:[te&&r&&(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 select-none px-2 py-3 text-base text-neutral-400 leading-[1.5rem] md:py-2 md:text-sm`,"aria-hidden":`true`,children:r}),(0,H.jsx)(`div`,{..._,ref:j,role:`textbox`,"aria-multiline":`true`,"aria-placeholder":r,"aria-disabled":i,"aria-autocomplete":M?`inline`:void 0,tabIndex:i?-1:0,contentEditable:!i,suppressContentEditableWarning:!0,dir:h,onInput:x,onBeforeInput:S,onKeyDown:C,onCut:w,onPaste:T,onDrop:E,onDragOver:D,onClick:p,className:R(`resize-none whitespace-pre-wrap break-words outline-none`,kp({variant:l,validationStyleEnabled:c?`enabled`:`disabled`}),s&&`overflow-y-auto`,m),children:v.map((e,t)=>(0,H.jsx)(pm,{index:t,text:e,isLast:t===v.length-1,ghostText:M&&d===t?u:void 0},t))})]})},_m=({isActive:e=!0,suggestion:t,...n})=>{let r=String(n.value??n.defaultValue??``),[i,a]=(0,z.useState)(r),[o,s]=(0,z.useState)(``),c=(0,z.useRef)(null);(0,z.useEffect)(()=>{n.value!==void 0&&a(String(n.value??n.defaultValue??``))},[n.value,n.defaultValue]);let l=()=>{let e=t??o;if(!e)return;let n=c.current?.getCursorOffset()??i.length,r=i.slice(0,n)+e+i.slice(n);a(r),s(``),setTimeout(()=>{c.current?.focus(),c.current?.setCursorAtOffset(n+e.length)},0)},u=e?t??(o||void 0):void 0,d=i.split(`
|
|
58
|
+
`),f=t?d.length-1:void 0,p=t?d[d.length-1]?.length??0:void 0;return(0,H.jsx)(gm,{ref:c,value:i,onChange:e=>{if(a(e),s(``),n.onChange){let t={target:{value:e},currentTarget:{value:e}};n.onChange(t)}},onKeyDown:e=>{e.key===`Tab`&&(t??o)&&(e.preventDefault(),l()),n.onKeyDown?.(e)},ghostText:u,ghostLine:f,ghostOffset:p,placeholder:n.placeholder,disabled:n.disabled,autoSize:n.autoSize,maxRows:n.maxRows,minRows:n.rows,variant:n.variant,validationStyleEnabled:n.validationStyleEnabled,className:n.className,dir:n.dir,"aria-label":n[`aria-label`],"aria-invalid":n[`aria-invalid`],"aria-describedby":n[`aria-describedby`],"data-testid":n[`data-testid`]})},vm=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:a,validate:o,additionalButtons:s,...c}=e,{isAuthenticated:l}=rp(),[u,d]=(0,z.useState)(n),[f,p]=(0,z.useState)(0),m=u!==n,h;t[0]===n?h=t[1]:(h=()=>{d(n),p(ym)},t[0]=n,t[1]=h);let g=h,_;t[2]!==u||t[3]!==r?(_=()=>{r(u)},t[2]=u,t[3]=r,t[4]=_):_=t[4];let v=_,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>d(e.currentTarget.value??``),t[5]=y):y=t[5];let b=y,x=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!a&&w?(e.preventDefault(),v()):e.key===`Escape`&&(e.preventDefault(),g())},S,C;t[6]===n?(S=t[7],C=t[8]):(S=()=>{d(n),p(bm)},C=[n],t[6]=n,t[7]=S,t[8]=C),(0,z.useEffect)(S,C);let w=o?.(u)??!0;return(0,H.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[(0,H.jsx)(_m,{onChange:b,onKeyDown:x,variant:`invisible`,className:`size-full`,value:n,isActive:l,disabled:a,"aria-label":`Editable textarea content`,"aria-describedby":m||s?`content-editor-textarea-actions`:void 0,"aria-invalid":!w,...c},f),(m||s)&&(0,H.jsxs)(`div`,{id:`content-editor-textarea-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[m&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(M,{Icon:i,label:`Save changes${w?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:a||!w,onClick:v,"aria-describedby":w?void 0:`textarea-validation-error`}),(0,H.jsx)(M,{Icon:pe,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:g,disabled:a})]}),s]})]},n)};function ym(e){return e+1}function bm(e){return e+1}var xm=(e,t,n)=>{let r={...e};for(let i of Object.keys(e))i===t?(r[n]=e[t],delete r[t]):r[i]=e[i];return r},Sm=({htmlFor:e,required:t=!1,disabled:n=!1,className:r,children:i,...a})=>(0,H.jsxs)(`label`,{className:R(`select-none font-medium text-sm leading-none`,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,n&&`cursor-not-allowed text-muted-foreground opacity-70`,r),htmlFor:e,suppressHydrationWarning:!0,...a,children:[i,t&&(0,H.jsx)(`span`,{className:`ml-1 text-error`,"aria-hidden":`true`,title:`This field is required`,children:`*`})]}),Cm=(0,z.createContext)({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),wm=()=>(0,z.useContext)(Cm),Tm=e=>{let t=(0,V.c)(16),{availableLocales:n,defaultSelectedLocales:r,children:i}=e,{locale:a}=Ht(),s;t[0]!==r||t[1]!==a?(s=r??[a],t[0]=r,t[1]=a,t[2]=s):s=t[2];let[c,l]=o(`locale-content-selector-selected-locales`,s),u;t[3]!==n||t[4]!==r||t[5]!==a||t[6]!==c||t[7]!==l?(u=()=>{if(n.length&&!c?.some(e=>n.includes(e))){let e=r?.filter(e=>n.includes(e));l(e?.length?e:[a])}},t[3]=n,t[4]=r,t[5]=a,t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=[n],t[9]=n,t[10]=d),(0,z.useEffect)(u,d);let f;return t[11]!==n||t[12]!==i||t[13]!==c||t[14]!==l?(f=(0,H.jsx)(Cm,{value:{availableLocales:n,selectedLocales:c,setSelectedLocales:l},children:i}),t[11]=n,t[12]=i,t[13]=c,t[14]=l,t[15]=f):f=t[15],f},Em=e=>{let t,n;if(typeof e==`number`||!Number.isNaN(Number(e)))t=`=`,n=e.toString();else if(typeof e==`string`){let r=[`<=`,`>=`,`<`,`>`,`=`].find(t=>e.startsWith(t));r&&(t=r,n=e.slice(r.length))}return{comparator:t,numberValue:n}},Dm=e=>{let t=(0,V.c)(13),{value:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=Em(n),t[0]=n,t[1]=i);let{comparator:a,numberValue:o}=i,[s,c]=(0,z.useState)(a??null),[l,u]=(0,z.useState)(o??null),d,f;t[2]!==s||t[3]!==a||t[4]!==o||t[5]!==l||t[6]!==r?(d=()=>{s&&l&&(s!==a||l!==o)&&r(`${s}${l}`)},f=[s,a,o,l,r],t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=r,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,z.useEffect)(d,f);let p;if(t[9]!==a||t[10]!==l){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>u(e.target.value),t[12]=e):e=t[12],p=(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsxs)(L,{onValueChange:c,defaultValue:a,children:[(0,H.jsx)(L.Trigger,{className:`w-20`,children:(0,H.jsx)(L.Value,{placeholder:`Select a comparator`})}),(0,H.jsxs)(L.Content,{children:[(0,H.jsx)(L.Item,{value:`<`,children:`<`}),(0,H.jsx)(L.Item,{value:`<=`,children:`<=`}),(0,H.jsx)(L.Item,{value:`=`,children:`=`}),(0,H.jsx)(L.Item,{value:`>=`,children:`>=`}),(0,H.jsx)(L.Item,{value:`>`,children:`>`})]})]}),(0,H.jsx)(Ap,{type:`number`,"aria-label":`Quantity`,defaultValue:l??void 0,onChange:e,className:`min-w-4`})]}),t[9]=a,t[10]=l,t[11]=p}else p=t[11];return p},Om=({rawContent:e})=>{let[t,n]=(0,z.useState)(``);return(0,z.useEffect)(()=>{Ct(async()=>{let{default:e}=await import(`./purify.es-ChwZkWde.js`);return{default:e}},[]).then(({default:t})=>{n(t.sanitize(e))})},[e]),t?(0,H.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):(0,H.jsx)(`div`,{})},km=(0,z.lazy)(()=>Ct(()=>import(`./MarkDownRender-CiKQVquM.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3,4]))),Am=(0,z.lazy)(()=>Ct(()=>import(`./MarkdownEditor-QEPrPZ-E.js`).then(e=>({default:e.MarkdownEditor})),__vite__mapDeps([5,2,3,4,1,6]))),jm=(0,z.memo)(function(e){let t=(0,V.c)(2),{label:n,...r}=e,[i,a]=(0,z.useState)(!1),o;return t[0]===i?o=t[1]:(o=e=>{e&&!i&&a(!0)},t[0]=i,t[1]=o),(0,H.jsx)(gp,{header:n,label:n,onToggle:o,children:i?(0,H.jsx)(Xm,{...r}):null})}),Mm=e=>{let t=(0,V.c)(14),{keyPath:n,dictionary:r,...i}=e,{editedContent:a,addEditedContent:o}=Bf(),s=Rf(),{mutate:c,isPending:l}=sp(),u;t[0]!==o||t[1]!==r||t[2]!==n?(u=e=>o(r.localId,e,n),t[0]=o,t[1]=r,t[2]=n,t[3]=u):u=t[3];let d;return t[4]!==o||t[5]!==c||t[6]!==s?.ai?.apiKey||t[7]!==s?.ai?.model||t[8]!==s?.ai?.temperature||t[9]!==s?.internationalization||t[10]!==r||t[11]!==a||t[12]!==n?(d=()=>{c({fileContent:JSON.stringify({...r,...a?.[r.localId]??{}}),keyPath:n,locales:s?.internationalization.locales??[],aiOptions:{apiKey:s?.ai?.apiKey,model:s?.ai?.model,temperature:s?.ai?.temperature}},{onSuccess:e=>{if(e?.data)try{let t=e.data.fileContent;o(r.localId,t,n)}catch(e){console.error(e)}}})},t[4]=o,t[5]=c,t[6]=s?.ai?.apiKey,t[7]=s?.ai?.model,t[8]=s?.ai?.temperature,t[9]=s?.internationalization,t[10]=r,t[11]=a,t[12]=n,t[13]=d):d=t[13],(0,H.jsx)(vm,{variant:`default`,onContentChange:u,additionalButtons:(0,H.jsx)(M,{Icon:sc,label:`Audit`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,isLoading:l,onClick:d}),...i})},Nm=e=>{let t=(0,V.c)(4),{keyPath:n,dictionary:r,...i}=e,{addEditedContent:a}=Bf(),o;return t[0]!==a||t[1]!==r||t[2]!==n?(o=e=>a(r.localId,e,n),t[0]=a,t[1]=r,t[2]=n,t[3]=o):o=t[3],(0,H.jsx)($p,{variant:`default`,onContentChange:o,...i})},Pm=[{content:`False`,value:!1},{content:`True`,value:!0}],Fm=e=>{let t=(0,V.c)(4),{dictionary:n,keyPath:r,...i}=e,{addEditedContent:a}=Bf(),o;return t[0]!==a||t[1]!==n||t[2]!==r?(o=e=>a(n.localId,e,r),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3],(0,H.jsx)(wp,{choices:Pm,value:!0,onChange:o,color:`text`,size:`sm`,...i})},Im=e=>{let t=(0,V.c)(15),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{locale:o,defaultLocale:s}=Ht(),{selectedLocales:c}=wm(),l=n[ge],u;if(t[0]!==l||t[1]!==s||t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a||t[6]!==c){let e;t[8]!==l||t[9]!==s||t[10]!==i||t[11]!==r||t[12]!==o||t[13]!==a?(e=e=>{let t=`${JSON.stringify(r)}-translation-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:At(e,o)})}),(0,H.jsx)(`tr`,{className:`flex`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Zm,{section:l[e]??Pt(l[s]),keyPath:[...r,{type:ge,key:e}],dictionary:i,renderSection:a})})})]},t)},t[8]=l,t[9]=s,t[10]=i,t[11]=r,t[12]=o,t[13]=a,t[14]=e):e=t[14],u=(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:c.map(e)})}),t[0]=l,t[1]=s,t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=c,t[7]=u}else u=t[7];return u},Lm=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Bf(),{addNewEnumeration:s,removeEnumeration:c}=F(`navigation-view`),l=n[h],u;t[0]===l?u=t[1]:(u=Object.keys(l),t[0]=l,t[1]=u);let d=u[0],f;if(t[2]!==o||t[3]!==s.label.value||t[4]!==s.text||t[5]!==l||t[6]!==i||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==a||t[11]!==n){let e;t[13]!==o||t[14]!==l||t[15]!==i||t[16]!==d||t[17]!==r?(e=()=>o(i.localId,Pt(l[d])??``,[...r,{type:h,key:`unknown`}]),t[13]=o,t[14]=l,t[15]=i,t[16]=d,t[17]=r,t[18]=e):e=t[18],f=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(n[h]).map(e=>{let t=[...r,{type:h,key:e}],s=`${JSON.stringify(r)}-enumeration-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(`div`,{className:`flex flex-1`,children:(0,H.jsx)(M,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,Icon:oc,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,H.jsx)(`tr`,{className:`w-full p-2`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Dm,{value:e,onChange:t=>{let a=n[h],s=xm(a,e,t),c={...n,[h]:s};console.log(`newValue`,c),o(i.localId,c,r)}})})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Xm,{section:l[e]??Pt(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,H.jsx)(M,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:nc,className:`m-2`,children:s.text})]}),t[2]=o,t[3]=s.label.value,t[4]=s.text,t[5]=l,t[6]=i,t[7]=d,t[8]=r,t[9]=c,t[10]=a,t[11]=n,t[12]=f}else f=t[12];return f},Rm=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Bf(),{addNewSelectCase:s,removeSelectCase:c}=F(`navigation-view`),l=n[C],u;t[0]===l?u=t[1]:(u=Object.keys(l),t[0]=l,t[1]=u);let d=u[0],f;if(t[2]!==o||t[3]!==s.label.value||t[4]!==s.text||t[5]!==l||t[6]!==i||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==a||t[11]!==n){let e;t[13]!==o||t[14]!==l||t[15]!==i||t[16]!==d||t[17]!==r?(e=()=>o(i.localId,Pt(l[d])??``,[...r,{type:C,key:`newCase`}]),t[13]=o,t[14]=l,t[15]=i,t[16]=d,t[17]=r,t[18]=e):e=t[18],f=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(l).map(e=>{let t=[...r,{type:C,key:e}],s=`${JSON.stringify(r)}-select-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(`div`,{className:`flex flex-1`,children:(0,H.jsx)(M,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,Icon:oc,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,H.jsx)(`tr`,{className:`w-full p-2`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)($p,{"aria-label":`Edit case`,type:`text`,variant:`default`,onContentChange:t=>{let a={...n,[C]:xm(l,e,String(t))};o(i.localId,a,r)},children:e})})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Xm,{section:l[e]??Pt(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,H.jsx)(M,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:nc,className:`m-2`,children:s.text})]}),t[2]=o,t[3]=s.label.value,t[4]=s.text,t[5]=l,t[6]=i,t[7]=d,t[8]=r,t[9]=c,t[10]=a,t[11]=n,t[12]=f}else f=t[12];return f},zm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[N];return(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`true`,`false`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-condition-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Zm,{section:i[e]??Pt(i.true),keyPath:[...t,{type:N,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},Bm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[D];return(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`male`,`female`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-gender-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Zm,{section:i[e]??Pt(i.male),keyPath:[...t,{type:D,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},Vm=[`zero`,`one`,`two`,`few`,`many`,`other`],Hm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[_];return(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Vm.map(e=>{let a=`${JSON.stringify(t)}-plural-${e}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:e})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Zm,{section:i[e]??Pt(i.other),keyPath:[...t,{type:_,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},Um=e=>{let t=(0,V.c)(22),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Bf(),{addNewElement:s,removeElement:c}=F(`navigation-view`),l;if(t[0]!==o||t[1]!==s.label.value||t[2]!==s.text||t[3]!==i||t[4]!==r||t[5]!==c||t[6]!==a||t[7]!==n){let e;t[9]!==o||t[10]!==i||t[11]!==r||t[12]!==c||t[13]!==a||t[14]!==n[0]?(e=(e,t)=>{let s=`${JSON.stringify(r)}-array-${t}`;return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 w-full p-2`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`text-xs`,children:String(t)}),(0,H.jsx)(M,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,onClick:()=>{let e=[...r,{type:k,key:t}];o(i.localId,void 0,e)},Icon:oc,children:c.text})]})})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Zm,{section:e??Pt(n[0]),keyPath:[...r,{type:k,key:t}],dictionary:i,renderSection:a})})})]},s)},t[9]=o,t[10]=i,t[11]=r,t[12]=c,t[13]=a,t[14]=n[0],t[15]=e):e=t[15];let u;t[16]!==o||t[17]!==i||t[18]!==r||t[19]!==n[0]||t[20]!==n.length?(u=()=>{let e=[...r,{type:k,key:n.length}];o(i.localId,Pt(n[0])??``,e,!1)},t[16]=o,t[17]=i,t[18]=r,t[19]=n[0],t[20]=n.length,t[21]=u):u=t[21],l=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:n.map(e)})}),(0,H.jsx)(M,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:u,Icon:nc,children:s.text})]}),t[0]=o,t[1]=s.label.value,t[2]=s.text,t[3]=i,t[4]=r,t[5]=c,t[6]=a,t[7]=n,t[8]=l}else l=t[8];return l},Wm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e,a=Object.keys(i)[0];return(0,H.jsx)(`table`,{className:`w-full`,children:(0,H.jsx)(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(i).map(e=>{let o=[...t,{type:ue,key:e}],s=i[e]??Pt(i[a]),c=`${JSON.stringify(t)}-object-${e}`;return typeof s!=`object`||!s?(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`tr`,{className:`mt-2 p-2 text-xs`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,H.jsx)(`tr`,{className:`block w-full`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(Xm,{section:s,keyPath:o,dictionary:n,renderSection:r})})})]},c):(0,H.jsx)(`tr`,{className:`block w-full border-neutral/10 border-t py-1`,children:(0,H.jsx)(`td`,{className:`flex w-full`,children:(0,H.jsx)(jm,{label:Dt(e),section:s,keyPath:o,dictionary:n,renderSection:r})})},c)})})})},Gm=e=>{let t=(0,V.c)(5),{section:n,keyPath:r,dictionary:i}=e,[a,o]=(0,z.useState)(0),s;if(t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n){let e=[{content:`Edit`,value:0},{content:`Preview`,value:1}],c=[...r,{type:ie}],l=n[ie];s=(0,H.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,H.jsx)(wp,{choices:e,value:a,onChange:o,color:`text`,size:`sm`,className:`ml-auto`}),(0,H.jsx)(Zm,{section:l,keyPath:c,dictionary:i,renderSection:a===1?Qm:void 0})]}),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s}else s=t[4];return s},Km=e=>{let t=(0,V.c)(9),{section:n,keyPath:r,dictionary:i}=e,[a,o]=(0,z.useState)(0),{addEditedContent:s}=Bf(),c;if(t[0]!==s||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e=[{content:`Edit`,value:0},{content:`Raw`,value:1},{content:`Preview`,value:2}],u=[...r,{type:l}],d=n.markdown??``,f;t[6]!==s||t[7]!==i?(f=(e,t)=>(0,H.jsx)(z.Suspense,{fallback:(0,H.jsx)(m,{}),children:(0,H.jsx)(Am,{defaultValue:e,onChange:e=>s(i.localId,e,t)},JSON.stringify(t))}),t[6]=s,t[7]=i,t[8]=f):f=t[8];let p=f,h=$m;c=(0,H.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,H.jsx)(wp,{choices:e,value:a,onChange:o,color:`text`,size:`sm`,className:`ml-auto`}),(0,H.jsx)(Zm,{section:d,keyPath:u,dictionary:i,renderSection:a===0?p:a===2?h:void 0})]}),t[0]=s,t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=c}else c=t[5];return c},qm=({section:e,keyPath:t,...n})=>{let r=[...t,{type:it}],i=e[it];return(0,H.jsx)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:(0,H.jsx)(Zm,{section:i,keyPath:r,...n})})},Jm=({section:e,keyPath:t,...n})=>{let r=[...t,{type:x}],i=e[x],{content:a}=e;return(0,H.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,H.jsxs)(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),(0,H.jsx)(Zm,{section:a,keyPath:r,...n})]})},Ym=e=>{let{keyPath:t,dictionary:n,renderSection:r,section:i,...a}=e,{addEditedContent:o}=Bf(),s=i[ce],c=[...t,{type:ce}];return(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[(0,H.jsx)(Sm,{children:`Dictionary key`}),(0,H.jsx)($p,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,dictionaryKey:String(e)},c)},children:s.dictionaryKey??``}),(0,H.jsx)(Sm,{children:`Path (optional)`}),(0,H.jsx)($p,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,path:e===``?void 0:e},c)},children:s.path??``})]})},Xm=(0,z.memo)(function(e){let t=(0,V.c)(85),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{tsxNotEditable:o}=F(`navigation-view`),s,c;if(t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==o){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=zt(n);if(e===`reactNode`){let e;t[7]===o?e=t[8]:(e=(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,H.jsx)(`span`,{children:`(React Node)`}),(0,H.jsx)(`span`,{className:`flex text-muted-foreground text-xs`,children:o})]}),t[7]=o,t[8]=e),c=e;break bb0}if(e===`nested`){let e;t[9]!==i||t[10]!==r||t[11]!==a||t[12]!==n?(e=(0,H.jsx)(Ym,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[9]=i,t[10]=r,t[11]=a,t[12]=n,t[13]=e):e=t[13],c=e;break bb0}if(e===`translation`){let e;t[14]!==i||t[15]!==r||t[16]!==a||t[17]!==n?(e=(0,H.jsx)(Im,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[14]=i,t[15]=r,t[16]=a,t[17]=n,t[18]=e):e=t[18],c=e;break bb0}if(e===`enumeration`){let e;t[19]!==i||t[20]!==r||t[21]!==a||t[22]!==n?(e=(0,H.jsx)(Lm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[19]=i,t[20]=r,t[21]=a,t[22]=n,t[23]=e):e=t[23],c=e;break bb0}if(e===`condition`){let e;t[24]!==i||t[25]!==r||t[26]!==a||t[27]!==n?(e=(0,H.jsx)(zm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[24]=i,t[25]=r,t[26]=a,t[27]=n,t[28]=e):e=t[28],c=e;break bb0}if(e===`select`){let e;t[29]!==i||t[30]!==r||t[31]!==a||t[32]!==n?(e=(0,H.jsx)(Rm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[29]=i,t[30]=r,t[31]=a,t[32]=n,t[33]=e):e=t[33],c=e;break bb0}if(e===`gender`){let e;t[34]!==i||t[35]!==r||t[36]!==a||t[37]!==n?(e=(0,H.jsx)(Bm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[34]=i,t[35]=r,t[36]=a,t[37]=n,t[38]=e):e=t[38],c=e;break bb0}if(e===`plural`){let e;t[39]!==i||t[40]!==r||t[41]!==a||t[42]!==n?(e=(0,H.jsx)(Hm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[39]=i,t[40]=r,t[41]=a,t[42]=n,t[43]=e):e=t[43],c=e;break bb0}if(e===`insertion`){let e;t[44]!==i||t[45]!==r||t[46]!==a||t[47]!==n?(e=(0,H.jsx)(qm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[44]=i,t[45]=r,t[46]=a,t[47]=n,t[48]=e):e=t[48],c=e;break bb0}if(e===`markdown`){let e;t[49]!==i||t[50]!==r||t[51]!==n?(e=(0,H.jsx)(Km,{dictionary:i,keyPath:r,section:n}),t[49]=i,t[50]=r,t[51]=n,t[52]=e):e=t[52],c=e;break bb0}if(e===`html`){let e;t[53]!==i||t[54]!==r||t[55]!==n?(e=(0,H.jsx)(Gm,{dictionary:i,keyPath:r,section:n}),t[53]=i,t[54]=r,t[55]=n,t[56]=e):e=t[56],c=e;break bb0}if(e===`file`){let e;t[57]!==i||t[58]!==r||t[59]!==a||t[60]!==n?(e=(0,H.jsx)(Jm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[57]=i,t[58]=r,t[59]=a,t[60]=n,t[61]=e):e=t[61],c=e;break bb0}if(e===`array`){let e;t[62]!==i||t[63]!==r||t[64]!==a||t[65]!==n?(e=(0,H.jsx)(Um,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[62]=i,t[63]=r,t[64]=a,t[65]=n,t[66]=e):e=t[66],c=e;break bb0}if(e===`object`){let e;t[67]!==i||t[68]!==r||t[69]!==a||t[70]!==n?(e=(0,H.jsx)(Wm,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[67]=i,t[68]=r,t[69]=a,t[70]=n,t[71]=e):e=t[71],c=e;break bb0}if(e===`number`){let e;t[72]!==i||t[73]!==r||t[74]!==n?(e=(0,H.jsx)(`div`,{className:`w-full p-2`,children:(0,H.jsx)(Nm,{dictionary:i,keyPath:r,type:`number`,"aria-label":`Edit field`,children:n})}),t[72]=i,t[73]=r,t[74]=n,t[75]=e):e=t[75],c=e;break bb0}if(e===`text`){let e;t[76]!==i||t[77]!==r||t[78]!==a||t[79]!==n?(e=(0,H.jsx)(`div`,{className:`w-full p-2`,children:typeof a==`function`?a(n,r):(0,H.jsx)(Mm,{variant:`default`,"aria-label":`Edit field`,keyPath:r,dictionary:i,children:n})}),t[76]=i,t[77]=r,t[78]=a,t[79]=n,t[80]=e):e=t[80],c=e;break bb0}if(e===`boolean`){let e;t[81]!==i||t[82]!==r||t[83]!==n?(e=(0,H.jsx)(`div`,{className:`w-full p-2`,children:(0,H.jsx)(Fm,{dictionary:i,keyPath:r,value:n})}),t[81]=i,t[82]=r,t[83]=n,t[84]=e):e=t[84],c=e;break bb0}s=(0,H.jsxs)(`div`,{className:`w-full p-2`,children:[`Error. Format not supported.`,JSON.stringify(n,null,2),JSON.stringify(r,null,2),`NodeType : `,e]})}t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];return c===Symbol.for(`react.early_return_sentinel`)?s:c}),Zm=(0,z.memo)(function(e){return(0,H.jsx)(Ne,{border:!0,background:`none`,className:`top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky`,roundedSize:`2xl`,children:(0,H.jsx)(Xm,{...e})})});function Qm(e){return(0,H.jsx)(Om,{rawContent:e})}function $m(e){return(0,H.jsx)(z.Suspense,{fallback:(0,H.jsx)(m,{}),children:(0,H.jsx)(km,{children:e})})}var eh=Ze(`inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{color:{primary:`border-primary bg-primary text-primary hover:bg-primary-500`,secondary:`border-secondary bg-secondary text-secondary hover:bg-secondary-300`,success:`border-success bg-success text-success hover:bg-success-500`,error:`border-error bg-error text-error hover:bg-error-500`,neutral:`border-neutral bg-neutral text-muted-foreground hover:bg-neutral-600`,light:`border-white bg-white text-white hover:bg-neutral-500`,dark:`border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900`,text:`border-text bg-text text-foreground hover:opacity-80`,custom:``},variant:{default:`rounded-lg text-foreground-opposite`,none:`border-none bg-opacity-0 text-inherit hover:bg-opacity-0`,outline:`rounded-lg border-[1.3px] bg-opacity-0 hover:bg-opacity-30`,hoverable:`rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10`},size:{sm:`px-2 py-0.5 text-xs`,md:`px-2.5 py-0.5 text-xs`,lg:`px-3 py-1 text-sm`}},defaultVariants:{variant:`default`,color:`primary`,size:`md`}}),th=({className:e,variant:t=`default`,color:n=`primary`,size:r=`md`,children:i,clickable:a=!1,dismissible:o=!1,onClick:s,onDismiss:c,role:l,tabIndex:u,"aria-label":d,...f})=>{let p=a?`button`:`span`,m=e=>{a&&s&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(e))},h=e=>{e.stopPropagation(),c?.()};return(0,H.jsxs)(p,{className:R(eh({variant:t,color:n,size:r}),a&&`cursor-pointer hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2`,o&&`pr-1`,e),onClick:a?s:void 0,onKeyDown:a?m:void 0,role:l||(a?`button`:`status`),tabIndex:a?u??0:u,"aria-label":d||(a?`${i} button`:void 0),...f,children:[i,o&&(0,H.jsx)(`button`,{type:`button`,className:`ml-1 inline-flex h-4 w-4 items-center justify-center rounded-full hover:bg-black/10 focus:outline-none focus:ring-1 focus:ring-offset-1`,onClick:h,"aria-label":`Remove ${i} badge`,children:(0,H.jsxs)(`svg`,{className:`size-3`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-label":`Remove badge`,children:[(0,H.jsx)(`title`,{children:`Remove badge`}),(0,H.jsx)(`path`,{fillRule:`evenodd`,d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:`evenodd`})]})})]})},nh=Object.defineProperty,rh=(e,t)=>nh(e,`name`,{value:t,configurable:!0}),ih=`Dialog`,[ah,oh]=$e(ih),[sh,ch]=ah(ih),lh=rh(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=Me({prop:r,defaultProp:i??!1,onChange:a,caller:ih}),[f,p]=z.useState(0),[m,h]=z.useState(0);return(0,H.jsx)(sh,{scope:t,triggerRef:s,contentRef:c,contentId:d(),titleId:d(),descriptionId:d(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),uh=`DialogPortal`,[dh,fh]=ah(uh,{forceMount:void 0}),ph=rh(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ch(uh,t);return(0,H.jsx)(dh,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,H.jsx)(ve,{present:n||a.open,children:(0,H.jsx)(Be,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),mh=`DialogOverlay`,hh=z.forwardRef(rh(function(e,t){let n=fh(mh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ch(mh,e.__scopeDialog);return a.modal?(0,H.jsx)(ve,{present:r||a.open,children:(0,H.jsx)(_h,{...i,ref:t})}):null},`DialogOverlay`)),gh=_e(`DialogOverlay.RemoveScroll`),_h=z.forwardRef(rh(function(e,t){let{__scopeDialog:n,...r}=e,i=ch(mh,n),a=Se(),o=ye(t,a);return(0,H.jsx)(ke,{as:gh,allowPinchZoom:!0,shards:[i.contentRef],children:(0,H.jsx)(He.div,{"data-state":Ch(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),vh=`DialogContent`,yh=z.forwardRef(rh(function(e,t){let n=fh(vh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ch(vh,e.__scopeDialog);return(0,H.jsx)(ve,{present:r||a.open,children:a.modal?(0,H.jsx)(bh,{...i,ref:t}):(0,H.jsx)(xh,{...i,ref:t})})},`DialogContent`)),bh=z.forwardRef(rh(function(e,t){let n=ch(vh,e.__scopeDialog),r=z.useRef(null),i=ye(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return De(e)},[]),(0,H.jsx)(Sh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:tt(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:tt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:tt(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),xh=z.forwardRef(rh(function(e,t){let n=ch(vh,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,H.jsx)(Sh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Sh=z.forwardRef(rh(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ch(vh,n);return Fe(),(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(j,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Le,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ch(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function Ch(e){return e?`open`:`closed`}rh(Ch,`getState`);var wh=1,Th=.9,Eh=.8,Dh=.17,Oh=.1,kh=.999,Ah=.9999,jh=.99,Mh=/[\\\/_+.#"@\[\(\{&]/,Nh=/[\\\/_+.#"@\[\(\{&]/g,Ph=/[\s-]/,Fh=/[\s-]/g;function Ih(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?wh:jh;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Ih(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=wh:Mh.test(e.charAt(l-1))?(d*=Eh,p=e.slice(i,l-1).match(Nh),p&&i>0&&(d*=kh**+p.length)):Ph.test(e.charAt(l-1))?(d*=Th,m=e.slice(i,l-1).match(Fh),m&&i>0&&(d*=kh**+m.length)):(d*=Dh,i>0&&(d*=kh**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Ah)),(d<Oh&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Ih(e,t,n,r,l+1,a+2,o),f*Oh>d&&(d=f*Oh)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Lh(e){return e.toLowerCase().replace(Fh,` `)}function Rh(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Ih(e,t,Lh(e),Lh(t),0,0,{})}var zh=`[cmdk-group=""]`,Bh=`[cmdk-group-items=""]`,Vh=`[cmdk-group-heading=""]`,Hh=`[cmdk-item=""]`,Uh=`${Hh}:not([aria-disabled="true"])`,Wh=`cmdk-item-select`,Gh=`data-value`,Kh=(e,t,n)=>Rh(e,t,n),qh=z.createContext(void 0),Jh=()=>z.useContext(qh),Yh=z.createContext(void 0),Xh=()=>z.useContext(Yh),Zh=z.createContext(void 0),Qh=z.forwardRef((e,t)=>{let n=fg(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=fg(()=>new Set),i=fg(()=>new Map),a=fg(()=>new Map),o=fg(()=>new Set),s=ug(e),{label:c,children:l,value:u,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=d(),b=d(),x=d(),S=z.useRef(null),C=hg();dg(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),dg(()=>{C(6,ee)},[]);let w=z.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,ee),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=z.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Kh;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Bh);t?t.appendChild(e.parentElement===t?e:e.closest(`${Bh} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Bh} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${zh}[${Gh}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Gh);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(zh)?.querySelector(Vh))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${Hh}[aria-selected="true"]`)}function j(){return Array.from(S.current?.querySelectorAll(Uh)||[])}function te(e){let t=j()[e];t&&w.setState(`value`,t.getAttribute(Gh))}function M(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Gh))}function N(e){let t=A()?.closest(zh),n;for(;t&&!n;)t=e>0?cg(t,zh):lg(t,zh),n=t?.querySelector(Uh);n?w.setState(`value`,n.getAttribute(Gh)):M(e)}let P=()=>te(j().length-1),ne=e=>{e.preventDefault(),e.metaKey?P():e.altKey?N(1):M(1)},re=e=>{e.preventDefault(),e.metaKey?te(0):e.altKey?N(-1):M(-1)};return z.createElement(He.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&ne(e);break;case`ArrowDown`:ne(e);break;case`p`:case`k`:_&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),te(0);break;case`End`:e.preventDefault(),P();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Wh);t.dispatchEvent(e)}}}}},z.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:vg},c),_g(e,e=>z.createElement(Yh.Provider,{value:w},z.createElement(qh.Provider,{value:T},e))))}),$h=z.forwardRef((e,t)=>{let n=d(),r=z.useRef(null),i=z.useContext(Zh),a=Jh(),o=ug(e),s=o.current?.forceMount??i?.forceMount;dg(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=mg(n,r,[e.value,e.children,r],e.keywords),l=Xh(),u=pg(e=>e.value&&e.value===c.current),f=pg(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);z.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Wh,p),()=>t.removeEventListener(Wh,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return z.createElement(He.div,{ref:nt(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),eg=z.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=d(),s=z.useRef(null),c=z.useRef(null),l=d(),u=Jh(),f=pg(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));dg(()=>u.group(o),[]),mg(o,s,[e.value,e.heading,c]);let p=z.useMemo(()=>({id:o,forceMount:i}),[i]);return z.createElement(He.div,{ref:nt(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&z.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),_g(e,e=>z.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},z.createElement(Zh.Provider,{value:p},e))))}),tg=z.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=z.useRef(null),a=pg(e=>!e.search);return!n&&!a?null:z.createElement(He.div,{ref:nt(i,t),...r,"cmdk-separator":``,role:`separator`})}),ng=z.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Xh(),o=pg(e=>e.search),s=pg(e=>e.selectedItemId),c=Jh();return z.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),z.createElement(He.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),rg=z.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=z.useRef(null),o=z.useRef(null),s=pg(e=>e.selectedItemId),c=Jh();return z.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),z.createElement(He.div,{ref:nt(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},_g(e,e=>z.createElement(`div`,{ref:nt(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),ig=z.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return z.createElement(lh,{open:n,onOpenChange:r},z.createElement(ph,{container:o},z.createElement(hh,{"cmdk-overlay":``,className:i}),z.createElement(yh,{"aria-label":e.label,"cmdk-dialog":``,className:a},z.createElement(Qh,{ref:t,...s}))))}),ag=z.forwardRef((e,t)=>pg(e=>e.filtered.count===0)?z.createElement(He.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),og=z.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return z.createElement(He.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},_g(e,e=>z.createElement(`div`,{"aria-hidden":!0},e)))}),sg=Object.assign(Qh,{List:rg,Item:$h,Input:ng,Group:eg,Separator:tg,Dialog:ig,Empty:ag,Loading:og});function cg(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lg(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ug(e){let t=z.useRef(e);return dg(()=>{t.current=e}),t}var dg=typeof window>`u`?z.useEffect:z.useLayoutEffect;function fg(e){let t=z.useRef();return t.current===void 0&&(t.current=e()),t}function pg(e){let t=Xh(),n=()=>e(t.snapshot());return z.useSyncExternalStore(t.subscribe,n,n)}function mg(e,t,n,r=[]){let i=z.useRef(),a=Jh();return dg(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Gh,s),i.current=s}),i}var hg=()=>{let[e,t]=z.useState(),n=fg(()=>new Map);return dg(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function gg(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function _g({asChild:e,children:t},n){return e&&z.isValidElement(t)?z.cloneElement(gg(t),{ref:t.ref},n(t.props.children)):n(t)}var vg={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},yg=({className:e,...t})=>(0,H.jsx)(sg,{className:R(`flex flex-col overflow-hidden rounded-md px-3 py-2`,e),...t}),bg=({children:e,...t})=>(0,H.jsx)(lh,{...t,children:(0,H.jsx)(yh,{className:`overflow-hidden p-0`,children:(0,H.jsx)(yg,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]_svg]:size-5`,children:e})})}),xg=({className:e,...t})=>(0,H.jsxs)(`div`,{className:R(`flex flex-1 items-center gap-2 px-3 py-2`,`rounded-2xl supports-[corner-shape:squircle]:rounded-4xl`,`bg-neutral-50 dark:bg-neutral-950`,`ring-1 ring-neutral-100 dark:ring-neutral-700`,`transition-shadow duration-100 focus-within:ring-3 hover:ring-3`,e),"cmdk-input-wrapper":``,children:[(0,H.jsx)(ac,{className:`size-4 shrink-0 opacity-50`}),(0,H.jsx)(sg.Input,{className:`flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,...t})]}),Sg=({className:e,...t})=>(0,H.jsx)(sg.List,{className:R(`max-h-75 overflow-y-auto overflow-x-hidden`,e),...t}),Cg=e=>(0,H.jsx)(sg.Empty,{className:`py-6 text-center text-sm`,...e}),wg=({className:e,...t})=>(0,H.jsx)(sg.Group,{className:R(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs`,e),...t}),Tg=({className:e,...t})=>(0,H.jsx)(sg.Separator,{className:R(`-mx-1 h-px bg-border`,e),...t}),Eg=({className:e,...t})=>(0,H.jsx)(sg.Item,{className:R(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}),Dg=({className:e,...t})=>(0,H.jsx)(`span`,{className:R(`ml-auto text-muted-foreground text-xs tracking-widest`,e),...t}),Og={...yg,Dialog:bg,Input:xg,List:Sg,Empty:Cg,Group:wg,Separator:Tg,Item:Eg,Shortcut:Dg},kg=(0,z.createContext)(null),Ag=()=>{let e=(0,z.useContext)(kg);if(!e)throw Error(`useMultiSelect must be used within MultiSelectProvider`);return e},jg=({values:e,defaultValues:t,onValueChange:n,loop:r=!1,className:i,children:a,dir:o,...s})=>{let[c,l]=(0,z.useState)(t??[]),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(-1),g=(0,z.useRef)(null),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(``);(0,z.useEffect)(()=>{e&&l(e)},[e]);let x=(0,z.useCallback)(e=>{if(c.includes(e)){let t=c.filter(t=>t!==e);l(t),n?.(t)}else{let t=[...c,e];l(t),n?.(t)}},[c]),S=(0,z.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=t.value.substring(t.selectionStart??0,t.selectionEnd??0);b(n),v(n===u)},[u]),C=(0,z.useCallback)(e=>{e.stopPropagation();let t=g.current;if(!t)return;let n=()=>{let e=m+1;h(e>c.length-1?r?0:-1:e)},i=()=>{let e=m-1;h(e<0?c.length-1:e)},a=()=>{let e=m-1<=0?c.length-1==0?-1:0:m-1;h(e)};switch(e.key){case`ArrowLeft`:o===`rtl`?c.length>0&&(m!==-1||r)&&n():c.length>0&&t.selectionStart===0&&i();break;case`ArrowRight`:o===`rtl`?c.length>0&&t.selectionStart===0&&i():c.length>0&&(m!==-1||r)&&n();break;case`Backspace`:case`Delete`:c.length>0&&(m!==-1&&m<c.length?(x(c[m]),a()):(t.selectionStart===0&&y===u||_)&&x(c[c.length-1]));break;case`Enter`:p(!0);break;case`Escape`:m===-1?f&&p(!1):h(-1)}},[c,u,m,r]),w=(0,z.useMemo)(()=>({value:c,onValueChange:x,open:f,setOpen:p,inputValue:u,setInputValue:d,activeIndex:m,setActiveIndex:h,ref:g,handleSelect:S}),[c,x,f,p,u,d,m,h,g,S]);return(0,H.jsx)(kg,{value:w,children:(0,H.jsx)(yg,{onKeyDown:C,className:R(`flex w-full flex-col gap-2 overflow-visible bg-transparent`,i),dir:o,...s,children:a})})},Mg=({className:e,getBadgeValue:t=e=>e,validationStyleEnabled:n=!1,children:r,...i})=>{let{value:a,onValueChange:o,activeIndex:s}=Ag(),c=(0,z.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,H.jsxs)(`div`,{className:R(`flex w-full flex-col gap-3`,`cursor-pointer select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-foreground`,`ring-0`,`focus-within:outline-none`,`focus-within:ring-3`,`focus-within:ring-neutral-200`,`dark:focus-within:ring-neutral-500`,`focus-within:ring-offset-white`,`dark:focus-within:ring-offset-neutral-500`,`[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,n&&`valid:border-success invalid:border-error`,e),...i,children:[a.length>0&&(0,H.jsx)(`div`,{className:`flex w-full flex-wrap gap-1`,children:a.map((e,n)=>(0,H.jsxs)(th,{className:R(`flex items-center gap-1 rounded-xl px-1`,s===n&&`ring-2 ring-muted-foreground`),color:`text`,children:[(0,H.jsx)(`span`,{className:`text-xs`,children:t(e)}),(0,H.jsxs)(`button`,{"aria-label":`Remove ${e} option`,"aria-roledescription":`button to remove option`,onMouseDown:c,onClick:()=>o(e),children:[(0,H.jsxs)(`span`,{className:`sr-only`,children:[`Remove `,e,` option`]}),(0,H.jsx)(pe,{className:`size-4 cursor-pointer`})]})]},e))}),r]})},Ng=e=>{let t=(0,V.c)(5),{className:n,...r}=e,{setOpen:i,inputValue:a,setInputValue:o,activeIndex:s,setActiveIndex:c,handleSelect:l,ref:u}=Ag(),d,f;t[0]===i?(d=t[1],f=t[2]):(d=()=>i(!1),f=()=>i(!0),t[0]=i,t[1]=d,t[2]=f);let p;return t[3]===c?p=t[4]:(p=()=>c(-1),t[3]=c,t[4]=p),(0,H.jsx)(Og.Input,{...r,tabIndex:0,ref:u,value:a,onValueChange:s===-1?o:void 0,onSelect:l,onBlur:d,onFocus:f,onClick:p,className:R(`ml-2 flex-1 cursor-pointer outline-hidden`,n,s!==-1&&`caret-transparent`)})},Pg=e=>{let t=(0,V.c)(2),{children:n}=e,{open:r}=Ag(),i=r&&n,a;return t[0]===i?a=t[1]:(a=(0,H.jsx)(`div`,{className:`relative`,children:i}),t[0]=i,t[1]=a),a},Fg=({className:e,children:t})=>(0,H.jsxs)(Og.List,{className:R(`absolute top-0 z-10 flex w-full flex-col gap-2`,`rounded-xl p-2 shadow-md`,`bg-white dark:bg-neutral-950`,`text-foreground`,`border border-neutral-200 dark:border-neutral-800`,`transition-colors`,e),children:[t,(0,H.jsx)(Og.Empty,{children:(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`No results found`})})]}),Ig=e=>{let t=(0,V.c)(4),{className:n,value:r,children:a,...o}=e,{value:s,onValueChange:c,setInputValue:l}=Ag(),u=Rg,d=s.includes(r),f;return t[0]!==c||t[1]!==l||t[2]!==r?(f=()=>{c(r),l(``)},t[0]=c,t[1]=l,t[2]=r,t[3]=f):f=t[3],(0,H.jsxs)(Og.Item,{...o,onSelect:f,className:R(`flex cursor-pointer justify-between`,`rounded-lg px-2 py-1`,`transition-colors`,`hover:bg-neutral/10`,d&&`opacity-50`,o.disabled&&`cursor-not-allowed opacity-50`,n),onMouseDown:u,children:[a,d&&(0,H.jsx)(i,{className:`size-4`})]})},Lg=jg;Lg.Trigger=Mg,Lg.Input=Ng,Lg.Content=Pg,Lg.List=Fg,Lg.Item=Ig;function Rg(e){e.preventDefault(),e.stopPropagation()}var zg=e=>{let{id:t,...n}=e,r=(0,z.useId)(),i=t??r;return(0,H.jsx)(Bg,{value:{id:i},children:(0,H.jsx)(`div`,{className:`flex flex-col gap-2 p-2`,id:i,suppressHydrationWarning:!0,...n})})},Bg=(0,z.createContext)({}),Vg=e=>e.type===`checkbox`,Hg=e=>e.type===`file`,Ug=e=>e instanceof Date,Wg=e=>e==null,Gg=e=>typeof e==`object`,Kg=e=>!Wg(e)&&!Array.isArray(e)&&Gg(e)&&!Ug(e),qg=e=>Kg(e)&&e.target?Vg(e.target)?e.target.checked:Hg(e.target)?e.target.files:e.target.value:e,Jg=/[.[\]'"]/,Yg=e=>e.split(Jg).filter(Boolean);function Xg(e,t){let n=Yg(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var Zg=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),Qg=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function $g(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(Qg&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&e.constructor!==Object)return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=$g(e[t]));return r}var e_={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},t_={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},n_={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},r_=`root`,i_=[`__proto__`,`constructor`,`prototype`],a_=/^\w*$/,o_=e=>a_.test(e),s_=e=>e===void 0,X=(e,t,n)=>{if(!t||!Kg(e))return n;let r=o_(t)?[t]:Yg(t);if(r.some(e=>i_.includes(e)))return n;let i=r.reduce((e,t)=>Wg(e)?void 0:e[t],e);return s_(i)||i===e?s_(e[t])?n:e[t]:i},c_=e=>typeof e==`boolean`,l_=e=>typeof e==`function`,u_=(e,t,n)=>{let r=-1,i=o_(t)?[t]:Yg(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=Kg(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(i_.includes(t))return;e[t]=a,e=e[t]}},d_=z.createContext(null);d_.displayName=`HookFormControlContext`;var f_=()=>z.useContext(d_),p_=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==t_.all&&(t._proxyFormState[i]=!r||t_.all),n&&(n[i]=!0),e[i]}});return i},m_=Qg?z.useLayoutEffect:z.useEffect,h_=e=>{let t=e.constructor&&e.constructor.prototype;return Kg(t)&&t.hasOwnProperty(`isPrototypeOf`)},g_=e=>Wg(e)||!Gg(e),__=(e,t)=>t.length===0&&!Array.isArray(e)&&!h_(e);function v_(e,t,n=new WeakMap){if(e===t)return!0;if(g_(e)||g_(t))return Object.is(e,t);if(Ug(e)&&Ug(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(__(e,r)||__(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(Ug(r)&&Ug(e)||(Kg(r)||Array.isArray(r))&&(Kg(e)||Array.isArray(e))?!v_(r,e,n):!Object.is(r,e))return!1}}return!0}function y_(e){let t=z.useRef(!1),n=z.useRef(!1),r=z.useRef(void 0),i=z.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=$g(e())),{resyncIfNeeded:z.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();v_(r.current,e)||o(e)}t.current=!0},[]),snapshot:z.useCallback((e,t)=>{e&&(r.current=$g(t()))},[])}}function b_(e){let t=f_(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=z.useState(o),l=z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:d}=y_(o);return m_(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),d(!r,o)}},[i,r,a,u,d]),z.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),z.useMemo(()=>p_(s,n,l.current,!1),[s,n])}var x_=e=>typeof e==`string`,S_=(e,t,n,r,i)=>x_(e)?(r&&t.watch.add(e),X(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),X(n,e,X(i,e)))):(r&&(t.watchAll=!0),n);function C_(e){let t=f_(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=z.useRef(i),l=z.useRef(s),u=z.useRef(void 0),d=z.useRef(n),f=z.useRef(r);l.current=s;let p=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[m,h]=z.useState(p),g=z.useCallback(e=>{let t=S_(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),_=z.useCallback(e=>{if(!a){let t=S_(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);v_(e,u.current)||(h(e),u.current=e)}else h(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:v,snapshot:y}=y_(p),b=z.useRef(_);b.current=_;let x=z.useRef(g);x.current=g,m_(()=>{d.current!==n||!v_(f.current,r)?(d.current=n,f.current=r,b.current()):v(!a,()=>x.current(),e=>{h(e),u.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>x.current())}},[n,o,r,a,v,y]),z.useEffect(()=>n._removeUnmounted());let S=d.current!==n,C=f.current;return z.useMemo(()=>{if(a)return!1;let e=!S&&!v_(C,r);return S||e},[a,S,r,C])?g():m}function w_(e){let t=f_(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=Zg(i._names.array,n),l=C_({control:i,name:n,defaultValue:z.useMemo(()=>{let e=X(i._formValues,n,X(i._defaultValues,n,o));return s_(e)?Xg(i,n):e},[i,n,o]),exact:s}),u=b_({control:i,name:n,exact:s}),d=z.useRef(e),f=z.useRef(null),p=z.useRef(i.register(n,{...e.rules,value:l,...c_(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=z.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!X(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!X(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!X(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!X(u.validatingFields,n)},error:{enumerable:!0,get:()=>X(u.errors,n)}}),[u,n]),h=z.useCallback(e=>{let t=qg(e);return X(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:qg(e),name:n},type:e_.CHANGE})},[n,i]),g=z.useCallback(()=>p.current.onBlur({target:{value:X(i._formValues,n),name:n},type:e_.BLUR}),[n,i._formValues]),_=z.useCallback(e=>{e&&(f.current={focus:()=>l_(e.focus)&&e.focus(),select:()=>l_(e.select)&&e.select(),setCustomValidity:t=>l_(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>l_(e.reportValidity)&&e.reportValidity()});let t=X(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current)},[i._fields,n]),v=z.useMemo(()=>({name:n,value:l,...c_(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return z.useEffect(()=>{let e=i._options.shouldUnregister||a;p.current=i.register(n,{...d.current.rules,...c_(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=X(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=$g(X(a?i._defaultValues:i._options.values||i._defaultValues,n,X(i._options.defaultValues,n,d.current.defaultValue)));u_(i._defaultValues,n,e),s_(X(i._formValues,n))&&u_(i._formValues,n,e)}if(!c&&i.register(n),f.current){let e=X(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),z.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),z.useMemo(()=>({field:v,formState:u,fieldState:m}),[v,u,m])}var T_=e=>e.render(w_(e)),E_=e=>({isOnSubmit:!e||e===t_.onSubmit,isOnBlur:e===t_.onBlur,isOnChange:e===t_.onChange,isOnAll:e===t_.all,isOnTouch:e===t_.onTouched}),D_=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},O_=(e,t,n,r)=>{for(let i of n||Object.keys(e)){if(i===`_f`)continue;let a=n?X(e,i):e[i];if(a){let{_f:e}=a;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(O_(a,t))break}else if((Kg(a)||Array.isArray(a))&&O_(a,t))break}}},k_=(e,t,n)=>{let r=X(e,n),i=Array.isArray(r)?r:[];return u_(i,r_,t[n]),u_(e,n,i),e},A_=e=>Kg(e)&&!Object.keys(e).length,j_=e=>{if(!Qg)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},M_=e=>e.type===`radio`,N_=e=>e instanceof RegExp,P_=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},F_={value:!1,isValid:!1},I_={value:!0,isValid:!0},L_=e=>{if(!Array.isArray(e))return F_;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?F_:!t.attributes||!(`value`in t.attributes)||s_(t.value)||t.value===``?I_:{value:t.value,isValid:!0}},R_={isValid:!1,value:null},z_=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,R_):R_;function B_(e,t,n=`validate`){if(x_(e)||Array.isArray(e)&&e.every(x_)||c_(e)&&!e)return{type:n,message:x_(e)?e:``,ref:t}}var V_=e=>Kg(e)&&!N_(e)?e:{value:e,message:``},H_=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=X(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=c_(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=M_(o),C=Vg(o),w=S||C,T=(g||Hg(o))&&s_(o.value)&&s_(v)||j_(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=P_.bind(null,h,r,x),D=(e,t,n,r=n_.maxLength,i=n_.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||Wg(v))||c_(v)&&!v||C&&!L_(s).isValid||S&&!z_(s).isValid)){let{value:e,message:t}=x_(c)?{value:!!c,message:c}:V_(c);if(e&&(x[h]={type:n_.required,message:t,ref:y,...E(n_.required,t)},!r))return b(t),x}if(!T&&(!Wg(d)||!Wg(f))){let e,t,n=V_(f),i=V_(d);if(!Wg(v)&&!Ug(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;Wg(n.value)||(e=r>n.value),Wg(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;x_(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),x_(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,n_.max,n_.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(x_(v)||a&&Array.isArray(v))){let e=V_(l),t=V_(u),n=!Wg(e.value)&&v.length>+e.value,i=!Wg(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&x_(v)){let{value:e,message:t}=V_(p);if(N_(e)&&!v.match(e)&&(x[h]={type:n_.pattern,message:t,ref:o,...E(n_.pattern,t)},!r))return b(t),x}if(m){if(l_(m)){let e=B_(await m(v,n),y);if(e&&(x[h]={...e,...E(n_.validate,e.message)},!r))return b(e.message),x}else if(Kg(m)){let e={};for(let t in m){if(!A_(e)&&!r)break;let i=B_(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!A_(e)&&(x[h]={ref:y,...e},!r))return x}}let O=x[h];return b(!O||O.message),x},U_=e=>Array.isArray(e)?e:[e],W_=e=>Array.isArray(e)?e.filter(Boolean):[];function G_(e,t){let n=t.length-1,r=0;for(;r<n;){if(Wg(e)){e=void 0;break}e=e[t[r]],r++}return e}function K_(e){for(let t in e)if(e.hasOwnProperty(t)&&!s_(e[t]))return!1;return!0}function q_(e,t){if(x_(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:o_(t)?[t]:Yg(t);if(n.some(e=>i_.includes(String(e))))return e;let r=n.length===1?e:G_(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(Kg(r)&&A_(r)||Array.isArray(r)&&K_(r))&&q_(e,n.slice(0,-1)),e}var J_=z.createContext(null);J_.displayName=`HookFormContext`;var Y_=()=>z.useContext(J_),X_=({children:e,watch:t,getValues:n,getErrors:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,resetDefaultValues:p,handleSubmit:m,unregister:h,control:g,register:_,setFocus:v,subscribe:y})=>{let b=z.useMemo(()=>({watch:t,getValues:n,getErrors:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,resetDefaultValues:p,handleSubmit:m,unregister:h,control:g,register:_,setFocus:v,subscribe:y}),[o,g,u,r,i,n,m,_,f,p,d,a,v,s,c,y,l,h,t]);return z.createElement(J_.Provider,{value:b},z.createElement(d_.Provider,{value:b.control},e))},Z_=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Q_(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&Kg(i)&&a){let e=Q_(i,a);Kg(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var $_=(e,t)=>e!==null&&Gg(e)&&Object.prototype.hasOwnProperty.call(e,t),ev=(e,t)=>{if(!t)return!1;let n=e;for(let r of o_(t)?[t]:Yg(t)){if(!$_(n,r))return $_(e,t);n=n[r]}return!0},tv=e=>e.type===`select-multiple`,nv=e=>M_(e)||Vg(e),rv=e=>j_(e)&&e.isConnected;function iv(e){return Array.isArray(e)||Kg(e)}function av(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];iv(o)&&iv(X(t,a))?av(o,t,a,r):r.push(a)}return r}var ov=e=>{for(let t in e)if(l_(e[t]))return!0;return!1};function sv(e){return Array.isArray(e)||Kg(e)&&!ov(e)}function cv(e){return!!(e&&`_f`in e)}function lv(e){return Array.isArray(e)?!e.some(e=>!s_(e)):!Object.keys(e).length}function uv(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function dv(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];sv(i)&&(!Array.isArray(i)||!cv(a))?(t[r]=Array.isArray(i)?[]:{},dv(i,t[r],a),lv(t[r])&&uv(t,r)):s_(i)||(t[r]=!0)}return t}function fv(e,t,n,r){n||=dv(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];sv(a)&&(!Array.isArray(a)||!cv(o))?(s_(t)||g_(n[i])?n[i]=dv(a,Array.isArray(a)?[]:{},o):fv(a,Wg(t)?{}:t[i],n[i],o),lv(n[i])&&uv(n,i)):v_(a,t[i])?uv(n,i):n[i]=!0}return n}var pv=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},mv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>s_(e)?e:t?e===``?NaN:e&&+e:n&&x_(e)?new Date(e):r?r(e):e;function hv(e){let t=e.ref;return Hg(t)?t.files:M_(t)?z_(e.refs).value:tv(t)?[...t.selectedOptions].map(({value:e})=>e):Vg(t)?L_(e.refs).value:mv(t.value,e)}var gv=(e,t,n,r)=>{let i={};for(let n of e){let e=X(t,n);e&&u_(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},_v=e=>s_(e)?e:N_(e)?e.source:Kg(e)?N_(e.value)?e.value.source:e.value:e,vv=`AsyncFunction`,yv=e=>{if(!e||!e.validate)return!1;if(l_(e.validate))return e.validate.constructor.name===vv;if(Kg(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===vv)return!0}return!1},bv=e=>e.mount&&(e.required||!s_(e.required)&&e.required!==!1||!s_(e.min)||!s_(e.max)||!s_(e.maxLength)||!s_(e.minLength)||e.pattern||e.validate);function xv(e,t,n){let r=X(e,n);if(r||o_(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=X(t,r),o=X(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Sv=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||t_.all))},Cv=(e,t,n)=>!e||!t||e===t||U_(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),wv=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,Tv=(e,t)=>{let n=X(e,t);!W_(n).length&&!(n!=null&&n.root)&&q_(e,t)},Ev={mode:t_.onSubmit,reValidateMode:t_.onChange,shouldFocusError:!0},Dv=`form`,Ov=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},kv={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Av(e={}){let t={...Ev,...e},n={...$g(kv),isLoading:l_(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(Kg(t.defaultValues)||Kg(t.values))&&$g(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:$g(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=E_(t.mode),f=E_(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g={array:Z_(),state:Z_()},_=0,v=t.criteriaMode===t_.all,y=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},b=async e=>{if(!o.keepIsValid&&!t.disabled&&(m.isValid||h.isValid||e)){let e=++_,i;t.resolver?(i=A_((await A()).errors),e===_&&x()):i=await M({fields:r,onlyCheckValid:!0,eventType:e_.VALID}),e===_&&i!==n.isValid&&g.state.next({isValid:i})}},x=(e,r)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((e||s.mount).forEach(e=>{e&&(r?u_(n.validatingFields,e,r):q_(n.validatingFields,e))}),g.state.next({validatingFields:n.validatingFields,isValidating:!A_(n.validatingFields)}))},S=()=>{n.dirtyFields=fv(i,a,void 0,r)},C=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=X(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&u_(r,e,n)}let a=X(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&u_(n.errors,e,r),Tv(n.errors,e)}let d=X(n.touchedFields,e);if((m.touchedFields||h.touchedFields)&&u&&Array.isArray(d)){let t=s(d,c.argA,c.argB);l&&u_(n.touchedFields,e,t)}(m.dirtyFields||h.dirtyFields)&&S(),g.state.next({name:e,isDirty:P(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else u_(a,e,i)},w=(e,t)=>{u_(n.errors,e,t),n.errors={...n.errors},g.state.next({errors:n.errors})},T=e=>{n.errors=e,g.state.next({errors:n.errors,isValid:!1})},E=e=>{let t=o_(e)?[e]:Yg(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=Wg(n)?n:n[i],r=Wg(r)?r:r[i],n===null&&r!==null)return!0}return!1},D=e=>{if(!o.actionArrayLengths.size)return!1;let t=o_(e)?[e]:Yg(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(Wg(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a]}return!1},O=(t,c,l,u)=>{let d=X(r,t);if(d){if(E(t)||D(t))return;let r=s_(X(a,t)),f=X(a,t,s_(l)?X(i,t):l);s_(f)||u&&u.defaultChecked||c?u_(a,t,c?f:hv(d._f)):ie(t,f),o.mount&&!o.action&&(b(),r&&n.isDirty&&(m.isDirty||h.isDirty)&&(P()||(n.isDirty=!1,g.state.next({...n}))),e.shouldUnregister&&r&&!s_(X(a,t))&&D_(t,s)&&(o.watch=!0))}},k=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=v_(X(i,e),o);(m.isDirty||h.isDirty)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||P(),u=d!==f.isDirty),d=!!X(n.dirtyFields,e),t===n.isDirty?t?q_(n.dirtyFields,e):u_(n.dirtyFields,e,!0):Ov(n.dirtyFields,fv(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=(m.dirtyFields||h.dirtyFields)&&d!==!t}if(s){let t=X(n.touchedFields,e);t||(u_(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=(m.touchedFields||h.touchedFields)&&t!==s)}u&&l&&g.state.next(f)}return u?f:{}},ee=(e,r,i,a)=>{let o=X(n.errors,e),s=(m.isValid||h.isValid)&&c_(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=y(e,()=>w(e,i)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e],i?u_(n.errors,e,i):q_(n.errors,e),n.errors={...n.errors}),(i?!v_(o,i):o)||!A_(a)||s){let t={...a,...s&&c_(r)?{isValid:r}:{},errors:n.errors,name:e};g.state.next(t)}},A=async e=>(x(e,!0),await t.resolver(a,t.context,gv(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),j=async e=>{let{errors:t}=await A(e);if(x(e),e){for(let r of e){let e=X(t,r);e?s.array.has(r)&&Kg(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?k_(n.errors,{[r]:e},r):u_(n.errors,r,e):q_(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},te=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(Kg(i))for(let e in i){let t=i[e];t&&me(`${Dv}.${e}`,{message:x_(t.message)?t.message:``,type:t.type||n_.validate})}else x_(i)||!i?me(Dv,{message:i||``,type:n_.validate}):pe(Dv);return i}return!0},M=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await te({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&yv(u._f),d=m.validatingFields||m.isValidating||h.validatingFields||h.isValidating;c&&d&&x([r.name],!0);let f=await H_(u,s.disabled,a,v,t.shouldUseNativeValidation&&!i,o);if(c&&d&&x([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(X(f,r.name)?o?k_(n.errors,f,r.name):u_(n.errors,r.name,f[r.name]):q_(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!A_(d)&&await M({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},N=()=>{for(let e of s.unMount){let t=X(r,e);t&&(t._f.refs?t._f.refs.every(e=>!rv(e)):!rv(t._f.ref))&&ve(e)}s.unMount=new Set},P=(e,t)=>(e&&t&&u_(a,e,t),!v_(o.mount?a:i,i)),ne=(e,t,n)=>S_(e,s,{...o.mount?a:s_(t)||x_(e)?i:t},n,t),re=e=>W_(X(o.mount?a:i,e,t.shouldUnregister?X(i,e,[]):[])),ie=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=X(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&u_(a,e,mv(t,n)),l=j_(n.ref)&&Wg(t)?``:t,tv(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?Vg(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):Hg(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&g.state.next({name:e,values:i?a:$g(a)})))}(n.shouldDirty||n.shouldTouch)&&k(e,l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&le(e,{delayError:n.delayError})},F=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&g.array.next({name:e,values:i?a:$g(a)});for(let a in t){if(!t.hasOwnProperty(a))continue;let l=t[a],u=e+`.`+a,d=X(r,u);(s.array.has(e)||Kg(l)||d&&!d._f)&&!Ug(l)?F(u,l,n,i,o,c):ie(u,l,n,i,o,c)}},I=(e,t,i,c,l=!1)=>{let u=X(r,e),d=s.array.has(e),f=c?t:$g(t),p=v_(X(a,e),f);if(p||u_(a,e,f),d)g.array.next({name:e,values:c?a:$g(a)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&i.shouldDirty&&(S(),l||g.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:P(e,f)}));else{let t=Array.isArray(f)&&!f.length||A_(f),n=!p&&!l;!u||u._f||Wg(f)||t?ie(e,f,i,c,l,n):F(e,f,i,c,l,n)}if(!p&&!l){let t=D_(e,s),r=c?a:$g(a);if(g.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of pv(s.array,e))g.state.next({name:t,values:r})}},ae=(e,t,n={})=>I(e,t,n,!1),oe=(e,t={})=>{let r=l_(e)?e(a):e;if(!v_(a,r)){a={...a,...r};for(let e of s.mount)ev(r,e)&&I(e,X(r,e),t,!0,!0);g.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&b()}},se=async i=>{o.mount=!0;let l=i.target,p=l.name,_=!0,y=X(r,p),S=e=>{_=Number.isNaN(e)||Ug(e)&&isNaN(e.getTime())||v_(e,X(a,p,e))};if(y){let o,C,w=l.type?hv(y._f):qg(i),T=i.type===e_.BLUR||i.type===e_.FOCUS_OUT,E=!bv(y._f)&&!e.validate&&!t.resolver&&!X(n.errors,p)&&!y._f.deps,D=E||wv(T,X(n.touchedFields,p),n.isSubmitted,f,d),O=D_(p,s,T);if(u_(a,p,$g(w)),T){if(!l||!l.readOnly){y._f.onBlur&&y._f.onBlur(i);let e=c[p];e&&e(0)}}else y._f.onChange&&y._f.onChange(i);let j=k(p,w,T),N=!A_(j)||O;if(!T&&g.state.next({name:p,type:i.type,...u?{values:$g(a)}:{}}),D)return(!E||!n.isValid)&&(m.isValid||h.isValid)&&(t.mode===`onBlur`?T&&b():T||b()),N&&g.state.next({name:p,...O?{}:j});if(!t.resolver&&e.validate&&await te({name:p,eventType:i.type}),!T&&O&&g.state.next({...n}),t.resolver){let{errors:e}=await A([p]);if(x([p]),S(w),!_){!A_(j)&&g.state.next(j);return}let t=xv(n.errors,r,p),i=xv(e,r,t.name||p);o=i.error,p=i.name,C=A_(e)}else x([p],!0),o=(await H_(y,s.disabled,a,v,t.shouldUseNativeValidation))[p],x([p]),S(w),_&&(o?C=!1:(m.isValid||h.isValid)&&(C=await M({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));_&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&le(y._f.deps),ee(p,C,o,j))}},ce=(e,t)=>{if(X(n.errors,t)&&e.focus)return e.focus(),1},le=async(e,i={})=>{let a,o,u=U_(e);if(t.resolver){let t=await j(s_(e)?e:u);a=A_(t),o=e?!u.some(e=>X(t,e)):a}else e?(o=(await Promise.all(u.map(async e=>{let t=X(r,e);return await M({fields:t&&t._f?{[e]:t}:t,eventType:e_.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&b()):o=a=await M({fields:r,name:e,eventType:e_.TRIGGER});if(i.delayError&&t.delayError&&x_(e)){let r=X(n.errors,e);r?(q_(n.errors,e),c[e]=y(e,()=>w(e,r)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e])}if(i.shouldTouch)for(let t of e?u:s.mount)!s.array.has(t)&&u_(n.touchedFields,t,!0);return g.state.next({...!x_(e)||(m.isValid||h.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&(m.touchedFields||h.touchedFields)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!o&&O_(r,ce,e?u:s.mount),o},ue=(e,t)=>{let r={...o.mount?a:i};return t&&(r=Q_(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),s_(e)?r:x_(e)?X(r,e):e.map(e=>X(r,e))},de=e=>s_(e)?{...n.errors}:x_(e)?X(n.errors,e):e.map(e=>X(n.errors,e)),fe=(e,t)=>{let r=t||n,i=X(r.errors,e);return{invalid:!!i,isDirty:!!X(r.dirtyFields,e),error:i,isValidating:!!X(n.validatingFields,e),isTouched:!!X(r.touchedFields,e)}},pe=e=>{let t=e?U_(e):void 0;t?.forEach(e=>q_(n.errors,e)),t?t.forEach(e=>{g.state.next({name:e,errors:n.errors})}):(n.errors={},g.state.next({errors:n.errors}))},me=(e,t,i)=>{let a=(X(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=X(n.errors,e)||{};u_(n.errors,e,{...l,...t,ref:a}),g.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},he=(e,t)=>{if(l_(e)){u++;let{unsubscribe:n}=g.state.subscribe({next:n=>`values`in n&&e(n.values||ne(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return ne(e,t,!0)},ge=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=g.state.subscribe({next:t=>{if(Cv(e.name,t.name,e.exact)&&Sv(t,e.formState||m,Oe,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},_e=e=>(o.mount=!0,h={...h,...e.formState},ge({...e,formState:{...p,...e.formState}})),ve=(e,o={})=>{for(let c of e?U_(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(q_(r,c),q_(a,c)),!o.keepError&&q_(n.errors,c),!o.keepDirty&&q_(n.dirtyFields,c),!o.keepTouched&&q_(n.touchedFields,c),!o.keepIsValidating&&q_(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&q_(i,c);u&&g.state.next({values:$g(a)}),g.state.next({...n,...o.keepDirty?{}:{isDirty:P()}}),!o.keepIsValid&&b()},ye=({disabled:e,name:t})=>{if(c_(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&b()}},be=(e,n={})=>{let a=X(r,e),c=c_(n.disabled)||c_(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return u_(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?ye({disabled:c_(n.disabled)?n.disabled:t.disabled,name:e}):O(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:_v(n.min),max:_v(n.max),minLength:_v(n.minLength),maxLength:_v(n.maxLength),pattern:_v(n.pattern)}:{},name:e,onChange:se,onBlur:se,ref:c=>{if(c){s.registerName.add(e),be(e,n),s.registerName.delete(e),a=X(r,e);let t=s_(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=nv(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(rv),t,...Array.isArray(X(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),u_(r,e,{_f:u}),O(e,!1,void 0,t)}else a=X(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(Zg(s.array,e)&&o.action)&&s.unMount.add(e)}}},xe=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&O_(r,ce,s.mount),Se=e=>{c_(e)&&(g.state.next({disabled:e}),O_(r,(t,n)=>{let i=X(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},Ce=(e,i)=>async o=>{let c,l;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let u=$g(a);if(g.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await A();x(),n.errors=e,u=$g(t)}else await M({fields:r,eventType:e_.SUBMIT});if(s.disabled.size)for(let e of s.disabled)q_(u,e);if(q_(n.errors,r_),A_(n.errors)){g.state.next({errors:{}});try{c=await e(u,o)}catch(e){l=e}}else i&&await i({...n.errors},o),xe(),setTimeout(xe);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:A_(n.errors)&&!l,submitCount:n.submitCount+1,errors:n.errors}),l)throw l;return c},we=(e,t={})=>{X(r,e)&&(s_(t.defaultValue)?ae(e,$g(X(i,e))):(ae(e,t.defaultValue),u_(i,e,$g(t.defaultValue))),t.keepTouched||q_(n.touchedFields,e),t.keepDirty||(q_(n.dirtyFields,e),n.isDirty=t.defaultValue?P(e,$g(X(i,e))):P()),t.keepError||(q_(n.errors,e),b()),g.state.next({...n}))},Te=(e,c={})=>{let l=e?$g(e):i,u=$g(l),d=A_(e),f=u,p=r;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...av(fv(i,a,void 0,p),n.dirtyFields)]);for(let t of e){let e=X(n.dirtyFields,t),r=X(a,t),i=X(f,t);e&&!s_(r)?u_(f,t,r):!e&&!s_(i)&&ae(t,i)}}else{if(Qg&&s_(e))for(let e of s.mount){let t=X(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(j_(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)ae(e,X(f,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?$g(i):{},c.keepFieldsRef)for(let e of s.mount)u_(a,e,X(f,e))}else a=$g(f);g.array.next({values:{...f}}),g.state.next({name:void 0,type:void 0,values:{...f}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!A_(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),c.keepErrors||(n.errors={}),g.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:d?!1:c.keepDirty?n.isDirty:c.keepValues?P():!!(c.keepDefaultValues&&!v_(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:c.keepDirtyValues?c.keepDefaultValues&&a?fv(i,a,void 0,p):n.dirtyFields:c.keepDefaultValues&&e?fv(i,e,void 0,p):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ee=(e,n)=>Te(l_(e)?e(a):e,{...t.resetOptions,...n}),De=(e,t={})=>{let n=X(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&l_(e.select)&&e.select()})}},Oe=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};g.state.subscribe({next:Oe});let ke={control:{register:be,unregister:ve,getFieldState:fe,handleSubmit:Ce,setError:me,_subscribe:ge,_runSchema:A,_updateIsValidating:x,_focusError:xe,_getWatch:ne,_getDirty:P,_setValid:b,_setFieldArray:C,_setDisabledField:ye,_setErrors:T,_getFieldArray:re,_reset:Te,_resetDefaultValues:()=>l_(t.defaultValues)&&t.defaultValues().then(e=>{Ee(e,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:Se,_subjects:g,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=E_(t.mode),f=E_(t.reValidateMode)}},subscribe:_e,trigger:le,register:be,handleSubmit:Ce,watch:he,setValue:ae,setValues:oe,getValues:ue,getErrors:de,reset:Ee,resetField:we,resetDefaultValues:(e,t={})=>{if(i=$g(e),!t.keepDirty){let e=fv(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!A_(e)}t.keepIsValid||b(),g.state.next({...n,defaultValues:i})},clearErrors:pe,unregister:ve,setError:me,setFocus:De,getFieldState:fe};return{...ke,formControl:ke}}function jv(e={}){let t=z.useRef(void 0),n=z.useRef(void 0),r=z.useRef(e.formControl),[i,a]=z.useState(()=>({...$g(kv),isLoading:l_(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:l_(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!l_(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Av(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let{resyncIfNeeded:s,snapshot:c}=y_();return m_(()=>{let e=()=>({...o._formState,defaultValues:o._defaultValues});s(!0,e,a);let t=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{t(),c(!0,e)}},[o,s,c]),z.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),z.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),z.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),z.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),z.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),z.useEffect(()=>{e.values&&!v_(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),z.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=z.useMemo(()=>p_(i,o),[o,i]),t.current}var Mv=(0,z.createContext)({}),Nv=e=>{let t=(0,V.c)(7),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i=r,a;return t[4]!==i||t[5]!==n?(a=(0,H.jsx)(Mv,{value:i,children:(0,H.jsx)(T_,{...n})}),t[4]=i,t[5]=n,t[6]=a):a=t[6],a},Pv=()=>{let e=(0,V.c)(11),t=(0,z.useContext)(Mv),n=(0,z.useContext)(Bg),{getFieldState:r,formState:i}=Y_(),a;e[0]!==t.name||e[1]!==i||e[2]!==r?(a=r(t.name,i),e[0]=t.name,e[1]=i,e[2]=r,e[3]=a):a=e[3];let o=a;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:s}=n,c=`${s}-form-item`,l=`${s}-form-item-description`,u=`${s}-form-item-message`,d;return e[4]!==t.name||e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==u?(d={id:s,name:t.name,formItemId:c,formDescriptionId:l,formMessageId:u,...o},e[4]=t.name,e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=u,e[10]=d):d=e[10],d},Fv=e=>{let t=(0,V.c)(5),{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=Pv(),o=n?`${i} ${a}`:`${i}`,s=!!n,c;return t[0]!==r||t[1]!==e||t[2]!==o||t[3]!==s?(c=(0,H.jsx)(Oe,{id:r,"aria-describedby":o,"aria-invalid":s,...e}),t[0]=r,t[1]=e,t[2]=o,t[3]=s,t[4]=c):c=t[4],c},Iv=e=>{let t=(0,V.c)(3),{formDescriptionId:n}=Pv(),r;return t[0]!==n||t[1]!==e?(r=(0,H.jsx)(`p`,{className:`text-neutral text-sm`,id:n,...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r},Lv=e=>{let{children:t,...n}=e,{error:r,formMessageId:i}=Pv(),a=r?String(r?.message??``):t;return a?(0,H.jsx)(`p`,{className:`font-medium text-error text-xs`,role:`alert`,id:i,...n,children:a}):null},Rv=({className:e,children:t,...n})=>(0,H.jsxs)(`i`,{className:R(`text-neutral-400 text-xs`,e),...n,children:[`ⓘ `,t]}),zv=e=>{let{className:t,...n}=e,{error:r,formItemId:i}=Pv();return(0,H.jsx)(Sm,{className:R(`mb-2`,r&&`text-error`,t),htmlFor:i,...n})},Bv=({isRequired:e})=>e?(0,H.jsx)(`span`,{"aria-label":`Asterisk meaning the field is required`,children:`*`}):(0,H.jsx)(H.Fragment,{}),Vv=({children:e,isRequired:t,info:n,htmlFor:r,className:i})=>(0,H.jsxs)(`div`,{className:`ml-1 flex gap-1 align-middle text-base leading-none`,children:[e&&(0,H.jsxs)(zv,{htmlFor:r,id:`${r}-label`,suppressHydrationWarning:!0,className:R(`font-bold`,i),children:[e,(0,H.jsx)(Bv,{isRequired:t})]}),n&&(0,H.jsx)(Rv,{content:n})]}),Hv=({label:e,description:t,isRequired:n,info:r,children:i,showErrorMessage:a=!0,htmlFor:o,className:s})=>(0,H.jsxs)(zg,{className:R(`flex w-full flex-col flex-wrap gap-2 px-1 py-2`,s),children:[(t||e)&&(0,H.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 p-1 leading-none`,children:[e&&(0,H.jsx)(Vv,{isRequired:n,info:r,htmlFor:o,children:e}),t&&(0,H.jsx)(Iv,{children:t})]}),(0,H.jsx)(Fv,{children:i}),a&&(0,H.jsx)(Lv,{"data-testid":`error-message`})]}),Uv=({field:e,name:t,label:n,Element:r,isRequired:i=!1,info:a,description:o,showErrorMessage:s=!0,layoutClassName:c,...l})=>{let{error:u}=Pv(),{value:d,onChange:f,...p}=e??{},m=l,h=m.value===void 0?d??``:m.value,g=(...e)=>{typeof f==`function`&&f(...e),typeof m.onChange==`function`&&m.onChange(...e)};return(0,H.jsx)(Hv,{htmlFor:t,label:n,description:o,isRequired:i,info:a,showErrorMessage:s,"aria-invalid":!!u,className:c,children:(0,H.jsx)(r,{"data-testid":`element`,id:t,...p,...l,value:h,onChange:g,children:l.children})})},Wv=e=>{let t=(0,V.c)(6),{control:n}=Y_(),r;t[0]===e?r=t[1]:(r=t=>{let{field:n}=t;return(0,H.jsx)(Uv,{...e,field:n})},t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==e.name||t[4]!==r?(i=(0,H.jsx)(Nv,{control:n,name:e.name,render:r}),t[2]=n,t[3]=e.name,t[4]=r,t[5]=i):i=t[5],i},Gv=e=>(0,H.jsx)(Wv,{id:e.name,"data-testid":e.name,Element:Ap,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,...e}),Kv=e=>{let{field:t,name:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,children:c,...l}=e,{error:u}=Pv();return(0,H.jsx)(Hv,{htmlFor:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,"aria-invalid":!!u,children:(0,H.jsx)(Lg,{onValueChange:t.onChange,values:t.value,...l,children:c})})},qv=e=>{let{name:t,description:n,label:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c}=e,{control:l}=Y_();return(0,H.jsx)(Nv,{control:l,name:t,render:e=>{let{field:l}=e;return(0,H.jsx)(Kv,{field:l,name:t,label:r,description:n,isRequired:i,info:a,showErrorMessage:o,...c,children:s})}})},Jv=e=>{let{field:t,name:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,children:c,...l}=e,{error:u}=Pv();return(0,H.jsx)(Hv,{htmlFor:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,"aria-invalid":!!u,children:(0,H.jsx)(L,{onValueChange:t.onChange,defaultValue:t.value,...l,children:c})})},Yv=e=>{let{name:t,description:n,label:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c}=e,{control:l}=Y_();return(0,H.jsx)(Nv,{control:l,name:t,render:e=>{let{field:l}=e;return(0,H.jsx)(Jv,{field:l,name:t,label:r,description:n,isRequired:i,info:a,showErrorMessage:o,...c,children:s})}})},Xv=(e,t,n)=>{if(e&&`reportValidity`in e){let r=X(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},Zv=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?Xv(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>Xv(t,n,e))}},Qv=(e,t)=>{t.shouldUseNativeValidation&&Zv(e,t);let n={};for(let r in e){let i=X(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.refs?i.refs[0]:i&&i.ref});if($v(t.names||Object.keys(e),r)){let e=Object.assign({},X(n,r));u_(e,`root`,a),u_(n,r,e)}else u_(n,r,a)}return n},$v=(e,t)=>{let n=ey(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>ey(e).match(`^${n}\\.\\d+`))};function ey(e){return e.replace(/\[(\d+)]/g,`.$1`).replace(/[[\]]/g,``)}function ty(){return ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ty.apply(null,arguments)}function ny(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function ry(e,t){for(var n=Object.create(null);e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(`unionErrors`in r){var s=r.unionErrors.reduce(function(e,t){return t.errors.length<e.errors.length?t:e}).errors[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=P_(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function iy(e,t){for(var n=Object.create(null),r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors.reduce(function(e,t){return t.length<e.length?t:e})[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(ty({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=P_(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function ay(e,t,n){if(n===void 0&&(n={}),function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(ny(function(){function i(e){return a.shouldUseNativeValidation&&Zv({},a),{errors:{},values:n.raw?Object.assign({},r):e}}var o=e;return n.mode===`sync`?i(o.parse(r,t)):Promise.resolve(o.parseAsync(r,t)).then(i)},function(e){if(function(e){var t;return!(e==null||(t=e._zod)==null||(t=t.traits)==null||!t.has(`$ZodError`))}(e))return{values:{},errors:Qv(iy(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_def`in e&&typeof e._def==`object`}(e))return function(r,i,a){try{return Promise.resolve(ny(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&Zv({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:Qv(ry(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var oy=async e=>e&&typeof e.then==`function`?await e:e,sy=({schema:e,onSubmit:t,onSubmitSuccess:n,onSubmitError:r,className:i,children:a,autoComplete:o,method:s,...c})=>{let l=async i=>{let a=e?.safeParse(i)??{success:!0,data:void 0};await oy(t?.(i)),a.success?await oy(n?.(a.data)):await oy(r?.(Error(a.error.issues.map(e=>e.message).join(`, `))))},u=e=>{if(e.key!==`Enter`)return;let t=e.target;if(t.tagName!==`INPUT`)return;e.preventDefault();let n=e.currentTarget,r=Array.from(n.querySelectorAll(`input:not([disabled]):not([type="hidden"]), textarea:not([disabled])`)),i=r.indexOf(t);i>=0&&i<r.length-1&&r[i+1]?.focus()};return(0,H.jsx)(X_,{...c,children:(0,H.jsx)(`form`,{className:R(`flex flex-col gap-y-6`,i),onSubmit:c.handleSubmit(l),onKeyDown:u,autoComplete:o?`on`:`off`,noValidate:!0,method:s,children:a})})},cy=(e,t)=>{let n=(0,V.c)(13),r;n[0]===e?r=n[1]:(r=ay(e),n[0]=e,n[1]=r);let i;n[2]!==t||n[3]!==r?(i={resolver:r,...t},n[2]=t,n[3]=r,n[4]=i):i=n[4];let a=jv(i),o;n[5]===a.control?o=n[6]:(o={control:a.control},n[5]=a.control,n[6]=o);let{isSubmitting:s,isSubmitted:c,isLoading:l,isValid:u}=b_(o),d;return n[7]!==a||n[8]!==l||n[9]!==c||n[10]!==s||n[11]!==u?(d={form:a,isSubmitting:s,isSubmitted:c,isLoading:l,isValid:u},n[7]=a,n[8]=l,n[9]=c,n[10]=s,n[11]=u,n[12]=d):d=n[12],d},ly=sy;function uy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function dy(e,t=`|`){return e.map(e=>Oy(e)).join(t)}function fy(e,t){return typeof t==`bigint`?t.toString():t}function py(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function my(e){return e==null}function hy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function gy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _y(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function vy(e){return JSON.stringify(e)}function yy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var by=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Sy=py(()=>{if(fb.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Cy(e){if(xy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return xy(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function wy(e){return Cy(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ty=new Set([`string`,`number`,`symbol`]);function Ey(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Dy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Oy(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ky(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function Ay(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Dy(e,_y(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&gy(e,r,n.shape[r])}return gy(this,`shape`,e),e},checks:[]}))}function jy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Dy(e,_y(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return gy(this,`shape`,r),r},checks:[]}))}function My(e,t){if(!Cy(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Dy(e,_y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return gy(this,`shape`,n),n}}))}function Ny(e,t){if(!Cy(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Dy(e,_y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return gy(this,`shape`,n),n}}))}function Py(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Dy(e,_y(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return gy(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Fy(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return Dy(t,_y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return gy(this,`shape`,i),i},checks:[]}))}function Iy(e,t,n){return Dy(t,_y(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return gy(this,`shape`,i),i}}))}function Ly(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ry(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function zy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function By(e){return typeof e==`string`?e:e?.message}function Vy(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Hy(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:By(e.inst?._zod.def?.error?.(e))??By(a?.(e))??By(t?.error?.(e))??By(n.customError?.(e))??By(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}var Uy=/[\uD800-\uDBFF]/;function Wy(e){let t=e.length;if(!Uy.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Gy(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ky(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function qy(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Jy(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Zy(e,n,r.value)}}function Yy(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Xy(e,t,n){return Yy(e,t,n,!1)}function Zy(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Yy(this,t,n.bind(this))},set(e){Yy(this,t,e)}})}function Qy(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var $y,eb=!1,tb={configurable:!0,get(){eb=!0}};function nb(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&$y!==e._zod){$y=void 0;return}$y=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,tb);let e=eb;eb=!1;try{let r=n(this);return eb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),eb||=e,r}catch(n){throw delete this[t],eb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function rb(e,t,n,r){let i=Qy(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ib=`~constantCatch`;function ab(e){let t=()=>e;return t[ib]=!0,t}var ob,sb={value:void 0,enumerable:!1},cb=`captureStackTrace`in Error?Error:null;function lb(e){let t=cb;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return cb=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Q(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){sb.value=new a(r);try{Object.defineProperty(n,"_zod",sb)}finally{sb.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Jy(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?lb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ub=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},db=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ob=globalThis).__zod_globalConfig??(ob.__zod_globalConfig={});var fb=globalThis.__zod_globalConfig;function pb(e){return e&&Object.assign(fb,e),fb}function mb(){let e=this._zod;return e.message??=JSON.stringify(e.def,fy,2),e.message}function hb(e){this._zod.message=e}var gb={get:mb,set:hb,enumerable:!0,configurable:!0},_b={value:void 0,enumerable:!1},vb={value:void 0,enumerable:!1},yb=new WeakSet([Object.prototype,Error.prototype]),bb=(e,t)=>{e.name=`$ZodError`,_b.value=e._zod,Object.defineProperty(e,"_zod",_b),vb.value=t,Object.defineProperty(e,"issues",vb),_b.value=void 0,vb.value=void 0,Object.defineProperty(e,"message",gb);let n=Object.getPrototypeOf(e);yb.has(n)||(yb.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},xb=Q(`$ZodError`,bb),Sb=Q(`$ZodError`,bb,void 0,{Parent:Error});function Cb(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function wb(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Cb(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Tb(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Eb(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Db=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ub;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Hy(e,o,pb())));throw by(n,a?.callee??t),n}return s.value};return t},Ob=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Hy(e,o,pb())));throw by(n,a?.callee??t),n}return s.value};return t},kb=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ub;return a.issues.length?{success:!1,error:new(e??xb)(a.issues.map(e=>Hy(e,i,pb())))}:{success:!0,data:a.value}},Ab=kb(Sb),jb=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Hy(e,i,pb())))}:{success:!0,data:a.value}},Mb=jb(Sb),Nb=e=>{let t=Db(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Eb(n,a))};return n},Pb=e=>{let t=Db(e),n=(e,r,i,a)=>t(e,r,i,Eb(n,a));return n},Fb=e=>{let t=Ob(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Eb(n,a))};return n},Ib=e=>{let t=Ob(e),n=async(e,r,i,a)=>await t(e,r,i,Eb(n,a));return n},Lb=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return kb(e)(t,n,i)},Rb=e=>(t,n,r)=>kb(e)(t,n,r),zb=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jb(e)(t,n,i)},Bb=e=>async(t,n,r)=>jb(e)(t,n,r),Vb=/^[cC][0-9a-z]{6,}$/,Hb=/^[0-9a-z]+$/,Ub=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Wb=/^[0-9a-vA-V]{20}$/,Gb=/^[A-Za-z0-9]{27}$/,Kb=/^[a-zA-Z0-9_-]{21}$/;function qb(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Jb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Yb=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Xb=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Zb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qb=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function $b(){return new RegExp(Qb,`u`)}var ex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,nx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ix=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ax=/^[A-Za-z0-9_-]*$/,ox=/^https?$/,sx=/^\+[1-9]\d{6,14}$/,cx=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function lx(e){return RegExp(`^${e}$`)}var ux=lx(cx);function dx(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fx(e){return RegExp(`^${dx(e)}$`)}function px(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${dx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${dx({precision:e.precision})}`:n;return RegExp(`^${cx}T(?:${r})$`)}var mx=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},hx=/^[^A-Z]*$/,gx=/^[^a-z]*$/,_x=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vx=e=>{let t=e.value;return!my(t)&&t.length!==void 0},yx=Q(`$ZodCheckMaxLength`,(e,t)=>{var n;_x.init(e,t),(n=e._zod.def).when??(n.when=vx),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Wy(r):i)<=t.maximum)return;let a=Gy(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bx=Q(`$ZodCheckMinLength`,(e,t)=>{var n;_x.init(e,t),(n=e._zod.def).when??(n.when=vx),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Wy(r):i)>=t.minimum)return;let a=Gy(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xx=Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;_x.init(e,t),(n=e._zod.def).when??(n.when=vx),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Wy(r):i;if(a===t.length)return;let o=Gy(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Sx=Q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_x.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Cx=Q(`$ZodCheckRegex`,(e,t)=>{Sx.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),wx=Q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hx,Sx.init(e,t)}),Tx=Q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gx,Sx.init(e,t)}),Ex=Q(`$ZodCheckIncludes`,(e,t)=>{_x.init(e,t);let n=Ey(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Dx=Q(`$ZodCheckStartsWith`,(e,t)=>{_x.init(e,t);let n=RegExp(`^${Ey(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ox=Q(`$ZodCheckEndsWith`,(e,t)=>{_x.init(e,t);let n=RegExp(`.*${Ey(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),kx=Q(`$ZodCheckOverwrite`,(e,t)=>{_x.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ax=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
59
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
60
|
+
`)}\n};`)(...Object.values(this.closed))}},jx={major:4,minor:5,patch:4},Mx=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jx;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Ly(t),a;for(let o of n){if(o._zod.def.when){if(Ry(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new ub;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Vy(t.issues,n,e),i||=Ly(t,n))});else{if(t.issues.length===n)continue;Vy(t.issues,n,e),i||=Ly(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ly(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new ub;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new ub;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Xy(this,`~standard`,Px(this))},set"~standard"(e){Yy(this,`~standard`,e)}}),Nx=e=>e.success?{value:e.data}:{issues:e.error?.issues};function Px(e){return{validate:t=>{try{return Nx(Ab(e,t))}catch{return Mb(e,t).then(Nx)}},vendor:`zod`,version:1}}var Fx=Q(`$ZodString`,(e,t)=>{Mx.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mx(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Ix=Q(`$ZodStringFormat`,(e,t)=>{Sx.init(e,t),Fx.init(e,t)}),Lx=Q(`$ZodGUID`,(e,t)=>{t.pattern??=Yb,Ix.init(e,t)}),Rx=Q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Xb(e)}else t.pattern??=Xb();Ix.init(e,t)}),zx=Q(`$ZodEmail`,(e,t)=>{t.pattern??=Zb,Ix.init(e,t)});function Bx(e,t){if(!t.normalize&&t.protocol?.source===ox.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var Vx=/[\t\n\r]/g;function Hx(e){return e.replace(Vx,``)}function Ux(e,t){return t.lastIndex=0,t.test(e.hostname)}function Wx(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Gx=Q(`$ZodURL`,(e,t)=>{Ix.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Bx(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Ux(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Wx(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Hx(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Kx=Q(`$ZodEmoji`,(e,t)=>{t.pattern??=$b(),Ix.init(e,t)}),qx=Q(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Kb:qb(t.length),Ix.init(e,t)}),Jx=Q(`$ZodCUID`,(e,t)=>{t.pattern??=Vb,Ix.init(e,t)}),Yx=Q(`$ZodCUID2`,(e,t)=>{t.pattern??=Hb,Ix.init(e,t)}),Xx=Q(`$ZodULID`,(e,t)=>{t.pattern??=Ub,Ix.init(e,t)}),Zx=Q(`$ZodXID`,(e,t)=>{t.pattern??=Wb,Ix.init(e,t)}),Qx=Q(`$ZodKSUID`,(e,t)=>{t.pattern??=Gb,Ix.init(e,t)}),$x=Q(`$ZodISODateTime`,(e,t)=>{t.pattern??=px(t),Ix.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),eS=Q(`$ZodISODate`,(e,t)=>{t.pattern??=ux,Ix.init(e,t)}),tS=Q(`$ZodISOTime`,(e,t)=>{t.pattern??=fx(t),Ix.init(e,t)}),nS=Q(`$ZodISODuration`,(e,t)=>{t.pattern??=Jb,Ix.init(e,t)}),rS=Q(`$ZodIPv4`,(e,t)=>{t.pattern??=ex,Ix.init(e,t),e._zod.bag.format=`ipv4`}),iS=/^[0-9a-fA-F:.]+$/;function aS(e){if(!iS.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var oS=Q(`$ZodIPv6`,(e,t)=>{t.pattern??=tx,Ix.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{aS(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),sS=Q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=nx,Ix.init(e,t)});function cS(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:aS(n)}var lS=Q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=rx,Ix.init(e,t),e._zod.check=n=>{cS(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function uS(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var dS=Q(`$ZodBase64`,(e,t)=>{t.pattern??=ix,Ix.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{uS(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function fS(e){if(!ax.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return uS(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var pS=Q(`$ZodBase64URL`,(e,t)=>{t.pattern??=ax,Ix.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{fS(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),mS=Q(`$ZodE164`,(e,t)=>{t.pattern??=sx,Ix.init(e,t)});function hS(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var gS=Q(`$ZodJWT`,(e,t)=>{Ix.init(e,t),e._zod.check=n=>{hS(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),_S=Q(`$ZodUnknown`,(e,t)=>{Mx.init(e,t),e._zod.parse=e=>e}),vS=Q(`$ZodNever`,(e,t)=>{Mx.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function yS(e,t,n){e.issues.length&&t.issues.push(...zy(n,e.issues)),t.value[n]=e.value}var bS=Q(`$ZodArray`,(e,t)=>{Mx.init(e,t);let n=fb.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>yS(t,r,e))):yS(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function xS(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...zy(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var SS=[];function CS(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:SS,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ky(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function wS(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>xS(e,n,i,t,u,d))):xS(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var TS=new WeakMap,ES=Q(`$ZodObject`,(e,t)=>{if(Mx.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;TS.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),TS.set(t,n),n}})}let n=py(()=>CS(t));nb(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||gy(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=xy,i=t.catchall,a,o=fb.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>xS(n,t,e,c,r,i))):xS(a,t,e,c,r,i)}return i?wS(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),DS=Q(`$ZodObjectJIT`,(e,t)=>{ES.init(e,t);let n=e._zod.parse,r=py(()=>CS(t)),i=fb.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Ax([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
61
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
62
|
+
const iss = ${e}.issues[i];
|
|
63
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
64
|
+
payload.issues.push(iss);
|
|
65
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:vy(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
66
|
+
const ${n}_present = ${i};
|
|
67
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
68
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (${e}) {
|
|
72
|
+
newResult[${r}] = ${n}.value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`)}else f?o.write(`
|
|
77
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (${n}.value === undefined) {
|
|
81
|
+
if (${i}) {
|
|
82
|
+
newResult[${r}] = undefined;
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
newResult[${r}] = ${n}.value;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
`):o.write(`
|
|
89
|
+
const ${n}_present = ${i};
|
|
90
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
91
|
+
}
|
|
92
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
93
|
+
payload.issues.push({
|
|
94
|
+
code: "invalid_type",
|
|
95
|
+
expected: "nonoptional",
|
|
96
|
+
input: undefined,
|
|
97
|
+
path: [${r}]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (${n}_present) {
|
|
102
|
+
newResult[${r}] = ${n}.value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xy,c=!fb.jitless,l=c&&Sy.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?wS([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function OS(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ly(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Hy(e,r,pb())))}),t)}var kS=Q(`$ZodUnion`,(e,t)=>{Mx.init(e,t),nb(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),nb(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),nb(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),nb(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>hy(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>OS(t,r,e,i)):OS(o,r,e,i)}}),AS=Q(`$ZodIntersection`,(e,t)=>{Mx.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>MS(e,t,n)):MS(e,i,a)}});function jS(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Cy(e)&&Cy(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=jS(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=jS(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function MS(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=jS(t.value,n.value);if(!c.valid){if(Ly(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var NS=Q(`$ZodEnum`,(e,t)=>{Mx.init(e,t);let n=uy(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>Ty.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>Ey(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),PS=Q(`$ZodTransform`,(e,t)=>{Mx.init(e,t),e._zod.optin=`optional`,fb.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new db(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ub;return n.value=i,n}});function FS(e,t){return e.value=t.issues.length?void 0:t.value,e}var IS=Q(`$ZodOptional`,(e,t)=>{Mx.init(e,t),nb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,nb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),nb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${hy(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>FS(e,t)):FS(e,r)}return t.innerType._zod.run(e,n)}}),LS=Q(`$ZodExactOptional`,(e,t)=>{IS.init(e,t),nb(e,`values`,e=>e.def.innerType._zod.values),nb(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),RS=Q(`$ZodNullable`,(e,t)=>{Mx.init(e,t),nb(e,`optin`,e=>e.def.innerType._zod.optin),nb(e,`optout`,e=>e.def.innerType._zod.optout),nb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${hy(t.source)}|null)$`):void 0}),nb(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),zS=Q(`$ZodDefault`,(e,t)=>{Mx.init(e,t),e._zod.optin=`defaulted`,nb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>BS(e,t)):BS(r,t)}});function BS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var VS=Q(`$ZodPrefault`,(e,t)=>{Mx.init(e,t),e._zod.optin=`defaulted`,nb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),HS=Q(`$ZodNonOptional`,(e,t)=>{Mx.init(e,t),nb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>US(t,e)):US(i,e)}});function US(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function WS(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Hy(e,r,pb()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var GS=Q(`$ZodCatch`,(e,t)=>{Mx.init(e,t),nb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),nb(e,`optout`,e=>e.def.innerType._zod.optout),nb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>WS(e,r,t,n)):WS(e,r,t,n)}}),KS=Q(`$ZodPipe`,(e,t)=>{Mx.init(e,t),nb(e,`values`,e=>e.def.in._zod.values),nb(e,`optin`,e=>e.def.in._zod.optin),nb(e,`optout`,e=>e.def.out._zod.optout),nb(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>qS(e,t.in,n)):qS(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qS(e,t.out,n)):qS(r,t.out,n)}});function qS(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var JS=Q(`$ZodReadonly`,(e,t)=>{Mx.init(e,t),nb(e,`propValues`,e=>e.def.innerType._zod.propValues),nb(e,`values`,e=>e.def.innerType._zod.values),nb(e,`optin`,e=>e.def.innerType?._zod?.optin),nb(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(YS):YS(r)}});function YS(e){return e.memo||(e.value=Object.freeze(e.value)),e}var XS=Q(`$ZodCustom`,(e,t)=>{_x.init(e,t),Mx.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ZS(t,n,r,e));ZS(i,n,r,e)}});function ZS(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(qy(e))}}var QS=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},$S=`~memo`,eC=[];function tC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var nC=new WeakMap;function rC(e,t){let n=nC.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&rC(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);break;case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),nC.set(e,r),r}function iC(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var aC,oC=[],sC={alloc(e,t,n){let r=aC;if(!r)return n;aC=void 0;let i={value:n,issues:null};return r.set(t.value,i),oC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&lC(n,e.value))throw new QS;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=rC(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[$S];l||(l={buckets:new Map,backEdges:void 0},s[$S]=l);let u;r===s?u=i:(u=iC(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...tC(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;aC=u;let f=oC.length,p=t(o,s);aC=void 0;let m=oC.length>f?oC.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?tC(e.issues):eC),e)):(m&&(m.issues=p.issues.length?tC(p.issues):eC),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function cC(){return sC}function lC(e,t){let n=e[$S]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var uC=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ky(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Oy(e.values[0])}`:`Invalid option: expected one of ${dy(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${dy(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function dC(){return{localeError:uC()}}var fC,pC=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function mC(){return new pC}(fC=globalThis).__zod_globalRegistry??(fC.__zod_globalRegistry=mC());var hC=globalThis.__zod_globalRegistry;function gC(e,t){return new e({type:`string`,...Z(t)})}function _C(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function vC(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function yC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function bC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function xC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function SC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function CC(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function wC(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function TC(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function EC(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function DC(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function OC(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function kC(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function AC(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function jC(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function MC(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function NC(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function PC(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function FC(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function IC(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function LC(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function RC(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function zC(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function BC(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function VC(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function HC(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function UC(e){return new e({type:`unknown`})}function WC(e,t){return new e({type:`never`,...Z(t)})}function GC(e,t){return new yx({check:`max_length`,...Z(t),maximum:e})}function KC(e,t){return new bx({check:`min_length`,...Z(t),minimum:e})}function qC(e,t){return new xx({check:`length_equals`,...Z(t),length:e})}function JC(e,t){return new Cx({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function YC(e){return new wx({check:`string_format`,format:`lowercase`,...Z(e)})}function XC(e){return new Tx({check:`string_format`,format:`uppercase`,...Z(e)})}function ZC(e,t){return new Ex({check:`string_format`,format:`includes`,...Z(t),includes:e})}function QC(e,t){return new Dx({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function $C(e,t){return new Ox({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function ew(e){return new kx({check:`overwrite`,tx:e})}function tw(e){return ew(t=>t.normalize(e))}function nw(){return ew(e=>e.trim())}function rw(){return ew(e=>e.toLowerCase())}function iw(){return ew(e=>e.toUpperCase())}function aw(){return ew(e=>yy(e))}function ow(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function sw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}function cw(e,t){let n=lw(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(qy(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(qy(r))}},e(t.value,t)),t);return n}function lw(e,t){let n=new _x({check:`custom`,...Z(t)});return n._zod.check=e,n}function uw(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&gy(e,t,n[t]);return e}function dw(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??hC,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function fw(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function pw(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,pw(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&uw(o.schema,c),t.io===`input`&&Cw(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function mw(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function hw(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${mw(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+mw(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
106
|
+
|
|
107
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function gw(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;gw(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var _w=new Set([`type`,`properties`,`required`,`additionalProperties`]),vw=[`oneOf`,`anyOf`];function yw(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function bw(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!_w.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??yw(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}gy(n,r,e.length===1?e[0]:bw(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=yw(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function xw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of _w)if(t in e)return;let n=t.filter(e=>vw.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=bw(t);else{let e=n[0],i=vw.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>bw([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,uw(e,r))}function Sw(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):uw(i,s),uw(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())gw(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])xw(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}uw(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,gy(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Tw(t,`input`,e.processors),output:Tw(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Cw(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Cw(r.element,n);if(r.type===`set`)return Cw(r.valueType,n);if(r.type===`lazy`)return Cw(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Cw(r.innerType,n);if(r.type===`intersection`)return Cw(r.left,n)||Cw(r.right,n);if(r.type===`record`||r.type===`map`)return Cw(r.keyType,n)||Cw(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Cw(r.in,n)||Cw(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Cw(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Cw(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Cw(e,n))return!0;return!!(r.rest&&Cw(r.rest,n))}return!1}var ww=(e,t={})=>n=>{let r=dw({...n,processors:t});return pw(e,r),hw(r,e),Sw(r,e)},Tw=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=dw({...i??{},target:a,io:t,processors:n});return pw(e,o),hw(o,e),Sw(o,e)},Ew={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Dw=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ew[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ow=(e,t,n,r)=>{n.not={}},kw=(e,t,n,r)=>{let i=e._zod.def,a=uy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Aw=(e,t,n,r)=>{fw(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},jw=(e,t,n,r)=>{fw(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Mw=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=pw(a.element,t,{...r,path:[...r.path,`items`]})};function Nw(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Nw(t.out):t.type===`catch`?Nw(t.innerType):e._zod.optin}var Pw=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&fw(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)gy(i.properties,e,pw(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Nw(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=pw(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Fw=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>pw(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Iw=(e,t,n,r)=>{let i=e._zod.def,a=pw(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=pw(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Lw=(e,t,n,r)=>{let i=e._zod.def,a=pw(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zw=Symbol();function Bw(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(fw(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zw):JSON.parse(o)}var Vw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Bw(i.defaultValue,e,t,n,r);o!==zw&&(n.default=o)},Hw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Bw(i.defaultValue,e,t,n,r);o!==zw&&(n._prefault=o)},Uw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{fw(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Ww=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;pw(o,t,r);let s=t.seen.get(e);s.ref=o},Gw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Kw=(e,t,n,r)=>{let i=e._zod.def;pw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qw=new WeakSet([Object.prototype,Error.prototype]);function Jw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Yw=Q(`ZodError`,(e,t)=>{xb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);qw.has(n)||(qw.add(n),Jw(n,`format`,e=>t=>Tb(e,t)),Jw(n,`flatten`,e=>t=>wb(e,t)),Jw(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,fy,2)}),Jw(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,fy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Xw=Db(Yw),Zw=Ob(Yw),Qw=kb(Yw),$w=jb(Yw),eT=Nb(Yw),tT=Pb(Yw),nT=Fb(Yw),rT=Ib(Yw),iT=Lb(Yw),aT=Rb(Yw),oT=zb(Yw),sT=Bb(Yw);function cT(){fb.localeError||pb(dC())}function lT(){fb.memoizer||pb({memoizer:cC()})}var uT=Q(`ZodType`,(e,t)=>(cT(),Mx.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_y(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Dy(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(yE(e,t))},superRefine(e,t){return this.check(bE(e,t))},overwrite(e){return this.check(ew(e))},optional(){return tE(this)},exactOptional(){return rE(this)},nullable(){return aE(this)},nullish(){return tE(aE(this))},nonoptional(e){return dE(this,e)},array(){return UT(this)},or(e){return qT([this,e])},and(e){return YT(this,e)},transform(e){return hE(this,$T(e))},default(e){return sE(this,e)},prefault(e){return lE(this,e)},catch(e){return pE(this,e)},pipe(e){return hE(this,e)},readonly(){return _E(this)},describe(e){let t=this.clone();return hC.add(t,{description:e}),t},meta(...e){if(e.length===0)return hC.get(this);let t=this.clone();return hC.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Xy(this,`~standard`,{...Px(this),jsonSchema:{input:Tw(this,`input`),output:Tw(this,`output`)}})},set"~standard"(e){Yy(this,`~standard`,e)},parse:function e(t,n){return Xw(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Zw(this,t,n,{callee:e})},safeParse(e,t){return Qw(this,e,t)},async safeParseAsync(e,t){return $w(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Yy(this,`spa`,e)},encode:function e(t,n){return eT(this,t,n,{callee:e})},decode:function e(t,n){return tT(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await nT(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await rT(this,t,n,{callee:e})},safeEncode(e,t){return iT(this,e,t)},safeDecode(e,t){return aT(this,e,t)},async safeEncodeAsync(e,t){return oT(this,e,t)},async safeDecodeAsync(e,t){return sT(this,e,t)},toJSONSchema(e){return ww(this,{})(e)},get description(){return hC.get(this)?.description},get _def(){return this._zod.def}}),dT=Q(`_ZodString`,(e,t)=>{Fx.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dw(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(JC(...e))},includes(...e){return this.check(ZC(...e))},startsWith(...e){return this.check(QC(...e))},endsWith(...e){return this.check($C(...e))},min(...e){return this.check(KC(...e))},max(...e){return this.check(GC(...e))},length(...e){return this.check(qC(...e))},nonempty(...e){return this.check(KC(1,...e))},lowercase(e){return this.check(YC(e))},uppercase(e){return this.check(XC(e))},trim(){return this.check(nw())},normalize(...e){return this.check(tw(...e))},toLowerCase(){return this.check(rw())},toUpperCase(){return this.check(iw())},slugify(){return this.check(aw())}}),fT=Q(`ZodString`,(e,t)=>{Fx.init(e,t),dT.init(e,t)},{email(e){return this.check(_C(yT,e))},url(e){return this.check(CC(ST,e))},jwt(e){return this.check(RC(LT,e))},emoji(e){return this.check(wC(CT,e))},guid(e){return this.check(vC(bT,e))},uuid(e){return this.check(yC(xT,e))},uuidv4(e){return this.check(bC(xT,e))},uuidv6(e){return this.check(xC(xT,e))},uuidv7(e){return this.check(SC(xT,e))},nanoid(e){return this.check(TC(wT,e))},cuid(e){return this.check(EC(TT,e))},cuid2(e){return this.check(DC(ET,e))},ulid(e){return this.check(OC(DT,e))},base64(e){return this.check(FC(PT,e))},base64url(e){return this.check(IC(FT,e))},xid(e){return this.check(kC(OT,e))},ksuid(e){return this.check(AC(kT,e))},ipv4(e){return this.check(jC(AT,e))},ipv6(e){return this.check(MC(jT,e))},cidrv4(e){return this.check(NC(MT,e))},cidrv6(e){return this.check(PC(NT,e))},e164(e){return this.check(LC(IT,e))},datetime(e){return this.check(zC(hT,e))},date(e){return this.check(BC(gT,e))},time(e){return this.check(VC(_T,e))},duration(e){return this.check(HC(vT,e))}});function pT(e){return gC(fT,e)}var mT=Q(`ZodStringFormat`,(e,t)=>{Ix.init(e,t),dT.init(e,t)}),hT=Q(`ZodISODateTime`,(e,t)=>{$x.init(e,t),mT.init(e,t)}),gT=Q(`ZodISODate`,(e,t)=>{eS.init(e,t),mT.init(e,t)}),_T=Q(`ZodISOTime`,(e,t)=>{tS.init(e,t),mT.init(e,t)}),vT=Q(`ZodISODuration`,(e,t)=>{nS.init(e,t),mT.init(e,t)}),yT=Q(`ZodEmail`,(e,t)=>{zx.init(e,t),mT.init(e,t)}),bT=Q(`ZodGUID`,(e,t)=>{Lx.init(e,t),mT.init(e,t)}),xT=Q(`ZodUUID`,(e,t)=>{Rx.init(e,t),mT.init(e,t)}),ST=Q(`ZodURL`,(e,t)=>{Gx.init(e,t),mT.init(e,t)}),CT=Q(`ZodEmoji`,(e,t)=>{Kx.init(e,t),mT.init(e,t)}),wT=Q(`ZodNanoID`,(e,t)=>{qx.init(e,t),mT.init(e,t)}),TT=Q(`ZodCUID`,(e,t)=>{Jx.init(e,t),mT.init(e,t)}),ET=Q(`ZodCUID2`,(e,t)=>{Yx.init(e,t),mT.init(e,t)}),DT=Q(`ZodULID`,(e,t)=>{Xx.init(e,t),mT.init(e,t)}),OT=Q(`ZodXID`,(e,t)=>{Zx.init(e,t),mT.init(e,t)}),kT=Q(`ZodKSUID`,(e,t)=>{Qx.init(e,t),mT.init(e,t)}),AT=Q(`ZodIPv4`,(e,t)=>{rS.init(e,t),mT.init(e,t)}),jT=Q(`ZodIPv6`,(e,t)=>{oS.init(e,t),mT.init(e,t)}),MT=Q(`ZodCIDRv4`,(e,t)=>{sS.init(e,t),mT.init(e,t)}),NT=Q(`ZodCIDRv6`,(e,t)=>{lS.init(e,t),mT.init(e,t)}),PT=Q(`ZodBase64`,(e,t)=>{dS.init(e,t),mT.init(e,t)}),FT=Q(`ZodBase64URL`,(e,t)=>{pS.init(e,t),mT.init(e,t)}),IT=Q(`ZodE164`,(e,t)=>{mS.init(e,t),mT.init(e,t)}),LT=Q(`ZodJWT`,(e,t)=>{gS.init(e,t),mT.init(e,t)}),RT=Q(`ZodUnknown`,(e,t)=>{_S.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function zT(){return UC(RT)}var BT=Q(`ZodNever`,(e,t)=>{vS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ow(e,t,n,r)});function VT(e){return WC(BT,e)}var HT=Q(`ZodArray`,(e,t)=>{lT(),bS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mw(e,t,n,r),e.element=t.element},{min(e,t){return this.check(KC(e,t))},nonempty(e){return this.check(KC(1,e))},max(e,t){return this.check(GC(e,t))},length(e,t){return this.check(qC(e,t))},unwrap(){return this.element}});function UT(e,t){return ow(HT,e,t)}var WT=Q(`ZodObject`,(e,t)=>{lT(),DS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pw(e,t,n,r),rb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ZT(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:zT()})},loose(){return this.clone({...this._zod.def,catchall:zT()})},strict(){return this.clone({...this._zod.def,catchall:VT()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return My(this,e)},safeExtend(e){return Ny(this,e)},merge(e){return Py(this,e)},pick(e){return Ay(this,e)},omit(e){return jy(this,e)},partial(...e){return Fy(eE,this,e[0])},exactPartial(...e){return Fy(nE,this,e[0],`exactPartial`)},required(...e){return Iy(uE,this,e[0])}});function GT(e,t){return new WT({type:`object`,shape:e??{},...Z(t)})}var KT=Q(`ZodUnion`,(e,t)=>{kS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fw(e,t,n,r),e.options=t.options});function qT(e,t){return new KT({type:`union`,options:e,...Z(t)})}var JT=Q(`ZodIntersection`,(e,t)=>{AS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iw(e,t,n,r)});function YT(e,t){return new JT({type:`intersection`,left:e,right:t})}var XT=Q(`ZodEnum`,(e,t)=>{NS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kw(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new XT({...t,checks:[],...Z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new XT({...t,checks:[],...Z(r),entries:i})}});function ZT(e,t){return new XT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Z(t)})}var QT=Q(`ZodTransform`,(e,t)=>{lT(),PS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jw(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new db(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(qy(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(qy(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function $T(e){return new QT({type:`transform`,transform:e})}var eE=Q(`ZodOptional`,(e,t)=>{IS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tE(e){return new eE({type:`optional`,innerType:e})}var nE=Q(`ZodExactOptional`,(e,t)=>{LS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rE(e){return new nE({type:`optional`,innerType:e})}var iE=Q(`ZodNullable`,(e,t)=>{RS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aE(e){return new iE({type:`nullable`,innerType:e})}var oE=Q(`ZodDefault`,(e,t)=>{zS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sE(e,t){return new oE({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():wy(t)}})}var cE=Q(`ZodPrefault`,(e,t)=>{VS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lE(e,t){return new cE({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():wy(t)}})}var uE=Q(`ZodNonOptional`,(e,t)=>{HS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dE(e,t){return new uE({type:`nonoptional`,innerType:e,...Z(t)})}var fE=Q(`ZodCatch`,(e,t)=>{GS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pE(e,t){return new fE({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ab(t)})}var mE=Q(`ZodPipe`,(e,t)=>{KS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ww(e,t,n,r),e.in=t.in,e.out=t.out});function hE(e,t){return new mE({type:`pipe`,in:e,out:t})}var gE=Q(`ZodReadonly`,(e,t)=>{JS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _E(e){return new gE({type:`readonly`,innerType:e})}var vE=Q(`ZodCustom`,(e,t)=>{XS.init(e,t),uT.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aw(e,t,n,r)});function yE(e,t={}){return sw(vE,e,t)}function bE(e,t){return cw(e,t)}var xE=e=>e&&{primary:`text-primary`,secondary:`text-secondary`,neutral:`text-neutral`,light:`text-white`,dark:`text-neutral-800`,text:`text-muted-foreground`,"text-inverse":`text-foreground-opposite`,error:`text-error`,success:`text-success`,custom:``}[e]||``,SE=Ze(`flex flex-row flex-wrap items-center`,{variants:{size:{xs:`gap-1 text-xs`,sm:`gap-1.5 text-sm`,md:`gap-2 text-base`,lg:`gap-3 text-lg`,xl:`gap-4 text-xl`},spacing:{compact:`gap-1`,normal:`gap-2`,loose:`gap-4`}},defaultVariants:{size:`md`,spacing:`normal`}}),CE=({href:e,lang:t,children:n,onClick:r,color:i,position:a,locale:o,className:c,...l})=>{let u=s(`breadcrumb`).linkLabel;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ve,{href:e,locale:o,color:i,onClick:r,itemProp:`item`,isExternalLink:!1,itemScope:!0,itemType:`https://schema.org/WebPage`,...l,label:`${u} ${n}`,itemID:e,size:`custom`,children:(0,H.jsx)(`span`,{itemProp:`name`,children:n})}),(0,H.jsx)(`meta`,{itemProp:`position`,content:a.toString()})]})},wE=e=>{let{children:t,onClick:n,color:r,position:i,className:a,...o}=e,{linkLabel:s}=F(`breadcrumb`);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(M,{onClick:n,variant:`link`,label:`${s} ${t}`,color:r,itemProp:`item`,size:`custom`,...o,children:(0,H.jsx)(`span`,{itemProp:`name`,children:t})}),(0,H.jsx)(`meta`,{itemProp:`position`,content:i.toString()})]})},TE=({children:e,position:t,className:n,...r})=>(0,H.jsxs)(`span`,{itemProp:`item`,className:R(`inline-flex items-center`,`font-medium text-muted-foreground`,`transition-colors duration-200`,n),children:[(0,H.jsx)(`span`,{itemProp:`name`,...r,children:e}),(0,H.jsx)(`meta`,{itemProp:`position`,content:t.toString()})]}),EE=({links:e,className:t,color:n=`text`,locale:r,elementType:i=`page`,separator:a=(0,H.jsx)(Ys,{size:10}),ariaLabel:o=`breadcrumb`,includeStructuredData:s=!0,maxItems:c,size:l,spacing:u,...d})=>{let f=c&&e.length>c?[...e.slice(0,1),`...`,...e.slice(-(c-2))]:e;return(0,H.jsx)(`nav`,{"aria-label":o,children:(0,H.jsx)(`ol`,{className:R(SE({size:l,spacing:u}),t),...s&&{itemScope:!0,itemType:`http://schema.org/BreadcrumbList`},...d,children:f.map((e,t)=>{let o=t===f.length-1,c=typeof e==`object`&&typeof e.href==`string`,l=typeof e==`object`&&typeof e.onClick==`function`,u=t===f.length-1,d=u?i:void 0,p=e===`...`,m=e.text??e,h=xE(n);if(p)return(0,H.jsxs)(z.Fragment,{children:[(0,H.jsx)(`li`,{className:`flex items-center`,"aria-hidden":`true`,children:(0,H.jsx)(`span`,{className:`text-neutral-500`,children:`…`})}),!o&&(0,H.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,H.jsx)(`span`,{className:R(h),children:a})})]},`truncated-${m}`);let g=(0,H.jsx)(TE,{position:t+1,"aria-current":d,className:R(`transition-colors duration-200`,u&&`text-foreground`),children:m},m);c?g=(0,H.jsx)(CE,{href:e.href,color:n,position:t+1,locale:r,"aria-current":d,className:R(u&&`cursor-default text-foreground`),children:m},m):l&&(g=(0,H.jsx)(wE,{onClick:e.onClick,color:n,position:t+1,"aria-current":d,className:R(u&&`cursor-default text-neutral-900`),children:m},m));let _=(0,z.createElement)(`li`,{...s&&{itemProp:`itemListElement`,itemScope:!0,itemType:`https://schema.org/ListItem`},key:m,className:`flex items-center`},g);return o?_:(0,H.jsxs)(z.Fragment,{children:[_,(0,H.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,H.jsx)(`span`,{className:R(h),children:a})})]},m)})})})},DE=({keyPath:e,dictionaryKey:t,onClickKeyPath:n,locale:r,color:i,showDictionaryKey:a=!0})=>{let o=[...a?[{text:Dt(t),onClick:n?()=>n([]):void 0}]:[],...e.map((t,r)=>({onClick:n?()=>n?.(e.slice(0,r+1)):void 0,text:Dt(t.key?.toString()??``)}))];return(0,H.jsx)(EE,{links:o,locale:r,elementType:`location`,color:i})},OE=({children:e,className:t,identifier:n,...r})=>(0,H.jsx)(`div`,{className:R(`group/dropdown relative flex`,t),"aria-label":`DropDown ${n}`,id:`dropdown-container-${n}`,...r,children:e});OE.Trigger=({children:e,identifier:t,className:n,label:r,...i})=>(0,H.jsx)(M,{className:R([`w-full cursor-pointer`,`group-focus-within/dropdown:bg-current/20 group-focus-within/dropdown:ring-4`,n]),label:r??`Open panel ${t}`,"aria-haspopup":`true`,"aria-controls":`dropdown-panel-${t}`,id:`dropdown-trigger-${t}`,onClick:e=>{e.currentTarget.focus()},variant:`none`,...i,children:e}),OE.Panel=({children:e,isHidden:t=void 0,isOverable:n=!1,isFocusable:r=!1,align:i=`start`,yAlign:a=`below`,identifier:o,className:s,smootherClassName:c,...l})=>(0,H.jsx)(`div`,{className:R(`absolute z-100 min-w-full`,i===`start`&&`left-0`,i===`end`&&`right-0`,a===`below`&&`top-[calc(100%+0.5rem)]`,a===`above`&&`bottom-[calc(100%+0.5rem)]`,s),"aria-hidden":t,role:`region`,"aria-labelledby":`dropdown-trigger-${o}`,id:`dropdown-panel-${o}`,children:(0,H.jsx)(ee,{isHidden:t,className:R(`overflow-x-visible`,t===!1&&`invisible`,t===!0&&`visible`,n&&`group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]`,r&&`group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]`,c),...l,children:e})});function kE(e){return Array.isArray?Array.isArray(e):zE(e)===`[object Array]`}function AE(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function jE(e){return e==null?``:AE(e)}function ME(e){return typeof e==`string`}function NE(e){return typeof e==`number`}function PE(e){return e===!0||e===!1||IE(e)&&zE(e)==`[object Boolean]`}function FE(e){return typeof e==`object`}function IE(e){return FE(e)&&e!==null}function LE(e){return e!=null}function RE(e){return!e.trim().length}function zE(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var BE=`Incorrect 'index' type`,VE=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,HE=e=>`Invalid value for key ${e}`,UE=e=>`Pattern length exceeds max of ${e}.`,WE=e=>`Missing ${e} property in key`,GE=e=>`Property 'weight' in key '${e}' must be a positive integer`,KE=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,qE=Object.prototype.hasOwnProperty,JE=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=YE(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function YE(e){let t=null,n=null,r=null,i=1,a=null;if(ME(e)||kE(e))r=e,t=XE(e),n=ZE(e);else{if(!qE.call(e,`name`))throw Error(WE(`name`));let o=e.name;if(r=o,qE.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(GE(ZE(o)));t=XE(o),n=ZE(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function XE(e){return kE(e)?e:e.split(`.`)}function ZE(e){return kE(e)?e.join(`.`):e}function QE(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(LE(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!LE(s))return;if(a===t.length-1&&(ME(s)||NE(s)||PE(s)||typeof s==`bigint`))n.push(o===void 0?jE(s):{v:jE(s),i:o});else if(kE(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,ME(t)?t.split(`.`):t,0),r?n:n[0]}var $E={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},eD={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},tD={location:0,threshold:.6,distance:100},nD={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:QE,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},$=Object.freeze({...eD,...$E,...tD,...nD});function rD(e){return e>=9&&e<=13||e===32||e===160}function iD(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)rD(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var aD=class{constructor({getFn:e=$.getFn,fieldNormWeight:t=$.fieldNormWeight}={}){this.norm=iD(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(ME(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(VE);if(ME(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(VE);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!LE(e)||RE(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(LE(i)){if(kE(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(LE(n)){if(ME(n)){if(!RE(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(LE(n.v)){let t=ME(n.v)?n.v:jE(n.v);if(!RE(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(ME(i)&&!RE(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function oD(e,t,{getFn:n=$.getFn,fieldNormWeight:r=$.fieldNormWeight}={}){let i=new aD({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(YE)),i.setSources(t),i.create(),i}function sD(e,{getFn:t=$.getFn,fieldNormWeight:n=$.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new aD({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function cD(e=[],t=$.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function lD(e,t,n,{location:r=$.location,distance:i=$.distance,threshold:a=$.threshold,findAllMatches:o=$.findAllMatches,minMatchCharLength:s=$.minMatchCharLength,includeMatches:c=$.includeMatches,ignoreLocation:l=$.ignoreLocation}={}){if(t.length>32)throw Error(UE(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=cD(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function uD(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function dD(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var fD={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},pD=RegExp(`[`+Object.keys(fD).join(``)+`]`,`g`),mD=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(pD,e=>fD[e]):e=>e,hD=class{constructor(e,{location:t=$.location,threshold:n=$.threshold,distance:r=$.distance,includeMatches:i=$.includeMatches,findAllMatches:a=$.findAllMatches,minMatchCharLength:o=$.minMatchCharLength,isCaseSensitive:s=$.isCaseSensitive,ignoreDiacritics:c=$.ignoreDiacritics,ignoreLocation:l=$.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?mD(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:uD(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?mD(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=lD(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=dD(u)),p}},gD=new Set([`fuzzy`,`include`]);function _D(e){return e.startsWith(`inverse`)}var vD=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new hD(e,{location:t.location??$.location,threshold:t.threshold??$.threshold,distance:t.distance??$.distance,includeMatches:t.includeMatches??$.includeMatches,findAllMatches:t.findAllMatches??$.findAllMatches,minMatchCharLength:t.minMatchCharLength??$.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??$.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??$.ignoreDiacritics,ignoreLocation:t.ignoreLocation??$.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],yD=vD.length,bD=`\0`,xD=`|`;function SD(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function CD(e,t){let n=e.match(t);return n?n[1]:null}function wD(e,t={}){return e.replace(/\\\|/g,bD).split(xD).map(e=>{let n=SD(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<yD;){let e=vD[o],n=CD(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<yD;){let e=vD[o],n=CD(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var TD=class{constructor(e,{isCaseSensitive:t=$.isCaseSensitive,ignoreDiacritics:n=$.ignoreDiacritics,includeMatches:r=$.includeMatches,minMatchCharLength:i=$.minMatchCharLength,ignoreLocation:a=$.ignoreLocation,findAllMatches:o=$.findAllMatches,location:s=$.location,threshold:c=$.threshold,distance:l=$.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?mD(e):e,this.pattern=e,this.query=wD(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?mD(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,_D(r.type)&&(c=!0),n&&(gD.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=dD(o)),e}}return{isMatch:!1,score:1}}},ED=[];function DD(...e){ED.push(...e)}function OD(e,t){for(let n=0,r=ED.length;n<r;n+=1){let r=ED[n];if(r.condition(e,t))return new r(e,t)}return new hD(e,t)}var kD={AND:`$and`,OR:`$or`},AD={PATH:`$path`,PATTERN:`$val`},jD=e=>!!(e[kD.AND]||e[kD.OR]),MD=e=>!!e[AD.PATH],ND=e=>!kE(e)&&FE(e)&&!jD(e),PD=e=>({[kD.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function FD(e,t,{auto:n=!0}={}){let r=e=>{if(ME(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=OD(e,t)),r}let i=Object.keys(e),a=MD(e);if(!a&&i.length>1&&!jD(e))return r(PD(e));if(ND(e)){let r=a?e[AD.PATH]:i[0],o=a?e[AD.PATTERN]:e[r];if(!ME(o))throw Error(HE(r));let s={keyId:ZE(r),pattern:o};return n&&(s.searcher=OD(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];kE(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return jD(e)||(e=PD(e)),r(e)}function ID(e,{ignoreFieldNorm:t=$.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function LD(e,{ignoreFieldNorm:t=$.ignoreFieldNorm}){e.forEach(e=>{e.score=ID(e.matches,{ignoreFieldNorm:t})})}var RD=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function zD(e){let t=[];return e.matches.forEach(e=>{if(!LE(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function BD(e,t,{includeMatches:n=$.includeMatches,includeScore:r=$.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=zD(e)),r&&(a.score=e.score),a})}var VD=/[\p{L}\p{M}\p{N}_]+/gu,HD=new WeakSet;function UD(e){HD.has(e)||(HD.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function WD(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||UD(e),t=>t.match(e)||[]):e=>e.match(VD)||[]}function GD({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=WD(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=mD(n)),r(n)}}}var KD=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=GD({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new hD(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=dD(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function qD(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function JD(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){qD(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)qD(e,t.v,i,r);else qD(e,n.v,i,r)}}}function YD(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)JD(r,i,t,n);return r}function XD(e,t,n,r){JD(e,t,n,r)}function ZD(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function QD(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)ZD(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var $D=class{constructor(e,t,n){this.options={...$,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new JE(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=OD(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof aD))throw Error(BE);if(this._myIndex=t||oD(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=GD({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=YD(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!LE(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=GD({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});XD(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&QD(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(VE);this._invertedIndex&&QD(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(ME(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return NE(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&NE(n)&&n>0&&ME(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new RD(n,u);ME(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=ME(e)?ME(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),LD(d,{ignoreFieldNorm:s}),a&&d.sort(ME(e)?u:l),NE(n)&&n>-1&&(d=d.slice(0,n));return BD(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!LE(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=ID(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=FD(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===kD.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(LE(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!LE(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=ID(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!LE(t))return[];let r=[];if(kE(t))t.forEach(({v:t,i,n:a})=>{if(!LE(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};$D.version=`7.5.0`,$D.createIndex=oD,$D.parseIndex=sD,$D.config=$,$D.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(KE);return OD(e,{...$,...n}).searchIn(t)},$D.parseQuery=FD,DD(TD),DD(KD),$D.use=function(...e){e.forEach(e=>DD(e))};var eO=$D,tO=`locale-switcher-content`,nO=({panelProps:e,isMultilingual:t=!0})=>{let{switchTo:n,searchInput:r,localeSwitcherLabel:a,languageListLabel:s,seeAllLocalesSwitch:c}=F(`locale-switcher-content`),l=(0,z.useRef)(null),{locale:u}=Ht(),{availableLocales:d,selectedLocales:f,setSelectedLocales:p}=wm(),m=(0,z.useMemo)(()=>d.map(e=>({locale:e,englishName:At(e,`en`),currentLocaleName:At(e,u),ownLocaleName:At(e)})),[d,u]),[h,g]=(0,z.useState)(``),[_,v]=o(`locale-content-selector-see-all-locales`,!1),y=(0,z.useMemo)(()=>new eO(m,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[m]),b=(0,z.useMemo)(()=>h?y.search(h).map(e=>e.item):m,[h,m,y]),x=e=>{t?f.includes(e)?f.length>1&&p(t=>t.filter(t=>t!==e)):p(t=>[...t,e]):p([e])},S=e=>{v(e),p(e?d:[u])};return(0,H.jsx)(`div`,{className:`rounded-xl border border-text text-foreground transition-colors`,children:(0,H.jsxs)(OE,{identifier:tO,children:[(0,H.jsx)(OE.Trigger,{identifier:tO,label:a.value,className:`p-0!`,roundedSize:`3xl`,color:`text`,variant:`hoverable`,children:(0,H.jsxs)(`div`,{className:`flex w-full items-center justify-between text-foreground`,children:[(0,H.jsx)(`div`,{className:`px-2 py-1`,children:(0,H.jsx)(Qs,{size:16})}),(0,H.jsx)($s,{className:`self-center`,size:16})]})}),(0,H.jsx)(OE.Panel,{identifier:tO,isOverable:!0,isFocusable:!0,align:`end`,...e,children:(0,H.jsxs)(Ne,{className:`max-h-[60vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,border:!0,roundedSize:`3xl`,borderColor:`text`,"aria-label":s.value,children:[t&&(0,H.jsx)(`div`,{className:`m-auto p-2`,children:(0,H.jsx)(wp,{defaultValue:_,onChange:S,color:`text`,size:`sm`,className:`!w-60`,choices:[{content:c.true.value,value:!0},{content:c.false.value,value:!1}]})}),!(t&&_)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(Ap,{type:`search`,"aria-label":r.ariaLabel.value,placeholder:r.placeholder.value,onChange:e=>g(e.target.value),ref:l})}),(0,H.jsx)(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:b.map(({locale:e,currentLocaleName:r,ownLocaleName:a})=>(0,H.jsx)(`li`,{className:`px-1.5 py-1`,children:(0,H.jsx)(M,{onClick:()=>x(e),label:`${n} ${r}`,disabled:!(d??d).includes(e),isActive:f.includes(e),variant:`hoverable`,color:`text`,isFullWidth:!0,textAlign:`left`,size:`sm`,children:(0,H.jsxs)(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[t&&(0,H.jsx)(`div`,{className:`w-4`,children:f.includes(e)&&(0,H.jsx)(i,{className:`size-full`})}),(0,H.jsxs)(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col text-nowrap`,children:[(0,H.jsx)(`span`,{dir:kt(e),lang:e,children:a}),(0,H.jsx)(`span`,{className:`text-neutral text-xs`,children:r})]}),(0,H.jsx)(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})},rO=Ze(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}}),iO=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},aO=e=>e?.getAttribute(`aria-current`)===`true`,oO=e=>e===`sm`?`icon-sm`:e===`lg`?`icon-lg`:`icon-md`,sO=e=>(0,H.jsx)(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),cO=({currentPage:e,totalPages:t,onPageChange:n,showFirstLast:r=!1,showPrevNext:i=!0,maxVisiblePages:a=5,disabled:o=!1,size:s=`md`,variant:c=`default`,color:l=`text`,className:u,...d})=>{let{goToNextPage:f,goToPreviousPage:p}=F(`pagination`),m=iO(e,t,a),h=oO(s),g=e===1,_=e===t,v=(0,z.useRef)([]),y=(0,z.useRef)(null),{choiceIndicatorPosition:b,scheduleMeasurement:x}=O(v,{selector:aO,isHoverable:!0});if((0,z.useEffect)(()=>{let e=setTimeout(()=>{x()},300);return()=>clearTimeout(e)},[e,x]),t<=1)return null;let S=r=>{!o&&r>=1&&r<=t&&r!==e&&n(r)};return(0,H.jsx)(`div`,{className:R(rO({size:s,variant:c}),u),...d,children:(0,H.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[b&&(0,H.jsx)(sO,{style:b,ref:y}),i&&(0,H.jsx)(M,{variant:`outline`,size:h,color:`text`,onClick:()=>S(e-1),disabled:o||g,label:p.value,Icon:Js,ref:e=>{e&&(v.current[0]=e)},className:`min-w-0 px-2`}),(0,H.jsx)(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:m.map((t,n)=>{if(t===`ellipsis`){let e=n===m.indexOf(`ellipsis`)?`ellipsis-start`:`ellipsis-end`;return(0,H.jsx)(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:(0,H.jsx)(Zs,{className:`h-4 w-4 text-muted-foreground`})},e)}let r=t===e,a=+!!i+m.slice(0,n).filter(e=>e!==`ellipsis`).length;return(0,H.jsx)(M,{variant:r?`default`:`outline`,size:h,color:`text`,onClick:()=>S(t),disabled:o,label:`Go to page ${t}`,"aria-current":r?`true`:`false`,ref:e=>{e&&(v.current[a]=e)},className:R(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,s===`sm`&&`h-6 w-6 text-xs`,s===`lg`&&`size-10 text-base`,r&&`font-semibold`),children:t},t)})}),i&&(0,H.jsx)(M,{variant:`outline`,size:h,color:`text`,onClick:()=>S(e+1),disabled:o||_,label:f.value,Icon:Ys,ref:e=>{let t=+!!i+m.filter(e=>e!==`ellipsis`).length;e&&(v.current[t]=e)},className:`min-w-0 px-2`})]})})},lO=e=>{let t=Ft(e),n=zt(e);return t&&(n===`reactNode`||n===`file`)?!0:t&&typeof t.nodeType==`string`?lO(t[t.nodeType]):typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===void 0},uO=e=>{let t=(0,V.c)(3),{children:n,onToggle:r,...i}=e,[a,o]=(0,z.useState)(!1),s;return t[0]!==a||t[1]!==r?(s=e=>{e&&!a&&o(!0),r?.(e)},t[0]=a,t[1]=r,t[2]=s):s=t[2],(0,H.jsx)(gp,{...i,onToggle:s,children:a?n:null})},dO=e=>{let t=(0,V.c)(16),{section:n,keyPath:r,dictionary:i}=e,{selectedLocales:a}=wm(),o=Mt(n,r,Nf()),{addEditedContent:s}=zf(),{setFocusedContentKeyPath:c,focusedContent:l}=Ff(),{addNewElement:u,goToField:d}=F(`navigation-view`),f=zt(o),p;t[0]===l?.keyPath?p=t[1]:(p=e=>(l?.keyPath?.length??0)>0&&Et(e,l?.keyPath??[]),t[0]=l?.keyPath,t[1]=p);let m=p,h=lO(o);if(!o)return(0,H.jsx)(H.Fragment,{});if(h){let e;return t[2]!==r||t[3]!==c?(e=()=>c(r),t[2]=r,t[3]=c,t[4]=e):e=t[4],(0,H.jsx)(M,{label:d.label.value,variant:`hoverable`,color:`text`,className:`w-full`,onClick:e,IconRight:Ys,children:Dt(r[r.length-1]?.key)})}if(typeof o==`object`){if(f===`reactNode`)return(0,H.jsx)(H.Fragment,{children:`React Node`});if(f===`translation`){let e;return t[5]!==i||t[6]!==r||t[7]!==n?(e=e=>{let t=[...r,{type:ge,key:e}];return(0,H.jsx)(dO,{keyPath:t,section:n,dictionary:i},e)},t[5]=i,t[6]=r,t[7]=n,t[8]=e):e=t[8],(0,H.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:a.map(e)})}if(f===`enumeration`||f===`plural`||f===`condition`)return(0,H.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:Object.keys(o[f]).map(e=>{let t=[...r,{type:f,key:e}];return(0,H.jsx)(dO,{keyPath:t,section:n,dictionary:i},e)})});if(f===`array`){let e;return t[9]!==i||t[10]!==m||t[11]!==d||t[12]!==r||t[13]!==n||t[14]!==c?(e=(e,t)=>{let a=[...r,{type:k,key:t}];return lO(e)?(0,H.jsxs)(M,{label:`${d.label.value} ${t}`,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(a),IconRight:Ys,isActive:m(a),children:[`Item `,t]},JSON.stringify(a)):(0,H.jsx)(uO,{label:`${d.label.value} ${t}`,header:`Item ${t}`,isActive:m(a),onClick:()=>c(a),children:(0,H.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,H.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,H.jsx)(dO,{keyPath:a,section:n,dictionary:i})})})},JSON.stringify(a))},t[9]=i,t[10]=m,t[11]=d,t[12]=r,t[13]=n,t[14]=c,t[15]=e):e=t[15],(0,H.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[o.map(e),(0,H.jsx)(M,{label:u.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,onClick:()=>{let e=[...r,{type:k,key:o.length}],t=o,n=Pt(t[t.length-1])??``;s(i.localId,n,e,!1),c(e)},Icon:nc,children:u.text})]})}if(typeof o.nodeType==`string`){let e=[...r,{type:o.nodeType}];return(0,H.jsx)(dO,{keyPath:e,section:n,dictionary:i})}let e=Object.keys(o);return(0,H.jsx)(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:e.map(e=>{let t=[...r,{type:ue,key:e}];return lO(Mt(n,t))?(0,H.jsx)(M,{label:`${d.label.value} ${e}`,isActive:m(t),variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(t),IconRight:Ys,children:Dt(e)},e):(0,H.jsx)(uO,{label:`${d.label.value} ${e}`,isActive:m(t),onClick:()=>c(t),header:Dt(e),children:(0,H.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,H.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,H.jsx)(dO,{keyPath:t,section:n,dictionary:i})})})},e)})})}return(0,H.jsxs)(H.Fragment,{children:[`Error loading section --`,f,`--`,JSON.stringify(o),`--`,JSON.stringify(r)]})},fO=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,pO=e=>{let t=(0,V.c)(35),{dictionary:n}=e,{itemPagination:r,variantSwitcher:i}=F(`content-editor`),{editedContent:a}=Bf(),{focusedContent:o,setFocusedContentKeyPath:s}=Ff(),[,c]=(0,z.useTransition)(),l;t[0]!==s||t[1]!==c?(l=e=>c(()=>s(e)),t[0]=s,t[1]=c,t[2]=l):l=t[2];let u=l,[d,f]=(0,z.useState)(n),p,m;t[3]===n?(p=t[4],m=t[5]):(p=()=>{f(n)},m=[n],t[3]=n,t[4]=p,t[5]=m),(0,z.useEffect)(p,m);let h=n.item!==void 0||n.variant!==void 0,g;t[6]===n.key?g=t[7]:(g={keys:[n.key]},t[6]=n.key,t[7]=g);let _=h&&!!n.key,v;t[8]===_?v=t[9]:(v={enabled:_},t[8]=_,t[9]=v);let{data:y}=lp(g,v),b;t[10]===y?.data?b=t[11]:(b=y?.data??[],t[10]=y?.data,t[11]=b);let x=b,S;bb0:{if(n.item===void 0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[12]=e):e=t[12],S=e;break bb0}let e;t[13]===x?e=t[14]:(e=x.filter(mO).sort(hO),t[13]=x,t[14]=e),S=e}let C=S,w;bb1:{if(n.variant===void 0){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[15]=e):e=t[15],w=e;break bb1}let e;t[16]===x?e=t[17]:(e=x.filter(gO),t[16]=x,t[17]=e),w=e}let T=w,E;t[18]===u?E=t[19]:(E=e=>{f(e),u([])},t[18]=u,t[19]=E);let D=E,{content:O,key:k,localId:ee}=d,A=o?.keyPath,j=a?.[ee]?.content===void 0?O:a?.[ee]?.content,te=Nf(),M;t[20]===A?M=t[21]:(M=A??[],t[20]=A,t[21]=M);let N;t[22]!==te||t[23]!==j||t[24]!==M?(N=Mt(j,M,te),t[22]=te,t[23]=j,t[24]=M,t[25]=N):N=t[25];let P=N,ne=(0,z.useDeferredValue)(A),re=(0,z.useDeferredValue)(P),ie=re!==P,I;t[26]===j?I=t[27]:(I=lO(j),t[26]=j,t[27]=I);let ae=I,oe=lO(re),se;t[28]!==o?.keyPath||t[29]!==P||t[30]!==u?(se=()=>{P===void 0&&u(o?.keyPath?.slice(0,-1)??[])},t[28]=o?.keyPath,t[29]=P,t[30]=u,t[31]=se):se=t[31];let ce;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[],t[32]=ce):ce=t[32],(0,z.useEffect)(se,ce);let le;t[33]===d.localId?le=t[34]:(le=e=>e.localId===d.localId,t[33]=d.localId,t[34]=le);let ue=C.findIndex(le),de=d.variant;return(0,H.jsxs)(`div`,{children:[h&&(0,H.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-4`,children:[C.length>0&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`font-medium text-muted text-xs`,children:r.label}),(0,H.jsx)(cO,{currentPage:ue>=0?ue+1:1,totalPages:C.length,onPageChange:e=>{let t=C[e-1];t&&D(t)},size:`sm`})]}),T.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`font-medium text-muted text-xs`,children:[i.label,`:`]}),T.map(e=>{let t=e.localId===d.localId;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>!t&&D(e),className:`rounded-lg px-3 py-1 text-xs transition-colors ${t?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`}`,children:fO(e.variant)},e.localId)}),de!==void 0&&!T.some(e=>e.localId===n.localId)&&(0,H.jsx)(`span`,{className:`rounded-lg bg-text px-3 py-1 font-semibold text-foreground-opposite text-xs`,children:fO(de)})]})]}),(0,H.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-2`,children:[(0,H.jsx)(DE,{dictionaryKey:k,keyPath:A??[],onClickKeyPath:u}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,H.jsx)(nO,{})})]}),(0,H.jsxs)(`div`,{className:`flex flex-1 gap-2 overflow-visible max-md:flex-col`,children:[typeof j==`object`&&j&&!ae&&Object.keys(j).length>0&&(0,H.jsx)(Ne,{border:!0,background:`none`,className:`top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]`,roundedSize:`2xl`,transparency:`xs`,children:(0,H.jsx)(dO,{keyPath:[],section:j,dictionary:d})}),(oe||(ne??[]).length>0)&&(0,H.jsx)(`div`,{className:ie?`pointer-events-none flex-1 opacity-50 transition-opacity`:`flex-1 transition-opacity`,children:(0,H.jsx)(Zm,{keyPath:ne??[],section:re,dictionary:d})})]})]})};function mO(e){return e.item!==void 0}function hO(e,t){return(e.item??0)-(t.item??0)}function gO(e){return e.variant!==void 0}var _O=e=>{let t=(0,V.c)(25),{dictionary:n,mode:r,className:i,onDelete:a,onSave:o,...s}=e,[c,l]=(0,z.useState)(!1),{setLocaleDictionary:u}=Mf(),{mutate:d,isPending:f}=dp(),{mutate:p,isPending:m}=pp(),{mutate:h,isPending:g}=up(),_=m||g,{editedContent:v,restoreEditedContent:y}=Bf(),{deleteButton:b,resetButton:x,saveButton:S,publishButton:C,downloadButton:w,confirmation:T}=F(`save-dictionary-details`),{isAuthenticated:E}=np(),{session:D}=tp(),O;t[0]===D?.permissions?O=t[1]:(O=(D?.permissions?.includes(`dictionary:admin`)||D?.permissions?.includes(`dictionary:write`))??!1,t[0]=D?.permissions,t[1]=O);let k=O,ee=k,A=v?.[n.localId],j;t[2]!==n||t[3]!==A?(j=A&&JSON.stringify(A)!==JSON.stringify(n),t[2]=n,t[3]=A,t[4]=j):j=t[4];let te=j,N=n?.id!==void 0,P;t[5]!==n||t[6]!==v||t[7]!==o||t[8]!==y||t[9]!==u||t[10]!==p?(P=async()=>{if(!v?.[n.localId])return;let e={...n,...v?.[n.localId]};p({dictionary:e},{onSuccess:()=>{u(v?.[n.localId]),y(n.localId),l(!1),o?.()}})},t[5]=n,t[6]=v,t[7]=o,t[8]=y,t[9]=u,t[10]=p,t[11]=P):P=t[11];let ne=P,re;t[12]!==n||t[13]!==v||t[14]!==o||t[15]!==h||t[16]!==y||t[17]!==u?(re=()=>{let e={...n,...v?.[n.localId]};h({dictionaries:[e]},{onSuccess:t=>{t&&(u(e),y(n.localId),o?.())}})},t[12]=n,t[13]=v,t[14]=o,t[15]=h,t[16]=y,t[17]=u,t[18]=re):re=t[18];let ie=re,I;t[19]!==d||t[20]!==n||t[21]!==a?(I=()=>{n.id&&d({dictionaryId:n.id},{onSuccess:e=>{e&&a?.()}})},t[19]=d,t[20]=n,t[21]=a,t[22]=I):I=t[22];let ae=I,oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>l(!1),t[23]=oe):oe=t[23];let se;return t[24]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>l(!1),t[24]=se):se=t[24],(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(je,{isOpen:c,title:T.title.value,size:`md`,onClose:oe,padding:`md`,children:(0,H.jsxs)(`form`,{className:`size-full`,children:[(0,H.jsx)(`p`,{className:`py-4 text-muted-foreground text-sm`,children:T.message}),(0,H.jsxs)(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[(0,H.jsx)(M,{label:T.cancelButton.label.value,disabled:!te||_,color:`text`,className:`max-md:w-full`,variant:`outline`,onClick:se,children:T.cancelButton.text}),(0,H.jsx)(M,{label:T.confirmButton.label.value,disabled:!te||_||!k,Icon:ic,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:T.confirmButton.text})]})]})}),(0,H.jsxs)(`form`,{className:R(`flex justify-end gap-2`,i),...s,children:[r.includes(`remote`)&&N&&a&&E&&(0,H.jsx)(M,{label:b.label.value,Icon:oc,color:`error`,variant:`outline`,className:`max-md:w-full`,isLoading:f,onClick:ae,disabled:!ee,children:b.text}),te&&(0,H.jsx)(M,{label:x.label.value,disabled:!te,Icon:rc,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:()=>y(n.localId),children:x.text}),r.includes(`local`)&&(0,H.jsx)(M,{label:w.label.value,disabled:!te||_,Icon:Xs,color:`text`,variant:E?`outline`:`default`,className:`max-md:w-full`,isLoading:m,onClick:()=>l(!0),children:w.text}),r.includes(`remote`)&&E&&!N&&(0,H.jsx)(M,{label:C.label.value,disabled:_||!k,Icon:qs,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ie,children:C.text}),r.includes(`remote`)&&E&&N&&te&&(0,H.jsx)(M,{label:S.label.value,disabled:!te||_||!k,Icon:ic,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ie,children:S.text})]})]})},vO=(e,t=2e3,n,r)=>{let[i,a]=(0,z.useState)(!1);return{isCopied:i,copy:async()=>{if(e)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else{r?.(Error(`Clipboard API not supported in this browser`));return}a(!0),setTimeout(()=>a(!1),t),n?.()}catch(e){let t=e instanceof Error?e.message:`Failed to copy to clipboard`;r?.(e instanceof Error?e:Error(t))}}}},yO=({text:e,children:t,className:n,"aria-label":r=`Copy to clipboard`,"aria-copied-label":i=`Copied to clipboard`,feedbackDuration:a=2e3,onCopySuccess:o,onCopyError:s,disable:c,preventDefault:l=!0,stopPropagation:u=!0,size:d=14})=>{let{isCopied:f,copy:p}=vO(e,a,o,s);if(c)return(0,H.jsx)(`span`,{className:n,children:t});let m=e=>{(e.key===`Enter`||e.key===` `)&&h(e)},h=e=>{l&&e.preventDefault(),u&&e.stopPropagation(),p()},g=f?i:r,_=f?he:de;return(0,H.jsxs)(`span`,{className:R(`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-md p-0.5 hover:bg-neutral/10`,n),onClick:h,onKeyDown:m,role:`button`,tabIndex:0,"aria-label":g,"aria-pressed":f,"data-testid":`copy-to-clipboard`,children:[(0,H.jsx)(`span`,{className:`min-w-0 break-all`,children:t}),e&&(0,H.jsx)(_,{className:`ml-1 ml-auto shrink-0`,size:d,"aria-hidden":`true`})]})},bO=Ze([`appearance-none`,`relative cursor-pointer border-2`,`focus:outline-0`,`checked:hover:opacity-80`,`ring-offset-background`,`hover:bg-neutral-500/10`,`disabled:opacity-50`,`ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6`,`checked:before:absolute checked:before:inset-0 checked:before:content-['✓']`,`checked:before:flex checked:before:items-center checked:before:justify-center`,`checked:before:text-foreground-opposite/80`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`after:absolute after:-inset-2 after:content-['']`].join(` `),{variants:{variant:{default:``},size:{xs:`size-3 rounded-sm`,sm:`size-4 rounded-md`,md:`size-5 rounded-lg`,lg:`size-6 rounded-xl`},color:{primary:`border-primary/30 text-primary ring-primary/20 checked:border-primary checked:bg-primary`,secondary:`border-secondary/30 text-secondary ring-secondary/20 checked:border-secondary checked:bg-secondary`,neutral:`border-neutral/30 text-muted-foreground ring-neutral/20 checked:border-neutral checked:bg-neutral`,light:`border-white/30 text-white ring-white/20 checked:border-white checked:bg-white`,text:`border-text/30 text-foreground ring-text/20 checked:border-text checked:bg-text`,"text-inverse":`border-text-inverse/30 text-foreground-inverse ring-text-inverse/20 checked:border-text-inverse checked:bg-text-inverse`,dark:`border-neutral-800/30 text-neutral-800 ring-neutral-800/20 checked:border-neutral-800 checked:bg-neutral-800`,error:`border-error/30 text-error ring-error/20 checked:border-error checked:bg-error`,success:`border-success/30 text-success ring-success/20 checked:border-success checked:bg-success`,custom:`border-custom/30 text-custom ring-custom/20 checked:border-custom checked:bg-custom`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,color:`text`,validationStyleEnabled:`disabled`,size:`md`}}),xO=({validationStyleEnabled:e=!1,label:t,size:n,color:r,name:i,variant:a,className:o,labelClassName:s,...c})=>(0,H.jsx)(`input`,{type:`checkbox`,className:R(bO({variant:a,size:n,color:r,validationStyleEnabled:e?`enabled`:`disabled`}),o),...c}),SO=e=>{let{label:t,name:n,id:r}=e;return t?(0,H.jsxs)(`label`,{htmlFor:r??n,className:R(`flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm`,e.size===`xs`&&`text-xs`,e.labelClassName),children:[(0,H.jsx)(xO,{id:r??n,...e}),t]}):(0,H.jsx)(xO,{id:r??n,...e})},CO=e=>(0,H.jsx)(Wv,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:Wp,...e}),wO=e=>(0,H.jsx)(Wv,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:Ip,...e}),TO=e=>{let t=(0,V.c)(38),{titleRequiredError:n,titleInvalidTypeError:r,titleMinLengthError:i,keyRequiredError:a,keyInvalidTypeError:o,keySpaceError:s,keyMinLengthError:c,descriptionRequiredError:l,descriptionInvalidTypeError:u,requiredErrorProjectId:d,invalidTypeErrorProjectId:f,invalidTypeErrorTags:p,locationRequiredError:m,locationInvalidTypeError:h,filePathRequiredError:g,filePathInvalidTypeError:_}=F(`dictionary-detail-schema`),v;if(t[0]!==u||t[1]!==l||t[2]!==_||t[3]!==g||t[4]!==f||t[5]!==p||t[6]!==o||t[7]!==c.value||t[8]!==a||t[9]!==s.value||t[10]!==h||t[11]!==m||t[12]!==e||t[13]!==d||t[14]!==r||t[15]!==i.value||t[16]!==n){let y;t[18]!==r||t[19]!==n?(y=e=>e.input===void 0?n.value:r.value,t[18]=r,t[19]=n,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==a?(b=e=>e.input===void 0?a.value:o.value,t[21]=o,t[22]=a,t[23]=b):b=t[23];let x;t[24]!==u||t[25]!==l?(x=e=>e.input===void 0?l.value:u.value,t[24]=u,t[25]=l,t[26]=x):x=t[26];let S;t[27]!==f||t[28]!==d?(S=e=>e.input===void 0?d.value:f.value,t[27]=f,t[28]=d,t[29]=S):S=t[29];let C;t[30]===p?C=t[31]:(C=()=>p.value,t[30]=p,t[31]=C);let w;t[32]!==h||t[33]!==m?(w=e=>e.input===void 0?m.value:h.value,t[32]=h,t[33]=m,t[34]=w):w=t[34];let T;t[35]!==_||t[36]!==g?(T=e=>e.input===void 0?g.value:_.value,t[35]=_,t[36]=g,t[37]=T):T=t[37],v=GT({title:pT({error:y}).refine(EO,{error:i.value}).optional(),key:pT({error:b}).min(4,{error:c.value}).regex(/^[a-zA-Z0-9-_]+$/,{error:s.value}).default(``),description:pT({error:x}).optional(),projectIds:UT(pT({error:S})).default([e]),tags:UT(pT({error:C})).default([]),location:ZT([`local`,`remote`,`hybrid`,`plugin`],{error:w}).optional(),importMode:ZT([`static`,`dynamic`,`fetch`]).optional(),filePath:pT({error:T}).optional()}),t[0]=u,t[1]=l,t[2]=_,t[3]=g,t[4]=f,t[5]=p,t[6]=o,t[7]=c.value,t[8]=a,t[9]=s.value,t[10]=h,t[11]=m,t[12]=e,t[13]=d,t[14]=r,t[15]=i.value,t[16]=n,t[17]=v}else v=t[17];return v};function EO(e){return e.length===0||e.length>=4}var DO=[`collection`,`variant`],OO=e=>{let t=[];return e.item!==void 0&&t.push(`collection`),e.variant!==void 0&&t.push(`variant`),t},kO=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,AO=e=>{if(e.trim().startsWith(`{`))try{return{variant:JSON.parse(e),error:!1}}catch{return{variant:e,error:!0}}return{variant:e,error:!1}},jO=({dictionary:e,mode:t,onSelectSibling:n})=>{let{session:r}=tp(),{project:i}=r??{},{data:a,isLoading:o}=mp(),{data:s}=hp(),c=a?.data??[],l=s?.data??[],u=TO(String(i?.id)),{form:d,isSubmitting:f}=cy(u,{defaultValues:{...e,location:e.location??`remote`}}),{editedContent:p,setEditedDictionary:h}=Bf(),{titleInput:g,keyInput:_,descriptionInput:v,projectInput:y,tagsSelect:x,locationSelect:S,importModeSelect:C,filePathInput:w,auditButton:T,qualifierSection:E,siblingDictionaries:D,typeSwitch:O}=F(`dictionary-details`),{mutate:k,isPending:ee}=op(),A=p?.[e.localId],{data:j,isLoading:te}=lp({keys:[e.key]},{enabled:!!e.key}),N=(0,z.useMemo)(()=>(j?.data??[]).filter(t=>t.localId!==e.localId),[j,e.localId]),P=(0,z.useMemo)(()=>N.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[N]),ne=(0,z.useMemo)(()=>N.filter(e=>e.variant!==void 0),[N]),re=(0,z.useMemo)(()=>e.item===void 0?P:[e,...P].sort((e,t)=>(e.item??0)-(t.item??0)),[e,P]),ie=(0,z.useMemo)(()=>e.variant===void 0?ne:[e,...ne],[e,ne]);(0,z.useEffect)(()=>{d.reset({...e,tags:e.tags??[],location:e.location??`remote`}),le(OO(e)),de(e.item??1),pe(kO(e.variant)),he(!1),_e(!1)},[e,d?.reset]),(0,z.useEffect)(()=>{A===void 0&&d.reset({...e,tags:e.tags??[],location:e.location??`remote`})},[A]);let I=()=>{let t={...e,...A};k({fileContent:JSON.stringify(t)},{onSuccess:e=>{if(!e?.data)return;let n=e.data.fileContent,r={...t,...n,tags:n.tags??t.tags??[]};h(r),d.reset(r)}})},ae=C_({control:d.control,name:`location`}),oe=ae===`local`||ae===`hybrid`,se=N.length>0,[ce,le]=(0,z.useState)(()=>OO(e)),[ue,de]=(0,z.useState)(e.item??1),[fe,pe]=(0,z.useState)(kO(e.variant)),[me,he]=(0,z.useState)(!1),[ge,_e]=(0,z.useState)(!1),ve=(0,z.useMemo)(()=>[...P,...ne],[P,ne]),ye=t=>{let n=[t].flat(),r=n.filter(e=>!ce.includes(e)),i=ce.filter(e=>!n.includes(e)),a={...e,...A??{}};for(let e of i)e===`collection`&&(a={...a,item:void 0}),e===`variant`&&(a={...a,variant:void 0});for(let e of r)if(e===`collection`){let e=re.length>0?Math.max(...re.map(e=>e.item??0))+1:1;de(e),a={...a,item:e}}else if(e===`variant`){let e=fe||`default`;pe(e),a={...a,variant:AO(e).variant}}le(n),h(a),he(!1),n.length===0&&ve.length>0?_e(!0):_e(!1)};return(0,H.jsxs)(ly,{className:`flex w-full flex-col gap-8`,...d,schema:u,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,H.jsx)(CO,{name:`key`,label:_.label,placeholder:_.label.value,description:_.description,disabled:f,isRequired:!0,onSave:t=>{d.setValue(`key`,t,{shouldDirty:!0}),h({...e,...A??{},key:t})}}),(0,H.jsx)(CO,{name:`title`,label:g.label,placeholder:g.placeholder.value,description:g.description,disabled:f,onSave:t=>{d.setValue(`title`,t,{shouldDirty:!0}),h({...e,...A??{},title:t})}})]}),(0,H.jsx)(wO,{name:`description`,label:v.label,placeholder:v.placeholder.value,description:v.description,disabled:f,onSave:t=>{d.setValue(`description`,t,{shouldDirty:!0}),h({...e,...A??{},description:t})}}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[(0,H.jsx)(Nv,{control:d.control,name:`location`,render:({field:n})=>{let r=n.value,i=r===`local`||r===`hybrid`,a=r===`remote`||r===`hybrid`,o=t=>{if(!t&&!a)return;let r=t?a?`hybrid`:`local`:`remote`;n.onChange(r);let i=t?d.getValues(`filePath`)??e.filePath:void 0;t||d.setValue(`filePath`,void 0),h({...e,...A??{},location:r,filePath:i})},s=t=>{if(!t&&!i)return;let r=t?i?`hybrid`:`remote`:`local`;n.onChange(r),h({...e,...A??{},location:r})};return(0,H.jsxs)(zg,{className:`flex flex-col gap-2 px-1`,children:[(0,H.jsx)(Vv,{className:`ml-1`,children:S.label}),(0,H.jsxs)(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[(0,H.jsx)(SO,{id:`location-local`,name:`location-local`,label:S.local.value,color:`text`,checked:i,disabled:!t.includes(`local`)&&!t.includes(`remote`),onChange:e=>o(e.target.checked)}),(0,H.jsx)(SO,{id:`location-remote`,name:`location-remote`,label:S.remote.value,color:`text`,checked:a,disabled:!t.includes(`remote`)&&e.location!==`remote`&&e.location!==`hybrid`,onChange:e=>s(e.target.checked)})]}),(0,H.jsx)(Iv,{children:S.testDescription}),(0,H.jsx)(Lv,{})]})}}),(0,H.jsx)(Ec,{mode:`wait`,children:oe&&(0,H.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},children:(0,H.jsx)(Gv,{name:`filePath`,label:w.label.value,placeholder:w.placeholder.value,description:w.description.value,disabled:f||!oe,onChange:t=>{let n=t.target.value;h({...e,...A??{},filePath:n})}})},`filePath-input`)})]}),(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:(0,H.jsxs)(Yv,{name:`importMode`,label:C.label.value,description:C.description.value,onValueChange:t=>{d.setValue(`importMode`,t,{shouldDirty:!0}),h({...e,...A??{},importMode:t})},children:[(0,H.jsx)(L.Trigger,{children:(0,H.jsx)(L.Value,{placeholder:C.label.value})}),(0,H.jsxs)(L.Content,{children:[(0,H.jsx)(L.Item,{value:`static`,children:C.static.value}),(0,H.jsx)(L.Item,{value:`dynamic`,children:C.dynamic.value}),(0,H.jsx)(L.Item,{value:`live`,children:C.live.value})]})]})}),(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,H.jsxs)(qv,{name:`projectIds`,label:y.label.value,description:y.description,onValueChange:t=>{let n=[t].flat();d.setValue(`projectIds`,n,{shouldDirty:!0}),h({...e,...A??{},projectIds:n})},children:[(0,H.jsx)(Lg.Trigger,{getBadgeValue:e=>c?.find(t=>String(t.id)===e)?.name??e,children:(0,H.jsx)(Lg.Input,{placeholder:y.placeholder.value})}),(0,H.jsx)(Lg.Content,{children:(0,H.jsx)(m,{isLoading:o,children:(0,H.jsx)(Lg.List,{children:c?.map(e=>(0,H.jsx)(Lg.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),(0,H.jsxs)(qv,{name:`tags`,label:x.label.value,description:x.description,onValueChange:t=>{let n=[t].flat();d.setValue(`tags`,n,{shouldDirty:!0}),h({...e,...A??{},tags:n})},children:[(0,H.jsx)(Lg.Trigger,{getBadgeValue:e=>l?.find(t=>String(t.key)===e)?.name??e,children:(0,H.jsx)(Lg.Input,{placeholder:x.placeholder.value})}),(0,H.jsx)(Lg.Content,{children:(0,H.jsx)(m,{isLoading:o,children:(0,H.jsx)(Lg.List,{children:l?.map(e=>(0,H.jsx)(Lg.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),(0,H.jsxs)(Ne,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`card`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`p`,{className:`ml-1 font-semibold text-sm`,children:O.label}),(0,H.jsx)(`p`,{className:`ml-1 text-muted text-xs`,children:O.description})]}),(0,H.jsxs)(Lg,{values:ce,onValueChange:ye,className:`max-w-xs`,children:[(0,H.jsx)(Lg.Trigger,{getBadgeValue:e=>e===`collection`?String(O.collection):e===`variant`?String(O.variant):e,children:(0,H.jsx)(Lg.Input,{placeholder:O.label.value})}),(0,H.jsx)(Lg.Content,{children:(0,H.jsx)(Lg.List,{children:DO.map(e=>(0,H.jsx)(Lg.Item,{value:e,children:O[e].value},e))})})]}),(0,H.jsxs)(Ec,{children:[ce.includes(`collection`)&&(0,H.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,H.jsx)(`label`,{htmlFor:`qualifier-item-value`,className:`ml-1 font-medium text-sm`,children:O.itemValueLabel}),(0,H.jsx)(Ap,{id:`qualifier-item-value`,type:`number`,min:1,value:ue,placeholder:O.itemValuePlaceholder.value,onChange:t=>{let n=parseInt(t.target.value,10);!Number.isNaN(n)&&n>=1&&(de(n),h({...e,...A??{},item:n}))}})]})},`item-input`),ce.includes(`variant`)&&(0,H.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,H.jsx)(`label`,{htmlFor:`qualifier-variant-value`,className:`ml-1 font-medium text-sm`,children:O.variantValueLabel}),(0,H.jsx)(Ap,{id:`qualifier-variant-value`,type:`text`,value:fe,placeholder:O.variantValuePlaceholder.value,onChange:t=>{let n=t.target.value;pe(n);let{variant:r,error:i}=AO(n);he(i),i||h({...e,...A??{},variant:r})}}),me&&(0,H.jsx)(`p`,{className:`ml-1 text-destructive text-xs`,children:O.variantJsonError})]})},`variant-input`),ce.length===0&&ge&&(0,H.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,H.jsxs)(Ne,{background:`none`,border:!0,borderColor:`neutral`,roundedSize:`xl`,padding:`md`,className:`gap-3`,children:[(0,H.jsx)(`p`,{className:`font-medium text-sm`,children:O.disablePickerTitle}),(0,H.jsx)(`p`,{className:`text-muted text-xs`,children:O.disablePickerDescription}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ve.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{n?.(e),_e(!1)},className:`cursor-pointer rounded-lg border border-border px-3 py-1 text-xs transition-colors hover:bg-text/10`,children:[e.variant!==void 0&&(0,H.jsxs)(`span`,{children:[E.variant,`:`,` `,kO(e.variant)]}),e.item!==void 0&&(0,H.jsxs)(`span`,{children:[E.item,`: `,e.item]})]},e.localId))})]})},`sibling-picker`)]})]}),(0,H.jsxs)(Ne,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`neutral`,children:[(0,H.jsx)(`p`,{className:`font-semibold text-sm`,children:D.title}),(0,H.jsxs)(m,{isLoading:te,children:[!se&&(0,H.jsx)(`p`,{className:`text-muted text-sm`,children:D.noSiblings}),re.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.collectionItems}),(0,H.jsx)(cO,{currentPage:re.findIndex(t=>t.localId===e.localId)+1||1,totalPages:re.length,onPageChange:e=>{let t=re[e-1];t&&n&&n(t)},showPrevNext:!0}),(0,H.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:re.map(t=>{let r=t.localId===e.localId;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:R(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:[D.itemIndex,` `,t.item]},t.localId)})})]}),ie.length>0&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.variants}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ie.map(t=>{let r=t.localId===e.localId;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:R(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:kO(t.variant)},t.localId)})})]})]})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:(0,H.jsx)(M,{type:`button`,size:`icon-md`,label:T.label.value,Icon:sc,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:I,disabled:f||ee,isLoading:ee})})]})},MO=(0,z.lazy)(()=>Ct(()=>import(`./dist-CMBnegHe.js`).then(e=>({default:e.Editor})),__vite__mapDeps([7,2]))),NO=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:i=!0,isReadOnly:a=!1,onChange:o})=>{let s=(0,z.useRef)(null),c=(0,z.useRef)(null),[l,u]=(0,z.useState)({height:0,width:0}),d=n?`vs-dark-transparent`:`hc-light-theme`,f=(e,t)=>{c.current=e;let n=(e.getContentHeight()??0)+25;t.editor.defineTheme(`vs-dark-transparent`,{base:`vs-dark`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.defineTheme(`hc-light-theme`,{base:`vs`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.setTheme(d),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.typescriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),t.languages.typescript.javascriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),u({height:n,width:s.current?.clientWidth??0})},p=r??(typeof e==`string`&&e.split(`
|
|
108
|
+
`).length>1);return(0,H.jsxs)(`div`,{className:R(`relative size-full text-sm`,r&&`ml-0`),children:[i&&(0,H.jsx)(`div`,{className:`sticky top-5 z-10`,children:(0,H.jsx)(`div`,{className:R(`absolute right-2 bottom-0 flex h-7 items-center`),children:(0,H.jsx)(ze,{content:e})})}),(0,H.jsx)(`div`,{className:`z-0 grid size-full grid-cols-[0px] overflow-auto`,ref:s,children:(0,H.jsx)(z.Suspense,{fallback:(0,H.jsx)(m,{}),children:(0,H.jsx)(MO,{...l,defaultLanguage:`typescript`,language:t,loading:(0,H.jsx)(m,{}),defaultValue:String(e).replace(/\n$/,``),onMount:f,onChange:o,options:{contextmenu:!1,readOnly:a,cursorStyle:`line`,minimap:{enabled:!1},scrollbar:{vertical:`hidden`,verticalScrollbarSize:0,alwaysConsumeMouseWheel:!1},folding:!1,renderValidationDecorations:`off`,quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,mouseWheelScrollSensitivity:0,fastScrollSensitivity:0,scrollBeyondLastLine:!1,lineNumbers:p?`on`:`off`},theme:d,className:`my-2 rounded-md`})})})]})},PO=e=>{let t=(0,V.c)(7),{dictionary:n,isDarkMode:r}=e,{setEditedContent:i,editedContent:a}=Bf(),o=FO,s=a?.[n.localId]?.content??n?.content,c;t[0]!==n||t[1]!==i?(c=e=>{o(e??`{}`)&&i(n.localId,JSON.parse(e??`{}`))},t[0]=n,t[1]=i,t[2]=c):c=t[2];let l;return t[3]!==s||t[4]!==r||t[5]!==c?(l=(0,H.jsx)(NO,{language:`json`,onChange:c,isDarkMode:r,children:JSON.stringify(s,null,2)}),t[3]=s,t[4]=r,t[5]=c,t[6]=l):l=t[6],l};function FO(e){try{return JSON.parse(e),!0}catch{return!1}}var IO=e=>{let t=(0,V.c)(24),{section:n,onValueChange:r}=e,{multilingual:i,text:a,number:o,boolean:s,node:c,array:u,enumeration:d,plural:f,triggerPlaceHolder:p,nest:m,gender:g,select:v,condition:y,markdown:b,insertion:S,reactNode:w,file:T}=F(`node-type-selector`),E;t[0]===n?E=t[1]:(E=zt(n),t[0]=n,t[1]=E);let[O,ee]=(0,z.useState)(E),j;t[2]===r?j=t[3]:(j=e=>{ee(e),r(e)},t[2]=r,t[3]=j);let te=j,M;return t[4]!==u||t[5]!==s||t[6]!==y||t[7]!==d||t[8]!==T||t[9]!==g||t[10]!==S||t[11]!==O||t[12]!==b||t[13]!==i||t[14]!==m||t[15]!==c||t[16]!==o||t[17]!==te||t[18]!==f||t[19]!==w||t[20]!==v||t[21]!==a||t[22]!==p?(M=(0,H.jsxs)(L,{value:O,onValueChange:te,children:[(0,H.jsx)(L.Trigger,{children:(0,H.jsx)(L.Value,{placeholder:p})}),(0,H.jsxs)(L.Content,{children:[(0,H.jsx)(L.Item,{value:ge,children:i}),(0,H.jsx)(L.Item,{value:fe,children:a}),(0,H.jsx)(L.Item,{value:oe,children:o}),(0,H.jsx)(L.Item,{value:A,children:s}),(0,H.jsx)(L.Item,{value:ue,children:c}),(0,H.jsx)(L.Item,{value:k,children:u}),(0,H.jsx)(L.Item,{value:h,children:d}),(0,H.jsx)(L.Item,{value:_,children:f}),(0,H.jsx)(L.Item,{value:D,children:g}),(0,H.jsx)(L.Item,{value:C,children:v}),(0,H.jsx)(L.Item,{value:it,children:S}),(0,H.jsx)(L.Item,{value:l,children:b}),(0,H.jsx)(L.Item,{value:ce,children:m}),(0,H.jsx)(L.Item,{value:N,children:y}),(0,H.jsx)(L.Item,{value:We,disabled:!0,children:w}),(0,H.jsx)(L.Item,{value:x,children:T})]})]}),t[4]=u,t[5]=s,t[6]=y,t[7]=d,t[8]=T,t[9]=g,t[10]=S,t[11]=O,t[12]=b,t[13]=i,t[14]=m,t[15]=c,t[16]=o,t[17]=te,t[18]=f,t[19]=w,t[20]=v,t[21]=a,t[22]=p,t[23]=M):M=t[23],M},LO=e=>{let t=(0,V.c)(15),{section:n,dictionaryLocalId:r,keyPath:i,onNodeTypeChange:a}=e,o=Rf()?.internationalization?.locales??[],s=zt(n),c=Ft(n),l=e=>{a(Nt(s,o,e))};if(s===`translation`||s===`condition`||s===`gender`||s===`select`||s===`enumeration`||s===`plural`){let e=Object.keys(n[s])[0],t=[...i,{type:s,key:e}];return(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,H.jsx)(IO,{section:n,onValueChange:e=>a(Nt(e,o))}),(0,H.jsx)(LO,{section:c,keyPath:t,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`array`){let e=[...i,{type:s,key:0}];return(0,H.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,H.jsx)(IO,{section:n,onValueChange:e=>a(Nt(e,o))}),(0,H.jsx)(LO,{section:c,keyPath:e,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`object`){let e;if(t[0]!==r||t[1]!==i||t[2]!==o||t[3]!==a||t[4]!==n){let s;t[6]!==o||t[7]!==a?(s=e=>a(Nt(e,o)),t[6]=o,t[7]=a,t[8]=s):s=t[8],e=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(IO,{section:n,onValueChange:s}),(0,H.jsx)(`div`,{className:`mt-6 ml-10`,children:(0,H.jsx)(BO,{keyPath:i,section:n,dictionaryLocalId:r})})]}),t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=n,t[5]=e}else e=t[5];return e}let u;t[9]!==o||t[10]!==a?(u=e=>a(Nt(e,o)),t[9]=o,t[10]=a,t[11]=u):u=t[11];let d;return t[12]!==n||t[13]!==u?(d=(0,H.jsx)(IO,{section:n,onValueChange:u}),t[12]=n,t[13]=u,t[14]=d):d=t[14],d},RO=e=>{let t=(0,V.c)(23),{sectionKey:n,section:r,keyPath:i,dictionaryLocalId:a}=e,{focusedContent:o,setFocusedContentKeyPath:s}=Ff(),{renameEditedContent:c,addEditedContent:l}=zf(),{titleInput:u,deleteButton:d}=F(`structure-view`),f;t[0]!==a||t[1]!==i||t[2]!==c||t[3]!==s?(f=e=>{c(a,e,i);let t=i.slice(0,-1),n=i[i.length-1],r=[...t,{...n,key:e}];s(r)},t[0]=a,t[1]=i,t[2]=c,t[3]=s,t[4]=f):f=t[4];let p=f,m;if(t[5]!==l||t[6]!==d||t[7]!==a||t[8]!==o?.keyPath||t[9]!==p||t[10]!==i||t[11]!==r||t[12]!==n||t[13]!==s||t[14]!==u){let e;t[16]!==i||t[17]!==s?(e=()=>s(i),t[16]=i,t[17]=s,t[18]=e):e=t[18];let c;t[19]!==l||t[20]!==a||t[21]!==i?(c=e=>{l(a,e,i)},t[19]=l,t[20]=a,t[21]=i,t[22]=c):c=t[22],m=(0,H.jsx)(Ne,{transparency:`xl`,roundedSize:`2xl`,className:`w-full min-w-80 gap-2 overflow-auto px-5 py-2`,border:!0,borderColor:`text`,background:`none`,"aria-selected":Et(i,o?.keyPath??[]),onClick:e,children:(0,H.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof n==`string`&&(0,H.jsxs)(`div`,{className:`w-full`,children:[(0,H.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[(0,H.jsx)(Wp,{name:`key`,"aria-label":`Key`,placeholder:u.placeholder.value,defaultValue:n,onSave:e=>p(e),variant:`invisible`}),(0,H.jsx)(M,{label:d.label.value,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`translate-x-2`,Icon:oc,onClick:()=>{l(a,void 0,i);let e=i.slice(0,-1);s(e)}})]}),(0,H.jsxs)(`span`,{className:`ml-3 text-muted-foreground text-sm`,children:[`( `,Dt(n),` )`]})]}),(0,H.jsx)(LO,{keyPath:i,dictionaryLocalId:a,section:r,onNodeTypeChange:c})]})}),t[5]=l,t[6]=d,t[7]=a,t[8]=o?.keyPath,t[9]=p,t[10]=i,t[11]=r,t[12]=n,t[13]=s,t[14]=u,t[15]=m}else m=t[15];return m},zO=e=>{let t=(0,V.c)(14),{section:n,keyPath:r,dictionaryLocalId:i}=e,{addNodeButton:a}=F(`structure-view`),{setFocusedContentKeyPath:o}=Ff(),{addEditedContent:s}=zf();if(!n||typeof n!=`object`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(`div`,{children:`Not an object`}),t[0]=e):e=t[0],e}let c;if(t[1]!==s||t[2]!==a.label.value||t[3]!==a.text||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==o){let e;t[9]!==s||t[10]!==i||t[11]!==r||t[12]!==o?(e=()=>{let e=[...r,{type:ue,key:`newKey`}];s(i,``,e),o(e)},t[9]=s,t[10]=i,t[11]=r,t[12]=o,t[13]=e):e=t[13],c=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[(0,H.jsx)(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(n).map(e=>(0,H.jsx)(`li`,{className:`flex w-full`,children:(0,H.jsx)(RO,{sectionKey:e,section:n?.[e],keyPath:[...r,{type:ue,key:e}],dictionaryLocalId:i})},`${JSON.stringify(r)}-object-${e}`))}),(0,H.jsx)(M,{label:a.label.value,variant:`hoverable`,size:`md`,color:`text`,Icon:nc,className:`flex-1`,onClick:e,children:a.text})]}),t[1]=s,t[2]=a.label.value,t[3]=a.text,t[4]=i,t[5]=r,t[6]=n,t[7]=o,t[8]=c}else c=t[8];return c},BO=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?(0,H.jsx)(RO,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):(0,H.jsx)(zO,{section:e,keyPath:t,dictionaryLocalId:n}),VO=e=>{let t=(0,V.c)(3),{dictionary:n}=e,{content:r,localId:i}=n,{editedContent:a}=Bf(),o=a?.[i]?.content===void 0?r:a?.[i]?.content,s;return t[0]!==o||t[1]!==i?(s=(0,H.jsx)(RO,{section:o,keyPath:[],dictionaryLocalId:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2],s},HO=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:i,onSave:a,showReturnButton:o=!0,rightContent:s})=>{let c=Rf(),{returnToDictionaryList:l}=F(`dictionary-field-editor`),{focusedContent:u,setFocusedContent:d}=Ff(),{setLocaleDictionary:f}=Mf(),[p,m]=(0,z.useState)(`content`);return(0,z.useEffect)(()=>{d({...u??{},dictionaryKey:e.key,dictionaryLocalId:e.localId}),f(e)},[]),(0,H.jsx)(Tm,{availableLocales:c?.internationalization?.locales??[],children:(0,H.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[o&&(0,H.jsx)(M,{onClick:t,variant:`hoverable`,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:`text`,Icon:Ks,label:l.label.value,children:l.text}),(0,H.jsxs)(`div`,{className:`mb-22 flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 gap-3 rounded-xl bg-background/20 p-3 pb-4`,children:[(0,H.jsx)(Ge,{selectedChoice:p,tabs:[...r.includes(`remote`)?[(0,H.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`details`,onClick:()=>m(`details`),type:`button`,children:`Details`},`details`)]:[],(0,H.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`structure`,onClick:()=>m(`structure`),type:`button`,children:`Structure`},`structure`),(0,H.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`content`,onClick:()=>m(`content`),type:`button`,children:`Content`},`content`),(0,H.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`json`,onClick:()=>m(`json`),type:`button`,children:`JSON`},`json`)],hoverable:!0,color:`text`}),(0,H.jsx)(`div`,{className:`flex w-full items-center justify-end`,children:s})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,H.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-6`,children:[r.includes(`remote`)&&p===`details`&&(0,H.jsx)(jO,{dictionary:e,mode:r}),p===`structure`&&(0,H.jsx)(VO,{dictionary:e}),p===`content`&&(0,H.jsx)(pO,{dictionary:e}),p===`json`&&(0,H.jsx)(PO,{dictionary:e,isDarkMode:n})]})})]}),(0,H.jsx)(`div`,{className:`absolute bottom-3 z-20 w-full p-2`,children:(0,H.jsxs)(Ne,{color:`card`,roundedSize:`2xl`,padding:`sm`,className:`w-full shrink-0 flex-row flex-wrap items-center justify-end gap-10 bg-background/20 md:bottom-0`,children:[(0,H.jsx)(yO,{text:e.id,className:`text-nowrap text-muted-foreground text-sm`,size:9,children:e.id}),(0,H.jsx)(_O,{dictionary:e,mode:r,onDelete:()=>{d(null),i?.()},onSave:a})]})})]})})},UO=new class{listeners=new Set;drawers={};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.drawers;isOpen=e=>!!this.drawers[e];open=e=>{this.drawers[e]||(this.drawers={...this.drawers,[e]:!0},this.emit())};close=e=>{this.drawers[e]&&(this.drawers={...this.drawers,[e]:!1},this.emit())};set=e=>{let t=!1,n={...this.drawers};for(let[r,i]of Object.entries(e))n[r]!==i&&(n[r]=i,t=!0);t&&(this.drawers=n,this.emit())};emit=()=>{this.listeners.forEach(e=>{e()})}},WO={open:UO.open,close:UO.close,set:UO.set},GO=()=>!1,KO=()=>WO,qO=e=>{let t=(0,V.c)(2),n;t[0]===e?n=t[1]:(n=()=>UO.isOpen(e),t[0]=e,t[1]=n);let r=n;return(0,z.useSyncExternalStore)(UO.subscribe,r,GO)},JO=()=>{let e=(0,V.c)(2),t=(0,z.useSyncExternalStore)(UO.subscribe,UO.getSnapshot,YO),n;return e[0]===t?n=e[1]:(n={...WO,isOpen:e=>!!t[e]},e[0]=t,e[1]=n),n};function YO(){return{}}var XO=e=>{switch(e){case`xs`:return 480;case`sm`:return 640;case`md`:return 768;case`lg`:return 1024;case`xl`:return 1280;case`2xl`:return 1536;default:return e}},ZO=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},QO=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/iP(?:hone|ad|od)/.test(e)},$O=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/Macintosh|MacIntel|Mac OS X/.test(e)},ek=e=>{let t=(0,V.c)(4),n=e===void 0?`md`:e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={isMobileScreen:void 0,isMobileUserAgent:void 0,isMobile:void 0,isIOS:void 0,isMac:void 0},t[0]=r):r=t[0];let[i,a]=(0,z.useState)(r),o,s;return t[1]===n?(o=t[2],s=t[3]):(o=()=>{let e=XO(n),t=window.matchMedia(`(max-width: ${e}px)`),r=ZO(),i=QO(),o=$O(),s=e=>a({isMobileScreen:e,isMobileUserAgent:r,isMobile:e,isIOS:i,isMac:o});s(t.matches);let c=e=>s(e.matches);return t.addEventListener(`change`,c),()=>t.removeEventListener(`change`,c)},s=[n],t[1]=n,t[2]=o,t[3]=s),(0,z.useEffect)(o,s),i},tk=e=>e.split(` + `).map(e=>e.trim()),nk=e=>({"⌘":`Meta`,Ctrl:`Control`,Control:`Control`,Alt:`Alt`,"⌥":`Alt`,Shift:`Shift`,Meta:`Meta`,"↑":`ArrowUp`,"↓":`ArrowDown`,"←":`ArrowLeft`,"→":`ArrowRight`,ArrowUp:`ArrowUp`,ArrowDown:`ArrowDown`,ArrowLeft:`ArrowLeft`,ArrowRight:`ArrowRight`})[e]||e,rk=(e,t)=>{let n=t.map(nk),r={Meta:n.includes(`Meta`),Control:n.includes(`Control`),Alt:n.includes(`Alt`),Shift:n.includes(`Shift`)};if(r.Meta!==e.metaKey||r.Control!==e.ctrlKey||r.Alt!==e.altKey||r.Shift!==e.shiftKey)return!1;let i=t.find(e=>![`⌘`,`Ctrl`,`Control`,`Alt`,`⌥`,`Shift`,`Meta`].includes(nk(e)));if(!i)return!1;let a=nk(i);return a.startsWith(`Arrow`)?e.key===a:e.key.toLowerCase()===a.toLowerCase()},ik=e=>({ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`})[e]||e,ak=(e,t)=>{let n=e;return t?(n=n.replace(/Ctrl/g,`⌘`),n=n.replace(/Alt/g,`⌥`)):(n=n.replace(/⌘/g,`Ctrl`),n=n.replace(/⌥/g,`Alt`)),n=n.replace(/ArrowUp/g,`↑`),n=n.replace(/ArrowDown/g,`↓`),n=n.replace(/ArrowLeft/g,`←`),n=n.replace(/ArrowRight/g,`→`),n},ok=({shortcut:e,onTriggered:t,display:n=!0,disabled:r=!1,className:i,size:a=`md`})=>{let{isMac:o}=ek(),s=tk(ak(e,o??!1)),[c,l]=(0,z.useState)(new Set);if((0,z.useEffect)(()=>{let e=e=>{let n=e.target,i=n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable,a=e.key,c=new Set;if(e.metaKey&&c.add(`⌘`),e.ctrlKey&&c.add(`Ctrl`),e.altKey&&c.add(o?`⌥`:`Alt`),e.shiftKey&&c.add(`Shift`),a.startsWith(`Arrow`)?(c.add(a),c.add(ik(a))):c.add(a.toUpperCase()),l(c),!r&&t&&rk(e,s)){let n=s.includes(`Escape`);if(i&&!n)return;e.preventDefault(),t()}},n=()=>{l(new Set)};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,n),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,n),window.removeEventListener(`blur`,n)}},[s,t,o,r]),!n)return null;let u=e=>{let t=e.toUpperCase(),n=nk(e);return c.has(e)||c.has(t)||c.has(n)||e===`⌘`&&c.has(`Meta`)||e===`Ctrl`&&c.has(`Control`)||e===`⌥`&&c.has(`Alt`)||e===`Alt`&&c.has(`Alt`)||e===`←`&&c.has(`ArrowLeft`)||e===`→`&&c.has(`ArrowRight`)||e===`↑`&&c.has(`ArrowUp`)||e===`↓`&&c.has(`ArrowDown`)};return(0,H.jsx)(`kbd`,{className:R(`inline-flex items-center justify-center gap-0.5 p-0.5`,`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,`font-medium font-sans`,`border-1 text-neutral`,a===`sm`&&`text-xs`,a===`md`&&`text-sm`,a===`lg`&&`text-base`,i),children:s.map((t,n)=>{let r=`${t}-${n}-${e}`,i=ik(t);return(0,H.jsxs)(`span`,{className:`inline-flex items-center`,children:[n>0&&(0,H.jsx)(`span`,{className:`text-neutral/50`,children:`+`}),(0,H.jsx)(`span`,{className:R(`min-w-4 px-0.5 text-center`,u(t)&&`scale-120 font-bold text-foreground`),suppressHydrationWarning:!0,children:i})]},r)})})},sk=({children:e,isHidden:t,minWidth:n=0,align:r=`left`,isDisabled:i=!1,className:a,...o})=>{let s=t&&!i;return(0,H.jsx)(`div`,{className:R(`relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-[grid-template-columns] duration-500 ease-in-out`,s?``:`grid-cols-[1fr]`,a),"aria-hidden":s,inert:s?!0:void 0,...o,children:(0,H.jsx)(`div`,{style:{minWidth:`${n}px`},className:R(r===`right`&&`ml-auto`),children:e})})},ck=e=>{let t=e.getBoundingClientRect(),n=t.top,r=t.bottom-1;if(n>=0&&r<=window.innerHeight){let n=t.left+t.width/2,r=t.top+10,i=document.elementFromPoint(n,r);return e===i||e.contains(i)}return!1},lk=({title:e,identifier:t,children:n,header:r,footer:i,closeOnOutsideClick:a=!0,backButton:o,isOpen:s,onClose:c,container:l})=>{let u=F(`right-drawer`),{isMobile:d}=ek(`md`),f=(0,z.useRef)(null),p=(0,z.useRef)(null),m=Te(l),{open:h,close:g}=KO(),_=qO(t),v=_,[y,b]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!v){b(!1);return}let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>b(!0))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[v]);let x=v&&y;xe({disableScroll:v,key:t?`right_drawer_${t}`:`right_drawer`}),(0,z.useEffect)(()=>{if(!v)return;let e=e=>{try{if(!f.current)return;let n=a,r=e.target&&!f.current.contains(e.target),i=ck(f.current);(n&&r&&i||!e.target)&&(g(t),c?.())}catch{g(t),c?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,g,c,a,t]);let S=(0,z.useRef)(c);return(0,z.useEffect)(()=>{S.current=c},[c]),(0,z.useEffect)(()=>{s!==void 0&&s!==_&&(s?h(t):(g(t),S.current?.()))},[s,_,t,h,g]),m?(0,Xo.createPortal)((0,H.jsx)(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:(0,H.jsx)(sk,{isHidden:!x,align:`right`,children:(0,H.jsxs)(Ne,{className:`relative flex h-screen w-screen flex-col border-l text-foreground md:w-100`,ref:f,roundedSize:`none`,borderColor:`neutral`,children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[(0,H.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,H.jsx)(`div`,{children:o&&(0,H.jsx)(M,{variant:`hoverable`,color:`text`,label:o.text??u.goBack.value,onClick:o.onBack,Icon:Js,children:o?.text})}),(0,H.jsx)(`div`,{children:(0,H.jsxs)(Ye,{identifier:`close-drawer`,children:[(0,H.jsx)(M,{variant:`hoverable`,color:`text`,label:`Close`,className:`ml-auto`,onClick:()=>{g(t),c?.()},Icon:pe,size:`icon-md`}),(0,H.jsx)(Ye.Detail,{identifier:`close-drawer`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,H.jsx)(`span`,{className:`whitespace-nowrap text-muted-foreground text-xs`,children:u.closeDrawer}),(0,H.jsx)(ok,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{g(t),c?.()}})]})})]})})]}),e&&(0,H.jsx)(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:e}),r]}),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:(0,H.jsx)(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&d&&(g(t),c?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d&&(g(t),c?.()))},ref:p,role:`button`,tabIndex:0,children:n})}),i&&(0,H.jsx)(`div`,{className:`shrink-0`,children:i})]})})}),m):(0,H.jsx)(H.Fragment,{})},uk=Ze(`w-fit backdrop-blur`,{variants:{roundedSize:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,xxl:`rounded-2xl`,xxxl:`rounded-3xl`,full:`rounded-full`},color:{primary:`border-primary bg-primary/10 text-primary`,success:`border-success bg-success/10 text-success`,error:`border-error bg-error/10 text-error`,warning:`border-warning bg-warning/10 text-warning`,neutral:`/10 border-neutral bg-neutral/10 text-neutral`,text:`border-text bg-text/10 text-foreground`,black:`border-black bg-black/10 text-black`,white:`border-white bg-white/10 text-white`},size:{xs:`border-[1.2px] px-2 py-0.5 text-xs`,sm:`border-[1.3px] px-2 py-0.5 text-sm`,md:`border-2 px-2 py-1 text-base`,lg:`border-2 px-3 py-2 text-lg`,xl:`border-2 px-3 py-2 text-xl`},border:{none:`border-none`,with:`border-[1.3px] border-text`},background:{none:`bg-none`,with:``}},defaultVariants:{roundedSize:`full`,border:`none`,color:`text`,size:`md`}}),dk=({children:e,color:t,roundedSize:n,size:r,border:i,background:a,className:o,...s})=>(0,H.jsx)(`div`,{className:uk({color:t,roundedSize:n,size:r,border:i,background:a,className:o}),...s,children:e}),fk=`dictionaryList`,pk=e=>`dictionary_edition_${e}`,mk=e=>{let t=(0,V.c)(23),n;t[0]===e?n=t[1]:(n=pk(e),t[0]=e,t[1]=n);let r=n,{isOpen:i,open:a,close:o}=JO(),{getEditedContentValue:s}=zf(),{focusedContent:c,setFocusedContent:l}=Ff(),u;t[2]!==c?.dictionaryKey||t[3]!==r||t[4]!==a?(u=()=>{c?.dictionaryKey&&a(r)},t[2]=c?.dictionaryKey,t[3]=r,t[4]=a,t[5]=u):u=t[5];let d=c?.dictionaryKey,f;t[6]!==r||t[7]!==a||t[8]!==d?(f=[d,a,r],t[6]=r,t[7]=a,t[8]=d,t[9]=f):f=t[9],(0,z.useEffect)(u,f);let p;t[10]!==i||t[11]!==r?(p=i(r),t[10]=i,t[11]=r,t[12]=p):p=t[12];let m;t[13]!==o||t[14]!==c||t[15]!==r||t[16]!==l?(m=()=>{o(r),c?.dictionaryKey&&l({...c,keyPath:[]})},t[13]=o,t[14]=c,t[15]=r,t[16]=l,t[17]=m):m=t[17];let h;return t[18]!==c||t[19]!==s||t[20]!==p||t[21]!==m?(h={isOpen:p,focusedContent:c,getEditedContentValue:s,close:m},t[18]=c,t[19]=s,t[20]=p,t[21]=m,t[22]=h):h=t[22],h},hk=e=>{let t=(0,V.c)(77),{dictionaryKey:n,isDarkMode:r}=e,{backButtonText:i,openDictionaryEditor:a,modalTitle:o,noDictionaryFocused:s,focusedDictionaryNotFound:c}=Vt(Pc),l;t[0]===n?l=t[1]:(l=pk(n),t[0]=n,t[1]=l);let u=l,{focusedContent:d,close:f}=mk(n),{setFocusedContent:p}=Ff(),{open:m}=JO(),h;t[2]===m?h=t[3]:(h=()=>m(fk),t[2]=m,t[3]=h);let g=h,{data:_}=fp(),v;t[4]!==f||t[5]!==g||t[6]!==p?(v=()=>{f(),p(null),g()},t[4]=f,t[5]=g,t[6]=p,t[7]=v):v=t[7];let y=v,[b,x]=(0,z.useState)(!1),S;t[8]===y?S=t[9]:(S=()=>{x(!1),y()},t[8]=y,t[9]=S);let C=S;if(!d?.dictionaryKey){let e;return t[10]===s?e=t[11]:(e=(0,H.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:s}),t[10]=s,t[11]=e),e}let w,T,E,D,O,k,ee,A,j,te;if(t[12]!==i||t[13]!==f||t[14]!==d||t[15]!==c||t[16]!==y||t[17]!==u||t[18]!==a||t[19]!==p||t[20]!==_){O=Symbol.for(`react.early_return_sentinel`);bb0:{if(T=_?.[d.dictionaryKey]?.find(e=>e.localId===d?.dictionaryLocalId),!T){let e;t[31]===c?e=t[32]:(e=(0,H.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:c}),t[31]=c,t[32]=e),O=e;break bb0}w=lk,te=u,t[33]!==i.value||t[34]!==y?(E={onBack:y,text:i.value},t[33]=i.value,t[34]=y,t[35]=E):E=t[35],t[36]!==f||t[37]!==p?(D=()=>{f(),p(null)},t[36]=f,t[37]=p,t[38]=D):D=t[38];let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>x(!0),t[39]=e):e=t[39];let n;t[40]===a.label.value?n=t[41]:(n=(0,H.jsx)(M,{variant:`hoverable`,color:`text`,size:`icon-md`,IconRight:ec,label:a.label.value,onClick:e}),t[40]=a.label.value,t[41]=n);let r;t[42]===a.popoverContent?r=t[43]:(r=(0,H.jsx)(Ye.Detail,{identifier:`open-dictionary-editor`,children:(0,H.jsx)(`span`,{className:`whitespace-nowrap p-2 text-neutral text-xs`,children:a.popoverContent})}),t[42]=a.popoverContent,t[43]=r);let o;t[44]!==n||t[45]!==r?(o=(0,H.jsxs)(Ye,{identifier:`open-dictionary-editor`,children:[n,r]}),t[44]=n,t[45]=r,t[46]=o):o=t[46],j=(0,H.jsxs)(`header`,{className:`mb-5 flex w-full px-3`,children:[(0,H.jsx)(`h3`,{className:`w-full text-center text-lg`,children:T.title?T.title:T.key}),o]}),k=`flex flex-wrap items-center justify-center gap-x-4 gap-y-2 border-text/20 border-b border-dotted pb-3`,ee=(0,H.jsx)(dk,{color:`text`,roundedSize:`full`,size:`xs`,children:T.key}),A=T.filePath&&(0,H.jsx)(dk,{color:`blue`,roundedSize:`full`,size:`xs`,children:T.filePath.split(`/`).pop()})}t[12]=i,t[13]=f,t[14]=d,t[15]=c,t[16]=y,t[17]=u,t[18]=a,t[19]=p,t[20]=_,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O,t[26]=k,t[27]=ee,t[28]=A,t[29]=j,t[30]=te}else w=t[21],T=t[22],E=t[23],D=t[24],O=t[25],k=t[26],ee=t[27],A=t[28],j=t[29],te=t[30];if(O!==Symbol.for(`react.early_return_sentinel`))return O;let N;t[47]===T.id?N=t[48]:(N=T.id&&(0,H.jsx)(dk,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`}),t[47]=T.id,t[48]=N);let P;t[49]!==N||t[50]!==k||t[51]!==ee||t[52]!==A?(P=(0,H.jsxs)(`div`,{className:k,children:[ee,A,N]}),t[49]=N,t[50]=k,t[51]=ee,t[52]=A,t[53]=P):P=t[53];let ne;t[54]!==P||t[55]!==j?(ne=(0,H.jsxs)(H.Fragment,{children:[j,P]}),t[54]=P,t[55]=j,t[56]=ne):ne=t[56];let re;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(re=[`local`,`remote`],t[57]=re):re=t[57];let ie;t[58]!==T||t[59]!==y?(ie=(0,H.jsx)(_O,{dictionary:T,mode:re,className:`mb-4 flex-col px-3`,onDelete:y}),t[58]=T,t[59]=y,t[60]=ie):ie=t[60];let F;t[61]!==T||t[62]!==b||t[63]!==d||t[64]!==y||t[65]!==r||t[66]!==o||t[67]!==C?(F=d&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(je,{isOpen:b,onClose:()=>x(!1),hasCloseButton:!0,title:o,size:`xl`,transparency:`lg`,className:`h-full`,children:(0,H.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-1 flex-col px-3 pt-5`,children:(0,H.jsx)(HO,{dictionary:T,onClickDictionaryList:C,isDarkMode:r,mode:[`local`,`remote`],onDelete:()=>{x(!1),y()},onSave:()=>{x(!1)}})})}),(0,H.jsx)(Qp,{dictionary:T})]}),t[61]=T,t[62]=b,t[63]=d,t[64]=y,t[65]=r,t[66]=o,t[67]=C,t[68]=F):F=t[68];let I;return t[69]!==w||t[70]!==E||t[71]!==D||t[72]!==ne||t[73]!==ie||t[74]!==F||t[75]!==te?(I=(0,H.jsx)(w,{identifier:te,backButton:E,onClose:D,header:ne,footer:ie,children:F}),t[69]=w,t[70]=E,t[71]=D,t[72]=ne,t[73]=ie,t[74]=F,t[75]=te,t[76]=I):I=t[76],I},gk=e=>{let t=(0,V.c)(4),{isDarkMode:n}=e,{focusedContent:r}=Ff(),i=r?.dictionaryKey;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(H.Fragment,{}),t[0]=e):e=t[0],e}let a;return t[1]!==i||t[2]!==n?(a=(0,H.jsx)(hk,{dictionaryKey:i,isDarkMode:n}),t[1]=i,t[2]=n,t[3]=a):a=t[3],a},_k={key:`dictionary-list-drawer`,content:{nodeType:`translation`,translation:{en:{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},"en-GB":{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},fr:{drawerTitle:{label:`Liste des dictionnaires`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Ouvrir le dictionnaire dans l'éditeur {{dictionaryLocalId}}`}}},es:{drawerTitle:{label:`Lista de diccionarios`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir el diccionario en el editor {{dictionaryLocalId}}`}}},de:{drawerTitle:{label:`Wörterbuchliste`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Wörterbuch-Editor öffnen {{dictionaryLocalId}}`}}},ja:{drawerTitle:{label:`辞書リスト`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`辞書エディタを開く {{dictionaryLocalId}}`}}},ko:{drawerTitle:{label:`사전 목록`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`사전 편집기 열기 {{dictionaryLocalId}}`}}},zh:{drawerTitle:{label:`字典列表`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`打开字典编辑器 {{dictionaryLocalId}}`}}},it:{drawerTitle:{label:`Lista dei dizionari`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Apri editor dizionario {{dictionaryLocalId}}`}}},pt:{drawerTitle:{label:`Lista de dicionários`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir editor de dicionário {{dictionaryLocalId}}`}}},hi:{drawerTitle:{label:`शब्दकोश सूची`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`शब्दकोश संपादक खोलें {{dictionaryLocalId}}`}}},ar:{drawerTitle:{label:`قائمة القواميس`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`فتح محرر القاموس {{dictionaryLocalId}}`}}},ru:{drawerTitle:{label:`Список словарей`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Открыть редактор словаря {{dictionaryLocalId}}`}}}}},location:`local`,localId:`dictionary-list-drawer::local::client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`},vk=e=>{let{minChars:t=3,debounceMs:n=300,trim:r=!0,defaultValue:i,onSearch:a,onClear:o}=e??{},s=(0,z.useRef)(``),c=(0,z.useRef)(null),[l,u]=(0,z.useState)(i??``),d=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,z.useEffect)(()=>()=>{d()},[]),{setSearch:e=>{s.current=e;let i=r?e.trim():e;if(d(),i.length<t){u(``),o?.();return}c.current=setTimeout(()=>{let e=r?s.current.trim():s.current;e.length>=t?(u(e),a?.(e)):(u(``),o?.())},n)},search:l,hasMinChars:l.length>=t}},yk=({className:e,...t})=>(0,H.jsxs)(`div`,{className:`relative flex w-full items-center gap-1`,children:[(0,H.jsx)(ac,{className:`absolute left-2 size-4`}),(0,H.jsx)(Ap,{...t,type:`search`,className:R(`pl-8`,e)})]}),bk=()=>{let{drawerTitle:e,buttonLabel:t}=Vt(_k),{set:n}=JO(),{localeDictionaries:r}=jf(),{editedContent:i}=Bf(),{setFocusedContent:a}=Ff(),{setSearch:o,search:s}=vk(),c=(0,z.useMemo)(()=>new eO(Object.values(r),{keys:[`key`,`title`,`filePath`,`description`,`tags`],threshold:.3,includeScore:!0}),[r]),l=(0,z.useMemo)(()=>!s||s.trim()===``?Object.values(r):c.search(s).map(e=>e.item),[s,c,r]),u=e=>{a({dictionaryKey:e.key,dictionaryLocalId:e.localId,keyPath:[]}),n({[fk]:!1,[pk(e.key)]:!0})},d=e=>Object.keys(i??{}).includes(e);return(0,H.jsxs)(lk,{title:e.label.value,identifier:fk,children:[(0,H.jsx)(`div`,{className:`p-3 pb-4`,children:(0,H.jsx)(yk,{placeholder:`Search dictionaries`,onChange:e=>o(e.target.value),type:`search`})}),(0,H.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l.map(e=>(0,H.jsx)(`li`,{className:`w-full`,children:(0,H.jsx)(M,{label:t.label({dictionaryLocalId:e.localId}).value,onClick:()=>u(e),variant:`hoverable`,color:`text`,IconRight:Ys,size:`md`,isFullWidth:!0,Icon:d(e.localId)?tc:void 0,children:(0,H.jsx)(`div`,{className:`flex items-center gap-2 py-1`,children:(0,H.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1.5`,children:[(0,H.jsx)(dk,{color:`text`,roundedSize:`full`,size:`xs`,children:e.key}),e.filePath&&(0,H.jsx)(dk,{color:`blue`,roundedSize:`full`,size:`xs`,children:e.filePath.split(`/`).pop()}),e.id&&(0,H.jsx)(dk,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`})]}),(0,H.jsx)(`span`,{children:(e.title??``).length>0?e.title:e.key})]})})})},e.localId))})]})},xk={key:`long-press-message`,content:{nodeType:`translation`,translation:{en:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},"en-GB":{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},fr:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press pour éditer le dictionnaire "{{dictionaryKey}}"`}},es:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Presiona largo para editar el diccionario "{{dictionaryKey}}"`}},de:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Lang press für Bearbeitung des Wörterbuchs "{{dictionaryKey}}"`}},ja:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`長押しして編集 "{{dictionaryKey}}" 辞書`}},ko:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`길게 눌러 편집 "{{dictionaryKey}}" 사전`}},zh:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`长按编辑 "{{dictionaryKey}}" 字典`}},it:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Premi a lungo per modificare il dizionario "{{dictionaryKey}}"`}},pt:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Pressione longa para editar o dicionário "{{dictionaryKey}}"`}},hi:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`लंग प्रेस करें टू एडिट "{{dictionaryKey}}"`}},ar:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`اضغط طويلاً للتعديل "{{dictionaryKey}}"`}},ru:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Длительное нажатие для редактирования словаря "{{dictionaryKey}}"`}}}},location:`local`,localId:`long-press-message::local::client/src/components/Editor/LongPressMessage/index.content.ts`,filePath:`client/src/components/Editor/LongPressMessage/index.content.ts`},Sk=()=>{let e=(0,V.c)(8),{message:t}=Vt(xk),[n]=kf(Rd.INTLAYER_HOVERED_CONTENT_CHANGED,null),r=n?.dictionaryKey?`opacity-100`:`opacity-0`,i;e[0]===r?i=e[1]:(i=R(`rounded-2xl bg-neutral/30 px-3 py-1 font-bold text-sm text-text transition-opacity duration-100`,r),e[0]=r,e[1]=i);let a;e[2]!==n||e[3]!==t?(a=n?.dictionaryKey?t({dictionaryKey:n.dictionaryKey}):``,e[2]=n,e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==i||e[6]!==a?(o=(0,H.jsx)(`div`,{className:i,children:a}),e[5]=i,e[6]=a,e[7]=o):o=e[7],o},Ck=e=>{let t=(0,V.c)(5),{children:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,H.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,H.jsx)(Sk,{})}),i=(0,H.jsx)(gk,{}),a=(0,H.jsx)(bk,{}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,H.jsxs)(`div`,{className:`relative size-full bg-card p-3`,children:[n,r,i,a]}),t[3]=n,t[4]=o),o},wk=()=>{let e=(0,V.c)(2),[t,n]=(0,z.useState)(),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{fetch(`/api/config`).then(Tk).then(e=>n(e.data))},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,z.useEffect)(r,i),t};function Tk(e){return e.json()}var Ek=e=>{let t=(0,V.c)(11),{children:n,iframeRef:r}=e,i=wk(),a=i?.editor.applicationURL;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(m,{}),t[0]=e):e=t[0],e}let o;t[1]!==a||t[2]!==r?(o=e=>{r.current?.contentWindow?.postMessage(e,a)},t[1]=a,t[2]=r,t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=[a],t[4]=a,t[5]=s);let c;return t[6]!==n||t[7]!==i||t[8]!==o||t[9]!==s?(c=(0,H.jsx)(If,{postMessage:o,allowedOrigins:s,configuration:i,children:n}),t[6]=n,t[7]=i,t[8]=o,t[9]=s,t[10]=c):c=t[10],c},Dk={key:`iframe-controller`,content:{nodeType:`translation`,translation:{en:{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},"en-GB":{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},fr:{intlayerApplication:`Application Intlayer`,enableEditor:`Activer l'éditeur`},es:{intlayerApplication:`Aplicación Intlayer`,enableEditor:`Activar el editor`},de:{intlayerApplication:`Intlayer-Anwendung`,enableEditor:`Editor aktivieren`},ja:{intlayerApplication:`Intlayerアプリケーション`,enableEditor:`エディタを有効にする`},ko:{intlayerApplication:`Intlayer 애플리케이션`,enableEditor:`에디터 활성화`},zh:{intlayerApplication:`Intlayer 应用程序`,enableEditor:`启用编辑器`},it:{intlayerApplication:`Applicazione Intlayer`,enableEditor:`Abilita l'editor`},pt:{intlayerApplication:`Aplicativo Intlayer`,enableEditor:`Ativar editor`},hi:{intlayerApplication:`इंटलेयर एप्लिकेशन`,enableEditor:`संपादक सक्षम करें`},ar:{intlayerApplication:`تطبيق Intlayer`,enableEditor:`تفعيل المحرر`},ru:{intlayerApplication:`Приложение Intlayer`,enableEditor:`Включить редактор`}}},location:`local`,localId:`iframe-controller::local::client/src/components/Editor/iframeController.content.ts`,filePath:`client/src/components/Editor/iframeController.content.ts`},Ok=()=>{let e=(0,V.c)(9),{editedContent:t,setEditedContentState:n}=Bf(),r;e[0]===n?r=e[1]:(r=()=>{let e=localStorage?.getItem(`INTLAYER_EDITED_CONTENT_CHANGED`);if(e)try{let t=JSON.parse(e);n(t)}catch(e){console.error(e)}},e[0]=n,e[1]=r);let i=r,a,o;e[2]===t?(a=e[3],o=e[4]):(a=()=>{t!==void 0&&localStorage?.setItem(`INTLAYER_EDITED_CONTENT_CHANGED`,JSON.stringify(t))},o=[t],e[2]=t,e[3]=a,e[4]=o),(0,z.useEffect)(a,o);let s;e[5]!==t||e[6]!==i?(s=()=>{t===void 0&&i()},e[5]=t,e[6]=i,e[7]=s):s=e[7];let c;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],e[8]=c):c=e[8],(0,z.useEffect)(s,c),i},kk={key:`no-application-url-view`,content:{nodeType:`translation`,translation:{en:{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},"en-GB":{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},fr:{title:`Votre configuration de projet ne comprend pas l’URL de l’application`,description:`Pour utiliser l’éditeur, vous devez ajouter l’URL de l’application pour accéder au fichier de configuration.`,documentationLink:{label:`Cliquez ici pour accéder à la documentation de l’éditeur`,text:`Voir comment configurer l’éditeur`}},es:{title:`Su configuración de proyecto no incluye la URL de la aplicación`,description:`Para usar el editor, debe agregar la URL de la aplicación para acceder al archivo de configuración.`,documentationLink:{label:`Haga clic aquí para acceder a la documentación del editor`,text:`Vea cómo configurar el editor`}},de:{title:`Ihre Projektkonfiguration enthält keine Anwendungs-URL`,description:`Um den Editor zu verwenden, müssen Sie die URL der Anwendung hinzufügen, um auf die Konfigurationsdatei zuzugreifen.`,documentationLink:{label:`Klicken Sie hier, um die Editor-Dokumentation zu besuchen`,text:`Siehe, wie man den Editor konfiguriert`}},ja:{title:`あなたのプロジェクト構成にはアプリケーション URL が含まれていません`,description:`エディターを使用するには、アプリケーションの URL を設定ファイルに追加する必要があります。`,documentationLink:{label:`エディターのドキュメントに移動するには、ここをクリックしてください`,text:`エディターの設定方法を見る`}},ko:{title:`당신의 프로젝트 구성에 앱 URL이 포함되어 있지 않습니다.`,description:`에디터를 사용하려면 설정 파일에 앱 URL을 추가해야 합니다.`,documentationLink:{label:`에디터 문서로 이동하려면 여기를 클릭하십시오.`,text:`에디터 설정 방법을 보십시오`}},zh:{title:`您的项目配置未包含应用程序 URL`,description:`要使用编辑器,您需要将应用程序 URL 添加到访问配置文件。`,documentationLink:{label:`点击此处访问编辑器文档`,text:`查看如何配置编辑器`}},it:{title:`La configurazione del progetto non include l’URL dell’applicazione`,description:`Per utilizzare l’editor, è necessario aggiungere l’URL dell’applicazione per accedere al file di configurazione.`,documentationLink:{label:`Fai clic qui per accedere alla documentazione dell’editor`,text:`Vedi come configurare l’editor`}},pt:{title:`Sua configuração do projeto não inclui a URL do aplicativo`,description:`Para usar o editor, você precisa adicionar a URL do aplicativo para acessar o arquivo de configuração.`,documentationLink:{label:`Clique aqui para acessar a documentação do editor`,text:`Veja como configurar o editor`}},hi:{title:`आपके प्रोजेक्ट कॉन्फ़िगरेशन में ऐप का URL शामिल नहीं है`,description:`एडिटर का उपयोग करने के लिए, आपको कॉन्फ़िगरेशन फ़ाइल तक ऐप का URL को जोड़ना होगा।`,documentationLink:{label:`एडिटर को डॉक्यूमेंट पर जाए रखना चाहते हैं?`,text:`एडिटर को काने के बारे में देखें`}},ar:{title:`تم إنشاء مشروعك بدون تضمين عنوان URL التطبيق`,description:`لاستخدام المحرر، يجب عليك إضافة عنوان URL التطبيق للوصول إلى ملف التكوين.`,documentationLink:{label:`انقر هنا للوصول إلى وثائق المحرر`,text:`انظر كيفية تكوين المحرر`}},ru:{title:`Ваша конфигурация проекта не включает URL-адрес приложения`,description:`Чтобы использовать редактор, вам необходимо добавить URL-адрес приложения для доступа к файлу конфигурации.`,documentationLink:{label:`Нажмите, чтобы перейти к документации редактора`,text:`Смотрите, как настроить редактор`}}}},location:`local`,localId:`no-application-url-view::local::client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`,filePath:`client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`},Ak=()=>{let e=(0,V.c)(11),{title:t,description:n,documentationLink:r}=Vt(kk),i;e[0]===t?i=e[1]:(i=(0,H.jsx)(qe,{className:`mb-8`,children:t}),e[0]=t,e[1]=i);let a;e[2]===n?a=e[3]:(a=(0,H.jsx)(`strong`,{className:`block text-neutral`,children:n}),e[2]=n,e[3]=a);let o;e[4]!==r.label.value||e[5]!==r.text?(o=(0,H.jsx)(Ve,{label:r.label.value,href:`https://intlayer.org/doc/concept/configuration#editor-configuration`,color:`text`,variant:`button`,className:`ml-auto`,isExternalLink:!0,children:r.text}),e[4]=r.label.value,e[5]=r.text,e[6]=o):o=e[6];let s;return e[7]!==i||e[8]!==a||e[9]!==o?(s=(0,H.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i,a,o]}),e[7]=i,e[8]=a,e[9]=o,e[10]=s):s=e[10],s},jk=e=>{let t=(0,V.c)(23),{iframeRef:n,applicationPath:r}=e,i=Vt(Dk),{editor:a}=Rf()??{},{enabled:o}=Vf(),s=Hf();Ok(),Wf();let[c,l]=(0,z.useState)(!0),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={receive:!0,emit:!1},t[0]=u):u=t[0];let[d]=Af(void 0,u),f,p;if(t[1]===d?(f=t[2],p=t[3]):(f=()=>{typeof d==`string`&&window.history.replaceState({},``,d)},p=[d],t[1]=d,t[2]=f,t[3]=p),(0,z.useEffect)(f,p),!a?.applicationURL){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(Ne,{className:`max-w-xl`,padding:`xl`,roundedSize:`2xl`,children:(0,H.jsx)(Ak,{})}),t[4]=e):e=t[4],e}let h;t[5]===c?h=t[6]:(h=(0,H.jsx)(m,{isLoading:c}),t[5]=c,t[6]=h);let g=`${a.applicationURL}${r}`,_=i.intlayerApplication.value,v=c&&`hidden`,y;t[7]===v?y=t[8]:(y=R(`size-full`,v),t[7]=v,t[8]=y);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>{l(!1)},t[9]=b):b=t[9];let x;t[10]!==i.intlayerApplication.value||t[11]!==n||t[12]!==g||t[13]!==y?(x=(0,H.jsx)(`iframe`,{src:g,title:_,sandbox:`allow-scripts allow-same-origin`,className:y,ref:n,onLoad:b}),t[10]=i.intlayerApplication.value,t[11]=n,t[12]=g,t[13]=y,t[14]=x):x=t[14];let S;t[15]!==i.enableEditor||t[16]!==o||t[17]!==s?(S=!o&&(0,H.jsx)(`div`,{className:`fixed right-4 bottom-4`,children:(0,H.jsx)(M,{label:i.enableEditor.value,onClick:s,color:`text`,children:i.enableEditor})}),t[15]=i.enableEditor,t[16]=o,t[17]=s,t[18]=S):S=t[18];let C;return t[19]!==x||t[20]!==S||t[21]!==h?(C=(0,H.jsxs)(`div`,{className:`relative size-full overflow-hidden rounded-lg`,children:[h,x,S]}),t[19]=x,t[20]=S,t[21]=h,t[22]=C):C=t[22],C},Mk=()=>{let e=(0,V.c)(2),t=(0,z.useRef)(null),n=gr(),r;return e[0]===n.pathname?r=e[1]:(r=(0,H.jsx)(Ek,{iframeRef:t,children:(0,H.jsx)(et,{disableEditor:!0,children:(0,H.jsx)(Ck,{children:(0,H.jsx)(jk,{iframeRef:t,applicationPath:n.pathname})})})}),e[0]=n.pathname,e[1]=r),r};(0,Ac.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(z.StrictMode,{children:(0,H.jsx)(()=>{let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,H.jsx)(Nc,{children:(0,H.jsx)(Mc,{children:(0,H.jsx)(Mk,{})})}),e[0]=t):t=e[0],t},{})}));export{$h as a,Zi as c,sg as i,Ct as l,yg as n,cp as o,ag as r,oc as s,Og as t};
|