From e244d6e92165e11c9a1113f1b60a5a43bd8f2c88 Mon Sep 17 00:00:00 2001 From: yoan <536464346@qq.com> Date: Thu, 5 Sep 2024 10:30:19 +0800 Subject: [PATCH] Add qiniu deployer --- go.mod | 2 + go.sum | 43 ++ internal/deployer/deployer.go | 7 +- internal/deployer/qiniu.go | 208 ++++++++ internal/deployer/qiniu_test.go | 86 +++ internal/domain/access.go | 5 + internal/utils/http/http.go | 28 +- migrations/1724943694_collections_snapshot.go | 504 ------------------ ....go => 1725503354_collections_snapshot.go} | 14 +- .../{index-CglXs5Ou.js => index-CMS-AsEx.js} | 76 +-- ui/dist/index.html | 2 +- ui/src/components/certimate/AccessEdit.tsx | 14 +- .../components/certimate/AccessQiniuForm.tsx | 195 +++++++ ui/src/domain/access.ts | 10 +- ui/src/domain/domain.ts | 1 + 15 files changed, 634 insertions(+), 561 deletions(-) create mode 100644 internal/deployer/qiniu.go create mode 100644 internal/deployer/qiniu_test.go delete mode 100644 migrations/1724943694_collections_snapshot.go rename migrations/{1725258856_collections_snapshot.go => 1725503354_collections_snapshot.go} (97%) rename ui/dist/assets/{index-CglXs5Ou.js => index-CMS-AsEx.js} (64%) create mode 100644 ui/src/components/certimate/AccessQiniuForm.tsx diff --git a/go.mod b/go.mod index fbfc1b4c..4856f692 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/pkg/sftp v1.13.6 github.com/pocketbase/dbx v1.10.1 github.com/pocketbase/pocketbase v0.22.18 + github.com/qiniu/go-sdk/v7 v7.22.0 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.992 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.992 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.992 @@ -26,6 +27,7 @@ require github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // i require ( github.com/AlecAivazis/survey/v2 v2.3.7 // indirect + github.com/BurntSushi/toml v1.4.0 // indirect github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect diff --git a/go.sum b/go.sum index ad53ddef..96e768f6 100644 --- a/go.sum +++ b/go.sum @@ -18,6 +18,9 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4 github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.7.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= @@ -25,6 +28,7 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63n github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82/go.mod h1:nLnM0KdK1CmygvjpDUO6m1TjSsiQtL61juhNsvV/JVI= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= github.com/alibabacloud-go/cas-20200407/v2 v2.3.0 h1:nOrp0n2nFZiYN0wIG7S26YVVaMMzOBkX9GJqUvYnGeE= @@ -115,6 +119,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/dave/jennifer v1.6.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -124,6 +129,8 @@ github.com/domodwyer/mailyak/v3 v3.6.2 h1:x3tGMsyFhTCaxp6ycgR0FE/bu5QiNp+hetUuCO github.com/domodwyer/mailyak/v3 v3.6.2/go.mod h1:lOm/u9CyCVWHeaAmHIdF4RiKVxKUT/H5XX10lIKAL6c= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/elastic/go-sysinfo v1.0.2/go.mod h1:O/D5m1VpYLwGjCYzEt63g3Z1uO3jXfwyzzjiW90t8cY= +github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -137,6 +144,7 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= +github.com/gammazero/toposort v0.1.1/go.mod h1:H2cozTnNpMw0hg2VHAYsAxmkHXBYroNangj2NTBQDvw= github.com/ganigeorgiev/fexpr v0.4.1 h1:hpUgbUEEWIZhSDBtf4M9aUNfQQ0BZkGRaMePy7Gcx5k= github.com/ganigeorgiev/fexpr v0.4.1/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE= github.com/go-acme/lego/v4 v4.17.4 h1:h0nePd3ObP6o7kAkndtpTzCw8shOZuWckNYeUQwo36Q= @@ -150,11 +158,18 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.7.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.8.0 h1:UtktXaU2Nb64z/pLiGIxY4431SJ4/dR5cjMmlVHgnT4= github.com/go-sql-driver/mysql v1.8.0/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gojek/heimdall/v7 v7.0.3 h1:+5sAhl8S0m+qRRL8IVeHCJudFh/XkG3wyO++nvOg+gc= github.com/gojek/heimdall/v7 v7.0.3/go.mod h1:Z43HtMid7ysSjmsedPTXAki6jcdcNVnjn5pmsTyiMic= github.com/gojek/valkyrie v0.0.0-20180215180059-6aee720afcdf h1:5xRGbUdOmZKoDXkGx5evVLehuCMpuO1hl701bEQqXOM= @@ -208,6 +223,7 @@ github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDP github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -218,12 +234,15 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -233,6 +252,9 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -241,6 +263,9 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 h1:FwuzbVh87iLiUQj1+uQUsuw9x5t9m5n5g7rG7o4svW4= github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61/go.mod h1:paQfF1YtHe+GrGg5fOgjsjoCX/UKDr9bc1DoWpZfns8= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f/go.mod h1:aEt7p9Rvh67BYApmZwNDPpgircTO2kgdmDUoF/1QmwA= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -267,6 +292,8 @@ github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJm github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= @@ -278,9 +305,16 @@ github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWK github.com/pocketbase/pocketbase v0.22.18 h1:yVckUhi5GDORqCb0BbtlvRB1CVxHY9HO9btEaeZHVJU= github.com/pocketbase/pocketbase v0.22.18/go.mod h1:0QFvDOOW7ANId78ChZSagyHbmP6CgMxDQrQFXzeaDpA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/qiniu/dyn v1.3.0/go.mod h1:E8oERcm8TtwJiZvkQPbcAh0RL8jO1G0VXJMW3FAWdkk= +github.com/qiniu/go-sdk/v7 v7.22.0 h1:NiRj6+beSkKsPBr4XN9OdjPJQKhERtOwOwu3HJtzcWQ= +github.com/qiniu/go-sdk/v7 v7.22.0/go.mod h1:44lnyCs6gflCxMUV1yTBlZhPEB4ZO6LIDHkMV8Rofms= +github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -378,6 +412,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= @@ -407,6 +442,7 @@ golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -419,6 +455,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -447,6 +484,7 @@ golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -515,22 +553,27 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= diff --git a/internal/deployer/deployer.go b/internal/deployer/deployer.go index c4d6efa1..f58065a4 100644 --- a/internal/deployer/deployer.go +++ b/internal/deployer/deployer.go @@ -10,16 +10,13 @@ import ( "github.com/pocketbase/pocketbase/models" ) -const ( - configTypeAliyun = "aliyun" -) - const ( targetAliyunOss = "aliyun-oss" targetAliyunCdn = "aliyun-cdn" targetSSH = "ssh" targetWebhook = "webhook" targetTencentCdn = "tencent-cdn" + targetQiniuCdn = "qiniu-cdn" ) type DeployerOption struct { @@ -63,6 +60,8 @@ func Get(record *models.Record, cert *applicant.Certificate) (Deployer, error) { return NewWebhook(option) case targetTencentCdn: return NewTencentCdn(option) + case targetQiniuCdn: + return NewQiNiu(option) } return nil, errors.New("not implemented") } diff --git a/internal/deployer/qiniu.go b/internal/deployer/qiniu.go new file mode 100644 index 00000000..15db6365 --- /dev/null +++ b/internal/deployer/qiniu.go @@ -0,0 +1,208 @@ +package deployer + +import ( + "bytes" + "certimate/internal/domain" + xhttp "certimate/internal/utils/http" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/qiniu/go-sdk/v7/auth" +) + +const qiniuGateway = "http://api.qiniu.com" + +type qiuniu struct { + option *DeployerOption + info []string + credentials *auth.Credentials +} + +func NewQiNiu(option *DeployerOption) (*qiuniu, error) { + access := &domain.QiniuAccess{} + json.Unmarshal([]byte(option.Access), access) + + return &qiuniu{ + option: option, + info: make([]string, 0), + + credentials: auth.New(access.AccessKey, access.SecretKey), + }, nil +} + +func (q *qiuniu) GetInfo() []string { + return q.info +} + +func (q *qiuniu) Deploy(ctx context.Context) error { + + // 上传证书 + certId, err := q.uploadCert() + if err != nil { + return fmt.Errorf("uploadCert failed: %w", err) + } + + // 获取域名信息 + domainInfo, err := q.getDomainInfo() + if err != nil { + return fmt.Errorf("getDomainInfo failed: %w", err) + } + + // 判断域名是否启用 https + + if domainInfo.Https != nil && domainInfo.Https.CertID != "" { + // 启用了 https + // 修改域名证书 + err = q.modifyDomainCert(certId) + if err != nil { + return fmt.Errorf("modifyDomainCert failed: %w", err) + } + } else { + // 没启用 https + // 启用 https + + err = q.enableHttps(certId) + if err != nil { + return fmt.Errorf("enableHttps failed: %w", err) + } + } + + return nil +} + +func (q *qiuniu) enableHttps(certId string) error { + path := fmt.Sprintf("/domain/%s/sslize", q.option.Domain) + + body := &modifyDomainCertReq{ + CertID: certId, + ForceHttps: true, + Http2Enable: true, + } + + bodyBytes, err := json.Marshal(body) + if err != nil { + return fmt.Errorf("enable https failed: %w", err) + } + + _, err = q.req(qiniuGateway+path, http.MethodPut, bytes.NewReader(bodyBytes)) + if err != nil { + return fmt.Errorf("enable https failed: %w", err) + } + + return nil +} + +type domainInfo struct { + Https *modifyDomainCertReq `json:"https"` +} + +func (q *qiuniu) getDomainInfo() (*domainInfo, error) { + path := fmt.Sprintf("/domain/%s", q.option.Domain) + + res, err := q.req(qiniuGateway+path, http.MethodGet, nil) + if err != nil { + return nil, fmt.Errorf("req failed: %w", err) + } + + resp := &domainInfo{} + err = json.Unmarshal(res, resp) + if err != nil { + return nil, fmt.Errorf("json.Unmarshal failed: %w", err) + } + + return resp, nil +} + +type uploadCertReq struct { + Name string `json:"name"` + CommonName string `json:"common_name"` + Pri string `json:"pri"` + Ca string `json:"ca"` +} + +type uploadCertResp struct { + CertID string `json:"certID"` +} + +func (q *qiuniu) uploadCert() (string, error) { + path := "/sslcert" + + body := &uploadCertReq{ + Name: q.option.Domain, + CommonName: q.option.Domain, + Pri: q.option.Certificate.PrivateKey, + Ca: q.option.Certificate.Certificate, + } + + bodyBytes, err := json.Marshal(body) + if err != nil { + return "", fmt.Errorf("json.Marshal failed: %w", err) + } + + res, err := q.req(qiniuGateway+path, http.MethodPost, bytes.NewReader(bodyBytes)) + if err != nil { + return "", fmt.Errorf("req failed: %w", err) + } + resp := &uploadCertResp{} + err = json.Unmarshal(res, resp) + if err != nil { + return "", fmt.Errorf("json.Unmarshal failed: %w", err) + } + + return resp.CertID, nil +} + +type modifyDomainCertReq struct { + CertID string `json:"certId"` + ForceHttps bool `json:"forceHttps"` + Http2Enable bool `json:"http2Enable"` +} + +func (q *qiuniu) modifyDomainCert(certId string) error { + path := fmt.Sprintf("/domain/%s/httpsconf", q.option.Domain) + + body := &modifyDomainCertReq{ + CertID: certId, + ForceHttps: true, + Http2Enable: true, + } + + bodyBytes, err := json.Marshal(body) + if err != nil { + return fmt.Errorf("json.Marshal failed: %w", err) + } + + _, err = q.req(qiniuGateway+path, http.MethodPut, bytes.NewReader(bodyBytes)) + if err != nil { + return fmt.Errorf("req failed: %w", err) + } + + return nil +} + +func (q *qiuniu) req(url, method string, body io.Reader) ([]byte, error) { + req := xhttp.BuildReq(url, method, body, map[string]string{ + "Content-Type": "application/json", + }) + + if err := q.credentials.AddToken(auth.TokenQBox, req); err != nil { + return nil, fmt.Errorf("credentials.AddToken failed: %w", err) + } + + respBody, err := xhttp.ToRequest(req) + if err != nil { + return nil, fmt.Errorf("ToRequest failed: %w", err) + } + + defer respBody.Close() + + res, err := io.ReadAll(respBody) + if err != nil { + return nil, fmt.Errorf("io.ReadAll failed: %w", err) + } + + return res, nil +} diff --git a/internal/deployer/qiniu_test.go b/internal/deployer/qiniu_test.go new file mode 100644 index 00000000..35b0746a --- /dev/null +++ b/internal/deployer/qiniu_test.go @@ -0,0 +1,86 @@ +package deployer + +import ( + "certimate/internal/applicant" + "testing" + + "github.com/qiniu/go-sdk/v7/auth" +) + +func Test_qiuniu_uploadCert(t *testing.T) { + type fields struct { + option *DeployerOption + } + tests := []struct { + name string + fields fields + want string + wantErr bool + }{ + { + name: "test", + fields: fields{ + option: &DeployerOption{ + DomainId: "1", + Domain: "example.com", + Product: "test", + Access: `{"bucket":"test","accessKey":"","secretKey":""}`, + Certificate: applicant.Certificate{ + Certificate: "", + PrivateKey: "", + }, + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + q, _ := NewQiNiu(tt.fields.option) + got, err := q.uploadCert() + if (err != nil) != tt.wantErr { + t.Errorf("qiuniu.uploadCert() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf("qiuniu.uploadCert() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_qiuniu_modifyDomainCert(t *testing.T) { + type fields struct { + option *DeployerOption + info []string + credentials *auth.Credentials + } + type args struct { + certId string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + { + name: "test", + fields: fields{ + option: &DeployerOption{ + DomainId: "1", + Domain: "jt1.ikit.fun", + Product: "test", + Access: `{"bucket":"test","accessKey":"","secretKey":""}`, + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + q, _ := NewQiNiu(tt.fields.option) + if err := q.modifyDomainCert(tt.args.certId); (err != nil) != tt.wantErr { + t.Errorf("qiuniu.modifyDomainCert() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/internal/domain/access.go b/internal/domain/access.go index af21ebf3..c778256d 100644 --- a/internal/domain/access.go +++ b/internal/domain/access.go @@ -13,3 +13,8 @@ type TencentAccess struct { type CloudflareAccess struct { DnsApiToken string `json:"dnsApiToken"` } + +type QiniuAccess struct { + AccessKey string `json:"accessKey"` + SecretKey string `json:"secretKey"` +} diff --git a/internal/utils/http/http.go b/internal/utils/http/http.go index 63ed91d8..47fa6f88 100644 --- a/internal/utils/http/http.go +++ b/internal/utils/http/http.go @@ -32,6 +32,24 @@ func Req(url string, method string, body io.Reader, head map[string]string, opts } func Req2GetReader(url string, method string, body io.Reader, head map[string]string, opts ...Option) (io.ReadCloser, error) { + req := BuildReq(url, method, body, head) + + return ToRequest(req, opts...) + +} + +func BuildReq(url string, method string, body io.Reader, head map[string]string) *http.Request { + + // Create an http.Request instance + req, _ := http.NewRequest(method, url, body) + for k, v := range head { + req.Header.Set(k, v) + } + + return req +} + +func ToRequest(req *http.Request, opts ...Option) (io.ReadCloser, error) { options := &Options{ Timeout: 30000 * time.Millisecond, } @@ -39,13 +57,8 @@ func Req2GetReader(url string, method string, body io.Reader, head map[string]st for _, opt := range opts { opt(options) } - client := httpclient.NewClient(httpclient.WithHTTPTimeout(options.Timeout)) - // Create an http.Request instance - req, _ := http.NewRequest(method, url, body) - for k, v := range head { - req.Header.Set(k, v) - } + client := httpclient.NewClient(httpclient.WithHTTPTimeout(options.Timeout)) // Call the `Do` method, which has a similar interface to the `http.Do` method res, err := client.Do(req) if err != nil { @@ -53,6 +66,9 @@ func Req2GetReader(url string, method string, body io.Reader, head map[string]st } if res.StatusCode != http.StatusOK { + defer res.Body.Close() + body, _ := io.ReadAll(res.Body) + fmt.Println(string(body)) return nil, fmt.Errorf("status code is not 200: %d", res.StatusCode) } diff --git a/migrations/1724943694_collections_snapshot.go b/migrations/1724943694_collections_snapshot.go deleted file mode 100644 index c8dcd6f0..00000000 --- a/migrations/1724943694_collections_snapshot.go +++ /dev/null @@ -1,504 +0,0 @@ -package migrations - -import ( - "encoding/json" - - "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/daos" - m "github.com/pocketbase/pocketbase/migrations" - "github.com/pocketbase/pocketbase/models" -) - -func init() { - m.Register(func(db dbx.Builder) error { - jsonData := `[ - { - "id": "_pb_users_auth_", - "created": "2024-07-29 09:44:56.398Z", - "updated": "2024-08-22 14:02:20.500Z", - "name": "users", - "type": "auth", - "system": false, - "schema": [ - { - "system": false, - "id": "users_name", - "name": "name", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "users_avatar", - "name": "avatar", - "type": "file", - "required": false, - "presentable": false, - "unique": false, - "options": { - "mimeTypes": [ - "image/jpeg", - "image/png", - "image/svg+xml", - "image/gif", - "image/webp" - ], - "thumbs": null, - "maxSelect": 1, - "maxSize": 5242880, - "protected": false - } - } - ], - "indexes": [], - "listRule": "id = @request.auth.id", - "viewRule": "id = @request.auth.id", - "createRule": "", - "updateRule": "id = @request.auth.id", - "deleteRule": "id = @request.auth.id", - "options": { - "allowEmailAuth": true, - "allowOAuth2Auth": true, - "allowUsernameAuth": true, - "exceptEmailDomains": null, - "manageRule": null, - "minPasswordLength": 8, - "onlyEmailDomains": null, - "onlyVerified": false, - "requireEmail": false - } - }, - { - "id": "z3p974ainxjqlvs", - "created": "2024-07-29 10:02:48.334Z", - "updated": "2024-08-28 14:33:37.350Z", - "name": "domains", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "iuaerpl2", - "name": "domain", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "v98eebqq", - "name": "crontab", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "alc8e9ow", - "name": "access", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "4yzbv8urny5ja1e", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "topsc9bj", - "name": "certUrl", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "vixgq072", - "name": "certStableUrl", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "g3a3sza5", - "name": "privateKey", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "gr6iouny", - "name": "certificate", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "tk6vnrmn", - "name": "issuerCertificate", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "sjo6ibse", - "name": "csr", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "x03n1bkj", - "name": "expiredAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }, - { - "system": false, - "id": "srybpixz", - "name": "targetType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun-oss", - "aliyun-cdn", - "ssh", - "webhook", - "tencent-cdn" - ] - } - }, - { - "system": false, - "id": "xy7yk0mb", - "name": "targetAccess", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "4yzbv8urny5ja1e", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "6jqeyggw", - "name": "enabled", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "hdsjcchf", - "name": "deployed", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "aiya3rev", - "name": "rightnow", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "ixznmhzc", - "name": "lastDeployedAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - }, - { - "system": false, - "id": "ghtlkn5j", - "name": "lastDeployment", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "0a1o4e6sstp694f", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - } - ], - "indexes": [ - "CREATE UNIQUE INDEX ` + "`" + `idx_4ABO6EQ` + "`" + ` ON ` + "`" + `domains` + "`" + ` (` + "`" + `domain` + "`" + `)" - ], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "4yzbv8urny5ja1e", - "created": "2024-07-29 10:04:39.685Z", - "updated": "2024-08-28 10:29:40.862Z", - "name": "access", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "geeur58v", - "name": "name", - "type": "text", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "system": false, - "id": "iql7jpwx", - "name": "config", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "hwy7m03o", - "name": "configType", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "aliyun", - "tencent", - "ssh", - "webhook" - ] - } - }, - { - "system": false, - "id": "lr33hiwg", - "name": "deleted", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - } - ], - "indexes": [ - "CREATE UNIQUE INDEX ` + "`" + `idx_wkoST0j` + "`" + ` ON ` + "`" + `access` + "`" + ` (` + "`" + `name` + "`" + `)" - ], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - }, - { - "id": "0a1o4e6sstp694f", - "created": "2024-07-30 06:30:27.801Z", - "updated": "2024-08-22 14:02:20.500Z", - "name": "deployments", - "type": "base", - "system": false, - "schema": [ - { - "system": false, - "id": "farvlzk7", - "name": "domain", - "type": "relation", - "required": false, - "presentable": false, - "unique": false, - "options": { - "collectionId": "z3p974ainxjqlvs", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "system": false, - "id": "jx5f69i3", - "name": "log", - "type": "json", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSize": 2000000 - } - }, - { - "system": false, - "id": "qbxdtg9q", - "name": "phase", - "type": "select", - "required": false, - "presentable": false, - "unique": false, - "options": { - "maxSelect": 1, - "values": [ - "check", - "apply", - "deploy" - ] - } - }, - { - "system": false, - "id": "rglrp1hz", - "name": "phaseSuccess", - "type": "bool", - "required": false, - "presentable": false, - "unique": false, - "options": {} - }, - { - "system": false, - "id": "lt1g1blu", - "name": "deployedAt", - "type": "date", - "required": false, - "presentable": false, - "unique": false, - "options": { - "min": "", - "max": "" - } - } - ], - "indexes": [], - "listRule": null, - "viewRule": null, - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": {} - } - ]` - - collections := []*models.Collection{} - if err := json.Unmarshal([]byte(jsonData), &collections); err != nil { - return err - } - - return daos.New(db).ImportCollections(collections, true, nil) - }, func(db dbx.Builder) error { - return nil - }) -} diff --git a/migrations/1725258856_collections_snapshot.go b/migrations/1725503354_collections_snapshot.go similarity index 97% rename from migrations/1725258856_collections_snapshot.go rename to migrations/1725503354_collections_snapshot.go index 1f9ceceb..540947b1 100644 --- a/migrations/1725258856_collections_snapshot.go +++ b/migrations/1725503354_collections_snapshot.go @@ -15,7 +15,7 @@ func init() { { "id": "_pb_users_auth_", "created": "2024-07-29 09:44:56.398Z", - "updated": "2024-08-30 03:19:22.095Z", + "updated": "2024-09-02 14:02:40.191Z", "name": "users", "type": "auth", "system": false, @@ -78,7 +78,7 @@ func init() { { "id": "z3p974ainxjqlvs", "created": "2024-07-29 10:02:48.334Z", - "updated": "2024-08-30 03:19:22.096Z", + "updated": "2024-09-04 15:10:19.440Z", "name": "domains", "type": "base", "system": false, @@ -239,7 +239,8 @@ func init() { "aliyun-cdn", "ssh", "webhook", - "tencent-cdn" + "tencent-cdn", + "qiniu-cdn" ] } }, @@ -332,7 +333,7 @@ func init() { { "id": "4yzbv8urny5ja1e", "created": "2024-07-29 10:04:39.685Z", - "updated": "2024-09-02 06:05:30.075Z", + "updated": "2024-09-04 15:09:46.789Z", "name": "access", "type": "base", "system": false, @@ -378,7 +379,8 @@ func init() { "tencent", "ssh", "webhook", - "cloudflare" + "cloudflare", + "qiniu" ] } }, @@ -409,7 +411,7 @@ func init() { { "id": "0a1o4e6sstp694f", "created": "2024-07-30 06:30:27.801Z", - "updated": "2024-08-30 03:19:22.096Z", + "updated": "2024-09-02 14:02:40.191Z", "name": "deployments", "type": "base", "system": false, diff --git a/ui/dist/assets/index-CglXs5Ou.js b/ui/dist/assets/index-CMS-AsEx.js similarity index 64% rename from ui/dist/assets/index-CglXs5Ou.js rename to ui/dist/assets/index-CMS-AsEx.js index 8ba292e6..c3c2cae0 100644 --- a/ui/dist/assets/index-CglXs5Ou.js +++ b/ui/dist/assets/index-CMS-AsEx.js @@ -1,4 +1,4 @@ -var gT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var eU=gT((dU,Ou)=>{function vw(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var Pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yw={exports:{}},Od={},ww={exports:{}},Qe={};/** +var gT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tU=gT((fU,Ou)=>{function vx(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();var jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yx={exports:{}},Od={},xx={exports:{}},Je={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var gT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var eU=gT((dU,Ou) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Jl=Symbol.for("react.element"),vT=Symbol.for("react.portal"),yT=Symbol.for("react.fragment"),wT=Symbol.for("react.strict_mode"),xT=Symbol.for("react.profiler"),_T=Symbol.for("react.provider"),bT=Symbol.for("react.context"),ST=Symbol.for("react.forward_ref"),kT=Symbol.for("react.suspense"),CT=Symbol.for("react.memo"),ET=Symbol.for("react.lazy"),Uv=Symbol.iterator;function TT(e){return e===null||typeof e!="object"?null:(e=Uv&&e[Uv]||e["@@iterator"],typeof e=="function"?e:null)}var xw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_w=Object.assign,bw={};function ia(e,t,r){this.props=e,this.context=t,this.refs=bw,this.updater=r||xw}ia.prototype.isReactComponent={};ia.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ia.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sw(){}Sw.prototype=ia.prototype;function mm(e,t,r){this.props=e,this.context=t,this.refs=bw,this.updater=r||xw}var gm=mm.prototype=new Sw;gm.constructor=mm;_w(gm,ia.prototype);gm.isPureReactComponent=!0;var Vv=Array.isArray,kw=Object.prototype.hasOwnProperty,vm={current:null},Cw={key:!0,ref:!0,__self:!0,__source:!0};function Ew(e,t,r){var n,s={},o=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)kw.call(t,n)&&!Cw.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1()=>(t||e((t={exports:{}}).exports,t),t.exports);var eU=gT((dU,Ou) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var DT=y,OT=Symbol.for("react.element"),AT=Symbol.for("react.fragment"),MT=Object.prototype.hasOwnProperty,IT=DT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,LT={key:!0,ref:!0,__self:!0,__source:!0};function Rw(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)MT.call(t,n)&&!LT.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:OT,type:e,key:o,ref:i,props:s,_owner:IT.current}}Od.Fragment=AT;Od.jsx=Rw;Od.jsxs=Rw;yw.exports=Od;var u=yw.exports,Lh={},Pw={exports:{}},Fr={},jw={exports:{}},Dw={};/** + */var DT=y,OT=Symbol.for("react.element"),AT=Symbol.for("react.fragment"),MT=Object.prototype.hasOwnProperty,IT=DT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,LT={key:!0,ref:!0,__self:!0,__source:!0};function Rx(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)MT.call(t,n)&&!LT.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:OT,type:e,key:o,ref:i,props:s,_owner:IT.current}}Od.Fragment=AT;Od.jsx=Rx;Od.jsxs=Rx;yx.exports=Od;var u=yx.exports,Lh={},jx={exports:{}},Fr={},Px={exports:{}},Dx={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var gT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var eU=gT((dU,Ou) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(Z,I){var Q=Z.length;Z.push(I);e:for(;0>>1,V=Z[z];if(0>>1;zs(se,Q))Ees(fe,se)?(Z[z]=fe,Z[Ee]=Q,z=Ee):(Z[z]=se,Z[ne]=Q,z=ne);else if(Ees(fe,Q))Z[z]=fe,Z[Ee]=Q,z=Ee;else break e}}return I}function s(Z,I){var Q=Z.sortIndex-I.sortIndex;return Q!==0?Q:Z.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,w=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(Z){for(var I=r(c);I!==null;){if(I.callback===null)n(c);else if(I.startTime<=Z)n(c),I.sortIndex=I.expirationTime,t(l,I);else break;I=r(c)}}function C(Z){if(v=!1,_(Z),!w)if(r(l)!==null)w=!0,te(T);else{var I=r(c);I!==null&&$(C,I.startTime-Z)}}function T(Z,I){w=!1,v&&(v=!1,h(O),O=-1),m=!0;var Q=p;try{for(_(I),f=r(l);f!==null&&(!(f.expirationTime>I)||Z&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,p=f.priorityLevel;var V=z(f.expirationTime<=I);I=e.unstable_now(),typeof V=="function"?f.callback=V:f===r(l)&&n(l),_(I)}else n(l);f=r(l)}if(f!==null)var de=!0;else{var ne=r(c);ne!==null&&$(C,ne.startTime-I),de=!1}return de}finally{f=null,p=Q,m=!1}}var E=!1,P=null,O=-1,j=5,L=-1;function q(){return!(e.unstable_now()-LZ||125z?(Z.sortIndex=Q,t(c,Z),r(l)===null&&Z===r(c)&&(v?(h(O),O=-1):v=!0,$(C,Q-z))):(Z.sortIndex=V,t(l,Z),w||m||(w=!0,te(T))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var I=p;return function(){var Q=p;p=I;try{return Z.apply(this,arguments)}finally{p=Q}}}})(Dw);jw.exports=Dw;var FT=jw.exports;/** + */(function(e){function t(Z,I){var Q=Z.length;Z.push(I);e:for(;0>>1,V=Z[z];if(0>>1;zs(se,Q))Ees(fe,se)?(Z[z]=fe,Z[Ee]=Q,z=Ee):(Z[z]=se,Z[ne]=Q,z=ne);else if(Ees(fe,Q))Z[z]=fe,Z[Ee]=Q,z=Ee;else break e}}return I}function s(Z,I){var Q=Z.sortIndex-I.sortIndex;return Q!==0?Q:Z.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,x=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(Z){for(var I=r(c);I!==null;){if(I.callback===null)n(c);else if(I.startTime<=Z)n(c),I.sortIndex=I.expirationTime,t(l,I);else break;I=r(c)}}function C(Z){if(v=!1,_(Z),!x)if(r(l)!==null)x=!0,te(T);else{var I=r(c);I!==null&&$(C,I.startTime-Z)}}function T(Z,I){x=!1,v&&(v=!1,h(O),O=-1),m=!0;var Q=p;try{for(_(I),f=r(l);f!==null&&(!(f.expirationTime>I)||Z&&!q());){var z=f.callback;if(typeof z=="function"){f.callback=null,p=f.priorityLevel;var V=z(f.expirationTime<=I);I=e.unstable_now(),typeof V=="function"?f.callback=V:f===r(l)&&n(l),_(I)}else n(l);f=r(l)}if(f!==null)var de=!0;else{var ne=r(c);ne!==null&&$(C,ne.startTime-I),de=!1}return de}finally{f=null,p=Q,m=!1}}var E=!1,j=null,O=-1,P=5,L=-1;function q(){return!(e.unstable_now()-LZ||125z?(Z.sortIndex=Q,t(c,Z),r(l)===null&&Z===r(c)&&(v?(h(O),O=-1):v=!0,$(C,Q-z))):(Z.sortIndex=V,t(l,Z),x||m||(x=!0,te(T))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var I=p;return function(){var Q=p;p=I;try{return Z.apply(this,arguments)}finally{p=Q}}}})(Dx);Px.exports=Dx;var FT=Px.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var gT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var eU=gT((dU,Ou) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zT=y,Lr=FT;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=Object.prototype.hasOwnProperty,UT=/^[: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]*$/,$v={},Bv={};function VT(e){return Fh.call(Bv,e)?!0:Fh.call($v,e)?!1:UT.test(e)?Bv[e]=!0:($v[e]=!0,!1)}function WT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $T(e,t,r,n){if(t===null||typeof t>"u"||WT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gr(e,t,r,n,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new gr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rr[t]=new gr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new gr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new gr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rr[e]=new gr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new gr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new gr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new gr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new gr(e,5,!1,e.toLowerCase(),null,!1,!1)});var wm=/[\-:]([a-z])/g;function xm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wm,xm);rr[t]=new gr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wm,xm);rr[t]=new gr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wm,xm);rr[t]=new gr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new gr(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new gr(e,1,!1,e.toLowerCase(),null,!0,!0)});function _m(e,t,r,n){var s=rr.hasOwnProperty(t)?rr[t]:null;(s!==null?s.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=Object.prototype.hasOwnProperty,UT=/^[: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]*$/,$v={},Bv={};function VT(e){return Fh.call(Bv,e)?!0:Fh.call($v,e)?!1:UT.test(e)?Bv[e]=!0:($v[e]=!0,!1)}function WT(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $T(e,t,r,n){if(t===null||typeof t>"u"||WT(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gr(e,t,r,n,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new gr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rr[t]=new gr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new gr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new gr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rr[e]=new gr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new gr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new gr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new gr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new gr(e,5,!1,e.toLowerCase(),null,!1,!1)});var xm=/[\-:]([a-z])/g;function wm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xm,wm);rr[t]=new gr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xm,wm);rr[t]=new gr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xm,wm);rr[t]=new gr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new gr(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new gr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new gr(e,1,!1,e.toLowerCase(),null,!0,!0)});function _m(e,t,r,n){var s=rr.hasOwnProperty(t)?rr[t]:null;(s!==null?s.type!==0:n||!(2a||s[i]!==o[a]){var l=` -`+s[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{$f=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?La(e):""}function BT(e){switch(e.tag){case 5:return La(e.type);case 16:return La("Lazy");case 13:return La("Suspense");case 19:return La("SuspenseList");case 0:case 2:case 15:return e=Bf(e.type,!1),e;case 11:return e=Bf(e.type.render,!1),e;case 1:return e=Bf(e.type,!0),e;default:return""}}function Wh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case vi:return"Fragment";case gi:return"Portal";case zh:return"Profiler";case bm:return"StrictMode";case Uh:return"Suspense";case Vh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mw:return(e.displayName||"Context")+".Consumer";case Aw:return(e._context.displayName||"Context")+".Provider";case Sm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:Wh(e.type)||"Memo";case Ms:t=e._payload,e=e._init;try{return Wh(e(t))}catch{}}return null}function HT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Wh(t);case 8:return t===bm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function eo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YT(e){var t=Lw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oc(e){e._valueTracker||(e._valueTracker=YT(e))}function Fw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Lw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Au(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $h(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Yv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=eo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zw(e,t){t=t.checked,t!=null&&_m(e,"checked",t,!1)}function Bh(e,t){zw(e,t);var r=eo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Hh(e,t.type,eo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zv(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Hh(e,t,r){(t!=="number"||Au(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fa=Array.isArray;function Di(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Ac.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ya={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ZT=["Webkit","ms","Moz","O"];Object.keys(Ya).forEach(function(e){ZT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ya[t]=Ya[e]})});function $w(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ya.hasOwnProperty(e)&&Ya[e]?(""+t).trim():t+"px"}function Bw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=$w(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var GT=At({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gh(e,t){if(t){if(GT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Kh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 qh=null;function Cm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xh=null,Oi=null,Ai=null;function qv(e){if(e=rc(e)){if(typeof Xh!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Fd(t),Xh(e.stateNode,e.type,t))}}function Hw(e){Oi?Ai?Ai.push(e):Ai=[e]:Oi=e}function Yw(){if(Oi){var e=Oi,t=Ai;if(Ai=Oi=null,qv(e),t)for(e=0;e>>=0,e===0?32:31-(oN(e)/iN|0)|0}var Mc=64,Ic=4194304;function za(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=za(a):(o&=i,o!==0&&(n=za(o)))}else i=r&~s,i!==0?n=za(i):o!==0&&(n=za(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function ec(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=r}function uN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Ga),oy=" ",iy=!1;function fx(e,t){switch(e){case"keyup":return FN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yi=!1;function UN(e,t){switch(e){case"compositionend":return hx(t);case"keypress":return t.which!==32?null:(iy=!0,oy);case"textInput":return e=t.data,e===oy&&iy?null:e;default:return null}}function VN(e,t){if(yi)return e==="compositionend"||!Om&&fx(e,t)?(e=ux(),du=Pm=Us=null,yi=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=uy(r)}}function vx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yx(){for(var e=window,t=Au();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Au(e.document)}return t}function Am(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")}function qN(e){var t=yx(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&vx(r.ownerDocument.documentElement,r)){if(n!==null&&Am(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=dy(r,o);var i=dy(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,wi=null,np=null,qa=null,sp=!1;function fy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;sp||wi==null||wi!==Au(n)||(n=wi,"selectionStart"in n&&Am(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qa&&vl(qa,n)||(qa=n,n=Vu(np,"onSelect"),0bi||(e.current=up[bi],up[bi]=null,bi--)}function vt(e,t){bi++,up[bi]=e.current,e.current=t}var to={},lr=fo(to),br=fo(!1),Lo=to;function Gi(e,t){var r=e.type.contextTypes;if(!r)return to;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Sr(e){return e=e.childContextTypes,e!=null}function $u(){_t(br),_t(lr)}function wy(e,t,r){if(lr.current!==to)throw Error(oe(168));vt(lr,t),vt(br,r)}function Tx(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(oe(108,HT(e)||"Unknown",s));return At({},r,n)}function Bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Lo=lr.current,vt(lr,e),vt(br,br.current),!0}function xy(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=Tx(e,t,Lo),n.__reactInternalMemoizedMergedChildContext=e,_t(br),_t(lr),vt(lr,e)):_t(br),vt(br,r)}var rs=null,zd=!1,sh=!1;function Nx(e){rs===null?rs=[e]:rs.push(e)}function lR(e){zd=!0,Nx(e)}function ho(){if(!sh&&rs!==null){sh=!0;var e=0,t=ft;try{var r=rs;for(ft=1;e>=i,s-=i,ns=1<<32-un(t)+s|r<O?(j=P,P=null):j=P.sibling;var L=p(h,P,_[O],C);if(L===null){P===null&&(P=j);break}e&&P&&L.alternate===null&&t(h,P),g=o(L,g,O),E===null?T=L:E.sibling=L,E=L,P=j}if(O===_.length)return r(h,P),Tt&&_o(h,O),T;if(P===null){for(;O<_.length;O++)P=f(h,_[O],C),P!==null&&(g=o(P,g,O),E===null?T=P:E.sibling=P,E=P);return Tt&&_o(h,O),T}for(P=n(h,P);O<_.length;O++)j=m(P,h,O,_[O],C),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?O:j.key),g=o(j,g,O),E===null?T=j:E.sibling=j,E=j);return e&&P.forEach(function(q){return t(h,q)}),Tt&&_o(h,O),T}function v(h,g,_,C){var T=_a(_);if(typeof T!="function")throw Error(oe(150));if(_=T.call(_),_==null)throw Error(oe(151));for(var E=T=null,P=g,O=g=0,j=null,L=_.next();P!==null&&!L.done;O++,L=_.next()){P.index>O?(j=P,P=null):j=P.sibling;var q=p(h,P,L.value,C);if(q===null){P===null&&(P=j);break}e&&P&&q.alternate===null&&t(h,P),g=o(q,g,O),E===null?T=q:E.sibling=q,E=q,P=j}if(L.done)return r(h,P),Tt&&_o(h,O),T;if(P===null){for(;!L.done;O++,L=_.next())L=f(h,L.value,C),L!==null&&(g=o(L,g,O),E===null?T=L:E.sibling=L,E=L);return Tt&&_o(h,O),T}for(P=n(h,P);!L.done;O++,L=_.next())L=m(P,h,O,L.value,C),L!==null&&(e&&L.alternate!==null&&P.delete(L.key===null?O:L.key),g=o(L,g,O),E===null?T=L:E.sibling=L,E=L);return e&&P.forEach(function(N){return t(h,N)}),Tt&&_o(h,O),T}function x(h,g,_,C){if(typeof _=="object"&&_!==null&&_.type===vi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Dc:e:{for(var T=_.key,E=g;E!==null;){if(E.key===T){if(T=_.type,T===vi){if(E.tag===7){r(h,E.sibling),g=s(E,_.props.children),g.return=h,h=g;break e}}else if(E.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Ms&&Sy(T)===E.type){r(h,E.sibling),g=s(E,_.props),g.ref=Ea(h,E,_),g.return=h,h=g;break e}r(h,E);break}else t(h,E);E=E.sibling}_.type===vi?(g=Oo(_.props.children,h.mode,C,_.key),g.return=h,h=g):(C=wu(_.type,_.key,_.props,null,h.mode,C),C.ref=Ea(h,g,_),C.return=h,h=C)}return i(h);case gi:e:{for(E=_.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===_.containerInfo&&g.stateNode.implementation===_.implementation){r(h,g.sibling),g=s(g,_.children||[]),g.return=h,h=g;break e}else{r(h,g);break}else t(h,g);g=g.sibling}g=fh(_,h.mode,C),g.return=h,h=g}return i(h);case Ms:return E=_._init,x(h,g,E(_._payload),C)}if(Fa(_))return w(h,g,_,C);if(_a(_))return v(h,g,_,C);$c(h,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,g!==null&&g.tag===6?(r(h,g.sibling),g=s(g,_),g.return=h,h=g):(r(h,g),g=dh(_,h.mode,C),g.return=h,h=g),i(h)):r(h,g)}return x}var qi=Dx(!0),Ox=Dx(!1),Zu=fo(null),Gu=null,Ci=null,Fm=null;function zm(){Fm=Ci=Gu=null}function Um(e){var t=Zu.current;_t(Zu),e._currentValue=t}function hp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ii(e,t){Gu=e,Fm=Ci=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_r=!0),e.firstContext=null)}function Kr(e){var t=e._currentValue;if(Fm!==e)if(e={context:e,memoizedValue:t,next:null},Ci===null){if(Gu===null)throw Error(oe(308));Ci=e,Gu.dependencies={lanes:0,firstContext:e}}else Ci=Ci.next=e;return t}var Co=null;function Vm(e){Co===null?Co=[e]:Co.push(e)}function Ax(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Vm(t)):(r.next=s.next,s.next=r),t.interleaved=r,hs(e,n)}function hs(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Is=!1;function Wm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function as(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ks(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,it&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,hs(e,r)}return s=n.interleaved,s===null?(t.next=t,Vm(n)):(t.next=s.next,s.next=t),n.interleaved=t,hs(e,r)}function hu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}function ky(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ku(e,t,r,n){var s=e.updateQueue;Is=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,d=c=l=null,a=o;do{var p=a.lane,m=a.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,v=a;switch(p=t,m=r,v.tag){case 1:if(w=v.payload,typeof w=="function"){f=w.call(m,f,p);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,p=typeof w=="function"?w.call(m,f,p):w,p==null)break e;f=At({},f,p);break e;case 2:Is=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=f):d=d.next=m,i|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Uo|=i,e.lanes=i,e.memoizedState=f}}function Cy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=ih.transition;ih.transition={};try{e(!1),t()}finally{ft=r,ih.transition=n}}function Qx(){return qr().memoizedState}function fR(e,t,r){var n=Xs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Jx(e))e_(t,r);else if(r=Ax(e,t,r,n),r!==null){var s=hr();dn(r,e,n,s),t_(r,t,n)}}function hR(e,t,r){var n=Xs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Jx(e))e_(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,hn(a,i)){var l=t.interleaved;l===null?(s.next=s,Vm(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Ax(e,t,s,n),r!==null&&(s=hr(),dn(r,e,n,s),t_(r,t,n))}}function Jx(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function e_(e,t){Xa=Xu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function t_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}var Qu={readContext:Kr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},pR={readContext:Kr,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:Kr,useEffect:Ty,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mu(4194308,4,Zx.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mu(4194308,4,e,t)},useInsertionEffect:function(e,t){return mu(4,2,e,t)},useMemo:function(e,t){var r=kn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=kn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=fR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:Ey,useDebugValue:qm,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Ey(!1),t=e[0];return e=dR.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=kn();if(Tt){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),Qt===null)throw Error(oe(349));zo&30||zx(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Ty(Vx.bind(null,n,o,e),[e]),n.flags|=2048,Cl(9,Ux.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=kn(),t=Qt.identifierPrefix;if(Tt){var r=ss,n=ns;r=(n&~(1<<32-un(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Sl++,0")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{$f=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?za(e):""}function BT(e){switch(e.tag){case 5:return za(e.type);case 16:return za("Lazy");case 13:return za("Suspense");case 19:return za("SuspenseList");case 0:case 2:case 15:return e=Bf(e.type,!1),e;case 11:return e=Bf(e.type.render,!1),e;case 1:return e=Bf(e.type,!0),e;default:return""}}function Wh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case vi:return"Fragment";case gi:return"Portal";case zh:return"Profiler";case bm:return"StrictMode";case Uh:return"Suspense";case Vh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mx:return(e.displayName||"Context")+".Consumer";case Ax:return(e._context.displayName||"Context")+".Provider";case Sm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:Wh(e.type)||"Memo";case Fs:t=e._payload,e=e._init;try{return Wh(e(t))}catch{}}return null}function HT(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Wh(t);case 8:return t===bm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function no(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YT(e){var t=Lx(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oc(e){e._valueTracker||(e._valueTracker=YT(e))}function Fx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Lx(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Au(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $h(e,t){var r=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Yv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=no(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zx(e,t){t=t.checked,t!=null&&_m(e,"checked",t,!1)}function Bh(e,t){zx(e,t);var r=no(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Hh(e,t.type,no(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zv(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Hh(e,t,r){(t!=="number"||Au(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ua=Array.isArray;function Di(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Ac.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ka={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ZT=["Webkit","ms","Moz","O"];Object.keys(Ka).forEach(function(e){ZT.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ka[t]=Ka[e]})});function $x(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ka.hasOwnProperty(e)&&Ka[e]?(""+t).trim():t+"px"}function Bx(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=$x(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var KT=At({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Kh(e,t){if(t){if(KT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Gh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 qh=null;function Cm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xh=null,Oi=null,Ai=null;function qv(e){if(e=sc(e)){if(typeof Xh!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Fd(t),Xh(e.stateNode,e.type,t))}}function Hx(e){Oi?Ai?Ai.push(e):Ai=[e]:Oi=e}function Yx(){if(Oi){var e=Oi,t=Ai;if(Ai=Oi=null,qv(e),t)for(e=0;e>>=0,e===0?32:31-(oN(e)/iN|0)|0}var Mc=64,Ic=4194304;function Va(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=Va(a):(o&=i,o!==0&&(n=Va(o)))}else i=r&~s,i!==0?n=Va(i):o!==0&&(n=Va(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function rc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=r}function uN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=qa),oy=" ",iy=!1;function fw(e,t){switch(e){case"keyup":return FN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yi=!1;function UN(e,t){switch(e){case"compositionend":return hw(t);case"keypress":return t.which!==32?null:(iy=!0,oy);case"textInput":return e=t.data,e===oy&&iy?null:e;default:return null}}function VN(e,t){if(yi)return e==="compositionend"||!Om&&fw(e,t)?(e=uw(),du=jm=$s=null,yi=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=uy(r)}}function vw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yw(){for(var e=window,t=Au();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Au(e.document)}return t}function Am(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")}function qN(e){var t=yw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&vw(r.ownerDocument.documentElement,r)){if(n!==null&&Am(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=dy(r,o);var i=dy(r,n);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,xi=null,np=null,Qa=null,sp=!1;function fy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;sp||xi==null||xi!==Au(n)||(n=xi,"selectionStart"in n&&Am(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qa&&xl(Qa,n)||(Qa=n,n=Vu(np,"onSelect"),0bi||(e.current=up[bi],up[bi]=null,bi--)}function yt(e,t){bi++,up[bi]=e.current,e.current=t}var so={},lr=mo(so),br=mo(!1),Fo=so;function Ki(e,t){var r=e.type.contextTypes;if(!r)return so;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Sr(e){return e=e.childContextTypes,e!=null}function $u(){_t(br),_t(lr)}function xy(e,t,r){if(lr.current!==so)throw Error(oe(168));yt(lr,t),yt(br,r)}function Tw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(oe(108,HT(e)||"Unknown",s));return At({},r,n)}function Bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||so,Fo=lr.current,yt(lr,e),yt(br,br.current),!0}function wy(e,t,r){var n=e.stateNode;if(!n)throw Error(oe(169));r?(e=Tw(e,t,Fo),n.__reactInternalMemoizedMergedChildContext=e,_t(br),_t(lr),yt(lr,e)):_t(br),yt(br,r)}var rs=null,zd=!1,sh=!1;function Nw(e){rs===null?rs=[e]:rs.push(e)}function lR(e){zd=!0,Nw(e)}function go(){if(!sh&&rs!==null){sh=!0;var e=0,t=ft;try{var r=rs;for(ft=1;e>=i,s-=i,ns=1<<32-un(t)+s|r<O?(P=j,j=null):P=j.sibling;var L=p(h,j,_[O],C);if(L===null){j===null&&(j=P);break}e&&j&&L.alternate===null&&t(h,j),g=o(L,g,O),E===null?T=L:E.sibling=L,E=L,j=P}if(O===_.length)return r(h,j),Tt&&bo(h,O),T;if(j===null){for(;O<_.length;O++)j=f(h,_[O],C),j!==null&&(g=o(j,g,O),E===null?T=j:E.sibling=j,E=j);return Tt&&bo(h,O),T}for(j=n(h,j);O<_.length;O++)P=m(j,h,O,_[O],C),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?O:P.key),g=o(P,g,O),E===null?T=P:E.sibling=P,E=P);return e&&j.forEach(function(q){return t(h,q)}),Tt&&bo(h,O),T}function v(h,g,_,C){var T=Sa(_);if(typeof T!="function")throw Error(oe(150));if(_=T.call(_),_==null)throw Error(oe(151));for(var E=T=null,j=g,O=g=0,P=null,L=_.next();j!==null&&!L.done;O++,L=_.next()){j.index>O?(P=j,j=null):P=j.sibling;var q=p(h,j,L.value,C);if(q===null){j===null&&(j=P);break}e&&j&&q.alternate===null&&t(h,j),g=o(q,g,O),E===null?T=q:E.sibling=q,E=q,j=P}if(L.done)return r(h,j),Tt&&bo(h,O),T;if(j===null){for(;!L.done;O++,L=_.next())L=f(h,L.value,C),L!==null&&(g=o(L,g,O),E===null?T=L:E.sibling=L,E=L);return Tt&&bo(h,O),T}for(j=n(h,j);!L.done;O++,L=_.next())L=m(j,h,O,L.value,C),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?O:L.key),g=o(L,g,O),E===null?T=L:E.sibling=L,E=L);return e&&j.forEach(function(N){return t(h,N)}),Tt&&bo(h,O),T}function w(h,g,_,C){if(typeof _=="object"&&_!==null&&_.type===vi&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Dc:e:{for(var T=_.key,E=g;E!==null;){if(E.key===T){if(T=_.type,T===vi){if(E.tag===7){r(h,E.sibling),g=s(E,_.props.children),g.return=h,h=g;break e}}else if(E.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Fs&&Sy(T)===E.type){r(h,E.sibling),g=s(E,_.props),g.ref=Na(h,E,_),g.return=h,h=g;break e}r(h,E);break}else t(h,E);E=E.sibling}_.type===vi?(g=Ao(_.props.children,h.mode,C,_.key),g.return=h,h=g):(C=xu(_.type,_.key,_.props,null,h.mode,C),C.ref=Na(h,g,_),C.return=h,h=C)}return i(h);case gi:e:{for(E=_.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===_.containerInfo&&g.stateNode.implementation===_.implementation){r(h,g.sibling),g=s(g,_.children||[]),g.return=h,h=g;break e}else{r(h,g);break}else t(h,g);g=g.sibling}g=fh(_,h.mode,C),g.return=h,h=g}return i(h);case Fs:return E=_._init,w(h,g,E(_._payload),C)}if(Ua(_))return x(h,g,_,C);if(Sa(_))return v(h,g,_,C);$c(h,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,g!==null&&g.tag===6?(r(h,g.sibling),g=s(g,_),g.return=h,h=g):(r(h,g),g=dh(_,h.mode,C),g.return=h,h=g),i(h)):r(h,g)}return w}var qi=Dw(!0),Ow=Dw(!1),Zu=mo(null),Ku=null,Ci=null,Fm=null;function zm(){Fm=Ci=Ku=null}function Um(e){var t=Zu.current;_t(Zu),e._currentValue=t}function hp(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ii(e,t){Ku=e,Fm=Ci=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_r=!0),e.firstContext=null)}function Gr(e){var t=e._currentValue;if(Fm!==e)if(e={context:e,memoizedValue:t,next:null},Ci===null){if(Ku===null)throw Error(oe(308));Ci=e,Ku.dependencies={lanes:0,firstContext:e}}else Ci=Ci.next=e;return t}var Eo=null;function Vm(e){Eo===null?Eo=[e]:Eo.push(e)}function Aw(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Vm(t)):(r.next=s.next,s.next=r),t.interleaved=r,hs(e,n)}function hs(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var zs=!1;function Wm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function as(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,it&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,hs(e,r)}return s=n.interleaved,s===null?(t.next=t,Vm(n)):(t.next=s.next,s.next=t),n.interleaved=t,hs(e,r)}function hu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}function ky(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Gu(e,t,r,n){var s=e.updateQueue;zs=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,d=c=l=null,a=o;do{var p=a.lane,m=a.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,v=a;switch(p=t,m=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){f=x.call(m,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,p=typeof x=="function"?x.call(m,f,p):x,p==null)break e;f=At({},f,p);break e;case 2:zs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=f):d=d.next=m,i|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Vo|=i,e.lanes=i,e.memoizedState=f}}function Cy(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=ih.transition;ih.transition={};try{e(!1),t()}finally{ft=r,ih.transition=n}}function Qw(){return qr().memoizedState}function fR(e,t,r){var n=eo(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Jw(e))e_(t,r);else if(r=Aw(e,t,r,n),r!==null){var s=hr();dn(r,e,n,s),t_(r,t,n)}}function hR(e,t,r){var n=eo(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Jw(e))e_(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,r);if(s.hasEagerState=!0,s.eagerState=a,hn(a,i)){var l=t.interleaved;l===null?(s.next=s,Vm(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Aw(e,t,s,n),r!==null&&(s=hr(),dn(r,e,n,s),t_(r,t,n))}}function Jw(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function e_(e,t){Ja=Xu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function t_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tm(e,r)}}var Qu={readContext:Gr,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},pR={readContext:Gr,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:Gr,useEffect:Ty,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mu(4194308,4,Zw.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mu(4194308,4,e,t)},useInsertionEffect:function(e,t){return mu(4,2,e,t)},useMemo:function(e,t){var r=kn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=kn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=fR.bind(null,Ot,e),[n.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:Ey,useDebugValue:qm,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=Ey(!1),t=e[0];return e=dR.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ot,s=kn();if(Tt){if(r===void 0)throw Error(oe(407));r=r()}else{if(r=t(),Qt===null)throw Error(oe(349));Uo&30||zw(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Ty(Vw.bind(null,n,o,e),[e]),n.flags|=2048,Tl(9,Uw.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=kn(),t=Qt.identifierPrefix;if(Tt){var r=ss,n=ns;r=(n&~(1<<32-un(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Cl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Cn]=t,e[xl]=n,d_(e,t,!1,!1),t.stateNode=e;e:{switch(i=Kh(r,n),r){case"dialog":wt("cancel",e),wt("close",e),s=n;break;case"iframe":case"object":case"embed":wt("load",e),s=n;break;case"video":case"audio":for(s=0;sJi&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304)}else{if(!n)if(e=qu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ta(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return or(t),null}else 2*zt()-o.renderingStartTime>Ji&&r!==1073741824&&(t.flags|=128,n=!0,Ta(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zt(),t.sibling=null,r=Pt.current,vt(Pt,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return rg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Rr&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function bR(e,t){switch(Im(t),t.tag){case 1:return Sr(t.type)&&$u(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(),_t(br),_t(lr),Hm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bm(t),null;case 13:if(_t(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Pt),null;case 4:return Xi(),null;case 10:return Um(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var Hc=!1,ir=!1,SR=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Ei(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){It(e,t,n)}else r.current=null}function bp(e,t,r){try{r()}catch(n){It(e,t,n)}}var Fy=!1;function kR(e,t){if(op=zu,e=yx(),Am(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(l=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++c===s&&(a=i),p===o&&++d===n&&(l=i),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ip={focusedElem:e,selectionRange:r},zu=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,x=w.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:rn(t.type,v),x);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(C){It(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return w=Fy,Fy=!1,w}function Qa(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&bp(t,r,o)}s=s.next}while(s!==n)}}function Wd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Sp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function p_(e){var t=e.alternate;t!==null&&(e.alternate=null,p_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[xl],delete t[cp],delete t[iR],delete t[aR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function m_(e){return e.tag===5||e.tag===3||e.tag===4}function zy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m_(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Wu));else if(n!==4&&(e=e.child,e!==null))for(kp(e,t,r),e=e.sibling;e!==null;)kp(e,t,r),e=e.sibling}function Cp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cp(e,t,r),e=e.sibling;e!==null;)Cp(e,t,r),e=e.sibling}var er=null,nn=!1;function Ps(e,t,r){for(r=r.child;r!==null;)g_(e,t,r),r=r.sibling}function g_(e,t,r){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(Ad,r)}catch{}switch(r.tag){case 5:ir||Ei(r,t);case 6:var n=er,s=nn;er=null,Ps(e,t,r),er=n,nn=s,er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?nh(e.parentNode,r):e.nodeType===1&&nh(e,r),ml(e)):nh(er,r.stateNode));break;case 4:n=er,s=nn,er=r.stateNode.containerInfo,nn=!0,Ps(e,t,r),er=n,nn=s;break;case 0:case 11:case 14:case 15:if(!ir&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&bp(r,t,i),s=s.next}while(s!==n)}Ps(e,t,r);break;case 1:if(!ir&&(Ei(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){It(r,t,a)}Ps(e,t,r);break;case 21:Ps(e,t,r);break;case 22:r.mode&1?(ir=(n=ir)||r.memoizedState!==null,Ps(e,t,r),ir=n):Ps(e,t,r);break;default:Ps(e,t,r)}}function Uy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new SR),t.forEach(function(n){var s=OR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=zt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ER(n/1960))-n,10e?16:e,Vs===null)var n=!1;else{if(e=Vs,Vs=null,td=0,it&6)throw Error(oe(331));var s=it;for(it|=4,_e=e.current;_e!==null;){var o=_e,i=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lzt()-eg?Do(e,0):Jm|=r),kr(e,t)}function k_(e,t){t===0&&(e.mode&1?(t=Ic,Ic<<=1,!(Ic&130023424)&&(Ic=4194304)):t=1);var r=hr();e=hs(e,t),e!==null&&(ec(e,t,r),kr(e,r))}function DR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),k_(e,r)}function OR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(t),k_(e,r)}var C_;C_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)_r=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _r=!1,xR(e,t,r);_r=!!(e.flags&131072)}else _r=!1,Tt&&t.flags&1048576&&Rx(t,Yu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;gu(e,t),e=t.pendingProps;var s=Gi(t,lr.current);Ii(t,r),s=Zm(null,t,n,e,s,r);var o=Gm();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Sr(n)?(o=!0,Bu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wm(t),s.updater=Vd,t.stateNode=s,s._reactInternals=t,mp(t,n,e,r),t=yp(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&Mm(t),dr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(gu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=MR(n),e=rn(n,e),s){case 0:t=vp(null,t,n,e,r);break e;case 1:t=My(null,t,n,e,r);break e;case 11:t=Oy(null,t,n,e,r);break e;case 14:t=Ay(null,t,n,rn(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),vp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),My(e,t,n,s,r);case 3:e:{if(l_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,Mx(e,t),Ku(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Qi(Error(oe(423)),t),t=Iy(e,t,n,r,s);break e}else if(n!==s){s=Qi(Error(oe(424)),t),t=Iy(e,t,n,r,s);break e}else for(Dr=Gs(t.stateNode.containerInfo.firstChild),Or=t,Tt=!0,on=null,r=Ox(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ki(),n===s){t=ps(e,t,r);break e}dr(e,t,n,r)}t=t.child}return t;case 5:return Ix(t),e===null&&fp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,ap(n,s)?i=null:o!==null&&ap(n,o)&&(t.flags|=32),a_(e,t),dr(e,t,i,r),t.child;case 6:return e===null&&fp(t),null;case 13:return c_(e,t,r);case 4:return $m(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=qi(t,null,n,r):dr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),Oy(e,t,n,s,r);case 7:return dr(e,t,t.pendingProps,r),t.child;case 8:return dr(e,t,t.pendingProps.children,r),t.child;case 12:return dr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,vt(Zu,n._currentValue),n._currentValue=i,o!==null)if(hn(o.value,i)){if(o.children===s.children&&!br.current){t=ps(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=as(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),hp(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(oe(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),hp(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}dr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Ii(t,r),s=Kr(s),n=n(s),t.flags|=1,dr(e,t,n,r),t.child;case 14:return n=t.type,s=rn(n,t.pendingProps),s=rn(n.type,s),Ay(e,t,n,s,r);case 15:return o_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),gu(e,t),t.tag=1,Sr(n)?(e=!0,Bu(t)):e=!1,Ii(t,r),r_(t,n,s),mp(t,n,s,r),yp(null,t,n,!0,e,r);case 19:return u_(e,t,r);case 22:return i_(e,t,r)}throw Error(oe(156,t.tag))};function E_(e,t){return Jw(e,t)}function AR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,r,n){return new AR(e,t,r,n)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function MR(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sm)return 11;if(e===km)return 14}return 2}function Qs(e,t){var r=e.alternate;return r===null?(r=Yr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function wu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")sg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case vi:return Oo(r.children,s,o,t);case bm:i=8,s|=8;break;case zh:return e=Yr(12,r,t,s|2),e.elementType=zh,e.lanes=o,e;case Uh:return e=Yr(13,r,t,s),e.elementType=Uh,e.lanes=o,e;case Vh:return e=Yr(19,r,t,s),e.elementType=Vh,e.lanes=o,e;case Iw:return Bd(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Aw:i=10;break e;case Mw:i=9;break e;case Sm:i=11;break e;case km:i=14;break e;case Ms:i=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Yr(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Oo(e,t,r,n){return e=Yr(7,e,n,t),e.lanes=r,e}function Bd(e,t,r,n){return e=Yr(22,e,n,t),e.elementType=Iw,e.lanes=r,e.stateNode={isHidden:!1},e}function dh(e,t,r){return e=Yr(6,e,null,t),e.lanes=r,e}function fh(e,t,r){return t=Yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function IR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yf(0),this.expirationTimes=Yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function og(e,t,r,n,s,o,i,a,l){return e=new IR(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Yr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wm(o),e}function LR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P_)}catch(e){console.error(e)}}P_(),Pw.exports=Fr;var _s=Pw.exports;const j_=pm(_s),WR=vw({__proto__:null,default:j_},[_s]);var Gy=_s;Lh.createRoot=Gy.createRoot,Lh.hydrateRoot=Gy.hydrateRoot;/** +`+o.stack}return{value:e,source:t,stack:s,digest:null}}function ch(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function gp(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var vR=typeof WeakMap=="function"?WeakMap:Map;function n_(e,t,r){r=as(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ed||(ed=!0,Ep=n),gp(e,t)},r}function s_(e,t,r){r=as(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){gp(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){gp(e,t),typeof n!="function"&&(Js===null?Js=new Set([this]):Js.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function jy(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new vR;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=PR.bind(null,e,t,r),t.then(e,e))}function Py(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dy(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=as(-1,1),t.tag=2,Qs(r,t,1))),r.lanes|=1),e)}var yR=ws.ReactCurrentOwner,_r=!1;function dr(e,t,r,n){t.child=e===null?Ow(t,null,r,n):qi(t,e.child,r,n)}function Oy(e,t,r,n,s){r=r.render;var o=t.ref;return Ii(t,s),n=Zm(e,t,r,n,o,s),r=Km(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ps(e,t,s)):(Tt&&r&&Mm(t),t.flags|=1,dr(e,t,n,s),t.child)}function Ay(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!sg(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,o_(e,t,o,n,s)):(e=xu(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(r=r.compare,r=r!==null?r:xl,r(i,n)&&e.ref===t.ref)return ps(e,t,s)}return t.flags|=1,e=to(o,n),e.ref=t.ref,e.return=t,t.child=e}function o_(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(xl(o,n)&&e.ref===t.ref)if(_r=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(_r=!0);else return t.lanes=e.lanes,ps(e,t,s)}return vp(e,t,r,n,s)}function i_(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(Ti,Rr),Rr|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,yt(Ti,Rr),Rr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,yt(Ti,Rr),Rr|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,yt(Ti,Rr),Rr|=n;return dr(e,t,s,r),t.child}function a_(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function vp(e,t,r,n,s){var o=Sr(r)?Fo:lr.current;return o=Ki(t,o),Ii(t,s),r=Zm(e,t,r,n,o,s),n=Km(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ps(e,t,s)):(Tt&&n&&Mm(t),t.flags|=1,dr(e,t,r,s),t.child)}function My(e,t,r,n,s){if(Sr(r)){var o=!0;Bu(t)}else o=!1;if(Ii(t,s),t.stateNode===null)gu(e,t),r_(t,r,n),mp(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=r.contextType;typeof c=="object"&&c!==null?c=Gr(c):(c=Sr(r)?Fo:lr.current,c=Ki(t,c));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Ry(t,i,n,c),zs=!1;var p=t.memoizedState;i.state=p,Gu(t,n,i,s),l=t.memoizedState,a!==n||p!==l||br.current||zs?(typeof d=="function"&&(pp(t,r,d,n),l=t.memoizedState),(a=zs||Ny(t,r,a,n,p,l,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=c,n=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Mw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:rn(t.type,a),i.props=c,f=t.pendingProps,p=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=Gr(l):(l=Sr(r)?Fo:lr.current,l=Ki(t,l));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||p!==l)&&Ry(t,i,n,l),zs=!1,p=t.memoizedState,i.state=p,Gu(t,n,i,s);var x=t.memoizedState;a!==f||p!==x||br.current||zs?(typeof m=="function"&&(pp(t,r,m,n),x=t.memoizedState),(c=zs||Ny(t,r,c,n,p,x,l)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,x,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,x,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),i.props=n,i.state=x,i.context=l,n=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return yp(e,t,r,n,o,s)}function yp(e,t,r,n,s,o){a_(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&wy(t,r,!1),ps(e,t,o);n=t.stateNode,yR.current=t;var a=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=qi(t,e.child,null,o),t.child=qi(t,null,a,o)):dr(e,t,a,o),t.memoizedState=n.state,s&&wy(t,r,!0),t.child}function l_(e){var t=e.stateNode;t.pendingContext?xy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xy(e,t.context,!1),$m(e,t.containerInfo)}function Iy(e,t,r,n,s){return Gi(),Lm(s),t.flags|=256,dr(e,t,r,n),t.child}var xp={dehydrated:null,treeContext:null,retryLane:0};function wp(e){return{baseLanes:e,cachePool:null,transitions:null}}function c_(e,t,r){var n=t.pendingProps,s=jt.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),yt(jt,s&1),e===null)return fp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,o?(n=t.mode,o=t.child,i={mode:"hidden",children:i},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Bd(i,n,0,null),e=Ao(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=wp(r),t.memoizedState=xp,e):Xm(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return xR(e,t,i,n,a,s,r);if(o){o=n.fallback,i=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=to(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=to(a,o):(o=Ao(o,i,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,i=e.child.memoizedState,i=i===null?wp(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=xp,n}return o=e.child,e=o.sibling,n=to(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Xm(e,t){return t=Bd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bc(e,t,r,n){return n!==null&&Lm(n),qi(t,e.child,null,r),e=Xm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xR(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=ch(Error(oe(422))),Bc(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=Bd({mode:"visible",children:n.children},s,0,null),o=Ao(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&qi(t,e.child,null,i),t.child.memoizedState=wp(i),t.memoizedState=xp,o);if(!(t.mode&1))return Bc(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(oe(419)),n=ch(o,n,void 0),Bc(e,t,i,n)}if(a=(i&e.childLanes)!==0,_r||a){if(n=Qt,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,hs(e,s),dn(n,e,s,-1))}return ng(),n=ch(Error(oe(421))),Bc(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=DR.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Dr=Xs(s.nextSibling),Or=t,Tt=!0,on=null,e!==null&&($r[Br++]=ns,$r[Br++]=ss,$r[Br++]=zo,ns=e.id,ss=e.overflow,zo=t),t=Xm(t,n.children),t.flags|=4096,t)}function Ly(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),hp(e.return,t,r)}function uh(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function u_(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(dr(e,t,n.children,r),n=jt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ly(e,r,t);else if(e.tag===19)Ly(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(yt(jt,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&qu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),uh(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&qu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}uh(t,!0,r,null,o);break;case"together":uh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ps(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Vo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,r=to(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=to(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wR(e,t,r){switch(t.tag){case 3:l_(t),Gi();break;case 5:Iw(t);break;case 1:Sr(t.type)&&Bu(t);break;case 4:$m(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;yt(Zu,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(yt(jt,jt.current&1),t.flags|=128,null):r&t.child.childLanes?c_(e,t,r):(yt(jt,jt.current&1),e=ps(e,t,r),e!==null?e.sibling:null);yt(jt,jt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return u_(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),yt(jt,jt.current),n)break;return null;case 22:case 23:return t.lanes=0,i_(e,t,r)}return ps(e,t,r)}var d_,_p,f_,h_;d_=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};_p=function(){};f_=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,To(Dn.current);var o=null;switch(r){case"input":s=$h(e,s),n=$h(e,n),o=[];break;case"select":s=At({},s,{value:void 0}),n=At({},n,{value:void 0}),o=[];break;case"textarea":s=Yh(e,s),n=Yh(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Wu)}Kh(r,n);var i;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(i in a)a.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(fl.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(r||(r={}),r[i]=l[i])}else r||(o||(o=[]),o.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(fl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&wt("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};h_=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ra(e,t){if(!Tt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function or(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function _R(e,t,r){var n=t.pendingProps;switch(Im(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return or(t),null;case 1:return Sr(t.type)&&$u(),or(t),null;case 3:return n=t.stateNode,Xi(),_t(br),_t(lr),Hm(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,on!==null&&(Rp(on),on=null))),_p(e,t),or(t),null;case 5:Bm(t);var s=To(kl.current);if(r=t.type,e!==null&&t.stateNode!=null)f_(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(oe(166));return or(t),null}if(e=To(Dn.current),Wc(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[Cn]=t,n[bl]=o,e=(t.mode&1)!==0,r){case"dialog":wt("cancel",n),wt("close",n);break;case"iframe":case"object":case"embed":wt("load",n);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Cn]=t,e[bl]=n,d_(e,t,!1,!1),t.stateNode=e;e:{switch(i=Gh(r,n),r){case"dialog":wt("cancel",e),wt("close",e),s=n;break;case"iframe":case"object":case"embed":wt("load",e),s=n;break;case"video":case"audio":for(s=0;sJi&&(t.flags|=128,n=!0,Ra(o,!1),t.lanes=4194304)}else{if(!n)if(e=qu(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ra(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Tt)return or(t),null}else 2*zt()-o.renderingStartTime>Ji&&r!==1073741824&&(t.flags|=128,n=!0,Ra(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zt(),t.sibling=null,r=jt.current,yt(jt,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return rg(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Rr&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function bR(e,t){switch(Im(t),t.tag){case 1:return Sr(t.type)&&$u(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(),_t(br),_t(lr),Hm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bm(t),null;case 13:if(_t(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(jt),null;case 4:return Xi(),null;case 10:return Um(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var Hc=!1,ir=!1,SR=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Ei(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){It(e,t,n)}else r.current=null}function bp(e,t,r){try{r()}catch(n){It(e,t,n)}}var Fy=!1;function kR(e,t){if(op=zu,e=yw(),Am(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(l=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++c===s&&(a=i),p===o&&++d===n&&(l=i),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ip={focusedElem:e,selectionRange:r},zu=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,w=x.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:rn(t.type,v),w);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(C){It(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return x=Fy,Fy=!1,x}function el(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&bp(t,r,o)}s=s.next}while(s!==n)}}function Wd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Sp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function p_(e){var t=e.alternate;t!==null&&(e.alternate=null,p_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[bl],delete t[cp],delete t[iR],delete t[aR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function m_(e){return e.tag===5||e.tag===3||e.tag===4}function zy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m_(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Wu));else if(n!==4&&(e=e.child,e!==null))for(kp(e,t,r),e=e.sibling;e!==null;)kp(e,t,r),e=e.sibling}function Cp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cp(e,t,r),e=e.sibling;e!==null;)Cp(e,t,r),e=e.sibling}var er=null,nn=!1;function Os(e,t,r){for(r=r.child;r!==null;)g_(e,t,r),r=r.sibling}function g_(e,t,r){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(Ad,r)}catch{}switch(r.tag){case 5:ir||Ei(r,t);case 6:var n=er,s=nn;er=null,Os(e,t,r),er=n,nn=s,er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(nn?(e=er,r=r.stateNode,e.nodeType===8?nh(e.parentNode,r):e.nodeType===1&&nh(e,r),vl(e)):nh(er,r.stateNode));break;case 4:n=er,s=nn,er=r.stateNode.containerInfo,nn=!0,Os(e,t,r),er=n,nn=s;break;case 0:case 11:case 14:case 15:if(!ir&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&bp(r,t,i),s=s.next}while(s!==n)}Os(e,t,r);break;case 1:if(!ir&&(Ei(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){It(r,t,a)}Os(e,t,r);break;case 21:Os(e,t,r);break;case 22:r.mode&1?(ir=(n=ir)||r.memoizedState!==null,Os(e,t,r),ir=n):Os(e,t,r);break;default:Os(e,t,r)}}function Uy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new SR),t.forEach(function(n){var s=OR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=i),n&=~o}if(n=s,n=zt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ER(n/1960))-n,10e?16:e,Bs===null)var n=!1;else{if(e=Bs,Bs=null,td=0,it&6)throw Error(oe(331));var s=it;for(it|=4,_e=e.current;_e!==null;){var o=_e,i=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lzt()-eg?Oo(e,0):Jm|=r),kr(e,t)}function k_(e,t){t===0&&(e.mode&1?(t=Ic,Ic<<=1,!(Ic&130023424)&&(Ic=4194304)):t=1);var r=hr();e=hs(e,t),e!==null&&(rc(e,t,r),kr(e,r))}function DR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),k_(e,r)}function OR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(oe(314))}n!==null&&n.delete(t),k_(e,r)}var C_;C_=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)_r=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _r=!1,wR(e,t,r);_r=!!(e.flags&131072)}else _r=!1,Tt&&t.flags&1048576&&Rw(t,Yu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;gu(e,t),e=t.pendingProps;var s=Ki(t,lr.current);Ii(t,r),s=Zm(null,t,n,e,s,r);var o=Km();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Sr(n)?(o=!0,Bu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wm(t),s.updater=Vd,t.stateNode=s,s._reactInternals=t,mp(t,n,e,r),t=yp(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&Mm(t),dr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(gu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=MR(n),e=rn(n,e),s){case 0:t=vp(null,t,n,e,r);break e;case 1:t=My(null,t,n,e,r);break e;case 11:t=Oy(null,t,n,e,r);break e;case 14:t=Ay(null,t,n,rn(n.type,e),r);break e}throw Error(oe(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),vp(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),My(e,t,n,s,r);case 3:e:{if(l_(t),e===null)throw Error(oe(387));n=t.pendingProps,o=t.memoizedState,s=o.element,Mw(e,t),Gu(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Qi(Error(oe(423)),t),t=Iy(e,t,n,r,s);break e}else if(n!==s){s=Qi(Error(oe(424)),t),t=Iy(e,t,n,r,s);break e}else for(Dr=Xs(t.stateNode.containerInfo.firstChild),Or=t,Tt=!0,on=null,r=Ow(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gi(),n===s){t=ps(e,t,r);break e}dr(e,t,n,r)}t=t.child}return t;case 5:return Iw(t),e===null&&fp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,ap(n,s)?i=null:o!==null&&ap(n,o)&&(t.flags|=32),a_(e,t),dr(e,t,i,r),t.child;case 6:return e===null&&fp(t),null;case 13:return c_(e,t,r);case 4:return $m(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=qi(t,null,n,r):dr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),Oy(e,t,n,s,r);case 7:return dr(e,t,t.pendingProps,r),t.child;case 8:return dr(e,t,t.pendingProps.children,r),t.child;case 12:return dr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,yt(Zu,n._currentValue),n._currentValue=i,o!==null)if(hn(o.value,i)){if(o.children===s.children&&!br.current){t=ps(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=as(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),hp(o.return,r,t),a.lanes|=r;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(oe(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),hp(i,r,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}dr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Ii(t,r),s=Gr(s),n=n(s),t.flags|=1,dr(e,t,n,r),t.child;case 14:return n=t.type,s=rn(n,t.pendingProps),s=rn(n.type,s),Ay(e,t,n,s,r);case 15:return o_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rn(n,s),gu(e,t),t.tag=1,Sr(n)?(e=!0,Bu(t)):e=!1,Ii(t,r),r_(t,n,s),mp(t,n,s,r),yp(null,t,n,!0,e,r);case 19:return u_(e,t,r);case 22:return i_(e,t,r)}throw Error(oe(156,t.tag))};function E_(e,t){return Jx(e,t)}function AR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,r,n){return new AR(e,t,r,n)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function MR(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sm)return 11;if(e===km)return 14}return 2}function to(e,t){var r=e.alternate;return r===null?(r=Yr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xu(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")sg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case vi:return Ao(r.children,s,o,t);case bm:i=8,s|=8;break;case zh:return e=Yr(12,r,t,s|2),e.elementType=zh,e.lanes=o,e;case Uh:return e=Yr(13,r,t,s),e.elementType=Uh,e.lanes=o,e;case Vh:return e=Yr(19,r,t,s),e.elementType=Vh,e.lanes=o,e;case Ix:return Bd(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ax:i=10;break e;case Mx:i=9;break e;case Sm:i=11;break e;case km:i=14;break e;case Fs:i=16,n=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Yr(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Ao(e,t,r,n){return e=Yr(7,e,n,t),e.lanes=r,e}function Bd(e,t,r,n){return e=Yr(22,e,n,t),e.elementType=Ix,e.lanes=r,e.stateNode={isHidden:!1},e}function dh(e,t,r){return e=Yr(6,e,null,t),e.lanes=r,e}function fh(e,t,r){return t=Yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function IR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yf(0),this.expirationTimes=Yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function og(e,t,r,n,s,o,i,a,l){return e=new IR(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Yr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wm(o),e}function LR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j_)}catch(e){console.error(e)}}j_(),jx.exports=Fr;var _s=jx.exports;const P_=pm(_s),WR=vx({__proto__:null,default:P_},[_s]);var Ky=_s;Lh.createRoot=Ky.createRoot,Lh.hydrateRoot=Ky.hydrateRoot;/** * @remix-run/router v1.18.0 * * Copyright (c) Remix Software Inc. @@ -46,9 +46,9 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Wo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function BR(){return Math.random().toString(36).substr(2,8)}function qy(e,t){return{usr:e.state,key:e.key,idx:t}}function Tl(e,t,r,n){return r===void 0&&(r=null),Rt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:r,key:t&&t.key||n||BR()})}function $o(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function bs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function HR(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Vt.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(Rt({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Vt.Pop;let x=d(),h=x==null?null:x-c;c=x,l&&l({action:a,location:v.location,delta:h})}function p(x,h){a=Vt.Push;let g=Tl(v.location,x,h);r&&r(g,x),c=d()+1;let _=qy(g,c),C=v.createHref(g);try{i.pushState(_,"",C)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;s.location.assign(C)}o&&l&&l({action:a,location:v.location,delta:1})}function m(x,h){a=Vt.Replace;let g=Tl(v.location,x,h);r&&r(g,x),c=d();let _=qy(g,c),C=v.createHref(g);i.replaceState(_,"",C),o&&l&&l({action:a,location:v.location,delta:0})}function w(x){let h=s.location.origin!=="null"?s.location.origin:s.location.href,g=typeof x=="string"?x:$o(x);return g=g.replace(/ $/,"%20"),Xe(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let v={get action(){return a},get location(){return e(s,i)},listen(x){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Ky,f),l=x,()=>{s.removeEventListener(Ky,f),l=null}},createHref(x){return t(s,x)},createURL:w,encodeLocation(x){let h=w(x);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:p,replace:m,go(x){return i.go(x)}};return v}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const YR=new Set(["lazy","caseSensitive","path","id","index","children"]);function ZR(e){return e.index===!0}function Nl(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,o)=>{let i=[...r,String(o)],a=typeof s.id=="string"?s.id:i.join("-");if(Xe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Xe(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),ZR(s)){let l=Rt({},s,t(s),{id:a});return n[a]=l,l}else{let l=Rt({},s,t(s),{id:a,children:void 0});return n[a]=l,s.children&&(l.children=Nl(s.children,t,i,n)),l}})}function So(e,t,r){return r===void 0&&(r="/"),xu(e,t,r,!1)}function xu(e,t,r,n){let s=typeof t=="string"?bs(t):t,o=ca(s.pathname||"/",r);if(o==null)return null;let i=D_(e);KR(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(Xe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=ls([n,l.relativePath]),d=r.concat(l);o.children&&o.children.length>0&&(Xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),D_(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:r2(c,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of O_(o.path))s(o,i,l)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=O_(n.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function KR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:n2(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qR=/^:[\w-]+$/,XR=3,QR=2,JR=1,e2=10,t2=-2,Xy=e=>e==="*";function r2(e,t){let r=e.split("/"),n=r.length;return r.some(Xy)&&(n+=t2),t&&(n+=QR),r.filter(s=>!Xy(s)).reduce((s,o)=>s+(qR.test(o)?XR:o===""?JR:e2),n)}function n2(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function s2(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let v=a[f]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const w=a[f];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function o2(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Wo(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function i2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Wo(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ca(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function a2(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?bs(e):e;return{pathname:r?r.startsWith("/")?r:l2(r,t):t,search:u2(n),hash:d2(s)}}function l2(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function hh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function A_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Kd(e,t){let r=A_(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qd(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=bs(e):(s=Rt({},e),Xe(!s.pathname||!s.pathname.includes("?"),hh("?","pathname","search",s)),Xe(!s.pathname||!s.pathname.includes("#"),hh("#","pathname","hash",s)),Xe(!s.search||!s.search.includes("#"),hh("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=a2(s,a),c=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ls=e=>e.join("/").replace(/\/\/+/g,"/"),c2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),u2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,d2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class cg{constructor(t,r,n,s){s===void 0&&(s=!1),this.status=t,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Xd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const M_=["post","put","patch","delete"],f2=new Set(M_),h2=["get",...M_],p2=new Set(h2),m2=new Set([301,302,303,307,308]),g2=new Set([307,308]),ph={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},v2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ra={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ug=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,y2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),I_="remix-router-transitions";function w2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;s=B=>({hasErrorBoundary:U(B)})}else s=y2;let o={},i=Nl(e.routes,s,void 0,o),a,l=e.basename||"/",c=e.unstable_dataStrategy||k2,d=e.unstable_patchRoutesOnMiss,f=Rt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,m=new Set,w=null,v=null,x=null,h=e.hydrationData!=null,g=So(i,e.history.location,l),_=null;if(g==null&&!d){let U=ur(404,{pathname:e.history.location.pathname}),{matches:B,route:K}=l0(i);g=B,_={[K.id]:U}}g&&d&&!e.hydrationData&&Uf(g,i,e.history.location.pathname).active&&(g=null);let C;if(!g)C=!1,g=[];else if(g.some(U=>U.route.lazy))C=!1;else if(!g.some(U=>U.route.loader))C=!0;else if(f.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,B=e.hydrationData?e.hydrationData.errors:null,K=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||B&&B[re.route.id]!==void 0:!0;if(B){let re=g.findIndex(ye=>B[ye.route.id]!==void 0);C=g.slice(0,re+1).every(K)}else C=g.every(K)}else C=e.hydrationData!=null;let T,E={historyAction:e.history.action,location:e.history.location,matches:g,initialized:C,navigation:ph,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},P=Vt.Pop,O=!1,j,L=!1,q=new Map,N=null,F=!1,b=!1,W=[],te=[],$=new Map,Z=0,I=-1,Q=new Map,z=new Set,V=new Map,de=new Map,ne=new Set,se=new Map,Ee=new Map,fe=new Map,ge=!1;function be(){if(p=e.history.listen(U=>{let{action:B,location:K,delta:re}=U;if(ge){ge=!1;return}Wo(Ee.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ye=Cc({currentLocation:E.location,nextLocation:K,historyAction:B});if(ye&&re!=null){ge=!0,e.history.go(re*-1),ri(ye,{state:"blocked",location:K,proceed(){ri(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),e.history.go(re)},reset(){let ke=new Map(E.blockers);ke.set(ye,Ra),Se({blockers:ke})}});return}return G(B,K)}),r){L2(t,q);let U=()=>F2(t,q);t.addEventListener("pagehide",U),N=()=>t.removeEventListener("pagehide",U)}return E.initialized||G(Vt.Pop,E.location,{initialHydration:!0}),T}function Pe(){p&&p(),N&&N(),m.clear(),j&&j.abort(),E.fetchers.forEach((U,B)=>$t(B)),E.blockers.forEach((U,B)=>kc(B))}function Te(U){return m.add(U),()=>m.delete(U)}function Se(U,B){B===void 0&&(B={}),E=Rt({},E,U);let K=[],re=[];f.v7_fetcherPersist&&E.fetchers.forEach((ye,ke)=>{ye.state==="idle"&&(ne.has(ke)?re.push(ke):K.push(ke))}),[...m].forEach(ye=>ye(E,{deletedFetchers:re,unstable_viewTransitionOpts:B.viewTransitionOpts,unstable_flushSync:B.flushSync===!0})),f.v7_fetcherPersist&&(K.forEach(ye=>E.fetchers.delete(ye)),re.forEach(ye=>$t(ye)))}function rt(U,B,K){var re,ye;let{flushSync:ke}=K===void 0?{}:K,Ie=E.actionData!=null&&E.navigation.formMethod!=null&&sn(E.navigation.formMethod)&&E.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,ce;B.actionData?Object.keys(B.actionData).length>0?ce=B.actionData:ce=null:Ie?ce=E.actionData:ce=null;let Ve=B.loaderData?i0(E.loaderData,B.loaderData,B.matches||[],B.errors):E.loaderData,Re=E.blockers;Re.size>0&&(Re=new Map(Re),Re.forEach((dt,mt)=>Re.set(mt,Ra)));let je=O===!0||E.navigation.formMethod!=null&&sn(E.navigation.formMethod)&&((ye=U.state)==null?void 0:ye._isRedirect)!==!0;a&&(i=a,a=void 0),F||P===Vt.Pop||(P===Vt.Push?e.history.push(U,U.state):P===Vt.Replace&&e.history.replace(U,U.state));let ht;if(P===Vt.Pop){let dt=q.get(E.location.pathname);dt&&dt.has(U.pathname)?ht={currentLocation:E.location,nextLocation:U}:q.has(U.pathname)&&(ht={currentLocation:U,nextLocation:E.location})}else if(L){let dt=q.get(E.location.pathname);dt?dt.add(U.pathname):(dt=new Set([U.pathname]),q.set(E.location.pathname,dt)),ht={currentLocation:E.location,nextLocation:U}}Se(Rt({},B,{actionData:ce,loaderData:Ve,historyAction:P,location:U,initialized:!0,navigation:ph,revalidation:"idle",restoreScrollPosition:Fv(U,B.matches||E.matches),preventScrollReset:je,blockers:Re}),{viewTransitionOpts:ht,flushSync:ke===!0}),P=Vt.Pop,O=!1,L=!1,F=!1,b=!1,W=[],te=[]}async function k(U,B){if(typeof U=="number"){e.history.go(U);return}let K=Pp(E.location,E.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,B==null?void 0:B.fromRouteId,B==null?void 0:B.relative),{path:re,submission:ye,error:ke}=Jy(f.v7_normalizeFormMethod,!1,K,B),Ie=E.location,ce=Tl(E.location,re,B&&B.state);ce=Rt({},ce,e.history.encodeLocation(ce));let Ve=B&&B.replace!=null?B.replace:void 0,Re=Vt.Push;Ve===!0?Re=Vt.Replace:Ve===!1||ye!=null&&sn(ye.formMethod)&&ye.formAction===E.location.pathname+E.location.search&&(Re=Vt.Replace);let je=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,ht=(B&&B.unstable_flushSync)===!0,dt=Cc({currentLocation:Ie,nextLocation:ce,historyAction:Re});if(dt){ri(dt,{state:"blocked",location:ce,proceed(){ri(dt,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),k(U,B)},reset(){let mt=new Map(E.blockers);mt.set(dt,Ra),Se({blockers:mt})}});return}return await G(Re,ce,{submission:ye,pendingError:ke,preventScrollReset:je,replace:B&&B.replace,enableViewTransition:B&&B.unstable_viewTransition,flushSync:ht})}function J(){if(Fe(),Se({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){G(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}G(P||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function G(U,B,K){j&&j.abort(),j=null,P=U,F=(K&&K.startUninterruptedRevalidation)===!0,fT(E.location,E.matches),O=(K&&K.preventScrollReset)===!0,L=(K&&K.enableViewTransition)===!0;let re=a||i,ye=K&&K.overrideNavigation,ke=So(re,B,l),Ie=(K&&K.flushSync)===!0,ce=Uf(ke,re,B.pathname);if(ce.active&&ce.matches&&(ke=ce.matches),!ke){let{error:ct,notFoundMatches:Jt,route:Ut}=ni(B.pathname);rt(B,{matches:Jt,loaderData:{},errors:{[Ut.id]:ct}},{flushSync:Ie});return}if(E.initialized&&!b&&P2(E.location,B)&&!(K&&K.submission&&sn(K.submission.formMethod))){rt(B,{matches:ke},{flushSync:Ie});return}j=new AbortController;let Ve=li(e.history,B,j.signal,K&&K.submission),Re;if(K&&K.pendingError)Re=[Ni(ke).route.id,{type:gt.error,error:K.pendingError}];else if(K&&K.submission&&sn(K.submission.formMethod)){let ct=await D(Ve,B,K.submission,ke,ce.active,{replace:K.replace,flushSync:Ie});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Jt,Ut]=ct.pendingActionResult;if(Pr(Ut)&&Xd(Ut.error)&&Ut.error.status===404){j=null,rt(B,{matches:ct.matches,loaderData:{},errors:{[Jt]:Ut.error}});return}}ke=ct.matches||ke,Re=ct.pendingActionResult,ye=mh(B,K.submission),Ie=!1,ce.active=!1,Ve=li(e.history,Ve.url,Ve.signal)}let{shortCircuited:je,matches:ht,loaderData:dt,errors:mt}=await S(Ve,B,ke,ce.active,ye,K&&K.submission,K&&K.fetcherSubmission,K&&K.replace,K&&K.initialHydration===!0,Ie,Re);je||(j=null,rt(B,Rt({matches:ht||ke},a0(Re),{loaderData:dt,errors:mt})))}async function D(U,B,K,re,ye,ke){ke===void 0&&(ke={}),Fe();let Ie=M2(B,K);if(Se({navigation:Ie},{flushSync:ke.flushSync===!0}),ye){let Re=await Ec(re,B.pathname,U.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let{boundaryId:je,error:ht}=_n(B.pathname,Re);return{matches:Re.partialMatches,pendingActionResult:[je,{type:gt.error,error:ht}]}}else if(Re.matches)re=Re.matches;else{let{notFoundMatches:je,error:ht,route:dt}=ni(B.pathname);return{matches:je,pendingActionResult:[dt.id,{type:gt.error,error:ht}]}}}let ce,Ve=Va(re,B);if(!Ve.route.action&&!Ve.route.lazy)ce={type:gt.error,error:ur(405,{method:U.method,pathname:B.pathname,routeId:Ve.route.id})};else if(ce=(await ee("action",U,[Ve],re))[0],U.signal.aborted)return{shortCircuited:!0};if(No(ce)){let Re;return ke&&ke.replace!=null?Re=ke.replace:Re=n0(ce.response.headers.get("Location"),new URL(U.url),l)===E.location.pathname+E.location.search,await X(U,ce,{submission:K,replace:Re}),{shortCircuited:!0}}if(To(ce))throw ur(400,{type:"defer-action"});if(Pr(ce)){let Re=Ni(re,Ve.route.id);return(ke&&ke.replace)!==!0&&(P=Vt.Push),{matches:re,pendingActionResult:[Re.route.id,ce]}}return{matches:re,pendingActionResult:[Ve.route.id,ce]}}async function S(U,B,K,re,ye,ke,Ie,ce,Ve,Re,je){let ht=ye||mh(B,ke),dt=ke||Ie||d0(ht),mt=!F&&(!f.v7_partialHydration||!Ve);if(re){if(mt){let Mt=R(je);Se(Rt({navigation:ht},Mt!==void 0?{actionData:Mt}:{}),{flushSync:Re})}let Be=await Ec(K,B.pathname,U.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){let{boundaryId:Mt,error:Er}=_n(B.pathname,Be);return{matches:Be.partialMatches,loaderData:{},errors:{[Mt]:Er}}}else if(Be.matches)K=Be.matches;else{let{error:Mt,notFoundMatches:Er,route:Ct}=ni(B.pathname);return{matches:Er,loaderData:{},errors:{[Ct.id]:Mt}}}}let ct=a||i,[Jt,Ut]=e0(e.history,E,K,dt,B,f.v7_partialHydration&&Ve===!0,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,ct,l,je);if(Ns(Be=>!(K&&K.some(Mt=>Mt.route.id===Be))||Jt&&Jt.some(Mt=>Mt.route.id===Be)),I=++Z,Jt.length===0&&Ut.length===0){let Be=Yn();return rt(B,Rt({matches:K,loaderData:{},errors:je&&Pr(je[1])?{[je[0]]:je[1].error}:null},a0(je),Be?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Re}),{shortCircuited:!0}}if(mt){let Be={};if(!re){Be.navigation=ht;let Mt=R(je);Mt!==void 0&&(Be.actionData=Mt)}Ut.length>0&&(Be.fetchers=A(Ut)),Se(Be,{flushSync:Re})}Ut.forEach(Be=>{$.has(Be.key)&&ot(Be.key),Be.controller&&$.set(Be.key,Be.controller)});let xa=()=>Ut.forEach(Be=>ot(Be.key));j&&j.signal.addEventListener("abort",xa);let{loaderResults:Rs,fetcherResults:si}=await he(E.matches,K,Jt,Ut,U);if(U.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",xa),Ut.forEach(Be=>$.delete(Be.key));let oi=c0([...Rs,...si]);if(oi){if(oi.idx>=Jt.length){let Be=Ut[oi.idx-Jt.length].key;z.add(Be)}return await X(U,oi.result,{replace:ce}),{shortCircuited:!0}}let{loaderData:ii,errors:bn}=o0(E,K,Jt,Rs,je,Ut,si,se);se.forEach((Be,Mt)=>{Be.subscribe(Er=>{(Er||Be.done)&&se.delete(Mt)})}),f.v7_partialHydration&&Ve&&E.errors&&Object.entries(E.errors).filter(Be=>{let[Mt]=Be;return!Jt.some(Er=>Er.route.id===Mt)}).forEach(Be=>{let[Mt,Er]=Be;bn=Object.assign(bn||{},{[Mt]:Er})});let Tc=Yn(),Nc=Wr(I),Rc=Tc||Nc||Ut.length>0;return Rt({matches:K,loaderData:ii,errors:bn},Rc?{fetchers:new Map(E.fetchers)}:{})}function R(U){if(U&&!Pr(U[1]))return{[U[0]]:U[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function A(U){return U.forEach(B=>{let K=E.fetchers.get(B.key),re=Pa(void 0,K?K.data:void 0);E.fetchers.set(B.key,re)}),new Map(E.fetchers)}function Y(U,B,K,re){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(U)&&ot(U);let ye=(re&&re.unstable_flushSync)===!0,ke=a||i,Ie=Pp(E.location,E.matches,l,f.v7_prependBasename,K,f.v7_relativeSplatPath,B,re==null?void 0:re.relative),ce=So(ke,Ie,l),Ve=Uf(ce,ke,Ie);if(Ve.active&&Ve.matches&&(ce=Ve.matches),!ce){kt(U,B,ur(404,{pathname:Ie}),{flushSync:ye});return}let{path:Re,submission:je,error:ht}=Jy(f.v7_normalizeFormMethod,!0,Ie,re);if(ht){kt(U,B,ht,{flushSync:ye});return}let dt=Va(ce,Re);if(O=(re&&re.preventScrollReset)===!0,je&&sn(je.formMethod)){M(U,B,Re,dt,ce,Ve.active,ye,je);return}V.set(U,{routeId:B,path:Re}),H(U,B,Re,dt,ce,Ve.active,ye,je)}async function M(U,B,K,re,ye,ke,Ie,ce){Fe(),V.delete(U);function Ve(Ct){if(!Ct.route.action&&!Ct.route.lazy){let Zn=ur(405,{method:ce.formMethod,pathname:K,routeId:B});return kt(U,B,Zn,{flushSync:Ie}),!0}return!1}if(!ke&&Ve(re))return;let Re=E.fetchers.get(U);De(U,I2(ce,Re),{flushSync:Ie});let je=new AbortController,ht=li(e.history,K,je.signal,ce);if(ke){let Ct=await Ec(ye,K,ht.signal);if(Ct.type==="aborted")return;if(Ct.type==="error"){let{error:Zn}=_n(K,Ct);kt(U,B,Zn,{flushSync:Ie});return}else if(Ct.matches){if(ye=Ct.matches,re=Va(ye,K),Ve(re))return}else{kt(U,B,ur(404,{pathname:K}),{flushSync:Ie});return}}$.set(U,je);let dt=Z,ct=(await ee("action",ht,[re],ye))[0];if(ht.signal.aborted){$.get(U)===je&&$.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(No(ct)||Pr(ct)){De(U,Os(void 0));return}}else{if(No(ct))if($.delete(U),I>dt){De(U,Os(void 0));return}else return z.add(U),De(U,Pa(ce)),X(ht,ct,{fetcherSubmission:ce});if(Pr(ct)){kt(U,B,ct.error);return}}if(To(ct))throw ur(400,{type:"defer-action"});let Jt=E.navigation.location||E.location,Ut=li(e.history,Jt,je.signal),xa=a||i,Rs=E.navigation.state!=="idle"?So(xa,E.navigation.location,l):E.matches;Xe(Rs,"Didn't find any matches after fetcher action");let si=++Z;Q.set(U,si);let oi=Pa(ce,ct.data);E.fetchers.set(U,oi);let[ii,bn]=e0(e.history,E,Rs,ce,Jt,!1,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,xa,l,[re.route.id,ct]);bn.filter(Ct=>Ct.key!==U).forEach(Ct=>{let Zn=Ct.key,zv=E.fetchers.get(Zn),mT=Pa(void 0,zv?zv.data:void 0);E.fetchers.set(Zn,mT),$.has(Zn)&&ot(Zn),Ct.controller&&$.set(Zn,Ct.controller)}),Se({fetchers:new Map(E.fetchers)});let Tc=()=>bn.forEach(Ct=>ot(Ct.key));je.signal.addEventListener("abort",Tc);let{loaderResults:Nc,fetcherResults:Rc}=await he(E.matches,Rs,ii,bn,Ut);if(je.signal.aborted)return;je.signal.removeEventListener("abort",Tc),Q.delete(U),$.delete(U),bn.forEach(Ct=>$.delete(Ct.key));let Be=c0([...Nc,...Rc]);if(Be){if(Be.idx>=ii.length){let Ct=bn[Be.idx-ii.length].key;z.add(Ct)}return X(Ut,Be.result)}let{loaderData:Mt,errors:Er}=o0(E,E.matches,ii,Nc,void 0,bn,Rc,se);if(E.fetchers.has(U)){let Ct=Os(ct.data);E.fetchers.set(U,Ct)}Wr(si),E.navigation.state==="loading"&&si>I?(Xe(P,"Expected pending action"),j&&j.abort(),rt(E.navigation.location,{matches:Rs,loaderData:Mt,errors:Er,fetchers:new Map(E.fetchers)})):(Se({errors:Er,loaderData:i0(E.loaderData,Mt,Rs,Er),fetchers:new Map(E.fetchers)}),b=!1)}async function H(U,B,K,re,ye,ke,Ie,ce){let Ve=E.fetchers.get(U);De(U,Pa(ce,Ve?Ve.data:void 0),{flushSync:Ie});let Re=new AbortController,je=li(e.history,K,Re.signal);if(ke){let ct=await Ec(ye,K,je.signal);if(ct.type==="aborted")return;if(ct.type==="error"){let{error:Jt}=_n(K,ct);kt(U,B,Jt,{flushSync:Ie});return}else if(ct.matches)ye=ct.matches,re=Va(ye,K);else{kt(U,B,ur(404,{pathname:K}),{flushSync:Ie});return}}$.set(U,Re);let ht=Z,mt=(await ee("loader",je,[re],ye))[0];if(To(mt)&&(mt=await V_(mt,je.signal,!0)||mt),$.get(U)===Re&&$.delete(U),!je.signal.aborted){if(ne.has(U)){De(U,Os(void 0));return}if(No(mt))if(I>ht){De(U,Os(void 0));return}else{z.add(U),await X(je,mt);return}if(Pr(mt)){kt(U,B,mt.error);return}Xe(!To(mt),"Unhandled fetcher deferred data"),De(U,Os(mt.data))}}async function X(U,B,K){let{submission:re,fetcherSubmission:ye,replace:ke}=K===void 0?{}:K;B.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Ie=B.response.headers.get("Location");Xe(Ie,"Expected a Location header on the redirect Response"),Ie=n0(Ie,new URL(U.url),l);let ce=Tl(E.location,Ie,{_isRedirect:!0});if(r){let mt=!1;if(B.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(ug.test(Ie)){const ct=e.history.createURL(Ie);mt=ct.origin!==t.location.origin||ca(ct.pathname,l)==null}if(mt){ke?t.location.replace(Ie):t.location.assign(Ie);return}}j=null;let Ve=ke===!0?Vt.Replace:Vt.Push,{formMethod:Re,formAction:je,formEncType:ht}=E.navigation;!re&&!ye&&Re&&je&&ht&&(re=d0(E.navigation));let dt=re||ye;if(g2.has(B.response.status)&&dt&&sn(dt.formMethod))await G(Ve,ce,{submission:Rt({},dt,{formAction:Ie}),preventScrollReset:O});else{let mt=mh(ce,re);await G(Ve,ce,{overrideNavigation:mt,fetcherSubmission:ye,preventScrollReset:O})}}async function ee(U,B,K,re){try{let ye=await C2(c,U,B,K,re,o,s);return await Promise.all(ye.map((ke,Ie)=>{if(D2(ke)){let ce=ke.result;return{type:gt.redirect,response:N2(ce,B,K[Ie].route.id,re,l,f.v7_relativeSplatPath)}}return T2(ke)}))}catch(ye){return K.map(()=>({type:gt.error,error:ye}))}}async function he(U,B,K,re,ye){let[ke,...Ie]=await Promise.all([K.length?ee("loader",ye,K,B):[],...re.map(ce=>{if(ce.matches&&ce.match&&ce.controller){let Ve=li(e.history,ce.path,ce.controller.signal);return ee("loader",Ve,[ce.match],ce.matches).then(Re=>Re[0])}else return Promise.resolve({type:gt.error,error:ur(404,{pathname:ce.path})})})]);return await Promise.all([u0(U,K,ke,ke.map(()=>ye.signal),!1,E.loaderData),u0(U,re.map(ce=>ce.match),Ie,re.map(ce=>ce.controller?ce.controller.signal:null),!0)]),{loaderResults:ke,fetcherResults:Ie}}function Fe(){b=!0,W.push(...Ns()),V.forEach((U,B)=>{$.has(B)&&(te.push(B),ot(B))})}function De(U,B,K){K===void 0&&(K={}),E.fetchers.set(U,B),Se({fetchers:new Map(E.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function kt(U,B,K,re){re===void 0&&(re={});let ye=Ni(E.matches,B);$t(U),Se({errors:{[ye.route.id]:K},fetchers:new Map(E.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function Vr(U){return f.v7_fetcherPersist&&(de.set(U,(de.get(U)||0)+1),ne.has(U)&&ne.delete(U)),E.fetchers.get(U)||v2}function $t(U){let B=E.fetchers.get(U);$.has(U)&&!(B&&B.state==="loading"&&Q.has(U))&&ot(U),V.delete(U),Q.delete(U),z.delete(U),ne.delete(U),E.fetchers.delete(U)}function Bn(U){if(f.v7_fetcherPersist){let B=(de.get(U)||0)-1;B<=0?(de.delete(U),ne.add(U)):de.set(U,B)}else $t(U);Se({fetchers:new Map(E.fetchers)})}function ot(U){let B=$.get(U);Xe(B,"Expected fetch controller: "+U),B.abort(),$.delete(U)}function Hn(U){for(let B of U){let K=Vr(B),re=Os(K.data);E.fetchers.set(B,re)}}function Yn(){let U=[],B=!1;for(let K of z){let re=E.fetchers.get(K);Xe(re,"Expected fetcher: "+K),re.state==="loading"&&(z.delete(K),U.push(K),B=!0)}return Hn(U),B}function Wr(U){let B=[];for(let[K,re]of Q)if(re0}function Sc(U,B){let K=E.blockers.get(U)||Ra;return Ee.get(U)!==B&&Ee.set(U,B),K}function kc(U){E.blockers.delete(U),Ee.delete(U)}function ri(U,B){let K=E.blockers.get(U)||Ra;Xe(K.state==="unblocked"&&B.state==="blocked"||K.state==="blocked"&&B.state==="blocked"||K.state==="blocked"&&B.state==="proceeding"||K.state==="blocked"&&B.state==="unblocked"||K.state==="proceeding"&&B.state==="unblocked","Invalid blocker state transition: "+K.state+" -> "+B.state);let re=new Map(E.blockers);re.set(U,B),Se({blockers:re})}function Cc(U){let{currentLocation:B,nextLocation:K,historyAction:re}=U;if(Ee.size===0)return;Ee.size>1&&Wo(!1,"A router only supports one blocker at a time");let ye=Array.from(Ee.entries()),[ke,Ie]=ye[ye.length-1],ce=E.blockers.get(ke);if(!(ce&&ce.state==="proceeding")&&Ie({currentLocation:B,nextLocation:K,historyAction:re}))return ke}function ni(U){let B=ur(404,{pathname:U}),K=a||i,{matches:re,route:ye}=l0(K);return Ns(),{notFoundMatches:re,route:ye,error:B}}function _n(U,B){return{boundaryId:Ni(B.partialMatches).route.id,error:ur(400,{type:"route-discovery",pathname:U,message:B.error!=null&&"message"in B.error?B.error:String(B.error)})}}function Ns(U){let B=[];return se.forEach((K,re)=>{(!U||U(re))&&(K.cancel(),B.push(re),se.delete(re))}),B}function dT(U,B,K){if(w=U,x=B,v=K||null,!h&&E.navigation===ph){h=!0;let re=Fv(E.location,E.matches);re!=null&&Se({restoreScrollPosition:re})}return()=>{w=null,x=null,v=null}}function Lv(U,B){return v&&v(U,B.map(re=>GR(re,E.loaderData)))||U.key}function fT(U,B){if(w&&x){let K=Lv(U,B);w[K]=x()}}function Fv(U,B){if(w){let K=Lv(U,B),re=w[K];if(typeof re=="number")return re}return null}function Uf(U,B,K){if(d)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:xu(B,K,l,!0)}}else return{active:!0,matches:xu(B,K,l,!0)||[]};return{active:!1,matches:null}}async function Ec(U,B,K){let re=U,ye=re.length>0?re[re.length-1].route:null;for(;;){let ke=a==null,Ie=a||i;try{await S2(d,B,re,Ie,o,s,fe,K)}catch(je){return{type:"error",error:je,partialMatches:re}}finally{ke&&(i=[...i])}if(K.aborted)return{type:"aborted"};let ce=So(Ie,B,l),Ve=!1;if(ce){let je=ce[ce.length-1].route;if(je.index)return{type:"success",matches:ce};if(je.path&&je.path.length>0)if(je.path==="*")Ve=!0;else return{type:"success",matches:ce}}let Re=xu(Ie,B,l,!0);if(!Re||re.map(je=>je.route.id).join("-")===Re.map(je=>je.route.id).join("-"))return{type:"success",matches:Ve?ce:null};if(re=Re,ye=re[re.length-1].route,ye.path==="*")return{type:"success",matches:re}}}function hT(U){o={},a=Nl(U,s,void 0,o)}function pT(U,B){let K=a==null;F_(U,B,a||i,o,s),K&&(i=[...i],Se({}))}return T={get basename(){return l},get future(){return f},get state(){return E},get routes(){return i},get window(){return t},initialize:be,subscribe:Te,enableScrollRestoration:dT,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Vr,deleteFetcher:Bn,dispose:Pe,getBlocker:Sc,deleteBlocker:kc,patchRoutes:pT,_internalFetchControllers:$,_internalActiveDeferreds:se,_internalSetRoutes:hT},T}function x2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Pp(e,t,r,n,s,o,i,a){let l,c;if(i){l=[];for(let f of t)if(l.push(f),f.route.id===i){c=f;break}}else l=t,c=t[t.length-1];let d=qd(s||".",Kd(l,o),ca(e.pathname,r)||e.pathname,a==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&c&&c.route.index&&!dg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ls([r,d.pathname])),$o(d)}function Jy(e,t,r,n){if(!n||!x2(n))return{path:r};if(n.formMethod&&!A2(n.formMethod))return{path:r,error:ur(405,{method:n.formMethod})};let s=()=>({path:r,error:ur(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=z_(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sn(i))return s();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,w)=>{let[v,x]=w;return""+m+v+"="+x+` -`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!sn(i))return s();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}Xe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=jp(n.formData),c=n.formData;else if(n.body instanceof FormData)l=jp(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=s0(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=s0(l)}catch{return s()}let d={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(sn(d.formMethod))return{path:r,submission:d};let f=bs(r);return t&&f.search&&dg(f.search)&&l.append("index",""),f.search="?"+l,{path:$o(f),submission:d}}function _2(e,t){let r=e;if(t){let n=e.findIndex(s=>s.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function e0(e,t,r,n,s,o,i,a,l,c,d,f,p,m,w,v){let x=v?Pr(v[1])?v[1].error:v[1].data:void 0,h=e.createURL(t.location),g=e.createURL(s),_=v&&Pr(v[1])?v[0]:void 0,C=_?_2(r,_):r,T=v?v[1].statusCode:void 0,E=i&&T&&T>=400,P=C.filter((j,L)=>{let{route:q}=j;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(b2(t.loaderData,t.matches[L],j)||l.some(b=>b===j.route.id))return!0;let N=t.matches[L],F=j;return t0(j,Rt({currentUrl:h,currentParams:N.params,nextUrl:g,nextParams:F.params},n,{actionResult:x,actionStatus:T,defaultShouldRevalidate:E?!1:a||h.pathname+h.search===g.pathname+g.search||h.search!==g.search||L_(N,F)}))}),O=[];return f.forEach((j,L)=>{if(o||!r.some(W=>W.route.id===j.routeId)||d.has(L))return;let q=So(m,j.path,w);if(!q){O.push({key:L,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(L),F=Va(q,j.path),b=!1;p.has(L)?b=!1:c.includes(L)?b=!0:N&&N.state!=="idle"&&N.data===void 0?b=a:b=t0(F,Rt({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:x,actionStatus:T,defaultShouldRevalidate:E?!1:a})),b&&O.push({key:L,routeId:j.routeId,path:j.path,matches:q,match:F,controller:new AbortController})}),[P,O]}function b2(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function L_(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function t0(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function S2(e,t,r,n,s,o,i,a){let l=[t,...r.map(c=>c.route.id)].join("-");try{let c=i.get(l);c||(c=e({path:t,matches:r,patch:(d,f)=>{a.aborted||F_(d,f,n,s,o)}}),i.set(l,c)),c&&j2(c)&&await c}finally{i.delete(l)}}function F_(e,t,r,n,s){if(e){var o;let i=n[e];Xe(i,"No route found to patch children into: routeId = "+e);let a=Nl(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...a):i.children=a}else{let i=Nl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function r0(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];Xe(s,"No route found in manifest");let o={};for(let i in n){let l=s[i]!==void 0&&i!=="hasErrorBoundary";Wo(!l,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!l&&!YR.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Rt({},t(s),{lazy:void 0}))}function k2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function C2(e,t,r,n,s,o,i,a){let l=n.reduce((f,p)=>f.add(p.route.id),new Set),c=new Set,d=await e({matches:s.map(f=>{let p=l.has(f.route.id);return Rt({},f,{shouldLoad:p,resolve:w=>(c.add(f.route.id),p?E2(t,r,f,o,i,w,a):Promise.resolve({type:gt.data,result:void 0}))})}),request:r,params:s[0].params,context:a});return s.forEach(f=>Xe(c.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,p)=>l.has(s[p].route.id))}async function E2(e,t,r,n,s,o,i){let a,l,c=d=>{let f,p=new Promise((v,x)=>f=x);l=()=>f(),t.signal.addEventListener("abort",l);let m=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...v!==void 0?[v]:[]),w;return o?w=o(v=>m(v)):w=(async()=>{try{return{type:"data",result:await m()}}catch(v){return{type:"error",result:v}}})(),Promise.race([w,p])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[p]=await Promise.all([c(d).catch(m=>{f=m}),r0(r.route,s,n)]);if(f!==void 0)throw f;a=p}else if(await r0(r.route,s,n),d=r.route[e],d)a=await c(d);else if(e==="action"){let f=new URL(t.url),p=f.pathname+f.search;throw ur(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:gt.data,result:void 0};else if(d)a=await c(d);else{let f=new URL(t.url),p=f.pathname+f.search;throw ur(404,{pathname:p})}Xe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:gt.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function T2(e){let{result:t,type:r,status:n}=e;if(U_(t)){let i;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(a){return{type:gt.error,error:a}}return r===gt.error?{type:gt.error,error:new cg(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:gt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===gt.error)return{type:gt.error,error:t,statusCode:Xd(t)?t.status:n};if(O2(t)){var s,o;return{type:gt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:gt.data,data:t,statusCode:n}}function N2(e,t,r,n,s,o){let i=e.headers.get("Location");if(Xe(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ug.test(i)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);i=Pp(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function n0(e,t,r){if(ug.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=ca(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function li(e,t,r,n){let s=e.createURL(z_(t)).toString(),o={signal:r};if(n&&sn(n.formMethod)){let{formMethod:i,formEncType:a}=n;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(n.json)):a==="text/plain"?o.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?o.body=jp(n.formData):o.body=n.formData}return new Request(s,o)}function jp(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function s0(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function R2(e,t,r,n,s,o){let i={},a=null,l,c=!1,d={},f=n&&Pr(n[1])?n[1].error:void 0;return r.forEach((p,m)=>{let w=t[m].route.id;if(Xe(!No(p),"Cannot handle redirect results in processLoaderData"),Pr(p)){let v=p.error;f!==void 0&&(v=f,f=void 0),a=a||{};{let x=Ni(e,w);a[x.route.id]==null&&(a[x.route.id]=v)}i[w]=void 0,c||(c=!0,l=Xd(p.error)?p.error.status:500),p.headers&&(d[w]=p.headers)}else To(p)?(s.set(w,p.deferredData),i[w]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(d[w]=p.headers)):(i[w]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(d[w]=p.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:d}}function o0(e,t,r,n,s,o,i,a){let{loaderData:l,errors:c}=R2(t,r,n,s,a);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function l0(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ur(e,t){let{pathname:r,routeId:n,method:s,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?l='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+i):s&&r&&n?l="You made a "+s+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",s&&r&&n?l="You made a "+s.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":s&&(l='Invalid request method "'+s.toUpperCase()+'"')),new cg(e||500,a,new Error(l),!0)}function c0(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(No(r))return{result:r,idx:t}}}function z_(e){let t=typeof e=="string"?bs(e):e;return $o(Rt({},t,{hash:""}))}function P2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function j2(e){return typeof e=="object"&&e!=null&&"then"in e}function D2(e){return U_(e.result)&&m2.has(e.result.status)}function To(e){return e.type===gt.deferred}function Pr(e){return e.type===gt.error}function No(e){return(e&&e.type)===gt.redirect}function O2(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function U_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function A2(e){return p2.has(e.toLowerCase())}function sn(e){return f2.has(e.toLowerCase())}async function u0(e,t,r,n,s,o){for(let i=0;if.route.id===l.route.id),d=c!=null&&!L_(c,l)&&(o&&o[l.route.id])!==void 0;if(To(a)&&(s||d)){let f=n[i];Xe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await V_(a,f,s).then(p=>{p&&(r[i]=p||r[i])})}}}async function V_(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:gt.error,error:s}}return{type:gt.data,data:e.deferredData.data}}}function dg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Va(e,t){let r=typeof t=="string"?bs(t).search:t.search;if(e[e.length-1].route.index&&dg(r||""))return e[e.length-1];let n=A_(e);return n[n.length-1]}function d0(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:o,json:i}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function mh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function M2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pa(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function I2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Os(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function L2(e,t){try{let r=e.sessionStorage.getItem(I_);if(r){let n=JSON.parse(r);for(let[s,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function F2(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(I_,JSON.stringify(r))}catch(n){Wo(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** + */function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function $o(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function BR(){return Math.random().toString(36).substr(2,8)}function qy(e,t){return{usr:e.state,key:e.key,idx:t}}function Rl(e,t,r,n){return r===void 0&&(r=null),Rt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:r,key:t&&t.key||n||BR()})}function Bo(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function bs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function HR(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Vt.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(Rt({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Vt.Pop;let w=d(),h=w==null?null:w-c;c=w,l&&l({action:a,location:v.location,delta:h})}function p(w,h){a=Vt.Push;let g=Rl(v.location,w,h);r&&r(g,w),c=d()+1;let _=qy(g,c),C=v.createHref(g);try{i.pushState(_,"",C)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;s.location.assign(C)}o&&l&&l({action:a,location:v.location,delta:1})}function m(w,h){a=Vt.Replace;let g=Rl(v.location,w,h);r&&r(g,w),c=d();let _=qy(g,c),C=v.createHref(g);i.replaceState(_,"",C),o&&l&&l({action:a,location:v.location,delta:0})}function x(w){let h=s.location.origin!=="null"?s.location.origin:s.location.href,g=typeof w=="string"?w:Bo(w);return g=g.replace(/ $/,"%20"),Qe(h,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,h)}let v={get action(){return a},get location(){return e(s,i)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Gy,f),l=w,()=>{s.removeEventListener(Gy,f),l=null}},createHref(w){return t(s,w)},createURL:x,encodeLocation(w){let h=x(w);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:p,replace:m,go(w){return i.go(w)}};return v}var gt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(gt||(gt={}));const YR=new Set(["lazy","caseSensitive","path","id","index","children"]);function ZR(e){return e.index===!0}function jl(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((s,o)=>{let i=[...r,String(o)],a=typeof s.id=="string"?s.id:i.join("-");if(Qe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Qe(!n[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),ZR(s)){let l=Rt({},s,t(s),{id:a});return n[a]=l,l}else{let l=Rt({},s,t(s),{id:a,children:void 0});return n[a]=l,s.children&&(l.children=jl(s.children,t,i,n)),l}})}function ko(e,t,r){return r===void 0&&(r="/"),wu(e,t,r,!1)}function wu(e,t,r,n){let s=typeof t=="string"?bs(t):t,o=ca(s.pathname||"/",r);if(o==null)return null;let i=D_(e);GR(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(Qe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=ls([n,l.relativePath]),d=r.concat(l);o.children&&o.children.length>0&&(Qe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),D_(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:r2(c,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of O_(o.path))s(o,i,l)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=O_(n.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function GR(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:n2(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qR=/^:[\w-]+$/,XR=3,QR=2,JR=1,e2=10,t2=-2,Xy=e=>e==="*";function r2(e,t){let r=e.split("/"),n=r.length;return r.some(Xy)&&(n+=t2),t&&(n+=QR),r.filter(s=>!Xy(s)).reduce((s,o)=>s+(qR.test(o)?XR:o===""?JR:e2),n)}function n2(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function s2(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let v=a[f]||"";i=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const x=a[f];return m&&!x?c[p]=void 0:c[p]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function o2(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),$o(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function i2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $o(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ca(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function a2(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?bs(e):e;return{pathname:r?r.startsWith("/")?r:l2(r,t):t,search:u2(n),hash:d2(s)}}function l2(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function hh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function A_(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Gd(e,t){let r=A_(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qd(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=bs(e):(s=Rt({},e),Qe(!s.pathname||!s.pathname.includes("?"),hh("?","pathname","search",s)),Qe(!s.pathname||!s.pathname.includes("#"),hh("#","pathname","hash",s)),Qe(!s.search||!s.search.includes("#"),hh("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=a2(s,a),c=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ls=e=>e.join("/").replace(/\/\/+/g,"/"),c2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),u2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,d2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class cg{constructor(t,r,n,s){s===void 0&&(s=!1),this.status=t,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function Xd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const M_=["post","put","patch","delete"],f2=new Set(M_),h2=["get",...M_],p2=new Set(h2),m2=new Set([301,302,303,307,308]),g2=new Set([307,308]),ph={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},v2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pa={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ug=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,y2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),I_="remix-router-transitions";function x2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;Qe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;s=B=>({hasErrorBoundary:U(B)})}else s=y2;let o={},i=jl(e.routes,s,void 0,o),a,l=e.basename||"/",c=e.unstable_dataStrategy||k2,d=e.unstable_patchRoutesOnMiss,f=Rt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,m=new Set,x=null,v=null,w=null,h=e.hydrationData!=null,g=ko(i,e.history.location,l),_=null;if(g==null&&!d){let U=ur(404,{pathname:e.history.location.pathname}),{matches:B,route:G}=l0(i);g=B,_={[G.id]:U}}g&&d&&!e.hydrationData&&Uf(g,i,e.history.location.pathname).active&&(g=null);let C;if(!g)C=!1,g=[];else if(g.some(U=>U.route.lazy))C=!1;else if(!g.some(U=>U.route.loader))C=!0;else if(f.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,B=e.hydrationData?e.hydrationData.errors:null,G=re=>re.route.loader?typeof re.route.loader=="function"&&re.route.loader.hydrate===!0?!1:U&&U[re.route.id]!==void 0||B&&B[re.route.id]!==void 0:!0;if(B){let re=g.findIndex(ye=>B[ye.route.id]!==void 0);C=g.slice(0,re+1).every(G)}else C=g.every(G)}else C=e.hydrationData!=null;let T,E={historyAction:e.history.action,location:e.history.location,matches:g,initialized:C,navigation:ph,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||_,fetchers:new Map,blockers:new Map},j=Vt.Pop,O=!1,P,L=!1,q=new Map,N=null,F=!1,b=!1,W=[],te=[],$=new Map,Z=0,I=-1,Q=new Map,z=new Set,V=new Map,de=new Map,ne=new Set,se=new Map,Ee=new Map,fe=new Map,ge=!1;function be(){if(p=e.history.listen(U=>{let{action:B,location:G,delta:re}=U;if(ge){ge=!1;return}$o(Ee.size===0||re!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ye=Cc({currentLocation:E.location,nextLocation:G,historyAction:B});if(ye&&re!=null){ge=!0,e.history.go(re*-1),ri(ye,{state:"blocked",location:G,proceed(){ri(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),e.history.go(re)},reset(){let ke=new Map(E.blockers);ke.set(ye,Pa),Se({blockers:ke})}});return}return K(B,G)}),r){L2(t,q);let U=()=>F2(t,q);t.addEventListener("pagehide",U),N=()=>t.removeEventListener("pagehide",U)}return E.initialized||K(Vt.Pop,E.location,{initialHydration:!0}),T}function Pe(){p&&p(),N&&N(),m.clear(),P&&P.abort(),E.fetchers.forEach((U,B)=>$t(B)),E.blockers.forEach((U,B)=>kc(B))}function Te(U){return m.add(U),()=>m.delete(U)}function Se(U,B){B===void 0&&(B={}),E=Rt({},E,U);let G=[],re=[];f.v7_fetcherPersist&&E.fetchers.forEach((ye,ke)=>{ye.state==="idle"&&(ne.has(ke)?re.push(ke):G.push(ke))}),[...m].forEach(ye=>ye(E,{deletedFetchers:re,unstable_viewTransitionOpts:B.viewTransitionOpts,unstable_flushSync:B.flushSync===!0})),f.v7_fetcherPersist&&(G.forEach(ye=>E.fetchers.delete(ye)),re.forEach(ye=>$t(ye)))}function rt(U,B,G){var re,ye;let{flushSync:ke}=G===void 0?{}:G,Ie=E.actionData!=null&&E.navigation.formMethod!=null&&sn(E.navigation.formMethod)&&E.navigation.state==="loading"&&((re=U.state)==null?void 0:re._isRedirect)!==!0,ce;B.actionData?Object.keys(B.actionData).length>0?ce=B.actionData:ce=null:Ie?ce=E.actionData:ce=null;let He=B.loaderData?i0(E.loaderData,B.loaderData,B.matches||[],B.errors):E.loaderData,je=E.blockers;je.size>0&&(je=new Map(je),je.forEach((dt,mt)=>je.set(mt,Pa)));let De=O===!0||E.navigation.formMethod!=null&&sn(E.navigation.formMethod)&&((ye=U.state)==null?void 0:ye._isRedirect)!==!0;a&&(i=a,a=void 0),F||j===Vt.Pop||(j===Vt.Push?e.history.push(U,U.state):j===Vt.Replace&&e.history.replace(U,U.state));let ht;if(j===Vt.Pop){let dt=q.get(E.location.pathname);dt&&dt.has(U.pathname)?ht={currentLocation:E.location,nextLocation:U}:q.has(U.pathname)&&(ht={currentLocation:U,nextLocation:E.location})}else if(L){let dt=q.get(E.location.pathname);dt?dt.add(U.pathname):(dt=new Set([U.pathname]),q.set(E.location.pathname,dt)),ht={currentLocation:E.location,nextLocation:U}}Se(Rt({},B,{actionData:ce,loaderData:He,historyAction:j,location:U,initialized:!0,navigation:ph,revalidation:"idle",restoreScrollPosition:Fv(U,B.matches||E.matches),preventScrollReset:De,blockers:je}),{viewTransitionOpts:ht,flushSync:ke===!0}),j=Vt.Pop,O=!1,L=!1,F=!1,b=!1,W=[],te=[]}async function k(U,B){if(typeof U=="number"){e.history.go(U);return}let G=jp(E.location,E.matches,l,f.v7_prependBasename,U,f.v7_relativeSplatPath,B==null?void 0:B.fromRouteId,B==null?void 0:B.relative),{path:re,submission:ye,error:ke}=Jy(f.v7_normalizeFormMethod,!1,G,B),Ie=E.location,ce=Rl(E.location,re,B&&B.state);ce=Rt({},ce,e.history.encodeLocation(ce));let He=B&&B.replace!=null?B.replace:void 0,je=Vt.Push;He===!0?je=Vt.Replace:He===!1||ye!=null&&sn(ye.formMethod)&&ye.formAction===E.location.pathname+E.location.search&&(je=Vt.Replace);let De=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,ht=(B&&B.unstable_flushSync)===!0,dt=Cc({currentLocation:Ie,nextLocation:ce,historyAction:je});if(dt){ri(dt,{state:"blocked",location:ce,proceed(){ri(dt,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),k(U,B)},reset(){let mt=new Map(E.blockers);mt.set(dt,Pa),Se({blockers:mt})}});return}return await K(je,ce,{submission:ye,pendingError:ke,preventScrollReset:De,replace:B&&B.replace,enableViewTransition:B&&B.unstable_viewTransition,flushSync:ht})}function J(){if(We(),Se({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){K(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}K(j||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function K(U,B,G){P&&P.abort(),P=null,j=U,F=(G&&G.startUninterruptedRevalidation)===!0,fT(E.location,E.matches),O=(G&&G.preventScrollReset)===!0,L=(G&&G.enableViewTransition)===!0;let re=a||i,ye=G&&G.overrideNavigation,ke=ko(re,B,l),Ie=(G&&G.flushSync)===!0,ce=Uf(ke,re,B.pathname);if(ce.active&&ce.matches&&(ke=ce.matches),!ke){let{error:ct,notFoundMatches:Jt,route:Ut}=ni(B.pathname);rt(B,{matches:Jt,loaderData:{},errors:{[Ut.id]:ct}},{flushSync:Ie});return}if(E.initialized&&!b&&j2(E.location,B)&&!(G&&G.submission&&sn(G.submission.formMethod))){rt(B,{matches:ke},{flushSync:Ie});return}P=new AbortController;let He=li(e.history,B,P.signal,G&&G.submission),je;if(G&&G.pendingError)je=[Ni(ke).route.id,{type:gt.error,error:G.pendingError}];else if(G&&G.submission&&sn(G.submission.formMethod)){let ct=await D(He,B,G.submission,ke,ce.active,{replace:G.replace,flushSync:Ie});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Jt,Ut]=ct.pendingActionResult;if(jr(Ut)&&Xd(Ut.error)&&Ut.error.status===404){P=null,rt(B,{matches:ct.matches,loaderData:{},errors:{[Jt]:Ut.error}});return}}ke=ct.matches||ke,je=ct.pendingActionResult,ye=mh(B,G.submission),Ie=!1,ce.active=!1,He=li(e.history,He.url,He.signal)}let{shortCircuited:De,matches:ht,loaderData:dt,errors:mt}=await S(He,B,ke,ce.active,ye,G&&G.submission,G&&G.fetcherSubmission,G&&G.replace,G&&G.initialHydration===!0,Ie,je);De||(P=null,rt(B,Rt({matches:ht||ke},a0(je),{loaderData:dt,errors:mt})))}async function D(U,B,G,re,ye,ke){ke===void 0&&(ke={}),We();let Ie=M2(B,G);if(Se({navigation:Ie},{flushSync:ke.flushSync===!0}),ye){let je=await Ec(re,B.pathname,U.signal);if(je.type==="aborted")return{shortCircuited:!0};if(je.type==="error"){let{boundaryId:De,error:ht}=_n(B.pathname,je);return{matches:je.partialMatches,pendingActionResult:[De,{type:gt.error,error:ht}]}}else if(je.matches)re=je.matches;else{let{notFoundMatches:De,error:ht,route:dt}=ni(B.pathname);return{matches:De,pendingActionResult:[dt.id,{type:gt.error,error:ht}]}}}let ce,He=$a(re,B);if(!He.route.action&&!He.route.lazy)ce={type:gt.error,error:ur(405,{method:U.method,pathname:B.pathname,routeId:He.route.id})};else if(ce=(await ee("action",U,[He],re))[0],U.signal.aborted)return{shortCircuited:!0};if(Ro(ce)){let je;return ke&&ke.replace!=null?je=ke.replace:je=n0(ce.response.headers.get("Location"),new URL(U.url),l)===E.location.pathname+E.location.search,await X(U,ce,{submission:G,replace:je}),{shortCircuited:!0}}if(No(ce))throw ur(400,{type:"defer-action"});if(jr(ce)){let je=Ni(re,He.route.id);return(ke&&ke.replace)!==!0&&(j=Vt.Push),{matches:re,pendingActionResult:[je.route.id,ce]}}return{matches:re,pendingActionResult:[He.route.id,ce]}}async function S(U,B,G,re,ye,ke,Ie,ce,He,je,De){let ht=ye||mh(B,ke),dt=ke||Ie||d0(ht),mt=!F&&(!f.v7_partialHydration||!He);if(re){if(mt){let Mt=R(De);Se(Rt({navigation:ht},Mt!==void 0?{actionData:Mt}:{}),{flushSync:je})}let Ge=await Ec(G,B.pathname,U.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){let{boundaryId:Mt,error:Er}=_n(B.pathname,Ge);return{matches:Ge.partialMatches,loaderData:{},errors:{[Mt]:Er}}}else if(Ge.matches)G=Ge.matches;else{let{error:Mt,notFoundMatches:Er,route:Ct}=ni(B.pathname);return{matches:Er,loaderData:{},errors:{[Ct.id]:Mt}}}}let ct=a||i,[Jt,Ut]=e0(e.history,E,G,dt,B,f.v7_partialHydration&&He===!0,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,ct,l,De);if(Ps(Ge=>!(G&&G.some(Mt=>Mt.route.id===Ge))||Jt&&Jt.some(Mt=>Mt.route.id===Ge)),I=++Z,Jt.length===0&&Ut.length===0){let Ge=Yn();return rt(B,Rt({matches:G,loaderData:{},errors:De&&jr(De[1])?{[De[0]]:De[1].error}:null},a0(De),Ge?{fetchers:new Map(E.fetchers)}:{}),{flushSync:je}),{shortCircuited:!0}}if(mt){let Ge={};if(!re){Ge.navigation=ht;let Mt=R(De);Mt!==void 0&&(Ge.actionData=Mt)}Ut.length>0&&(Ge.fetchers=A(Ut)),Se(Ge,{flushSync:je})}Ut.forEach(Ge=>{$.has(Ge.key)&&ot(Ge.key),Ge.controller&&$.set(Ge.key,Ge.controller)});let ba=()=>Ut.forEach(Ge=>ot(Ge.key));P&&P.signal.addEventListener("abort",ba);let{loaderResults:Ds,fetcherResults:si}=await he(E.matches,G,Jt,Ut,U);if(U.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",ba),Ut.forEach(Ge=>$.delete(Ge.key));let oi=c0([...Ds,...si]);if(oi){if(oi.idx>=Jt.length){let Ge=Ut[oi.idx-Jt.length].key;z.add(Ge)}return await X(U,oi.result,{replace:ce}),{shortCircuited:!0}}let{loaderData:ii,errors:bn}=o0(E,G,Jt,Ds,De,Ut,si,se);se.forEach((Ge,Mt)=>{Ge.subscribe(Er=>{(Er||Ge.done)&&se.delete(Mt)})}),f.v7_partialHydration&&He&&E.errors&&Object.entries(E.errors).filter(Ge=>{let[Mt]=Ge;return!Jt.some(Er=>Er.route.id===Mt)}).forEach(Ge=>{let[Mt,Er]=Ge;bn=Object.assign(bn||{},{[Mt]:Er})});let Tc=Yn(),Nc=Wr(I),Rc=Tc||Nc||Ut.length>0;return Rt({matches:G,loaderData:ii,errors:bn},Rc?{fetchers:new Map(E.fetchers)}:{})}function R(U){if(U&&!jr(U[1]))return{[U[0]]:U[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function A(U){return U.forEach(B=>{let G=E.fetchers.get(B.key),re=Da(void 0,G?G.data:void 0);E.fetchers.set(B.key,re)}),new Map(E.fetchers)}function Y(U,B,G,re){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(U)&&ot(U);let ye=(re&&re.unstable_flushSync)===!0,ke=a||i,Ie=jp(E.location,E.matches,l,f.v7_prependBasename,G,f.v7_relativeSplatPath,B,re==null?void 0:re.relative),ce=ko(ke,Ie,l),He=Uf(ce,ke,Ie);if(He.active&&He.matches&&(ce=He.matches),!ce){kt(U,B,ur(404,{pathname:Ie}),{flushSync:ye});return}let{path:je,submission:De,error:ht}=Jy(f.v7_normalizeFormMethod,!0,Ie,re);if(ht){kt(U,B,ht,{flushSync:ye});return}let dt=$a(ce,je);if(O=(re&&re.preventScrollReset)===!0,De&&sn(De.formMethod)){M(U,B,je,dt,ce,He.active,ye,De);return}V.set(U,{routeId:B,path:je}),H(U,B,je,dt,ce,He.active,ye,De)}async function M(U,B,G,re,ye,ke,Ie,ce){We(),V.delete(U);function He(Ct){if(!Ct.route.action&&!Ct.route.lazy){let Zn=ur(405,{method:ce.formMethod,pathname:G,routeId:B});return kt(U,B,Zn,{flushSync:Ie}),!0}return!1}if(!ke&&He(re))return;let je=E.fetchers.get(U);Oe(U,I2(ce,je),{flushSync:Ie});let De=new AbortController,ht=li(e.history,G,De.signal,ce);if(ke){let Ct=await Ec(ye,G,ht.signal);if(Ct.type==="aborted")return;if(Ct.type==="error"){let{error:Zn}=_n(G,Ct);kt(U,B,Zn,{flushSync:Ie});return}else if(Ct.matches){if(ye=Ct.matches,re=$a(ye,G),He(re))return}else{kt(U,B,ur(404,{pathname:G}),{flushSync:Ie});return}}$.set(U,De);let dt=Z,ct=(await ee("action",ht,[re],ye))[0];if(ht.signal.aborted){$.get(U)===De&&$.delete(U);return}if(f.v7_fetcherPersist&&ne.has(U)){if(Ro(ct)||jr(ct)){Oe(U,Is(void 0));return}}else{if(Ro(ct))if($.delete(U),I>dt){Oe(U,Is(void 0));return}else return z.add(U),Oe(U,Da(ce)),X(ht,ct,{fetcherSubmission:ce});if(jr(ct)){kt(U,B,ct.error);return}}if(No(ct))throw ur(400,{type:"defer-action"});let Jt=E.navigation.location||E.location,Ut=li(e.history,Jt,De.signal),ba=a||i,Ds=E.navigation.state!=="idle"?ko(ba,E.navigation.location,l):E.matches;Qe(Ds,"Didn't find any matches after fetcher action");let si=++Z;Q.set(U,si);let oi=Da(ce,ct.data);E.fetchers.set(U,oi);let[ii,bn]=e0(e.history,E,Ds,ce,Jt,!1,f.v7_skipActionErrorRevalidation,b,W,te,ne,V,z,ba,l,[re.route.id,ct]);bn.filter(Ct=>Ct.key!==U).forEach(Ct=>{let Zn=Ct.key,zv=E.fetchers.get(Zn),mT=Da(void 0,zv?zv.data:void 0);E.fetchers.set(Zn,mT),$.has(Zn)&&ot(Zn),Ct.controller&&$.set(Zn,Ct.controller)}),Se({fetchers:new Map(E.fetchers)});let Tc=()=>bn.forEach(Ct=>ot(Ct.key));De.signal.addEventListener("abort",Tc);let{loaderResults:Nc,fetcherResults:Rc}=await he(E.matches,Ds,ii,bn,Ut);if(De.signal.aborted)return;De.signal.removeEventListener("abort",Tc),Q.delete(U),$.delete(U),bn.forEach(Ct=>$.delete(Ct.key));let Ge=c0([...Nc,...Rc]);if(Ge){if(Ge.idx>=ii.length){let Ct=bn[Ge.idx-ii.length].key;z.add(Ct)}return X(Ut,Ge.result)}let{loaderData:Mt,errors:Er}=o0(E,E.matches,ii,Nc,void 0,bn,Rc,se);if(E.fetchers.has(U)){let Ct=Is(ct.data);E.fetchers.set(U,Ct)}Wr(si),E.navigation.state==="loading"&&si>I?(Qe(j,"Expected pending action"),P&&P.abort(),rt(E.navigation.location,{matches:Ds,loaderData:Mt,errors:Er,fetchers:new Map(E.fetchers)})):(Se({errors:Er,loaderData:i0(E.loaderData,Mt,Ds,Er),fetchers:new Map(E.fetchers)}),b=!1)}async function H(U,B,G,re,ye,ke,Ie,ce){let He=E.fetchers.get(U);Oe(U,Da(ce,He?He.data:void 0),{flushSync:Ie});let je=new AbortController,De=li(e.history,G,je.signal);if(ke){let ct=await Ec(ye,G,De.signal);if(ct.type==="aborted")return;if(ct.type==="error"){let{error:Jt}=_n(G,ct);kt(U,B,Jt,{flushSync:Ie});return}else if(ct.matches)ye=ct.matches,re=$a(ye,G);else{kt(U,B,ur(404,{pathname:G}),{flushSync:Ie});return}}$.set(U,je);let ht=Z,mt=(await ee("loader",De,[re],ye))[0];if(No(mt)&&(mt=await V_(mt,De.signal,!0)||mt),$.get(U)===je&&$.delete(U),!De.signal.aborted){if(ne.has(U)){Oe(U,Is(void 0));return}if(Ro(mt))if(I>ht){Oe(U,Is(void 0));return}else{z.add(U),await X(De,mt);return}if(jr(mt)){kt(U,B,mt.error);return}Qe(!No(mt),"Unhandled fetcher deferred data"),Oe(U,Is(mt.data))}}async function X(U,B,G){let{submission:re,fetcherSubmission:ye,replace:ke}=G===void 0?{}:G;B.response.headers.has("X-Remix-Revalidate")&&(b=!0);let Ie=B.response.headers.get("Location");Qe(Ie,"Expected a Location header on the redirect Response"),Ie=n0(Ie,new URL(U.url),l);let ce=Rl(E.location,Ie,{_isRedirect:!0});if(r){let mt=!1;if(B.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(ug.test(Ie)){const ct=e.history.createURL(Ie);mt=ct.origin!==t.location.origin||ca(ct.pathname,l)==null}if(mt){ke?t.location.replace(Ie):t.location.assign(Ie);return}}P=null;let He=ke===!0?Vt.Replace:Vt.Push,{formMethod:je,formAction:De,formEncType:ht}=E.navigation;!re&&!ye&&je&&De&&ht&&(re=d0(E.navigation));let dt=re||ye;if(g2.has(B.response.status)&&dt&&sn(dt.formMethod))await K(He,ce,{submission:Rt({},dt,{formAction:Ie}),preventScrollReset:O});else{let mt=mh(ce,re);await K(He,ce,{overrideNavigation:mt,fetcherSubmission:ye,preventScrollReset:O})}}async function ee(U,B,G,re){try{let ye=await C2(c,U,B,G,re,o,s);return await Promise.all(ye.map((ke,Ie)=>{if(D2(ke)){let ce=ke.result;return{type:gt.redirect,response:N2(ce,B,G[Ie].route.id,re,l,f.v7_relativeSplatPath)}}return T2(ke)}))}catch(ye){return G.map(()=>({type:gt.error,error:ye}))}}async function he(U,B,G,re,ye){let[ke,...Ie]=await Promise.all([G.length?ee("loader",ye,G,B):[],...re.map(ce=>{if(ce.matches&&ce.match&&ce.controller){let He=li(e.history,ce.path,ce.controller.signal);return ee("loader",He,[ce.match],ce.matches).then(je=>je[0])}else return Promise.resolve({type:gt.error,error:ur(404,{pathname:ce.path})})})]);return await Promise.all([u0(U,G,ke,ke.map(()=>ye.signal),!1,E.loaderData),u0(U,re.map(ce=>ce.match),Ie,re.map(ce=>ce.controller?ce.controller.signal:null),!0)]),{loaderResults:ke,fetcherResults:Ie}}function We(){b=!0,W.push(...Ps()),V.forEach((U,B)=>{$.has(B)&&(te.push(B),ot(B))})}function Oe(U,B,G){G===void 0&&(G={}),E.fetchers.set(U,B),Se({fetchers:new Map(E.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function kt(U,B,G,re){re===void 0&&(re={});let ye=Ni(E.matches,B);$t(U),Se({errors:{[ye.route.id]:G},fetchers:new Map(E.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function Vr(U){return f.v7_fetcherPersist&&(de.set(U,(de.get(U)||0)+1),ne.has(U)&&ne.delete(U)),E.fetchers.get(U)||v2}function $t(U){let B=E.fetchers.get(U);$.has(U)&&!(B&&B.state==="loading"&&Q.has(U))&&ot(U),V.delete(U),Q.delete(U),z.delete(U),ne.delete(U),E.fetchers.delete(U)}function Bn(U){if(f.v7_fetcherPersist){let B=(de.get(U)||0)-1;B<=0?(de.delete(U),ne.add(U)):de.set(U,B)}else $t(U);Se({fetchers:new Map(E.fetchers)})}function ot(U){let B=$.get(U);Qe(B,"Expected fetch controller: "+U),B.abort(),$.delete(U)}function Hn(U){for(let B of U){let G=Vr(B),re=Is(G.data);E.fetchers.set(B,re)}}function Yn(){let U=[],B=!1;for(let G of z){let re=E.fetchers.get(G);Qe(re,"Expected fetcher: "+G),re.state==="loading"&&(z.delete(G),U.push(G),B=!0)}return Hn(U),B}function Wr(U){let B=[];for(let[G,re]of Q)if(re0}function Sc(U,B){let G=E.blockers.get(U)||Pa;return Ee.get(U)!==B&&Ee.set(U,B),G}function kc(U){E.blockers.delete(U),Ee.delete(U)}function ri(U,B){let G=E.blockers.get(U)||Pa;Qe(G.state==="unblocked"&&B.state==="blocked"||G.state==="blocked"&&B.state==="blocked"||G.state==="blocked"&&B.state==="proceeding"||G.state==="blocked"&&B.state==="unblocked"||G.state==="proceeding"&&B.state==="unblocked","Invalid blocker state transition: "+G.state+" -> "+B.state);let re=new Map(E.blockers);re.set(U,B),Se({blockers:re})}function Cc(U){let{currentLocation:B,nextLocation:G,historyAction:re}=U;if(Ee.size===0)return;Ee.size>1&&$o(!1,"A router only supports one blocker at a time");let ye=Array.from(Ee.entries()),[ke,Ie]=ye[ye.length-1],ce=E.blockers.get(ke);if(!(ce&&ce.state==="proceeding")&&Ie({currentLocation:B,nextLocation:G,historyAction:re}))return ke}function ni(U){let B=ur(404,{pathname:U}),G=a||i,{matches:re,route:ye}=l0(G);return Ps(),{notFoundMatches:re,route:ye,error:B}}function _n(U,B){return{boundaryId:Ni(B.partialMatches).route.id,error:ur(400,{type:"route-discovery",pathname:U,message:B.error!=null&&"message"in B.error?B.error:String(B.error)})}}function Ps(U){let B=[];return se.forEach((G,re)=>{(!U||U(re))&&(G.cancel(),B.push(re),se.delete(re))}),B}function dT(U,B,G){if(x=U,w=B,v=G||null,!h&&E.navigation===ph){h=!0;let re=Fv(E.location,E.matches);re!=null&&Se({restoreScrollPosition:re})}return()=>{x=null,w=null,v=null}}function Lv(U,B){return v&&v(U,B.map(re=>KR(re,E.loaderData)))||U.key}function fT(U,B){if(x&&w){let G=Lv(U,B);x[G]=w()}}function Fv(U,B){if(x){let G=Lv(U,B),re=x[G];if(typeof re=="number")return re}return null}function Uf(U,B,G){if(d)if(U){let re=U[U.length-1].route;if(re.path&&(re.path==="*"||re.path.endsWith("/*")))return{active:!0,matches:wu(B,G,l,!0)}}else return{active:!0,matches:wu(B,G,l,!0)||[]};return{active:!1,matches:null}}async function Ec(U,B,G){let re=U,ye=re.length>0?re[re.length-1].route:null;for(;;){let ke=a==null,Ie=a||i;try{await S2(d,B,re,Ie,o,s,fe,G)}catch(De){return{type:"error",error:De,partialMatches:re}}finally{ke&&(i=[...i])}if(G.aborted)return{type:"aborted"};let ce=ko(Ie,B,l),He=!1;if(ce){let De=ce[ce.length-1].route;if(De.index)return{type:"success",matches:ce};if(De.path&&De.path.length>0)if(De.path==="*")He=!0;else return{type:"success",matches:ce}}let je=wu(Ie,B,l,!0);if(!je||re.map(De=>De.route.id).join("-")===je.map(De=>De.route.id).join("-"))return{type:"success",matches:He?ce:null};if(re=je,ye=re[re.length-1].route,ye.path==="*")return{type:"success",matches:re}}}function hT(U){o={},a=jl(U,s,void 0,o)}function pT(U,B){let G=a==null;F_(U,B,a||i,o,s),G&&(i=[...i],Se({}))}return T={get basename(){return l},get future(){return f},get state(){return E},get routes(){return i},get window(){return t},initialize:be,subscribe:Te,enableScrollRestoration:dT,navigate:k,fetch:Y,revalidate:J,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:Vr,deleteFetcher:Bn,dispose:Pe,getBlocker:Sc,deleteBlocker:kc,patchRoutes:pT,_internalFetchControllers:$,_internalActiveDeferreds:se,_internalSetRoutes:hT},T}function w2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function jp(e,t,r,n,s,o,i,a){let l,c;if(i){l=[];for(let f of t)if(l.push(f),f.route.id===i){c=f;break}}else l=t,c=t[t.length-1];let d=qd(s||".",Gd(l,o),ca(e.pathname,r)||e.pathname,a==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&c&&c.route.index&&!dg(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:ls([r,d.pathname])),Bo(d)}function Jy(e,t,r,n){if(!n||!w2(n))return{path:r};if(n.formMethod&&!A2(n.formMethod))return{path:r,error:ur(405,{method:n.formMethod})};let s=()=>({path:r,error:ur(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=z_(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sn(i))return s();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,x)=>{let[v,w]=x;return""+m+v+"="+w+` +`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!sn(i))return s();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}Qe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=Pp(n.formData),c=n.formData;else if(n.body instanceof FormData)l=Pp(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=s0(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=s0(l)}catch{return s()}let d={formMethod:i,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(sn(d.formMethod))return{path:r,submission:d};let f=bs(r);return t&&f.search&&dg(f.search)&&l.append("index",""),f.search="?"+l,{path:Bo(f),submission:d}}function _2(e,t){let r=e;if(t){let n=e.findIndex(s=>s.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function e0(e,t,r,n,s,o,i,a,l,c,d,f,p,m,x,v){let w=v?jr(v[1])?v[1].error:v[1].data:void 0,h=e.createURL(t.location),g=e.createURL(s),_=v&&jr(v[1])?v[0]:void 0,C=_?_2(r,_):r,T=v?v[1].statusCode:void 0,E=i&&T&&T>=400,j=C.filter((P,L)=>{let{route:q}=P;if(q.lazy)return!0;if(q.loader==null)return!1;if(o)return typeof q.loader!="function"||q.loader.hydrate?!0:t.loaderData[q.id]===void 0&&(!t.errors||t.errors[q.id]===void 0);if(b2(t.loaderData,t.matches[L],P)||l.some(b=>b===P.route.id))return!0;let N=t.matches[L],F=P;return t0(P,Rt({currentUrl:h,currentParams:N.params,nextUrl:g,nextParams:F.params},n,{actionResult:w,actionStatus:T,defaultShouldRevalidate:E?!1:a||h.pathname+h.search===g.pathname+g.search||h.search!==g.search||L_(N,F)}))}),O=[];return f.forEach((P,L)=>{if(o||!r.some(W=>W.route.id===P.routeId)||d.has(L))return;let q=ko(m,P.path,x);if(!q){O.push({key:L,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(L),F=$a(q,P.path),b=!1;p.has(L)?b=!1:c.includes(L)?b=!0:N&&N.state!=="idle"&&N.data===void 0?b=a:b=t0(F,Rt({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:r[r.length-1].params},n,{actionResult:w,actionStatus:T,defaultShouldRevalidate:E?!1:a})),b&&O.push({key:L,routeId:P.routeId,path:P.path,matches:q,match:F,controller:new AbortController})}),[j,O]}function b2(e,t,r){let n=!t||r.route.id!==t.route.id,s=e[r.route.id]===void 0;return n||s}function L_(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function t0(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function S2(e,t,r,n,s,o,i,a){let l=[t,...r.map(c=>c.route.id)].join("-");try{let c=i.get(l);c||(c=e({path:t,matches:r,patch:(d,f)=>{a.aborted||F_(d,f,n,s,o)}}),i.set(l,c)),c&&P2(c)&&await c}finally{i.delete(l)}}function F_(e,t,r,n,s){if(e){var o;let i=n[e];Qe(i,"No route found to patch children into: routeId = "+e);let a=jl(t,s,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],n);i.children?i.children.push(...a):i.children=a}else{let i=jl(t,s,["patch",String(r.length||"0")],n);r.push(...i)}}async function r0(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let s=r[e.id];Qe(s,"No route found in manifest");let o={};for(let i in n){let l=s[i]!==void 0&&i!=="hasErrorBoundary";$o(!l,'Route "'+s.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!l&&!YR.has(i)&&(o[i]=n[i])}Object.assign(s,o),Object.assign(s,Rt({},t(s),{lazy:void 0}))}function k2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function C2(e,t,r,n,s,o,i,a){let l=n.reduce((f,p)=>f.add(p.route.id),new Set),c=new Set,d=await e({matches:s.map(f=>{let p=l.has(f.route.id);return Rt({},f,{shouldLoad:p,resolve:x=>(c.add(f.route.id),p?E2(t,r,f,o,i,x,a):Promise.resolve({type:gt.data,result:void 0}))})}),request:r,params:s[0].params,context:a});return s.forEach(f=>Qe(c.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,p)=>l.has(s[p].route.id))}async function E2(e,t,r,n,s,o,i){let a,l,c=d=>{let f,p=new Promise((v,w)=>f=w);l=()=>f(),t.signal.addEventListener("abort",l);let m=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):d({request:t,params:r.params,context:i},...v!==void 0?[v]:[]),x;return o?x=o(v=>m(v)):x=(async()=>{try{return{type:"data",result:await m()}}catch(v){return{type:"error",result:v}}})(),Promise.race([x,p])};try{let d=r.route[e];if(r.route.lazy)if(d){let f,[p]=await Promise.all([c(d).catch(m=>{f=m}),r0(r.route,s,n)]);if(f!==void 0)throw f;a=p}else if(await r0(r.route,s,n),d=r.route[e],d)a=await c(d);else if(e==="action"){let f=new URL(t.url),p=f.pathname+f.search;throw ur(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:gt.data,result:void 0};else if(d)a=await c(d);else{let f=new URL(t.url),p=f.pathname+f.search;throw ur(404,{pathname:p})}Qe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:gt.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function T2(e){let{result:t,type:r,status:n}=e;if(U_(t)){let i;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(a){return{type:gt.error,error:a}}return r===gt.error?{type:gt.error,error:new cg(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:gt.data,data:i,statusCode:t.status,headers:t.headers}}if(r===gt.error)return{type:gt.error,error:t,statusCode:Xd(t)?t.status:n};if(O2(t)){var s,o;return{type:gt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:gt.data,data:t,statusCode:n}}function N2(e,t,r,n,s,o){let i=e.headers.get("Location");if(Qe(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ug.test(i)){let a=n.slice(0,n.findIndex(l=>l.route.id===r)+1);i=jp(new URL(t.url),a,s,!0,i,o),e.headers.set("Location",i)}return e}function n0(e,t,r){if(ug.test(e)){let n=e,s=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=ca(s.pathname,r)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function li(e,t,r,n){let s=e.createURL(z_(t)).toString(),o={signal:r};if(n&&sn(n.formMethod)){let{formMethod:i,formEncType:a}=n;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(n.json)):a==="text/plain"?o.body=n.text:a==="application/x-www-form-urlencoded"&&n.formData?o.body=Pp(n.formData):o.body=n.formData}return new Request(s,o)}function Pp(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function s0(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function R2(e,t,r,n,s,o){let i={},a=null,l,c=!1,d={},f=n&&jr(n[1])?n[1].error:void 0;return r.forEach((p,m)=>{let x=t[m].route.id;if(Qe(!Ro(p),"Cannot handle redirect results in processLoaderData"),jr(p)){let v=p.error;f!==void 0&&(v=f,f=void 0),a=a||{};{let w=Ni(e,x);a[w.route.id]==null&&(a[w.route.id]=v)}i[x]=void 0,c||(c=!0,l=Xd(p.error)?p.error.status:500),p.headers&&(d[x]=p.headers)}else No(p)?(s.set(x,p.deferredData),i[x]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(d[x]=p.headers)):(i[x]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(l=p.statusCode),p.headers&&(d[x]=p.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:d}}function o0(e,t,r,n,s,o,i,a){let{loaderData:l,errors:c}=R2(t,r,n,s,a);for(let d=0;dn.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function l0(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ur(e,t){let{pathname:r,routeId:n,method:s,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?l='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: +`+i):s&&r&&n?l="You made a "+s+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(a="Not Found",l='No route matches URL "'+r+'"'):e===405&&(a="Method Not Allowed",s&&r&&n?l="You made a "+s.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":s&&(l='Invalid request method "'+s.toUpperCase()+'"')),new cg(e||500,a,new Error(l),!0)}function c0(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ro(r))return{result:r,idx:t}}}function z_(e){let t=typeof e=="string"?bs(e):e;return Bo(Rt({},t,{hash:""}))}function j2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function P2(e){return typeof e=="object"&&e!=null&&"then"in e}function D2(e){return U_(e.result)&&m2.has(e.result.status)}function No(e){return e.type===gt.deferred}function jr(e){return e.type===gt.error}function Ro(e){return(e&&e.type)===gt.redirect}function O2(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function U_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function A2(e){return p2.has(e.toLowerCase())}function sn(e){return f2.has(e.toLowerCase())}async function u0(e,t,r,n,s,o){for(let i=0;if.route.id===l.route.id),d=c!=null&&!L_(c,l)&&(o&&o[l.route.id])!==void 0;if(No(a)&&(s||d)){let f=n[i];Qe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await V_(a,f,s).then(p=>{p&&(r[i]=p||r[i])})}}}async function V_(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:gt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:gt.error,error:s}}return{type:gt.data,data:e.deferredData.data}}}function dg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $a(e,t){let r=typeof t=="string"?bs(t).search:t.search;if(e[e.length-1].route.index&&dg(r||""))return e[e.length-1];let n=A_(e);return n[n.length-1]}function d0(e){let{formMethod:t,formAction:r,formEncType:n,text:s,formData:o,json:i}=e;if(!(!t||!r||!n)){if(s!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function mh(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function M2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Da(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function I2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Is(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function L2(e,t){try{let r=e.sessionStorage.getItem(I_);if(r){let n=JSON.parse(r);for(let[s,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function F2(e,t){if(t.size>0){let r={};for(let[n,s]of t)r[n]=[...s];try{e.sessionStorage.setItem(I_,JSON.stringify(r))}catch(n){$o(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.25.1 * * Copyright (c) Remix Software Inc. @@ -57,7 +57,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let f=qd(c,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ls([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}const V2=y.createContext(null);function W2(e){let t=y.useContext(Ss).outlet;return t&&y.createElement(V2.Provider,{value:e},t)}function H_(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=y.useContext(po),{matches:s}=y.useContext(Ss),{pathname:o}=zn(),i=JSON.stringify(Kd(s,n.v7_relativeSplatPath));return y.useMemo(()=>qd(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function $2(e,t,r,n){ua()||Xe(!1);let{navigator:s}=y.useContext(po),{matches:o}=y.useContext(Ss),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=zn(),d;d=c;let f=d.pathname||"/",p=f;if(l!=="/"){let v=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=So(e,{pathname:p});return G2(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:ls([l,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:ls([l,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,r,n)}function B2(){let e=Q2(),t=Xd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:s},r):null,null)}const H2=y.createElement(B2,null);class Y2 extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?y.createElement(Ss.Provider,{value:this.props.routeContext},y.createElement($_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Z2(e){let{routeContext:t,match:r,children:n}=e,s=y.useContext(Qd);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Ss.Provider,{value:t},n)}function G2(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Xe(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,f,p)=>{let m,w=!1,v=null,x=null;r&&(m=a&&f.route.id?a[f.route.id]:void 0,v=f.route.errorElement||H2,l&&(c<0&&p===0?(eP("route-fallback"),w=!0,x=null):c===p&&(w=!0,x=f.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,p+1)),g=()=>{let _;return m?_=v:w?_=x:f.route.Component?_=y.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=d,y.createElement(Z2,{match:f,routeContext:{outlet:d,matches:h,isDataRoute:r!=null},children:_})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?y.createElement(Y2,{location:r.location,revalidation:r.revalidation,component:v,error:m,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var Y_=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Y_||{}),od=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(od||{});function K2(e){let t=y.useContext(Qd);return t||Xe(!1),t}function q2(e){let t=y.useContext(W_);return t||Xe(!1),t}function X2(e){let t=y.useContext(Ss);return t||Xe(!1),t}function Z_(e){let t=X2(),r=t.matches[t.matches.length-1];return r.route.id||Xe(!1),r.route.id}function Q2(){var e;let t=y.useContext($_),r=q2(od.UseRouteError),n=Z_(od.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function J2(){let{router:e}=K2(Y_.UseNavigateStable),t=Z_(od.UseNavigateStable),r=y.useRef(!1);return B_(()=>{r.current=!0}),y.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,sd({fromRouteId:t},o)))},[e,t])}const f0={};function eP(e,t,r){f0[e]||(f0[e]=!0)}function G_(e){let{to:t,replace:r,state:n,relative:s}=e;ua()||Xe(!1);let{future:o,static:i}=y.useContext(po),{matches:a}=y.useContext(Ss),{pathname:l}=zn(),c=Un(),d=qd(t,Kd(a,o.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return y.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:s}),[c,f,s,r,n]),null}function hg(e){return W2(e.context)}function tP(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Vt.Pop,navigator:o,static:i=!1,future:a}=e;ua()&&Xe(!1);let l=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:o,static:i,future:sd({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=bs(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:w="default"}=n,v=y.useMemo(()=>{let x=ca(d,l);return x==null?null:{location:{pathname:x,search:f,hash:p,state:m,key:w},navigationType:s}},[l,d,f,p,m,w,s]);return v==null?null:y.createElement(po.Provider,{value:c},y.createElement(fg.Provider,{children:r,value:v}))}new Promise(()=>{});function rP(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let f=qd(c,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ls([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}const V2=y.createContext(null);function W2(e){let t=y.useContext(Ss).outlet;return t&&y.createElement(V2.Provider,{value:e},t)}function H_(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=y.useContext(vo),{matches:s}=y.useContext(Ss),{pathname:o}=zn(),i=JSON.stringify(Gd(s,n.v7_relativeSplatPath));return y.useMemo(()=>qd(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function $2(e,t,r,n){ua()||Qe(!1);let{navigator:s}=y.useContext(vo),{matches:o}=y.useContext(Ss),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=zn(),d;d=c;let f=d.pathname||"/",p=f;if(l!=="/"){let v=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=ko(e,{pathname:p});return K2(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:ls([l,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:ls([l,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,r,n)}function B2(){let e=Q2(),t=Xd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:s},r):null,null)}const H2=y.createElement(B2,null);class Y2 extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?y.createElement(Ss.Provider,{value:this.props.routeContext},y.createElement($_.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Z2(e){let{routeContext:t,match:r,children:n}=e,s=y.useContext(Qd);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Ss.Provider,{value:t},n)}function K2(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let i=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Qe(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,f,p)=>{let m,x=!1,v=null,w=null;r&&(m=a&&f.route.id?a[f.route.id]:void 0,v=f.route.errorElement||H2,l&&(c<0&&p===0?(ej("route-fallback"),x=!0,w=null):c===p&&(x=!0,w=f.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,p+1)),g=()=>{let _;return m?_=v:x?_=w:f.route.Component?_=y.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=d,y.createElement(Z2,{match:f,routeContext:{outlet:d,matches:h,isDataRoute:r!=null},children:_})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?y.createElement(Y2,{location:r.location,revalidation:r.revalidation,component:v,error:m,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var Y_=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Y_||{}),od=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(od||{});function G2(e){let t=y.useContext(Qd);return t||Qe(!1),t}function q2(e){let t=y.useContext(W_);return t||Qe(!1),t}function X2(e){let t=y.useContext(Ss);return t||Qe(!1),t}function Z_(e){let t=X2(),r=t.matches[t.matches.length-1];return r.route.id||Qe(!1),r.route.id}function Q2(){var e;let t=y.useContext($_),r=q2(od.UseRouteError),n=Z_(od.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function J2(){let{router:e}=G2(Y_.UseNavigateStable),t=Z_(od.UseNavigateStable),r=y.useRef(!1);return B_(()=>{r.current=!0}),y.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,sd({fromRouteId:t},o)))},[e,t])}const f0={};function ej(e,t,r){f0[e]||(f0[e]=!0)}function K_(e){let{to:t,replace:r,state:n,relative:s}=e;ua()||Qe(!1);let{future:o,static:i}=y.useContext(vo),{matches:a}=y.useContext(Ss),{pathname:l}=zn(),c=Un(),d=qd(t,Gd(a,o.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return y.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:s}),[c,f,s,r,n]),null}function hg(e){return W2(e.context)}function tj(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Vt.Pop,navigator:o,static:i=!1,future:a}=e;ua()&&Qe(!1);let l=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:o,static:i,future:sd({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=bs(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:x="default"}=n,v=y.useMemo(()=>{let w=ca(d,l);return w==null?null:{location:{pathname:w,search:f,hash:p,state:m,key:x},navigationType:s}},[l,d,f,p,m,x,s]);return v==null?null:y.createElement(vo.Provider,{value:c},y.createElement(fg.Provider,{children:r,value:v}))}new Promise(()=>{});function rj(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.25.1 * * Copyright (c) Remix Software Inc. @@ -66,27 +66,27 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function sP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oP(e,t){return e.button===0&&(!t||t==="_self")&&!sP(e)}function Dp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function iP(e,t){let r=Dp(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const aP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lP="6";try{window.__reactRouterVersion=lP}catch{}function cP(e,t){return w2({basename:void 0,future:Rl({},void 0,{v7_prependBasename:!0}),history:$R({window:void 0}),hydrationData:uP(),routes:e,mapRouteProperties:rP,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function uP(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Rl({},t,{errors:dP(t.errors)})),t}function dP(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,s]of t)if(s&&s.__type==="RouteErrorResponse")r[n]=new cg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(s.message);o.stack="",r[n]=o}}else r[n]=s;return r}const fP=y.createContext({isTransitioning:!1}),hP=y.createContext(new Map),pP="startTransition",h0=Nw[pP],mP="flushSync",p0=WR[mP];function gP(e){h0?h0(e):e()}function ja(e){p0?p0(e):e()}class vP{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function yP(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=y.useState(r.state),[i,a]=y.useState(),[l,c]=y.useState({isTransitioning:!1}),[d,f]=y.useState(),[p,m]=y.useState(),[w,v]=y.useState(),x=y.useRef(new Map),{v7_startTransition:h}=n||{},g=y.useCallback(O=>{h?gP(O):O()},[h]),_=y.useCallback((O,j)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:N}=j;L.forEach(b=>x.current.delete(b)),O.fetchers.forEach((b,W)=>{b.data!==void 0&&x.current.set(W,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!N||F){q?ja(()=>o(O)):g(()=>o(O));return}if(q){ja(()=>{p&&(d&&d.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let b=r.window.document.startViewTransition(()=>{ja(()=>o(O))});b.finished.finally(()=>{ja(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})})}),ja(()=>m(b));return}p?(d&&d.resolve(),p.skipTransition(),v({state:O,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(O),c({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[r.window,p,d,x,g]);y.useLayoutEffect(()=>r.subscribe(_),[r,_]),y.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new vP)},[l]),y.useEffect(()=>{if(d&&i&&r.window){let O=i,j=d.promise,L=r.window.document.startViewTransition(async()=>{g(()=>o(O)),await j});L.finished.finally(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})}),m(L)}},[g,i,d,r.window]),y.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,p,s.location,i]),y.useEffect(()=>{!l.isTransitioning&&w&&(a(w.state),c({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),v(void 0))},[l.isTransitioning,w]),y.useEffect(()=>{},[]);let C=y.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:O=>r.navigate(O),push:(O,j,L)=>r.navigate(O,{state:j,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(O,j,L)=>r.navigate(O,{replace:!0,state:j,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),T=r.basename||"/",E=y.useMemo(()=>({router:r,navigator:C,static:!1,basename:T}),[r,C,T]),P=y.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return y.createElement(y.Fragment,null,y.createElement(Qd.Provider,{value:E},y.createElement(W_.Provider,{value:s},y.createElement(hP.Provider,{value:x.current},y.createElement(fP.Provider,{value:l},y.createElement(tP,{basename:T,location:s.location,navigationType:s.historyAction,navigator:C,future:P},s.initialized||r.future.v7_partialHydration?y.createElement(wP,{routes:r.routes,future:r.future,state:s}):t))))),null)}const wP=y.memo(xP);function xP(e){let{routes:t,future:r,state:n}=e;return $2(t,void 0,n,r)}const _P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xn=y.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:d,unstable_viewTransition:f}=t,p=nP(t,aP),{basename:m}=y.useContext(po),w,v=!1;if(typeof c=="string"&&bP.test(c)&&(w=c,_P))try{let _=new URL(window.location.href),C=c.startsWith("//")?new URL(_.protocol+c):new URL(c),T=ca(C.pathname,m);C.origin===_.origin&&T!=null?c=T+C.search+C.hash:v=!0}catch{}let x=z2(c,{relative:s}),h=SP(c,{replace:i,state:a,target:l,preventScrollReset:d,relative:s,unstable_viewTransition:f});function g(_){n&&n(_),_.defaultPrevented||h(_)}return y.createElement("a",Rl({},p,{href:w||x,onClick:v||o?n:g,ref:r,target:l}))});var m0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(m0||(m0={}));var g0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(g0||(g0={}));function SP(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,l=Un(),c=zn(),d=H_(e,{relative:i});return y.useCallback(f=>{if(oP(f,r)){f.preventDefault();let p=n!==void 0?n:$o(c)===$o(d);l(e,{replace:p,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[c,l,d,n,s,r,e,o,i,a])}function kP(e){let t=y.useRef(Dp(e)),r=y.useRef(!1),n=zn(),s=y.useMemo(()=>iP(n.search,r.current?null:t.current),[n.search]),o=Un(),i=y.useCallback((a,l)=>{const c=Dp(typeof a=="function"?a(s):a);r.current=!0,o("?"+c,l)},[o,s]);return[s,i]}/** + */function Pl(){return Pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function sj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oj(e,t){return e.button===0&&(!t||t==="_self")&&!sj(e)}function Dp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function ij(e,t){let r=Dp(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(o=>{r.append(s,o)})}),r}const aj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],lj="6";try{window.__reactRouterVersion=lj}catch{}function cj(e,t){return x2({basename:void 0,future:Pl({},void 0,{v7_prependBasename:!0}),history:$R({window:void 0}),hydrationData:uj(),routes:e,mapRouteProperties:rj,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function uj(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Pl({},t,{errors:dj(t.errors)})),t}function dj(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,s]of t)if(s&&s.__type==="RouteErrorResponse")r[n]=new cg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(s.message);o.stack="",r[n]=o}}else r[n]=s;return r}const fj=y.createContext({isTransitioning:!1}),hj=y.createContext(new Map),pj="startTransition",h0=Nx[pj],mj="flushSync",p0=WR[mj];function gj(e){h0?h0(e):e()}function Oa(e){p0?p0(e):e()}class vj{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function yj(e){let{fallbackElement:t,router:r,future:n}=e,[s,o]=y.useState(r.state),[i,a]=y.useState(),[l,c]=y.useState({isTransitioning:!1}),[d,f]=y.useState(),[p,m]=y.useState(),[x,v]=y.useState(),w=y.useRef(new Map),{v7_startTransition:h}=n||{},g=y.useCallback(O=>{h?gj(O):O()},[h]),_=y.useCallback((O,P)=>{let{deletedFetchers:L,unstable_flushSync:q,unstable_viewTransitionOpts:N}=P;L.forEach(b=>w.current.delete(b)),O.fetchers.forEach((b,W)=>{b.data!==void 0&&w.current.set(W,b.data)});let F=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!N||F){q?Oa(()=>o(O)):g(()=>o(O));return}if(q){Oa(()=>{p&&(d&&d.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let b=r.window.document.startViewTransition(()=>{Oa(()=>o(O))});b.finished.finally(()=>{Oa(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})})}),Oa(()=>m(b));return}p?(d&&d.resolve(),p.skipTransition(),v({state:O,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(O),c({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[r.window,p,d,w,g]);y.useLayoutEffect(()=>r.subscribe(_),[r,_]),y.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new vj)},[l]),y.useEffect(()=>{if(d&&i&&r.window){let O=i,P=d.promise,L=r.window.document.startViewTransition(async()=>{g(()=>o(O)),await P});L.finished.finally(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})}),m(L)}},[g,i,d,r.window]),y.useEffect(()=>{d&&i&&s.location.key===i.location.key&&d.resolve()},[d,p,s.location,i]),y.useEffect(()=>{!l.isTransitioning&&x&&(a(x.state),c({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),v(void 0))},[l.isTransitioning,x]),y.useEffect(()=>{},[]);let C=y.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:O=>r.navigate(O),push:(O,P,L)=>r.navigate(O,{state:P,preventScrollReset:L==null?void 0:L.preventScrollReset}),replace:(O,P,L)=>r.navigate(O,{replace:!0,state:P,preventScrollReset:L==null?void 0:L.preventScrollReset})}),[r]),T=r.basename||"/",E=y.useMemo(()=>({router:r,navigator:C,static:!1,basename:T}),[r,C,T]),j=y.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return y.createElement(y.Fragment,null,y.createElement(Qd.Provider,{value:E},y.createElement(W_.Provider,{value:s},y.createElement(hj.Provider,{value:w.current},y.createElement(fj.Provider,{value:l},y.createElement(tj,{basename:T,location:s.location,navigationType:s.historyAction,navigator:C,future:j},s.initialized||r.future.v7_partialHydration?y.createElement(xj,{routes:r.routes,future:r.future,state:s}):t))))),null)}const xj=y.memo(wj);function wj(e){let{routes:t,future:r,state:n}=e;return $2(t,void 0,n,r)}const _j=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xn=y.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:d,unstable_viewTransition:f}=t,p=nj(t,aj),{basename:m}=y.useContext(vo),x,v=!1;if(typeof c=="string"&&bj.test(c)&&(x=c,_j))try{let _=new URL(window.location.href),C=c.startsWith("//")?new URL(_.protocol+c):new URL(c),T=ca(C.pathname,m);C.origin===_.origin&&T!=null?c=T+C.search+C.hash:v=!0}catch{}let w=z2(c,{relative:s}),h=Sj(c,{replace:i,state:a,target:l,preventScrollReset:d,relative:s,unstable_viewTransition:f});function g(_){n&&n(_),_.defaultPrevented||h(_)}return y.createElement("a",Pl({},p,{href:x||w,onClick:v||o?n:g,ref:r,target:l}))});var m0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(m0||(m0={}));var g0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(g0||(g0={}));function Sj(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,l=Un(),c=zn(),d=H_(e,{relative:i});return y.useCallback(f=>{if(oj(f,r)){f.preventDefault();let p=n!==void 0?n:Bo(c)===Bo(d);l(e,{replace:p,state:s,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[c,l,d,n,s,r,e,o,i,a])}function kj(e){let t=y.useRef(Dp(e)),r=y.useRef(!1),n=zn(),s=y.useMemo(()=>ij(n.search,r.current?null:t.current),[n.search]),o=Un(),i=y.useCallback((a,l)=>{const c=Dp(typeof a=="function"?a(s):a);r.current=!0,o("?"+c,l)},[o,s]);return[s,i]}/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K_=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** + */const Cj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G_=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var EP={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var Ej={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TP=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>y.createElement("svg",{ref:l,...EP,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:K_("lucide",s),...a},[...i.map(([c,d])=>y.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** + */const Tj=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>y.createElement("svg",{ref:l,...Ej,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:G_("lucide",s),...a},[...i.map(([c,d])=>y.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qt=(e,t)=>{const r=y.forwardRef(({className:n,...s},o)=>y.createElement(TP,{ref:o,iconNode:t,className:K_(`lucide-${CP(e)}`,n),...s}));return r.displayName=`${e}`,r};/** + */const qt=(e,t)=>{const r=y.forwardRef(({className:n,...s},o)=>y.createElement(Tj,{ref:o,iconNode:t,className:G_(`lucide-${Cj(e)}`,n),...s}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -101,12 +101,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NP=qt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Nj=qt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RP=qt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const Rj=qt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -116,7 +116,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PP=qt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + */const jj=qt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -126,7 +126,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jP=qt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const Pj=qt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -136,7 +136,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DP=qt("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"}]]);/** + */const Dj=qt("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"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -146,17 +146,17 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OP=qt("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** + */const Oj=qt("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AP=qt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** + */const Aj=qt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MP=qt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const Mj=qt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. @@ -166,22 +166,22 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const w0=qt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + */const x0=qt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IP=qt("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** + */const Ij=qt("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LP=qt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + */const Lj=qt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.417.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pg=qt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function FP(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jd(...e){return t=>e.forEach(r=>FP(r,t))}function Ke(...e){return y.useCallback(Jd(...e),e)}var ms=y.forwardRef((e,t)=>{const{children:r,...n}=e,s=y.Children.toArray(r),o=s.find(zP);if(o){const i=o.props.children,a=s.map(l=>l===o?y.Children.count(i)>1?y.Children.only(null):y.isValidElement(i)?i.props.children:null:l);return u.jsx(Ap,{...n,ref:t,children:y.isValidElement(i)?y.cloneElement(i,void 0,a):null})}return u.jsx(Ap,{...n,ref:t,children:r})});ms.displayName="Slot";var Ap=y.forwardRef((e,t)=>{const{children:r,...n}=e;if(y.isValidElement(r)){const s=VP(r);return y.cloneElement(r,{...UP(n,r.props),ref:t?Jd(t,s):s})}return y.Children.count(r)>1?y.Children.only(null):null});Ap.displayName="SlotClone";var mg=({children:e})=>u.jsx(u.Fragment,{children:e});function zP(e){return y.isValidElement(e)&&e.type===mg}function UP(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function VP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function e1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,_0=WP,sc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return _0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const d=r==null?void 0:r[c],f=o==null?void 0:o[c];if(d===null)return null;const p=x0(d)||x0(f);return s[c][p]}),a=r&&Object.entries(r).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(w=>{let[v,x]=w;return Array.isArray(x)?x.includes({...o,...a}[v]):{...o,...a}[v]===x})?[...c,f,p]:c},[]);return _0(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};function t1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ta(o)))==null?void 0:i.classGroupId}const b0=/^\[(.+)\]$/;function HP(e){if(b0.test(e)){const t=b0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function YP(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return GP(Object.entries(e.classGroups),r).forEach(([o,i])=>{Mp(i,n,o,t)}),n}function Mp(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:S0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(ZP(s)){Mp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Mp(i,S0(t,o),r,n)})})}function S0(e,t){let r=e;return t.split(gg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function ZP(e){return e.isThemeGetter}function GP(e,t){return t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e}function KP(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(o,i){r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)}return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}}const n1="!";function qP(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(a){const l=[];let c=0,d=0,f;for(let x=0;xd?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:v}}return r?function(l){return r({className:l,parseClassName:i})}:i}function XP(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function QP(e){return{cache:KP(e.cacheSize),parseClassName:qP(e),...BP(e)}}const JP=/\s+/;function ej(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(JP).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=r(i);let f=!!d,p=n(f?c.substring(0,d):c);if(!p){if(!f)return{isTailwindClass:!1,originalClassName:i};if(p=n(c),!p)return{isTailwindClass:!1,originalClassName:i};f=!1}const m=XP(a).join(":");return{isTailwindClass:!0,modifierId:l?m+n1:m,classGroupId:p,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=i,d=a+l;return o.has(d)?!1:(o.add(d),s(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function tj(){let e=0,t,r,n="";for(;ef(d),e());return r=QP(c),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const d=ej(l,r);return s(l,d),d}return function(){return o(tj.apply(null,arguments))}}function yt(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const o1=/^\[(?:([a-z-]+):)?(.+)\]$/i,nj=/^\d+\/\d+$/,sj=new Set(["px","full","screen"]),oj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ij=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Gn(e){return Ro(e)||sj.has(e)||nj.test(e)}function js(e){return da(e,"length",vj)}function Ro(e){return!!e&&!Number.isNaN(Number(e))}function Gc(e){return da(e,"number",Ro)}function Da(e){return!!e&&Number.isInteger(Number(e))}function uj(e){return e.endsWith("%")&&Ro(e.slice(0,-1))}function We(e){return o1.test(e)}function Ds(e){return oj.test(e)}const dj=new Set(["length","size","percentage"]);function fj(e){return da(e,dj,i1)}function hj(e){return da(e,"position",i1)}const pj=new Set(["image","url"]);function mj(e){return da(e,pj,wj)}function gj(e){return da(e,"",yj)}function Oa(){return!0}function da(e,t,r){const n=o1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function vj(e){return ij.test(e)&&!aj.test(e)}function i1(){return!1}function yj(e){return lj.test(e)}function wj(e){return cj.test(e)}function xj(){const e=yt("colors"),t=yt("spacing"),r=yt("blur"),n=yt("brightness"),s=yt("borderColor"),o=yt("borderRadius"),i=yt("borderSpacing"),a=yt("borderWidth"),l=yt("contrast"),c=yt("grayscale"),d=yt("hueRotate"),f=yt("invert"),p=yt("gap"),m=yt("gradientColorStops"),w=yt("gradientColorStopPositions"),v=yt("inset"),x=yt("margin"),h=yt("opacity"),g=yt("padding"),_=yt("saturate"),C=yt("scale"),T=yt("sepia"),E=yt("skew"),P=yt("space"),O=yt("translate"),j=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",We,t],N=()=>[We,t],F=()=>["",Gn,js],b=()=>["auto",Ro,We],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",We],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Ro,Gc],V=()=>[Ro,We];return{cacheSize:500,separator:":",theme:{colors:[Oa],spacing:[Gn,js],blur:["none","",Ds,We],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ds,We],borderSpacing:N(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:V(),invert:I(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[uj,js],inset:q(),margin:q(),opacity:z(),padding:N(),saturate:z(),scale:z(),sepia:I(),skew:V(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",We]}],container:["container"],columns:[{columns:[Ds]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),We]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Da,We]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",We]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Da,We]}],"grid-cols":[{"grid-cols":[Oa]}],"col-start-end":[{col:["auto",{span:["full",Da,We]},We]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Oa]}],"row-start-end":[{row:["auto",{span:[Da,We]},We]}],"row-start":[{"row-start":b()}],"row-end":[{"row-end":b()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",We]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",We]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",We,t]}],"min-w":[{"min-w":[We,t,"min","max","fit"]}],"max-w":[{"max-w":[We,t,"none","full","min","max","fit","prose",{screen:[Ds]},Ds]}],h:[{h:[We,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[We,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ds,js]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gc]}],"font-family":[{font:[Oa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",We]}],"line-clamp":[{"line-clamp":["none",Ro,Gc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gn,We]}],"list-image":[{"list-image":["none",We]}],"list-style-type":[{list:["none","disc","decimal",We]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gn,js]}],"underline-offset":[{"underline-offset":["auto",Gn,We]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),hj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:te()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[Gn,We]}],"outline-w":[{outline:[Gn,js]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Gn,js]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ds,gj]}],"shadow-color":[{shadow:[Oa]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ds,We]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",We]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",We]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",We]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Da,We]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",We]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Gn,js,Gc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const _j=rj(xj);function ve(...e){return _j($P(e))}const ef=sc("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xt=y.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?ms:"button";return u.jsx(i,{className:ve(ef({variant:t,size:r,className:e})),ref:o,...s})});xt.displayName="Button";function ue(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function bj(e,t){const r=y.createContext(t);function n(o){const{children:i,...a}=o,l=y.useMemo(()=>a,Object.values(a));return u.jsx(r.Provider,{value:l,children:i})}function s(o){const i=y.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function Xr(e,t=[]){let r=[];function n(o,i){const a=y.createContext(i),l=r.length;r=[...r,i];function c(f){const{scope:p,children:m,...w}=f,v=(p==null?void 0:p[e][l])||a,x=y.useMemo(()=>w,Object.values(w));return u.jsx(v.Provider,{value:x,children:m})}function d(f,p){const m=(p==null?void 0:p[e][l])||a,w=y.useContext(m);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const s=()=>{const o=r.map(i=>y.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,Sj(s,...t)]}function Sj(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function jt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function ro({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=kj({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=jt(r),l=y.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function kj({defaultProp:e,onChange:t}){const r=y.useState(e),[n]=r,s=y.useRef(n),o=jt(t);return y.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var Cj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Me=Cj.reduce((e,t)=>{const r=y.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?ms:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vg(e,t){e&&_s.flushSync(()=>e.dispatchEvent(t))}function tf(e){const t=e+"CollectionProvider",[r,n]=Xr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:w,children:v}=m,x=et.useRef(null),h=et.useRef(new Map).current;return u.jsx(s,{scope:w,itemMap:h,collectionRef:x,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=et.forwardRef((m,w)=>{const{scope:v,children:x}=m,h=o(a,v),g=Ke(w,h.collectionRef);return u.jsx(ms,{ref:g,children:x})});l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=et.forwardRef((m,w)=>{const{scope:v,children:x,...h}=m,g=et.useRef(null),_=Ke(w,g),C=o(c,v);return et.useEffect(()=>(C.itemMap.set(g,{ref:g,...h}),()=>void C.itemMap.delete(g))),u.jsx(ms,{[d]:"",ref:_,children:x})});f.displayName=c;function p(m){const w=o(e+"CollectionConsumer",m);return et.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const h=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((C,T)=>h.indexOf(C.ref.current)-h.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},p,n]}var Ej=y.createContext(void 0);function rf(e){const t=y.useContext(Ej);return e||t||"ltr"}function Tj(e,t=globalThis==null?void 0:globalThis.document){const r=jt(e);y.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Nj="DismissableLayer",Ip="dismissableLayer.update",Rj="dismissableLayer.pointerDownOutside",Pj="dismissableLayer.focusOutside",k0,a1=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fa=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=y.useContext(a1),[d,f]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),w=Ke(t,P=>f(P)),v=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(x),g=d?v.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,C=g>=h,T=Dj(P=>{const O=P.target,j=[...c.branches].some(L=>L.contains(O));!C||j||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},p),E=Oj(P=>{const O=P.target;[...c.branches].some(L=>L.contains(O))||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},p);return Tj(P=>{g===c.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),y.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(k0=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),C0(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=k0)}},[d,p,r,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),C0())},[d,c]),y.useEffect(()=>{const P=()=>m({});return document.addEventListener(Ip,P),()=>document.removeEventListener(Ip,P)},[]),u.jsx(Me.div,{...l,ref:w,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,T.onPointerDownCapture)})});fa.displayName=Nj;var jj="DismissableLayerBranch",l1=y.forwardRef((e,t)=>{const r=y.useContext(a1),n=y.useRef(null),s=Ke(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(Me.div,{...e,ref:s})});l1.displayName=jj;function Dj(e,t=globalThis==null?void 0:globalThis.document){const r=jt(e),n=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){c1(Rj,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Oj(e,t=globalThis==null?void 0:globalThis.document){const r=jt(e),n=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!n.current&&c1(Pj,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function C0(){const e=new CustomEvent(Ip);document.dispatchEvent(e)}function c1(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vg(s,o):s.dispatchEvent(o)}var Aj=fa,Mj=l1,gh=0;function yg(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??E0()),document.body.insertAdjacentElement("beforeend",e[1]??E0()),gh++,()=>{gh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gh--}},[])}function E0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var vh="focusScope.autoFocusOnMount",yh="focusScope.autoFocusOnUnmount",T0={bubbles:!1,cancelable:!0},Ij="FocusScope",nf=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=y.useState(null),c=jt(s),d=jt(o),f=y.useRef(null),p=Ke(t,v=>l(v)),m=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let v=function(_){if(m.paused||!a)return;const C=_.target;a.contains(C)?f.current=C:As(f.current,{select:!0})},x=function(_){if(m.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||As(f.current,{select:!0}))},h=function(_){if(document.activeElement===document.body)for(const T of _)T.removedNodes.length>0&&As(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const g=new MutationObserver(h);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),g.disconnect()}}},[n,a,m.paused]),y.useEffect(()=>{if(a){R0.add(m);const v=document.activeElement;if(!a.contains(v)){const h=new CustomEvent(vh,T0);a.addEventListener(vh,c),a.dispatchEvent(h),h.defaultPrevented||(Lj(Wj(u1(a)),{select:!0}),document.activeElement===v&&As(a))}return()=>{a.removeEventListener(vh,c),setTimeout(()=>{const h=new CustomEvent(yh,T0);a.addEventListener(yh,d),a.dispatchEvent(h),h.defaultPrevented||As(v??document.body,{select:!0}),a.removeEventListener(yh,d),R0.remove(m)},0)}}},[a,c,d,m]);const w=y.useCallback(v=>{if(!r&&!n||m.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,h=document.activeElement;if(x&&h){const g=v.currentTarget,[_,C]=Fj(g);_&&C?!v.shiftKey&&h===C?(v.preventDefault(),r&&As(_,{select:!0})):v.shiftKey&&h===_&&(v.preventDefault(),r&&As(C,{select:!0})):h===g&&v.preventDefault()}},[r,n,m.paused]);return u.jsx(Me.div,{tabIndex:-1,...i,ref:p,onKeyDown:w})});nf.displayName=Ij;function Lj(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(As(n,{select:t}),document.activeElement!==r)return}function Fj(e){const t=u1(e),r=N0(t,e),n=N0(t.reverse(),e);return[r,n]}function u1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function N0(e,t){for(const r of e)if(!zj(r,{upTo:t}))return r}function zj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Uj(e){return e instanceof HTMLInputElement&&"select"in e}function As(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Uj(e)&&t&&e.select()}}var R0=Vj();function Vj(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=P0(e,t),e.unshift(t)},remove(t){var r;e=P0(e,t),(r=e[0])==null||r.resume()}}}function P0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Wj(e){return e.filter(t=>t.tagName!=="A")}var nr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},$j=Nw.useId||(()=>{}),Bj=0;function On(e){const[t,r]=y.useState($j());return nr(()=>{r(n=>n??String(Bj++))},[e]),t?`radix-${t}`:""}const Hj=["top","right","bottom","left"],Rn=Math.min,jr=Math.max,id=Math.round,Kc=Math.floor,no=e=>({x:e,y:e}),Yj={left:"right",right:"left",bottom:"top",top:"bottom"},Zj={start:"end",end:"start"};function Lp(e,t,r){return jr(e,Rn(t,r))}function gs(e,t){return typeof e=="function"?e(t):e}function vs(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function wg(e){return e==="x"?"y":"x"}function xg(e){return e==="y"?"height":"width"}function so(e){return["top","bottom"].includes(vs(e))?"y":"x"}function _g(e){return wg(so(e))}function Gj(e,t,r){r===void 0&&(r=!1);const n=ha(e),s=_g(e),o=xg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ad(i)),[i,ad(i)]}function Kj(e){const t=ad(e);return[Fp(e),t,Fp(t)]}function Fp(e){return e.replace(/start|end/g,t=>Zj[t])}function qj(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function Xj(e,t,r,n){const s=ha(e);let o=qj(vs(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Fp)))),o}function ad(e){return e.replace(/left|right|bottom|top/g,t=>Yj[t])}function Qj(e){return{top:0,right:0,bottom:0,left:0,...e}}function d1(e){return typeof e!="number"?Qj(e):{top:e,right:e,bottom:e,left:e}}function ld(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function j0(e,t,r){let{reference:n,floating:s}=e;const o=so(t),i=_g(t),a=xg(i),l=vs(t),c=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(ha(t)){case"start":m[i]-=p*(r&&c?-1:1);break;case"end":m[i]+=p*(r&&c?-1:1);break}return m}const Jj=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=j0(c,n,l),p=n,m={},w=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=gs(e,t)||{};if(c==null)return{};const f=d1(d),p={x:r,y:n},m=_g(s),w=xg(m),v=await i.getDimensions(c),x=m==="y",h=x?"top":"left",g=x?"bottom":"right",_=x?"clientHeight":"clientWidth",C=o.reference[w]+o.reference[m]-p[m]-o.floating[w],T=p[m]-o.reference[m],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let P=E?E[_]:0;(!P||!await(i.isElement==null?void 0:i.isElement(E)))&&(P=a.floating[_]||o.floating[w]);const O=C/2-T/2,j=P/2-v[w]/2-1,L=Rn(f[h],j),q=Rn(f[g],j),N=L,F=P-v[w]-q,b=P/2-v[w]/2+O,W=Lp(N,b,F),te=!l.arrow&&ha(s)!=null&&b!==W&&o.reference[w]/2-(bb<=0)){var q,N;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,W=P[b];if(W)return{data:{index:b,overflows:L},reset:{placement:W}};let te=(N=L.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(m){case"bestFit":{var F;const $=(F=L.filter(Z=>{if(E){const I=so(Z.placement);return I===g||I==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(I=>I>0).reduce((I,Q)=>I+Q,0)]).sort((Z,I)=>Z[1]-I[1])[0])==null?void 0:F[0];$&&(te=$);break}case"initialPlacement":te=a;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function D0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O0(e){return Hj.some(t=>e[t]>=0)}const rD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=gs(e,t);switch(n){case"referenceHidden":{const o=await Pl(t,{...s,elementContext:"reference"}),i=D0(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:O0(i)}}}case"escaped":{const o=await Pl(t,{...s,altBoundary:!0}),i=D0(o,r.floating);return{data:{escapedOffsets:i,escaped:O0(i)}}}default:return{}}}}};async function nD(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=vs(r),a=ha(r),l=so(r)==="y",c=["left","top"].includes(i)?-1:1,d=o&&l?-1:1,f=gs(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof w=="number"&&(m=a==="end"?w*-1:w),l?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const sD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await nD(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},oD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:h,y:g}=x;return{x:h,y:g}}},...l}=gs(e,t),c={x:r,y:n},d=await Pl(t,l),f=so(vs(s)),p=wg(f);let m=c[p],w=c[f];if(o){const x=p==="y"?"top":"left",h=p==="y"?"bottom":"right",g=m+d[x],_=m-d[h];m=Lp(g,m,_)}if(i){const x=f==="y"?"top":"left",h=f==="y"?"bottom":"right",g=w+d[x],_=w-d[h];w=Lp(g,w,_)}const v=a.fn({...t,[p]:m,[f]:w});return{...v,data:{x:v.x-r,y:v.y-n}}}}},iD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gs(e,t),d={x:r,y:n},f=so(s),p=wg(f);let m=d[p],w=d[f];const v=gs(a,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const _=p==="y"?"height":"width",C=o.reference[p]-o.floating[_]+x.mainAxis,T=o.reference[p]+o.reference[_]-x.mainAxis;mT&&(m=T)}if(c){var h,g;const _=p==="y"?"width":"height",C=["top","left"].includes(vs(s)),T=o.reference[f]-o.floating[_]+(C&&((h=i.offset)==null?void 0:h[f])||0)+(C?0:x.crossAxis),E=o.reference[f]+o.reference[_]+(C?0:((g=i.offset)==null?void 0:g[f])||0)-(C?x.crossAxis:0);wE&&(w=E)}return{[p]:m,[f]:w}}}},aD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:o}=t,{apply:i=()=>{},...a}=gs(e,t),l=await Pl(t,a),c=vs(r),d=ha(r),f=so(r)==="y",{width:p,height:m}=n.floating;let w,v;c==="top"||c==="bottom"?(w=c,v=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,w=d==="end"?"top":"bottom");const x=m-l.top-l.bottom,h=p-l.left-l.right,g=Rn(m-l[w],x),_=Rn(p-l[v],h),C=!t.middlewareData.shift;let T=g,E=_;if(f?E=d||C?Rn(_,h):h:T=d||C?Rn(g,x):x,C&&!d){const O=jr(l.left,0),j=jr(l.right,0),L=jr(l.top,0),q=jr(l.bottom,0);f?E=p-2*(O!==0||j!==0?O+j:jr(l.left,l.right)):T=m-2*(L!==0||q!==0?L+q:jr(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const P=await s.getDimensions(o.floating);return p!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function pa(e){return f1(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(f1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f1(e){return e instanceof Node||e instanceof Ar(e).Node}function pn(e){return e instanceof Element||e instanceof Ar(e).Element}function Mn(e){return e instanceof HTMLElement||e instanceof Ar(e).HTMLElement}function A0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ar(e).ShadowRoot}function oc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function lD(e){return["table","td","th"].includes(pa(e))}function sf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bg(e){const t=Sg(),r=pn(e)?mn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function cD(e){let t=oo(e);for(;Mn(t)&&!ea(t);){if(bg(t))return t;if(sf(t))return null;t=oo(t)}return null}function Sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ea(e){return["html","body","#document"].includes(pa(e))}function mn(e){return Ar(e).getComputedStyle(e)}function of(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(pa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A0(e)&&e.host||ks(e);return A0(t)?t.host:t}function h1(e){const t=oo(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mn(t)&&oc(t)?t:h1(t)}function jl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=h1(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Ar(s);return o?t.concat(i,i.visualViewport||[],oc(s)?s:[],i.frameElement&&r?jl(i.frameElement):[]):t.concat(s,jl(s,[],r))}function p1(e){const t=mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Mn(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=id(r)!==o||id(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function kg(e){return pn(e)?e:e.contextElement}function Fi(e){const t=kg(e);if(!Mn(t))return no(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=p1(t);let i=(o?id(r.width):r.width)/n,a=(o?id(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const uD=no(0);function m1(e){const t=Ar(e);return!Sg()||!t.visualViewport?uD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ar(e)?!1:t}function Bo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=kg(e);let i=no(1);t&&(n?pn(n)&&(i=Fi(n)):i=Fi(e));const a=dD(o,r,n)?m1(o):no(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const p=Ar(o),m=n&&pn(n)?Ar(n):n;let w=p,v=w.frameElement;for(;v&&n&&m!==w;){const x=Fi(v),h=v.getBoundingClientRect(),g=mn(v),_=h.left+(v.clientLeft+parseFloat(g.paddingLeft))*x.x,C=h.top+(v.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,c*=x.y,d*=x.x,f*=x.y,l+=_,c+=C,w=Ar(v),v=w.frameElement}}return ld({width:d,height:f,x:l,y:c})}function fD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=ks(n),a=t?sf(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=no(1);const d=no(0),f=Mn(n);if((f||!f&&!o)&&((pa(n)!=="body"||oc(i))&&(l=of(n)),Mn(n))){const p=Bo(n);c=Fi(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x,y:r.y*c.y-l.scrollTop*c.y+d.y}}function hD(e){return Array.from(e.getClientRects())}function g1(e){return Bo(ks(e)).left+of(e).scrollLeft}function pD(e){const t=ks(e),r=of(e),n=e.ownerDocument.body,s=jr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=jr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+g1(e);const a=-r.scrollTop;return mn(n).direction==="rtl"&&(i+=jr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function mD(e,t){const r=Ar(e),n=ks(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=Sg();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function gD(e,t){const r=Bo(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Mn(e)?Fi(e):no(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function M0(e,t,r){let n;if(t==="viewport")n=mD(e,r);else if(t==="document")n=pD(ks(e));else if(pn(t))n=gD(t,r);else{const s=m1(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ld(n)}function v1(e,t){const r=oo(e);return r===t||!pn(r)||ea(r)?!1:mn(r).position==="fixed"||v1(r,t)}function vD(e,t){const r=t.get(e);if(r)return r;let n=jl(e,[],!1).filter(a=>pn(a)&&pa(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?oo(e):e;for(;pn(i)&&!ea(i);){const a=mn(i),l=bg(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||oc(i)&&!l&&v1(e,i))?n=n.filter(d=>d!==i):s=a,i=oo(i)}return t.set(e,n),n}function yD(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?sf(t)?[]:vD(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,d)=>{const f=M0(t,d,s);return c.top=jr(f.top,c.top),c.right=Rn(f.right,c.right),c.bottom=Rn(f.bottom,c.bottom),c.left=jr(f.left,c.left),c},M0(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function wD(e){const{width:t,height:r}=p1(e);return{width:t,height:r}}function xD(e,t,r){const n=Mn(t),s=ks(t),o=r==="fixed",i=Bo(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=no(0);if(n||!n&&!o)if((pa(t)!=="body"||oc(s))&&(a=of(t)),n){const f=Bo(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else s&&(l.x=g1(s));const c=i.left+a.scrollLeft-l.x,d=i.top+a.scrollTop-l.y;return{x:c,y:d,width:i.width,height:i.height}}function wh(e){return mn(e).position==="static"}function I0(e,t){return!Mn(e)||mn(e).position==="fixed"?null:t?t(e):e.offsetParent}function y1(e,t){const r=Ar(e);if(sf(e))return r;if(!Mn(e)){let s=oo(e);for(;s&&!ea(s);){if(pn(s)&&!wh(s))return s;s=oo(s)}return r}let n=I0(e,t);for(;n&&lD(n)&&wh(n);)n=I0(n,t);return n&&ea(n)&&wh(n)&&!bg(n)?r:n||cD(e)||r}const _D=async function(e){const t=this.getOffsetParent||y1,r=this.getDimensions,n=await r(e.floating);return{reference:xD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bD(e){return mn(e).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:ks,getClippingRect:yD,getOffsetParent:y1,getElementRects:_D,getClientRects:hD,getDimensions:wD,getScale:Fi,isElement:pn,isRTL:bD};function kD(e,t){let r=null,n;const s=ks(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const m=Kc(d),w=Kc(s.clientWidth-(c+f)),v=Kc(s.clientHeight-(d+p)),x=Kc(c),g={rootMargin:-m+"px "+-w+"px "+-v+"px "+-x+"px",threshold:jr(0,Rn(1,l))||1};let _=!0;function C(T){const E=T[0].intersectionRatio;if(E!==l){if(!_)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(C,{...g,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,g)}r.observe(e)}return i(!0),o}function CD(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=kg(e),d=s||o?[...c?jl(c):[],...jl(t)]:[];d.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),o&&h.addEventListener("resize",r)});const f=c&&a?kD(c,r):null;let p=-1,m=null;i&&(m=new ResizeObserver(h=>{let[g]=h;g&&g.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),r()}),c&&!l&&m.observe(c),m.observe(t));let w,v=l?Bo(e):null;l&&x();function x(){const h=Bo(e);v&&(h.x!==v.x||h.y!==v.y||h.width!==v.width||h.height!==v.height)&&r(),v=h,w=requestAnimationFrame(x)}return r(),()=>{var h;d.forEach(g=>{s&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f==null||f(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(w)}}const ED=sD,TD=oD,ND=tD,RD=aD,PD=rD,L0=eD,jD=iD,DD=(e,t,r)=>{const n=new Map,s={platform:SD,...r},o={...s.platform,_c:n};return Jj(e,t,{...s,platform:o})};var _u=typeof document<"u"?y.useLayoutEffect:y.useEffect;function cd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!cd(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!cd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function w1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F0(e,t){const r=w1(e);return Math.round(t*r)/r}function z0(e){const t=y.useRef(e);return _u(()=>{t.current=e}),t}function OD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=y.useState(n);cd(p,n)||m(n);const[w,v]=y.useState(null),[x,h]=y.useState(null),g=y.useCallback($=>{$!==E.current&&(E.current=$,v($))},[]),_=y.useCallback($=>{$!==P.current&&(P.current=$,h($))},[]),C=o||w,T=i||x,E=y.useRef(null),P=y.useRef(null),O=y.useRef(d),j=l!=null,L=z0(l),q=z0(s),N=y.useCallback(()=>{if(!E.current||!P.current)return;const $={placement:t,strategy:r,middleware:p};q.current&&($.platform=q.current),DD(E.current,P.current,$).then(Z=>{const I={...Z,isPositioned:!0};F.current&&!cd(O.current,I)&&(O.current=I,_s.flushSync(()=>{f(I)}))})},[p,t,r,q]);_u(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const F=y.useRef(!1);_u(()=>(F.current=!0,()=>{F.current=!1}),[]),_u(()=>{if(C&&(E.current=C),T&&(P.current=T),C&&T){if(L.current)return L.current(C,T,N);N()}},[C,T,N,L,j]);const b=y.useMemo(()=>({reference:E,floating:P,setReference:g,setFloating:_}),[g,_]),W=y.useMemo(()=>({reference:C,floating:T}),[C,T]),te=y.useMemo(()=>{const $={position:r,left:0,top:0};if(!W.floating)return $;const Z=F0(W.floating,d.x),I=F0(W.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+I+"px)",...w1(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:I}},[r,a,W.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:N,refs:b,elements:W,floatingStyles:te}),[d,N,b,W,te])}const AD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?L0({element:n.current,padding:s}).fn(r):{}:n?L0({element:n,padding:s}).fn(r):{}}}},MD=(e,t)=>({...ED(e),options:[e,t]}),ID=(e,t)=>({...TD(e),options:[e,t]}),LD=(e,t)=>({...jD(e),options:[e,t]}),FD=(e,t)=>({...ND(e),options:[e,t]}),zD=(e,t)=>({...RD(e),options:[e,t]}),UD=(e,t)=>({...PD(e),options:[e,t]}),VD=(e,t)=>({...AD(e),options:[e,t]});var WD="Arrow",x1=y.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return u.jsx(Me.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});x1.displayName=WD;var $D=x1;function _1(e){const[t,r]=y.useState(void 0);return nr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Cg="Popper",[b1,ma]=Xr(Cg),[BD,S1]=b1(Cg),k1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=y.useState(null);return u.jsx(BD,{scope:t,anchor:n,onAnchorChange:s,children:r})};k1.displayName=Cg;var C1="PopperAnchor",E1=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=S1(C1,r),i=y.useRef(null),a=Ke(t,i);return y.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:u.jsx(Me.div,{...s,ref:a})});E1.displayName=C1;var Eg="PopperContent",[HD,YD]=b1(Eg),T1=y.forwardRef((e,t)=>{var fe,ge,be,Pe,Te,Se;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...v}=e,x=S1(Eg,r),[h,g]=y.useState(null),_=Ke(t,rt=>g(rt)),[C,T]=y.useState(null),E=_1(C),P=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,j=n+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(c)?c:[c],N=q.length>0,F={padding:L,boundary:q.filter(GD),altBoundary:N},{refs:b,floatingStyles:W,placement:te,isPositioned:$,middlewareData:Z}=OD({strategy:"fixed",placement:j,whileElementsMounted:(...rt)=>CD(...rt,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[MD({mainAxis:s+O,alignmentAxis:i}),l&&ID({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?LD():void 0,...F}),l&&FD({...F}),zD({...F,apply:({elements:rt,rects:k,availableWidth:J,availableHeight:G})=>{const{width:D,height:S}=k.reference,R=rt.floating.style;R.setProperty("--radix-popper-available-width",`${J}px`),R.setProperty("--radix-popper-available-height",`${G}px`),R.setProperty("--radix-popper-anchor-width",`${D}px`),R.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&VD({element:C,padding:a}),KD({arrowWidth:P,arrowHeight:O}),p&&UD({strategy:"referenceHidden",...F})]}),[I,Q]=P1(te),z=jt(w);nr(()=>{$&&(z==null||z())},[$,z]);const V=(fe=Z.arrow)==null?void 0:fe.x,de=(ge=Z.arrow)==null?void 0:ge.y,ne=((be=Z.arrow)==null?void 0:be.centerOffset)!==0,[se,Ee]=y.useState();return nr(()=>{h&&Ee(window.getComputedStyle(h).zIndex)},[h]),u.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=Z.transformOrigin)==null?void 0:Pe.x,(Te=Z.transformOrigin)==null?void 0:Te.y].join(" "),...((Se=Z.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(HD,{scope:r,placedSide:I,onArrowChange:T,arrowX:V,arrowY:de,shouldHideArrow:ne,children:u.jsx(Me.div,{"data-side":I,"data-align":Q,...v,ref:_,style:{...v.style,animation:$?void 0:"none"}})})})});T1.displayName=Eg;var N1="PopperArrow",ZD={top:"bottom",right:"left",bottom:"top",left:"right"},R1=y.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=YD(N1,n),i=ZD[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx($D,{...s,ref:r,style:{...s.style,display:"block"}})})});R1.displayName=N1;function GD(e){return e!==null}var KD=e=>({name:"transformOrigin",options:e,fn(t){var x,h,g;const{placement:r,rects:n,middlewareData:s}=t,i=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=P1(r),f={start:"0%",center:"50%",end:"100%"}[d],p=(((h=s.arrow)==null?void 0:h.x)??0)+a/2,m=(((g=s.arrow)==null?void 0:g.y)??0)+l/2;let w="",v="";return c==="bottom"?(w=i?f:`${p}px`,v=`${-l}px`):c==="top"?(w=i?f:`${p}px`,v=`${n.floating.height+l}px`):c==="right"?(w=`${-l}px`,v=i?f:`${m}px`):c==="left"&&(w=`${n.floating.width+l}px`,v=i?f:`${m}px`),{data:{x:w,y:v}}}});function P1(e){const[t,r="center"]=e.split("-");return[t,r]}var Tg=k1,Ng=E1,Rg=T1,Pg=R1,qD="Portal",ic=y.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=y.useState(!1);nr(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?j_.createPortal(u.jsx(Me.div,{...n,ref:t}),i):null});ic.displayName=qD;function XD(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Cr=e=>{const{present:t,children:r}=e,n=QD(t),s=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=Ke(n.ref,JD(s));return typeof r=="function"||n.isPresent?y.cloneElement(s,{ref:o}):null};Cr.displayName="Presence";function QD(e){const[t,r]=y.useState(),n=y.useRef({}),s=y.useRef(e),o=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=XD(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=qc(n.current);o.current=a==="mounted"?c:"none"},[a]),nr(()=>{const c=n.current,d=s.current;if(d!==e){const p=o.current,m=qc(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nr(()=>{if(t){const c=f=>{const m=qc(n.current).includes(f.animationName);f.target===t&&m&&_s.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=qc(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function qc(e){return(e==null?void 0:e.animationName)||"none"}function JD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var xh="rovingFocusGroup.onEntryFocus",eO={bubbles:!1,cancelable:!0},af="RovingFocusGroup",[zp,j1,tO]=tf(af),[rO,D1]=Xr(af,[tO]),[nO,sO]=rO(af),O1=y.forwardRef((e,t)=>u.jsx(zp.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(zp.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(oO,{...e,ref:t})})}));O1.displayName=af;var oO=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,p=y.useRef(null),m=Ke(t,p),w=rf(o),[v=null,x]=ro({prop:i,defaultProp:a,onChange:l}),[h,g]=y.useState(!1),_=jt(c),C=j1(r),T=y.useRef(!1),[E,P]=y.useState(0);return y.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(xh,_),()=>O.removeEventListener(xh,_)},[_]),u.jsx(nO,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:v,onItemFocus:y.useCallback(O=>x(O),[x]),onItemShiftTab:y.useCallback(()=>g(!0),[]),onFocusableItemAdd:y.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:y.useCallback(()=>P(O=>O-1),[]),children:u.jsx(Me.div,{tabIndex:h||E===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{T.current=!0}),onFocus:ue(e.onFocus,O=>{const j=!T.current;if(O.target===O.currentTarget&&j&&!h){const L=new CustomEvent(xh,eO);if(O.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),N=q.find(te=>te.active),F=q.find(te=>te.id===v),W=[N,F,...q].filter(Boolean).map(te=>te.ref.current);I1(W,d)}}T.current=!1}),onBlur:ue(e.onBlur,()=>g(!1))})})}),A1="RovingFocusGroupItem",M1=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=On(),l=o||a,c=sO(A1,r),d=c.currentTabStopId===l,f=j1(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return y.useEffect(()=>{if(n)return p(),()=>m()},[n,p,m]),u.jsx(zp.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:u.jsx(Me.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:ue(e.onMouseDown,w=>{n?c.onItemFocus(l):w.preventDefault()}),onFocus:ue(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){c.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const v=lO(w,c.orientation,c.dir);if(v!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let h=f().filter(g=>g.focusable).map(g=>g.ref.current);if(v==="last")h.reverse();else if(v==="prev"||v==="next"){v==="prev"&&h.reverse();const g=h.indexOf(w.currentTarget);h=c.loop?cO(h,g+1):h.slice(g+1)}setTimeout(()=>I1(h))}})})})});M1.displayName=A1;var iO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function lO(e,t,r){const n=aO(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return iO[n]}function I1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function cO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var uO=O1,dO=M1,fO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ci=new WeakMap,Xc=new WeakMap,Qc={},_h=0,L1=function(e){return e&&(e.host||L1(e.parentNode))},hO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=L1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pO=function(e,t,r,n){var s=hO(t,Array.isArray(e)?e:[e]);Qc[r]||(Qc[r]=new WeakMap);var o=Qc[r],i=[],a=new Set,l=new Set(s),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};s.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else try{var m=p.getAttribute(n),w=m!==null&&m!=="false",v=(ci.get(p)||0)+1,x=(o.get(p)||0)+1;ci.set(p,v),o.set(p,x),i.push(p),v===1&&w&&Xc.set(p,!0),x===1&&p.setAttribute(r,"true"),w||p.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",p,h)}})};return d(t),a.clear(),_h++,function(){i.forEach(function(f){var p=ci.get(f)-1,m=o.get(f)-1;ci.set(f,p),o.set(f,m),p||(Xc.has(f)||f.removeAttribute(n),Xc.delete(f)),m||f.removeAttribute(r)}),_h--,_h||(ci=new WeakMap,ci=new WeakMap,Xc=new WeakMap,Qc={})}},jg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=fO(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),pO(n,s,r,"aria-hidden")):function(){return null}},En=function(){return En=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return jO;var t=DO(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},AO=V1(),zi="data-scroll-locked",MO=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` + */const pg=qt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Fj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jd(...e){return t=>e.forEach(r=>Fj(r,t))}function Xe(...e){return y.useCallback(Jd(...e),e)}var ms=y.forwardRef((e,t)=>{const{children:r,...n}=e,s=y.Children.toArray(r),o=s.find(zj);if(o){const i=o.props.children,a=s.map(l=>l===o?y.Children.count(i)>1?y.Children.only(null):y.isValidElement(i)?i.props.children:null:l);return u.jsx(Ap,{...n,ref:t,children:y.isValidElement(i)?y.cloneElement(i,void 0,a):null})}return u.jsx(Ap,{...n,ref:t,children:r})});ms.displayName="Slot";var Ap=y.forwardRef((e,t)=>{const{children:r,...n}=e;if(y.isValidElement(r)){const s=Vj(r);return y.cloneElement(r,{...Uj(n,r.props),ref:t?Jd(t,s):s})}return y.Children.count(r)>1?y.Children.only(null):null});Ap.displayName="SlotClone";var mg=({children:e})=>u.jsx(u.Fragment,{children:e});function zj(e){return y.isValidElement(e)&&e.type===mg}function Uj(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function Vj(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function e1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,_0=Wj,ic=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return _0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const d=r==null?void 0:r[c],f=o==null?void 0:o[c];if(d===null)return null;const p=w0(d)||w0(f);return s[c][p]}),a=r&&Object.entries(r).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(x=>{let[v,w]=x;return Array.isArray(w)?w.includes({...o,...a}[v]):{...o,...a}[v]===w})?[...c,f,p]:c},[]);return _0(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};function t1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ta(o)))==null?void 0:i.classGroupId}const b0=/^\[(.+)\]$/;function Hj(e){if(b0.test(e)){const t=b0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}function Yj(e){const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Kj(Object.entries(e.classGroups),r).forEach(([o,i])=>{Mp(i,n,o,t)}),n}function Mp(e,t,r,n){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:S0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(Zj(s)){Mp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Mp(i,S0(t,o),r,n)})})}function S0(e,t){let r=e;return t.split(gg).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function Zj(e){return e.isThemeGetter}function Kj(e,t){return t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e}function Gj(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;function s(o,i){r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)}return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}}const n1="!";function qj(e){const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length;function i(a){const l=[];let c=0,d=0,f;for(let w=0;wd?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:v}}return r?function(l){return r({className:l,parseClassName:i})}:i}function Xj(e){if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t}function Qj(e){return{cache:Gj(e.cacheSize),parseClassName:qj(e),...Bj(e)}}const Jj=/\s+/;function eP(e,t){const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(Jj).map(i=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=r(i);let f=!!d,p=n(f?c.substring(0,d):c);if(!p){if(!f)return{isTailwindClass:!1,originalClassName:i};if(p=n(c),!p)return{isTailwindClass:!1,originalClassName:i};f=!1}const m=Xj(a).join(":");return{isTailwindClass:!0,modifierId:l?m+n1:m,classGroupId:p,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=i,d=a+l;return o.has(d)?!1:(o.add(d),s(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function tP(){let e=0,t,r,n="";for(;ef(d),e());return r=Qj(c),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const d=eP(l,r);return s(l,d),d}return function(){return o(tP.apply(null,arguments))}}function xt(e){const t=r=>r[e]||[];return t.isThemeGetter=!0,t}const o1=/^\[(?:([a-z-]+):)?(.+)\]$/i,nP=/^\d+\/\d+$/,sP=new Set(["px","full","screen"]),oP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iP=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,aP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Kn(e){return jo(e)||sP.has(e)||nP.test(e)}function As(e){return da(e,"length",vP)}function jo(e){return!!e&&!Number.isNaN(Number(e))}function Kc(e){return da(e,"number",jo)}function Aa(e){return!!e&&Number.isInteger(Number(e))}function uP(e){return e.endsWith("%")&&jo(e.slice(0,-1))}function Ye(e){return o1.test(e)}function Ms(e){return oP.test(e)}const dP=new Set(["length","size","percentage"]);function fP(e){return da(e,dP,i1)}function hP(e){return da(e,"position",i1)}const pP=new Set(["image","url"]);function mP(e){return da(e,pP,xP)}function gP(e){return da(e,"",yP)}function Ma(){return!0}function da(e,t,r){const n=o1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1}function vP(e){return iP.test(e)&&!aP.test(e)}function i1(){return!1}function yP(e){return lP.test(e)}function xP(e){return cP.test(e)}function wP(){const e=xt("colors"),t=xt("spacing"),r=xt("blur"),n=xt("brightness"),s=xt("borderColor"),o=xt("borderRadius"),i=xt("borderSpacing"),a=xt("borderWidth"),l=xt("contrast"),c=xt("grayscale"),d=xt("hueRotate"),f=xt("invert"),p=xt("gap"),m=xt("gradientColorStops"),x=xt("gradientColorStopPositions"),v=xt("inset"),w=xt("margin"),h=xt("opacity"),g=xt("padding"),_=xt("saturate"),C=xt("scale"),T=xt("sepia"),E=xt("skew"),j=xt("space"),O=xt("translate"),P=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Ye,t],N=()=>[Ye,t],F=()=>["",Kn,As],b=()=>["auto",jo,Ye],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ye],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[jo,Kc],V=()=>[jo,Ye];return{cacheSize:500,separator:":",theme:{colors:[Ma],spacing:[Kn,As],blur:["none","",Ms,Ye],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ms,Ye],borderSpacing:N(),borderWidth:F(),contrast:z(),grayscale:I(),hueRotate:V(),invert:I(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[uP,As],inset:q(),margin:q(),opacity:z(),padding:N(),saturate:z(),scale:z(),sepia:I(),skew:V(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[Ms]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ye]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Aa,Ye]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Aa,Ye]}],"grid-cols":[{"grid-cols":[Ma]}],"col-start-end":[{col:["auto",{span:["full",Aa,Ye]},Ye]}],"col-start":[{"col-start":b()}],"col-end":[{"col-end":b()}],"grid-rows":[{"grid-rows":[Ma]}],"row-start-end":[{row:["auto",{span:[Aa,Ye]},Ye]}],"row-start":[{"row-start":b()}],"row-end":[{"row-end":b()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,t]}],"min-w":[{"min-w":[Ye,t,"min","max","fit"]}],"max-w":[{"max-w":[Ye,t,"none","full","min","max","fit","prose",{screen:[Ms]},Ms]}],h:[{h:[Ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ms,As]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kc]}],"font-family":[{font:[Ma]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",jo,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kn,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kn,As]}],"underline-offset":[{"underline-offset":["auto",Kn,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),hP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:te()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[Kn,Ye]}],"outline-w":[{outline:[Kn,As]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Kn,As]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ms,gP]}],"shadow-color":[{shadow:[Ma]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ms,Ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[_]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Aa,Ye]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kn,As,Kc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const _P=rP(wP);function ve(...e){return _P($j(e))}const ef=ic("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),vt=y.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?ms:"button";return u.jsx(i,{className:ve(ef({variant:t,size:r,className:e})),ref:o,...s})});vt.displayName="Button";function ue(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function bP(e,t){const r=y.createContext(t);function n(o){const{children:i,...a}=o,l=y.useMemo(()=>a,Object.values(a));return u.jsx(r.Provider,{value:l,children:i})}function s(o){const i=y.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function Xr(e,t=[]){let r=[];function n(o,i){const a=y.createContext(i),l=r.length;r=[...r,i];function c(f){const{scope:p,children:m,...x}=f,v=(p==null?void 0:p[e][l])||a,w=y.useMemo(()=>x,Object.values(x));return u.jsx(v.Provider,{value:w,children:m})}function d(f,p){const m=(p==null?void 0:p[e][l])||a,x=y.useContext(m);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const s=()=>{const o=r.map(i=>y.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,SP(s,...t)]}function SP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Pt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function oo({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=kP({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=Pt(r),l=y.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function kP({defaultProp:e,onChange:t}){const r=y.useState(e),[n]=r,s=y.useRef(n),o=Pt(t);return y.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var CP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Me=CP.reduce((e,t)=>{const r=y.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?ms:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vg(e,t){e&&_s.flushSync(()=>e.dispatchEvent(t))}function tf(e){const t=e+"CollectionProvider",[r,n]=Xr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:x,children:v}=m,w=et.useRef(null),h=et.useRef(new Map).current;return u.jsx(s,{scope:x,itemMap:h,collectionRef:w,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=et.forwardRef((m,x)=>{const{scope:v,children:w}=m,h=o(a,v),g=Xe(x,h.collectionRef);return u.jsx(ms,{ref:g,children:w})});l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=et.forwardRef((m,x)=>{const{scope:v,children:w,...h}=m,g=et.useRef(null),_=Xe(x,g),C=o(c,v);return et.useEffect(()=>(C.itemMap.set(g,{ref:g,...h}),()=>void C.itemMap.delete(g))),u.jsx(ms,{[d]:"",ref:_,children:w})});f.displayName=c;function p(m){const x=o(e+"CollectionConsumer",m);return et.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const h=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((C,T)=>h.indexOf(C.ref.current)-h.indexOf(T.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},p,n]}var EP=y.createContext(void 0);function rf(e){const t=y.useContext(EP);return e||t||"ltr"}function TP(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e);y.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var NP="DismissableLayer",Ip="dismissableLayer.update",RP="dismissableLayer.pointerDownOutside",jP="dismissableLayer.focusOutside",k0,a1=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fa=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=y.useContext(a1),[d,f]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),x=Xe(t,j=>f(j)),v=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(w),g=d?v.indexOf(d):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,C=g>=h,T=DP(j=>{const O=j.target,P=[...c.branches].some(L=>L.contains(O));!C||P||(s==null||s(j),i==null||i(j),j.defaultPrevented||a==null||a())},p),E=OP(j=>{const O=j.target;[...c.branches].some(L=>L.contains(O))||(o==null||o(j),i==null||i(j),j.defaultPrevented||a==null||a())},p);return TP(j=>{g===c.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},p),y.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(k0=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),C0(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=k0)}},[d,p,r,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),C0())},[d,c]),y.useEffect(()=>{const j=()=>m({});return document.addEventListener(Ip,j),()=>document.removeEventListener(Ip,j)},[]),u.jsx(Me.div,{...l,ref:x,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,T.onPointerDownCapture)})});fa.displayName=NP;var PP="DismissableLayerBranch",l1=y.forwardRef((e,t)=>{const r=y.useContext(a1),n=y.useRef(null),s=Xe(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(Me.div,{...e,ref:s})});l1.displayName=PP;function DP(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e),n=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){c1(RP,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function OP(e,t=globalThis==null?void 0:globalThis.document){const r=Pt(e),n=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!n.current&&c1(jP,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function C0(){const e=new CustomEvent(Ip);document.dispatchEvent(e)}function c1(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vg(s,o):s.dispatchEvent(o)}var AP=fa,MP=l1,gh=0;function yg(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??E0()),document.body.insertAdjacentElement("beforeend",e[1]??E0()),gh++,()=>{gh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gh--}},[])}function E0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var vh="focusScope.autoFocusOnMount",yh="focusScope.autoFocusOnUnmount",T0={bubbles:!1,cancelable:!0},IP="FocusScope",nf=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=y.useState(null),c=Pt(s),d=Pt(o),f=y.useRef(null),p=Xe(t,v=>l(v)),m=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let v=function(_){if(m.paused||!a)return;const C=_.target;a.contains(C)?f.current=C:Ls(f.current,{select:!0})},w=function(_){if(m.paused||!a)return;const C=_.relatedTarget;C!==null&&(a.contains(C)||Ls(f.current,{select:!0}))},h=function(_){if(document.activeElement===document.body)for(const T of _)T.removedNodes.length>0&&Ls(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const g=new MutationObserver(h);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),g.disconnect()}}},[n,a,m.paused]),y.useEffect(()=>{if(a){R0.add(m);const v=document.activeElement;if(!a.contains(v)){const h=new CustomEvent(vh,T0);a.addEventListener(vh,c),a.dispatchEvent(h),h.defaultPrevented||(LP(WP(u1(a)),{select:!0}),document.activeElement===v&&Ls(a))}return()=>{a.removeEventListener(vh,c),setTimeout(()=>{const h=new CustomEvent(yh,T0);a.addEventListener(yh,d),a.dispatchEvent(h),h.defaultPrevented||Ls(v??document.body,{select:!0}),a.removeEventListener(yh,d),R0.remove(m)},0)}}},[a,c,d,m]);const x=y.useCallback(v=>{if(!r&&!n||m.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,h=document.activeElement;if(w&&h){const g=v.currentTarget,[_,C]=FP(g);_&&C?!v.shiftKey&&h===C?(v.preventDefault(),r&&Ls(_,{select:!0})):v.shiftKey&&h===_&&(v.preventDefault(),r&&Ls(C,{select:!0})):h===g&&v.preventDefault()}},[r,n,m.paused]);return u.jsx(Me.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});nf.displayName=IP;function LP(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ls(n,{select:t}),document.activeElement!==r)return}function FP(e){const t=u1(e),r=N0(t,e),n=N0(t.reverse(),e);return[r,n]}function u1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function N0(e,t){for(const r of e)if(!zP(r,{upTo:t}))return r}function zP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function UP(e){return e instanceof HTMLInputElement&&"select"in e}function Ls(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&UP(e)&&t&&e.select()}}var R0=VP();function VP(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=j0(e,t),e.unshift(t)},remove(t){var r;e=j0(e,t),(r=e[0])==null||r.resume()}}}function j0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function WP(e){return e.filter(t=>t.tagName!=="A")}var nr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},$P=Nx.useId||(()=>{}),BP=0;function On(e){const[t,r]=y.useState($P());return nr(()=>{r(n=>n??String(BP++))},[e]),t?`radix-${t}`:""}const HP=["top","right","bottom","left"],Rn=Math.min,Pr=Math.max,id=Math.round,Gc=Math.floor,io=e=>({x:e,y:e}),YP={left:"right",right:"left",bottom:"top",top:"bottom"},ZP={start:"end",end:"start"};function Lp(e,t,r){return Pr(e,Rn(t,r))}function gs(e,t){return typeof e=="function"?e(t):e}function vs(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function xg(e){return e==="x"?"y":"x"}function wg(e){return e==="y"?"height":"width"}function ao(e){return["top","bottom"].includes(vs(e))?"y":"x"}function _g(e){return xg(ao(e))}function KP(e,t,r){r===void 0&&(r=!1);const n=ha(e),s=_g(e),o=wg(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ad(i)),[i,ad(i)]}function GP(e){const t=ad(e);return[Fp(e),t,Fp(t)]}function Fp(e){return e.replace(/start|end/g,t=>ZP[t])}function qP(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function XP(e,t,r,n){const s=ha(e);let o=qP(vs(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Fp)))),o}function ad(e){return e.replace(/left|right|bottom|top/g,t=>YP[t])}function QP(e){return{top:0,right:0,bottom:0,left:0,...e}}function d1(e){return typeof e!="number"?QP(e):{top:e,right:e,bottom:e,left:e}}function ld(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function P0(e,t,r){let{reference:n,floating:s}=e;const o=ao(t),i=_g(t),a=wg(i),l=vs(t),c=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[a]/2-s[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-s.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(ha(t)){case"start":m[i]-=p*(r&&c?-1:1);break;case"end":m[i]+=p*(r&&c?-1:1);break}return m}const JP=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=P0(c,n,l),p=n,m={},x=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=gs(e,t)||{};if(c==null)return{};const f=d1(d),p={x:r,y:n},m=_g(s),x=wg(m),v=await i.getDimensions(c),w=m==="y",h=w?"top":"left",g=w?"bottom":"right",_=w?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[m]-p[m]-o.floating[x],T=p[m]-o.reference[m],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let j=E?E[_]:0;(!j||!await(i.isElement==null?void 0:i.isElement(E)))&&(j=a.floating[_]||o.floating[x]);const O=C/2-T/2,P=j/2-v[x]/2-1,L=Rn(f[h],P),q=Rn(f[g],P),N=L,F=j-v[x]-q,b=j/2-v[x]/2+O,W=Lp(N,b,F),te=!l.arrow&&ha(s)!=null&&b!==W&&o.reference[x]/2-(bb<=0)){var q,N;const b=(((q=o.flip)==null?void 0:q.index)||0)+1,W=j[b];if(W)return{data:{index:b,overflows:L},reset:{placement:W}};let te=(N=L.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:N.placement;if(!te)switch(m){case"bestFit":{var F;const $=(F=L.filter(Z=>{if(E){const I=ao(Z.placement);return I===g||I==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(I=>I>0).reduce((I,Q)=>I+Q,0)]).sort((Z,I)=>Z[1]-I[1])[0])==null?void 0:F[0];$&&(te=$);break}case"initialPlacement":te=a;break}if(s!==te)return{reset:{placement:te}}}return{}}}};function D0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O0(e){return HP.some(t=>e[t]>=0)}const rD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=gs(e,t);switch(n){case"referenceHidden":{const o=await Dl(t,{...s,elementContext:"reference"}),i=D0(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:O0(i)}}}case"escaped":{const o=await Dl(t,{...s,altBoundary:!0}),i=D0(o,r.floating);return{data:{escapedOffsets:i,escaped:O0(i)}}}default:return{}}}}};async function nD(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=vs(r),a=ha(r),l=ao(r)==="y",c=["left","top"].includes(i)?-1:1,d=o&&l?-1:1,f=gs(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof x=="number"&&(m=a==="end"?x*-1:x),l?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const sD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await nD(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},oD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:w=>{let{x:h,y:g}=w;return{x:h,y:g}}},...l}=gs(e,t),c={x:r,y:n},d=await Dl(t,l),f=ao(vs(s)),p=xg(f);let m=c[p],x=c[f];if(o){const w=p==="y"?"top":"left",h=p==="y"?"bottom":"right",g=m+d[w],_=m-d[h];m=Lp(g,m,_)}if(i){const w=f==="y"?"top":"left",h=f==="y"?"bottom":"right",g=x+d[w],_=x-d[h];x=Lp(g,x,_)}const v=a.fn({...t,[p]:m,[f]:x});return{...v,data:{x:v.x-r,y:v.y-n}}}}},iD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gs(e,t),d={x:r,y:n},f=ao(s),p=xg(f);let m=d[p],x=d[f];const v=gs(a,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const _=p==="y"?"height":"width",C=o.reference[p]-o.floating[_]+w.mainAxis,T=o.reference[p]+o.reference[_]-w.mainAxis;mT&&(m=T)}if(c){var h,g;const _=p==="y"?"width":"height",C=["top","left"].includes(vs(s)),T=o.reference[f]-o.floating[_]+(C&&((h=i.offset)==null?void 0:h[f])||0)+(C?0:w.crossAxis),E=o.reference[f]+o.reference[_]+(C?0:((g=i.offset)==null?void 0:g[f])||0)-(C?w.crossAxis:0);xE&&(x=E)}return{[p]:m,[f]:x}}}},aD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:s,elements:o}=t,{apply:i=()=>{},...a}=gs(e,t),l=await Dl(t,a),c=vs(r),d=ha(r),f=ao(r)==="y",{width:p,height:m}=n.floating;let x,v;c==="top"||c==="bottom"?(x=c,v=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,x=d==="end"?"top":"bottom");const w=m-l.top-l.bottom,h=p-l.left-l.right,g=Rn(m-l[x],w),_=Rn(p-l[v],h),C=!t.middlewareData.shift;let T=g,E=_;if(f?E=d||C?Rn(_,h):h:T=d||C?Rn(g,w):w,C&&!d){const O=Pr(l.left,0),P=Pr(l.right,0),L=Pr(l.top,0),q=Pr(l.bottom,0);f?E=p-2*(O!==0||P!==0?O+P:Pr(l.left,l.right)):T=m-2*(L!==0||q!==0?L+q:Pr(l.top,l.bottom))}await i({...t,availableWidth:E,availableHeight:T});const j=await s.getDimensions(o.floating);return p!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function pa(e){return f1(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(f1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f1(e){return e instanceof Node||e instanceof Ar(e).Node}function pn(e){return e instanceof Element||e instanceof Ar(e).Element}function Mn(e){return e instanceof HTMLElement||e instanceof Ar(e).HTMLElement}function A0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ar(e).ShadowRoot}function ac(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function lD(e){return["table","td","th"].includes(pa(e))}function sf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bg(e){const t=Sg(),r=pn(e)?mn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function cD(e){let t=lo(e);for(;Mn(t)&&!ea(t);){if(bg(t))return t;if(sf(t))return null;t=lo(t)}return null}function Sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ea(e){return["html","body","#document"].includes(pa(e))}function mn(e){return Ar(e).getComputedStyle(e)}function of(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lo(e){if(pa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A0(e)&&e.host||ks(e);return A0(t)?t.host:t}function h1(e){const t=lo(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mn(t)&&ac(t)?t:h1(t)}function Ol(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=h1(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Ar(s);return o?t.concat(i,i.visualViewport||[],ac(s)?s:[],i.frameElement&&r?Ol(i.frameElement):[]):t.concat(s,Ol(s,[],r))}function p1(e){const t=mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Mn(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=id(r)!==o||id(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function kg(e){return pn(e)?e:e.contextElement}function Fi(e){const t=kg(e);if(!Mn(t))return io(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=p1(t);let i=(o?id(r.width):r.width)/n,a=(o?id(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const uD=io(0);function m1(e){const t=Ar(e);return!Sg()||!t.visualViewport?uD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ar(e)?!1:t}function Ho(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=kg(e);let i=io(1);t&&(n?pn(n)&&(i=Fi(n)):i=Fi(e));const a=dD(o,r,n)?m1(o):io(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const p=Ar(o),m=n&&pn(n)?Ar(n):n;let x=p,v=x.frameElement;for(;v&&n&&m!==x;){const w=Fi(v),h=v.getBoundingClientRect(),g=mn(v),_=h.left+(v.clientLeft+parseFloat(g.paddingLeft))*w.x,C=h.top+(v.clientTop+parseFloat(g.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,f*=w.y,l+=_,c+=C,x=Ar(v),v=x.frameElement}}return ld({width:d,height:f,x:l,y:c})}function fD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=ks(n),a=t?sf(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=io(1);const d=io(0),f=Mn(n);if((f||!f&&!o)&&((pa(n)!=="body"||ac(i))&&(l=of(n)),Mn(n))){const p=Ho(n);c=Fi(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x,y:r.y*c.y-l.scrollTop*c.y+d.y}}function hD(e){return Array.from(e.getClientRects())}function g1(e){return Ho(ks(e)).left+of(e).scrollLeft}function pD(e){const t=ks(e),r=of(e),n=e.ownerDocument.body,s=Pr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Pr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+g1(e);const a=-r.scrollTop;return mn(n).direction==="rtl"&&(i+=Pr(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function mD(e,t){const r=Ar(e),n=ks(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=Sg();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function gD(e,t){const r=Ho(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Mn(e)?Fi(e):io(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function M0(e,t,r){let n;if(t==="viewport")n=mD(e,r);else if(t==="document")n=pD(ks(e));else if(pn(t))n=gD(t,r);else{const s=m1(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ld(n)}function v1(e,t){const r=lo(e);return r===t||!pn(r)||ea(r)?!1:mn(r).position==="fixed"||v1(r,t)}function vD(e,t){const r=t.get(e);if(r)return r;let n=Ol(e,[],!1).filter(a=>pn(a)&&pa(a)!=="body"),s=null;const o=mn(e).position==="fixed";let i=o?lo(e):e;for(;pn(i)&&!ea(i);){const a=mn(i),l=bg(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||ac(i)&&!l&&v1(e,i))?n=n.filter(d=>d!==i):s=a,i=lo(i)}return t.set(e,n),n}function yD(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?sf(t)?[]:vD(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,d)=>{const f=M0(t,d,s);return c.top=Pr(f.top,c.top),c.right=Rn(f.right,c.right),c.bottom=Rn(f.bottom,c.bottom),c.left=Pr(f.left,c.left),c},M0(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xD(e){const{width:t,height:r}=p1(e);return{width:t,height:r}}function wD(e,t,r){const n=Mn(t),s=ks(t),o=r==="fixed",i=Ho(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=io(0);if(n||!n&&!o)if((pa(t)!=="body"||ac(s))&&(a=of(t)),n){const f=Ho(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else s&&(l.x=g1(s));const c=i.left+a.scrollLeft-l.x,d=i.top+a.scrollTop-l.y;return{x:c,y:d,width:i.width,height:i.height}}function xh(e){return mn(e).position==="static"}function I0(e,t){return!Mn(e)||mn(e).position==="fixed"?null:t?t(e):e.offsetParent}function y1(e,t){const r=Ar(e);if(sf(e))return r;if(!Mn(e)){let s=lo(e);for(;s&&!ea(s);){if(pn(s)&&!xh(s))return s;s=lo(s)}return r}let n=I0(e,t);for(;n&&lD(n)&&xh(n);)n=I0(n,t);return n&&ea(n)&&xh(n)&&!bg(n)?r:n||cD(e)||r}const _D=async function(e){const t=this.getOffsetParent||y1,r=this.getDimensions,n=await r(e.floating);return{reference:wD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bD(e){return mn(e).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:fD,getDocumentElement:ks,getClippingRect:yD,getOffsetParent:y1,getElementRects:_D,getClientRects:hD,getDimensions:xD,getScale:Fi,isElement:pn,isRTL:bD};function kD(e,t){let r=null,n;const s=ks(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const m=Gc(d),x=Gc(s.clientWidth-(c+f)),v=Gc(s.clientHeight-(d+p)),w=Gc(c),g={rootMargin:-m+"px "+-x+"px "+-v+"px "+-w+"px",threshold:Pr(0,Rn(1,l))||1};let _=!0;function C(T){const E=T[0].intersectionRatio;if(E!==l){if(!_)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(C,{...g,root:s.ownerDocument})}catch{r=new IntersectionObserver(C,g)}r.observe(e)}return i(!0),o}function CD(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=kg(e),d=s||o?[...c?Ol(c):[],...Ol(t)]:[];d.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),o&&h.addEventListener("resize",r)});const f=c&&a?kD(c,r):null;let p=-1,m=null;i&&(m=new ResizeObserver(h=>{let[g]=h;g&&g.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(t)})),r()}),c&&!l&&m.observe(c),m.observe(t));let x,v=l?Ho(e):null;l&&w();function w(){const h=Ho(e);v&&(h.x!==v.x||h.y!==v.y||h.width!==v.width||h.height!==v.height)&&r(),v=h,x=requestAnimationFrame(w)}return r(),()=>{var h;d.forEach(g=>{s&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),f==null||f(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(x)}}const ED=sD,TD=oD,ND=tD,RD=aD,jD=rD,L0=eD,PD=iD,DD=(e,t,r)=>{const n=new Map,s={platform:SD,...r},o={...s.platform,_c:n};return JP(e,t,{...s,platform:o})};var _u=typeof document<"u"?y.useLayoutEffect:y.useEffect;function cd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!cd(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!cd(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function x1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F0(e,t){const r=x1(e);return Math.round(t*r)/r}function z0(e){const t=y.useRef(e);return _u(()=>{t.current=e}),t}function OD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=y.useState(n);cd(p,n)||m(n);const[x,v]=y.useState(null),[w,h]=y.useState(null),g=y.useCallback($=>{$!==E.current&&(E.current=$,v($))},[]),_=y.useCallback($=>{$!==j.current&&(j.current=$,h($))},[]),C=o||x,T=i||w,E=y.useRef(null),j=y.useRef(null),O=y.useRef(d),P=l!=null,L=z0(l),q=z0(s),N=y.useCallback(()=>{if(!E.current||!j.current)return;const $={placement:t,strategy:r,middleware:p};q.current&&($.platform=q.current),DD(E.current,j.current,$).then(Z=>{const I={...Z,isPositioned:!0};F.current&&!cd(O.current,I)&&(O.current=I,_s.flushSync(()=>{f(I)}))})},[p,t,r,q]);_u(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const F=y.useRef(!1);_u(()=>(F.current=!0,()=>{F.current=!1}),[]),_u(()=>{if(C&&(E.current=C),T&&(j.current=T),C&&T){if(L.current)return L.current(C,T,N);N()}},[C,T,N,L,P]);const b=y.useMemo(()=>({reference:E,floating:j,setReference:g,setFloating:_}),[g,_]),W=y.useMemo(()=>({reference:C,floating:T}),[C,T]),te=y.useMemo(()=>{const $={position:r,left:0,top:0};if(!W.floating)return $;const Z=F0(W.floating,d.x),I=F0(W.floating,d.y);return a?{...$,transform:"translate("+Z+"px, "+I+"px)",...x1(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:I}},[r,a,W.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:N,refs:b,elements:W,floatingStyles:te}),[d,N,b,W,te])}const AD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?L0({element:n.current,padding:s}).fn(r):{}:n?L0({element:n,padding:s}).fn(r):{}}}},MD=(e,t)=>({...ED(e),options:[e,t]}),ID=(e,t)=>({...TD(e),options:[e,t]}),LD=(e,t)=>({...PD(e),options:[e,t]}),FD=(e,t)=>({...ND(e),options:[e,t]}),zD=(e,t)=>({...RD(e),options:[e,t]}),UD=(e,t)=>({...jD(e),options:[e,t]}),VD=(e,t)=>({...AD(e),options:[e,t]});var WD="Arrow",w1=y.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return u.jsx(Me.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});w1.displayName=WD;var $D=w1;function _1(e){const[t,r]=y.useState(void 0);return nr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Cg="Popper",[b1,ma]=Xr(Cg),[BD,S1]=b1(Cg),k1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=y.useState(null);return u.jsx(BD,{scope:t,anchor:n,onAnchorChange:s,children:r})};k1.displayName=Cg;var C1="PopperAnchor",E1=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=S1(C1,r),i=y.useRef(null),a=Xe(t,i);return y.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:u.jsx(Me.div,{...s,ref:a})});E1.displayName=C1;var Eg="PopperContent",[HD,YD]=b1(Eg),T1=y.forwardRef((e,t)=>{var fe,ge,be,Pe,Te,Se;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:x,...v}=e,w=S1(Eg,r),[h,g]=y.useState(null),_=Xe(t,rt=>g(rt)),[C,T]=y.useState(null),E=_1(C),j=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,P=n+(o!=="center"?"-"+o:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},q=Array.isArray(c)?c:[c],N=q.length>0,F={padding:L,boundary:q.filter(KD),altBoundary:N},{refs:b,floatingStyles:W,placement:te,isPositioned:$,middlewareData:Z}=OD({strategy:"fixed",placement:P,whileElementsMounted:(...rt)=>CD(...rt,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[MD({mainAxis:s+O,alignmentAxis:i}),l&&ID({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?LD():void 0,...F}),l&&FD({...F}),zD({...F,apply:({elements:rt,rects:k,availableWidth:J,availableHeight:K})=>{const{width:D,height:S}=k.reference,R=rt.floating.style;R.setProperty("--radix-popper-available-width",`${J}px`),R.setProperty("--radix-popper-available-height",`${K}px`),R.setProperty("--radix-popper-anchor-width",`${D}px`),R.setProperty("--radix-popper-anchor-height",`${S}px`)}}),C&&VD({element:C,padding:a}),GD({arrowWidth:j,arrowHeight:O}),p&&UD({strategy:"referenceHidden",...F})]}),[I,Q]=j1(te),z=Pt(x);nr(()=>{$&&(z==null||z())},[$,z]);const V=(fe=Z.arrow)==null?void 0:fe.x,de=(ge=Z.arrow)==null?void 0:ge.y,ne=((be=Z.arrow)==null?void 0:be.centerOffset)!==0,[se,Ee]=y.useState();return nr(()=>{h&&Ee(window.getComputedStyle(h).zIndex)},[h]),u.jsx("div",{ref:b.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:$?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=Z.transformOrigin)==null?void 0:Pe.x,(Te=Z.transformOrigin)==null?void 0:Te.y].join(" "),...((Se=Z.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(HD,{scope:r,placedSide:I,onArrowChange:T,arrowX:V,arrowY:de,shouldHideArrow:ne,children:u.jsx(Me.div,{"data-side":I,"data-align":Q,...v,ref:_,style:{...v.style,animation:$?void 0:"none"}})})})});T1.displayName=Eg;var N1="PopperArrow",ZD={top:"bottom",right:"left",bottom:"top",left:"right"},R1=y.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=YD(N1,n),i=ZD[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx($D,{...s,ref:r,style:{...s.style,display:"block"}})})});R1.displayName=N1;function KD(e){return e!==null}var GD=e=>({name:"transformOrigin",options:e,fn(t){var w,h,g;const{placement:r,rects:n,middlewareData:s}=t,i=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=j1(r),f={start:"0%",center:"50%",end:"100%"}[d],p=(((h=s.arrow)==null?void 0:h.x)??0)+a/2,m=(((g=s.arrow)==null?void 0:g.y)??0)+l/2;let x="",v="";return c==="bottom"?(x=i?f:`${p}px`,v=`${-l}px`):c==="top"?(x=i?f:`${p}px`,v=`${n.floating.height+l}px`):c==="right"?(x=`${-l}px`,v=i?f:`${m}px`):c==="left"&&(x=`${n.floating.width+l}px`,v=i?f:`${m}px`),{data:{x,y:v}}}});function j1(e){const[t,r="center"]=e.split("-");return[t,r]}var Tg=k1,Ng=E1,Rg=T1,jg=R1,qD="Portal",lc=y.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=y.useState(!1);nr(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?P_.createPortal(u.jsx(Me.div,{...n,ref:t}),i):null});lc.displayName=qD;function XD(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Cr=e=>{const{present:t,children:r}=e,n=QD(t),s=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=Xe(n.ref,JD(s));return typeof r=="function"||n.isPresent?y.cloneElement(s,{ref:o}):null};Cr.displayName="Presence";function QD(e){const[t,r]=y.useState(),n=y.useRef({}),s=y.useRef(e),o=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=XD(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=qc(n.current);o.current=a==="mounted"?c:"none"},[a]),nr(()=>{const c=n.current,d=s.current;if(d!==e){const p=o.current,m=qc(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nr(()=>{if(t){const c=f=>{const m=qc(n.current).includes(f.animationName);f.target===t&&m&&_s.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=qc(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function qc(e){return(e==null?void 0:e.animationName)||"none"}function JD(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var wh="rovingFocusGroup.onEntryFocus",eO={bubbles:!1,cancelable:!0},af="RovingFocusGroup",[zp,P1,tO]=tf(af),[rO,D1]=Xr(af,[tO]),[nO,sO]=rO(af),O1=y.forwardRef((e,t)=>u.jsx(zp.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(zp.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(oO,{...e,ref:t})})}));O1.displayName=af;var oO=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,p=y.useRef(null),m=Xe(t,p),x=rf(o),[v=null,w]=oo({prop:i,defaultProp:a,onChange:l}),[h,g]=y.useState(!1),_=Pt(c),C=P1(r),T=y.useRef(!1),[E,j]=y.useState(0);return y.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(wh,_),()=>O.removeEventListener(wh,_)},[_]),u.jsx(nO,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:v,onItemFocus:y.useCallback(O=>w(O),[w]),onItemShiftTab:y.useCallback(()=>g(!0),[]),onFocusableItemAdd:y.useCallback(()=>j(O=>O+1),[]),onFocusableItemRemove:y.useCallback(()=>j(O=>O-1),[]),children:u.jsx(Me.div,{tabIndex:h||E===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{T.current=!0}),onFocus:ue(e.onFocus,O=>{const P=!T.current;if(O.target===O.currentTarget&&P&&!h){const L=new CustomEvent(wh,eO);if(O.currentTarget.dispatchEvent(L),!L.defaultPrevented){const q=C().filter(te=>te.focusable),N=q.find(te=>te.active),F=q.find(te=>te.id===v),W=[N,F,...q].filter(Boolean).map(te=>te.ref.current);I1(W,d)}}T.current=!1}),onBlur:ue(e.onBlur,()=>g(!1))})})}),A1="RovingFocusGroupItem",M1=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=On(),l=o||a,c=sO(A1,r),d=c.currentTabStopId===l,f=P1(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return y.useEffect(()=>{if(n)return p(),()=>m()},[n,p,m]),u.jsx(zp.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:u.jsx(Me.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:ue(e.onMouseDown,x=>{n?c.onItemFocus(l):x.preventDefault()}),onFocus:ue(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=lO(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let h=f().filter(g=>g.focusable).map(g=>g.ref.current);if(v==="last")h.reverse();else if(v==="prev"||v==="next"){v==="prev"&&h.reverse();const g=h.indexOf(x.currentTarget);h=c.loop?cO(h,g+1):h.slice(g+1)}setTimeout(()=>I1(h))}})})})});M1.displayName=A1;var iO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function lO(e,t,r){const n=aO(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return iO[n]}function I1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function cO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var uO=O1,dO=M1,fO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ci=new WeakMap,Xc=new WeakMap,Qc={},_h=0,L1=function(e){return e&&(e.host||L1(e.parentNode))},hO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=L1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pO=function(e,t,r,n){var s=hO(t,Array.isArray(e)?e:[e]);Qc[r]||(Qc[r]=new WeakMap);var o=Qc[r],i=[],a=new Set,l=new Set(s),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};s.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else try{var m=p.getAttribute(n),x=m!==null&&m!=="false",v=(ci.get(p)||0)+1,w=(o.get(p)||0)+1;ci.set(p,v),o.set(p,w),i.push(p),v===1&&x&&Xc.set(p,!0),w===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",p,h)}})};return d(t),a.clear(),_h++,function(){i.forEach(function(f){var p=ci.get(f)-1,m=o.get(f)-1;ci.set(f,p),o.set(f,m),p||(Xc.has(f)||f.removeAttribute(n),Xc.delete(f)),m||f.removeAttribute(r)}),_h--,_h||(ci=new WeakMap,ci=new WeakMap,Xc=new WeakMap,Qc={})}},Pg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=fO(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),pO(n,s,r,"aria-hidden")):function(){return null}},En=function(){return En=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return PO;var t=DO(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},AO=V1(),zi="data-scroll-locked",MO=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` .`.concat(gO,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; @@ -218,29 +218,29 @@ Error generating stack: `+o.message+` body[`).concat(zi,`] { `).concat(vO,": ").concat(a,`px; } -`)},V0=function(){var e=parseInt(document.body.getAttribute(zi)||"0",10);return isFinite(e)?e:0},IO=function(){y.useEffect(function(){return document.body.setAttribute(zi,(V0()+1).toString()),function(){var e=V0()-1;e<=0?document.body.removeAttribute(zi):document.body.setAttribute(zi,e.toString())}},[])},LO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;IO();var o=y.useMemo(function(){return OO(s)},[s]);return y.createElement(AO,{styles:MO(o,!t,s,r?"":"!important")})},Up=!1;if(typeof window<"u")try{var Jc=Object.defineProperty({},"passive",{get:function(){return Up=!0,!0}});window.addEventListener("test",Jc,Jc),window.removeEventListener("test",Jc,Jc)}catch{Up=!1}var ui=Up?{passive:!1}:!1,FO=function(e){return e.tagName==="TEXTAREA"},W1=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!FO(e)&&r[t]==="visible")},zO=function(e){return W1(e,"overflowY")},UO=function(e){return W1(e,"overflowX")},W0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=$1(e,n);if(s){var o=B1(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},VO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},WO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$1=function(e,t){return e==="v"?zO(t):UO(t)},B1=function(e,t){return e==="v"?VO(t):WO(t)},$O=function(e,t){return e==="h"&&t==="rtl"?-1:1},BO=function(e,t,r,n,s){var o=$O(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,d=i>0,f=0,p=0;do{var m=B1(e,a),w=m[0],v=m[1],x=m[2],h=v-x-o*w;(w||h)&&$1(e,a)&&(f+=h,p+=w),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(p)<1||!s))&&(c=!0),c},eu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$0=function(e){return[e.deltaX,e.deltaY]},B0=function(e){return e&&"current"in e?e.current:e},HO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YO=function(e){return` +`)},V0=function(){var e=parseInt(document.body.getAttribute(zi)||"0",10);return isFinite(e)?e:0},IO=function(){y.useEffect(function(){return document.body.setAttribute(zi,(V0()+1).toString()),function(){var e=V0()-1;e<=0?document.body.removeAttribute(zi):document.body.setAttribute(zi,e.toString())}},[])},LO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;IO();var o=y.useMemo(function(){return OO(s)},[s]);return y.createElement(AO,{styles:MO(o,!t,s,r?"":"!important")})},Up=!1;if(typeof window<"u")try{var Jc=Object.defineProperty({},"passive",{get:function(){return Up=!0,!0}});window.addEventListener("test",Jc,Jc),window.removeEventListener("test",Jc,Jc)}catch{Up=!1}var ui=Up?{passive:!1}:!1,FO=function(e){return e.tagName==="TEXTAREA"},W1=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!FO(e)&&r[t]==="visible")},zO=function(e){return W1(e,"overflowY")},UO=function(e){return W1(e,"overflowX")},W0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=$1(e,n);if(s){var o=B1(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},VO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},WO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$1=function(e,t){return e==="v"?zO(t):UO(t)},B1=function(e,t){return e==="v"?VO(t):WO(t)},$O=function(e,t){return e==="h"&&t==="rtl"?-1:1},BO=function(e,t,r,n,s){var o=$O(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,d=i>0,f=0,p=0;do{var m=B1(e,a),x=m[0],v=m[1],w=m[2],h=v-w-o*x;(x||h)&&$1(e,a)&&(f+=h,p+=x),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(p)<1||!s))&&(c=!0),c},eu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$0=function(e){return[e.deltaX,e.deltaY]},B0=function(e){return e&&"current"in e?e.current:e},HO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YO=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},ZO=0,di=[];function GO(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),s=y.useState(ZO++)[0],o=y.useState(V1)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=mO([e.lockRef.current],(e.shards||[]).map(B0),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!i.current.allowPinchZoom;var h=eu(v),g=r.current,_="deltaX"in v?v.deltaX:g[0]-h[0],C="deltaY"in v?v.deltaY:g[1]-h[1],T,E=v.target,P=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&P==="h"&&E.type==="range")return!1;var O=W0(P,E);if(!O)return!0;if(O?T=P:(T=P==="v"?"h":"v",O=W0(P,E)),!O)return!1;if(!n.current&&"changedTouches"in v&&(_||C)&&(n.current=T),!T)return!0;var j=n.current||T;return BO(j,x,v,j==="h"?_:C,!0)},[]),l=y.useCallback(function(v){var x=v;if(!(!di.length||di[di.length-1]!==o)){var h="deltaY"in x?$0(x):eu(x),g=t.current.filter(function(T){return T.name===x.type&&(T.target===x.target||x.target===T.shadowParent)&&HO(T.delta,h)})[0];if(g&&g.should){x.cancelable&&x.preventDefault();return}if(!g){var _=(i.current.shards||[]).map(B0).filter(Boolean).filter(function(T){return T.contains(x.target)}),C=_.length>0?a(x,_[0]):!i.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),c=y.useCallback(function(v,x,h,g){var _={name:v,delta:x,target:h,should:g,shadowParent:KO(h)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=y.useCallback(function(v){r.current=eu(v),n.current=void 0},[]),f=y.useCallback(function(v){c(v.type,$0(v),v.target,a(v,e.lockRef.current))},[]),p=y.useCallback(function(v){c(v.type,eu(v),v.target,a(v,e.lockRef.current))},[]);y.useEffect(function(){return di.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ui),document.addEventListener("touchmove",l,ui),document.addEventListener("touchstart",d,ui),function(){di=di.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ui),document.removeEventListener("touchmove",l,ui),document.removeEventListener("touchstart",d,ui)}},[]);var m=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(o,{styles:YO(s)}):null,m?y.createElement(LO,{gapMode:e.gapMode}):null)}function KO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=kO(U1,GO);var cf=y.forwardRef(function(e,t){return y.createElement(lf,En({},e,{ref:t,sideCar:qO}))});cf.classNames=lf.classNames;var Vp=["Enter"," "],XO=["ArrowDown","PageUp","Home"],H1=["ArrowUp","PageDown","End"],QO=[...XO,...H1],JO={ltr:[...Vp,"ArrowRight"],rtl:[...Vp,"ArrowLeft"]},eA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ac="Menu",[Dl,tA,rA]=tf(ac),[Xo,Y1]=Xr(ac,[rA,ma,D1]),uf=ma(),Z1=D1(),[nA,Qo]=Xo(ac),[sA,lc]=Xo(ac),G1=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=uf(t),[l,c]=y.useState(null),d=y.useRef(!1),f=jt(o),p=rf(s);return y.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),u.jsx(Tg,{...a,children:u.jsx(nA,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c,children:u.jsx(sA,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:i,children:n})})})};G1.displayName=ac;var oA="MenuAnchor",Dg=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return u.jsx(Ng,{...s,...n,ref:t})});Dg.displayName=oA;var Og="MenuPortal",[iA,K1]=Xo(Og,{forceMount:void 0}),q1=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Qo(Og,t);return u.jsx(iA,{scope:t,forceMount:r,children:u.jsx(Cr,{present:r||o.open,children:u.jsx(ic,{asChild:!0,container:s,children:n})})})};q1.displayName=Og;var Gr="MenuContent",[aA,Ag]=Xo(Gr),X1=y.forwardRef((e,t)=>{const r=K1(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Qo(Gr,e.__scopeMenu),i=lc(Gr,e.__scopeMenu);return u.jsx(Dl.Provider,{scope:e.__scopeMenu,children:u.jsx(Cr,{present:n||o.open,children:u.jsx(Dl.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(lA,{...s,ref:t}):u.jsx(cA,{...s,ref:t})})})})}),lA=y.forwardRef((e,t)=>{const r=Qo(Gr,e.__scopeMenu),n=y.useRef(null),s=Ke(t,n);return y.useEffect(()=>{const o=n.current;if(o)return jg(o)},[]),u.jsx(Mg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),cA=y.forwardRef((e,t)=>{const r=Qo(Gr,e.__scopeMenu);return u.jsx(Mg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Mg=y.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:w,...v}=e,x=Qo(Gr,r),h=lc(Gr,r),g=uf(r),_=Z1(r),C=tA(r),[T,E]=y.useState(null),P=y.useRef(null),O=Ke(t,P,x.onContentChange),j=y.useRef(0),L=y.useRef(""),q=y.useRef(0),N=y.useRef(null),F=y.useRef("right"),b=y.useRef(0),W=w?cf:y.Fragment,te=w?{as:ms,allowPinchZoom:!0}:void 0,$=I=>{var fe,ge;const Q=L.current+I,z=C().filter(be=>!be.disabled),V=document.activeElement,de=(fe=z.find(be=>be.ref.current===V))==null?void 0:fe.textValue,ne=z.map(be=>be.textValue),se=_A(ne,Q,de),Ee=(ge=z.find(be=>be.textValue===se))==null?void 0:ge.ref.current;(function be(Pe){L.current=Pe,window.clearTimeout(j.current),Pe!==""&&(j.current=window.setTimeout(()=>be(""),1e3))})(Q),Ee&&setTimeout(()=>Ee.focus())};y.useEffect(()=>()=>window.clearTimeout(j.current),[]),yg();const Z=y.useCallback(I=>{var z,V;return F.current===((z=N.current)==null?void 0:z.side)&&SA(I,(V=N.current)==null?void 0:V.area)},[]);return u.jsx(aA,{scope:r,searchRef:L,onItemEnter:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:y.useCallback(I=>{var Q;Z(I)||((Q=P.current)==null||Q.focus(),E(null))},[Z]),onTriggerLeave:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:y.useCallback(I=>{N.current=I},[]),children:u.jsx(W,{...te,children:u.jsx(nf,{asChild:!0,trapped:s,onMountAutoFocus:ue(o,I=>{var Q;I.preventDefault(),(Q=P.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:u.jsx(uO,{asChild:!0,..._,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:ue(l,I=>{h.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Rg,{role:"menu","aria-orientation":"vertical","data-state":hb(x.open),"data-radix-menu-content":"",dir:h.dir,...g,...v,ref:O,style:{outline:"none",...v.style},onKeyDown:ue(v.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,V=I.ctrlKey||I.altKey||I.metaKey,de=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!V&&de&&$(I.key));const ne=P.current;if(I.target!==ne||!QO.includes(I.key))return;I.preventDefault();const Ee=C().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);H1.includes(I.key)&&Ee.reverse(),wA(Ee)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(j.current),L.current="")}),onPointerMove:ue(e.onPointerMove,Ol(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const V=I.clientX>b.current?"right":"left";F.current=V,b.current=I.clientX}}))})})})})})})});X1.displayName=Gr;var uA="MenuGroup",Ig=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{role:"group",...n,ref:t})});Ig.displayName=uA;var dA="MenuLabel",Q1=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});Q1.displayName=dA;var ud="MenuItem",H0="menu.itemSelect",df=y.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=y.useRef(null),i=lc(ud,e.__scopeMenu),a=Ag(ud,e.__scopeMenu),l=Ke(t,o),c=y.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const p=new CustomEvent(H0,{bubbles:!0,cancelable:!0});f.addEventListener(H0,m=>n==null?void 0:n(m),{once:!0}),vg(f,p),p.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(J1,{...s,ref:l,disabled:r,onClick:ue(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),c.current=!0},onPointerUp:ue(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ue(e.onKeyDown,f=>{const p=a.searchRef.current!=="";r||p&&f.key===" "||Vp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});df.displayName=ud;var J1=y.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=Ag(ud,r),a=Z1(r),l=y.useRef(null),c=Ke(t,l),[d,f]=y.useState(!1),[p,m]=y.useState("");return y.useEffect(()=>{const w=l.current;w&&m((w.textContent??"").trim())},[o.children]),u.jsx(Dl.ItemSlot,{scope:r,disabled:n,textValue:s??p,children:u.jsx(dO,{asChild:!0,...a,focusable:!n,children:u.jsx(Me.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:ue(e.onPointerMove,Ol(w=>{n?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,Ol(w=>i.onItemLeave(w))),onFocus:ue(e.onFocus,()=>f(!0)),onBlur:ue(e.onBlur,()=>f(!1))})})})}),fA="MenuCheckboxItem",eb=y.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return u.jsx(ob,{scope:e.__scopeMenu,checked:r,children:u.jsx(df,{role:"menuitemcheckbox","aria-checked":dd(r)?"mixed":r,...s,ref:t,"data-state":Fg(r),onSelect:ue(s.onSelect,()=>n==null?void 0:n(dd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});eb.displayName=fA;var tb="MenuRadioGroup",[hA,pA]=Xo(tb,{value:void 0,onValueChange:()=>{}}),rb=y.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=jt(n);return u.jsx(hA,{scope:e.__scopeMenu,value:r,onValueChange:o,children:u.jsx(Ig,{...s,ref:t})})});rb.displayName=tb;var nb="MenuRadioItem",sb=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=pA(nb,e.__scopeMenu),o=r===s.value;return u.jsx(ob,{scope:e.__scopeMenu,checked:o,children:u.jsx(df,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":Fg(o),onSelect:ue(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});sb.displayName=nb;var Lg="MenuItemIndicator",[ob,mA]=Xo(Lg,{checked:!1}),ib=y.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=mA(Lg,r);return u.jsx(Cr,{present:n||dd(o.checked)||o.checked===!0,children:u.jsx(Me.span,{...s,ref:t,"data-state":Fg(o.checked)})})});ib.displayName=Lg;var gA="MenuSeparator",ab=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ab.displayName=gA;var vA="MenuArrow",lb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return u.jsx(Pg,{...s,...n,ref:t})});lb.displayName=vA;var yA="MenuSub",[rU,cb]=Xo(yA),Wa="MenuSubTrigger",ub=y.forwardRef((e,t)=>{const r=Qo(Wa,e.__scopeMenu),n=lc(Wa,e.__scopeMenu),s=cb(Wa,e.__scopeMenu),o=Ag(Wa,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),u.jsx(Dg,{asChild:!0,...c,children:u.jsx(J1,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":hb(r.open),...e,ref:Jd(t,s.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,Ol(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ue(e.onPointerLeave,Ol(f=>{var m,w;d();const p=(m=r.content)==null?void 0:m.getBoundingClientRect();if(p){const v=(w=r.content)==null?void 0:w.dataset.side,x=v==="right",h=x?-5:5,g=p[x?"left":"right"],_=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+h,y:f.clientY},{x:g,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:g,y:p.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,f=>{var m;const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||JO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});ub.displayName=Wa;var db="MenuSubContent",fb=y.forwardRef((e,t)=>{const r=K1(Gr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Qo(Gr,e.__scopeMenu),i=lc(Gr,e.__scopeMenu),a=cb(db,e.__scopeMenu),l=y.useRef(null),c=Ke(t,l);return u.jsx(Dl.Provider,{scope:e.__scopeMenu,children:u.jsx(Cr,{present:n||o.open,children:u.jsx(Dl.Slot,{scope:e.__scopeMenu,children:u.jsx(Mg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ue(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),p=eA[i.dir].includes(d.key);f&&p&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});fb.displayName=db;function hb(e){return e?"open":"closed"}function dd(e){return e==="indeterminate"}function Fg(e){return dd(e)?"indeterminate":e?"checked":"unchecked"}function wA(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function xA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function _A(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=xA(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function bA(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function SA(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return bA(r,t)}function Ol(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kA=G1,CA=Dg,EA=q1,TA=X1,NA=Ig,RA=Q1,PA=df,jA=eb,DA=rb,OA=sb,AA=ib,MA=ab,IA=lb,LA=ub,FA=fb,zg="DropdownMenu",[zA,nU]=Xr(zg,[Y1]),vr=Y1(),[UA,pb]=zA(zg),mb=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=vr(t),c=y.useRef(null),[d=!1,f]=ro({prop:s,defaultProp:o,onChange:i});return u.jsx(UA,{scope:t,triggerId:On(),triggerRef:c,contentId:On(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(p=>!p),[f]),modal:a,children:u.jsx(kA,{...l,open:d,onOpenChange:f,dir:n,modal:a,children:r})})};mb.displayName=zg;var gb="DropdownMenuTrigger",vb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=pb(gb,r),i=vr(r);return u.jsx(CA,{asChild:!0,...i,children:u.jsx(Me.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Jd(t,o.triggerRef),onPointerDown:ue(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:ue(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});vb.displayName=gb;var VA="DropdownMenuPortal",yb=e=>{const{__scopeDropdownMenu:t,...r}=e,n=vr(t);return u.jsx(EA,{...n,...r})};yb.displayName=VA;var wb="DropdownMenuContent",xb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=pb(wb,r),o=vr(r),i=y.useRef(!1);return u.jsx(TA,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ue(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!s.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xb.displayName=wb;var WA="DropdownMenuGroup",$A=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(NA,{...s,...n,ref:t})});$A.displayName=WA;var BA="DropdownMenuLabel",_b=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(RA,{...s,...n,ref:t})});_b.displayName=BA;var HA="DropdownMenuItem",bb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(PA,{...s,...n,ref:t})});bb.displayName=HA;var YA="DropdownMenuCheckboxItem",Sb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(jA,{...s,...n,ref:t})});Sb.displayName=YA;var ZA="DropdownMenuRadioGroup",GA=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(DA,{...s,...n,ref:t})});GA.displayName=ZA;var KA="DropdownMenuRadioItem",kb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(OA,{...s,...n,ref:t})});kb.displayName=KA;var qA="DropdownMenuItemIndicator",Cb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(AA,{...s,...n,ref:t})});Cb.displayName=qA;var XA="DropdownMenuSeparator",Eb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(MA,{...s,...n,ref:t})});Eb.displayName=XA;var QA="DropdownMenuArrow",JA=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(IA,{...s,...n,ref:t})});JA.displayName=QA;var eM="DropdownMenuSubTrigger",Tb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(LA,{...s,...n,ref:t})});Tb.displayName=eM;var tM="DropdownMenuSubContent",Nb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(FA,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Nb.displayName=tM;var rM=mb,nM=vb,sM=yb,Rb=xb,Pb=_b,jb=bb,Db=Sb,Ob=kb,Ab=Cb,Mb=Eb,Ib=Tb,Lb=Nb;const Fb=rM,zb=nM,oM=y.forwardRef(({className:e,inset:t,children:r,...n},s)=>u.jsxs(Ib,{ref:s,className:ve("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,u.jsx(NP,{className:"ml-auto h-4 w-4"})]}));oM.displayName=Ib.displayName;const iM=y.forwardRef(({className:e,...t},r)=>u.jsx(Lb,{ref:r,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));iM.displayName=Lb.displayName;const Ug=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(sM,{children:u.jsx(Rb,{ref:n,sideOffset:t,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Ug.displayName=Rb.displayName;const Ui=y.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(jb,{ref:n,className:ve("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Ui.displayName=jb.displayName;const aM=y.forwardRef(({className:e,children:t,checked:r,...n},s)=>u.jsxs(Db,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Ab,{children:u.jsx(q_,{className:"h-4 w-4"})})}),t]}));aM.displayName=Db.displayName;const lM=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(Ob,{ref:n,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Ab,{children:u.jsx(jP,{className:"h-2 w-2 fill-current"})})}),t]}));lM.displayName=Ob.displayName;const Ub=y.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(Pb,{ref:n,className:ve("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Ub.displayName=Pb.displayName;const Vb=y.forwardRef(({className:e,...t},r)=>u.jsx(Mb,{ref:r,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));Vb.displayName=Mb.displayName;var Vg="Dialog",[Wb,$b]=Xr(Vg),[cM,wn]=Wb(Vg),Bb=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=y.useRef(null),l=y.useRef(null),[c=!1,d]=ro({prop:n,defaultProp:s,onChange:o});return u.jsx(cM,{scope:t,triggerRef:a,contentRef:l,contentId:On(),titleId:On(),descriptionId:On(),open:c,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};Bb.displayName=Vg;var Hb="DialogTrigger",Yb=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(Hb,r),o=Ke(t,s.triggerRef);return u.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Bg(s.open),...n,ref:o,onClick:ue(e.onClick,s.onOpenToggle)})});Yb.displayName=Hb;var Wg="DialogPortal",[uM,Zb]=Wb(Wg,{forceMount:void 0}),Gb=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=wn(Wg,t);return u.jsx(uM,{scope:t,forceMount:r,children:y.Children.map(n,i=>u.jsx(Cr,{present:r||o.open,children:u.jsx(ic,{asChild:!0,container:s,children:i})}))})};Gb.displayName=Wg;var fd="DialogOverlay",Kb=y.forwardRef((e,t)=>{const r=Zb(fd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wn(fd,e.__scopeDialog);return o.modal?u.jsx(Cr,{present:n||o.open,children:u.jsx(dM,{...s,ref:t})}):null});Kb.displayName=fd;var dM=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(fd,r);return u.jsx(cf,{as:ms,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Me.div,{"data-state":Bg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ho="DialogContent",qb=y.forwardRef((e,t)=>{const r=Zb(Ho,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wn(Ho,e.__scopeDialog);return u.jsx(Cr,{present:n||o.open,children:o.modal?u.jsx(fM,{...s,ref:t}):u.jsx(hM,{...s,ref:t})})});qb.displayName=Ho;var fM=y.forwardRef((e,t)=>{const r=wn(Ho,e.__scopeDialog),n=y.useRef(null),s=Ke(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return jg(o)},[]),u.jsx(Xb,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault())})}),hM=y.forwardRef((e,t)=>{const r=wn(Ho,e.__scopeDialog),n=y.useRef(!1),s=y.useRef(!1);return u.jsx(Xb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Xb=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=wn(Ho,r),l=y.useRef(null),c=Ke(t,l);return yg(),u.jsxs(u.Fragment,{children:[u.jsx(nf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(fa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bg(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(mM,{titleId:a.titleId}),u.jsx(vM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$g="DialogTitle",Qb=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn($g,r);return u.jsx(Me.h2,{id:s.titleId,...n,ref:t})});Qb.displayName=$g;var Jb="DialogDescription",eS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(Jb,r);return u.jsx(Me.p,{id:s.descriptionId,...n,ref:t})});eS.displayName=Jb;var tS="DialogClose",rS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wn(tS,r);return u.jsx(Me.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,()=>s.onOpenChange(!1))})});rS.displayName=tS;function Bg(e){return e?"open":"closed"}var nS="DialogTitleWarning",[pM,sS]=bj(nS,{contentName:Ho,titleName:$g,docsSlug:"dialog"}),mM=({titleId:e})=>{const t=sS(nS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +`)},ZO=0,di=[];function KO(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),s=y.useState(ZO++)[0],o=y.useState(V1)[0],i=y.useRef(e);y.useEffect(function(){i.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=mO([e.lockRef.current],(e.shards||[]).map(B0),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!i.current.allowPinchZoom;var h=eu(v),g=r.current,_="deltaX"in v?v.deltaX:g[0]-h[0],C="deltaY"in v?v.deltaY:g[1]-h[1],T,E=v.target,j=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in v&&j==="h"&&E.type==="range")return!1;var O=W0(j,E);if(!O)return!0;if(O?T=j:(T=j==="v"?"h":"v",O=W0(j,E)),!O)return!1;if(!n.current&&"changedTouches"in v&&(_||C)&&(n.current=T),!T)return!0;var P=n.current||T;return BO(P,w,v,P==="h"?_:C,!0)},[]),l=y.useCallback(function(v){var w=v;if(!(!di.length||di[di.length-1]!==o)){var h="deltaY"in w?$0(w):eu(w),g=t.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&HO(T.delta,h)})[0];if(g&&g.should){w.cancelable&&w.preventDefault();return}if(!g){var _=(i.current.shards||[]).map(B0).filter(Boolean).filter(function(T){return T.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=y.useCallback(function(v,w,h,g){var _={name:v,delta:w,target:h,should:g,shadowParent:GO(h)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=y.useCallback(function(v){r.current=eu(v),n.current=void 0},[]),f=y.useCallback(function(v){c(v.type,$0(v),v.target,a(v,e.lockRef.current))},[]),p=y.useCallback(function(v){c(v.type,eu(v),v.target,a(v,e.lockRef.current))},[]);y.useEffect(function(){return di.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ui),document.addEventListener("touchmove",l,ui),document.addEventListener("touchstart",d,ui),function(){di=di.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ui),document.removeEventListener("touchmove",l,ui),document.removeEventListener("touchstart",d,ui)}},[]);var m=e.removeScrollBar,x=e.inert;return y.createElement(y.Fragment,null,x?y.createElement(o,{styles:YO(s)}):null,m?y.createElement(LO,{gapMode:e.gapMode}):null)}function GO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qO=kO(U1,KO);var cf=y.forwardRef(function(e,t){return y.createElement(lf,En({},e,{ref:t,sideCar:qO}))});cf.classNames=lf.classNames;var Vp=["Enter"," "],XO=["ArrowDown","PageUp","Home"],H1=["ArrowUp","PageDown","End"],QO=[...XO,...H1],JO={ltr:[...Vp,"ArrowRight"],rtl:[...Vp,"ArrowLeft"]},eA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cc="Menu",[Al,tA,rA]=tf(cc),[Qo,Y1]=Xr(cc,[rA,ma,D1]),uf=ma(),Z1=D1(),[nA,Jo]=Qo(cc),[sA,uc]=Qo(cc),K1=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:i=!0}=e,a=uf(t),[l,c]=y.useState(null),d=y.useRef(!1),f=Pt(o),p=rf(s);return y.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),u.jsx(Tg,{...a,children:u.jsx(nA,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:c,children:u.jsx(sA,{scope:t,onClose:y.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:i,children:n})})})};K1.displayName=cc;var oA="MenuAnchor",Dg=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return u.jsx(Ng,{...s,...n,ref:t})});Dg.displayName=oA;var Og="MenuPortal",[iA,G1]=Qo(Og,{forceMount:void 0}),q1=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=Jo(Og,t);return u.jsx(iA,{scope:t,forceMount:r,children:u.jsx(Cr,{present:r||o.open,children:u.jsx(lc,{asChild:!0,container:s,children:n})})})};q1.displayName=Og;var Kr="MenuContent",[aA,Ag]=Qo(Kr),X1=y.forwardRef((e,t)=>{const r=G1(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Jo(Kr,e.__scopeMenu),i=uc(Kr,e.__scopeMenu);return u.jsx(Al.Provider,{scope:e.__scopeMenu,children:u.jsx(Cr,{present:n||o.open,children:u.jsx(Al.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(lA,{...s,ref:t}):u.jsx(cA,{...s,ref:t})})})})}),lA=y.forwardRef((e,t)=>{const r=Jo(Kr,e.__scopeMenu),n=y.useRef(null),s=Xe(t,n);return y.useEffect(()=>{const o=n.current;if(o)return Pg(o)},[]),u.jsx(Mg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),cA=y.forwardRef((e,t)=>{const r=Jo(Kr,e.__scopeMenu);return u.jsx(Mg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Mg=y.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:x,...v}=e,w=Jo(Kr,r),h=uc(Kr,r),g=uf(r),_=Z1(r),C=tA(r),[T,E]=y.useState(null),j=y.useRef(null),O=Xe(t,j,w.onContentChange),P=y.useRef(0),L=y.useRef(""),q=y.useRef(0),N=y.useRef(null),F=y.useRef("right"),b=y.useRef(0),W=x?cf:y.Fragment,te=x?{as:ms,allowPinchZoom:!0}:void 0,$=I=>{var fe,ge;const Q=L.current+I,z=C().filter(be=>!be.disabled),V=document.activeElement,de=(fe=z.find(be=>be.ref.current===V))==null?void 0:fe.textValue,ne=z.map(be=>be.textValue),se=_A(ne,Q,de),Ee=(ge=z.find(be=>be.textValue===se))==null?void 0:ge.ref.current;(function be(Pe){L.current=Pe,window.clearTimeout(P.current),Pe!==""&&(P.current=window.setTimeout(()=>be(""),1e3))})(Q),Ee&&setTimeout(()=>Ee.focus())};y.useEffect(()=>()=>window.clearTimeout(P.current),[]),yg();const Z=y.useCallback(I=>{var z,V;return F.current===((z=N.current)==null?void 0:z.side)&&SA(I,(V=N.current)==null?void 0:V.area)},[]);return u.jsx(aA,{scope:r,searchRef:L,onItemEnter:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:y.useCallback(I=>{var Q;Z(I)||((Q=j.current)==null||Q.focus(),E(null))},[Z]),onTriggerLeave:y.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:q,onPointerGraceIntentChange:y.useCallback(I=>{N.current=I},[]),children:u.jsx(W,{...te,children:u.jsx(nf,{asChild:!0,trapped:s,onMountAutoFocus:ue(o,I=>{var Q;I.preventDefault(),(Q=j.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:u.jsx(uO,{asChild:!0,..._,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:ue(l,I=>{h.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Rg,{role:"menu","aria-orientation":"vertical","data-state":hb(w.open),"data-radix-menu-content":"",dir:h.dir,...g,...v,ref:O,style:{outline:"none",...v.style},onKeyDown:ue(v.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,V=I.ctrlKey||I.altKey||I.metaKey,de=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!V&&de&&$(I.key));const ne=j.current;if(I.target!==ne||!QO.includes(I.key))return;I.preventDefault();const Ee=C().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);H1.includes(I.key)&&Ee.reverse(),xA(Ee)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(P.current),L.current="")}),onPointerMove:ue(e.onPointerMove,Ml(I=>{const Q=I.target,z=b.current!==I.clientX;if(I.currentTarget.contains(Q)&&z){const V=I.clientX>b.current?"right":"left";F.current=V,b.current=I.clientX}}))})})})})})})});X1.displayName=Kr;var uA="MenuGroup",Ig=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{role:"group",...n,ref:t})});Ig.displayName=uA;var dA="MenuLabel",Q1=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});Q1.displayName=dA;var ud="MenuItem",H0="menu.itemSelect",df=y.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=y.useRef(null),i=uc(ud,e.__scopeMenu),a=Ag(ud,e.__scopeMenu),l=Xe(t,o),c=y.useRef(!1),d=()=>{const f=o.current;if(!r&&f){const p=new CustomEvent(H0,{bubbles:!0,cancelable:!0});f.addEventListener(H0,m=>n==null?void 0:n(m),{once:!0}),vg(f,p),p.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(J1,{...s,ref:l,disabled:r,onClick:ue(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),c.current=!0},onPointerUp:ue(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:ue(e.onKeyDown,f=>{const p=a.searchRef.current!=="";r||p&&f.key===" "||Vp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});df.displayName=ud;var J1=y.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,i=Ag(ud,r),a=Z1(r),l=y.useRef(null),c=Xe(t,l),[d,f]=y.useState(!1),[p,m]=y.useState("");return y.useEffect(()=>{const x=l.current;x&&m((x.textContent??"").trim())},[o.children]),u.jsx(Al.ItemSlot,{scope:r,disabled:n,textValue:s??p,children:u.jsx(dO,{asChild:!0,...a,focusable:!n,children:u.jsx(Me.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:ue(e.onPointerMove,Ml(x=>{n?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,Ml(x=>i.onItemLeave(x))),onFocus:ue(e.onFocus,()=>f(!0)),onBlur:ue(e.onBlur,()=>f(!1))})})})}),fA="MenuCheckboxItem",eb=y.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return u.jsx(ob,{scope:e.__scopeMenu,checked:r,children:u.jsx(df,{role:"menuitemcheckbox","aria-checked":dd(r)?"mixed":r,...s,ref:t,"data-state":Fg(r),onSelect:ue(s.onSelect,()=>n==null?void 0:n(dd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});eb.displayName=fA;var tb="MenuRadioGroup",[hA,pA]=Qo(tb,{value:void 0,onValueChange:()=>{}}),rb=y.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Pt(n);return u.jsx(hA,{scope:e.__scopeMenu,value:r,onValueChange:o,children:u.jsx(Ig,{...s,ref:t})})});rb.displayName=tb;var nb="MenuRadioItem",sb=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=pA(nb,e.__scopeMenu),o=r===s.value;return u.jsx(ob,{scope:e.__scopeMenu,checked:o,children:u.jsx(df,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":Fg(o),onSelect:ue(n.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,r)},{checkForDefaultPrevented:!1})})})});sb.displayName=nb;var Lg="MenuItemIndicator",[ob,mA]=Qo(Lg,{checked:!1}),ib=y.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=mA(Lg,r);return u.jsx(Cr,{present:n||dd(o.checked)||o.checked===!0,children:u.jsx(Me.span,{...s,ref:t,"data-state":Fg(o.checked)})})});ib.displayName=Lg;var gA="MenuSeparator",ab=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return u.jsx(Me.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ab.displayName=gA;var vA="MenuArrow",lb=y.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=uf(r);return u.jsx(jg,{...s,...n,ref:t})});lb.displayName=vA;var yA="MenuSub",[nU,cb]=Qo(yA),Ba="MenuSubTrigger",ub=y.forwardRef((e,t)=>{const r=Jo(Ba,e.__scopeMenu),n=uc(Ba,e.__scopeMenu),s=cb(Ba,e.__scopeMenu),o=Ag(Ba,e.__scopeMenu),i=y.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=y.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return y.useEffect(()=>d,[d]),y.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),u.jsx(Dg,{asChild:!0,...c,children:u.jsx(J1,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":hb(r.open),...e,ref:Jd(t,s.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,Ml(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ue(e.onPointerLeave,Ml(f=>{var m,x;d();const p=(m=r.content)==null?void 0:m.getBoundingClientRect();if(p){const v=(x=r.content)==null?void 0:x.dataset.side,w=v==="right",h=w?-5:5,g=p[w?"left":"right"],_=p[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+h,y:f.clientY},{x:g,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:g,y:p.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,f=>{var m;const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||JO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});ub.displayName=Ba;var db="MenuSubContent",fb=y.forwardRef((e,t)=>{const r=G1(Kr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=Jo(Kr,e.__scopeMenu),i=uc(Kr,e.__scopeMenu),a=cb(db,e.__scopeMenu),l=y.useRef(null),c=Xe(t,l);return u.jsx(Al.Provider,{scope:e.__scopeMenu,children:u.jsx(Cr,{present:n||o.open,children:u.jsx(Al.Slot,{scope:e.__scopeMenu,children:u.jsx(Mg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ue(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),p=eA[i.dir].includes(d.key);f&&p&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});fb.displayName=db;function hb(e){return e?"open":"closed"}function dd(e){return e==="indeterminate"}function Fg(e){return dd(e)?"indeterminate":e?"checked":"unchecked"}function xA(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function wA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function _A(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=wA(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function bA(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function SA(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return bA(r,t)}function Ml(e){return t=>t.pointerType==="mouse"?e(t):void 0}var kA=K1,CA=Dg,EA=q1,TA=X1,NA=Ig,RA=Q1,jA=df,PA=eb,DA=rb,OA=sb,AA=ib,MA=ab,IA=lb,LA=ub,FA=fb,zg="DropdownMenu",[zA,sU]=Xr(zg,[Y1]),vr=Y1(),[UA,pb]=zA(zg),mb=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=vr(t),c=y.useRef(null),[d=!1,f]=oo({prop:s,defaultProp:o,onChange:i});return u.jsx(UA,{scope:t,triggerId:On(),triggerRef:c,contentId:On(),open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(p=>!p),[f]),modal:a,children:u.jsx(kA,{...l,open:d,onOpenChange:f,dir:n,modal:a,children:r})})};mb.displayName=zg;var gb="DropdownMenuTrigger",vb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=pb(gb,r),i=vr(r);return u.jsx(CA,{asChild:!0,...i,children:u.jsx(Me.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Jd(t,o.triggerRef),onPointerDown:ue(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:ue(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});vb.displayName=gb;var VA="DropdownMenuPortal",yb=e=>{const{__scopeDropdownMenu:t,...r}=e,n=vr(t);return u.jsx(EA,{...n,...r})};yb.displayName=VA;var xb="DropdownMenuContent",wb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=pb(xb,r),o=vr(r),i=y.useRef(!1);return u.jsx(TA,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ue(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!s.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wb.displayName=xb;var WA="DropdownMenuGroup",$A=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(NA,{...s,...n,ref:t})});$A.displayName=WA;var BA="DropdownMenuLabel",_b=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(RA,{...s,...n,ref:t})});_b.displayName=BA;var HA="DropdownMenuItem",bb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(jA,{...s,...n,ref:t})});bb.displayName=HA;var YA="DropdownMenuCheckboxItem",Sb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(PA,{...s,...n,ref:t})});Sb.displayName=YA;var ZA="DropdownMenuRadioGroup",KA=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(DA,{...s,...n,ref:t})});KA.displayName=ZA;var GA="DropdownMenuRadioItem",kb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(OA,{...s,...n,ref:t})});kb.displayName=GA;var qA="DropdownMenuItemIndicator",Cb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(AA,{...s,...n,ref:t})});Cb.displayName=qA;var XA="DropdownMenuSeparator",Eb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(MA,{...s,...n,ref:t})});Eb.displayName=XA;var QA="DropdownMenuArrow",JA=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(IA,{...s,...n,ref:t})});JA.displayName=QA;var eM="DropdownMenuSubTrigger",Tb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(LA,{...s,...n,ref:t})});Tb.displayName=eM;var tM="DropdownMenuSubContent",Nb=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=vr(r);return u.jsx(FA,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Nb.displayName=tM;var rM=mb,nM=vb,sM=yb,Rb=wb,jb=_b,Pb=bb,Db=Sb,Ob=kb,Ab=Cb,Mb=Eb,Ib=Tb,Lb=Nb;const Fb=rM,zb=nM,oM=y.forwardRef(({className:e,inset:t,children:r,...n},s)=>u.jsxs(Ib,{ref:s,className:ve("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,u.jsx(Nj,{className:"ml-auto h-4 w-4"})]}));oM.displayName=Ib.displayName;const iM=y.forwardRef(({className:e,...t},r)=>u.jsx(Lb,{ref:r,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));iM.displayName=Lb.displayName;const Ug=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(sM,{children:u.jsx(Rb,{ref:n,sideOffset:t,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Ug.displayName=Rb.displayName;const Ui=y.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(Pb,{ref:n,className:ve("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Ui.displayName=Pb.displayName;const aM=y.forwardRef(({className:e,children:t,checked:r,...n},s)=>u.jsxs(Db,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Ab,{children:u.jsx(q_,{className:"h-4 w-4"})})}),t]}));aM.displayName=Db.displayName;const lM=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(Ob,{ref:n,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Ab,{children:u.jsx(Pj,{className:"h-2 w-2 fill-current"})})}),t]}));lM.displayName=Ob.displayName;const Ub=y.forwardRef(({className:e,inset:t,...r},n)=>u.jsx(jb,{ref:n,className:ve("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Ub.displayName=jb.displayName;const Vb=y.forwardRef(({className:e,...t},r)=>u.jsx(Mb,{ref:r,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));Vb.displayName=Mb.displayName;var Vg="Dialog",[Wb,$b]=Xr(Vg),[cM,xn]=Wb(Vg),Bb=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=y.useRef(null),l=y.useRef(null),[c=!1,d]=oo({prop:n,defaultProp:s,onChange:o});return u.jsx(cM,{scope:t,triggerRef:a,contentRef:l,contentId:On(),titleId:On(),descriptionId:On(),open:c,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};Bb.displayName=Vg;var Hb="DialogTrigger",Yb=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xn(Hb,r),o=Xe(t,s.triggerRef);return u.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Bg(s.open),...n,ref:o,onClick:ue(e.onClick,s.onOpenToggle)})});Yb.displayName=Hb;var Wg="DialogPortal",[uM,Zb]=Wb(Wg,{forceMount:void 0}),Kb=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=xn(Wg,t);return u.jsx(uM,{scope:t,forceMount:r,children:y.Children.map(n,i=>u.jsx(Cr,{present:r||o.open,children:u.jsx(lc,{asChild:!0,container:s,children:i})}))})};Kb.displayName=Wg;var fd="DialogOverlay",Gb=y.forwardRef((e,t)=>{const r=Zb(fd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=xn(fd,e.__scopeDialog);return o.modal?u.jsx(Cr,{present:n||o.open,children:u.jsx(dM,{...s,ref:t})}):null});Gb.displayName=fd;var dM=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xn(fd,r);return u.jsx(cf,{as:ms,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Me.div,{"data-state":Bg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Yo="DialogContent",qb=y.forwardRef((e,t)=>{const r=Zb(Yo,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=xn(Yo,e.__scopeDialog);return u.jsx(Cr,{present:n||o.open,children:o.modal?u.jsx(fM,{...s,ref:t}):u.jsx(hM,{...s,ref:t})})});qb.displayName=Yo;var fM=y.forwardRef((e,t)=>{const r=xn(Yo,e.__scopeDialog),n=y.useRef(null),s=Xe(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return Pg(o)},[]),u.jsx(Xb,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,o=>o.preventDefault())})}),hM=y.forwardRef((e,t)=>{const r=xn(Yo,e.__scopeDialog),n=y.useRef(!1),s=y.useRef(!1);return u.jsx(Xb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Xb=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=xn(Yo,r),l=y.useRef(null),c=Xe(t,l);return yg(),u.jsxs(u.Fragment,{children:[u.jsx(nf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(fa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bg(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(mM,{titleId:a.titleId}),u.jsx(vM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$g="DialogTitle",Qb=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xn($g,r);return u.jsx(Me.h2,{id:s.titleId,...n,ref:t})});Qb.displayName=$g;var Jb="DialogDescription",eS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xn(Jb,r);return u.jsx(Me.p,{id:s.descriptionId,...n,ref:t})});eS.displayName=Jb;var tS="DialogClose",rS=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xn(tS,r);return u.jsx(Me.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,()=>s.onOpenChange(!1))})});rS.displayName=tS;function Bg(e){return e?"open":"closed"}var nS="DialogTitleWarning",[pM,sS]=bP(nS,{contentName:Yo,titleName:$g,docsSlug:"dialog"}),mM=({titleId:e})=>{const t=sS(nS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},gM="DialogDescriptionWarning",vM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sS(gM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Hg=Bb,Yg=Yb,Zg=Gb,cc=Kb,uc=qb,dc=Qb,fc=eS,ff=rS;const oS=Hg,iS=Yg,yM=Zg,aS=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));aS.displayName=cc.displayName;const wM=sc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Gg=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>u.jsxs(yM,{children:[u.jsx(aS,{}),u.jsxs(uc,{ref:s,className:ve(wM({side:e}),t),...n,children:[r,u.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[u.jsx(pg,{className:"h-4 w-4 dark:text-stone-200"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Gg.displayName=uc.displayName;const lS=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",e),...t});lS.displayName="SheetHeader";const cS=y.forwardRef(({className:e,...t},r)=>u.jsx(dc,{ref:r,className:ve("text-lg font-semibold text-foreground",e),...t}));cS.displayName=dc.displayName;const xM=y.forwardRef(({className:e,...t},r)=>u.jsx(fc,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));xM.displayName=fc.displayName;class Mr extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Mr.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Mr||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const tu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _M(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||bM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}uS=typeof atob!="function"||kM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const Z0="pb_auth";class CM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!dS(this.token)}get isAdmin(){return Vi(this.token).type==="admin"}get isAuthRecord(){return Vi(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=Z0){const n=_M(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=Z0){var l,c;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Vi(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=Y0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(c=o==null?void 0:o.model)==null?void 0:c.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=Y0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class EM extends CM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class Jo{constructor(t){this.client=t}}class TM extends Jo{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class Kg extends Jo{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Mr({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Mr({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Tr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Ch(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class NM extends Kg{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Tr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Ch(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(c,d,f,p){Ch(c);const m=c.beforeSend,w=c.authStore.model,v=c.authStore.onChange((x,h)=>{(!x||(h==null?void 0:h.id)!=(w==null?void 0:w.id)||(h!=null&&h.collectionId||w!=null&&w.collectionId)&&(h==null?void 0:h.collectionId)!=(w==null?void 0:w.collectionId))&&Ch(c)});c._resetAutoRefresh=function(){v(),c.beforeSend=m,delete c._resetAutoRefresh},c.beforeSend=async(x,h)=>{var T;const g=c.authStore.token;if((T=h.query)!=null&&T.autoRefresh)return m?m(x,h):{url:x,sendOptions:h};let _=c.authStore.isValid;if(_&&dS(c.authStore.token,d))try{await f()}catch{_=!1}_||await p();const C=h.headers||{};for(let E in C)if(E.toLowerCase()=="authorization"&&g==C[E]&&c.authStore.token){C[E]=c.authStore.token;break}return h.headers=C,m?m(x,h):{url:x,sendOptions:h}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Tr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const RM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function fS(e){if(e){e.query=e.query||{};for(let t in e)RM.includes(t)||(e.query[t]=e[t],delete e[t])}}class hS extends Jo{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){fS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let c;try{c=JSON.parse(l==null?void 0:l.data)}catch{}r(c||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Mr(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class PM extends Kg{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Tr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Tr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(c=>this.authResponse(c))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=G0(void 0));const s=new hS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const c=l.authProviders.find(m=>m.name===r.provider);if(!c)throw new Mr(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(m,w)=>{var v;try{await s.subscribe("@oauth2",async _=>{var T;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const E=Object.assign({},r);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(T=f==null?void 0:f.signal)!=null&&T.onabort&&(f.signal.onabort=null);const P=await this.authWithOAuth2Code(c.name,_.code,c.codeVerifier,d,r.createData,E);m(P)}catch(E){w(new Mr(E))}o()});const x={state:s.clientId};(v=r.scopes)!=null&&v.length&&(x.scope=r.scopes.join(" "));const h=this._replaceQueryParams(c.authUrl+d,x);await(r.urlCallback||function(_){n?n.location.href=_:n=G0(_)})(h)}catch(x){o(),w(new Mr(x))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Tr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Tr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Vi(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Tr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Tr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Vi(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function G0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Mr(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class jM extends Kg{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class DM extends Jo{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Mr({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class OM extends Jo{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class AM extends Jo{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class MM extends Jo{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class IM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new EM,this.admins=new NM(this),this.collections=new jM(this),this.files=new AM(this),this.logs=new DM(this),this.settings=new TM(this),this.realtime=new hS(this),this.health=new OM(this),this.backups=new MM(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new PM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Mr({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Mr(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),fS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var LM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const FM=LM.VITE_API_DOMAIN;console.log(FM);let ru;const Dt=()=>ru||(ru=new IM("/"),ru);//! moment.js +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},gM="DialogDescriptionWarning",vM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sS(gM).contentName}}.`;return y.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Hg=Bb,Yg=Yb,Zg=Kb,dc=Gb,fc=qb,hc=Qb,pc=eS,ff=rS;const oS=Hg,iS=Yg,yM=Zg,aS=y.forwardRef(({className:e,...t},r)=>u.jsx(dc,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));aS.displayName=dc.displayName;const xM=ic("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kg=y.forwardRef(({side:e="right",className:t,children:r,...n},s)=>u.jsxs(yM,{children:[u.jsx(aS,{}),u.jsxs(fc,{ref:s,className:ve(xM({side:e}),t),...n,children:[r,u.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[u.jsx(pg,{className:"h-4 w-4 dark:text-stone-200"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kg.displayName=fc.displayName;const lS=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",e),...t});lS.displayName="SheetHeader";const cS=y.forwardRef(({className:e,...t},r)=>u.jsx(hc,{ref:r,className:ve("text-lg font-semibold text-foreground",e),...t}));cS.displayName=hc.displayName;const wM=y.forwardRef(({className:e,...t},r)=>u.jsx(pc,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));wM.displayName=pc.displayName;class Mr extends Error{constructor(t){var r,n,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Mr.prototype),t!==null&&typeof t=="object"&&(this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort,this.originalError=t.originalError,t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Mr||(this.originalError=t),typeof DOMException<"u"&&t instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(r=this.response)==null?void 0:r.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(o=(s=(n=this.originalError)==null?void 0:n.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const tu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _M(e,t){const r={};if(typeof e!="string")return r;const n=Object.assign({},{}).decode||bM;let s=0;for(;s0&&(!r.exp||r.exp-t>Date.now()/1e3))}uS=typeof atob!="function"||kM?e=>{let t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,o=0,i="";n=t.charAt(o++);~n&&(r=s%4?64*r+n:n,s++%4)?i+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return i}:atob;const Z0="pb_auth";class CM{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!dS(this.token)}get isAdmin(){return Vi(this.token).type==="admin"}get isAuthRecord(){return Vi(this.token).type==="authRecord"}save(t,r){this.baseToken=t||"",this.baseModel=r||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,r=Z0){const n=_M(t||"")[r]||"";let s={};try{s=JSON.parse(n),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(t,r=Z0){var l,c;const n={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Vi(this.token);n.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},n,t);const o={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let i=Y0(r,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.model&&a>4096){o.model={id:(l=o==null?void 0:o.model)==null?void 0:l.id,email:(c=o==null?void 0:o.model)==null?void 0:c.email};const d=["collectionId","username","verified"];for(const f in this.model)d.includes(f)&&(o.model[f]=this.model[f]);i=Y0(r,JSON.stringify(o),t)}return i}onChange(t,r=!1){return this._onChangeCallbacks.push(t),r&&t(this.token,this.model),()=>{for(let n=this._onChangeCallbacks.length-1;n>=0;n--)if(this._onChangeCallbacks[n]==t)return delete this._onChangeCallbacks[n],void this._onChangeCallbacks.splice(n,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.model)}}class EM extends CM{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(t,r){this._storageSet(this.storageKey,{token:t,model:r}),super.save(t,r)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const r=window.localStorage.getItem(t)||"";try{return JSON.parse(r)}catch{return r}}return this.storageFallback[t]}_storageSet(t,r){if(typeof window<"u"&&(window!=null&&window.localStorage)){let n=r;typeof r!="string"&&(n=JSON.stringify(r)),window.localStorage.setItem(t,n)}else this.storageFallback[t]=r}_storageRemove(t){var r;typeof window<"u"&&(window!=null&&window.localStorage)&&((r=window.localStorage)==null||r.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",t=>{if(t.key!=this.storageKey)return;const r=this._storageGet(this.storageKey)||{};super.save(r.token||"",r.model||null)})}}class ei{constructor(t){this.client=t}}class TM extends ei{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,r){return r=Object.assign({method:"PATCH",body:t},r),this.client.send("/api/settings",r)}async testS3(t="storage",r){return r=Object.assign({method:"POST",body:{filesystem:t}},r),this.client.send("/api/settings/test/s3",r).then(()=>!0)}async testEmail(t,r,n){return n=Object.assign({method:"POST",body:{email:t,template:r}},n),this.client.send("/api/settings/test/email",n).then(()=>!0)}async generateAppleClientSecret(t,r,n,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:r,keyId:n,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}class Gg extends ei{decode(t){return t}async getFullList(t,r){if(typeof t=="number")return this._getFullList(t,r);let n=500;return(r=Object.assign({},t,r)).batch&&(n=r.batch,delete r.batch),this._getFullList(n,r)}async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send(this.baseCrudPath,n).then(s=>{var o;return s.items=((o=s.items)==null?void 0:o.map(i=>this.decode(i)))||[],s})}async getFirstListItem(t,r){return(r=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},r)).query=Object.assign({filter:t,skipTotal:1},r.query),this.getList(1,1,r).then(n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))throw new Mr({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return n.items[0]})}async getOne(t,r){if(!t)throw new Mr({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(n=>this.decode(n))}async create(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send(this.baseCrudPath,r).then(n=>this.decode(n))}async update(t,r,n){return n=Object.assign({method:"PATCH",body:r},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),n).then(s=>this.decode(s))}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then(()=>!0)}_getFullList(t=500,r){(r=r||{}).query=Object.assign({skipTotal:1},r.query);let n=[],s=async o=>this.getList(o,t||500,r).then(i=>{const a=i.items;return n=n.concat(a),a.length==i.perPage?s(o+1):n});return s(1)}}function Tr(e,t,r,n){const s=n!==void 0;return s||r!==void 0?s?(console.warn(e),t.body=Object.assign({},t.body,r),t.query=Object.assign({},t.query,n),t):Object.assign(t,r):t}function Ch(e){var t;(t=e._resetAutoRefresh)==null||t.call(e)}class NM extends Gg{get baseCrudPath(){return"/api/admins"}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i;return((o=this.client.authStore.model)==null?void 0:o.id)===s.id&&((i=this.client.authStore.model)==null?void 0:i.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o;return n&&((s=this.client.authStore.model)==null?void 0:s.id)===t&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:r})}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};o=Tr("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",o,n,s);const i=o.autoRefreshThreshold;delete o.autoRefreshThreshold,o.autoRefresh||Ch(this.client);let a=await this.client.send(this.baseCrudPath+"/auth-with-password",o);return a=this.authResponse(a),i&&function(c,d,f,p){Ch(c);const m=c.beforeSend,x=c.authStore.model,v=c.authStore.onChange((w,h)=>{(!w||(h==null?void 0:h.id)!=(x==null?void 0:x.id)||(h!=null&&h.collectionId||x!=null&&x.collectionId)&&(h==null?void 0:h.collectionId)!=(x==null?void 0:x.collectionId))&&Ch(c)});c._resetAutoRefresh=function(){v(),c.beforeSend=m,delete c._resetAutoRefresh},c.beforeSend=async(w,h)=>{var T;const g=c.authStore.token;if((T=h.query)!=null&&T.autoRefresh)return m?m(w,h):{url:w,sendOptions:h};let _=c.authStore.isValid;if(_&&dS(c.authStore.token,d))try{await f()}catch{_=!1}_||await p();const C=h.headers||{};for(let E in C)if(E.toLowerCase()=="authorization"&&g==C[E]&&c.authStore.token){C[E]=c.authStore.token;break}return h.headers=C,m?m(w,h):{url:w,sendOptions:h}}}(this.client,i,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(t,r,Object.assign({autoRefresh:!0},o))),a}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCrudPath+"/auth-refresh",n).then(this.authResponse.bind(this))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Tr("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCrudPath+"/confirm-password-reset",i).then(()=>!0)}}const RM=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function fS(e){if(e){e.query=e.query||{};for(let t in e)RM.includes(t)||(e.query[t]=e[t],delete e[t])}}class hS extends ei{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,r,n){var i;if(!t)throw new Error("topic must be set.");let s=t;if(n){fS(n);const a="options="+encodeURIComponent(JSON.stringify({query:n.query,headers:n.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let c;try{c=JSON.parse(l==null?void 0:l.data)}catch{}r(c||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var n;let r=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(n=this.eventSource)==null||n.removeEventListener(o,i);delete this.subscriptions[o],r||(r=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var n;let r=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){r=!0;for(let o of this.subscriptions[s])(n=this.eventSource)==null||n.removeEventListener(s,o);delete this.subscriptions[s]}r&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,r){var o;let n=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===r&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,r));a&&(this.subscriptions[i].length||delete this.subscriptions[i],n||this.hasSubscriptionListeners(i)||(n=!0))}this.hasSubscriptionListeners()?n&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var r,n;if(this.subscriptions=this.subscriptions||{},t)return!!((r=this.subscriptions[t])!=null&&r.length);for(let s in this.subscriptions)if((n=this.subscriptions[s])!=null&&n.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(t=>{if(!(t!=null&&t.isAbort))throw t})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const r={};t=t.includes("?")?t:t+"?";for(let n in this.subscriptions)(n+"?").startsWith(t)&&(r[n]=this.subscriptions[n]);return r}getNonEmptySubscriptionKeys(){const t=[];for(let r in this.subscriptions)this.subscriptions[r].length&&t.push(r);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.addEventListener(t,r)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let r of this.subscriptions[t])this.eventSource.removeEventListener(t,r)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((t,r)=>{this.pendingConnects.push({resolve:t,reject:r}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",t=>{const r=t;this.clientId=r==null?void 0:r.lastEventId,this.submitSubscriptions().then(async()=>{let n=3;for(;this.hasUnsentSubscriptions()&&n>0;)n--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in n)for(let o of n[s])o(t)}).catch(n=>{this.clientId="",this.connectErrorHandler(n)})})}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const r of t)if(!this.lastSentSubscriptions.includes(r))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let n of this.pendingConnects)n.reject(new Mr(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const r=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},r)}disconnect(t=!1){var r;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(r=this.eventSource)==null||r.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let n of this.pendingConnects)n.resolve();this.pendingConnects=[]}}}class jM extends Gg{constructor(t,r){super(t),this.collectionIdOrName=r}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(t,r,n){if(!t)throw new Error("Missing topic.");if(!r)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,r,n)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,r){if(typeof t=="number")return super.getFullList(t,r);const n=Object.assign({},t,r);return super.getFullList(n)}async getList(t=1,r=30,n){return super.getList(t,r,n)}async getFirstListItem(t,r){return super.getFirstListItem(t,r)}async getOne(t,r){return super.getOne(t,r)}async create(t,r){return super.create(t,r)}async update(t,r,n){return super.update(t,r,n).then(s=>{var o,i,a;return((o=this.client.authStore.model)==null?void 0:o.id)!==(s==null?void 0:s.id)||((i=this.client.authStore.model)==null?void 0:i.collectionId)!==this.collectionIdOrName&&((a=this.client.authStore.model)==null?void 0:a.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}async delete(t,r){return super.delete(t,r).then(n=>{var s,o,i;return!n||((s=this.client.authStore.model)==null?void 0:s.id)!==t||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.model)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),n})}authResponse(t){const r=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,r),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:r})}async listAuthMethods(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t).then(r=>Object.assign({},r,{usernamePassword:!!(r!=null&&r.usernamePassword),emailPassword:!!(r!=null&&r.emailPassword),authProviders:Array.isArray(r==null?void 0:r.authProviders)?r==null?void 0:r.authProviders:[]}))}async authWithPassword(t,r,n,s){let o={method:"POST",body:{identity:t,password:r}};return o=Tr("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/auth-with-password",o).then(i=>this.authResponse(i))}async authWithOAuth2Code(t,r,n,s,o,i,a){let l={method:"POST",body:{provider:t,code:r,codeVerifier:n,redirectUrl:s,createData:o}};return l=Tr("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then(c=>this.authResponse(c))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const r=(t==null?void 0:t[0])||{};let n=null;r.urlCallback||(n=K0(void 0));const s=new hS(this.client);function o(){n==null||n.close(),s.unsubscribe()}const i={},a=r.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then(l=>{var p;const c=l.authProviders.find(m=>m.name===r.provider);if(!c)throw new Mr(new Error(`Missing or invalid provider "${r.provider}".`));const d=this.client.buildUrl("/api/oauth2-redirect"),f=a?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;return f&&(f.signal.onabort=()=>{o()}),new Promise(async(m,x)=>{var v;try{await s.subscribe("@oauth2",async _=>{var T;const C=s.clientId;try{if(!_.state||C!==_.state)throw new Error("State parameters don't match.");if(_.error||!_.code)throw new Error("OAuth2 redirect error or missing code: "+_.error);const E=Object.assign({},r);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(T=f==null?void 0:f.signal)!=null&&T.onabort&&(f.signal.onabort=null);const j=await this.authWithOAuth2Code(c.name,_.code,c.codeVerifier,d,r.createData,E);m(j)}catch(E){x(new Mr(E))}o()});const w={state:s.clientId};(v=r.scopes)!=null&&v.length&&(w.scope=r.scopes.join(" "));const h=this._replaceQueryParams(c.authUrl+d,w);await(r.urlCallback||function(_){n?n.location.href=_:n=K0(_)})(h)}catch(w){o(),x(new Mr(w))}})}).catch(l=>{throw o(),l})}async authRefresh(t,r){let n={method:"POST"};return n=Tr("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",n,t,r),this.client.send(this.baseCollectionPath+"/auth-refresh",n).then(s=>this.authResponse(s))}async requestPasswordReset(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(t,r,n,s,o){let i={method:"POST",body:{token:t,password:r,passwordConfirm:n}};return i=Tr("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then(()=>!0)}async requestVerification(t,r,n){let s={method:"POST",body:{email:t}};return s=Tr("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(t,r,n){let s={method:"POST",body:{token:t}};return s=Tr("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const o=Vi(t),i=this.client.authStore.model;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0})}async requestEmailChange(t,r,n){let s={method:"POST",body:{newEmail:t}};return s=Tr("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,r,n),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(t,r,n,s){let o={method:"POST",body:{token:t,password:r}};return o=Tr("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,n,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then(()=>{const i=Vi(t),a=this.client.authStore.model;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(t,r){return r=Object.assign({method:"GET"},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",r)}async unlinkExternalAuth(t,r,n){return n=Object.assign({method:"DELETE"},n),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(r),n).then(()=>!0)}_replaceQueryParams(t,r={}){let n=t,s="";t.indexOf("?")>=0&&(n=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in r)r.hasOwnProperty(a)&&(r[a]==null?delete o[a]:o[a]=r[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?n+"?"+s:n}}function K0(e){if(typeof window>"u"||!(window!=null&&window.open))throw new Mr(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,r=768,n=window.innerWidth,s=window.innerHeight;t=t>n?n:t,r=r>s?s:r;let o=n/2-t/2,i=s/2-r/2;return window.open(e,"popup_window","width="+t+",height="+r+",top="+i+",left="+o+",resizable,menubar=no")}class PM extends Gg{get baseCrudPath(){return"/api/collections"}async import(t,r=!1,n){return n=Object.assign({method:"PUT",body:{collections:t,deleteMissing:r}},n),this.client.send(this.baseCrudPath+"/import",n).then(()=>!0)}}class DM extends ei{async getList(t=1,r=30,n){return(n=Object.assign({method:"GET"},n)).query=Object.assign({page:t,perPage:r},n.query),this.client.send("/api/logs",n)}async getOne(t,r){if(!t)throw new Mr({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return r=Object.assign({method:"GET"},r),this.client.send("/api/logs/"+encodeURIComponent(t),r)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class OM extends ei{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class AM extends ei{getUrl(t,r,n={}){if(!r||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(r));let o=this.client.buildUrl(s.join("/"));if(Object.keys(n).length){n.download===!1&&delete n.download;const i=new URLSearchParams(n);o+=(o.includes("?")?"&":"?")+i}return o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then(r=>(r==null?void 0:r.token)||"")}}class MM extends ei{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,r){return r=Object.assign({method:"POST",body:{name:t}},r),this.client.send("/api/backups",r).then(()=>!0)}async upload(t,r){return r=Object.assign({method:"POST",body:t},r),this.client.send("/api/backups/upload",r).then(()=>!0)}async delete(t,r){return r=Object.assign({method:"DELETE"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}`,r).then(()=>!0)}async restore(t,r){return r=Object.assign({method:"POST"},r),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,r).then(()=>!0)}getDownloadUrl(t,r){return this.client.buildUrl(`/api/backups/${encodeURIComponent(r)}?token=${encodeURIComponent(t)}`)}}class IM{constructor(t="/",r,n="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=t,this.lang=n,this.authStore=r||new EM,this.admins=new NM(this),this.collections=new PM(this),this.files=new AM(this),this.logs=new DM(this),this.settings=new TM(this),this.realtime=new hS(this),this.health=new OM(this),this.backups=new MM(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new jM(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,r){if(!r)return t;for(let n in r){let s=r[n];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+n+"}",s)}return t}getFileUrl(t,r,n={}){return this.files.getUrl(t,r,n)}buildUrl(t){var n;let r=this.baseUrl;return typeof window>"u"||!window.location||r.startsWith("https://")||r.startsWith("http://")||(r=(n=window.location.origin)!=null&&n.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(r+=window.location.pathname||"/",r+=r.endsWith("/")?"":"/"),r+=this.baseUrl),t&&(r+=r.endsWith("/")?"":"/",r+=t.startsWith("/")?t.substring(1):t),r}async send(t,r){r=this.initSendOptions(t,r);let n=this.buildUrl(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(n,r));s.url!==void 0||s.options!==void 0?(n=s.url||n,r=s.options||r):Object.keys(s).length&&(r=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(r.query!==void 0){const s=this.serializeQueryParams(r.query);s&&(n+=(n.includes("?")?"&":"?")+s),delete r.query}return this.getHeader(r.headers,"Content-Type")=="application/json"&&r.body&&typeof r.body!="string"&&(r.body=JSON.stringify(r.body)),(r.fetch||fetch)(n,r).then(async s=>{let o={};try{o=await s.json()}catch{}if(this.afterSend&&(o=await this.afterSend(s,o)),s.status>=400)throw new Mr({url:s.url,status:s.status,data:o});return o}).catch(s=>{throw new Mr(s)})}initSendOptions(t,r){if((r=Object.assign({method:"GET"},r)).body=this.convertToFormDataIfNeeded(r.body),fS(r),r.query=Object.assign({},r.params,r.query),r.requestKey===void 0&&(r.$autoCancel===!1||r.query.$autoCancel===!1?r.requestKey=null:(r.$cancelKey||r.query.$cancelKey)&&(r.requestKey=r.$cancelKey||r.query.$cancelKey)),delete r.$autoCancel,delete r.query.$autoCancel,delete r.$cancelKey,delete r.query.$cancelKey,this.getHeader(r.headers,"Content-Type")!==null||this.isFormData(r.body)||(r.headers=Object.assign({},r.headers,{"Content-Type":"application/json"})),this.getHeader(r.headers,"Accept-Language")===null&&(r.headers=Object.assign({},r.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(r.headers,"Authorization")===null&&(r.headers=Object.assign({},r.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&r.requestKey!==null){const n=r.requestKey||(r.method||"GET")+t;delete r.requestKey,this.cancelRequest(n);const s=new AbortController;this.cancelControllers[n]=s,r.signal=s.signal}return r}convertToFormDataIfNeeded(t){if(typeof FormData>"u"||t===void 0||typeof t!="object"||t===null||this.isFormData(t)||!this.hasBlobField(t))return t;const r=new FormData;for(const n in t){const s=t[n];if(typeof s!="object"||this.hasBlobField({data:s})){const o=Array.isArray(s)?s:[s];for(let i of o)r.append(n,i)}else{let o={};o[n]=s,r.append("@jsonPayload",JSON.stringify(o))}}return r}hasBlobField(t){for(const r in t){const n=Array.isArray(t[r])?t[r]:[t[r]];for(const s of n)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(t,r){t=t||{},r=r.toLowerCase();for(let n in t)if(n.toLowerCase()==r)return t[n];return null}isFormData(t){return t&&(t.constructor.name==="FormData"||typeof FormData<"u"&&t instanceof FormData)}serializeQueryParams(t){const r=[];for(const n in t){if(t[n]===null)continue;const s=t[n],o=encodeURIComponent(n);if(Array.isArray(s))for(const i of s)r.push(o+"="+encodeURIComponent(i));else s instanceof Date?r.push(o+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?r.push(o+"="+encodeURIComponent(JSON.stringify(s))):r.push(o+"="+encodeURIComponent(s))}return r.join("&")}}var LM={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const FM=LM.VITE_API_DOMAIN;console.log(FM);let ru;const Dt=()=>ru||(ru=new IM("/"),ru);//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com -var pS;function me(){return pS.apply(null,arguments)}function zM(e){pS=e}function gn(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ao(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function at(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qg(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(at(e,t))return!1;return!0}function yr(e){return e===void 0}function ys(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function hc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function mS(e,t){var r=[],n,s=e.length;for(n=0;n>>0,n;for(n=0;n0)for(r=0;r>>0,n;for(n=0;n0)for(r=0;r=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var ev=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,nu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Th={},Wi={};function Ne(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Wi[e]=s),t&&(Wi[t[0]]=function(){return In(s.apply(this,arguments),t[1],t[2])}),r&&(Wi[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function BM(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function HM(e){var t=e.match(ev),r,n;for(r=0,n=t.length;r=0&&nu.test(e);)e=e.replace(nu,n),nu.lastIndex=0,r-=1;return e}var YM={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ZM(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(ev).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var GM="Invalid date";function KM(){return this._invalidDate}var qM="%d",XM=/\d{1,2}/;function QM(e){return this._ordinal.replace("%d",e)}var JM={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function eI(e,t,r,n){var s=this._relativeTime[r];return Wn(s)?s(e,t,r,n):s.replace(/%d/i,e)}function tI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Wn(r)?r(t):r.replace(/%s/i,t)}var X0={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(e){return typeof e=="string"?X0[e]||X0[e.toLowerCase()]:void 0}function tv(e){var t={},r,n;for(n in e)at(e,n)&&(r=Jr(n),r&&(t[r]=e[n]));return t}var rI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function nI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:rI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var wS=/\d/,Ur=/\d\d/,xS=/\d{3}/,rv=/\d{4}/,pf=/[+-]?\d{6}/,St=/\d\d?/,_S=/\d\d\d\d?/,bS=/\d\d\d\d\d\d?/,mf=/\d{1,3}/,nv=/\d{1,4}/,gf=/[+-]?\d{1,6}/,ga=/\d+/,vf=/[+-]?\d+/,sI=/Z|[+-]\d\d:?\d\d/gi,yf=/Z|[+-]\d\d(?::?\d\d)?/gi,oI=/[+-]?\d+(\.\d{1,3})?/,mc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,va=/^[1-9]\d?/,sv=/^([1-9]\d|\d)/,hd;hd={};function xe(e,t,r){hd[e]=Wn(t)?t:function(n,s){return n&&r?r:t}}function iI(e,t){return at(hd,e)?hd[e](t._strict,t._locale):new RegExp(aI(e))}function aI(e){return cs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function cs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Hr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function tt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Hr(t)),r}var Hp={};function pt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),ys(t)&&(n=function(o,i){i[t]=tt(o)}),s=e.length,r=0;r68?1900:2e3)};var SS=ya("FullYear",!0);function dI(){return wf(this.year())}function ya(e,t){return function(r){return r!=null?(kS(this,e,r),me.updateOffset(this,t),this):Al(this,e)}}function Al(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function kS(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!wf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function fI(e){return e=Jr(e),Wn(this[e])?this[e]():this}function hI(e,t){if(typeof e=="object"){e=tv(e);var r=nI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function Ml(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function pd(e,t,r){var n=7+t-r,s=(7+Ml(e,0,n).getUTCDay()-t)%7;return-s+n-1}function PS(e,t,r,n,s){var o=(7+r-n)%7,i=pd(e,n,s),a=1+7*(t-1)+o+i,l,c;return a<=0?(l=e-1,c=tl(l)+a):a>tl(e)?(l=e+1,c=a-tl(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Il(e,t,r){var n=pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+us(i,t,r)):s>us(e.year(),t,r)?(o=s-us(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function us(e,t,r){var n=pd(e,t,r),s=pd(e+1,t,r);return(tl(e)-n+s)/7}Ne("w",["ww",2],"wo","week");Ne("W",["WW",2],"Wo","isoWeek");xe("w",St,va);xe("ww",St,Ur);xe("W",St,va);xe("WW",St,Ur);gc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=tt(e)});function EI(e){return Il(e,this._week.dow,this._week.doy).week}var TI={dow:0,doy:6};function NI(){return this._week.dow}function RI(){return this._week.doy}function PI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function jI(e){var t=Il(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Ne("d",0,"do","day");Ne("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Ne("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Ne("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Ne("e",0,0,"weekday");Ne("E",0,0,"isoWeekday");xe("d",St);xe("e",St);xe("E",St);xe("dd",function(e,t){return t.weekdaysMinRegex(e)});xe("ddd",function(e,t){return t.weekdaysShortRegex(e)});xe("dddd",function(e,t){return t.weekdaysRegex(e)});gc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:$e(r).invalidWeekday=e});gc(["d","e","E"],function(e,t,r,n){t[n]=tt(e)});function DI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function OI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function iv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var AI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),MI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),II=mc,LI=mc,FI=mc;function zI(e,t){var r=gn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?iv(r,this._week.dow):e?r[e.day()]:r}function UI(e){return e===!0?iv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function VI(e){return e===!0?iv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function WI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Vn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1||(s=Ft.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=Ft.call(this._minWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function $I(e,t,r){var n,s,o;if(this._weekdaysParseExact)return WI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Vn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function BI(e){if(!this.isValid())return e!=null?this:NaN;var t=Al(this,"Day");return e!=null?(e=DI(e,this.localeData()),this.add(e-t,"d")):t}function HI(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function YI(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=OI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ZI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=II),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function GI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=LI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function KI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=FI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function av(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,a,l,c;for(o=0;o<7;o++)i=Vn([2e3,1]).day(o),a=cs(this.weekdaysMin(i,"")),l=cs(this.weekdaysShort(i,"")),c=cs(this.weekdays(i,"")),t.push(a),r.push(l),n.push(c),s.push(a),s.push(l),s.push(c);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function lv(){return this.hours()%12||12}function qI(){return this.hours()||24}Ne("H",["HH",2],0,"hour");Ne("h",["hh",2],0,lv);Ne("k",["kk",2],0,qI);Ne("hmm",0,0,function(){return""+lv.apply(this)+In(this.minutes(),2)});Ne("hmmss",0,0,function(){return""+lv.apply(this)+In(this.minutes(),2)+In(this.seconds(),2)});Ne("Hmm",0,0,function(){return""+this.hours()+In(this.minutes(),2)});Ne("Hmmss",0,0,function(){return""+this.hours()+In(this.minutes(),2)+In(this.seconds(),2)});function DS(e,t){Ne(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}DS("a",!0);DS("A",!1);function OS(e,t){return t._meridiemParse}xe("a",OS);xe("A",OS);xe("H",St,sv);xe("h",St,va);xe("k",St,va);xe("HH",St,Ur);xe("hh",St,Ur);xe("kk",St,Ur);xe("hmm",_S);xe("hmmss",bS);xe("Hmm",_S);xe("Hmmss",bS);pt(["H","HH"],Gt);pt(["k","kk"],function(e,t,r){var n=tt(e);t[Gt]=n===24?0:n});pt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});pt(["h","hh"],function(e,t,r){t[Gt]=tt(e),$e(r).bigHour=!0});pt("hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n)),$e(r).bigHour=!0});pt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n,2)),t[is]=tt(e.substr(s)),$e(r).bigHour=!0});pt("Hmm",function(e,t,r){var n=e.length-2;t[Gt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n))});pt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Gt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n,2)),t[is]=tt(e.substr(s))});function XI(e){return(e+"").toLowerCase().charAt(0)==="p"}var QI=/[ap]\.?m?\.?/i,JI=ya("Hours",!0);function eL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var AS={calendar:WM,longDateFormat:YM,invalidDate:GM,ordinal:qM,dayOfMonthOrdinalParse:XM,relativeTime:JM,months:mI,monthsShort:CS,week:TI,weekdays:AI,weekdaysMin:MI,weekdaysShort:jS,meridiemParse:QI},Et={},Aa={},Ll;function tL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=xf(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&tL(o,n)>=r-1)break;r--}t++}return Ll}function nL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function xf(e){var t=null,r;if(Et[e]===void 0&&typeof Ou<"u"&&Ou&&Ou.exports&&nL(e))try{t=Ll._abbr,r=require,r("./locale/"+e),Js(t)}catch{Et[e]=null}return Et[e]}function Js(e,t){var r;return e&&(yr(t)?r=Cs(e):r=cv(e,t),r?Ll=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ll._abbr}function cv(e,t){if(t!==null){var r,n=AS;if(t.abbr=e,Et[e]!=null)vS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Et[e]._config;else if(t.parentLocale!=null)if(Et[t.parentLocale]!=null)n=Et[t.parentLocale]._config;else if(r=xf(t.parentLocale),r!=null)n=r._config;else return Aa[t.parentLocale]||(Aa[t.parentLocale]=[]),Aa[t.parentLocale].push({name:e,config:t}),null;return Et[e]=new Jg($p(n,t)),Aa[e]&&Aa[e].forEach(function(s){cv(s.name,s.config)}),Js(e),Et[e]}else return delete Et[e],null}function sL(e,t){if(t!=null){var r,n,s=AS;Et[e]!=null&&Et[e].parentLocale!=null?Et[e].set($p(Et[e]._config,t)):(n=xf(e),n!=null&&(s=n._config),t=$p(s,t),n==null&&(t.abbr=e),r=new Jg(t),r.parentLocale=Et[e],Et[e]=r),Js(e)}else Et[e]!=null&&(Et[e].parentLocale!=null?(Et[e]=Et[e].parentLocale,e===Js()&&Js(e)):Et[e]!=null&&delete Et[e]);return Et[e]}function Cs(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ll;if(!gn(e)){if(t=xf(e),t)return t;e=[e]}return rL(e)}function oL(){return Bp(Et)}function uv(e){var t,r=e._a;return r&&$e(e).overflow===-2&&(t=r[os]<0||r[os]>11?os:r[Tn]<1||r[Tn]>ov(r[ar],r[os])?Tn:r[Gt]<0||r[Gt]>24||r[Gt]===24&&(r[ln]!==0||r[is]!==0||r[Po]!==0)?Gt:r[ln]<0||r[ln]>59?ln:r[is]<0||r[is]>59?is:r[Po]<0||r[Po]>999?Po:-1,$e(e)._overflowDayOfYear&&(tTn)&&(t=Tn),$e(e)._overflowWeeks&&t===-1&&(t=cI),$e(e)._overflowWeekday&&t===-1&&(t=uI),$e(e).overflow=t),e}var iL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,aL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,lL=/Z|[+-]\d\d(?::?\d\d)?/,su=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Nh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],cL=/^\/?Date\((-?\d+)/i,uL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,dL={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function MS(e){var t,r,n=e._i,s=iL.exec(n)||aL.exec(n),o,i,a,l,c=su.length,d=Nh.length;if(s){for($e(e).iso=!0,t=0,r=c;ttl(i)||e._dayOfYear===0)&&($e(e)._overflowDayOfYear=!0),r=Ml(i,0,e._dayOfYear),e._a[os]=r.getUTCMonth(),e._a[Tn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Gt]===24&&e._a[ln]===0&&e._a[is]===0&&e._a[Po]===0&&(e._nextDay=!0,e._a[Gt]=0),e._d=(e._useUTC?Ml:CI).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Gt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&($e(e).weekdayMismatch=!0)}}function wL(e){var t,r,n,s,o,i,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=pi(t.GG,e._a[ar],Il(bt(),1,4).year),n=pi(t.W,1),s=pi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Il(bt(),o,i),r=pi(t.gg,e._a[ar],c.year),n=pi(t.w,c.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>us(r,o,i)?$e(e)._overflowWeeks=!0:l!=null?$e(e)._overflowWeekday=!0:(a=PS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}me.ISO_8601=function(){};me.RFC_2822=function(){};function fv(e){if(e._f===me.ISO_8601){MS(e);return}if(e._f===me.RFC_2822){IS(e);return}e._a=[],$e(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,c,d;for(s=yS(e._f,e._locale).match(ev)||[],d=s.length,r=0;r0&&$e(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Wi[o]?(n?$e(e).empty=!1:$e(e).unusedTokens.push(o),lI(o,n,e)):e._strict&&!n&&$e(e).unusedTokens.push(o);$e(e).charsLeftOver=a-l,t.length>0&&$e(e).unusedInput.push(t),e._a[Gt]<=12&&$e(e).bigHour===!0&&e._a[Gt]>0&&($e(e).bigHour=void 0),$e(e).parsedDateParts=e._a.slice(0),$e(e).meridiem=e._meridiem,e._a[Gt]=xL(e._locale,e._a[Gt],e._meridiem),c=$e(e).era,c!==null&&(e._a[ar]=e._locale.erasConvertYear(c,e._a[ar])),dv(e),uv(e)}function xL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function _L(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){$e(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:hf()});function zS(e,t){var r,n;if(t.length===1&&gn(t[0])&&(t=t[0]),!t.length)return bt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function WL(){if(!yr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Qg(e,this),e=LS(e),e._a?(t=e._isUTC?Vn(e._a):bt(e._a),this._isDSTShifted=this.isValid()&&OL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function $L(){return this.isValid()?!this._isUTC:!1}function BL(){return this.isValid()?this._isUTC:!1}function VS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var HL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,YL=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xn(e,t){var r=e,n=null,s,o,i;return Cu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:ys(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=HL.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:tt(n[Tn])*s,h:tt(n[Gt])*s,m:tt(n[ln])*s,s:tt(n[is])*s,ms:tt(Yp(n[Po]*1e3))*s}):(n=YL.exec(e))?(s=n[1]==="-"?-1:1,r={y:xo(n[2],s),M:xo(n[3],s),w:xo(n[4],s),d:xo(n[5],s),h:xo(n[6],s),m:xo(n[7],s),s:xo(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=ZL(bt(r.from),bt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new _f(r),Cu(e)&&at(e,"_locale")&&(o._locale=e._locale),Cu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}xn.fn=_f.prototype;xn.invalid=DL;function xo(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function J0(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function ZL(e,t){var r;return e.isValid()&&t.isValid()?(t=pv(t,e),e.isBefore(t)?r=J0(e,t):(r=J0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function WS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(vS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=xn(r,n),$S(this,s,e),this}}function $S(e,t,r,n){var s=t._milliseconds,o=Yp(t._days),i=Yp(t._months);e.isValid()&&(n=n??!0,i&&TS(e,Al(e,"Month")+i*r),o&&kS(e,"Date",Al(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&me.updateOffset(e,o||i))}var GL=WS(1,"add"),KL=WS(-1,"subtract");function BS(e){return typeof e=="string"||e instanceof String}function qL(e){return vn(e)||hc(e)||BS(e)||ys(e)||QL(e)||XL(e)||e===null||e===void 0}function XL(e){var t=Ao(e)&&!qg(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?ku(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Wn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ku(r,"Z")):ku(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function fF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function hF(e){e||(e=this.isUtc()?me.defaultFormatUtc:me.defaultFormat);var t=ku(this,e);return this.localeData().postformat(t)}function pF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||bt(e).isValid())?xn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function mF(e){return this.from(bt(),e)}function gF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||bt(e).isValid())?xn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function vF(e){return this.to(bt(),e)}function HS(e){var t;return e===void 0?this._locale._abbr:(t=Cs(e),t!=null&&(this._locale=t),this)}var YS=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ZS(){return this._locale}var md=1e3,$i=60*md,gd=60*$i,GS=(365*400+97)*24*gd;function Bi(e,t){return(e%t+t)%t}function KS(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-GS:new Date(e,t,r).valueOf()}function qS(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-GS:Date.UTC(e,t,r)}function yF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?qS:KS,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd);break;case"minute":t=this._d.valueOf(),t-=Bi(t,$i);break;case"second":t=this._d.valueOf(),t-=Bi(t,md);break}return this._d.setTime(t),me.updateOffset(this,!0),this}function wF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?qS:KS,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=gd-Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd)-1;break;case"minute":t=this._d.valueOf(),t+=$i-Bi(t,$i)-1;break;case"second":t=this._d.valueOf(),t+=md-Bi(t,md)-1;break}return this._d.setTime(t),me.updateOffset(this,!0),this}function xF(){return this._d.valueOf()-(this._offset||0)*6e4}function _F(){return Math.floor(this.valueOf()/1e3)}function bF(){return new Date(this.valueOf())}function SF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function kF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function CF(){return this.isValid()?this.toISOString():null}function EF(){return Xg(this)}function TF(){return Ws({},$e(this))}function NF(){return $e(this).overflow}function RF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ne("N",0,0,"eraAbbr");Ne("NN",0,0,"eraAbbr");Ne("NNN",0,0,"eraAbbr");Ne("NNNN",0,0,"eraName");Ne("NNNNN",0,0,"eraNarrow");Ne("y",["y",1],"yo","eraYear");Ne("y",["yy",2],0,"eraYear");Ne("y",["yyy",3],0,"eraYear");Ne("y",["yyyy",4],0,"eraYear");xe("N",mv);xe("NN",mv);xe("NNN",mv);xe("NNNN",UF);xe("NNNNN",VF);pt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?$e(r).era=s:$e(r).invalidEra=e});xe("y",ga);xe("yy",ga);xe("yyy",ga);xe("yyyy",ga);xe("yo",WF);pt(["y","yy","yyy","yyyy"],ar);pt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function PF(e,t){var r,n,s,o=this._eras||Cs("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function DF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?me(e.since).year():me(e.since).year()+(t-e.offset)*r}function OF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),KF.call(this,e,t,r,n,s))}function KF(e,t,r,n,s){var o=PS(e,t,r,n,s),i=Ml(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Ne("Q",0,"Qo","quarter");xe("Q",wS);pt("Q",function(e,t){t[os]=(tt(e)-1)*3});function qF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Ne("D",["DD",2],"Do","date");xe("D",St,va);xe("DD",St,Ur);xe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});pt(["D","DD"],Tn);pt("Do",function(e,t){t[Tn]=tt(e.match(St)[0])});var QS=ya("Date",!0);Ne("DDD",["DDDD",3],"DDDo","dayOfYear");xe("DDD",mf);xe("DDDD",xS);pt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=tt(e)});function XF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Ne("m",["mm",2],0,"minute");xe("m",St,sv);xe("mm",St,Ur);pt(["m","mm"],ln);var QF=ya("Minutes",!1);Ne("s",["ss",2],0,"second");xe("s",St,sv);xe("ss",St,Ur);pt(["s","ss"],is);var JF=ya("Seconds",!1);Ne("S",0,0,function(){return~~(this.millisecond()/100)});Ne(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ne(0,["SSS",3],0,"millisecond");Ne(0,["SSSS",4],0,function(){return this.millisecond()*10});Ne(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ne(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ne(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ne(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ne(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});xe("S",mf,wS);xe("SS",mf,Ur);xe("SSS",mf,xS);var $s,JS;for($s="SSSS";$s.length<=9;$s+="S")xe($s,ga);function e4(e,t){t[Po]=tt(("0."+e)*1e3)}for($s="S";$s.length<=9;$s+="S")pt($s,e4);JS=ya("Milliseconds",!1);Ne("z",0,0,"zoneAbbr");Ne("zz",0,0,"zoneName");function t4(){return this._isUTC?"UTC":""}function r4(){return this._isUTC?"Coordinated Universal Time":""}var ae=pc.prototype;ae.add=GL;ae.calendar=tF;ae.clone=rF;ae.diff=cF;ae.endOf=wF;ae.format=hF;ae.from=pF;ae.fromNow=mF;ae.to=gF;ae.toNow=vF;ae.get=fI;ae.invalidAt=NF;ae.isAfter=nF;ae.isBefore=sF;ae.isBetween=oF;ae.isSame=iF;ae.isSameOrAfter=aF;ae.isSameOrBefore=lF;ae.isValid=EF;ae.lang=YS;ae.locale=HS;ae.localeData=ZS;ae.max=EL;ae.min=CL;ae.parsingFlags=TF;ae.set=hI;ae.startOf=yF;ae.subtract=KL;ae.toArray=SF;ae.toObject=kF;ae.toDate=bF;ae.toISOString=dF;ae.inspect=fF;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=CF;ae.toString=uF;ae.unix=_F;ae.valueOf=xF;ae.creationData=RF;ae.eraName=OF;ae.eraNarrow=AF;ae.eraAbbr=MF;ae.eraYear=IF;ae.year=SS;ae.isLeapYear=dI;ae.weekYear=$F;ae.isoWeekYear=BF;ae.quarter=ae.quarters=qF;ae.month=NS;ae.daysInMonth=bI;ae.week=ae.weeks=PI;ae.isoWeek=ae.isoWeeks=jI;ae.weeksInYear=ZF;ae.weeksInWeekYear=GF;ae.isoWeeksInYear=HF;ae.isoWeeksInISOWeekYear=YF;ae.date=QS;ae.day=ae.days=BI;ae.weekday=HI;ae.isoWeekday=YI;ae.dayOfYear=XF;ae.hour=ae.hours=JI;ae.minute=ae.minutes=QF;ae.second=ae.seconds=JF;ae.millisecond=ae.milliseconds=JS;ae.utcOffset=ML;ae.utc=LL;ae.local=FL;ae.parseZone=zL;ae.hasAlignedHourOffset=UL;ae.isDST=VL;ae.isLocal=$L;ae.isUtcOffset=BL;ae.isUtc=VS;ae.isUTC=VS;ae.zoneAbbr=t4;ae.zoneName=r4;ae.dates=Qr("dates accessor is deprecated. Use date instead.",QS);ae.months=Qr("months accessor is deprecated. Use month instead",NS);ae.years=Qr("years accessor is deprecated. Use year instead",SS);ae.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",IL);ae.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",WL);function n4(e){return bt(e*1e3)}function s4(){return bt.apply(null,arguments).parseZone()}function ek(e){return e}var lt=Jg.prototype;lt.calendar=$M;lt.longDateFormat=ZM;lt.invalidDate=KM;lt.ordinal=QM;lt.preparse=ek;lt.postformat=ek;lt.relativeTime=eI;lt.pastFuture=tI;lt.set=VM;lt.eras=PF;lt.erasParse=jF;lt.erasConvertYear=DF;lt.erasAbbrRegex=FF;lt.erasNameRegex=LF;lt.erasNarrowRegex=zF;lt.months=yI;lt.monthsShort=wI;lt.monthsParse=_I;lt.monthsRegex=kI;lt.monthsShortRegex=SI;lt.week=EI;lt.firstDayOfYear=RI;lt.firstDayOfWeek=NI;lt.weekdays=zI;lt.weekdaysMin=VI;lt.weekdaysShort=UI;lt.weekdaysParse=$I;lt.weekdaysRegex=ZI;lt.weekdaysShortRegex=GI;lt.weekdaysMinRegex=KI;lt.isPM=XI;lt.meridiem=eL;function vd(e,t,r,n){var s=Cs(),o=Vn().set(n,t);return s[r](o,e)}function tk(e,t,r){if(ys(e)&&(t=e,e=void 0),e=e||"",t!=null)return vd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=vd(e,n,r,"month");return s}function vv(e,t,r,n){typeof e=="boolean"?(ys(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,ys(t)&&(r=t,t=void 0),t=t||"");var s=Cs(),o=e?s._week.dow:0,i,a=[];if(r!=null)return vd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=vd(t,(i+o)%7,n,"day");return a}function o4(e,t){return tk(e,t,"months")}function i4(e,t){return tk(e,t,"monthsShort")}function a4(e,t,r){return vv(e,t,r,"weekdays")}function l4(e,t,r){return vv(e,t,r,"weekdaysShort")}function c4(e,t,r){return vv(e,t,r,"weekdaysMin")}Js("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=tt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});me.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Js);me.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",Cs);var Kn=Math.abs;function u4(){var e=this._data;return this._milliseconds=Kn(this._milliseconds),this._days=Kn(this._days),this._months=Kn(this._months),e.milliseconds=Kn(e.milliseconds),e.seconds=Kn(e.seconds),e.minutes=Kn(e.minutes),e.hours=Kn(e.hours),e.months=Kn(e.months),e.years=Kn(e.years),this}function rk(e,t,r,n){var s=xn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function d4(e,t){return rk(this,e,t,1)}function f4(e,t){return rk(this,e,t,-1)}function ew(e){return e<0?Math.floor(e):Math.ceil(e)}function h4(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=ew(Gp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Hr(e/1e3),n.seconds=s%60,o=Hr(s/60),n.minutes=o%60,i=Hr(o/60),n.hours=i%24,t+=Hr(i/24),l=Hr(nk(t)),r+=l,t-=ew(Gp(l)),a=Hr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function nk(e){return e*4800/146097}function Gp(e){return e*146097/4800}function p4(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=Jr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+nk(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Gp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Es(e){return function(){return this.as(e)}}var sk=Es("ms"),m4=Es("s"),g4=Es("m"),v4=Es("h"),y4=Es("d"),w4=Es("w"),x4=Es("M"),_4=Es("Q"),b4=Es("y"),S4=sk;function k4(){return xn(this)}function C4(e){return e=Jr(e),this.isValid()?this[e+"s"]():NaN}function ei(e){return function(){return this.isValid()?this._data[e]:NaN}}var E4=ei("milliseconds"),T4=ei("seconds"),N4=ei("minutes"),R4=ei("hours"),P4=ei("days"),j4=ei("months"),D4=ei("years");function O4(){return Hr(this.days()/7)}var es=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function A4(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function M4(e,t,r,n){var s=xn(e).abs(),o=es(s.as("s")),i=es(s.as("m")),a=es(s.as("h")),l=es(s.as("d")),c=es(s.as("M")),d=es(s.as("w")),f=es(s.as("y")),p=o<=r.ss&&["s",o]||o0,p[4]=n,A4.apply(null,p)}function I4(e){return e===void 0?es:typeof e=="function"?(es=e,!0):!1}function L4(e,t){return Ri[e]===void 0?!1:t===void 0?Ri[e]:(Ri[e]=t,e==="s"&&(Ri.ss=t-1),!0)}function F4(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ri,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Ri,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=M4(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Rh=Math.abs;function fi(e){return(e>0)-(e<0)||+e}function Sf(){if(!this.isValid())return this.localeData().invalidDate();var e=Rh(this._milliseconds)/1e3,t=Rh(this._days),r=Rh(this._months),n,s,o,i,a=this.asSeconds(),l,c,d,f;return a?(n=Hr(e/60),s=Hr(n/60),e%=60,n%=60,o=Hr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=fi(this._months)!==fi(a)?"-":"",d=fi(this._days)!==fi(a)?"-":"",f=fi(this._milliseconds)!==fi(a)?"-":"",l+"P"+(o?c+o+"Y":"")+(r?c+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var st=_f.prototype;st.isValid=jL;st.abs=u4;st.add=d4;st.subtract=f4;st.as=p4;st.asMilliseconds=sk;st.asSeconds=m4;st.asMinutes=g4;st.asHours=v4;st.asDays=y4;st.asWeeks=w4;st.asMonths=x4;st.asQuarters=_4;st.asYears=b4;st.valueOf=S4;st._bubble=h4;st.clone=k4;st.get=C4;st.milliseconds=E4;st.seconds=T4;st.minutes=N4;st.hours=R4;st.days=P4;st.weeks=O4;st.months=j4;st.years=D4;st.humanize=F4;st.toISOString=Sf;st.toString=Sf;st.toJSON=Sf;st.locale=HS;st.localeData=ZS;st.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Sf);st.lang=YS;Ne("X",0,0,"unix");Ne("x",0,0,"valueOf");xe("x",vf);xe("X",oI);pt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});pt("x",function(e,t,r){r._d=new Date(tt(e))});//! moment.js -me.version="2.30.1";zM(bt);me.fn=ae;me.min=TL;me.max=NL;me.now=RL;me.utc=Vn;me.unix=n4;me.months=o4;me.isDate=hc;me.locale=Js;me.invalid=hf;me.duration=xn;me.isMoment=vn;me.weekdays=a4;me.parseZone=s4;me.localeData=Cs;me.isDuration=Cu;me.monthsShort=i4;me.weekdaysMin=c4;me.defineLocale=cv;me.updateLocale=sL;me.locales=oL;me.weekdaysShort=l4;me.normalizeUnits=Jr;me.relativeTimeRounding=I4;me.relativeTimeThreshold=L4;me.calendarFormat=eF;me.prototype=ae;me.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const z4=async()=>await Dt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),vc=async e=>e.id?await Dt().collection("access").update(e.id,e):await Dt().collection("access").create(e),U4=async e=>(e.deleted=me.utc().format("YYYY-MM-DD HH:mm:ss"),await Dt().collection("access").update(e.id,e)),V4=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},ok=y.createContext({}),ti=()=>y.useContext(ok),W4=({children:e})=>{const[t,r]=y.useReducer(V4,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await z4();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return u.jsx(ok.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},$4={theme:"system",setTheme:()=>null},ik=y.createContext($4);function B4({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return u.jsx(ik.Provider,{...n,value:i,children:e})}const H4=()=>{const e=y.useContext(ik);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function Y4(){const{setTheme:e}=H4();return u.jsxs(Fb,{children:[u.jsx(zb,{asChild:!0,children:u.jsxs(xt,{variant:"outline",size:"icon",children:[u.jsx(LP,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),u.jsx(MP,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),u.jsxs(Ug,{align:"end",children:[u.jsx(Ui,{onClick:()=>e("light"),children:"浅色"}),u.jsx(Ui,{onClick:()=>e("dark"),children:"暗黑"}),u.jsx(Ui,{onClick:()=>e("system"),children:"系统"})]})]})}var Z4="Separator",tw="horizontal",G4=["horizontal","vertical"],ak=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=tw,...s}=e,o=K4(n)?n:tw,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(Me.div,{"data-orientation":o,...a,...s,ref:t})});ak.displayName=Z4;function K4(e){return G4.includes(e)}var lk=ak;const Ht=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>u.jsx(lk,{ref:s,decorative:r,orientation:t,className:ve("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Ht.displayName=lk.displayName;function q4(){const e=Un(),t=zn();if(!Dt().authStore.isValid||!Dt().authStore.isAdmin)return u.jsx(G_,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Dt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return u.jsx(u.Fragment,{children:u.jsx(W4,{children:u.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[u.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:u.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[u.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:u.jsxs(Xn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),u.jsx("div",{className:"flex-1",children:u.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[u.jsxs(Xn,{to:"/",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[u.jsx(Op,{className:"h-4 w-4"}),"域名列表"]}),u.jsxs(Xn,{to:"/access",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[u.jsx(w0,{className:"h-4 w-4"}),"授权管理"]}),u.jsxs(Xn,{to:"/history",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[u.jsx(v0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[u.jsxs(oS,{children:[u.jsx(iS,{asChild:!0,children:u.jsxs(xt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[u.jsx(AP,{className:"h-5 w-5 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),u.jsx(Gg,{side:"left",className:"flex flex-col",children:u.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[u.jsxs(Xn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"}),u.jsx("span",{className:"sr-only",children:"Certimate"})]}),u.jsxs(Xn,{to:"/",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[u.jsx(Op,{className:"h-5 w-5"}),"域名列表"]}),u.jsxs(Xn,{to:"/access",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[u.jsx(w0,{className:"h-5 w-5"}),"授权管理"]}),u.jsxs(Xn,{to:"/history",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[u.jsx(v0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),u.jsx("div",{className:"w-full flex-1"}),u.jsx(Y4,{}),u.jsxs(Fb,{children:[u.jsx(zb,{asChild:!0,children:u.jsxs(xt,{variant:"secondary",size:"icon",className:"rounded-full",children:[u.jsx(PP,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),u.jsxs(Ug,{align:"end",children:[u.jsx(Ub,{children:"账户"}),u.jsx(Vb,{}),u.jsx(Ui,{onClick:o,children:"设置"}),u.jsx(Ui,{onClick:s,children:"退出"})]})]})]}),u.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[u.jsx(hg,{}),u.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[u.jsx("div",{className:""}),u.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[u.jsx("a",{href:"https://docs.certimate.me",target:"_blank",children:"文档"}),u.jsx(Ht,{orientation:"vertical",className:"mx-2"}),u.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.14"})]})]})]})]})]})})})}const ck=({phase:e,phaseSuccess:t})=>{let r=u.jsx(u.Fragment,{children:" "});return e==="check"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},uk=({className:e,...t})=>u.jsx("nav",{role:"navigation","aria-label":"pagination",className:ve("mx-auto flex w-full justify-center",e),...t});uk.displayName="Pagination";const dk=y.forwardRef(({className:e,...t},r)=>u.jsx("ul",{ref:r,className:ve("flex flex-row items-center gap-1",e),...t}));dk.displayName="PaginationContent";const Kp=y.forwardRef(({className:e,...t},r)=>u.jsx("li",{ref:r,className:ve("",e),...t}));Kp.displayName="PaginationItem";const fk=({className:e,isActive:t,size:r="icon",...n})=>u.jsx("a",{"aria-current":t?"page":void 0,className:ve(ef({variant:t?"outline":"ghost",size:r}),e),...n});fk.displayName="PaginationLink";const hk=({className:e,...t})=>u.jsxs("span",{"aria-hidden":!0,className:ve("flex h-9 w-9 items-center justify-center",e),...t,children:[u.jsx(DP,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"More pages"})]});hk.displayName="PaginationEllipsis";const pk=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let c=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),p=e-1;return c=o(d,f),t>3&&c.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=c;return f},i=s();return u.jsx(u.Fragment,{children:u.jsx(uk,{className:"dark:text-stone-200 justify-end mt-3",children:u.jsx(dk,{children:i.map((a,l)=>a==="..."?u.jsx(Kp,{children:u.jsx(hk,{})},l):u.jsx(Kp,{children:u.jsx(fk,{href:"#",isActive:t==a,onClick:c=>{c.preventDefault(),r(a)},children:a})},l))})})})},rw=({when:e,children:t,fallback:r})=>e?t:r;var mk="AlertDialog",[X4,sU]=Xr(mk,[$b]),Ts=$b(),gk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Hg,{...n,...r,modal:!0})};gk.displayName=mk;var Q4="AlertDialogTrigger",vk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(Yg,{...s,...n,ref:t})});vk.displayName=Q4;var J4="AlertDialogPortal",yk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Zg,{...n,...r})};yk.displayName=J4;var e3="AlertDialogOverlay",wk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(cc,{...s,...n,ref:t})});wk.displayName=e3;var Hi="AlertDialogContent",[t3,r3]=X4(Hi),xk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Ke(t,i),l=y.useRef(null);return u.jsx(pM,{contentName:Hi,titleName:_k,docsSlug:"alert-dialog",children:u.jsx(t3,{scope:r,cancelRef:l,children:u.jsxs(uc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(mg,{children:n}),u.jsx(s3,{contentRef:i})]})})})});xk.displayName=Hi;var _k="AlertDialogTitle",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(dc,{...s,...n,ref:t})});bk.displayName=_k;var Sk="AlertDialogDescription",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(fc,{...s,...n,ref:t})});kk.displayName=Sk;var n3="AlertDialogAction",Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(ff,{...s,...n,ref:t})});Ck.displayName=n3;var Ek="AlertDialogCancel",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=r3(Ek,r),o=Ts(r),i=Ke(t,s);return u.jsx(ff,{...o,...n,ref:i})});Tk.displayName=Ek;var s3=({contentRef:e})=>{const t=`\`${Hi}\` requires a description for the component to be accessible for screen reader users. +`+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var q0={};function vS(e,t){me.deprecationHandler!=null&&me.deprecationHandler(e,t),q0[e]||(gS(t),q0[e]=!0)}me.suppressDeprecationWarnings=!1;me.deprecationHandler=null;function Wn(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function VM(e){var t,r;for(r in e)at(e,r)&&(t=e[r],Wn(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function $p(e,t){var r=Hs({},e),n;for(n in t)at(t,n)&&(Mo(e[n])&&Mo(t[n])?(r[n]={},Hs(r[n],e[n]),Hs(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)at(e,n)&&!at(t,n)&&Mo(e[n])&&(r[n]=Hs({},r[n]));return r}function Jg(e){e!=null&&this.set(e)}var Bp;Object.keys?Bp=Object.keys:Bp=function(e){var t,r=[];for(t in e)at(e,t)&&r.push(t);return r};var WM={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function $M(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return Wn(n)?n.call(t,r):n}function In(e,t,r){var n=""+Math.abs(e),s=t-n.length,o=e>=0;return(o?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var ev=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,nu=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Th={},Wi={};function Re(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Wi[e]=s),t&&(Wi[t[0]]=function(){return In(s.apply(this,arguments),t[1],t[2])}),r&&(Wi[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function BM(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function HM(e){var t=e.match(ev),r,n;for(r=0,n=t.length;r=0&&nu.test(e);)e=e.replace(nu,n),nu.lastIndex=0,r-=1;return e}var YM={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ZM(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(ev).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var KM="Invalid date";function GM(){return this._invalidDate}var qM="%d",XM=/\d{1,2}/;function QM(e){return this._ordinal.replace("%d",e)}var JM={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function eI(e,t,r,n){var s=this._relativeTime[r];return Wn(s)?s(e,t,r,n):s.replace(/%d/i,e)}function tI(e,t){var r=this._relativeTime[e>0?"future":"past"];return Wn(r)?r(t):r.replace(/%s/i,t)}var X0={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(e){return typeof e=="string"?X0[e]||X0[e.toLowerCase()]:void 0}function tv(e){var t={},r,n;for(n in e)at(e,n)&&(r=Jr(n),r&&(t[r]=e[n]));return t}var rI={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function nI(e){var t=[],r;for(r in e)at(e,r)&&t.push({unit:r,priority:rI[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var xS=/\d/,Ur=/\d\d/,wS=/\d{3}/,rv=/\d{4}/,pf=/[+-]?\d{6}/,St=/\d\d?/,_S=/\d\d\d\d?/,bS=/\d\d\d\d\d\d?/,mf=/\d{1,3}/,nv=/\d{1,4}/,gf=/[+-]?\d{1,6}/,ga=/\d+/,vf=/[+-]?\d+/,sI=/Z|[+-]\d\d:?\d\d/gi,yf=/Z|[+-]\d\d(?::?\d\d)?/gi,oI=/[+-]?\d+(\.\d{1,3})?/,vc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,va=/^[1-9]\d?/,sv=/^([1-9]\d|\d)/,hd;hd={};function we(e,t,r){hd[e]=Wn(t)?t:function(n,s){return n&&r?r:t}}function iI(e,t){return at(hd,e)?hd[e](t._strict,t._locale):new RegExp(aI(e))}function aI(e){return cs(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,o){return r||n||s||o}))}function cs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Hr(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function tt(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=Hr(t)),r}var Hp={};function pt(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),ys(t)&&(n=function(o,i){i[t]=tt(o)}),s=e.length,r=0;r68?1900:2e3)};var SS=ya("FullYear",!0);function dI(){return xf(this.year())}function ya(e,t){return function(r){return r!=null?(kS(this,e,r),me.updateOffset(this,t),this):Il(this,e)}}function Il(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function kS(e,t,r){var n,s,o,i,a;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}o=r,i=e.month(),a=e.date(),a=a===29&&i===1&&!xf(o)?28:a,s?n.setUTCFullYear(o,i,a):n.setFullYear(o,i,a)}}function fI(e){return e=Jr(e),Wn(this[e])?this[e]():this}function hI(e,t){if(typeof e=="object"){e=tv(e);var r=nI(e),n,s=r.length;for(n=0;n=0?(a=new Date(e+400,t,r,n,s,o,i),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,o,i),a}function Ll(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function pd(e,t,r){var n=7+t-r,s=(7+Ll(e,0,n).getUTCDay()-t)%7;return-s+n-1}function jS(e,t,r,n,s){var o=(7+r-n)%7,i=pd(e,n,s),a=1+7*(t-1)+o+i,l,c;return a<=0?(l=e-1,c=nl(l)+a):a>nl(e)?(l=e+1,c=a-nl(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Fl(e,t,r){var n=pd(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,o,i;return s<1?(i=e.year()-1,o=s+us(i,t,r)):s>us(e.year(),t,r)?(o=s-us(e.year(),t,r),i=e.year()+1):(i=e.year(),o=s),{week:o,year:i}}function us(e,t,r){var n=pd(e,t,r),s=pd(e+1,t,r);return(nl(e)-n+s)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");we("w",St,va);we("ww",St,Ur);we("W",St,va);we("WW",St,Ur);yc(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=tt(e)});function EI(e){return Fl(e,this._week.dow,this._week.doy).week}var TI={dow:0,doy:6};function NI(){return this._week.dow}function RI(){return this._week.doy}function jI(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function PI(e){var t=Fl(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Re("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Re("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");we("d",St);we("e",St);we("E",St);we("dd",function(e,t){return t.weekdaysMinRegex(e)});we("ddd",function(e,t){return t.weekdaysShortRegex(e)});we("dddd",function(e,t){return t.weekdaysRegex(e)});yc(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:Ze(r).invalidWeekday=e});yc(["d","e","E"],function(e,t,r,n){t[n]=tt(e)});function DI(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function OI(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function iv(e,t){return e.slice(t,7).concat(e.slice(0,t))}var AI="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),PS="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),MI="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),II=vc,LI=vc,FI=vc;function zI(e,t){var r=gn(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?iv(r,this._week.dow):e?r[e.day()]:r}function UI(e){return e===!0?iv(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function VI(e){return e===!0?iv(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function WI(e,t,r){var n,s,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=Vn([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return r?t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1?s:null):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null):(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null):t==="dddd"?(s=Ft.call(this._weekdaysParse,i),s!==-1||(s=Ft.call(this._shortWeekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):t==="ddd"?(s=Ft.call(this._shortWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._minWeekdaysParse,i),s!==-1?s:null)):(s=Ft.call(this._minWeekdaysParse,i),s!==-1||(s=Ft.call(this._weekdaysParse,i),s!==-1)?s:(s=Ft.call(this._shortWeekdaysParse,i),s!==-1?s:null))}function $I(e,t,r){var n,s,o;if(this._weekdaysParseExact)return WI.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=Vn([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function BI(e){if(!this.isValid())return e!=null?this:NaN;var t=Il(this,"Day");return e!=null?(e=DI(e,this.localeData()),this.add(e-t,"d")):t}function HI(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function YI(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=OI(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ZI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(at(this,"_weekdaysRegex")||(this._weekdaysRegex=II),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function KI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(at(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=LI),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function GI(e){return this._weekdaysParseExact?(at(this,"_weekdaysRegex")||av.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(at(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=FI),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function av(){function e(d,f){return f.length-d.length}var t=[],r=[],n=[],s=[],o,i,a,l,c;for(o=0;o<7;o++)i=Vn([2e3,1]).day(o),a=cs(this.weekdaysMin(i,"")),l=cs(this.weekdaysShort(i,"")),c=cs(this.weekdays(i,"")),t.push(a),r.push(l),n.push(c),s.push(a),s.push(l),s.push(c);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function lv(){return this.hours()%12||12}function qI(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,lv);Re("k",["kk",2],0,qI);Re("hmm",0,0,function(){return""+lv.apply(this)+In(this.minutes(),2)});Re("hmmss",0,0,function(){return""+lv.apply(this)+In(this.minutes(),2)+In(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+In(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+In(this.minutes(),2)+In(this.seconds(),2)});function DS(e,t){Re(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}DS("a",!0);DS("A",!1);function OS(e,t){return t._meridiemParse}we("a",OS);we("A",OS);we("H",St,sv);we("h",St,va);we("k",St,va);we("HH",St,Ur);we("hh",St,Ur);we("kk",St,Ur);we("hmm",_S);we("hmmss",bS);we("Hmm",_S);we("Hmmss",bS);pt(["H","HH"],Kt);pt(["k","kk"],function(e,t,r){var n=tt(e);t[Kt]=n===24?0:n});pt(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});pt(["h","hh"],function(e,t,r){t[Kt]=tt(e),Ze(r).bigHour=!0});pt("hmm",function(e,t,r){var n=e.length-2;t[Kt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n)),Ze(r).bigHour=!0});pt("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Kt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n,2)),t[is]=tt(e.substr(s)),Ze(r).bigHour=!0});pt("Hmm",function(e,t,r){var n=e.length-2;t[Kt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n))});pt("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Kt]=tt(e.substr(0,n)),t[ln]=tt(e.substr(n,2)),t[is]=tt(e.substr(s))});function XI(e){return(e+"").toLowerCase().charAt(0)==="p"}var QI=/[ap]\.?m?\.?/i,JI=ya("Hours",!0);function eL(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var AS={calendar:WM,longDateFormat:YM,invalidDate:KM,ordinal:qM,dayOfMonthOrdinalParse:XM,relativeTime:JM,months:mI,monthsShort:CS,week:TI,weekdays:AI,weekdaysMin:MI,weekdaysShort:PS,meridiemParse:QI},Et={},Ia={},zl;function tL(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(s=wf(o.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&tL(o,n)>=r-1)break;r--}t++}return zl}function nL(e){return!!(e&&e.match("^[^/\\\\]*$"))}function wf(e){var t=null,r;if(Et[e]===void 0&&typeof Ou<"u"&&Ou&&Ou.exports&&nL(e))try{t=zl._abbr,r=require,r("./locale/"+e),ro(t)}catch{Et[e]=null}return Et[e]}function ro(e,t){var r;return e&&(yr(t)?r=Cs(e):r=cv(e,t),r?zl=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),zl._abbr}function cv(e,t){if(t!==null){var r,n=AS;if(t.abbr=e,Et[e]!=null)vS("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Et[e]._config;else if(t.parentLocale!=null)if(Et[t.parentLocale]!=null)n=Et[t.parentLocale]._config;else if(r=wf(t.parentLocale),r!=null)n=r._config;else return Ia[t.parentLocale]||(Ia[t.parentLocale]=[]),Ia[t.parentLocale].push({name:e,config:t}),null;return Et[e]=new Jg($p(n,t)),Ia[e]&&Ia[e].forEach(function(s){cv(s.name,s.config)}),ro(e),Et[e]}else return delete Et[e],null}function sL(e,t){if(t!=null){var r,n,s=AS;Et[e]!=null&&Et[e].parentLocale!=null?Et[e].set($p(Et[e]._config,t)):(n=wf(e),n!=null&&(s=n._config),t=$p(s,t),n==null&&(t.abbr=e),r=new Jg(t),r.parentLocale=Et[e],Et[e]=r),ro(e)}else Et[e]!=null&&(Et[e].parentLocale!=null?(Et[e]=Et[e].parentLocale,e===ro()&&ro(e)):Et[e]!=null&&delete Et[e]);return Et[e]}function Cs(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return zl;if(!gn(e)){if(t=wf(e),t)return t;e=[e]}return rL(e)}function oL(){return Bp(Et)}function uv(e){var t,r=e._a;return r&&Ze(e).overflow===-2&&(t=r[os]<0||r[os]>11?os:r[Tn]<1||r[Tn]>ov(r[ar],r[os])?Tn:r[Kt]<0||r[Kt]>24||r[Kt]===24&&(r[ln]!==0||r[is]!==0||r[Po]!==0)?Kt:r[ln]<0||r[ln]>59?ln:r[is]<0||r[is]>59?is:r[Po]<0||r[Po]>999?Po:-1,Ze(e)._overflowDayOfYear&&(tTn)&&(t=Tn),Ze(e)._overflowWeeks&&t===-1&&(t=cI),Ze(e)._overflowWeekday&&t===-1&&(t=uI),Ze(e).overflow=t),e}var iL=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,aL=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,lL=/Z|[+-]\d\d(?::?\d\d)?/,su=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Nh=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],cL=/^\/?Date\((-?\d+)/i,uL=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,dL={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function MS(e){var t,r,n=e._i,s=iL.exec(n)||aL.exec(n),o,i,a,l,c=su.length,d=Nh.length;if(s){for(Ze(e).iso=!0,t=0,r=c;tnl(i)||e._dayOfYear===0)&&(Ze(e)._overflowDayOfYear=!0),r=Ll(i,0,e._dayOfYear),e._a[os]=r.getUTCMonth(),e._a[Tn]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Kt]===24&&e._a[ln]===0&&e._a[is]===0&&e._a[Po]===0&&(e._nextDay=!0,e._a[Kt]=0),e._d=(e._useUTC?Ll:CI).apply(null,n),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Kt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(Ze(e).weekdayMismatch=!0)}}function xL(e){var t,r,n,s,o,i,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,r=pi(t.GG,e._a[ar],Fl(bt(),1,4).year),n=pi(t.W,1),s=pi(t.E,1),(s<1||s>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Fl(bt(),o,i),r=pi(t.gg,e._a[ar],c.year),n=pi(t.w,c.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+o,(t.e<0||t.e>6)&&(l=!0)):s=o),n<1||n>us(r,o,i)?Ze(e)._overflowWeeks=!0:l!=null?Ze(e)._overflowWeekday=!0:(a=jS(r,n,s,o,i),e._a[ar]=a.year,e._dayOfYear=a.dayOfYear)}me.ISO_8601=function(){};me.RFC_2822=function(){};function fv(e){if(e._f===me.ISO_8601){MS(e);return}if(e._f===me.RFC_2822){IS(e);return}e._a=[],Ze(e).empty=!0;var t=""+e._i,r,n,s,o,i,a=t.length,l=0,c,d;for(s=yS(e._f,e._locale).match(ev)||[],d=s.length,r=0;r0&&Ze(e).unusedInput.push(i),t=t.slice(t.indexOf(n)+n.length),l+=n.length),Wi[o]?(n?Ze(e).empty=!1:Ze(e).unusedTokens.push(o),lI(o,n,e)):e._strict&&!n&&Ze(e).unusedTokens.push(o);Ze(e).charsLeftOver=a-l,t.length>0&&Ze(e).unusedInput.push(t),e._a[Kt]<=12&&Ze(e).bigHour===!0&&e._a[Kt]>0&&(Ze(e).bigHour=void 0),Ze(e).parsedDateParts=e._a.slice(0),Ze(e).meridiem=e._meridiem,e._a[Kt]=wL(e._locale,e._a[Kt],e._meridiem),c=Ze(e).era,c!==null&&(e._a[ar]=e._locale.erasConvertYear(c,e._a[ar])),dv(e),uv(e)}function wL(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function _L(e){var t,r,n,s,o,i,a=!1,l=e._f.length;if(l===0){Ze(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;sthis?this:e:hf()});function zS(e,t){var r,n;if(t.length===1&&gn(t[0])&&(t=t[0]),!t.length)return bt();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function WL(){if(!yr(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Qg(e,this),e=LS(e),e._a?(t=e._isUTC?Vn(e._a):bt(e._a),this._isDSTShifted=this.isValid()&&OL(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function $L(){return this.isValid()?!this._isUTC:!1}function BL(){return this.isValid()?this._isUTC:!1}function VS(){return this.isValid()?this._isUTC&&this._offset===0:!1}var HL=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,YL=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function wn(e,t){var r=e,n=null,s,o,i;return Cu(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:ys(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=HL.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:tt(n[Tn])*s,h:tt(n[Kt])*s,m:tt(n[ln])*s,s:tt(n[is])*s,ms:tt(Yp(n[Po]*1e3))*s}):(n=YL.exec(e))?(s=n[1]==="-"?-1:1,r={y:_o(n[2],s),M:_o(n[3],s),w:_o(n[4],s),d:_o(n[5],s),h:_o(n[6],s),m:_o(n[7],s),s:_o(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(i=ZL(bt(r.from),bt(r.to)),r={},r.ms=i.milliseconds,r.M=i.months),o=new _f(r),Cu(e)&&at(e,"_locale")&&(o._locale=e._locale),Cu(e)&&at(e,"_isValid")&&(o._isValid=e._isValid),o}wn.fn=_f.prototype;wn.invalid=DL;function _o(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function J0(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function ZL(e,t){var r;return e.isValid()&&t.isValid()?(t=pv(t,e),e.isBefore(t)?r=J0(e,t):(r=J0(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function WS(e,t){return function(r,n){var s,o;return n!==null&&!isNaN(+n)&&(vS(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=r,r=n,n=o),s=wn(r,n),$S(this,s,e),this}}function $S(e,t,r,n){var s=t._milliseconds,o=Yp(t._days),i=Yp(t._months);e.isValid()&&(n=n??!0,i&&TS(e,Il(e,"Month")+i*r),o&&kS(e,"Date",Il(e,"Date")+o*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&me.updateOffset(e,o||i))}var KL=WS(1,"add"),GL=WS(-1,"subtract");function BS(e){return typeof e=="string"||e instanceof String}function qL(e){return vn(e)||mc(e)||BS(e)||ys(e)||QL(e)||XL(e)||e===null||e===void 0}function XL(e){var t=Mo(e)&&!qg(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,o,i=n.length;for(s=0;sr.valueOf():r.valueOf()9999?ku(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Wn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ku(r,"Z")):ku(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function fF(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(r+n+s+o)}function hF(e){e||(e=this.isUtc()?me.defaultFormatUtc:me.defaultFormat);var t=ku(this,e);return this.localeData().postformat(t)}function pF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||bt(e).isValid())?wn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function mF(e){return this.from(bt(),e)}function gF(e,t){return this.isValid()&&(vn(e)&&e.isValid()||bt(e).isValid())?wn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function vF(e){return this.to(bt(),e)}function HS(e){var t;return e===void 0?this._locale._abbr:(t=Cs(e),t!=null&&(this._locale=t),this)}var YS=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ZS(){return this._locale}var md=1e3,$i=60*md,gd=60*$i,KS=(365*400+97)*24*gd;function Bi(e,t){return(e%t+t)%t}function GS(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-KS:new Date(e,t,r).valueOf()}function qS(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-KS:Date.UTC(e,t,r)}function yF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?qS:GS,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd);break;case"minute":t=this._d.valueOf(),t-=Bi(t,$i);break;case"second":t=this._d.valueOf(),t-=Bi(t,md);break}return this._d.setTime(t),me.updateOffset(this,!0),this}function xF(e){var t,r;if(e=Jr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?qS:GS,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=gd-Bi(t+(this._isUTC?0:this.utcOffset()*$i),gd)-1;break;case"minute":t=this._d.valueOf(),t+=$i-Bi(t,$i)-1;break;case"second":t=this._d.valueOf(),t+=md-Bi(t,md)-1;break}return this._d.setTime(t),me.updateOffset(this,!0),this}function wF(){return this._d.valueOf()-(this._offset||0)*6e4}function _F(){return Math.floor(this.valueOf()/1e3)}function bF(){return new Date(this.valueOf())}function SF(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function kF(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function CF(){return this.isValid()?this.toISOString():null}function EF(){return Xg(this)}function TF(){return Hs({},Ze(this))}function NF(){return Ze(this).overflow}function RF(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");we("N",mv);we("NN",mv);we("NNN",mv);we("NNNN",UF);we("NNNNN",VF);pt(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?Ze(r).era=s:Ze(r).invalidEra=e});we("y",ga);we("yy",ga);we("yyy",ga);we("yyyy",ga);we("yo",WF);pt(["y","yy","yyy","yyyy"],ar);pt(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ar]=r._locale.eraYearOrdinalParse(e,s):t[ar]=parseInt(e,10)});function jF(e,t){var r,n,s,o=this._eras||Cs("en")._eras;for(r=0,n=o.length;r=0)return o[n]}function DF(e,t){var r=e.since<=e.until?1:-1;return t===void 0?me(e.since).year():me(e.since).year()+(t-e.offset)*r}function OF(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;eo&&(t=o),GF.call(this,e,t,r,n,s))}function GF(e,t,r,n,s){var o=jS(e,t,r,n,s),i=Ll(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}Re("Q",0,"Qo","quarter");we("Q",xS);pt("Q",function(e,t){t[os]=(tt(e)-1)*3});function qF(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");we("D",St,va);we("DD",St,Ur);we("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});pt(["D","DD"],Tn);pt("Do",function(e,t){t[Tn]=tt(e.match(St)[0])});var QS=ya("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");we("DDD",mf);we("DDDD",wS);pt(["DDD","DDDD"],function(e,t,r){r._dayOfYear=tt(e)});function XF(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Re("m",["mm",2],0,"minute");we("m",St,sv);we("mm",St,Ur);pt(["m","mm"],ln);var QF=ya("Minutes",!1);Re("s",["ss",2],0,"second");we("s",St,sv);we("ss",St,Ur);pt(["s","ss"],is);var JF=ya("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});we("S",mf,xS);we("SS",mf,Ur);we("SSS",mf,wS);var Ys,JS;for(Ys="SSSS";Ys.length<=9;Ys+="S")we(Ys,ga);function e4(e,t){t[Po]=tt(("0."+e)*1e3)}for(Ys="S";Ys.length<=9;Ys+="S")pt(Ys,e4);JS=ya("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function t4(){return this._isUTC?"UTC":""}function r4(){return this._isUTC?"Coordinated Universal Time":""}var ae=gc.prototype;ae.add=KL;ae.calendar=tF;ae.clone=rF;ae.diff=cF;ae.endOf=xF;ae.format=hF;ae.from=pF;ae.fromNow=mF;ae.to=gF;ae.toNow=vF;ae.get=fI;ae.invalidAt=NF;ae.isAfter=nF;ae.isBefore=sF;ae.isBetween=oF;ae.isSame=iF;ae.isSameOrAfter=aF;ae.isSameOrBefore=lF;ae.isValid=EF;ae.lang=YS;ae.locale=HS;ae.localeData=ZS;ae.max=EL;ae.min=CL;ae.parsingFlags=TF;ae.set=hI;ae.startOf=yF;ae.subtract=GL;ae.toArray=SF;ae.toObject=kF;ae.toDate=bF;ae.toISOString=dF;ae.inspect=fF;typeof Symbol<"u"&&Symbol.for!=null&&(ae[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ae.toJSON=CF;ae.toString=uF;ae.unix=_F;ae.valueOf=wF;ae.creationData=RF;ae.eraName=OF;ae.eraNarrow=AF;ae.eraAbbr=MF;ae.eraYear=IF;ae.year=SS;ae.isLeapYear=dI;ae.weekYear=$F;ae.isoWeekYear=BF;ae.quarter=ae.quarters=qF;ae.month=NS;ae.daysInMonth=bI;ae.week=ae.weeks=jI;ae.isoWeek=ae.isoWeeks=PI;ae.weeksInYear=ZF;ae.weeksInWeekYear=KF;ae.isoWeeksInYear=HF;ae.isoWeeksInISOWeekYear=YF;ae.date=QS;ae.day=ae.days=BI;ae.weekday=HI;ae.isoWeekday=YI;ae.dayOfYear=XF;ae.hour=ae.hours=JI;ae.minute=ae.minutes=QF;ae.second=ae.seconds=JF;ae.millisecond=ae.milliseconds=JS;ae.utcOffset=ML;ae.utc=LL;ae.local=FL;ae.parseZone=zL;ae.hasAlignedHourOffset=UL;ae.isDST=VL;ae.isLocal=$L;ae.isUtcOffset=BL;ae.isUtc=VS;ae.isUTC=VS;ae.zoneAbbr=t4;ae.zoneName=r4;ae.dates=Qr("dates accessor is deprecated. Use date instead.",QS);ae.months=Qr("months accessor is deprecated. Use month instead",NS);ae.years=Qr("years accessor is deprecated. Use year instead",SS);ae.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",IL);ae.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",WL);function n4(e){return bt(e*1e3)}function s4(){return bt.apply(null,arguments).parseZone()}function ek(e){return e}var lt=Jg.prototype;lt.calendar=$M;lt.longDateFormat=ZM;lt.invalidDate=GM;lt.ordinal=QM;lt.preparse=ek;lt.postformat=ek;lt.relativeTime=eI;lt.pastFuture=tI;lt.set=VM;lt.eras=jF;lt.erasParse=PF;lt.erasConvertYear=DF;lt.erasAbbrRegex=FF;lt.erasNameRegex=LF;lt.erasNarrowRegex=zF;lt.months=yI;lt.monthsShort=xI;lt.monthsParse=_I;lt.monthsRegex=kI;lt.monthsShortRegex=SI;lt.week=EI;lt.firstDayOfYear=RI;lt.firstDayOfWeek=NI;lt.weekdays=zI;lt.weekdaysMin=VI;lt.weekdaysShort=UI;lt.weekdaysParse=$I;lt.weekdaysRegex=ZI;lt.weekdaysShortRegex=KI;lt.weekdaysMinRegex=GI;lt.isPM=XI;lt.meridiem=eL;function vd(e,t,r,n){var s=Cs(),o=Vn().set(n,t);return s[r](o,e)}function tk(e,t,r){if(ys(e)&&(t=e,e=void 0),e=e||"",t!=null)return vd(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=vd(e,n,r,"month");return s}function vv(e,t,r,n){typeof e=="boolean"?(ys(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,ys(t)&&(r=t,t=void 0),t=t||"");var s=Cs(),o=e?s._week.dow:0,i,a=[];if(r!=null)return vd(t,(r+o)%7,n,"day");for(i=0;i<7;i++)a[i]=vd(t,(i+o)%7,n,"day");return a}function o4(e,t){return tk(e,t,"months")}function i4(e,t){return tk(e,t,"monthsShort")}function a4(e,t,r){return vv(e,t,r,"weekdays")}function l4(e,t,r){return vv(e,t,r,"weekdaysShort")}function c4(e,t,r){return vv(e,t,r,"weekdaysMin")}ro("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=tt(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});me.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",ro);me.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",Cs);var Gn=Math.abs;function u4(){var e=this._data;return this._milliseconds=Gn(this._milliseconds),this._days=Gn(this._days),this._months=Gn(this._months),e.milliseconds=Gn(e.milliseconds),e.seconds=Gn(e.seconds),e.minutes=Gn(e.minutes),e.hours=Gn(e.hours),e.months=Gn(e.months),e.years=Gn(e.years),this}function rk(e,t,r,n){var s=wn(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function d4(e,t){return rk(this,e,t,1)}function f4(e,t){return rk(this,e,t,-1)}function ex(e){return e<0?Math.floor(e):Math.ceil(e)}function h4(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,o,i,a,l;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=ex(Kp(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=Hr(e/1e3),n.seconds=s%60,o=Hr(s/60),n.minutes=o%60,i=Hr(o/60),n.hours=i%24,t+=Hr(i/24),l=Hr(nk(t)),r+=l,t-=ex(Kp(l)),a=Hr(r/12),r%=12,n.days=t,n.months=r,n.years=a,this}function nk(e){return e*4800/146097}function Kp(e){return e*146097/4800}function p4(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=Jr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+nk(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Kp(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Es(e){return function(){return this.as(e)}}var sk=Es("ms"),m4=Es("s"),g4=Es("m"),v4=Es("h"),y4=Es("d"),x4=Es("w"),w4=Es("M"),_4=Es("Q"),b4=Es("y"),S4=sk;function k4(){return wn(this)}function C4(e){return e=Jr(e),this.isValid()?this[e+"s"]():NaN}function ti(e){return function(){return this.isValid()?this._data[e]:NaN}}var E4=ti("milliseconds"),T4=ti("seconds"),N4=ti("minutes"),R4=ti("hours"),j4=ti("days"),P4=ti("months"),D4=ti("years");function O4(){return Hr(this.days()/7)}var es=Math.round,Ri={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function A4(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function M4(e,t,r,n){var s=wn(e).abs(),o=es(s.as("s")),i=es(s.as("m")),a=es(s.as("h")),l=es(s.as("d")),c=es(s.as("M")),d=es(s.as("w")),f=es(s.as("y")),p=o<=r.ss&&["s",o]||o0,p[4]=n,A4.apply(null,p)}function I4(e){return e===void 0?es:typeof e=="function"?(es=e,!0):!1}function L4(e,t){return Ri[e]===void 0?!1:t===void 0?Ri[e]:(Ri[e]=t,e==="s"&&(Ri.ss=t-1),!0)}function F4(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Ri,s,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Ri,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),o=M4(this,!r,n,s),r&&(o=s.pastFuture(+this,o)),s.postformat(o)}var Rh=Math.abs;function fi(e){return(e>0)-(e<0)||+e}function Sf(){if(!this.isValid())return this.localeData().invalidDate();var e=Rh(this._milliseconds)/1e3,t=Rh(this._days),r=Rh(this._months),n,s,o,i,a=this.asSeconds(),l,c,d,f;return a?(n=Hr(e/60),s=Hr(n/60),e%=60,n%=60,o=Hr(r/12),r%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=fi(this._months)!==fi(a)?"-":"",d=fi(this._days)!==fi(a)?"-":"",f=fi(this._milliseconds)!==fi(a)?"-":"",l+"P"+(o?c+o+"Y":"")+(r?c+r+"M":"")+(t?d+t+"D":"")+(s||n||e?"T":"")+(s?f+s+"H":"")+(n?f+n+"M":"")+(e?f+i+"S":"")):"P0D"}var st=_f.prototype;st.isValid=PL;st.abs=u4;st.add=d4;st.subtract=f4;st.as=p4;st.asMilliseconds=sk;st.asSeconds=m4;st.asMinutes=g4;st.asHours=v4;st.asDays=y4;st.asWeeks=x4;st.asMonths=w4;st.asQuarters=_4;st.asYears=b4;st.valueOf=S4;st._bubble=h4;st.clone=k4;st.get=C4;st.milliseconds=E4;st.seconds=T4;st.minutes=N4;st.hours=R4;st.days=j4;st.weeks=O4;st.months=P4;st.years=D4;st.humanize=F4;st.toISOString=Sf;st.toString=Sf;st.toJSON=Sf;st.locale=HS;st.localeData=ZS;st.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Sf);st.lang=YS;Re("X",0,0,"unix");Re("x",0,0,"valueOf");we("x",vf);we("X",oI);pt("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});pt("x",function(e,t,r){r._d=new Date(tt(e))});//! moment.js +me.version="2.30.1";zM(bt);me.fn=ae;me.min=TL;me.max=NL;me.now=RL;me.utc=Vn;me.unix=n4;me.months=o4;me.isDate=mc;me.locale=ro;me.invalid=hf;me.duration=wn;me.isMoment=vn;me.weekdays=a4;me.parseZone=s4;me.localeData=Cs;me.isDuration=Cu;me.monthsShort=i4;me.weekdaysMin=c4;me.defineLocale=cv;me.updateLocale=sL;me.locales=oL;me.weekdaysShort=l4;me.normalizeUnits=Jr;me.relativeTimeRounding=I4;me.relativeTimeThreshold=L4;me.calendarFormat=eF;me.prototype=ae;me.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const z4=async()=>await Dt().collection("access").getFullList({sort:"-created",filter:"deleted = null"}),xa=async e=>e.id?await Dt().collection("access").update(e.id,e):await Dt().collection("access").create(e),U4=async e=>(e.deleted=me.utc().format("YYYY-MM-DD HH:mm:ss"),await Dt().collection("access").update(e.id,e)),V4=(e,t)=>{switch(t.type){case"SET_ACCESSES":return{...e,accesses:t.payload};case"ADD_ACCESS":return{...e,accesses:[t.payload,...e.accesses]};case"DELETE_ACCESS":return{...e,accesses:e.accesses.filter(r=>r.id!==t.payload)};case"UPDATE_ACCESS":return{...e,accesses:e.accesses.map(r=>r.id===t.payload.id?t.payload:r)};default:return e}},ok=y.createContext({}),yo=()=>y.useContext(ok),W4=({children:e})=>{const[t,r]=y.useReducer(V4,{accesses:[]});y.useEffect(()=>{(async()=>{const a=await z4();r({type:"SET_ACCESSES",payload:a})})()},[]);const n=y.useCallback(i=>{r({type:"DELETE_ACCESS",payload:i})},[]),s=y.useCallback(i=>{r({type:"ADD_ACCESS",payload:i})},[]),o=y.useCallback(i=>{r({type:"UPDATE_ACCESS",payload:i})},[]);return u.jsx(ok.Provider,{value:{config:{accesses:t.accesses},deleteAccess:n,addAccess:s,updateAccess:o},children:e&&e})},$4={theme:"system",setTheme:()=>null},ik=y.createContext($4);function B4({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...n}){const[s,o]=y.useState(()=>localStorage.getItem(r)||t);y.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),s==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(s)},[s]);const i={theme:s,setTheme:a=>{localStorage.setItem(r,a),o(a)}};return u.jsx(ik.Provider,{...n,value:i,children:e})}const H4=()=>{const e=y.useContext(ik);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function Y4(){const{setTheme:e}=H4();return u.jsxs(Fb,{children:[u.jsx(zb,{asChild:!0,children:u.jsxs(vt,{variant:"outline",size:"icon",children:[u.jsx(Lj,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),u.jsx(Mj,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),u.jsxs(Ug,{align:"end",children:[u.jsx(Ui,{onClick:()=>e("light"),children:"浅色"}),u.jsx(Ui,{onClick:()=>e("dark"),children:"暗黑"}),u.jsx(Ui,{onClick:()=>e("system"),children:"系统"})]})]})}var Z4="Separator",tx="horizontal",K4=["horizontal","vertical"],ak=y.forwardRef((e,t)=>{const{decorative:r,orientation:n=tx,...s}=e,o=G4(n)?n:tx,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(Me.div,{"data-orientation":o,...a,...s,ref:t})});ak.displayName=Z4;function G4(e){return K4.includes(e)}var lk=ak;const Ht=y.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>u.jsx(lk,{ref:s,decorative:r,orientation:t,className:ve("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Ht.displayName=lk.displayName;function q4(){const e=Un(),t=zn();if(!Dt().authStore.isValid||!Dt().authStore.isAdmin)return u.jsx(K_,{to:"/login"});const r=t.pathname,n=i=>(console.log(r),i==r?"bg-muted text-primary":"text-muted-foreground"),s=()=>{Dt().authStore.clear(),e("/login")},o=()=>{e("/setting/password")};return u.jsx(u.Fragment,{children:u.jsx(W4,{children:u.jsxs("div",{className:"grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]",children:[u.jsx("div",{className:"hidden border-r dark:border-stone-500 bg-muted/40 md:block",children:u.jsxs("div",{className:"flex h-full max-h-screen flex-col gap-2",children:[u.jsx("div",{className:"flex h-14 items-center border-b dark:border-stone-500 px-4 lg:h-[60px] lg:px-6",children:u.jsxs(Xn,{to:"/",className:"flex items-center gap-2 font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"})]})}),u.jsx("div",{className:"flex-1",children:u.jsxs("nav",{className:"grid items-start px-2 text-sm font-medium lg:px-4",children:[u.jsxs(Xn,{to:"/",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/")),children:[u.jsx(Op,{className:"h-4 w-4"}),"域名列表"]}),u.jsxs(Xn,{to:"/access",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/access")),children:[u.jsx(x0,{className:"h-4 w-4"}),"授权管理"]}),u.jsxs(Xn,{to:"/history",className:ve("flex items-center gap-3 rounded-lg px-3 py-2 transition-all hover:text-primary",n("/history")),children:[u.jsx(v0,{className:"h-4 w-4"}),"部署历史"]})]})})]})}),u.jsxs("div",{className:"flex flex-col",children:[u.jsxs("header",{className:"flex h-14 items-center gap-4 border-b dark:border-stone-500 bg-muted/40 px-4 lg:h-[60px] lg:px-6",children:[u.jsxs(oS,{children:[u.jsx(iS,{asChild:!0,children:u.jsxs(vt,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[u.jsx(Aj,{className:"h-5 w-5 dark:text-white"}),u.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),u.jsx(Kg,{side:"left",className:"flex flex-col",children:u.jsxs("nav",{className:"grid gap-2 text-lg font-medium",children:[u.jsxs(Xn,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[u.jsx("img",{src:"/vite.svg",className:"w-[36px] h-[36px]"}),u.jsx("span",{className:"dark:text-white",children:"Certimate"}),u.jsx("span",{className:"sr-only",children:"Certimate"})]}),u.jsxs(Xn,{to:"/",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/")),children:[u.jsx(Op,{className:"h-5 w-5"}),"域名列表"]}),u.jsxs(Xn,{to:"/access",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/dns_provider")),children:[u.jsx(x0,{className:"h-5 w-5"}),"授权管理"]}),u.jsxs(Xn,{to:"/history",className:ve("mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 hover:text-foreground",n("/history")),children:[u.jsx(v0,{className:"h-5 w-5"}),"部署历史"]})]})})]}),u.jsx("div",{className:"w-full flex-1"}),u.jsx(Y4,{}),u.jsxs(Fb,{children:[u.jsx(zb,{asChild:!0,children:u.jsxs(vt,{variant:"secondary",size:"icon",className:"rounded-full",children:[u.jsx(jj,{className:"h-5 w-5"}),u.jsx("span",{className:"sr-only",children:"Toggle user menu"})]})}),u.jsxs(Ug,{align:"end",children:[u.jsx(Ub,{children:"账户"}),u.jsx(Vb,{}),u.jsx(Ui,{onClick:o,children:"设置"}),u.jsx(Ui,{onClick:s,children:"退出"})]})]})]}),u.jsxs("main",{className:"flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 relative",children:[u.jsx(hg,{}),u.jsxs("div",{className:"fixed right-0 bottom-0 w-full flex justify-between p-5",children:[u.jsx("div",{className:""}),u.jsxs("div",{className:"text-muted-foreground text-sm hover:text-stone-900 dark:hover:text-stone-200 flex",children:[u.jsx("a",{href:"https://docs.certimate.me",target:"_blank",children:"文档"}),u.jsx(Ht,{orientation:"vertical",className:"mx-2"}),u.jsx("a",{href:"https://github.com/usual2970/certimate/releases",target:"_blank",children:"Certimate v0.0.14"})]})]})]})]})]})})})}const ck=({phase:e,phaseSuccess:t})=>{let r=u.jsx(u.Fragment,{children:" "});return e==="check"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="apply"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow"}),u.jsx("div",{className:"text-xs text-nowrap text-muted-foreground",children:"部署"})]})),e==="deploy"&&(t?r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"部署"})]}):r=u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"检查 "}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-green-600",children:"获取"}),u.jsx(Ht,{className:"h-1 grow bg-green-600"}),u.jsx("div",{className:"text-xs text-nowrap text-red-600",children:"部署"})]})),r},uk=({className:e,...t})=>u.jsx("nav",{role:"navigation","aria-label":"pagination",className:ve("mx-auto flex w-full justify-center",e),...t});uk.displayName="Pagination";const dk=y.forwardRef(({className:e,...t},r)=>u.jsx("ul",{ref:r,className:ve("flex flex-row items-center gap-1",e),...t}));dk.displayName="PaginationContent";const Gp=y.forwardRef(({className:e,...t},r)=>u.jsx("li",{ref:r,className:ve("",e),...t}));Gp.displayName="PaginationItem";const fk=({className:e,isActive:t,size:r="icon",...n})=>u.jsx("a",{"aria-current":t?"page":void 0,className:ve(ef({variant:t?"outline":"ghost",size:r}),e),...n});fk.displayName="PaginationLink";const hk=({className:e,...t})=>u.jsxs("span",{"aria-hidden":!0,className:ve("flex h-9 w-9 items-center justify-center",e),...t,children:[u.jsx(Dj,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"More pages"})]});hk.displayName="PaginationEllipsis";const pk=({totalPages:e,currentPage:t,onPageChange:r})=>{const s=()=>{if(e>7){let c=[];const d=Math.max(2,t-1),f=Math.min(e-1,t+1),p=e-1;return c=o(d,f),t>3&&c.unshift("..."),t{let d=a;const f=[];for(;d<=l;)f.push(d),d+=c;return f},i=s();return u.jsx(u.Fragment,{children:u.jsx(uk,{className:"dark:text-stone-200 justify-end mt-3",children:u.jsx(dk,{children:i.map((a,l)=>a==="..."?u.jsx(Gp,{children:u.jsx(hk,{})},l):u.jsx(Gp,{children:u.jsx(fk,{href:"#",isActive:t==a,onClick:c=>{c.preventDefault(),r(a)},children:a})},l))})})})},rx=({when:e,children:t,fallback:r})=>e?t:r;var mk="AlertDialog",[X4,oU]=Xr(mk,[$b]),Ts=$b(),gk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Hg,{...n,...r,modal:!0})};gk.displayName=mk;var Q4="AlertDialogTrigger",vk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(Yg,{...s,...n,ref:t})});vk.displayName=Q4;var J4="AlertDialogPortal",yk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ts(t);return u.jsx(Zg,{...n,...r})};yk.displayName=J4;var e3="AlertDialogOverlay",xk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(dc,{...s,...n,ref:t})});xk.displayName=e3;var Hi="AlertDialogContent",[t3,r3]=X4(Hi),wk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=Ts(r),i=y.useRef(null),a=Xe(t,i),l=y.useRef(null);return u.jsx(pM,{contentName:Hi,titleName:_k,docsSlug:"alert-dialog",children:u.jsx(t3,{scope:r,cancelRef:l,children:u.jsxs(fc,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:ue(s.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(mg,{children:n}),u.jsx(s3,{contentRef:i})]})})})});wk.displayName=Hi;var _k="AlertDialogTitle",bk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(hc,{...s,...n,ref:t})});bk.displayName=_k;var Sk="AlertDialogDescription",kk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(pc,{...s,...n,ref:t})});kk.displayName=Sk;var n3="AlertDialogAction",Ck=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ts(r);return u.jsx(ff,{...s,...n,ref:t})});Ck.displayName=n3;var Ek="AlertDialogCancel",Tk=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=r3(Ek,r),o=Ts(r),i=Xe(t,s);return u.jsx(ff,{...o,...n,ref:i})});Tk.displayName=Ek;var s3=({contentRef:e})=>{const t=`\`${Hi}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Hi}\` by passing a \`${Sk}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Hi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},o3=gk,i3=vk,a3=yk,Nk=wk,Rk=xk,Pk=Ck,jk=Tk,Dk=bk,Ok=kk;const l3=o3,c3=i3,u3=a3,Ak=y.forwardRef(({className:e,...t},r)=>u.jsx(Nk,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Ak.displayName=Nk.displayName;const Mk=y.forwardRef(({className:e,...t},r)=>u.jsxs(u3,{children:[u.jsx(Ak,{}),u.jsx(Rk,{ref:r,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Mk.displayName=Rk.displayName;const Ik=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ik.displayName="AlertDialogHeader";const Lk=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Lk.displayName="AlertDialogFooter";const Fk=y.forwardRef(({className:e,...t},r)=>u.jsx(Dk,{ref:r,className:ve("text-lg font-semibold",e),...t}));Fk.displayName=Dk.displayName;const zk=y.forwardRef(({className:e,...t},r)=>u.jsx(Ok,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));zk.displayName=Ok.displayName;const Uk=y.forwardRef(({className:e,...t},r)=>u.jsx(Pk,{ref:r,className:ve(ef(),e),...t}));Uk.displayName=Pk.displayName;const Vk=y.forwardRef(({className:e,...t},r)=>u.jsx(jk,{ref:r,className:ve(ef({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Vk.displayName=jk.displayName;function Wk(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yv="Switch",[d3,oU]=Xr(yv),[f3,h3]=d3(yv),$k=y.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,p]=y.useState(null),m=Ke(t,g=>p(g)),w=y.useRef(!1),v=f?!!f.closest("form"):!0,[x=!1,h]=ro({prop:s,defaultProp:o,onChange:c});return u.jsxs(f3,{scope:r,checked:x,disabled:a,children:[u.jsx(Me.button,{type:"button",role:"switch","aria-checked":x,"aria-required":i,"data-state":Yk(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:ue(e.onClick,g=>{h(_=>!_),v&&(w.current=g.isPropagationStopped(),w.current||g.stopPropagation())})}),v&&u.jsx(p3,{control:f,bubbles:!w.current,name:n,value:l,checked:x,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});$k.displayName=yv;var Bk="SwitchThumb",Hk=y.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=h3(Bk,r);return u.jsx(Me.span,{"data-state":Yk(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Hk.displayName=Bk;var p3=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=y.useRef(null),i=Wk(r),a=_1(t);return y.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&f){const p=new Event("click",{bubbles:n});f.call(l,r),l.dispatchEvent(p)}},[i,r,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Yk(e){return e?"checked":"unchecked"}var Zk=$k,m3=Hk;const Gk=y.forwardRef(({className:e,...t},r)=>u.jsx(Zk,{className:ve("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:u.jsx(m3,{className:ve("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Gk.displayName=Zk.displayName;var g3="VisuallyHidden",yc=y.forwardRef((e,t)=>u.jsx(Me.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));yc.displayName=g3;var v3=yc,wv="ToastProvider",[xv,y3,w3]=tf("Toast"),[Kk,iU]=Xr("Toast",[w3]),[x3,kf]=Kk(wv),qk=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=y.useState(null),[c,d]=y.useState(0),f=y.useRef(!1),p=y.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${wv}\`. Expected non-empty \`string\`.`),u.jsx(xv.Provider,{scope:t,children:u.jsx(x3,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:y.useCallback(()=>d(m=>m+1),[]),onToastRemove:y.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};qk.displayName=wv;var Xk="ToastViewport",_3=["F8"],qp="toast.viewportPause",Xp="toast.viewportResume",Qk=y.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=_3,label:s="Notifications ({hotkey})",...o}=e,i=kf(Xk,r),a=y3(r),l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=Ke(t,f,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=i.toastCount>0;y.useEffect(()=>{const x=h=>{var _;n.every(C=>h[C]||h.code===C)&&((_=f.current)==null||_.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),y.useEffect(()=>{const x=l.current,h=f.current;if(w&&x&&h){const g=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(qp);h.dispatchEvent(E),i.isClosePausedRef.current=!0}},_=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Xp);h.dispatchEvent(E),i.isClosePausedRef.current=!1}},C=E=>{!x.contains(E.relatedTarget)&&_()},T=()=>{x.contains(document.activeElement)||_()};return x.addEventListener("focusin",g),x.addEventListener("focusout",C),x.addEventListener("pointermove",g),x.addEventListener("pointerleave",T),window.addEventListener("blur",g),window.addEventListener("focus",_),()=>{x.removeEventListener("focusin",g),x.removeEventListener("focusout",C),x.removeEventListener("pointermove",g),x.removeEventListener("pointerleave",T),window.removeEventListener("blur",g),window.removeEventListener("focus",_)}}},[w,i.isClosePausedRef]);const v=y.useCallback(({tabbingDirection:x})=>{const g=a().map(_=>{const C=_.ref.current,T=[C,...A3(C)];return x==="forwards"?T:T.reverse()});return(x==="forwards"?g.reverse():g).flat()},[a]);return y.useEffect(()=>{const x=f.current;if(x){const h=g=>{var T,E,P;const _=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!_){const O=document.activeElement,j=g.shiftKey;if(g.target===x&&j){(T=c.current)==null||T.focus();return}const N=v({tabbingDirection:j?"backwards":"forwards"}),F=N.findIndex(b=>b===O);Ph(N.slice(F+1))?g.preventDefault():j?(E=c.current)==null||E.focus():(P=d.current)==null||P.focus()}};return x.addEventListener("keydown",h),()=>x.removeEventListener("keydown",h)}},[a,v]),u.jsxs(Mj,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&u.jsx(Qp,{ref:c,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"forwards"});Ph(x)}}),u.jsx(xv.Slot,{scope:r,children:u.jsx(Me.ol,{tabIndex:-1,...o,ref:p})}),w&&u.jsx(Qp,{ref:d,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"backwards"});Ph(x)}})]})});Qk.displayName=Xk;var Jk="ToastFocusProxy",Qp=y.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=kf(Jk,r);return u.jsx(yc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&n()}})});Qp.displayName=Jk;var Cf="Toast",b3="toast.swipeStart",S3="toast.swipeMove",k3="toast.swipeCancel",C3="toast.swipeEnd",eC=y.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=ro({prop:n,defaultProp:s,onChange:o});return u.jsx(Cr,{present:r||a,children:u.jsx(N3,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:jt(e.onPause),onResume:jt(e.onResume),onSwipeStart:ue(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(e.onSwipeMove,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ue(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(e.onSwipeEnd,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});eC.displayName=Cf;var[E3,T3]=Kk(Cf,{onClose(){}}),N3=y.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...w}=e,v=kf(Cf,r),[x,h]=y.useState(null),g=Ke(t,b=>h(b)),_=y.useRef(null),C=y.useRef(null),T=s||v.duration,E=y.useRef(0),P=y.useRef(T),O=y.useRef(0),{onToastAdd:j,onToastRemove:L}=v,q=jt(()=>{var W;(x==null?void 0:x.contains(document.activeElement))&&((W=v.viewport)==null||W.focus()),i()}),N=y.useCallback(b=>{!b||b===1/0||(window.clearTimeout(O.current),E.current=new Date().getTime(),O.current=window.setTimeout(q,b))},[q]);y.useEffect(()=>{const b=v.viewport;if(b){const W=()=>{N(P.current),c==null||c()},te=()=>{const $=new Date().getTime()-E.current;P.current=P.current-$,window.clearTimeout(O.current),l==null||l()};return b.addEventListener(qp,te),b.addEventListener(Xp,W),()=>{b.removeEventListener(qp,te),b.removeEventListener(Xp,W)}}},[v.viewport,T,l,c,N]),y.useEffect(()=>{o&&!v.isClosePausedRef.current&&N(T)},[o,T,v.isClosePausedRef,N]),y.useEffect(()=>(j(),()=>L()),[j,L]);const F=y.useMemo(()=>x?aC(x):null,[x]);return v.viewport?u.jsxs(u.Fragment,{children:[F&&u.jsx(R3,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),u.jsx(E3,{scope:r,onClose:q,children:_s.createPortal(u.jsx(xv.ItemSlot,{scope:r,children:u.jsx(Aj,{asChild:!0,onEscapeKeyDown:ue(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||q(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(Me.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...w,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ue(e.onPointerDown,b=>{b.button===0&&(_.current={x:b.clientX,y:b.clientY})}),onPointerMove:ue(e.onPointerMove,b=>{if(!_.current)return;const W=b.clientX-_.current.x,te=b.clientY-_.current.y,$=!!C.current,Z=["left","right"].includes(v.swipeDirection),I=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,Q=Z?I(0,W):0,z=Z?0:I(0,te),V=b.pointerType==="touch"?10:2,de={x:Q,y:z},ne={originalEvent:b,delta:de};$?(C.current=de,ou(S3,f,ne,{discrete:!1})):nw(de,v.swipeDirection,V)?(C.current=de,ou(b3,d,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(W)>V||Math.abs(te)>V)&&(_.current=null)}),onPointerUp:ue(e.onPointerUp,b=>{const W=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,_.current=null,W){const $=b.currentTarget,Z={originalEvent:b,delta:W};nw(W,v.swipeDirection,v.swipeThreshold)?ou(C3,m,Z,{discrete:!0}):ou(k3,p,Z,{discrete:!0}),$.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),R3=e=>{const{__scopeToast:t,children:r,...n}=e,s=kf(Cf,t),[o,i]=y.useState(!1),[a,l]=y.useState(!1);return D3(()=>i(!0)),y.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(ic,{asChild:!0,children:u.jsx(yc,{...n,children:o&&u.jsxs(u.Fragment,{children:[s.label," ",r]})})})},P3="ToastTitle",tC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});tC.displayName=P3;var j3="ToastDescription",rC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});rC.displayName=j3;var nC="ToastAction",sC=y.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?u.jsx(iC,{altText:r,asChild:!0,children:u.jsx(_v,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${nC}\`. Expected non-empty \`string\`.`),null)});sC.displayName=nC;var oC="ToastClose",_v=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=T3(oC,r);return u.jsx(iC,{asChild:!0,children:u.jsx(Me.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,s.onClose)})})});_v.displayName=oC;var iC=y.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return u.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function aC(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),O3(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...aC(n))}}),t}function ou(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vg(s,o):s.dispatchEvent(o)}var nw=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function D3(e=()=>{}){const t=jt(e);nr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function O3(e){return e.nodeType===e.ELEMENT_NODE}function A3(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ph(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var M3=qk,lC=Qk,cC=eC,uC=tC,dC=rC,fC=sC,hC=_v;const I3=M3,pC=y.forwardRef(({className:e,...t},r)=>u.jsx(lC,{ref:r,className:ve("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));pC.displayName=lC.displayName;const L3=sc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all 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-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out 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",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),mC=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx(cC,{ref:n,className:ve(L3({variant:t}),e),...r}));mC.displayName=cC.displayName;const F3=y.forwardRef(({className:e,...t},r)=>u.jsx(fC,{ref:r,className:ve("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));F3.displayName=fC.displayName;const gC=y.forwardRef(({className:e,...t},r)=>u.jsx(hC,{ref:r,className:ve("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(pg,{className:"h-4 w-4"})}));gC.displayName=hC.displayName;const vC=y.forwardRef(({className:e,...t},r)=>u.jsx(uC,{ref:r,className:ve("text-sm font-semibold",e),...t}));vC.displayName=uC.displayName;const yC=y.forwardRef(({className:e,...t},r)=>u.jsx(dC,{ref:r,className:ve("text-sm opacity-90",e),...t}));yC.displayName=dC.displayName;const z3=1,U3=1e6;let jh=0;function V3(){return jh=(jh+1)%Number.MAX_SAFE_INTEGER,jh.toString()}const Dh=new Map,sw=e=>{if(Dh.has(e))return;const t=setTimeout(()=>{Dh.delete(e),rl({type:"REMOVE_TOAST",toastId:e})},U3);Dh.set(e,t)},W3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,z3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?sw(r):e.toasts.forEach(n=>{sw(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Tu=[];let Nu={toasts:[]};function rl(e){Nu=W3(Nu,e),Tu.forEach(t=>{t(Nu)})}function $3({...e}){const t=V3(),r=s=>rl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>rl({type:"DISMISS_TOAST",toastId:t});return rl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Ef(){const[e,t]=y.useState(Nu);return y.useEffect(()=>(Tu.push(t),()=>{const r=Tu.indexOf(t);r>-1&&Tu.splice(r,1)}),[e]),{...e,toast:$3,dismiss:r=>rl({type:"DISMISS_TOAST",toastId:r})}}function bv(){const{toasts:e}=Ef();return u.jsxs(I3,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return u.jsxs(mC,{...o,children:[u.jsxs("div",{className:"grid gap-1",children:[r&&u.jsx(vC,{children:r}),n&&u.jsx(yC,{children:n})]}),s,u.jsx(gC,{})]},t)}),u.jsx(pC,{})]})}var[Tf,aU]=Xr("Tooltip",[ma]),Nf=ma(),wC="TooltipProvider",B3=700,Jp="tooltip.open",[H3,Sv]=Tf(wC),xC=e=>{const{__scopeTooltip:t,delayDuration:r=B3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=y.useState(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),u.jsx(H3,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};xC.displayName=wC;var Rf="Tooltip",[Y3,Pf]=Tf(Rf),_C=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=Sv(Rf,e.__scopeTooltip),c=Nf(t),[d,f]=y.useState(null),p=On(),m=y.useRef(0),w=i??l.disableHoverableContent,v=a??l.delayDuration,x=y.useRef(!1),[h=!1,g]=ro({prop:n,defaultProp:s,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(Jp))):l.onClose(),o==null||o(P)}}),_=y.useMemo(()=>h?x.current?"delayed-open":"instant-open":"closed",[h]),C=y.useCallback(()=>{window.clearTimeout(m.current),x.current=!1,g(!0)},[g]),T=y.useCallback(()=>{window.clearTimeout(m.current),g(!1)},[g]),E=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,g(!0)},v)},[v,g]);return y.useEffect(()=>()=>window.clearTimeout(m.current),[]),u.jsx(Tg,{...c,children:u.jsx(Y3,{scope:t,contentId:p,open:h,stateAttribute:_,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?E():C()},[l.isOpenDelayed,E,C]),onTriggerLeave:y.useCallback(()=>{w?T():window.clearTimeout(m.current)},[T,w]),onOpen:C,onClose:T,disableHoverableContent:w,children:r})})};_C.displayName=Rf;var em="TooltipTrigger",bC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Pf(em,r),o=Sv(em,r),i=Nf(r),a=y.useRef(null),l=Ke(t,a,s.onTriggerChange),c=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(Ng,{asChild:!0,...i,children:u.jsx(Me.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:ue(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});bC.displayName=em;var Z3="TooltipPortal",[lU,G3]=Tf(Z3,{forceMount:void 0}),ta="TooltipContent",kv=y.forwardRef((e,t)=>{const r=G3(ta,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=Pf(ta,e.__scopeTooltip);return u.jsx(Cr,{present:n||i.open,children:i.disableHoverableContent?u.jsx(SC,{side:s,...o,ref:t}):u.jsx(K3,{side:s,...o,ref:t})})}),K3=y.forwardRef((e,t)=>{const r=Pf(ta,e.__scopeTooltip),n=Sv(ta,e.__scopeTooltip),s=y.useRef(null),o=Ke(t,s),[i,a]=y.useState(null),{trigger:l,onClose:c}=r,d=s.current,{onPointerInTransitChange:f}=n,p=y.useCallback(()=>{a(null),f(!1)},[f]),m=y.useCallback((w,v)=>{const x=w.currentTarget,h={x:w.clientX,y:w.clientY},g=J3(h,x.getBoundingClientRect()),_=e5(h,g),C=t5(v.getBoundingClientRect()),T=n5([..._,...C]);a(T),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(l&&d){const w=x=>m(x,d),v=x=>m(x,l);return l.addEventListener("pointerleave",w),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",v)}}},[l,d,m,p]),y.useEffect(()=>{if(i){const w=v=>{const x=v.target,h={x:v.clientX,y:v.clientY},g=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),_=!r5(h,i);g?p():_&&(p(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,d,i,c,p]),u.jsx(SC,{...e,ref:o})}),[q3,X3]=Tf(Rf,{isInside:!1}),SC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=Pf(ta,r),c=Nf(r),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(Jp,d),()=>document.removeEventListener(Jp,d)),[d]),y.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Rg,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(mg,{children:n}),u.jsx(q3,{scope:r,isInside:!0,children:u.jsx(v3,{id:l.contentId,role:"tooltip",children:s||n})})]})})});kv.displayName=ta;var kC="TooltipArrow",Q3=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Nf(r);return X3(kC,r).isInside?null:u.jsx(Pg,{...s,...n,ref:t})});Q3.displayName=kC;function J3(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function e5(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function t5(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function r5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function n5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),s5(t)}function s5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var o5=_C,i5=bC,CC=kv;const a5=o5,l5=i5,c5=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(CC,{ref:n,sideOffset:t,className:ve("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));c5.displayName=CC.displayName;function iu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var EC={exports:{}};/*! +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},o3=gk,i3=vk,a3=yk,Nk=xk,Rk=wk,jk=Ck,Pk=Tk,Dk=bk,Ok=kk;const l3=o3,c3=i3,u3=a3,Ak=y.forwardRef(({className:e,...t},r)=>u.jsx(Nk,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Ak.displayName=Nk.displayName;const Mk=y.forwardRef(({className:e,...t},r)=>u.jsxs(u3,{children:[u.jsx(Ak,{}),u.jsx(Rk,{ref:r,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Mk.displayName=Rk.displayName;const Ik=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ik.displayName="AlertDialogHeader";const Lk=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Lk.displayName="AlertDialogFooter";const Fk=y.forwardRef(({className:e,...t},r)=>u.jsx(Dk,{ref:r,className:ve("text-lg font-semibold",e),...t}));Fk.displayName=Dk.displayName;const zk=y.forwardRef(({className:e,...t},r)=>u.jsx(Ok,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));zk.displayName=Ok.displayName;const Uk=y.forwardRef(({className:e,...t},r)=>u.jsx(jk,{ref:r,className:ve(ef(),e),...t}));Uk.displayName=jk.displayName;const Vk=y.forwardRef(({className:e,...t},r)=>u.jsx(Pk,{ref:r,className:ve(ef({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Vk.displayName=Pk.displayName;function Wk(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yv="Switch",[d3,iU]=Xr(yv),[f3,h3]=d3(yv),$k=y.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,p]=y.useState(null),m=Xe(t,g=>p(g)),x=y.useRef(!1),v=f?!!f.closest("form"):!0,[w=!1,h]=oo({prop:s,defaultProp:o,onChange:c});return u.jsxs(f3,{scope:r,checked:w,disabled:a,children:[u.jsx(Me.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":Yk(w),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:ue(e.onClick,g=>{h(_=>!_),v&&(x.current=g.isPropagationStopped(),x.current||g.stopPropagation())})}),v&&u.jsx(p3,{control:f,bubbles:!x.current,name:n,value:l,checked:w,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});$k.displayName=yv;var Bk="SwitchThumb",Hk=y.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=h3(Bk,r);return u.jsx(Me.span,{"data-state":Yk(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Hk.displayName=Bk;var p3=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=y.useRef(null),i=Wk(r),a=_1(t);return y.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&f){const p=new Event("click",{bubbles:n});f.call(l,r),l.dispatchEvent(p)}},[i,r,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Yk(e){return e?"checked":"unchecked"}var Zk=$k,m3=Hk;const Kk=y.forwardRef(({className:e,...t},r)=>u.jsx(Zk,{className:ve("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:u.jsx(m3,{className:ve("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Kk.displayName=Zk.displayName;var g3="VisuallyHidden",xc=y.forwardRef((e,t)=>u.jsx(Me.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));xc.displayName=g3;var v3=xc,xv="ToastProvider",[wv,y3,x3]=tf("Toast"),[Gk,aU]=Xr("Toast",[x3]),[w3,kf]=Gk(xv),qk=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=y.useState(null),[c,d]=y.useState(0),f=y.useRef(!1),p=y.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${xv}\`. Expected non-empty \`string\`.`),u.jsx(wv.Provider,{scope:t,children:u.jsx(w3,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:y.useCallback(()=>d(m=>m+1),[]),onToastRemove:y.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};qk.displayName=xv;var Xk="ToastViewport",_3=["F8"],qp="toast.viewportPause",Xp="toast.viewportResume",Qk=y.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=_3,label:s="Notifications ({hotkey})",...o}=e,i=kf(Xk,r),a=y3(r),l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=Xe(t,f,i.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;y.useEffect(()=>{const w=h=>{var _;n.every(C=>h[C]||h.code===C)&&((_=f.current)==null||_.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),y.useEffect(()=>{const w=l.current,h=f.current;if(x&&w&&h){const g=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(qp);h.dispatchEvent(E),i.isClosePausedRef.current=!0}},_=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Xp);h.dispatchEvent(E),i.isClosePausedRef.current=!1}},C=E=>{!w.contains(E.relatedTarget)&&_()},T=()=>{w.contains(document.activeElement)||_()};return w.addEventListener("focusin",g),w.addEventListener("focusout",C),w.addEventListener("pointermove",g),w.addEventListener("pointerleave",T),window.addEventListener("blur",g),window.addEventListener("focus",_),()=>{w.removeEventListener("focusin",g),w.removeEventListener("focusout",C),w.removeEventListener("pointermove",g),w.removeEventListener("pointerleave",T),window.removeEventListener("blur",g),window.removeEventListener("focus",_)}}},[x,i.isClosePausedRef]);const v=y.useCallback(({tabbingDirection:w})=>{const g=a().map(_=>{const C=_.ref.current,T=[C,...A3(C)];return w==="forwards"?T:T.reverse()});return(w==="forwards"?g.reverse():g).flat()},[a]);return y.useEffect(()=>{const w=f.current;if(w){const h=g=>{var T,E,j;const _=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!_){const O=document.activeElement,P=g.shiftKey;if(g.target===w&&P){(T=c.current)==null||T.focus();return}const N=v({tabbingDirection:P?"backwards":"forwards"}),F=N.findIndex(b=>b===O);jh(N.slice(F+1))?g.preventDefault():P?(E=c.current)==null||E.focus():(j=d.current)==null||j.focus()}};return w.addEventListener("keydown",h),()=>w.removeEventListener("keydown",h)}},[a,v]),u.jsxs(MP,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&u.jsx(Qp,{ref:c,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});jh(w)}}),u.jsx(wv.Slot,{scope:r,children:u.jsx(Me.ol,{tabIndex:-1,...o,ref:p})}),x&&u.jsx(Qp,{ref:d,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});jh(w)}})]})});Qk.displayName=Xk;var Jk="ToastFocusProxy",Qp=y.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=kf(Jk,r);return u.jsx(xc,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&n()}})});Qp.displayName=Jk;var Cf="Toast",b3="toast.swipeStart",S3="toast.swipeMove",k3="toast.swipeCancel",C3="toast.swipeEnd",eC=y.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=oo({prop:n,defaultProp:s,onChange:o});return u.jsx(Cr,{present:r||a,children:u.jsx(N3,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Pt(e.onPause),onResume:Pt(e.onResume),onSwipeStart:ue(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(e.onSwipeMove,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ue(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(e.onSwipeEnd,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});eC.displayName=Cf;var[E3,T3]=Gk(Cf,{onClose(){}}),N3=y.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...x}=e,v=kf(Cf,r),[w,h]=y.useState(null),g=Xe(t,b=>h(b)),_=y.useRef(null),C=y.useRef(null),T=s||v.duration,E=y.useRef(0),j=y.useRef(T),O=y.useRef(0),{onToastAdd:P,onToastRemove:L}=v,q=Pt(()=>{var W;(w==null?void 0:w.contains(document.activeElement))&&((W=v.viewport)==null||W.focus()),i()}),N=y.useCallback(b=>{!b||b===1/0||(window.clearTimeout(O.current),E.current=new Date().getTime(),O.current=window.setTimeout(q,b))},[q]);y.useEffect(()=>{const b=v.viewport;if(b){const W=()=>{N(j.current),c==null||c()},te=()=>{const $=new Date().getTime()-E.current;j.current=j.current-$,window.clearTimeout(O.current),l==null||l()};return b.addEventListener(qp,te),b.addEventListener(Xp,W),()=>{b.removeEventListener(qp,te),b.removeEventListener(Xp,W)}}},[v.viewport,T,l,c,N]),y.useEffect(()=>{o&&!v.isClosePausedRef.current&&N(T)},[o,T,v.isClosePausedRef,N]),y.useEffect(()=>(P(),()=>L()),[P,L]);const F=y.useMemo(()=>w?aC(w):null,[w]);return v.viewport?u.jsxs(u.Fragment,{children:[F&&u.jsx(R3,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),u.jsx(E3,{scope:r,onClose:q,children:_s.createPortal(u.jsx(wv.ItemSlot,{scope:r,children:u.jsx(AP,{asChild:!0,onEscapeKeyDown:ue(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||q(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(Me.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...x,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,b=>{b.key==="Escape"&&(a==null||a(b.nativeEvent),b.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:ue(e.onPointerDown,b=>{b.button===0&&(_.current={x:b.clientX,y:b.clientY})}),onPointerMove:ue(e.onPointerMove,b=>{if(!_.current)return;const W=b.clientX-_.current.x,te=b.clientY-_.current.y,$=!!C.current,Z=["left","right"].includes(v.swipeDirection),I=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,Q=Z?I(0,W):0,z=Z?0:I(0,te),V=b.pointerType==="touch"?10:2,de={x:Q,y:z},ne={originalEvent:b,delta:de};$?(C.current=de,ou(S3,f,ne,{discrete:!1})):nx(de,v.swipeDirection,V)?(C.current=de,ou(b3,d,ne,{discrete:!1}),b.target.setPointerCapture(b.pointerId)):(Math.abs(W)>V||Math.abs(te)>V)&&(_.current=null)}),onPointerUp:ue(e.onPointerUp,b=>{const W=C.current,te=b.target;if(te.hasPointerCapture(b.pointerId)&&te.releasePointerCapture(b.pointerId),C.current=null,_.current=null,W){const $=b.currentTarget,Z={originalEvent:b,delta:W};nx(W,v.swipeDirection,v.swipeThreshold)?ou(C3,m,Z,{discrete:!0}):ou(k3,p,Z,{discrete:!0}),$.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),R3=e=>{const{__scopeToast:t,children:r,...n}=e,s=kf(Cf,t),[o,i]=y.useState(!1),[a,l]=y.useState(!1);return D3(()=>i(!0)),y.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(lc,{asChild:!0,children:u.jsx(xc,{...n,children:o&&u.jsxs(u.Fragment,{children:[s.label," ",r]})})})},j3="ToastTitle",tC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});tC.displayName=j3;var P3="ToastDescription",rC=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(Me.div,{...n,ref:t})});rC.displayName=P3;var nC="ToastAction",sC=y.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?u.jsx(iC,{altText:r,asChild:!0,children:u.jsx(_v,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${nC}\`. Expected non-empty \`string\`.`),null)});sC.displayName=nC;var oC="ToastClose",_v=y.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=T3(oC,r);return u.jsx(iC,{asChild:!0,children:u.jsx(Me.button,{type:"button",...n,ref:t,onClick:ue(e.onClick,s.onClose)})})});_v.displayName=oC;var iC=y.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return u.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function aC(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),O3(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...aC(n))}}),t}function ou(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?vg(s,o):s.dispatchEvent(o)}var nx=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function D3(e=()=>{}){const t=Pt(e);nr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function O3(e){return e.nodeType===e.ELEMENT_NODE}function A3(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function jh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var M3=qk,lC=Qk,cC=eC,uC=tC,dC=rC,fC=sC,hC=_v;const I3=M3,pC=y.forwardRef(({className:e,...t},r)=>u.jsx(lC,{ref:r,className:ve("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));pC.displayName=lC.displayName;const L3=ic("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all 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-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out 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",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),mC=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx(cC,{ref:n,className:ve(L3({variant:t}),e),...r}));mC.displayName=cC.displayName;const F3=y.forwardRef(({className:e,...t},r)=>u.jsx(fC,{ref:r,className:ve("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));F3.displayName=fC.displayName;const gC=y.forwardRef(({className:e,...t},r)=>u.jsx(hC,{ref:r,className:ve("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(pg,{className:"h-4 w-4"})}));gC.displayName=hC.displayName;const vC=y.forwardRef(({className:e,...t},r)=>u.jsx(uC,{ref:r,className:ve("text-sm font-semibold",e),...t}));vC.displayName=uC.displayName;const yC=y.forwardRef(({className:e,...t},r)=>u.jsx(dC,{ref:r,className:ve("text-sm opacity-90",e),...t}));yC.displayName=dC.displayName;const z3=1,U3=1e6;let Ph=0;function V3(){return Ph=(Ph+1)%Number.MAX_SAFE_INTEGER,Ph.toString()}const Dh=new Map,sx=e=>{if(Dh.has(e))return;const t=setTimeout(()=>{Dh.delete(e),sl({type:"REMOVE_TOAST",toastId:e})},U3);Dh.set(e,t)},W3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,z3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?sx(r):e.toasts.forEach(n=>{sx(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Tu=[];let Nu={toasts:[]};function sl(e){Nu=W3(Nu,e),Tu.forEach(t=>{t(Nu)})}function $3({...e}){const t=V3(),r=s=>sl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>sl({type:"DISMISS_TOAST",toastId:t});return sl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Ef(){const[e,t]=y.useState(Nu);return y.useEffect(()=>(Tu.push(t),()=>{const r=Tu.indexOf(t);r>-1&&Tu.splice(r,1)}),[e]),{...e,toast:$3,dismiss:r=>sl({type:"DISMISS_TOAST",toastId:r})}}function bv(){const{toasts:e}=Ef();return u.jsxs(I3,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return u.jsxs(mC,{...o,children:[u.jsxs("div",{className:"grid gap-1",children:[r&&u.jsx(vC,{children:r}),n&&u.jsx(yC,{children:n})]}),s,u.jsx(gC,{})]},t)}),u.jsx(pC,{})]})}var[Tf,lU]=Xr("Tooltip",[ma]),Nf=ma(),xC="TooltipProvider",B3=700,Jp="tooltip.open",[H3,Sv]=Tf(xC),wC=e=>{const{__scopeTooltip:t,delayDuration:r=B3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=y.useState(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),u.jsx(H3,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};wC.displayName=xC;var Rf="Tooltip",[Y3,jf]=Tf(Rf),_C=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=Sv(Rf,e.__scopeTooltip),c=Nf(t),[d,f]=y.useState(null),p=On(),m=y.useRef(0),x=i??l.disableHoverableContent,v=a??l.delayDuration,w=y.useRef(!1),[h=!1,g]=oo({prop:n,defaultProp:s,onChange:j=>{j?(l.onOpen(),document.dispatchEvent(new CustomEvent(Jp))):l.onClose(),o==null||o(j)}}),_=y.useMemo(()=>h?w.current?"delayed-open":"instant-open":"closed",[h]),C=y.useCallback(()=>{window.clearTimeout(m.current),w.current=!1,g(!0)},[g]),T=y.useCallback(()=>{window.clearTimeout(m.current),g(!1)},[g]),E=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,g(!0)},v)},[v,g]);return y.useEffect(()=>()=>window.clearTimeout(m.current),[]),u.jsx(Tg,{...c,children:u.jsx(Y3,{scope:t,contentId:p,open:h,stateAttribute:_,trigger:d,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?E():C()},[l.isOpenDelayed,E,C]),onTriggerLeave:y.useCallback(()=>{x?T():window.clearTimeout(m.current)},[T,x]),onOpen:C,onClose:T,disableHoverableContent:x,children:r})})};_C.displayName=Rf;var em="TooltipTrigger",bC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=jf(em,r),o=Sv(em,r),i=Nf(r),a=y.useRef(null),l=Xe(t,a,s.onTriggerChange),c=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(Ng,{asChild:!0,...i,children:u.jsx(Me.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:ue(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ue(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:ue(e.onBlur,s.onClose),onClick:ue(e.onClick,s.onClose)})})});bC.displayName=em;var Z3="TooltipPortal",[cU,K3]=Tf(Z3,{forceMount:void 0}),ta="TooltipContent",kv=y.forwardRef((e,t)=>{const r=K3(ta,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=jf(ta,e.__scopeTooltip);return u.jsx(Cr,{present:n||i.open,children:i.disableHoverableContent?u.jsx(SC,{side:s,...o,ref:t}):u.jsx(G3,{side:s,...o,ref:t})})}),G3=y.forwardRef((e,t)=>{const r=jf(ta,e.__scopeTooltip),n=Sv(ta,e.__scopeTooltip),s=y.useRef(null),o=Xe(t,s),[i,a]=y.useState(null),{trigger:l,onClose:c}=r,d=s.current,{onPointerInTransitChange:f}=n,p=y.useCallback(()=>{a(null),f(!1)},[f]),m=y.useCallback((x,v)=>{const w=x.currentTarget,h={x:x.clientX,y:x.clientY},g=J3(h,w.getBoundingClientRect()),_=e5(h,g),C=t5(v.getBoundingClientRect()),T=n5([..._,...C]);a(T),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(l&&d){const x=w=>m(w,d),v=w=>m(w,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",v)}}},[l,d,m,p]),y.useEffect(()=>{if(i){const x=v=>{const w=v.target,h={x:v.clientX,y:v.clientY},g=(l==null?void 0:l.contains(w))||(d==null?void 0:d.contains(w)),_=!r5(h,i);g?p():_&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,i,c,p]),u.jsx(SC,{...e,ref:o})}),[q3,X3]=Tf(Rf,{isInside:!1}),SC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=jf(ta,r),c=Nf(r),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(Jp,d),()=>document.removeEventListener(Jp,d)),[d]),y.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Rg,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(mg,{children:n}),u.jsx(q3,{scope:r,isInside:!0,children:u.jsx(v3,{id:l.contentId,role:"tooltip",children:s||n})})]})})});kv.displayName=ta;var kC="TooltipArrow",Q3=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Nf(r);return X3(kC,r).isInside?null:u.jsx(jg,{...s,...n,ref:t})});Q3.displayName=kC;function J3(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function e5(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function t5(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function r5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;on!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function n5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),s5(t)}function s5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var o5=_C,i5=bC,CC=kv;const a5=o5,l5=i5,c5=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(CC,{ref:n,sideOffset:t,className:ve("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));c5.displayName=CC.displayName;function iu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var EC={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -250,5 +250,5 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,o){function i(c,d){if(!s[c]){if(!n[c]){var f=typeof iu=="function"&&iu;if(!d&&f)return f(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var m=s[c]={exports:{}};n[c][0].call(m.exports,function(w){var v=n[c][1][w];return i(v||w)},m,m.exports,r,n,s,o)}return s[c].exports}for(var a=typeof iu=="function"&&iu,l=0;l>2,m=(3&c)<<4|d>>4,w=1<_?(15&d)<<2|f>>6:64,v=2<_?63&f:64,x.push(a.charAt(p)+a.charAt(m)+a.charAt(w)+a.charAt(v));return x.join("")},s.decode=function(l){var c,d,f,p,m,w,v=0,x=0,h="data:";if(l.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var g,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(g=i.uint8array?new Uint8Array(0|_):new Array(0|_);v>4,d=(15&p)<<4|(m=a.indexOf(l.charAt(v++)))>>2,f=(3&m)<<6|(w=a.indexOf(l.charAt(v++))),g[x++]=c,m!==64&&(g[x++]=d),w!==64&&(g[x++]=f);return g}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,f,p,m,w){this.compressedSize=d,this.uncompressedSize=f,this.crc32=p,this.compression=m,this.compressedContent=w}c.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,f,p){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,d,f,p){var m=i,w=p+f;c^=-1;for(var v=p;v>>8^m[255&(c^d[v])];return-1^c}(0|l,a,a.length,0):function(c,d,f,p){var m=i,w=p+f;c^=-1;for(var v=p;v>>8^m[255&(c^d.charCodeAt(v))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=o?"uint8array":"array";function d(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}s.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(m,w){var v,x="";for(v=0;v>>=8;return x}function i(m,w,v,x,h,g){var _,C,T=m.file,E=m.compression,P=g!==c.utf8encode,O=a.transformTo("string",g(T.name)),j=a.transformTo("string",c.utf8encode(T.name)),L=T.comment,q=a.transformTo("string",g(L)),N=a.transformTo("string",c.utf8encode(L)),F=j.length!==T.name.length,b=N.length!==L.length,W="",te="",$="",Z=T.dir,I=T.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};w&&!v||(Q.crc32=m.crc32,Q.compressedSize=m.compressedSize,Q.uncompressedSize=m.uncompressedSize);var z=0;w&&(z|=8),P||!F&&!b||(z|=2048);var V=0,de=0;Z&&(V|=16),h==="UNIX"?(de=798,V|=function(se,Ee){var fe=se;return se||(fe=Ee?16893:33204),(65535&fe)<<16}(T.unixPermissions,Z)):(de=20,V|=function(se){return 63&(se||0)}(T.dosPermissions)),_=I.getUTCHours(),_<<=6,_|=I.getUTCMinutes(),_<<=5,_|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=o(1,1)+o(d(O),4)+j,W+="up"+o(te.length,2)+te),b&&($=o(1,1)+o(d(q),4)+N,W+="uc"+o($.length,2)+$);var ne="";return ne+=` -\0`,ne+=o(z,2),ne+=E.magic,ne+=o(_,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(O.length,2),ne+=o(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+O+W,dirRecord:f.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o(V,4)+o(x,4)+O+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),f=r("../signature");function p(m,w,v,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=v,this.encodeFileName=x,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(m){var w=m.meta.percent||0,v=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,l.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:v?(w+100*(v-x-1))/v:100}}))},p.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var w=this.streamFiles&&!m.file.dir;if(w){var v=i(m,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:v.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(m){this.accumulate=!1;var w=this.streamFiles&&!m.file.dir,v=i(m,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(v.dirRecord),w)this.push({data:function(x){return f.DATA_DESCRIPTOR+o(x.crc32,4)+o(x.compressedSize,4)+o(x.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:v.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var m=this.bytesWritten,w=0;w=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var p=o.getTypeOf(f);return o.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new c(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}i.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:i.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=i(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,i),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}i.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=o.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var l=0;l "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(w,v){return new d.Promise(function(x,h){var g=[],_=w._internalType,C=w._outputType,T=w._mimeType;w.on("data",function(E,P){g.push(E),v&&v(P)}).on("error",function(E){g=[],h(E)}).on("end",function(){try{var E=function(P,O,j){switch(P){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),j);case"base64":return l.encode(O);default:return o.transformTo(P,O)}}(C,function(P,O){var j,L=0,q=null,N=0;for(j=0;j"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(w){var v,x,h,g,_,C=w.length,T=0;for(g=0;g>>6:(x<65536?v[_++]=224|x>>>12:(v[_++]=240|x>>>18,v[_++]=128|x>>>12&63),v[_++]=128|x>>>6&63),v[_++]=128|63&x);return v}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(w){var v,x,h,g,_=w.length,C=new Array(2*_);for(v=x=0;v<_;)if((h=w[v++])<128)C[x++]=h;else if(4<(g=c[h]))C[x++]=65533,v+=g-1;else{for(h&=g===2?31:g===3?15:7;1>10&1023,C[x++]=56320|1023&h)}return C.length!==x&&(C.subarray?C=C.subarray(0,x):C.length=x),o.applyFromCharCode(C)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(f,l),f.prototype.processChunk=function(m){var w=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var v=w;(w=new Uint8Array(v.length+this.leftOver.length)).set(this.leftOver,0),w.set(v,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var x=function(g,_){var C;for((_=_||g.length)>g.length&&(_=g.length),C=_-1;0<=C&&(192&g[C])==128;)C--;return C<0||C===0?_:C+c[g[C]]>_?C:_}(w),h=w;x!==w.length&&(i.uint8array?(h=w.subarray(0,x),this.leftOver=w.subarray(x,w.length)):(h=w.slice(0,x),this.leftOver=w.slice(x,w.length))),this.push({data:s.utf8decode(h),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(p,l),p.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(v){return v}function d(v,x){for(var h=0;h>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var w,v,x,h=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?p[x++]=224|m>>>12:(p[x++]=240|m>>>18,p[x++]=128|m>>>12&63),p[x++]=128|m>>>6&63),p[x++]=128|63&m);return p},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var p=new o.Buf8(f.length),m=0,w=p.length;m>10&1023,g[w++]=56320|1023&v)}return d(g,w)},s.utf8border=function(f,p){var m;for((p=p||f.length)>f.length&&(p=f.length),m=p-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?p:m+l[f[m]]>p?m:p}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var c=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,c){var d=o,f=c+l;i^=-1;for(var p=c;p>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),f=0,p=4,m=0,w=-2,v=-1,x=4,h=2,g=8,_=9,C=286,T=30,E=19,P=2*C+1,O=15,j=3,L=258,q=L+j+1,N=42,F=113,b=1,W=2,te=3,$=4;function Z(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(G=k.avail_out),G!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,G,k.next_out),k.next_out+=G,J.pending_out+=G,k.total_out+=G,k.avail_out-=G,J.pending-=G,J.pending===0&&(J.pending_out=0))}function V(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var G,D,S=k.max_chain_length,R=k.strstart,A=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,Fe=H[R+A-1],De=H[R+A];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(G=J)+A]===De&&H[G+A-1]===Fe&&H[G]===H[R]&&H[++G]===H[R+1]){R+=2,G++;do;while(H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&H[++R]===H[++G]&&RM&&--S!=0);return A<=k.lookahead?A:k.lookahead}function Ee(k){var J,G,D,S,R,A,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=G=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--G;);for(J=G=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--G;);S+=ee}if(k.strm.avail_in===0)break;if(A=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=A.avail_in,H=j)for(R=k.strstart-k.insert,k.ins_h=k.window[R],k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-j),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=j){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=j&&(k.ins_h=(k.ins_h<=j&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-j,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-j),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(G=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Ee(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+G;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,V(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&(V(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===p?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new be(4,4,8,4,fe),new be(4,5,16,8,fe),new be(4,6,32,32,fe),new be(4,4,16,16,ge),new be(8,16,32,32,ge),new be(8,16,128,128,ge),new be(8,32,128,256,ge),new be(32,128,258,1024,ge),new be(32,258,258,4096,ge)],s.deflateInit=function(k,J){return rt(k,J,g,15,8,0)},s.deflateInit2=rt,s.deflateReset=Se,s.deflateResetKeep=Te,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?w:(k.state.gzhead=J,m):w},s.deflate=function(k,J){var G,D,S,R;if(!k||!k.state||5>8&255),de(D,D.gzhead.time>>16&255),de(D,D.gzhead.time>>24&255),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(de(D,255&D.gzhead.extra.length),de(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=c(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(de(D,0),de(D,0),de(D,0),de(D,0),de(D,0),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,3),D.status=F);else{var A=g+(D.w_bits-8<<4)<<8;A|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(A|=32),A+=31-A%31,D.status=F,ne(D,A),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)de(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){R=1;break}R=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),R===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){R=1;break}R=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),R===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(de(D,255&k.adler),de(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,m}else if(k.avail_in===0&&I(J)<=I(G)&&J!==p)return Z(k,-5);if(D.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==f&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Ee(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===p?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(D,J):D.strategy===3?function(M,H){for(var X,ee,he,Fe,De=M.window;;){if(M.lookahead<=L){if(Ee(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=j&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=j?(X=a._tr_tally(M,1,M.match_length-j),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===p?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==$||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),m;if(Y===W&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,m}return J!==p?m:D.wrap<=0?1:(D.wrap===2?(de(D,255&k.adler),de(D,k.adler>>8&255),de(D,k.adler>>16&255),de(D,k.adler>>24&255),de(D,255&k.total_in),de(D,k.total_in>>8&255),de(D,k.total_in>>16&255),de(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=G.w_size&&(R===0&&(Q(G.head),G.strstart=0,G.block_start=0,G.insert=0),H=new i.Buf8(G.w_size),i.arraySet(H,J,X-G.w_size,G.w_size,0),J=H,X=G.w_size),A=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Ee(G);G.lookahead>=j;){for(D=G.strstart,S=G.lookahead-(j-1);G.ins_h=(G.ins_h<>>=j=O>>>24,_-=j,(j=O>>>16&255)===0)W[d++]=65535&O;else{if(!(16&j)){if(!(64&j)){O=C[(65535&O)+(g&(1<>>=j,_-=j),_<15&&(g+=b[l++]<<_,_+=8,g+=b[l++]<<_,_+=8),O=T[g&P];r:for(;;){if(g>>>=j=O>>>24,_-=j,!(16&(j=O>>>16&255))){if(!(64&j)){O=T[(65535&O)+(g&(1<>>=j,_-=j,(j=d-f)>3,g&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(N){var F;return N&&N.state?(F=N.state,N.total_in=N.total_out=F.total=0,N.msg="",F.wrap&&(N.adler=1&F.wrap),F.mode=w,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(v),F.distcode=F.distdyn=new o.Buf32(x),F.sane=1,F.back=-1,p):m}function C(N){var F;return N&&N.state?((F=N.state).wsize=0,F.whave=0,F.wnext=0,_(N)):m}function T(N,F){var b,W;return N&&N.state?(W=N.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(o.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),o.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(o.arraySet($.window,F,b-W,W,0),$.wnext=W,$.whave=$.wsize):($.wnext+=te,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=te))),0}s.inflateReset=C,s.inflateReset2=T,s.inflateResetKeep=_,s.inflateInit=function(N){return E(N,15)},s.inflateInit2=E,s.inflate=function(N,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Ee,fe,ge,be,Pe,Te,Se,rt,k,J,G,D,S=0,R=new o.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return m;(b=N.state).mode===12&&(b.mode=13),Z=N.next_out,te=N.output,Q=N.avail_out,$=N.next_in,W=N.input,I=N.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=p;e:for(;;)switch(b.mode){case w:if(b.wrap===0){b.mode=13;break}for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,R,2,0),V=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",b.mode=30;break}if(V-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){N.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(R[0]=255&z,R[1]=z>>>8&255,b.check=a(b.check,R,2,0)),V=z=0,b.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>8&255,R[2]=z>>>16&255,R[3]=z>>>24&255,b.check=a(b.check,R,4,0)),V=z=0,b.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>8),512&b.flags&&(R[0]=255&z,R[1]=z>>>8&255,b.check=a(b.check,R,2,0)),V=z=0,b.mode=5;case 5:if(1024&b.flags){for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,R,2,0)),V=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,W,$,se,k)),512&b.flags&&(b.check=a(b.check,W,se,$)),I-=se,$+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=W[$+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),N.adler=b.check=0,b.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>=7&V,V-=7&V,b.mode=27;break}for(;V<3;){if(I===0)break e;I--,z+=W[$++]<>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,V-=2;break e;case 2:b.mode=17;break;case 3:N.msg="invalid block type",b.mode=30}z>>>=2,V-=2;break;case 14:for(z>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,z+=W[$++]<>>16^65535)){N.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,V=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,V-=5,b.ndist=1+(31&z),z>>>=5,V-=5,b.ncode=4+(15&z),z>>>=4,V-=4,286>>=3,V-=3}for(;b.have<19;)b.lens[A[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,G={bits:b.lenbits},J=c(0,b.lens,0,19,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ge,V-=ge,b.lens[b.have++]=Pe;else{if(Pe===16){for(D=ge+2;V>>=ge,V-=ge,b.have===0){N.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,V-=2}else if(Pe===17){for(D=ge+3;V>>=ge)),z>>>=3,V-=3}else{for(D=ge+7;V>>=ge)),z>>>=7,V-=7}if(b.have+se>b.nlen+b.ndist){N.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){N.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,G={bits:b.lenbits},J=c(d,b.lens,0,b.nlen,b.lencode,0,b.work,G),b.lenbits=G.bits,J){N.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,G={bits:b.distbits},J=c(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,G),b.distbits=G.bits,J){N.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){N.next_out=Z,N.avail_out=Q,N.next_in=$,N.avail_in=I,b.hold=z,b.bits=V,l(N,ne),Z=N.next_out,te=N.output,Q=N.avail_out,$=N.next_in,W=N.input,I=N.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=Te,V-=Te,b.back+=Te}if(z>>>=ge,V-=ge,b.back+=ge,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){N.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(D=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;be=(S=b.distcode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=Te,V-=Te,b.back+=Te}if(z>>>=ge,V-=ge,b.back+=ge,64&be){N.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(D=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){N.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){N.msg="invalid distance too far back",b.mode=30;break}Ee=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Ee=Z-b.offset,se=b.length;for(QP?(j=Ee[fe+x[F]],V[de+x[F]]):(j=96,0),g=1<>Z)+(_-=g)]=O<<24|j<<16|L|0,_!==0;);for(g=1<>=1;if(g!==0?(z&=g-1,z+=g):z=0,F++,--ne[N]==0){if(N===W)break;N=f[p+x[F]]}if(te>>7)]}function de(S,R){S.pending_buf[S.pending++]=255&R,S.pending_buf[S.pending++]=R>>>8&255}function ne(S,R,A){S.bi_valid>h-A?(S.bi_buf|=R<>h-S.bi_valid,S.bi_valid+=A-h):(S.bi_buf|=R<>>=1,A<<=1,0<--R;);return A>>>1}function fe(S,R,A){var Y,M,H=new Array(x+1),X=0;for(Y=1;Y<=x;Y++)H[Y]=X=X+A[Y-1]<<1;for(M=0;M<=R;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Ee(H[ee]++,ee))}}function ge(S){var R;for(R=0;R>1;1<=A;A--)Te(S,H,A);for(M=he;A=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Te(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=A,S.heap[--S.heap_max]=Y,H[2*M]=H[2*A]+H[2*Y],S.depth[M]=(S.depth[A]>=S.depth[Y]?S.depth[A]:S.depth[Y])+1,H[2*A+1]=H[2*Y+1]=M,S.heap[1]=M++,Te(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(De,kt){var Vr,$t,Bn,ot,Hn,Yn,Wr=kt.dyn_tree,Sc=kt.max_code,kc=kt.stat_desc.static_tree,ri=kt.stat_desc.has_stree,Cc=kt.stat_desc.extra_bits,ni=kt.stat_desc.extra_base,_n=kt.stat_desc.max_length,Ns=0;for(ot=0;ot<=x;ot++)De.bl_count[ot]=0;for(Wr[2*De.heap[De.heap_max]+1]=0,Vr=De.heap_max+1;Vr>=7;M>>=1)if(1&Fe&&ee.dyn_ltree[2*he]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=A+5,A+4<=M&&R!==-1?D(S,R,A,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Se(S,q,N)):(ne(S,4+(Y?1:0),3),function(ee,he,Fe,De){var kt;for(ne(ee,he-257,5),ne(ee,Fe-1,5),ne(ee,De-4,4),kt=0;kt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&R,S.pending_buf[S.l_buf+S.last_lit]=255&A,S.last_lit++,R===0?S.dyn_ltree[2*A]++:(S.matches++,R--,S.dyn_ltree[2*(b[A]+f+1)]++,S.dyn_dtree[2*V(R)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(R){R.bi_valid===16?(de(R,R.bi_buf),R.bi_buf=0,R.bi_valid=0):8<=R.bi_valid&&(R.pending_buf[R.pending++]=255&R.bi_buf,R.bi_buf>>=8,R.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,a){if(!i.setImmediate){var l,c,d,f,p=1,m={},w=!1,v=i.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(i);x=x&&x.setTimeout?x:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){g(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,T=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=T,C}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(f+C,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){g(C.data)},function(C){d.port2.postMessage(C)}):v&&"onreadystatechange"in v.createElement("script")?(c=v.documentElement,function(C){var T=v.createElement("script");T.onreadystatechange=function(){g(C),T.onreadystatechange=null,c.removeChild(T),T=null},c.appendChild(T)}):function(C){setTimeout(g,0,C)},x.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var T=new Array(arguments.length-1),E=0;E"u"?o===void 0?this:o:self)}).call(this,typeof Pc<"u"?Pc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(EC);var u5=EC.exports;const d5=pm(u5);function f5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const h5=async(e,t)=>{const r=new d5;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},Fl=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},p5=e=>Fl(e).split(" ")[0],m5=async e=>{let t=1;e.page&&(t=e.page);let r=2;return e.perPage&&(r=e.perPage),Dt().collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment"})},g5=async e=>await Dt().collection("domains").getOne(e),tm=async e=>e.id?await Dt().collection("domains").update(e.id,e):await Dt().collection("domains").create(e),v5=async e=>await Dt().collection("domains").delete(e),y5=(e,t)=>Dt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),w5=e=>{Dt().collection("domains").unsubscribe(e)},x5=()=>{const e=Ef(),t=Un(),r=zn(),n=new URLSearchParams(r.search),s=n.get("page"),[o,i]=y.useState(0),a=()=>{t("/edit")},l=h=>{n.set("page",h.toString()),t(`?${n.toString()}`)},c=h=>{t(`/edit?id=${h}`)},d=h=>{t(`/history?domain=${h}`)},f=async h=>{try{await v5(h),m(p.filter(g=>g.id!==h))}catch(g){console.error("Error deleting domain:",g)}},[p,m]=y.useState([]);y.useEffect(()=>{(async()=>{const g=await m5({page:s?Number(s):1,perPage:10});m(g.items),i(g.totalPages)})()},[s]);const w=async h=>{const g=p.filter(E=>E.id===h),_=g[0].enabled,C=g[0];C.enabled=!_,await tm(C);const T=p.map(E=>E.id===h?{...E,checked:!_}:E);m(T)},v=async h=>{try{w5(h.id),y5(h.id,g=>{console.log(g);const _=p.map(C=>C.id===g.id?{...g}:C);m(_)}),h.rightnow=!0,await tm(h),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:u.jsxs(u.Fragment,{children:["执行失败,请查看",u.jsx(Xn,{to:`/history?domain=${h.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},x=async h=>{const g=`${h.id}-${h.domain}.zip`,_=[{name:`${h.domain}.pem`,content:h.certificate?h.certificate:""},{name:`${h.domain}.key`,content:h.privateKey?h.privateKey:""}];await h5(g,_)};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(bv,{}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),u.jsx(xt,{onClick:a,children:"新增域名"})]}),p.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-40",children:"域名"}),u.jsx("div",{className:"w-48",children:"有效期限"}),u.jsx("div",{className:"w-32",children:"最近执行状态"}),u.jsx("div",{className:"w-64",children:"最近执行阶段"}),u.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),u.jsx("div",{className:"w-32",children:"是否启用"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),p.map(h=>{var g,_,C,T,E,P;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:h.domain}),u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx("div",{children:h.expiredAt?u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"有效期90天"}),u.jsxs("div",{children:[p5(h.expiredAt),"到期"]})]}):"---"})}),u.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((g=h.expand)!=null&&g.lastDeployment)?u.jsx(u.Fragment,{children:((_=h.expand.lastDeployment)==null?void 0:_.phase)==="deploy"&&((C=h.expand.lastDeployment)!=null&&C.phaseSuccess)?u.jsx(Q_,{size:16,className:"text-green-700"}):u.jsx(J_,{size:16,className:"text-red-700"})}):"---"}),u.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((T=h.expand)!=null&&T.lastDeployment)?u.jsx(ck,{phase:(E=h.expand.lastDeployment)==null?void 0:E.phase,phaseSuccess:(P=h.expand.lastDeployment)==null?void 0:P.phaseSuccess}):"---"}),u.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:h.lastDeployedAt?Fl(h.lastDeployedAt):"---"}),u.jsx("div",{className:"sm:w-32 flex items-center",children:u.jsx(xC,{children:u.jsxs(a5,{children:[u.jsx(l5,{children:u.jsx(Gk,{checked:h.enabled,onCheckedChange:()=>{w(h.id)}})}),u.jsx(kv,{children:u.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:h.enabled?"禁用":"启用"})})]})})}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(xt,{variant:"link",className:"p-0",onClick:()=>d(h.id),children:"部署历史"}),u.jsxs(rw,{when:!!h.enabled,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(xt,{variant:"link",className:"p-0",onClick:()=>v(h),children:"立即部署"})]}),u.jsxs(rw,{when:!!h.expiredAt,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(xt,{variant:"link",className:"p-0",onClick:()=>x(h),children:"下载"})]}),!h.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsxs(l3,{children:[u.jsx(c3,{asChild:!0,children:u.jsx(xt,{variant:"link",className:"p-0",children:"删除"})}),u.jsxs(Mk,{children:[u.jsxs(Ik,{children:[u.jsx(Fk,{children:"删除域名"}),u.jsx(zk,{children:"确定要删除域名吗?"})]}),u.jsxs(Lk,{children:[u.jsx(Vk,{children:"取消"}),u.jsx(Uk,{onClick:()=>{f(h.id)},children:"确认"})]})]})]}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(xt,{variant:"link",className:"p-0",onClick:()=>c(h.id),children:"编辑"})]})]})]},h.id)}),u.jsx(pk,{totalPages:o,currentPage:s?Number(s):1,onPageChange:h=>{l(h)}})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(Op,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),u.jsx(xt,{onClick:a,className:"mt-3",children:"添加域名"})]})})]})})},Je=y.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:ve("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Je.displayName="Input";var wc=e=>e.type==="checkbox",Pi=e=>e instanceof Date,fr=e=>e==null;const TC=e=>typeof e=="object";var Kt=e=>!fr(e)&&!Array.isArray(e)&&TC(e)&&!Pi(e),NC=e=>Kt(e)&&e.target?wc(e.target)?e.target.checked:e.target.value:e,_5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RC=(e,t)=>e.has(_5(t)),b5=e=>{const t=e.constructor&&e.constructor.prototype;return Kt(t)&&t.hasOwnProperty("isPrototypeOf")},Cv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Cv&&(e instanceof Blob||e instanceof FileList))&&(r||Kt(e)))if(t=r?[]:{},!r&&!b5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=wr(e[n]));else return e;return t}var jf=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,le=(e,t,r)=>{if(!t||!Kt(e))return r;const n=jf(t.split(/[,[\].]+?/)).reduce((s,o)=>fr(s)?s:s[o],e);return Lt(n)||n===e?Lt(e[t])?r:e[t]:n},Nn=e=>typeof e=="boolean",Ev=e=>/^\w*$/.test(e),PC=e=>jf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const s=Ev(t)?[t]:PC(t),o=s.length,i=o-1;for(;++net.useContext(jC),S5=e=>{const{children:t,...r}=e;return et.createElement(jC.Provider,{value:r},t)};var DC=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==an.all&&(t._proxyFormState[i]=!n||an.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>Kt(e)&&!Object.keys(e).length,OC=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||an.all))},nl=e=>Array.isArray(e)?e:[e],AC=(e,t,r)=>!e||!t||e===t||nl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Tv(e){const t=et.useRef(e);t.current=e,et.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function k5(e){const t=Df(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=et.useState(r._formState),l=et.useRef(!0),c=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=et.useRef(s);return d.current=s,Tv({disabled:n,next:f=>l.current&&AC(d.current,f.name,o)&&OC(f,c.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),et.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),DC(i,r,c.current,!1)}var Pn=e=>typeof e=="string",MC=(e,t,r,n,s)=>Pn(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),le(r,o))):(n&&(t.watchAll=!0),r);function C5(e){const t=Df(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=et.useRef(n);a.current=n,Tv({disabled:o,subject:r._subjects.values,next:d=>{AC(a.current,d.name,i)&&c(wr(MC(a.current,r._names,d.values||r._formValues,!1,s)))}});const[l,c]=et.useState(r._getWatch(n,s));return et.useEffect(()=>r._removeUnmounted()),l}function E5(e){const t=Df(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=RC(s._names.array,r),a=C5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=k5({control:s,name:r}),c=et.useRef(s.register(r,{...e.rules,value:a,...Nn(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(p,m)=>{const w=le(s._fields,p);w&&w._f&&(w._f.mount=m)};if(f(r,!0),d){const p=wr(le(s._options.defaultValues,r));ut(s._defaultValues,r,p),Lt(le(s._formValues,r))&&ut(s._formValues,r,p)}return()=>{(i?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,i,o]),et.useEffect(()=>{le(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:le(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...Nn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>c.current.onChange({target:{value:NC(d),name:r},type:yd.CHANGE}),[r]),onBlur:et.useCallback(()=>c.current.onBlur({target:{value:le(s._formValues,r),name:r},type:yd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(l.validatingFields,r)},error:{enumerable:!0,get:()=>le(l.errors,r)}})}}const T5=e=>e.render(E5(e));var IC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},ow=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched}),iw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const sl=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=le(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;sl(a,t)}else Kt(a)&&sl(a,t)}}};var N5=(e,t,r)=>{const n=nl(le(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},Nv=e=>e.type==="file",Bs=e=>typeof e=="function",wd=e=>{if(!Cv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ru=e=>Pn(e),Rv=e=>e.type==="radio",xd=e=>e instanceof RegExp;const aw={value:!1,isValid:!1},lw={value:!0,isValid:!0};var LC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?lw:{value:e[0].value,isValid:!0}:lw:aw}return aw};const cw={isValid:!1,value:null};var FC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,cw):cw;function uw(e,t,r="validate"){if(Ru(e)||Array.isArray(e)&&e.every(Ru)||Nn(e)&&!e)return{type:r,message:Ru(e)?e:"",ref:t}}var hi=e=>Kt(e)&&!xd(e)?e:{value:e,message:""},dw=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:d,max:f,pattern:p,validate:m,name:w,valueAsNumber:v,mount:x,disabled:h}=e._f,g=le(t,w);if(!x||h)return{};const _=i?i[0]:o,C=N=>{n&&_.reportValidity&&(_.setCustomValidity(Nn(N)?"":N||""),_.reportValidity())},T={},E=Rv(o),P=wc(o),O=E||P,j=(v||Nv(o))&&Lt(o.value)&&Lt(g)||wd(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,L=IC.bind(null,w,r,T),q=(N,F,b,W=qn.maxLength,te=qn.minLength)=>{const $=N?F:b;T[w]={type:N?W:te,message:$,ref:o,...L(N?W:te,$)}};if(s?!Array.isArray(g)||!g.length:a&&(!O&&(j||fr(g))||Nn(g)&&!g||P&&!LC(i).isValid||E&&!FC(i).isValid)){const{value:N,message:F}=Ru(a)?{value:!!a,message:a}:hi(a);if(N&&(T[w]={type:qn.required,message:F,ref:_,...L(qn.required,F)},!r))return C(F),T}if(!j&&(!fr(d)||!fr(f))){let N,F;const b=hi(f),W=hi(d);if(!fr(g)&&!isNaN(g)){const te=o.valueAsNumber||g&&+g;fr(b.value)||(N=te>b.value),fr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";Pn(b.value)&&g&&(N=Z?$(g)>$(b.value):I?g>b.value:te>new Date(b.value)),Pn(W.value)&&g&&(F=Z?$(g)<$(W.value):I?g+N.value,W=!fr(F.value)&&g.length<+F.value;if((b||W)&&(q(b,N.message,F.message),!r))return C(T[w].message),T}if(p&&!j&&Pn(g)){const{value:N,message:F}=hi(p);if(xd(N)&&!g.match(N)&&(T[w]={type:qn.pattern,message:F,ref:o,...L(qn.pattern,F)},!r))return C(F),T}if(m){if(Bs(m)){const N=await m(g,t),F=uw(N,_);if(F&&(T[w]={...F,...L(qn.validate,F.message)},!r))return C(F.message),T}else if(Kt(m)){let N={};for(const F in m){if(!Nr(N)&&!r)break;const b=uw(await m[F](g,t),_,F);b&&(N={...b,...L(F,b.message)},C(b.message),r&&(T[w]=N))}if(!Nr(N)&&(T[w]={ref:_,...N},!r))return T}}return C(!0),T};function R5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},_d=e=>fr(e)||!TC(e);function jo(e,t){if(_d(e)||_d(t))return e===t;if(Pi(e)&&Pi(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(Pi(o)&&Pi(i)||Kt(o)&&Kt(i)||Array.isArray(o)&&Array.isArray(i)?!jo(o,i):o!==i)return!1}}return!0}var zC=e=>e.type==="select-multiple",j5=e=>Rv(e)||wc(e),Ah=e=>wd(e)&&e.isConnected,UC=e=>{for(const t in e)if(Bs(e[t]))return!0;return!1};function bd(e,t={}){const r=Array.isArray(e);if(Kt(e)||r)for(const n in e)Array.isArray(e[n])||Kt(e[n])&&!UC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},bd(e[n],t[n])):fr(e[n])||(t[n]=!0);return t}function VC(e,t,r){const n=Array.isArray(e);if(Kt(e)||n)for(const s in e)Array.isArray(e[s])||Kt(e[s])&&!UC(e[s])?Lt(t)||_d(r[s])?r[s]=Array.isArray(e[s])?bd(e[s],[]):{...bd(e[s])}:VC(e[s],fr(t)?{}:t[s],r[s]):r[s]=!jo(e[s],t[s]);return r}var au=(e,t)=>VC(e,t,bd(t)),WC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Lt(e)?e:t?e===""?NaN:e&&+e:r&&Pn(e)?new Date(e):n?n(e):e;function Mh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Nv(t)?t.files:Rv(t)?FC(e.refs).value:zC(t)?[...t.selectedOptions].map(({value:r})=>r):wc(t)?LC(e.refs).value:WC(Lt(t.value)?e.ref.value:t.value,e)}var D5=(e,t,r,n)=>{const s={};for(const o of e){const i=le(t,o);i&&ut(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ia=e=>Lt(e)?e:xd(e)?e.source:Kt(e)?xd(e.value)?e.value.source:e.value:e,O5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function fw(e,t,r){const n=le(e,r);if(n||Ev(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=le(t,o),a=le(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var A5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,M5=(e,t)=>!jf(le(e,t)).length&&Bt(e,t);const I5={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function L5(e={}){let t={...I5,...e},r={submitCount:0,isDirty:!1,isLoading:Bs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Kt(t.defaultValues)||Kt(t.values)?wr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:wr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Oh(),array:Oh(),state:Oh()},p=ow(t.mode),m=ow(t.reValidateMode),w=t.criteriaMode===an.all,v=S=>R=>{clearTimeout(c),c=setTimeout(S,R)},x=async S=>{if(d.isValid||S){const R=t.resolver?Nr((await O()).errors):await L(n,!0);R!==r.isValid&&f.state.next({isValid:R})}},h=(S,R)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(A=>{A&&(R?ut(r.validatingFields,A,R):Bt(r.validatingFields,A))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},g=(S,R=[],A,Y,M=!0,H=!0)=>{if(Y&&A){if(i.action=!0,H&&Array.isArray(le(n,S))){const X=A(le(n,S),Y.argA,Y.argB);M&&ut(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=A(le(r.errors,S),Y.argA,Y.argB);M&&ut(r.errors,S,X),M5(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(le(r.touchedFields,S))){const X=A(le(r.touchedFields,S),Y.argA,Y.argB);M&&ut(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=au(s,o)),f.state.next({name:S,isDirty:N(S,R),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,S,R)},_=(S,R)=>{ut(r.errors,S,R),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},T=(S,R,A,Y)=>{const M=le(n,S);if(M){const H=le(o,S,Lt(A)?le(s,S):A);Lt(H)||Y&&Y.defaultChecked||R?ut(o,S,R?H:Mh(M._f)):W(S,H),i.mount&&x()}},E=(S,R,A,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(le(n,S)&&le(n,S)._f&&le(n,S)._f.disabled);if(!A||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=N(),H=X!==ee.isDirty);const Fe=he||jo(le(s,S),R);X=!!(!he&&le(r.dirtyFields,S)),Fe||he?Bt(r.dirtyFields,S):ut(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!Fe}if(A){const Fe=le(r.touchedFields,S);Fe||(ut(r.touchedFields,S,A),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&Fe!==A)}return H&&M&&f.state.next(ee),H?ee:{}},P=(S,R,A,Y)=>{const M=le(r.errors,S),H=d.isValid&&Nn(R)&&r.isValid!==R;if(e.delayError&&A?(l=v(()=>_(S,A)),l(e.delayError)):(clearTimeout(c),l=null,A?ut(r.errors,S,A):Bt(r.errors,S)),(A?!jo(M,A):M)||!Nr(Y)||H){const X={...Y,...H&&Nn(R)?{isValid:R}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},O=async S=>{h(S,!0);const R=await t.resolver(o,t.context,D5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return h(S),R},j=async S=>{const{errors:R}=await O(S);if(S)for(const A of S){const Y=le(R,A);Y?ut(r.errors,A,Y):Bt(r.errors,A)}else r.errors=R;return R},L=async(S,R,A={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);h([Y],!0);const he=await dw(M,o,w,t.shouldUseNativeValidation&&!R,ee);if(h([Y]),he[H.name]&&(A.valid=!1,R))break;!R&&(le(he,H.name)?ee?N5(r.errors,he,H.name):ut(r.errors,H.name,he[H.name]):Bt(r.errors,H.name))}X&&await L(X,R,A)}}return A.valid},q=()=>{for(const S of a.unMount){const R=le(n,S);R&&(R._f.refs?R._f.refs.every(A=>!Ah(A)):!Ah(R._f.ref))&&Ee(S)}a.unMount=new Set},N=(S,R)=>(S&&R&&ut(o,S,R),!jo(z(),s)),F=(S,R,A)=>MC(S,a,{...i.mount?o:Lt(R)?s:Pn(S)?{[S]:R}:R},A,R),b=S=>jf(le(i.mount?o:s,S,e.shouldUnregister?le(s,S,[]):[])),W=(S,R,A={})=>{const Y=le(n,S);let M=R;if(Y){const H=Y._f;H&&(!H.disabled&&ut(o,S,WC(R,H)),M=wd(H.ref)&&fr(R)?"":R,zC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?wc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):Nv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...o}})))}(A.shouldDirty||A.shouldTouch)&&E(S,M,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&Q(S)},te=(S,R,A)=>{for(const Y in R){const M=R[Y],H=`${S}.${Y}`,X=le(n,H);(a.array.has(S)||!_d(M)||X&&!X._f)&&!Pi(M)?te(H,M,A):W(H,M,A)}},$=(S,R,A={})=>{const Y=le(n,S),M=a.array.has(S),H=wr(R);ut(o,S,H),M?(f.array.next({name:S,values:{...o}}),(d.isDirty||d.dirtyFields)&&A.shouldDirty&&f.state.next({name:S,dirtyFields:au(s,o),isDirty:N(S,H)})):Y&&!Y._f&&!fr(H)?te(S,H,A):W(S,H,A),iw(S,a)&&f.state.next({...r}),f.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const R=S.target;let A=R.name,Y=!0;const M=le(n,A),H=()=>R.type?Mh(M._f):NC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(o,A,ee)};if(M){let ee,he;const Fe=H(),De=S.type===yd.BLUR||S.type===yd.FOCUS_OUT,kt=!O5(M._f)&&!t.resolver&&!le(r.errors,A)&&!M._f.deps||A5(De,le(r.touchedFields,A),r.isSubmitted,m,p),Vr=iw(A,a,De);ut(o,A,Fe),De?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const $t=E(A,Fe,De,!1),Bn=!Nr($t)||Vr;if(!De&&f.values.next({name:A,type:S.type,values:{...o}}),kt)return d.isValid&&x(),Bn&&f.state.next({name:A,...Vr?{}:$t});if(!De&&Vr&&f.state.next({...r}),t.resolver){const{errors:ot}=await O([A]);if(X(Fe),Y){const Hn=fw(r.errors,n,A),Yn=fw(ot,n,Hn.name||A);ee=Yn.error,A=Yn.name,he=Nr(ot)}}else h([A],!0),ee=(await dw(M,o,w,t.shouldUseNativeValidation))[A],h([A]),X(Fe),Y&&(ee?he=!1:d.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),P(A,he,ee,$t))}},I=(S,R)=>{if(le(r.errors,R)&&S.focus)return S.focus(),1},Q=async(S,R={})=>{let A,Y;const M=nl(S);if(t.resolver){const H=await j(Lt(S)?S:M);A=Nr(H),Y=S?!M.some(X=>le(H,X)):A}else S?(Y=(await Promise.all(M.map(async H=>{const X=le(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&x()):Y=A=await L(n);return f.state.next({...!Pn(S)||d.isValid&&A!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:A}:{},errors:r.errors}),R.shouldFocus&&!Y&&sl(n,I,S?M:a.mount),Y},z=S=>{const R={...i.mount?o:s};return Lt(S)?R:Pn(S)?le(R,S):S.map(A=>le(R,A))},V=(S,R)=>({invalid:!!le((R||r).errors,S),isDirty:!!le((R||r).dirtyFields,S),error:le((R||r).errors,S),isValidating:!!le(r.validatingFields,S),isTouched:!!le((R||r).touchedFields,S)}),de=S=>{S&&nl(S).forEach(R=>Bt(r.errors,R)),f.state.next({errors:S?r.errors:{}})},ne=(S,R,A)=>{const Y=(le(n,S,{_f:{}})._f||{}).ref,M=le(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;ut(r.errors,S,{...he,...R,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,R)=>Bs(S)?f.values.subscribe({next:A=>S(F(void 0,R),A)}):F(S,R,!0),Ee=(S,R={})=>{for(const A of S?nl(S):a.mount)a.mount.delete(A),a.array.delete(A),R.keepValue||(Bt(n,A),Bt(o,A)),!R.keepError&&Bt(r.errors,A),!R.keepDirty&&Bt(r.dirtyFields,A),!R.keepTouched&&Bt(r.touchedFields,A),!R.keepIsValidating&&Bt(r.validatingFields,A),!t.shouldUnregister&&!R.keepDefaultValue&&Bt(s,A);f.values.next({values:{...o}}),f.state.next({...r,...R.keepDirty?{isDirty:N()}:{}}),!R.keepIsValid&&x()},fe=({disabled:S,name:R,field:A,fields:Y,value:M})=>{if(Nn(S)&&i.mount||S){const H=S?void 0:Lt(M)?Mh(A?A._f:le(Y,R)._f):M;ut(o,R,H),E(R,H,!1,!1,!0)}},ge=(S,R={})=>{let A=le(n,S);const Y=Nn(R.disabled);return ut(n,S,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:S}},name:S,mount:!0,...R}}),a.mount.add(S),A?fe({field:A,disabled:R.disabled,name:S,value:R.value}):T(S,!0,R.value),{...Y?{disabled:R.disabled}:{},...t.progressive?{required:!!R.required,min:Ia(R.min),max:Ia(R.max),minLength:Ia(R.minLength),maxLength:Ia(R.maxLength),pattern:Ia(R.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ge(S,R),A=le(n,S);const H=Lt(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=j5(H),ee=A._f.refs||[];if(X?ee.find(he=>he===H):H===A._f.ref)return;ut(n,S,{_f:{...A._f,...X?{refs:[...ee.filter(Ah),H,...Array.isArray(le(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),T(S,!1,void 0,H)}else A=le(n,S,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(RC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&sl(n,I,a.mount),Pe=S=>{Nn(S)&&(f.state.next({disabled:S}),sl(n,(R,A)=>{const Y=le(n,A);Y&&(R.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Te=(S,R)=>async A=>{let Y;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let M=wr(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await O();r.errors=H,M=X}else await L(n);if(Bt(r.errors,"root"),Nr(r.errors)){f.state.next({errors:{}});try{await S(M,A)}catch(H){Y=H}}else R&&await R({...r.errors},A),be(),setTimeout(be);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Se=(S,R={})=>{le(n,S)&&(Lt(R.defaultValue)?$(S,wr(le(s,S))):($(S,R.defaultValue),ut(s,S,wr(R.defaultValue))),R.keepTouched||Bt(r.touchedFields,S),R.keepDirty||(Bt(r.dirtyFields,S),r.isDirty=R.defaultValue?N(S,wr(le(s,S))):N()),R.keepError||(Bt(r.errors,S),d.isValid&&x()),f.state.next({...r}))},rt=(S,R={})=>{const A=S?wr(S):s,Y=wr(A),M=Nr(S),H=M?s:Y;if(R.keepDefaultValues||(s=A),!R.keepValues){if(R.keepDirtyValues)for(const X of a.mount)le(r.dirtyFields,X)?ut(H,X,le(o,X)):$(X,le(H,X));else{if(Cv&&Lt(S))for(const X of a.mount){const ee=le(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(wd(he)){const Fe=he.closest("form");if(Fe){Fe.reset();break}}}}n={}}o=e.shouldUnregister?R.keepDefaultValues?wr(s):{}:wr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:R.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!R.keepIsValid||!!R.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:R.keepSubmitCount?r.submitCount:0,isDirty:M?!1:R.keepDirty?r.isDirty:!!(R.keepDefaultValues&&!jo(S,s)),isSubmitted:R.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:R.keepDirtyValues?R.keepDefaultValues&&o?au(s,o):r.dirtyFields:R.keepDefaultValues&&S?au(s,S):R.keepDirty?r.dirtyFields:{},touchedFields:R.keepTouched?r.touchedFields:{},errors:R.keepErrors?r.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,R)=>rt(Bs(S)?S(o):S,R);return{control:{register:ge,unregister:Ee,getFieldState:V,handleSubmit:Te,setError:ne,_executeSchema:O,_getWatch:F,_getDirty:N,_updateValid:x,_removeUnmounted:q,_updateFieldArray:g,_updateDisabledField:fe,_getFieldArray:b,_reset:rt,_resetDefaultValues:()=>Bs(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Pe,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ge,handleSubmit:Te,watch:se,setValue:$,getValues:z,reset:k,resetField:Se,clearErrors:de,unregister:Ee,setError:ne,setFocus:(S,R={})=>{const A=le(n,S),Y=A&&A._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),R.shouldSelect&&M.select())}},getFieldState:V}}function mo(e={}){const t=et.useRef(),r=et.useRef(),[n,s]=et.useState({isDirty:!1,isValidating:!1,isLoading:Bs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Bs(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...L5(e),formState:n});const o=t.current.control;return o._options=e,Tv({subject:o._subjects.state,next:i=>{OC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),et.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),et.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),et.useEffect(()=>{e.values&&!jo(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),et.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),et.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=DC(n,o),t.current}const hw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},$C=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?hw(n.ref,r,e):n.refs&&n.refs.forEach(s=>hw(s,r,e))}},F5=(e,t)=>{t.shouldUseNativeValidation&&$C(e,t);const r={};for(const n in e){const s=le(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(z5(t.names||Object.keys(e),n)){const i=Object.assign({},le(r,n));ut(i,"root",o),ut(r,n,i)}else ut(r,n,o)}return r},z5=(e,t)=>e.some(r=>r.startsWith(t+"."));var U5=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=IC(i,t,r,s,c?[].concat(c,n.message):n.message)}e.shift()}return r},go=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(c){return o.shouldUseNativeValidation&&$C({},o),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:F5(U5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},nt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(nt||(nt={}));var rm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(rm||(rm={}));const we=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},ie=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),V5=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ir extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ir.create=e=>new Ir(e);const ra=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===we.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let BC=ra;function W5(e){BC=e}function Sd(){return BC}const kd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},$5=[];function pe(e,t){const r=Sd(),n=kd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ra?void 0:ra].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Le;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Le;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const Le=Object.freeze({status:"aborted"}),ji=e=>({status:"dirty",value:e}),pr=e=>({status:"valid",value:e}),nm=e=>e.status==="aborted",sm=e=>e.status==="dirty",zl=e=>e.status==="valid",Ul=e=>typeof Promise<"u"&&e instanceof Promise;function Cd(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function HC(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));var $a,Ba;class Ln{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pw=(e,t)=>{if(zl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ir(e.common.issues);return this._error=r,this._error}}};function Ue(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var l,c;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}class Ge{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return zs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Ul(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},o=this._parseSync({data:t,path:s.path,parent:s});return pw(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:zs(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Ul(s)?s:Promise.resolve(s));return pw(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new yn({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return An.create(this,this._def)}nullable(){return co.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this,this._def)}promise(){return sa.create(this,this._def)}or(t){return Bl.create([this,t],this._def)}and(t){return Hl.create(this,t,this._def)}transform(t){return new yn({...Ue(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ql({...Ue(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new Pv({typeName:Ae.ZodBranded,type:this,...Ue(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Xl({...Ue(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return xc.create(this,t)}readonly(){return Ql.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const B5=/^c[^\s-]{8,}$/i,H5=/^[0-9a-z]+$/,Y5=/^[0-9A-HJKMNP-TV-Z]{26}$/,Z5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,G5=/^[a-z0-9_-]{21}$/i,K5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,q5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ih;const Q5=/^(?:(?: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])$/,J5=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ez=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YC="((\\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])))",tz=new RegExp(`^${YC}$`);function ZC(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function rz(e){return new RegExp(`^${ZC(e)}$`)}function GC(e){let t=`${YC}T${ZC(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function nz(e,t){return!!((t==="v4"||!t)&&Q5.test(e)||(t==="v6"||!t)&&J5.test(e))}class cn extends Ge{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:we.string,received:o.parsedType}),Le}const n=new cr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ie.invalid_string,...Ce.errToObj(n)})}_addCheck(t){return new cn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Ce.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ce.errToObj(r)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new cn({checks:[],typeName:Ae.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ue(e)})};function sz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class io extends Ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==we.number){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:we.number,received:o.parsedType}),Le}let n;const s=new cr;for(const o of this._def.checks)o.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?sz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_finite,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new io({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new io({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew io({checks:[],typeName:Ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class ao extends Ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==we.bigint){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:we.bigint,received:o.parsedType}),Le}let n;const s=new cr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new ao({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new ao({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new ao({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ue(e)})};class Vl extends Ge{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.boolean,received:n.parsedType}),Le}return pr(t.data)}}Vl.create=e=>new Vl({typeName:Ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ue(e)});class Yo extends Ge{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:we.date,received:o.parsedType}),Le}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),Le}const n=new cr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):nt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Yo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Yo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...Ue(e)});class Ed extends Ge{_parse(t){if(this._getType(t)!==we.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.symbol,received:n.parsedType}),Le}return pr(t.data)}}Ed.create=e=>new Ed({typeName:Ae.ZodSymbol,...Ue(e)});class Wl extends Ge{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.undefined,received:n.parsedType}),Le}return pr(t.data)}}Wl.create=e=>new Wl({typeName:Ae.ZodUndefined,...Ue(e)});class $l extends Ge{_parse(t){if(this._getType(t)!==we.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.null,received:n.parsedType}),Le}return pr(t.data)}}$l.create=e=>new $l({typeName:Ae.ZodNull,...Ue(e)});class na extends Ge{constructor(){super(...arguments),this._any=!0}_parse(t){return pr(t.data)}}na.create=e=>new na({typeName:Ae.ZodAny,...Ue(e)});class Mo extends Ge{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pr(t.data)}}Mo.create=e=>new Mo({typeName:Ae.ZodUnknown,...Ue(e)});class ws extends Ge{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:we.never,received:r.parsedType}),Le}}ws.create=e=>new ws({typeName:Ae.ZodNever,...Ue(e)});class Td extends Ge{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.void,received:n.parsedType}),Le}return pr(t.data)}}Td.create=e=>new Td({typeName:Ae.ZodVoid,...Ue(e)});class fn extends Ge{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==we.array)return pe(r,{code:ie.invalid_type,expected:we.array,received:r.parsedType}),Le;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(pe(r,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Ln(r,i,r.path,a)))).then(i=>cr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Ln(r,i,r.path,a)));return cr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:Ce.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:Ce.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:Ce.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Ue(t)});function mi(e){if(e instanceof Nt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=An.create(mi(n))}return new Nt({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:mi(e.element)}):e instanceof An?An.create(mi(e.unwrap())):e instanceof co?co.create(mi(e.unwrap())):e instanceof Fn?Fn.create(e.items.map(t=>mi(t))):e}class Nt extends Ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==we.object){const c=this._getOrReturnCtx(t);return pe(c,{code:ie.invalid_type,expected:we.object,received:c.parsedType}),Le}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ws&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const d=o[c],f=s.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Ln(s,f,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ws){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(c==="strict")a.length>0&&(pe(s,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Ln(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of l){const f=await d.key,p=await d.value;c.push({key:f,value:p,alwaysSet:d.alwaysSet})}return c}).then(c=>cr.mergeObjectSync(n,c)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Nt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Nt({...this._def,unknownKeys:"strip"})}passthrough(){return new Nt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Nt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Nt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Nt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Nt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Nt({...this._def,shape:()=>r})}deepPartial(){return mi(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Nt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof An;)o=o._def.innerType;r[n]=o}}),new Nt({...this._def,shape:()=>r})}keyof(){return KC(nt.objectKeys(this.shape))}}Nt.create=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strip",catchall:ws.create(),typeName:Ae.ZodObject,...Ue(t)});Nt.strictCreate=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strict",catchall:ws.create(),typeName:Ae.ZodObject,...Ue(t)});Nt.lazycreate=(e,t)=>new Nt({shape:e,unknownKeys:"strip",catchall:ws.create(),typeName:Ae.ZodObject,...Ue(t)});class Bl extends Ge{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Ir(a.ctx.common.issues));return pe(r,{code:ie.invalid_union,unionErrors:i}),Le}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Ir(l));return pe(r,{code:ie.invalid_union,unionErrors:a}),Le}}get options(){return this._def.options}}Bl.create=(e,t)=>new Bl({options:e,typeName:Ae.ZodUnion,...Ue(t)});const Qn=e=>e instanceof Zl?Qn(e.schema):e instanceof yn?Qn(e.innerType()):e instanceof Gl?[e.value]:e instanceof lo?e.options:e instanceof Kl?nt.objectValues(e.enum):e instanceof ql?Qn(e._def.innerType):e instanceof Wl?[void 0]:e instanceof $l?[null]:e instanceof An?[void 0,...Qn(e.unwrap())]:e instanceof co?[null,...Qn(e.unwrap())]:e instanceof Pv||e instanceof Ql?Qn(e.unwrap()):e instanceof Xl?Qn(e._def.innerType):[];class Of extends Ge{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.object)return pe(r,{code:ie.invalid_type,expected:we.object,received:r.parsedType}),Le;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Le)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=Qn(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Of({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Ue(n)})}}function om(e,t){const r=zs(e),n=zs(t);if(e===t)return{valid:!0,data:e};if(r===we.object&&n===we.object){const s=nt.objectKeys(t),o=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=om(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===we.array&&n===we.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(nm(o)||nm(i))return Le;const a=om(o.value,i.value);return a.valid?((sm(o)||sm(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),Le)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Hl.create=(e,t,r)=>new Hl({left:e,right:t,typeName:Ae.ZodIntersection,...Ue(r)});class Fn extends Ge{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.array)return pe(n,{code:ie.invalid_type,expected:we.array,received:n.parsedType}),Le;if(n.data.lengththis._def.items.length&&(pe(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ln(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>cr.mergeArray(r,i)):cr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Fn({...this._def,rest:t})}}Fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:e,typeName:Ae.ZodTuple,rest:null,...Ue(t)})};class Yl extends Ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.object)return pe(n,{code:ie.invalid_type,expected:we.object,received:n.parsedType}),Le;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Ln(n,a,n.path,a)),value:i._parse(new Ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ge?new Yl({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Ue(n)}):new Yl({keyType:cn.create(),valueType:t,typeName:Ae.ZodRecord,...Ue(r)})}}class Nd extends Ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.map)return pe(n,{code:ie.invalid_type,expected:we.map,received:n.parsedType}),Le;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],c)=>({key:s._parse(new Ln(n,a,n.path,[c,"key"])),value:o._parse(new Ln(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return Le;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return Le;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}}Nd.create=(e,t,r)=>new Nd({valueType:t,keyType:e,typeName:Ae.ZodMap,...Ue(r)});class Zo extends Ge{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.set)return pe(n,{code:ie.invalid_type,expected:we.set,received:n.parsedType}),Le;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(pe(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const d of l){if(d.status==="aborted")return Le;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>o._parse(new Ln(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Zo({...this._def,minSize:{value:t,message:Ce.toString(r)}})}max(t,r){return new Zo({...this._def,maxSize:{value:t,message:Ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Zo.create=(e,t)=>new Zo({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Ue(t)});class Yi extends Ge{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.function)return pe(r,{code:ie.invalid_type,expected:we.function,received:r.parsedType}),Le;function n(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),ra].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),ra].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof sa){const a=this;return pr(async function(...l){const c=new Ir([]),d=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(n(l,m)),c}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw c.addIssue(s(f,m)),c})})}else{const a=this;return pr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Ir([n(l,c.error)]);const d=Reflect.apply(i,this,c.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new Ir([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Yi({...this._def,args:Fn.create(t).rest(Mo.create())})}returns(t){return new Yi({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Yi({args:t||Fn.create([]).rest(Mo.create()),returns:r||Mo.create(),typeName:Ae.ZodFunction,...Ue(n)})}}class Zl extends Ge{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Zl.create=(e,t)=>new Zl({getter:e,typeName:Ae.ZodLazy,...Ue(t)});class Gl extends Ge{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Le}return{status:"valid",value:t.data}}get value(){return this._def.value}}Gl.create=(e,t)=>new Gl({value:e,typeName:Ae.ZodLiteral,...Ue(t)});function KC(e,t){return new lo({values:e,typeName:Ae.ZodEnum,...Ue(t)})}class lo extends Ge{constructor(){super(...arguments),$a.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:nt.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Le}if(Cd(this,$a)||HC(this,$a,new Set(this._def.values)),!Cd(this,$a).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Le}return pr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return lo.create(t,{...this._def,...r})}exclude(t,r=this._def){return lo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}$a=new WeakMap;lo.create=KC;class Kl extends Ge{constructor(){super(...arguments),Ba.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==we.string&&n.parsedType!==we.number){const s=nt.objectValues(r);return pe(n,{expected:nt.joinValues(s),received:n.parsedType,code:ie.invalid_type}),Le}if(Cd(this,Ba)||HC(this,Ba,new Set(nt.getValidEnumValues(this._def.values))),!Cd(this,Ba).has(t.data)){const s=nt.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),Le}return pr(t.data)}get enum(){return this._def.values}}Ba=new WeakMap;Kl.create=(e,t)=>new Kl({values:e,typeName:Ae.ZodNativeEnum,...Ue(t)});class sa extends Ge{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.promise&&r.common.async===!1)return pe(r,{code:ie.invalid_type,expected:we.promise,received:r.parsedType}),Le;const n=r.parsedType===we.promise?r.data:Promise.resolve(r.data);return pr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}sa.create=(e,t)=>new sa({type:e,typeName:Ae.ZodPromise,...Ue(t)});class yn extends Ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Le;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Le:l.status==="dirty"||r.value==="dirty"?ji(l.value):l});{if(r.value==="aborted")return Le;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Le:a.status==="dirty"||r.value==="dirty"?ji(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Le:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Le:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!zl(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>zl(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);nt.assertNever(s)}}yn.create=(e,t,r)=>new yn({schema:e,typeName:Ae.ZodEffects,effect:t,...Ue(r)});yn.createWithPreprocess=(e,t,r)=>new yn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Ue(r)});class An extends Ge{_parse(t){return this._getType(t)===we.undefined?pr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Ae.ZodOptional,...Ue(t)});class co extends Ge{_parse(t){return this._getType(t)===we.null?pr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}co.create=(e,t)=>new co({innerType:e,typeName:Ae.ZodNullable,...Ue(t)});class ql extends Ge{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===we.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ql.create=(e,t)=>new ql({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ue(t)});class Xl extends Ge{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ul(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ir(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ir(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Xl.create=(e,t)=>new Xl({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ue(t)});class Rd extends Ge{_parse(t){if(this._getType(t)!==we.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:we.nan,received:n.parsedType}),Le}return{status:"valid",value:t.data}}}Rd.create=e=>new Rd({typeName:Ae.ZodNaN,...Ue(e)});const oz=Symbol("zod_brand");class Pv extends Ge{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class xc extends Ge{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Le:o.status==="dirty"?(r.dirty(),ji(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Le:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new xc({in:t,out:r,typeName:Ae.ZodPipeline})}}class Ql extends Ge{_parse(t){const r=this._def.innerType._parse(t),n=s=>(zl(s)&&(s.value=Object.freeze(s.value)),s);return Ul(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Ql.create=(e,t)=>new Ql({innerType:e,typeName:Ae.ZodReadonly,...Ue(t)});function qC(e,t={},r){return e?na.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):na.create()}const iz={object:Nt.lazycreate};var Ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));const az=(e,t={message:`Input not instance of ${e.name}`})=>qC(r=>r instanceof e,t),XC=cn.create,QC=io.create,lz=Rd.create,cz=ao.create,JC=Vl.create,uz=Yo.create,dz=Ed.create,fz=Wl.create,hz=$l.create,pz=na.create,mz=Mo.create,gz=ws.create,vz=Td.create,yz=fn.create,wz=Nt.create,xz=Nt.strictCreate,_z=Bl.create,bz=Of.create,Sz=Hl.create,kz=Fn.create,Cz=Yl.create,Ez=Nd.create,Tz=Zo.create,Nz=Yi.create,Rz=Zl.create,Pz=Gl.create,jz=lo.create,Dz=Kl.create,Oz=sa.create,mw=yn.create,Az=An.create,Mz=co.create,Iz=yn.createWithPreprocess,Lz=xc.create,Fz=()=>XC().optional(),zz=()=>QC().optional(),Uz=()=>JC().optional(),Vz={string:e=>cn.create({...e,coerce:!0}),number:e=>io.create({...e,coerce:!0}),boolean:e=>Vl.create({...e,coerce:!0}),bigint:e=>ao.create({...e,coerce:!0}),date:e=>Yo.create({...e,coerce:!0})},Wz=Le;var Oe=Object.freeze({__proto__:null,defaultErrorMap:ra,setErrorMap:W5,getErrorMap:Sd,makeIssue:kd,EMPTY_PATH:$5,addIssueToContext:pe,ParseStatus:cr,INVALID:Le,DIRTY:ji,OK:pr,isAborted:nm,isDirty:sm,isValid:zl,isAsync:Ul,get util(){return nt},get objectUtil(){return rm},ZodParsedType:we,getParsedType:zs,ZodType:Ge,datetimeRegex:GC,ZodString:cn,ZodNumber:io,ZodBigInt:ao,ZodBoolean:Vl,ZodDate:Yo,ZodSymbol:Ed,ZodUndefined:Wl,ZodNull:$l,ZodAny:na,ZodUnknown:Mo,ZodNever:ws,ZodVoid:Td,ZodArray:fn,ZodObject:Nt,ZodUnion:Bl,ZodDiscriminatedUnion:Of,ZodIntersection:Hl,ZodTuple:Fn,ZodRecord:Yl,ZodMap:Nd,ZodSet:Zo,ZodFunction:Yi,ZodLazy:Zl,ZodLiteral:Gl,ZodEnum:lo,ZodNativeEnum:Kl,ZodPromise:sa,ZodEffects:yn,ZodTransformer:yn,ZodOptional:An,ZodNullable:co,ZodDefault:ql,ZodCatch:Xl,ZodNaN:Rd,BRAND:oz,ZodBranded:Pv,ZodPipeline:xc,ZodReadonly:Ql,custom:qC,Schema:Ge,ZodSchema:Ge,late:iz,get ZodFirstPartyTypeKind(){return Ae},coerce:Vz,any:pz,array:yz,bigint:cz,boolean:JC,date:uz,discriminatedUnion:bz,effect:mw,enum:jz,function:Nz,instanceof:az,intersection:Sz,lazy:Rz,literal:Pz,map:Ez,nan:lz,nativeEnum:Dz,never:gz,null:hz,nullable:Mz,number:QC,object:wz,oboolean:Uz,onumber:zz,optional:Az,ostring:Fz,pipeline:Lz,preprocess:Iz,promise:Oz,record:Cz,set:Tz,strictObject:xz,string:XC,symbol:dz,transformer:mw,tuple:kz,undefined:fz,union:_z,unknown:mz,void:vz,NEVER:Wz,ZodIssueCode:ie,quotelessJson:V5,ZodError:Ir}),$z="Label",eE=y.forwardRef((e,t)=>u.jsx(Me.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));eE.displayName=$z;var tE=eE;const Bz=sc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),jv=y.forwardRef(({className:e,...t},r)=>u.jsx(tE,{ref:r,className:ve(Bz(),e),...t}));jv.displayName=tE.displayName;const vo=S5,rE=y.createContext({}),qe=({...e})=>u.jsx(rE.Provider,{value:{name:e.name},children:u.jsx(T5,{...e})}),Af=()=>{const e=y.useContext(rE),t=y.useContext(nE),{getFieldState:r,formState:n}=Df(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},nE=y.createContext({}),He=y.forwardRef(({className:e,...t},r)=>{const n=y.useId();return u.jsx(nE.Provider,{value:{id:n},children:u.jsx("div",{ref:r,className:ve("space-y-2",e),...t})})});He.displayName="FormItem";const Ye=y.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Af();return u.jsx(jv,{ref:r,className:ve(n&&"text-destructive",e),htmlFor:s,...t})});Ye.displayName="FormLabel";const Ze=y.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Af();return u.jsx(ms,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});Ze.displayName="FormControl";const Hz=y.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Af();return u.jsx("p",{ref:r,id:n,className:ve("text-sm text-muted-foreground",e),...t})});Hz.displayName="FormDescription";const ze=y.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Af(),i=s?String(s==null?void 0:s.message):t;return i?u.jsx("p",{ref:n,id:o,className:ve("text-sm font-medium text-destructive",e),...r,children:i}):null});ze.displayName="FormMessage";function im(e,[t,r]){return Math.min(r,Math.max(t,e))}var Yz=[" ","Enter","ArrowUp","ArrowDown"],Zz=[" ","Enter"],_c="Select",[Mf,If,Gz]=tf(_c),[wa,cU]=Xr(_c,[Gz,ma]),Lf=ma(),[Kz,yo]=wa(_c),[qz,Xz]=wa(_c),sE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:p,required:m}=e,w=Lf(t),[v,x]=y.useState(null),[h,g]=y.useState(null),[_,C]=y.useState(!1),T=rf(c),[E=!1,P]=ro({prop:n,defaultProp:s,onChange:o}),[O,j]=ro({prop:i,defaultProp:a,onChange:l}),L=y.useRef(null),q=v?!!v.closest("form"):!0,[N,F]=y.useState(new Set),b=Array.from(N).map(W=>W.props.value).join(";");return u.jsx(Tg,{...w,children:u.jsxs(Kz,{required:m,scope:t,trigger:v,onTriggerChange:x,valueNode:h,onValueNodeChange:g,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:On(),value:O,onValueChange:j,open:E,onOpenChange:P,dir:T,triggerPointerDownPosRef:L,disabled:p,children:[u.jsx(Mf.Provider,{scope:t,children:u.jsx(qz,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:y.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?u.jsxs(PE,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:W=>j(W.target.value),disabled:p,children:[O===void 0?u.jsx("option",{value:""}):null,Array.from(N)]},b):null]})})};sE.displayName=_c;var oE="SelectTrigger",iE=y.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Lf(r),i=yo(oE,r),a=i.disabled||n,l=Ke(t,i.onTriggerChange),c=If(r),[d,f,p]=jE(w=>{const v=c().filter(g=>!g.disabled),x=v.find(g=>g.value===i.value),h=DE(v,w,x);h!==void 0&&i.onValueChange(h.value)}),m=()=>{a||(i.onOpenChange(!0),p())};return u.jsx(Ng,{asChild:!0,...o,children:u.jsx(Me.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,w=>{w.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,w=>{const v=w.target;v.hasPointerCapture(w.pointerId)&&v.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)},w.preventDefault())}),onKeyDown:ue(s.onKeyDown,w=>{const v=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&f(w.key),!(v&&w.key===" ")&&Yz.includes(w.key)&&(m(),w.preventDefault())})})})});iE.displayName=oE;var aE="SelectValue",lE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=yo(aE,r),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=Ke(t,l.onValueNodeChange);return nr(()=>{c(d)},[c,d]),u.jsx(Me.span,{...a,ref:f,style:{pointerEvents:"none"},children:RE(l.value)?u.jsx(u.Fragment,{children:i}):o})});lE.displayName=aE;var Qz="SelectIcon",cE=y.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return u.jsx(Me.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});cE.displayName=Qz;var Jz="SelectPortal",uE=e=>u.jsx(ic,{asChild:!0,...e});uE.displayName=Jz;var Go="SelectContent",dE=y.forwardRef((e,t)=>{const r=yo(Go,e.__scopeSelect),[n,s]=y.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?_s.createPortal(u.jsx(fE,{scope:e.__scopeSelect,children:u.jsx(Mf.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(hE,{...e,ref:t})});dE.displayName=Go;var ts=10,[fE,wo]=wa(Go),e6="SelectContentImpl",hE=y.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:v,avoidCollisions:x,...h}=e,g=yo(Go,r),[_,C]=y.useState(null),[T,E]=y.useState(null),P=Ke(t,fe=>C(fe)),[O,j]=y.useState(null),[L,q]=y.useState(null),N=If(r),[F,b]=y.useState(!1),W=y.useRef(!1);y.useEffect(()=>{if(_)return jg(_)},[_]),yg();const te=y.useCallback(fe=>{const[ge,...be]=N().map(Se=>Se.ref.current),[Pe]=be.slice(-1),Te=document.activeElement;for(const Se of fe)if(Se===Te||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&T&&(T.scrollTop=0),Se===Pe&&T&&(T.scrollTop=T.scrollHeight),Se==null||Se.focus(),document.activeElement!==Te))return},[N,T]),$=y.useCallback(()=>te([O,_]),[te,O,_]);y.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=g;y.useEffect(()=>{if(_){let fe={x:0,y:0};const ge=Pe=>{var Te,Se;fe={x:Math.abs(Math.round(Pe.pageX)-(((Te=I.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((Se=I.current)==null?void 0:Se.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ge),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),y.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=jE(fe=>{const ge=N().filter(Te=>!Te.disabled),be=ge.find(Te=>Te.ref.current===document.activeElement),Pe=DE(ge,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),V=y.useCallback((fe,ge,be)=>{const Pe=!W.current&&!be;(g.value!==void 0&&g.value===ge||Pe)&&(j(fe),Pe&&(W.current=!0))},[g.value]),de=y.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=y.useCallback((fe,ge,be)=>{const Pe=!W.current&&!be;(g.value!==void 0&&g.value===ge||Pe)&&q(fe)},[g.value]),se=n==="popper"?am:pE,Ee=se===am?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:v,avoidCollisions:x}:{};return u.jsx(fE,{scope:r,content:_,viewport:T,onViewportChange:E,itemRefCallback:V,selectedItem:O,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:u.jsx(cf,{as:ms,allowPinchZoom:!0,children:u.jsx(nf,{asChild:!0,trapped:g.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ge;(ge=g.trigger)==null||ge.focus({preventScroll:!0}),fe.preventDefault()}),children:u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:u.jsx(se,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:fe=>fe.preventDefault(),...h,...Ee,onPlaced:()=>b(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:ue(h.onKeyDown,fe=>{const ge=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ge&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Pe=N().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Te=fe.target,Se=Pe.indexOf(Te);Pe=Pe.slice(Se+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});hE.displayName=e6;var t6="SelectItemAlignedPosition",pE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=yo(Go,r),i=wo(Go,r),[a,l]=y.useState(null),[c,d]=y.useState(null),f=Ke(t,P=>d(P)),p=If(r),m=y.useRef(!1),w=y.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:h,focusSelectedItem:g}=i,_=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&v&&x&&h){const P=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),L=h.getBoundingClientRect();if(o.dir!=="rtl"){const Te=L.left-O.left,Se=j.left-Te,rt=P.left-Se,k=P.width+rt,J=Math.max(k,O.width),G=window.innerWidth-ts,D=im(Se,[ts,G-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Te=O.right-L.right,Se=window.innerWidth-j.right-Te,rt=window.innerWidth-P.right-Se,k=P.width+rt,J=Math.max(k,O.width),G=window.innerWidth-ts,D=im(Se,[ts,G-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=p(),N=window.innerHeight-ts*2,F=v.scrollHeight,b=window.getComputedStyle(c),W=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),$=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=W+te+F+Z+$,Q=Math.min(x.offsetHeight*5,I),z=window.getComputedStyle(v),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=P.top+P.height/2-ts,se=N-ne,Ee=x.offsetHeight/2,fe=x.offsetTop+Ee,ge=W+te+fe,be=I-ge;if(ge<=ne){const Te=x===q[q.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-v.offsetTop-v.offsetHeight,rt=Math.max(se,Ee+(Te?de:0)+Se+$),k=ge+rt;a.style.height=k+"px"}else{const Te=x===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+v.offsetTop+(Te?V:0)+Ee)+be;a.style.height=rt+"px",v.scrollTop=ge-ne+v.offsetTop}a.style.margin=`${ts}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,v,x,h,o.dir,n]);nr(()=>_(),[_]);const[C,T]=y.useState();nr(()=>{c&&T(window.getComputedStyle(c).zIndex)},[c]);const E=y.useCallback(P=>{P&&w.current===!0&&(_(),g==null||g(),w.current=!1)},[_,g]);return u.jsx(n6,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:u.jsx(Me.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});pE.displayName=t6;var r6="SelectPopperPosition",am=y.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ts,...o}=e,i=Lf(r);return u.jsx(Rg,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});am.displayName=r6;var[n6,Dv]=wa(Go,{}),lm="SelectViewport",mE=y.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=wo(lm,r),i=Dv(lm,r),a=Ke(t,o.onViewportChange),l=y.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),u.jsx(Mf.Slot,{scope:r,children:u.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const m=Math.abs(l.current-d.scrollTop);if(m>0){const w=window.innerHeight-ts*2,v=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),h=Math.max(v,x);if(h0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});mE.displayName=lm;var gE="SelectGroup",[s6,o6]=wa(gE),vE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=On();return u.jsx(s6,{scope:r,id:s,children:u.jsx(Me.div,{role:"group","aria-labelledby":s,...n,ref:t})})});vE.displayName=gE;var yE="SelectLabel",wE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=o6(yE,r);return u.jsx(Me.div,{id:s.id,...n,ref:t})});wE.displayName=yE;var Pd="SelectItem",[i6,xE]=wa(Pd),_E=y.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=yo(Pd,r),l=wo(Pd,r),c=a.value===n,[d,f]=y.useState(o??""),[p,m]=y.useState(!1),w=Ke(t,h=>{var g;return(g=l.itemRefCallback)==null?void 0:g.call(l,h,n,s)}),v=On(),x=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(i6,{scope:r,value:n,disabled:s,textId:v,isSelected:c,onItemTextChange:y.useCallback(h=>{f(g=>g||((h==null?void 0:h.textContent)??"").trim())},[]),children:u.jsx(Mf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:u.jsx(Me.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:w,onFocus:ue(i.onFocus,()=>m(!0)),onBlur:ue(i.onBlur,()=>m(!1)),onPointerUp:ue(i.onPointerUp,x),onPointerMove:ue(i.onPointerMove,h=>{var g;s?(g=l.onItemLeave)==null||g.call(l):h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,h=>{var g;h.currentTarget===document.activeElement&&((g=l.onItemLeave)==null||g.call(l))}),onKeyDown:ue(i.onKeyDown,h=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&h.key===" "||(Zz.includes(h.key)&&x(),h.key===" "&&h.preventDefault())})})})})});_E.displayName=Pd;var Ha="SelectItemText",bE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=yo(Ha,r),a=wo(Ha,r),l=xE(Ha,r),c=Xz(Ha,r),[d,f]=y.useState(null),p=Ke(t,h=>f(h),l.onItemTextChange,h=>{var g;return(g=a.itemTextRefCallback)==null?void 0:g.call(a,h,l.value,l.disabled)}),m=d==null?void 0:d.textContent,w=y.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=c;return nr(()=>(v(w),()=>x(w)),[v,x,w]),u.jsxs(u.Fragment,{children:[u.jsx(Me.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?_s.createPortal(o.children,i.valueNode):null]})});bE.displayName=Ha;var SE="SelectItemIndicator",kE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return xE(SE,r).isSelected?u.jsx(Me.span,{"aria-hidden":!0,...n,ref:t}):null});kE.displayName=SE;var cm="SelectScrollUpButton",CE=y.forwardRef((e,t)=>{const r=wo(cm,e.__scopeSelect),n=Dv(cm,e.__scopeSelect),[s,o]=y.useState(!1),i=Ke(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(TE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});CE.displayName=cm;var um="SelectScrollDownButton",EE=y.forwardRef((e,t)=>{const r=wo(um,e.__scopeSelect),n=Dv(um,e.__scopeSelect),[s,o]=y.useState(!1),i=Ke(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(TE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});EE.displayName=um;var TE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=wo("SelectScrollButton",r),i=y.useRef(null),a=If(r),l=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),nr(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(Me.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),a6="SelectSeparator",NE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(Me.div,{"aria-hidden":!0,...n,ref:t})});NE.displayName=a6;var dm="SelectArrow",l6=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Lf(r),o=yo(dm,r),i=wo(dm,r);return o.open&&i.position==="popper"?u.jsx(Pg,{...s,...n,ref:t}):null});l6.displayName=dm;function RE(e){return e===""||e===void 0}var PE=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=y.useRef(null),o=Ke(t,s),i=Wk(r);return y.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[i,r]),u.jsx(yc,{asChild:!0,children:u.jsx("select",{...n,ref:o,defaultValue:r})})});PE.displayName="BubbleSelect";function jE(e){const t=jt(e),r=y.useRef(""),n=y.useRef(0),s=y.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=y.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function DE(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=c6(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function c6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var u6=sE,OE=iE,d6=lE,f6=cE,h6=uE,AE=dE,p6=mE,m6=vE,ME=wE,IE=_E,g6=bE,v6=kE,LE=CE,FE=EE,zE=NE;const Pu=u6,ju=m6,Du=d6,ol=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(OE,{ref:n,className:ve("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,u.jsx(f6,{asChild:!0,children:u.jsx(X_,{className:"h-4 w-4 opacity-50"})})]}));ol.displayName=OE.displayName;const UE=y.forwardRef(({className:e,...t},r)=>u.jsx(LE,{ref:r,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(RP,{className:"h-4 w-4"})}));UE.displayName=LE.displayName;const VE=y.forwardRef(({className:e,...t},r)=>u.jsx(FE,{ref:r,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(X_,{className:"h-4 w-4"})}));VE.displayName=FE.displayName;const il=y.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(h6,{children:u.jsxs(AE,{ref:s,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[u.jsx(UE,{}),u.jsx(p6,{className:ve("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(VE,{})]})}));il.displayName=AE.displayName;const al=y.forwardRef(({className:e,...t},r)=>u.jsx(ME,{ref:r,className:ve("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));al.displayName=ME.displayName;const ll=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(IE,{ref:n,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(v6,{children:u.jsx(q_,{className:"h-4 w-4"})})}),u.jsx(g6,{children:t})]}));ll.displayName=IE.displayName;const y6=y.forwardRef(({className:e,...t},r)=>u.jsx(zE,{ref:r,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));y6.displayName=zE.displayName;const fm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),w6=Array.from(fm.keys()),x6=Hg,_6=Yg,b6=Zg,WE=y.forwardRef(({className:e,...t},r)=>u.jsx(cc,{ref:r,className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));WE.displayName=cc.displayName;const $E=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(b6,{children:[u.jsx(WE,{}),u.jsxs(uc,{ref:n,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(pg,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$E.displayName=uc.displayName;const BE=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});BE.displayName="DialogHeader";const HE=y.forwardRef(({className:e,...t},r)=>u.jsx(dc,{ref:r,className:ve("text-lg font-semibold leading-none tracking-tight",e),...t}));HE.displayName=dc.displayName;const S6=y.forwardRef(({className:e,...t},r)=>u.jsx(fc,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));S6.displayName=fc.displayName;const Io=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),bc=Oe.union([Oe.literal("aliyun"),Oe.literal("tencent"),Oe.literal("ssh"),Oe.literal("webhook"),Oe.literal("cloudflare")],{message:"请选择云服务商"}),k6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ti(),s=Oe.object({id:Oe.string().optional(),name:Oe.string().min(1).max(64),configType:bc,secretId:Oe.string().min(1).max(64),secretKey:Oe.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=mo({resolver:go(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await vc(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(qe,{control:i.control,name:"name",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"名称"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入授权名称",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"id",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"secretId",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"SecretId"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入SecretId",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"secretKey",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"SecretKey"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入SecretKey",...l})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})})},C6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ti(),s=Oe.object({id:Oe.string().optional(),name:Oe.string().min(1).max(64),configType:bc,accessKeyId:Oe.string().min(1).max(64),accessSecretId:Oe.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=mo({resolver:go(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await vc(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})});return}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(qe,{control:i.control,name:"name",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"名称"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入授权名称",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"id",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"accessKeyId",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"AccessKeyId"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入AccessKeyId",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"accessSecretId",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"AccessKeySecret"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入AccessKeySecret",...l})}),u.jsx(ze,{})]})}),u.jsx(ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})})},YE=y.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:ve("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));YE.displayName="Textarea";const E6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ti(),s=Oe.object({id:Oe.string().optional(),name:Oe.string().min(1).max(64),configType:bc,host:Oe.string().ip({message:"请输入合法的IP地址"}),port:Oe.string().min(1).max(5),username:Oe.string().min(1).max(64),password:Oe.string().min(0).max(64),key:Oe.string().min(0).max(20480),keyFile:Oe.string().optional(),command:Oe.string().min(1).max(2048),certPath:Oe.string().min(0).max(2048),keyPath:Oe.string().min(0).max(2048)});let o={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(o=e.config);const i=mo({resolver:go(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:o.host,port:o.port,username:o.username,password:o.password,key:o.key,keyFile:o.keyFile,certPath:o.certPath,keyPath:o.keyPath,command:o.command}}),a=async c=>{console.log(c);const d={id:c.id,name:c.name,configType:c.configType,config:{host:c.host,port:c.port,username:c.username,password:c.password,key:c.key,command:c.command,certPath:c.certPath,keyPath:c.keyPath}};try{const f=await vc(d);if(t(),d.id=f.id,d.created=f.created,d.updated=f.updated,c.id){n(d);return}r(d)}catch(f){Object.entries(f.response.data).forEach(([m,w])=>{i.setError(m,{type:"manual",message:w.message})});return}},l=async c=>{var p;const d=(p=c.target.files)==null?void 0:p[0];if(!d)return;const f=await f5(d);i.setValue("key",f),i.setValue("keyFile","")};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...i,children:u.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-3",children:[u.jsx(qe,{control:i.control,name:"name",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"名称"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入授权名称",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"id",render:({field:c})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"configType",render:({field:c})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...c})}),u.jsx(ze,{})]})}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx(qe,{control:i.control,name:"host",render:({field:c})=>u.jsxs(He,{className:"grow",children:[u.jsx(Ye,{children:"服务器IP"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入Host",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"port",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"SSH端口"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入Port",...c,type:"number"})}),u.jsx(ze,{})]})})]}),u.jsx(qe,{control:i.control,name:"username",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"用户名"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入用户名",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"password",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"密码"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入密码",...c,type:"password"})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"key",render:({field:c})=>u.jsxs(He,{hidden:!0,children:[u.jsx(Ye,{children:"Key(使用证书登录)"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入Key",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"keyFile",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"Key(使用证书登录)"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入Key",...c,type:"file",onChange:l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"certPath",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"证书上传路径"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入证书上传路径",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"keyPath",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"私钥上传路径"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入私钥上传路径",...c})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"command",render:({field:c})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"Command"}),u.jsx(Ze,{children:u.jsx(YE,{placeholder:"请输入要执行的命令",...c})}),u.jsx(ze,{})]})}),u.jsx(ze,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})})},T6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ti(),s=Oe.object({id:Oe.string().optional(),name:Oe.string().min(1).max(64),configType:bc,url:Oe.string().url()});let o={url:""};e&&(o=e.config);const i=mo({resolver:go(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{url:l.url}};try{const d=await vc(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(qe,{control:i.control,name:"name",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"名称"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入授权名称",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"id",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"url",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"Webhook Url"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入Webhook Url",...l})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})})},N6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=ti(),s=Oe.object({id:Oe.string().optional(),name:Oe.string().min(1).max(64),configType:bc,dnsApiToken:Oe.string().min(1).max(64)});let o={dnsApiToken:""};e&&(o=e.config);const i=mo({resolver:go(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:o.dnsApiToken}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{dnsApiToken:l.dnsApiToken}};try{const d=await vc(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx(qe,{control:i.control,name:"name",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"名称"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入授权名称",...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"id",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(He,{className:"hidden",children:[u.jsx(Ye,{children:"配置类型"}),u.jsx(Ze,{children:u.jsx(Je,{...l})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:i.control,name:"dnsApiToken",render:({field:l})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"CLOUD_DNS_API_TOKEN"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})})};function cl({trigger:e,op:t,data:r,className:n}){const[s,o]=y.useState(!1),i=Array.from(Io.keys()),[a,l]=y.useState((r==null?void 0:r.configType)||"");let c=u.jsx(u.Fragment,{children:" "});switch(a){case"tencent":c=u.jsx(k6,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":c=u.jsx(C6,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":c=u.jsx(E6,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":c=u.jsx(T6,{data:r,onAfterReq:()=>{o(!1)}});break;case"cloudflare":c=u.jsx(N6,{data:r,onAfterReq:()=>{o(!1)}});break}const d=f=>f==a?"border-primary":"";return u.jsxs(x6,{onOpenChange:o,open:s,children:[u.jsx(_6,{asChild:!0,className:ve(n),children:e}),u.jsxs($E,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[u.jsx(BE,{children:u.jsxs(HE,{children:[t=="add"?"添加":"编辑","授权"]})}),u.jsxs("div",{className:"container",children:[u.jsx(jv,{children:"服务商"}),u.jsxs(Pu,{onValueChange:f=>{console.log(f),l(f)},children:[u.jsx(ol,{className:"mt-3",children:u.jsx(Du,{placeholder:"请选择服务商"})}),u.jsx(il,{children:u.jsxs(ju,{children:[u.jsx(al,{children:"服务商"}),i.map(f=>{var p,m;return u.jsx(ll,{value:f,children:u.jsxs("div",{className:ve("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[u.jsx("img",{src:(p=Io.get(f))==null?void 0:p[1],className:"h-6 w-6"}),u.jsx("div",{children:(m=Io.get(f))==null?void 0:m[0]})]})})})]})})]}),c]})]})]})}const R6=()=>{const{config:{accesses:e}}=ti(),[t,r]=y.useState(),n=zn();y.useEffect(()=>{const m=new URLSearchParams(n.search).get("id");m&&(async()=>{const v=await g5(m);r(v)})()},[n.search]);const s=Oe.object({id:Oe.string().optional(),domain:Oe.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Oe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Oe.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Oe.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=mo({resolver:go(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});y.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=y.useState(t?t.targetType:""),l=e.filter(p=>{if(i=="")return!0;const m=o.getValues().targetType.split("-");return p.configType===m[0]}),{toast:c}=Ef(),d=Un(),f=async p=>{const m={id:p.id,crontab:"0 0 * * *",domain:p.domain,access:p.access,targetAccess:p.targetAccess,targetType:p.targetType};try{await tm(m);let w="域名编辑成功";m.id==""&&(w="域名添加成功"),c({title:"成功",description:w}),d("/")}catch(w){Object.entries(w.response.data).forEach(([x,h])=>{o.setError(x,{type:"manual",message:h.message})});return}};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(bv,{}),u.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(vo,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(f),className:"space-y-8 dark:text-stone-200",children:[u.jsx(qe,{control:o.control,name:"domain",render:({field:p})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"域名"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"请输入域名",...p})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:o.control,name:"access",render:({field:p})=>u.jsxs(He,{children:[u.jsxs(Ye,{className:"flex w-full justify-between",children:[u.jsx("div",{children:"DNS 服务商授权配置"}),u.jsx(cl,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(y0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Ze,{children:u.jsxs(Pu,{...p,value:p.value,onValueChange:m=>{o.setValue("access",m)},children:[u.jsx(ol,{children:u.jsx(Du,{placeholder:"请选择授权配置"})}),u.jsx(il,{children:u.jsxs(ju,{children:[u.jsx(al,{children:"服务商授权配置"}),e.map(m=>{var w;return u.jsx(ll,{value:m.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Io.get(m.configType))==null?void 0:w[1]}),u.jsx("div",{children:m.name})]})},m.id)})]})})]})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:o.control,name:"targetType",render:({field:p})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"部署服务类型"}),u.jsx(Ze,{children:u.jsxs(Pu,{...p,onValueChange:m=>{a(m),o.setValue("targetType",m)},children:[u.jsx(ol,{children:u.jsx(Du,{placeholder:"请选择部署服务类型"})}),u.jsx(il,{children:u.jsxs(ju,{children:[u.jsx(al,{children:"部署服务类型"}),w6.map(m=>{var w,v;return u.jsx(ll,{value:m,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=fm.get(m))==null?void 0:w[1]}),u.jsx("div",{children:(v=fm.get(m))==null?void 0:v[0]})]})},m)})]})})]})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:o.control,name:"targetAccess",render:({field:p})=>u.jsxs(He,{children:[u.jsxs(Ye,{className:"w-full flex justify-between",children:[u.jsx("div",{children:"部署服务商授权配置"}),u.jsx(cl,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(y0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Ze,{children:u.jsxs(Pu,{...p,onValueChange:m=>{o.setValue("targetAccess",m)},children:[u.jsx(ol,{children:u.jsx(Du,{placeholder:"请选择授权配置"})}),u.jsx(il,{children:u.jsxs(ju,{children:[u.jsx(al,{children:"服务商授权配置"}),l.map(m=>{var w;return u.jsx(ll,{value:m.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(w=Io.get(m.configType))==null?void 0:w[1]}),u.jsx("div",{children:m.name})]})},m.id)})]})})]})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"保存"})})]})})})]})})},P6=()=>{const{config:e,deleteAccess:t}=ti(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Un(),i=zn(),a=new URLSearchParams(i.search),l=a.get("page"),c=l?Number(l):1,d=(c-1)*n,f=d+n,p=async m=>{const w=await U4(m);t(w.id)};return u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),u.jsx(cl,{trigger:u.jsx(xt,{children:"添加授权"}),op:"add"})]}),r.length===0?u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(OP,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),u.jsx(cl,{trigger:u.jsx(xt,{children:"添加授权"}),op:"add",className:"mt-3"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"名称"}),u.jsx("div",{className:"w-48",children:"服务商"}),u.jsx("div",{className:"w-52",children:"创建时间"}),u.jsx("div",{className:"w-52",children:"更新时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.slice(d,f).map(m=>{var w,v;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:m.name}),u.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[u.jsx("img",{src:(w=Io.get(m.configType))==null?void 0:w[1],className:"w-6"}),u.jsx("div",{children:(v=Io.get(m.configType))==null?void 0:v[0]})]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",m.created&&Fl(m.created)]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",m.updated&&Fl(m.updated)]}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(cl,{trigger:u.jsx(xt,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:m}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(xt,{variant:"link",className:"p-0",onClick:()=>{p(m)},children:"删除"})]})]},m.id)}),u.jsx(pk,{totalPages:s,currentPage:c,onPageChange:m=>{a.set("page",m.toString()),o({search:a.toString()})}})]})]})},j6=sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ZE=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx("div",{ref:n,role:"alert",className:ve(j6({variant:t}),e),...r}));ZE.displayName="Alert";const GE=y.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:ve("mb-1 font-medium leading-none tracking-tight",e),...t}));GE.displayName="AlertTitle";const KE=y.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ve("text-sm [&_p]:leading-relaxed",e),...t}));KE.displayName="AlertDescription";function D6(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Ov="ScrollArea",[qE,uU]=Xr(Ov),[O6,en]=qE(Ov),XE=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=y.useState(null),[c,d]=y.useState(null),[f,p]=y.useState(null),[m,w]=y.useState(null),[v,x]=y.useState(null),[h,g]=y.useState(0),[_,C]=y.useState(0),[T,E]=y.useState(!1),[P,O]=y.useState(!1),j=Ke(t,q=>l(q)),L=rf(s);return u.jsx(O6,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:T,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:P,onScrollbarYEnabledChange:O,onCornerWidthChange:g,onCornerHeightChange:C,children:u.jsx(Me.div,{dir:L,...i,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});XE.displayName=Ov;var QE="ScrollAreaViewport",JE=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=en(QE,r),a=y.useRef(null),l=Ke(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),u.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});JE.displayName=QE;var $n="ScrollAreaScrollbar",Av=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?u.jsx(A6,{...n,ref:t,forceMount:r}):s.type==="scroll"?u.jsx(M6,{...n,ref:t,forceMount:r}):s.type==="auto"?u.jsx(eT,{...n,ref:t,forceMount:r}):s.type==="always"?u.jsx(Mv,{...n,ref:t}):null});Av.displayName=$n;var A6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),u.jsx(Cr,{present:r||o,children:u.jsx(eT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),M6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),o=e.orientation==="horizontal",i=zf(()=>l("SCROLL_END"),100),[a,l]=D6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),y.useEffect(()=>{const c=s.viewport,d=o?"scrollLeft":"scrollTop";if(c){let f=c[d];const p=()=>{const m=c[d];f!==m&&(l("SCROLL"),i()),f=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[s.viewport,o,l,i]),u.jsx(Cr,{present:r||a!=="hidden",children:u.jsx(Mv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),eT=y.forwardRef((e,t)=>{const r=en($n,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",l=zf(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=en($n,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=oT(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,m){return V6(p,i.current,a,m)}return r==="horizontal"?u.jsx(I6,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,m=gw(p,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):r==="vertical"?u.jsx(L6,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,m=gw(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),I6=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ke(t,l,o.onScrollbarXChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(rT,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ff(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),aT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Dd(i.paddingLeft),paddingEnd:Dd(i.paddingRight)}})}})}),L6=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Ke(t,l,o.onScrollbarYChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(rT,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ff(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),aT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Dd(i.paddingTop),paddingEnd:Dd(i.paddingBottom)}})}})}),[F6,tT]=qE($n),rT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...p}=e,m=en($n,r),[w,v]=y.useState(null),x=Ke(t,j=>v(j)),h=y.useRef(null),g=y.useRef(""),_=m.viewport,C=n.content-n.viewport,T=jt(d),E=jt(l),P=zf(f,10);function O(j){if(h.current){const L=j.clientX-h.current.left,q=j.clientY-h.current.top;c({x:L,y:q})}}return y.useEffect(()=>{const j=L=>{const q=L.target;(w==null?void 0:w.contains(q))&&T(L,C)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[_,w,C,T]),y.useEffect(E,[n,E]),oa(w,P),oa(m.content,P),u.jsx(F6,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:jt(o),onThumbPointerUp:jt(i),onThumbPositionChange:E,onThumbPointerDown:jt(a),children:u.jsx(Me.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:ue(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),h.current=w.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),O(j))}),onPointerMove:ue(e.onPointerMove,O),onPointerUp:ue(e.onPointerUp,j=>{const L=j.target;L.hasPointerCapture(j.pointerId)&&L.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),jd="ScrollAreaThumb",nT=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=tT(jd,e.__scopeScrollArea);return u.jsx(Cr,{present:r||s.hasThumb,children:u.jsx(z6,{ref:t,...n})})}),z6=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=en(jd,r),i=tT(jd,r),{onThumbPositionChange:a}=i,l=Ke(t,f=>i.onThumbChange(f)),c=y.useRef(),d=zf(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const f=o.viewport;if(f){const p=()=>{if(d(),!c.current){const m=W6(f,a);c.current=m,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[o.viewport,d,a]),u.jsx(Me.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),w=f.clientX-m.left,v=f.clientY-m.top;i.onThumbPointerDown({x:w,y:v})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});nT.displayName=jd;var Iv="ScrollAreaCorner",sT=y.forwardRef((e,t)=>{const r=en(Iv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(U6,{...e,ref:t}):null});sT.displayName=Iv;var U6=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=en(Iv,r),[o,i]=y.useState(0),[a,l]=y.useState(0),c=!!(o&&a);return oa(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),oa(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),c?u.jsx(Me.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Dd(e){return e?parseInt(e,10):0}function oT(e,t){const r=e/t;return isNaN(r)?0:r}function Ff(e){const t=oT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function V6(e,t,r,n="ltr"){const s=Ff(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return iT([l,c],f)(e)}function gw(e,t,r="ltr"){const n=Ff(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],c=im(e,l);return iT([0,i],[0,a])(c)}function iT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function aT(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function zf(e,t){const r=jt(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function oa(e,t){const r=jt(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var lT=XE,$6=JE,B6=sT;const cT=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(lT,{ref:n,className:ve("relative overflow-hidden",e),...r,children:[u.jsx($6,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(uT,{}),u.jsx(B6,{})]}));cT.displayName=lT.displayName;const uT=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(Av,{ref:n,orientation:t,className:ve("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(nT,{className:"relative flex-1 rounded-full bg-border"})}));uT.displayName=Av.displayName;const H6=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await Dt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},Y6=()=>{const e=Un(),[t,r]=y.useState(),[n]=kP(),s=n.get("domain");return y.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await H6(i);r(a.items)})()},[s]),u.jsxs(cT,{className:"h-[80vh] overflow-hidden",children:[u.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"域名"}),u.jsx("div",{className:"w-24",children:"状态"}),u.jsx("div",{className:"w-56",children:"阶段"}),u.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),u.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?u.jsx(Q_,{size:16,className:"text-green-700"}):u.jsx(J_,{size:16,className:"text-red-700"})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx(ck,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Fl(o.deployedAt)}),u.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:u.jsxs(oS,{children:[u.jsx(iS,{asChild:!0,children:u.jsx(xt,{variant:"link",className:"p-0",children:"日志"})}),u.jsxs(Gg,{className:"sm:max-w-5xl",children:[u.jsx(lS,{children:u.jsxs(cS,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),u.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&u.jsx(u.Fragment,{children:o.log.check.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.apply&&u.jsx(u.Fragment,{children:o.log.apply.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(c=>u.jsx("div",{className:"mt-1 text-green-600",children:c})),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.deploy&&u.jsx(u.Fragment,{children:o.log.deploy.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},o.id)})]}):u.jsx(u.Fragment,{children:u.jsxs(ZE,{className:"max-w-[40em] mx-auto mt-20",children:[u.jsx(GE,{children:"暂无数据"}),u.jsxs(KE,{children:[u.jsxs("div",{className:"flex items-center mt-5",children:[u.jsx("div",{children:u.jsx(IP,{className:"text-yellow-400",size:36})}),u.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),u.jsx("div",{className:"mt-2 flex justify-end",children:u.jsx(xt,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},hm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",Z6=Oe.object({username:Oe.string().email({message:"请输入正确的邮箱地址"}),password:Oe.string().min(10,{message:"密码至少10个字符"})}),G6=()=>{const e=mo({resolver:go(Z6),defaultValues:{username:"",password:""}}),t=async n=>{try{await Dt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=hm(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Un();return u.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("img",{src:"/vite.svg",className:"w-16"})}),u.jsx(vo,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[u.jsx(qe,{control:e.control,name:"username",render:({field:n})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"用户名"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"email",...n})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:e.control,name:"password",render:({field:n})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"密码"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"shadcn",...n,type:"password"})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"登录"})})]})})]})},K6=()=>Dt().authStore.isValid&&Dt().authStore.isAdmin?u.jsx(G_,{to:"/"}):u.jsx("div",{className:"container",children:u.jsx(hg,{})}),q6=Oe.object({oldPassword:Oe.string().min(10,{message:"密码至少10个字符"}),newPassword:Oe.string().min(10,{message:"密码至少10个字符"}),confirmPassword:Oe.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),X6=()=>{const{toast:e}=Ef(),t=Un(),r=mo({resolver:go(q6),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await Dt().admins.authWithPassword((o=Dt().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const l=hm(a);r.setError("oldPassword",{message:l})}try{await Dt().admins.update((i=Dt().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),Dt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=hm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return u.jsx(u.Fragment,{children:u.jsx(vo,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[u.jsx(qe,{control:r.control,name:"oldPassword",render:({field:s})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"当前密码"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"当前密码",...s,type:"password"})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:r.control,name:"newPassword",render:({field:s})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"新密码"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"newPassword",...s,type:"password"})}),u.jsx(ze,{})]})}),u.jsx(qe,{control:r.control,name:"confirmPassword",render:({field:s})=>u.jsxs(He,{children:[u.jsx(Ye,{children:"确认密码"}),u.jsx(Ze,{children:u.jsx(Je,{placeholder:"confirmPassword",...s,type:"password"})}),u.jsx(ze,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(xt,{type:"submit",children:"确认修改"})})]})})})},Q6=()=>u.jsxs("div",{children:[u.jsx(bv,{}),u.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),u.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:u.jsx(hg,{})})]}),J6=cP([{path:"/",element:u.jsx(q4,{}),children:[{path:"/",element:u.jsx(x5,{})},{path:"/edit",element:u.jsx(R6,{})},{path:"/access",element:u.jsx(P6,{})},{path:"/history",element:u.jsx(Y6,{})},{path:"/setting",element:u.jsx(Q6,{}),children:[{path:"/setting/password",element:u.jsx(X6,{})}]}]},{path:"/login",element:u.jsx(K6,{}),children:[{path:"/login",element:u.jsx(G6,{})}]},{path:"/about",element:u.jsx("div",{children:"About"})}]);Lh.createRoot(document.getElementById("root")).render(u.jsx(et.StrictMode,{children:u.jsx(B4,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:u.jsx(yP,{router:J6})})}))});export default eU(); +*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,s,o){function i(c,d){if(!s[c]){if(!n[c]){var f=typeof iu=="function"&&iu;if(!d&&f)return f(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var m=s[c]={exports:{}};n[c][0].call(m.exports,function(x){var v=n[c][1][x];return i(v||x)},m,m.exports,r,n,s,o)}return s[c].exports}for(var a=typeof iu=="function"&&iu,l=0;l>2,m=(3&c)<<4|d>>4,x=1<_?(15&d)<<2|f>>6:64,v=2<_?63&f:64,w.push(a.charAt(p)+a.charAt(m)+a.charAt(x)+a.charAt(v));return w.join("")},s.decode=function(l){var c,d,f,p,m,x,v=0,w=0,h="data:";if(l.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var g,_=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&_--,l.charAt(l.length-2)===a.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(g=i.uint8array?new Uint8Array(0|_):new Array(0|_);v>4,d=(15&p)<<4|(m=a.indexOf(l.charAt(v++)))>>2,f=(3&m)<<6|(x=a.indexOf(l.charAt(v++))),g[w++]=c,m!==64&&(g[w++]=d),x!==64&&(g[w++]=f);return g}},{"./support":30,"./utils":32}],2:[function(r,n,s){var o=r("./external"),i=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,f,p,m,x){this.compressedSize=d,this.uncompressedSize=f,this.crc32=p,this.compression=m,this.compressedContent=x}c.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,f,p){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,s){var o=r("./utils"),i=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,d,f,p){var m=i,x=p+f;c^=-1;for(var v=p;v>>8^m[255&(c^d[v])];return-1^c}(0|l,a,a.length,0):function(c,d,f,p){var m=i,x=p+f;c^=-1;for(var v=p;v>>8^m[255&(c^d.charCodeAt(v))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,n,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:o}},{lie:37}],7:[function(r,n,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=o?"uint8array":"array";function d(f,p){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=p,this.meta={}}s.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(p){f.push({data:p,meta:f.meta})}},s.compressWorker=function(f){return new d("Deflate",f)},s.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,s){function o(m,x){var v,w="";for(v=0;v>>=8;return w}function i(m,x,v,w,h,g){var _,C,T=m.file,E=m.compression,j=g!==c.utf8encode,O=a.transformTo("string",g(T.name)),P=a.transformTo("string",c.utf8encode(T.name)),L=T.comment,q=a.transformTo("string",g(L)),N=a.transformTo("string",c.utf8encode(L)),F=P.length!==T.name.length,b=N.length!==L.length,W="",te="",$="",Z=T.dir,I=T.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};x&&!v||(Q.crc32=m.crc32,Q.compressedSize=m.compressedSize,Q.uncompressedSize=m.uncompressedSize);var z=0;x&&(z|=8),j||!F&&!b||(z|=2048);var V=0,de=0;Z&&(V|=16),h==="UNIX"?(de=798,V|=function(se,Ee){var fe=se;return se||(fe=Ee?16893:33204),(65535&fe)<<16}(T.unixPermissions,Z)):(de=20,V|=function(se){return 63&(se||0)}(T.dosPermissions)),_=I.getUTCHours(),_<<=6,_|=I.getUTCMinutes(),_<<=5,_|=I.getUTCSeconds()/2,C=I.getUTCFullYear()-1980,C<<=4,C|=I.getUTCMonth()+1,C<<=5,C|=I.getUTCDate(),F&&(te=o(1,1)+o(d(O),4)+P,W+="up"+o(te.length,2)+te),b&&($=o(1,1)+o(d(q),4)+N,W+="uc"+o($.length,2)+$);var ne="";return ne+=` +\0`,ne+=o(z,2),ne+=E.magic,ne+=o(_,2),ne+=o(C,2),ne+=o(Q.crc32,4),ne+=o(Q.compressedSize,4),ne+=o(Q.uncompressedSize,4),ne+=o(O.length,2),ne+=o(W.length,2),{fileRecord:f.LOCAL_FILE_HEADER+ne+O+W,dirRecord:f.CENTRAL_FILE_HEADER+o(de,2)+ne+o(q.length,2)+"\0\0\0\0"+o(V,4)+o(w,4)+O+W+q}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),f=r("../signature");function p(m,x,v,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=v,this.encodeFileName=w,this.streamFiles=m,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(m){var x=m.meta.percent||0,v=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(m):(this.bytesWritten+=m.data.length,l.prototype.push.call(this,{data:m.data,meta:{currentFile:this.currentFile,percent:v?(x+100*(v-w-1))/v:100}}))},p.prototype.openedSource=function(m){this.currentSourceOffset=this.bytesWritten,this.currentFile=m.file.name;var x=this.streamFiles&&!m.file.dir;if(x){var v=i(m,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:v.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(m){this.accumulate=!1;var x=this.streamFiles&&!m.file.dir,v=i(m,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(v.dirRecord),x)this.push({data:function(w){return f.DATA_DESCRIPTOR+o(w.crc32,4)+o(w.compressedSize,4)+o(w.uncompressedSize,4)}(m),meta:{percent:100}});else for(this.push({data:v.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var m=this.bytesWritten,x=0;x=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=i},{"../utils":32}],19:[function(r,n,s){var o=r("./Uint8ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,s){var o=r("./DataReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./DataReader":18}],21:[function(r,n,s){var o=r("./ArrayReader");function i(a){o.call(this,a)}r("../utils").inherits(i,o),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,s){var o=r("../utils"),i=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var p=o.getTypeOf(f);return o.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new c(f):i.uint8array?new d(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,s){var o=r("./GenericWorker"),i=r("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}i.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:i.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,s){var o=r("./GenericWorker"),i=r("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=i(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,i),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}i.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,s){var o=r("../utils"),i=r("./GenericWorker");function a(l){i.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=o.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}o.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,s){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var l=0;l "+i:i}},n.exports=o},{}],29:[function(r,n,s){var o=r("../utils"),i=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,v){return new d.Promise(function(w,h){var g=[],_=x._internalType,C=x._outputType,T=x._mimeType;x.on("data",function(E,j){g.push(E),v&&v(j)}).on("error",function(E){g=[],h(E)}).on("end",function(){try{var E=function(j,O,P){switch(j){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),P);case"base64":return l.encode(O);default:return o.transformTo(j,O)}}(C,function(j,O){var P,L=0,q=null,N=0;for(P=0;P"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),s.blob=i.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,s){for(var o=r("./utils"),i=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}s.utf8encode=function(m){return i.nodebuffer?a.newBufferFrom(m,"utf-8"):function(x){var v,w,h,g,_,C=x.length,T=0;for(g=0;g>>6:(w<65536?v[_++]=224|w>>>12:(v[_++]=240|w>>>18,v[_++]=128|w>>>12&63),v[_++]=128|w>>>6&63),v[_++]=128|63&w);return v}(m)},s.utf8decode=function(m){return i.nodebuffer?o.transformTo("nodebuffer",m).toString("utf-8"):function(x){var v,w,h,g,_=x.length,C=new Array(2*_);for(v=w=0;v<_;)if((h=x[v++])<128)C[w++]=h;else if(4<(g=c[h]))C[w++]=65533,v+=g-1;else{for(h&=g===2?31:g===3?15:7;1>10&1023,C[w++]=56320|1023&h)}return C.length!==w&&(C.subarray?C=C.subarray(0,w):C.length=w),o.applyFromCharCode(C)}(m=o.transformTo(i.uint8array?"uint8array":"array",m))},o.inherits(f,l),f.prototype.processChunk=function(m){var x=o.transformTo(i.uint8array?"uint8array":"array",m.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var v=x;(x=new Uint8Array(v.length+this.leftOver.length)).set(this.leftOver,0),x.set(v,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var w=function(g,_){var C;for((_=_||g.length)>g.length&&(_=g.length),C=_-1;0<=C&&(192&g[C])==128;)C--;return C<0||C===0?_:C+c[g[C]]>_?C:_}(x),h=x;w!==x.length&&(i.uint8array?(h=x.subarray(0,w),this.leftOver=x.subarray(w,x.length)):(h=x.slice(0,w),this.leftOver=x.slice(w,x.length))),this.push({data:s.utf8decode(h),meta:m.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=f,o.inherits(p,l),p.prototype.processChunk=function(m){this.push({data:s.utf8encode(m.data),meta:m.meta})},s.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,s){var o=r("./support"),i=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(v){return v}function d(v,w){for(var h=0;h>8;this.dir=!!(16&this.externalFileAttributes),m==0&&(this.dosPermissions=63&this.externalFileAttributes),m==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var m=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=m.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=m.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=m.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=m.readInt(4))}},readExtraFields:function(m){var x,v,w,h=m.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});m.index+4>>6:(m<65536?p[w++]=224|m>>>12:(p[w++]=240|m>>>18,p[w++]=128|m>>>12&63),p[w++]=128|m>>>6&63),p[w++]=128|63&m);return p},s.buf2binstring=function(f){return d(f,f.length)},s.binstring2buf=function(f){for(var p=new o.Buf8(f.length),m=0,x=p.length;m>10&1023,g[x++]=56320|1023&v)}return d(g,x)},s.utf8border=function(f,p){var m;for((p=p||f.length)>f.length&&(p=f.length),m=p-1;0<=m&&(192&f[m])==128;)m--;return m<0||m===0?p:m+l[f[m]]>p?m:p}},{"./common":41}],43:[function(r,n,s){n.exports=function(o,i,a,l){for(var c=65535&o|0,d=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:i>>>1;a[l]=i}return a}();n.exports=function(i,a,l,c){var d=o,f=c+l;i^=-1;for(var p=c;p>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(r,n,s){var o,i=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),f=0,p=4,m=0,x=-2,v=-1,w=4,h=2,g=8,_=9,C=286,T=30,E=19,j=2*C+1,O=15,P=3,L=258,q=L+P+1,N=42,F=113,b=1,W=2,te=3,$=4;function Z(k,J){return k.msg=d[J],J}function I(k){return(k<<1)-(4k.avail_out&&(K=k.avail_out),K!==0&&(i.arraySet(k.output,J.pending_buf,J.pending_out,K,k.next_out),k.next_out+=K,J.pending_out+=K,k.total_out+=K,k.avail_out-=K,J.pending-=K,J.pending===0&&(J.pending_out=0))}function V(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,z(k.strm)}function de(k,J){k.pending_buf[k.pending++]=J}function ne(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function se(k,J){var K,D,S=k.max_chain_length,R=k.strstart,A=k.prev_length,Y=k.nice_match,M=k.strstart>k.w_size-q?k.strstart-(k.w_size-q):0,H=k.window,X=k.w_mask,ee=k.prev,he=k.strstart+L,We=H[R+A-1],Oe=H[R+A];k.prev_length>=k.good_match&&(S>>=2),Y>k.lookahead&&(Y=k.lookahead);do if(H[(K=J)+A]===Oe&&H[K+A-1]===We&&H[K]===H[R]&&H[++K]===H[R+1]){R+=2,K++;do;while(H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&H[++R]===H[++K]&&RM&&--S!=0);return A<=k.lookahead?A:k.lookahead}function Ee(k){var J,K,D,S,R,A,Y,M,H,X,ee=k.w_size;do{if(S=k.window_size-k.lookahead-k.strstart,k.strstart>=ee+(ee-q)){for(i.arraySet(k.window,k.window,ee,ee,0),k.match_start-=ee,k.strstart-=ee,k.block_start-=ee,J=K=k.hash_size;D=k.head[--J],k.head[J]=ee<=D?D-ee:0,--K;);for(J=K=ee;D=k.prev[--J],k.prev[J]=ee<=D?D-ee:0,--K;);S+=ee}if(k.strm.avail_in===0)break;if(A=k.strm,Y=k.window,M=k.strstart+k.lookahead,H=S,X=void 0,X=A.avail_in,H=P)for(R=k.strstart-k.insert,k.ins_h=k.window[R],k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P)if(D=a._tr_tally(k,k.strstart-k.match_start,k.match_length-P),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=P){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<=P&&(k.ins_h=(k.ins_h<=P&&k.match_length<=k.prev_length){for(S=k.strstart+k.lookahead-P,D=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-P),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=S&&(k.ins_h=(k.ins_h<k.pending_buf_size-5&&(K=k.pending_buf_size-5);;){if(k.lookahead<=1){if(Ee(k),k.lookahead===0&&J===f)return b;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var D=k.block_start+K;if((k.strstart===0||k.strstart>=D)&&(k.lookahead=k.strstart-D,k.strstart=D,V(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-q&&(V(k,!1),k.strm.avail_out===0))return b}return k.insert=0,J===p?(V(k,!0),k.strm.avail_out===0?te:$):(k.strstart>k.block_start&&(V(k,!1),k.strm.avail_out),b)}),new be(4,4,8,4,fe),new be(4,5,16,8,fe),new be(4,6,32,32,fe),new be(4,4,16,16,ge),new be(8,16,32,32,ge),new be(8,16,128,128,ge),new be(8,32,128,256,ge),new be(32,128,258,1024,ge),new be(32,258,258,4096,ge)],s.deflateInit=function(k,J){return rt(k,J,g,15,8,0)},s.deflateInit2=rt,s.deflateReset=Se,s.deflateResetKeep=Te,s.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?x:(k.state.gzhead=J,m):x},s.deflate=function(k,J){var K,D,S,R;if(!k||!k.state||5>8&255),de(D,D.gzhead.time>>16&255),de(D,D.gzhead.time>>24&255),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,255&D.gzhead.os),D.gzhead.extra&&D.gzhead.extra.length&&(de(D,255&D.gzhead.extra.length),de(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(k.adler=c(k.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=69):(de(D,0),de(D,0),de(D,0),de(D,0),de(D,0),de(D,D.level===9?2:2<=D.strategy||D.level<2?4:0),de(D,3),D.status=F);else{var A=g+(D.w_bits-8<<4)<<8;A|=(2<=D.strategy||D.level<2?0:D.level<6?1:D.level===6?2:3)<<6,D.strstart!==0&&(A|=32),A+=31-A%31,D.status=F,ne(D,A),D.strstart!==0&&(ne(D,k.adler>>>16),ne(D,65535&k.adler)),k.adler=1}if(D.status===69)if(D.gzhead.extra){for(S=D.pending;D.gzindex<(65535&D.gzhead.extra.length)&&(D.pending!==D.pending_buf_size||(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending!==D.pending_buf_size));)de(D,255&D.gzhead.extra[D.gzindex]),D.gzindex++;D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),D.gzindex===D.gzhead.extra.length&&(D.gzindex=0,D.status=73)}else D.status=73;if(D.status===73)if(D.gzhead.name){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){R=1;break}R=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),R===0&&(D.gzindex=0,D.status=91)}else D.status=91;if(D.status===91)if(D.gzhead.comment){S=D.pending;do{if(D.pending===D.pending_buf_size&&(D.gzhead.hcrc&&D.pending>S&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),z(k),S=D.pending,D.pending===D.pending_buf_size)){R=1;break}R=D.gzindexS&&(k.adler=c(k.adler,D.pending_buf,D.pending-S,S)),R===0&&(D.status=103)}else D.status=103;if(D.status===103&&(D.gzhead.hcrc?(D.pending+2>D.pending_buf_size&&z(k),D.pending+2<=D.pending_buf_size&&(de(D,255&k.adler),de(D,k.adler>>8&255),k.adler=0,D.status=F)):D.status=F),D.pending!==0){if(z(k),k.avail_out===0)return D.last_flush=-1,m}else if(k.avail_in===0&&I(J)<=I(K)&&J!==p)return Z(k,-5);if(D.status===666&&k.avail_in!==0)return Z(k,-5);if(k.avail_in!==0||D.lookahead!==0||J!==f&&D.status!==666){var Y=D.strategy===2?function(M,H){for(var X;;){if(M.lookahead===0&&(Ee(M),M.lookahead===0)){if(H===f)return b;break}if(M.match_length=0,X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===p?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(D,J):D.strategy===3?function(M,H){for(var X,ee,he,We,Oe=M.window;;){if(M.lookahead<=L){if(Ee(M),M.lookahead<=L&&H===f)return b;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=P&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=P?(X=a._tr_tally(M,1,M.match_length-P),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(X=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),X&&(V(M,!1),M.strm.avail_out===0))return b}return M.insert=0,H===p?(V(M,!0),M.strm.avail_out===0?te:$):M.last_lit&&(V(M,!1),M.strm.avail_out===0)?b:W}(D,J):o[D.level].func(D,J);if(Y!==te&&Y!==$||(D.status=666),Y===b||Y===te)return k.avail_out===0&&(D.last_flush=-1),m;if(Y===W&&(J===1?a._tr_align(D):J!==5&&(a._tr_stored_block(D,0,0,!1),J===3&&(Q(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),z(k),k.avail_out===0))return D.last_flush=-1,m}return J!==p?m:D.wrap<=0?1:(D.wrap===2?(de(D,255&k.adler),de(D,k.adler>>8&255),de(D,k.adler>>16&255),de(D,k.adler>>24&255),de(D,255&k.total_in),de(D,k.total_in>>8&255),de(D,k.total_in>>16&255),de(D,k.total_in>>24&255)):(ne(D,k.adler>>>16),ne(D,65535&k.adler)),z(k),0=K.w_size&&(R===0&&(Q(K.head),K.strstart=0,K.block_start=0,K.insert=0),H=new i.Buf8(K.w_size),i.arraySet(H,J,X-K.w_size,K.w_size,0),J=H,X=K.w_size),A=k.avail_in,Y=k.next_in,M=k.input,k.avail_in=X,k.next_in=0,k.input=J,Ee(K);K.lookahead>=P;){for(D=K.strstart,S=K.lookahead-(P-1);K.ins_h=(K.ins_h<>>=P=O>>>24,_-=P,(P=O>>>16&255)===0)W[d++]=65535&O;else{if(!(16&P)){if(!(64&P)){O=C[(65535&O)+(g&(1<>>=P,_-=P),_<15&&(g+=b[l++]<<_,_+=8,g+=b[l++]<<_,_+=8),O=T[g&j];r:for(;;){if(g>>>=P=O>>>24,_-=P,!(16&(P=O>>>16&255))){if(!(64&P)){O=T[(65535&O)+(g&(1<>>=P,_-=P,(P=d-f)>3,g&=(1<<(_-=L<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(N){var F;return N&&N.state?(F=N.state,N.total_in=N.total_out=F.total=0,N.msg="",F.wrap&&(N.adler=1&F.wrap),F.mode=x,F.last=0,F.havedict=0,F.dmax=32768,F.head=null,F.hold=0,F.bits=0,F.lencode=F.lendyn=new o.Buf32(v),F.distcode=F.distdyn=new o.Buf32(w),F.sane=1,F.back=-1,p):m}function C(N){var F;return N&&N.state?((F=N.state).wsize=0,F.whave=0,F.wnext=0,_(N)):m}function T(N,F){var b,W;return N&&N.state?(W=N.state,F<0?(b=0,F=-F):(b=1+(F>>4),F<48&&(F&=15)),F&&(F<8||15=$.wsize?(o.arraySet($.window,F,b-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(W<(te=$.wsize-$.wnext)&&(te=W),o.arraySet($.window,F,b-W,te,$.wnext),(W-=te)?(o.arraySet($.window,F,b-W,W,0),$.wnext=W,$.whave=$.wsize):($.wnext+=te,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=te))),0}s.inflateReset=C,s.inflateReset2=T,s.inflateResetKeep=_,s.inflateInit=function(N){return E(N,15)},s.inflateInit2=E,s.inflate=function(N,F){var b,W,te,$,Z,I,Q,z,V,de,ne,se,Ee,fe,ge,be,Pe,Te,Se,rt,k,J,K,D,S=0,R=new o.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return m;(b=N.state).mode===12&&(b.mode=13),Z=N.next_out,te=N.output,Q=N.avail_out,$=N.next_in,W=N.input,I=N.avail_in,z=b.hold,V=b.bits,de=I,ne=Q,J=p;e:for(;;)switch(b.mode){case x:if(b.wrap===0){b.mode=13;break}for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,R,2,0),V=z=0,b.mode=2;break}if(b.flags=0,b.head&&(b.head.done=!1),!(1&b.wrap)||(((255&z)<<8)+(z>>8))%31){N.msg="incorrect header check",b.mode=30;break}if((15&z)!=8){N.msg="unknown compression method",b.mode=30;break}if(V-=4,k=8+(15&(z>>>=4)),b.wbits===0)b.wbits=k;else if(k>b.wbits){N.msg="invalid window size",b.mode=30;break}b.dmax=1<>8&1),512&b.flags&&(R[0]=255&z,R[1]=z>>>8&255,b.check=a(b.check,R,2,0)),V=z=0,b.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>8&255,R[2]=z>>>16&255,R[3]=z>>>24&255,b.check=a(b.check,R,4,0)),V=z=0,b.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>8),512&b.flags&&(R[0]=255&z,R[1]=z>>>8&255,b.check=a(b.check,R,2,0)),V=z=0,b.mode=5;case 5:if(1024&b.flags){for(;V<16;){if(I===0)break e;I--,z+=W[$++]<>>8&255,b.check=a(b.check,R,2,0)),V=z=0}else b.head&&(b.head.extra=null);b.mode=6;case 6:if(1024&b.flags&&(I<(se=b.length)&&(se=I),se&&(b.head&&(k=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),o.arraySet(b.head.extra,W,$,se,k)),512&b.flags&&(b.check=a(b.check,W,se,$)),I-=se,$+=se,b.length-=se),b.length))break e;b.length=0,b.mode=7;case 7:if(2048&b.flags){if(I===0)break e;for(se=0;k=W[$+se++],b.head&&k&&b.length<65536&&(b.head.name+=String.fromCharCode(k)),k&&se>9&1,b.head.done=!0),N.adler=b.check=0,b.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,z+=W[$++]<>>=7&V,V-=7&V,b.mode=27;break}for(;V<3;){if(I===0)break e;I--,z+=W[$++]<>>=1)){case 0:b.mode=14;break;case 1:if(L(b),b.mode=20,F!==6)break;z>>>=2,V-=2;break e;case 2:b.mode=17;break;case 3:N.msg="invalid block type",b.mode=30}z>>>=2,V-=2;break;case 14:for(z>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,z+=W[$++]<>>16^65535)){N.msg="invalid stored block lengths",b.mode=30;break}if(b.length=65535&z,V=z=0,b.mode=15,F===6)break e;case 15:b.mode=16;case 16:if(se=b.length){if(I>>=5,V-=5,b.ndist=1+(31&z),z>>>=5,V-=5,b.ncode=4+(15&z),z>>>=4,V-=4,286>>=3,V-=3}for(;b.have<19;)b.lens[A[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,K={bits:b.lenbits},J=c(0,b.lens,0,19,b.lencode,0,b.work,K),b.lenbits=K.bits,J){N.msg="invalid code lengths set",b.mode=30;break}b.have=0,b.mode=19;case 19:for(;b.have>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=ge,V-=ge,b.lens[b.have++]=Pe;else{if(Pe===16){for(D=ge+2;V>>=ge,V-=ge,b.have===0){N.msg="invalid bit length repeat",b.mode=30;break}k=b.lens[b.have-1],se=3+(3&z),z>>>=2,V-=2}else if(Pe===17){for(D=ge+3;V>>=ge)),z>>>=3,V-=3}else{for(D=ge+7;V>>=ge)),z>>>=7,V-=7}if(b.have+se>b.nlen+b.ndist){N.msg="invalid bit length repeat",b.mode=30;break}for(;se--;)b.lens[b.have++]=k}}if(b.mode===30)break;if(b.lens[256]===0){N.msg="invalid code -- missing end-of-block",b.mode=30;break}if(b.lenbits=9,K={bits:b.lenbits},J=c(d,b.lens,0,b.nlen,b.lencode,0,b.work,K),b.lenbits=K.bits,J){N.msg="invalid literal/lengths set",b.mode=30;break}if(b.distbits=6,b.distcode=b.distdyn,K={bits:b.distbits},J=c(f,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,K),b.distbits=K.bits,J){N.msg="invalid distances set",b.mode=30;break}if(b.mode=20,F===6)break e;case 20:b.mode=21;case 21:if(6<=I&&258<=Q){N.next_out=Z,N.avail_out=Q,N.next_in=$,N.avail_in=I,b.hold=z,b.bits=V,l(N,ne),Z=N.next_out,te=N.output,Q=N.avail_out,$=N.next_in,W=N.input,I=N.avail_in,z=b.hold,V=b.bits,b.mode===12&&(b.back=-1);break}for(b.back=0;be=(S=b.lencode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=Te,V-=Te,b.back+=Te}if(z>>>=ge,V-=ge,b.back+=ge,b.length=Pe,be===0){b.mode=26;break}if(32&be){b.back=-1,b.mode=12;break}if(64&be){N.msg="invalid literal/length code",b.mode=30;break}b.extra=15&be,b.mode=22;case 22:if(b.extra){for(D=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=23;case 23:for(;be=(S=b.distcode[z&(1<>>16&255,Pe=65535&S,!((ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>Te)])>>>16&255,Pe=65535&S,!(Te+(ge=S>>>24)<=V);){if(I===0)break e;I--,z+=W[$++]<>>=Te,V-=Te,b.back+=Te}if(z>>>=ge,V-=ge,b.back+=ge,64&be){N.msg="invalid distance code",b.mode=30;break}b.offset=Pe,b.extra=15&be,b.mode=24;case 24:if(b.extra){for(D=b.extra;V>>=b.extra,V-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){N.msg="invalid distance too far back",b.mode=30;break}b.mode=25;case 25:if(Q===0)break e;if(se=ne-Q,b.offset>se){if((se=b.offset-se)>b.whave&&b.sane){N.msg="invalid distance too far back",b.mode=30;break}Ee=se>b.wnext?(se-=b.wnext,b.wsize-se):b.wnext-se,se>b.length&&(se=b.length),fe=b.window}else fe=te,Ee=Z-b.offset,se=b.length;for(Qj?(P=Ee[fe+w[F]],V[de+w[F]]):(P=96,0),g=1<>Z)+(_-=g)]=O<<24|P<<16|L|0,_!==0;);for(g=1<>=1;if(g!==0?(z&=g-1,z+=g):z=0,F++,--ne[N]==0){if(N===W)break;N=f[p+w[F]]}if(te>>7)]}function de(S,R){S.pending_buf[S.pending++]=255&R,S.pending_buf[S.pending++]=R>>>8&255}function ne(S,R,A){S.bi_valid>h-A?(S.bi_buf|=R<>h-S.bi_valid,S.bi_valid+=A-h):(S.bi_buf|=R<>>=1,A<<=1,0<--R;);return A>>>1}function fe(S,R,A){var Y,M,H=new Array(w+1),X=0;for(Y=1;Y<=w;Y++)H[Y]=X=X+A[Y-1]<<1;for(M=0;M<=R;M++){var ee=S[2*M+1];ee!==0&&(S[2*M]=Ee(H[ee]++,ee))}}function ge(S){var R;for(R=0;R>1;1<=A;A--)Te(S,H,A);for(M=he;A=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Te(S,H,1),Y=S.heap[1],S.heap[--S.heap_max]=A,S.heap[--S.heap_max]=Y,H[2*M]=H[2*A]+H[2*Y],S.depth[M]=(S.depth[A]>=S.depth[Y]?S.depth[A]:S.depth[Y])+1,H[2*A+1]=H[2*Y+1]=M,S.heap[1]=M++,Te(S,H,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(Oe,kt){var Vr,$t,Bn,ot,Hn,Yn,Wr=kt.dyn_tree,Sc=kt.max_code,kc=kt.stat_desc.static_tree,ri=kt.stat_desc.has_stree,Cc=kt.stat_desc.extra_bits,ni=kt.stat_desc.extra_base,_n=kt.stat_desc.max_length,Ps=0;for(ot=0;ot<=w;ot++)Oe.bl_count[ot]=0;for(Wr[2*Oe.heap[Oe.heap_max]+1]=0,Vr=Oe.heap_max+1;Vr>=7;M>>=1)if(1&We&&ee.dyn_ltree[2*he]!==0)return i;if(ee.dyn_ltree[18]!==0||ee.dyn_ltree[20]!==0||ee.dyn_ltree[26]!==0)return a;for(he=32;he>>3,(H=S.static_len+3+7>>>3)<=M&&(M=H)):M=H=A+5,A+4<=M&&R!==-1?D(S,R,A,Y):S.strategy===4||H===M?(ne(S,2+(Y?1:0),3),Se(S,q,N)):(ne(S,4+(Y?1:0),3),function(ee,he,We,Oe){var kt;for(ne(ee,he-257,5),ne(ee,We-1,5),ne(ee,Oe-4,4),kt=0;kt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&R,S.pending_buf[S.l_buf+S.last_lit]=255&A,S.last_lit++,R===0?S.dyn_ltree[2*A]++:(S.matches++,R--,S.dyn_ltree[2*(b[A]+f+1)]++,S.dyn_dtree[2*V(R)]++),S.last_lit===S.lit_bufsize-1},s._tr_align=function(S){ne(S,2,3),se(S,_,q),function(R){R.bi_valid===16?(de(R,R.bi_buf),R.bi_buf=0,R.bi_valid=0):8<=R.bi_valid&&(R.pending_buf[R.pending++]=255&R.bi_buf,R.bi_buf>>=8,R.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(r,n,s){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,s){(function(o){(function(i,a){if(!i.setImmediate){var l,c,d,f,p=1,m={},x=!1,v=i.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(i);w=w&&w.setTimeout?w:i,l={}.toString.call(i.process)==="[object process]"?function(C){process.nextTick(function(){g(C)})}:function(){if(i.postMessage&&!i.importScripts){var C=!0,T=i.onmessage;return i.onmessage=function(){C=!1},i.postMessage("","*"),i.onmessage=T,C}}()?(f="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",_,!1):i.attachEvent("onmessage",_),function(C){i.postMessage(f+C,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){g(C.data)},function(C){d.port2.postMessage(C)}):v&&"onreadystatechange"in v.createElement("script")?(c=v.documentElement,function(C){var T=v.createElement("script");T.onreadystatechange=function(){g(C),T.onreadystatechange=null,c.removeChild(T),T=null},c.appendChild(T)}):function(C){setTimeout(g,0,C)},w.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var T=new Array(arguments.length-1),E=0;E"u"?o===void 0?this:o:self)}).call(this,typeof jc<"u"?jc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(EC);var u5=EC.exports;const d5=pm(u5);function f5(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{n.result?t(n.result.toString()):r("No content found")},n.onerror=()=>r(n.error),n.readAsText(e)})}const h5=async(e,t)=>{const r=new d5;t.forEach(o=>{r.file(o.name,o.content)});const n=await r.generateAsync({type:"blob"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=e,s.click()},Ul=e=>{const t=new Date(e);return new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"Asia/Shanghai"}).format(t)},p5=e=>Ul(e).split(" ")[0],m5=async e=>{let t=1;e.page&&(t=e.page);let r=2;return e.perPage&&(r=e.perPage),Dt().collection("domains").getList(t,r,{sort:"-created",expand:"lastDeployment"})},g5=async e=>await Dt().collection("domains").getOne(e),tm=async e=>e.id?await Dt().collection("domains").update(e.id,e):await Dt().collection("domains").create(e),v5=async e=>await Dt().collection("domains").delete(e),y5=(e,t)=>Dt().collection("domains").subscribe(e,r=>{r.action==="update"&&t(r.record)},{expand:"lastDeployment"}),x5=e=>{Dt().collection("domains").unsubscribe(e)},w5=()=>{const e=Ef(),t=Un(),r=zn(),n=new URLSearchParams(r.search),s=n.get("page"),[o,i]=y.useState(0),a=()=>{t("/edit")},l=h=>{n.set("page",h.toString()),t(`?${n.toString()}`)},c=h=>{t(`/edit?id=${h}`)},d=h=>{t(`/history?domain=${h}`)},f=async h=>{try{await v5(h),m(p.filter(g=>g.id!==h))}catch(g){console.error("Error deleting domain:",g)}},[p,m]=y.useState([]);y.useEffect(()=>{(async()=>{const g=await m5({page:s?Number(s):1,perPage:10});m(g.items),i(g.totalPages)})()},[s]);const x=async h=>{const g=p.filter(E=>E.id===h),_=g[0].enabled,C=g[0];C.enabled=!_,await tm(C);const T=p.map(E=>E.id===h?{...E,checked:!_}:E);m(T)},v=async h=>{try{x5(h.id),y5(h.id,g=>{console.log(g);const _=p.map(C=>C.id===g.id?{...g}:C);m(_)}),h.rightnow=!0,await tm(h),e.toast({title:"操作成功",description:"已发起部署,请稍后查看部署日志。"})}catch{e.toast({title:"执行失败",description:u.jsxs(u.Fragment,{children:["执行失败,请查看",u.jsx(Xn,{to:`/history?domain=${h.id}`,className:"underline text-blue-500",children:"部署日志"}),"查看详情。"]}),variant:"destructive"})}},w=async h=>{const g=`${h.id}-${h.domain}.zip`,_=[{name:`${h.domain}.pem`,content:h.certificate?h.certificate:""},{name:`${h.domain}.key`,content:h.privateKey?h.privateKey:""}];await h5(g,_)};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(bv,{}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"域名列表"}),u.jsx(vt,{onClick:a,children:"新增域名"})]}),p.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-40",children:"域名"}),u.jsx("div",{className:"w-48",children:"有效期限"}),u.jsx("div",{className:"w-32",children:"最近执行状态"}),u.jsx("div",{className:"w-64",children:"最近执行阶段"}),u.jsx("div",{className:"w-40 sm:ml-2",children:"最近执行时间"}),u.jsx("div",{className:"w-32",children:"是否启用"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"域名"}),p.map(h=>{var g,_,C,T,E,j;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-40 w-full pt-1 sm:pt-0 flex items-center",children:h.domain}),u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx("div",{children:h.expiredAt?u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"有效期90天"}),u.jsxs("div",{children:[p5(h.expiredAt),"到期"]})]}):"---"})}),u.jsx("div",{className:"sm:w-32 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((g=h.expand)!=null&&g.lastDeployment)?u.jsx(u.Fragment,{children:((_=h.expand.lastDeployment)==null?void 0:_.phase)==="deploy"&&((C=h.expand.lastDeployment)!=null&&C.phaseSuccess)?u.jsx(Q_,{size:16,className:"text-green-700"}):u.jsx(J_,{size:16,className:"text-red-700"})}):"---"}),u.jsx("div",{className:"sm:w-64 w-full pt-1 sm:pt-0 flex items-center",children:h.lastDeployedAt&&((T=h.expand)!=null&&T.lastDeployment)?u.jsx(ck,{phase:(E=h.expand.lastDeployment)==null?void 0:E.phase,phaseSuccess:(j=h.expand.lastDeployment)==null?void 0:j.phaseSuccess}):"---"}),u.jsx("div",{className:"sm:w-40 pt-1 sm:pt-0 sm:ml-2 flex items-center",children:h.lastDeployedAt?Ul(h.lastDeployedAt):"---"}),u.jsx("div",{className:"sm:w-32 flex items-center",children:u.jsx(wC,{children:u.jsxs(a5,{children:[u.jsx(l5,{children:u.jsx(Kk,{checked:h.enabled,onCheckedChange:()=>{x(h.id)}})}),u.jsx(kv,{children:u.jsx("div",{className:"border rounded-sm px-3 bg-background text-muted-foreground text-xs",children:h.enabled?"禁用":"启用"})})]})})}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(vt,{variant:"link",className:"p-0",onClick:()=>d(h.id),children:"部署历史"}),u.jsxs(rx,{when:!!h.enabled,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(vt,{variant:"link",className:"p-0",onClick:()=>v(h),children:"立即部署"})]}),u.jsxs(rx,{when:!!h.expiredAt,children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(vt,{variant:"link",className:"p-0",onClick:()=>w(h),children:"下载"})]}),!h.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsxs(l3,{children:[u.jsx(c3,{asChild:!0,children:u.jsx(vt,{variant:"link",className:"p-0",children:"删除"})}),u.jsxs(Mk,{children:[u.jsxs(Ik,{children:[u.jsx(Fk,{children:"删除域名"}),u.jsx(zk,{children:"确定要删除域名吗?"})]}),u.jsxs(Lk,{children:[u.jsx(Vk,{children:"取消"}),u.jsx(Uk,{onClick:()=>{f(h.id)},children:"确认"})]})]})]}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(vt,{variant:"link",className:"p-0",onClick:()=>c(h.id),children:"编辑"})]})]})]},h.id)}),u.jsx(pk,{totalPages:o,currentPage:s?Number(s):1,onPageChange:h=>{l(h)}})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(Op,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),u.jsx(vt,{onClick:a,className:"mt-3",children:"添加域名"})]})})]})})},Ke=y.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:ve("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ke.displayName="Input";var wc=e=>e.type==="checkbox",ji=e=>e instanceof Date,fr=e=>e==null;const TC=e=>typeof e=="object";var Gt=e=>!fr(e)&&!Array.isArray(e)&&TC(e)&&!ji(e),NC=e=>Gt(e)&&e.target?wc(e.target)?e.target.checked:e.target.value:e,_5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RC=(e,t)=>e.has(_5(t)),b5=e=>{const t=e.constructor&&e.constructor.prototype;return Gt(t)&&t.hasOwnProperty("isPrototypeOf")},Cv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Cv&&(e instanceof Blob||e instanceof FileList))&&(r||Gt(e)))if(t=r?[]:{},!r&&!b5(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=xr(e[n]));else return e;return t}var Pf=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,le=(e,t,r)=>{if(!t||!Gt(e))return r;const n=Pf(t.split(/[,[\].]+?/)).reduce((s,o)=>fr(s)?s:s[o],e);return Lt(n)||n===e?Lt(e[t])?r:e[t]:n},Nn=e=>typeof e=="boolean",Ev=e=>/^\w*$/.test(e),jC=e=>Pf(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const s=Ev(t)?[t]:jC(t),o=s.length,i=o-1;for(;++net.useContext(PC),S5=e=>{const{children:t,...r}=e;return et.createElement(PC.Provider,{value:r},t)};var DC=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==an.all&&(t._proxyFormState[i]=!n||an.all),r&&(r[i]=!0),e[i]}});return s},Nr=e=>Gt(e)&&!Object.keys(e).length,OC=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||an.all))},ol=e=>Array.isArray(e)?e:[e],AC=(e,t,r)=>!e||!t||e===t||ol(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Tv(e){const t=et.useRef(e);t.current=e,et.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function k5(e){const t=Df(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[i,a]=et.useState(r._formState),l=et.useRef(!0),c=et.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=et.useRef(s);return d.current=s,Tv({disabled:n,next:f=>l.current&&AC(d.current,f.name,o)&&OC(f,c.current,r._updateFormState)&&a({...r._formState,...f}),subject:r._subjects.state}),et.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),DC(i,r,c.current,!1)}var jn=e=>typeof e=="string",MC=(e,t,r,n,s)=>jn(e)?(n&&t.watch.add(e),le(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),le(r,o))):(n&&(t.watchAll=!0),r);function C5(e){const t=Df(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:i}=e||{},a=et.useRef(n);a.current=n,Tv({disabled:o,subject:r._subjects.values,next:d=>{AC(a.current,d.name,i)&&c(xr(MC(a.current,r._names,d.values||r._formValues,!1,s)))}});const[l,c]=et.useState(r._getWatch(n,s));return et.useEffect(()=>r._removeUnmounted()),l}function E5(e){const t=Df(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o}=e,i=RC(s._names.array,r),a=C5({control:s,name:r,defaultValue:le(s._formValues,r,le(s._defaultValues,r,e.defaultValue)),exact:!0}),l=k5({control:s,name:r}),c=et.useRef(s.register(r,{...e.rules,value:a,...Nn(e.disabled)?{disabled:e.disabled}:{}}));return et.useEffect(()=>{const d=s._options.shouldUnregister||o,f=(p,m)=>{const x=le(s._fields,p);x&&x._f&&(x._f.mount=m)};if(f(r,!0),d){const p=xr(le(s._options.defaultValues,r));ut(s._defaultValues,r,p),Lt(le(s._formValues,r))&&ut(s._formValues,r,p)}return()=>{(i?d&&!s._state.action:d)?s.unregister(r):f(r,!1)}},[r,s,i,o]),et.useEffect(()=>{le(s._fields,r)&&s._updateDisabledField({disabled:n,fields:s._fields,name:r,value:le(s._fields,r)._f.value})},[n,r,s]),{field:{name:r,value:a,...Nn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:et.useCallback(d=>c.current.onChange({target:{value:NC(d),name:r},type:yd.CHANGE}),[r]),onBlur:et.useCallback(()=>c.current.onBlur({target:{value:le(s._formValues,r),name:r},type:yd.BLUR}),[r,s]),ref:d=>{const f=le(s._fields,r);f&&d&&(f._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),reportValidity:()=>d.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(l.validatingFields,r)},error:{enumerable:!0,get:()=>le(l.errors,r)}})}}const T5=e=>e.render(E5(e));var IC=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},ox=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched}),ix=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const il=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=le(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)break;if(i.ref&&t(i.ref,i.name)&&!n)break;il(a,t)}else Gt(a)&&il(a,t)}}};var N5=(e,t,r)=>{const n=ol(le(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},Nv=e=>e.type==="file",Zs=e=>typeof e=="function",xd=e=>{if(!Cv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ru=e=>jn(e),Rv=e=>e.type==="radio",wd=e=>e instanceof RegExp;const ax={value:!1,isValid:!1},lx={value:!0,isValid:!0};var LC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?lx:{value:e[0].value,isValid:!0}:lx:ax}return ax};const cx={isValid:!1,value:null};var FC=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,cx):cx;function ux(e,t,r="validate"){if(Ru(e)||Array.isArray(e)&&e.every(Ru)||Nn(e)&&!e)return{type:r,message:Ru(e)?e:"",ref:t}}var hi=e=>Gt(e)&&!wd(e)?e:{value:e,message:""},dx=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:d,max:f,pattern:p,validate:m,name:x,valueAsNumber:v,mount:w,disabled:h}=e._f,g=le(t,x);if(!w||h)return{};const _=i?i[0]:o,C=N=>{n&&_.reportValidity&&(_.setCustomValidity(Nn(N)?"":N||""),_.reportValidity())},T={},E=Rv(o),j=wc(o),O=E||j,P=(v||Nv(o))&&Lt(o.value)&&Lt(g)||xd(o)&&o.value===""||g===""||Array.isArray(g)&&!g.length,L=IC.bind(null,x,r,T),q=(N,F,b,W=qn.maxLength,te=qn.minLength)=>{const $=N?F:b;T[x]={type:N?W:te,message:$,ref:o,...L(N?W:te,$)}};if(s?!Array.isArray(g)||!g.length:a&&(!O&&(P||fr(g))||Nn(g)&&!g||j&&!LC(i).isValid||E&&!FC(i).isValid)){const{value:N,message:F}=Ru(a)?{value:!!a,message:a}:hi(a);if(N&&(T[x]={type:qn.required,message:F,ref:_,...L(qn.required,F)},!r))return C(F),T}if(!P&&(!fr(d)||!fr(f))){let N,F;const b=hi(f),W=hi(d);if(!fr(g)&&!isNaN(g)){const te=o.valueAsNumber||g&&+g;fr(b.value)||(N=te>b.value),fr(W.value)||(F=tenew Date(new Date().toDateString()+" "+Q),Z=o.type=="time",I=o.type=="week";jn(b.value)&&g&&(N=Z?$(g)>$(b.value):I?g>b.value:te>new Date(b.value)),jn(W.value)&&g&&(F=Z?$(g)<$(W.value):I?g+N.value,W=!fr(F.value)&&g.length<+F.value;if((b||W)&&(q(b,N.message,F.message),!r))return C(T[x].message),T}if(p&&!P&&jn(g)){const{value:N,message:F}=hi(p);if(wd(N)&&!g.match(N)&&(T[x]={type:qn.pattern,message:F,ref:o,...L(qn.pattern,F)},!r))return C(F),T}if(m){if(Zs(m)){const N=await m(g,t),F=ux(N,_);if(F&&(T[x]={...F,...L(qn.validate,F.message)},!r))return C(F.message),T}else if(Gt(m)){let N={};for(const F in m){if(!Nr(N)&&!r)break;const b=ux(await m[F](g,t),_,F);b&&(N={...b,...L(F,b.message)},C(b.message),r&&(T[x]=N))}if(!Nr(N)&&(T[x]={ref:_,...N},!r))return T}}return C(!0),T};function R5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},_d=e=>fr(e)||!TC(e);function Do(e,t){if(_d(e)||_d(t))return e===t;if(ji(e)&&ji(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const o=e[s];if(!n.includes(s))return!1;if(s!=="ref"){const i=t[s];if(ji(o)&&ji(i)||Gt(o)&&Gt(i)||Array.isArray(o)&&Array.isArray(i)?!Do(o,i):o!==i)return!1}}return!0}var zC=e=>e.type==="select-multiple",P5=e=>Rv(e)||wc(e),Ah=e=>xd(e)&&e.isConnected,UC=e=>{for(const t in e)if(Zs(e[t]))return!0;return!1};function bd(e,t={}){const r=Array.isArray(e);if(Gt(e)||r)for(const n in e)Array.isArray(e[n])||Gt(e[n])&&!UC(e[n])?(t[n]=Array.isArray(e[n])?[]:{},bd(e[n],t[n])):fr(e[n])||(t[n]=!0);return t}function VC(e,t,r){const n=Array.isArray(e);if(Gt(e)||n)for(const s in e)Array.isArray(e[s])||Gt(e[s])&&!UC(e[s])?Lt(t)||_d(r[s])?r[s]=Array.isArray(e[s])?bd(e[s],[]):{...bd(e[s])}:VC(e[s],fr(t)?{}:t[s],r[s]):r[s]=!Do(e[s],t[s]);return r}var au=(e,t)=>VC(e,t,bd(t)),WC=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Lt(e)?e:t?e===""?NaN:e&&+e:r&&jn(e)?new Date(e):n?n(e):e;function Mh(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Nv(t)?t.files:Rv(t)?FC(e.refs).value:zC(t)?[...t.selectedOptions].map(({value:r})=>r):wc(t)?LC(e.refs).value:WC(Lt(t.value)?e.ref.value:t.value,e)}var D5=(e,t,r,n)=>{const s={};for(const o of e){const i=le(t,o);i&&ut(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Fa=e=>Lt(e)?e:wd(e)?e.source:Gt(e)?wd(e.value)?e.value.source:e.value:e,O5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function fx(e,t,r){const n=le(e,r);if(n||Ev(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=le(t,o),a=le(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:r}}var A5=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,M5=(e,t)=>!Pf(le(e,t)).length&&Bt(e,t);const I5={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0};function L5(e={}){let t={...I5,...e},r={submitCount:0,isDirty:!1,isLoading:Zs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Gt(t.defaultValues)||Gt(t.values)?xr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:xr(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Oh(),array:Oh(),state:Oh()},p=ox(t.mode),m=ox(t.reValidateMode),x=t.criteriaMode===an.all,v=S=>R=>{clearTimeout(c),c=setTimeout(S,R)},w=async S=>{if(d.isValid||S){const R=t.resolver?Nr((await O()).errors):await L(n,!0);R!==r.isValid&&f.state.next({isValid:R})}},h=(S,R)=>{(d.isValidating||d.validatingFields)&&((S||Array.from(a.mount)).forEach(A=>{A&&(R?ut(r.validatingFields,A,R):Bt(r.validatingFields,A))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Nr(r.validatingFields)}))},g=(S,R=[],A,Y,M=!0,H=!0)=>{if(Y&&A){if(i.action=!0,H&&Array.isArray(le(n,S))){const X=A(le(n,S),Y.argA,Y.argB);M&&ut(n,S,X)}if(H&&Array.isArray(le(r.errors,S))){const X=A(le(r.errors,S),Y.argA,Y.argB);M&&ut(r.errors,S,X),M5(r.errors,S)}if(d.touchedFields&&H&&Array.isArray(le(r.touchedFields,S))){const X=A(le(r.touchedFields,S),Y.argA,Y.argB);M&&ut(r.touchedFields,S,X)}d.dirtyFields&&(r.dirtyFields=au(s,o)),f.state.next({name:S,isDirty:N(S,R),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,S,R)},_=(S,R)=>{ut(r.errors,S,R),f.state.next({errors:r.errors})},C=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},T=(S,R,A,Y)=>{const M=le(n,S);if(M){const H=le(o,S,Lt(A)?le(s,S):A);Lt(H)||Y&&Y.defaultChecked||R?ut(o,S,R?H:Mh(M._f)):W(S,H),i.mount&&w()}},E=(S,R,A,Y,M)=>{let H=!1,X=!1;const ee={name:S},he=!!(le(n,S)&&le(n,S)._f&&le(n,S)._f.disabled);if(!A||Y){d.isDirty&&(X=r.isDirty,r.isDirty=ee.isDirty=N(),H=X!==ee.isDirty);const We=he||Do(le(s,S),R);X=!!(!he&&le(r.dirtyFields,S)),We||he?Bt(r.dirtyFields,S):ut(r.dirtyFields,S,!0),ee.dirtyFields=r.dirtyFields,H=H||d.dirtyFields&&X!==!We}if(A){const We=le(r.touchedFields,S);We||(ut(r.touchedFields,S,A),ee.touchedFields=r.touchedFields,H=H||d.touchedFields&&We!==A)}return H&&M&&f.state.next(ee),H?ee:{}},j=(S,R,A,Y)=>{const M=le(r.errors,S),H=d.isValid&&Nn(R)&&r.isValid!==R;if(e.delayError&&A?(l=v(()=>_(S,A)),l(e.delayError)):(clearTimeout(c),l=null,A?ut(r.errors,S,A):Bt(r.errors,S)),(A?!Do(M,A):M)||!Nr(Y)||H){const X={...Y,...H&&Nn(R)?{isValid:R}:{},errors:r.errors,name:S};r={...r,...X},f.state.next(X)}},O=async S=>{h(S,!0);const R=await t.resolver(o,t.context,D5(S||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return h(S),R},P=async S=>{const{errors:R}=await O(S);if(S)for(const A of S){const Y=le(R,A);Y?ut(r.errors,A,Y):Bt(r.errors,A)}else r.errors=R;return R},L=async(S,R,A={valid:!0})=>{for(const Y in S){const M=S[Y];if(M){const{_f:H,...X}=M;if(H){const ee=a.array.has(H.name);h([Y],!0);const he=await dx(M,o,x,t.shouldUseNativeValidation&&!R,ee);if(h([Y]),he[H.name]&&(A.valid=!1,R))break;!R&&(le(he,H.name)?ee?N5(r.errors,he,H.name):ut(r.errors,H.name,he[H.name]):Bt(r.errors,H.name))}X&&await L(X,R,A)}}return A.valid},q=()=>{for(const S of a.unMount){const R=le(n,S);R&&(R._f.refs?R._f.refs.every(A=>!Ah(A)):!Ah(R._f.ref))&&Ee(S)}a.unMount=new Set},N=(S,R)=>(S&&R&&ut(o,S,R),!Do(z(),s)),F=(S,R,A)=>MC(S,a,{...i.mount?o:Lt(R)?s:jn(S)?{[S]:R}:R},A,R),b=S=>Pf(le(i.mount?o:s,S,e.shouldUnregister?le(s,S,[]):[])),W=(S,R,A={})=>{const Y=le(n,S);let M=R;if(Y){const H=Y._f;H&&(!H.disabled&&ut(o,S,WC(R,H)),M=xd(H.ref)&&fr(R)?"":R,zC(H.ref)?[...H.ref.options].forEach(X=>X.selected=M.includes(X.value)):H.refs?wc(H.ref)?H.refs.length>1?H.refs.forEach(X=>(!X.defaultChecked||!X.disabled)&&(X.checked=Array.isArray(M)?!!M.find(ee=>ee===X.value):M===X.value)):H.refs[0]&&(H.refs[0].checked=!!M):H.refs.forEach(X=>X.checked=X.value===M):Nv(H.ref)?H.ref.value="":(H.ref.value=M,H.ref.type||f.values.next({name:S,values:{...o}})))}(A.shouldDirty||A.shouldTouch)&&E(S,M,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&Q(S)},te=(S,R,A)=>{for(const Y in R){const M=R[Y],H=`${S}.${Y}`,X=le(n,H);(a.array.has(S)||!_d(M)||X&&!X._f)&&!ji(M)?te(H,M,A):W(H,M,A)}},$=(S,R,A={})=>{const Y=le(n,S),M=a.array.has(S),H=xr(R);ut(o,S,H),M?(f.array.next({name:S,values:{...o}}),(d.isDirty||d.dirtyFields)&&A.shouldDirty&&f.state.next({name:S,dirtyFields:au(s,o),isDirty:N(S,H)})):Y&&!Y._f&&!fr(H)?te(S,H,A):W(S,H,A),ix(S,a)&&f.state.next({...r}),f.values.next({name:i.mount?S:void 0,values:{...o}})},Z=async S=>{i.mount=!0;const R=S.target;let A=R.name,Y=!0;const M=le(n,A),H=()=>R.type?Mh(M._f):NC(S),X=ee=>{Y=Number.isNaN(ee)||ee===le(o,A,ee)};if(M){let ee,he;const We=H(),Oe=S.type===yd.BLUR||S.type===yd.FOCUS_OUT,kt=!O5(M._f)&&!t.resolver&&!le(r.errors,A)&&!M._f.deps||A5(Oe,le(r.touchedFields,A),r.isSubmitted,m,p),Vr=ix(A,a,Oe);ut(o,A,We),Oe?(M._f.onBlur&&M._f.onBlur(S),l&&l(0)):M._f.onChange&&M._f.onChange(S);const $t=E(A,We,Oe,!1),Bn=!Nr($t)||Vr;if(!Oe&&f.values.next({name:A,type:S.type,values:{...o}}),kt)return d.isValid&&w(),Bn&&f.state.next({name:A,...Vr?{}:$t});if(!Oe&&Vr&&f.state.next({...r}),t.resolver){const{errors:ot}=await O([A]);if(X(We),Y){const Hn=fx(r.errors,n,A),Yn=fx(ot,n,Hn.name||A);ee=Yn.error,A=Yn.name,he=Nr(ot)}}else h([A],!0),ee=(await dx(M,o,x,t.shouldUseNativeValidation))[A],h([A]),X(We),Y&&(ee?he=!1:d.isValid&&(he=await L(n,!0)));Y&&(M._f.deps&&Q(M._f.deps),j(A,he,ee,$t))}},I=(S,R)=>{if(le(r.errors,R)&&S.focus)return S.focus(),1},Q=async(S,R={})=>{let A,Y;const M=ol(S);if(t.resolver){const H=await P(Lt(S)?S:M);A=Nr(H),Y=S?!M.some(X=>le(H,X)):A}else S?(Y=(await Promise.all(M.map(async H=>{const X=le(n,H);return await L(X&&X._f?{[H]:X}:X)}))).every(Boolean),!(!Y&&!r.isValid)&&w()):Y=A=await L(n);return f.state.next({...!jn(S)||d.isValid&&A!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:A}:{},errors:r.errors}),R.shouldFocus&&!Y&&il(n,I,S?M:a.mount),Y},z=S=>{const R={...i.mount?o:s};return Lt(S)?R:jn(S)?le(R,S):S.map(A=>le(R,A))},V=(S,R)=>({invalid:!!le((R||r).errors,S),isDirty:!!le((R||r).dirtyFields,S),error:le((R||r).errors,S),isValidating:!!le(r.validatingFields,S),isTouched:!!le((R||r).touchedFields,S)}),de=S=>{S&&ol(S).forEach(R=>Bt(r.errors,R)),f.state.next({errors:S?r.errors:{}})},ne=(S,R,A)=>{const Y=(le(n,S,{_f:{}})._f||{}).ref,M=le(r.errors,S)||{},{ref:H,message:X,type:ee,...he}=M;ut(r.errors,S,{...he,...R,ref:Y}),f.state.next({name:S,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&Y&&Y.focus&&Y.focus()},se=(S,R)=>Zs(S)?f.values.subscribe({next:A=>S(F(void 0,R),A)}):F(S,R,!0),Ee=(S,R={})=>{for(const A of S?ol(S):a.mount)a.mount.delete(A),a.array.delete(A),R.keepValue||(Bt(n,A),Bt(o,A)),!R.keepError&&Bt(r.errors,A),!R.keepDirty&&Bt(r.dirtyFields,A),!R.keepTouched&&Bt(r.touchedFields,A),!R.keepIsValidating&&Bt(r.validatingFields,A),!t.shouldUnregister&&!R.keepDefaultValue&&Bt(s,A);f.values.next({values:{...o}}),f.state.next({...r,...R.keepDirty?{isDirty:N()}:{}}),!R.keepIsValid&&w()},fe=({disabled:S,name:R,field:A,fields:Y,value:M})=>{if(Nn(S)&&i.mount||S){const H=S?void 0:Lt(M)?Mh(A?A._f:le(Y,R)._f):M;ut(o,R,H),E(R,H,!1,!1,!0)}},ge=(S,R={})=>{let A=le(n,S);const Y=Nn(R.disabled);return ut(n,S,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:S}},name:S,mount:!0,...R}}),a.mount.add(S),A?fe({field:A,disabled:R.disabled,name:S,value:R.value}):T(S,!0,R.value),{...Y?{disabled:R.disabled}:{},...t.progressive?{required:!!R.required,min:Fa(R.min),max:Fa(R.max),minLength:Fa(R.minLength),maxLength:Fa(R.maxLength),pattern:Fa(R.pattern)}:{},name:S,onChange:Z,onBlur:Z,ref:M=>{if(M){ge(S,R),A=le(n,S);const H=Lt(M.value)&&M.querySelectorAll&&M.querySelectorAll("input,select,textarea")[0]||M,X=P5(H),ee=A._f.refs||[];if(X?ee.find(he=>he===H):H===A._f.ref)return;ut(n,S,{_f:{...A._f,...X?{refs:[...ee.filter(Ah),H,...Array.isArray(le(s,S))?[{}]:[]],ref:{type:H.type,name:S}}:{ref:H}}}),T(S,!1,void 0,H)}else A=le(n,S,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(RC(a.array,S)&&i.action)&&a.unMount.add(S)}}},be=()=>t.shouldFocusError&&il(n,I,a.mount),Pe=S=>{Nn(S)&&(f.state.next({disabled:S}),il(n,(R,A)=>{const Y=le(n,A);Y&&(R.disabled=Y._f.disabled||S,Array.isArray(Y._f.refs)&&Y._f.refs.forEach(M=>{M.disabled=Y._f.disabled||S}))},0,!1))},Te=(S,R)=>async A=>{let Y;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let M=xr(o);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:H,values:X}=await O();r.errors=H,M=X}else await L(n);if(Bt(r.errors,"root"),Nr(r.errors)){f.state.next({errors:{}});try{await S(M,A)}catch(H){Y=H}}else R&&await R({...r.errors},A),be(),setTimeout(be);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(r.errors)&&!Y,submitCount:r.submitCount+1,errors:r.errors}),Y)throw Y},Se=(S,R={})=>{le(n,S)&&(Lt(R.defaultValue)?$(S,xr(le(s,S))):($(S,R.defaultValue),ut(s,S,xr(R.defaultValue))),R.keepTouched||Bt(r.touchedFields,S),R.keepDirty||(Bt(r.dirtyFields,S),r.isDirty=R.defaultValue?N(S,xr(le(s,S))):N()),R.keepError||(Bt(r.errors,S),d.isValid&&w()),f.state.next({...r}))},rt=(S,R={})=>{const A=S?xr(S):s,Y=xr(A),M=Nr(S),H=M?s:Y;if(R.keepDefaultValues||(s=A),!R.keepValues){if(R.keepDirtyValues)for(const X of a.mount)le(r.dirtyFields,X)?ut(H,X,le(o,X)):$(X,le(H,X));else{if(Cv&&Lt(S))for(const X of a.mount){const ee=le(n,X);if(ee&&ee._f){const he=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(xd(he)){const We=he.closest("form");if(We){We.reset();break}}}}n={}}o=e.shouldUnregister?R.keepDefaultValues?xr(s):{}:xr(H),f.array.next({values:{...H}}),f.values.next({values:{...H}})}a={mount:R.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!R.keepIsValid||!!R.keepDirtyValues,i.watch=!!e.shouldUnregister,f.state.next({submitCount:R.keepSubmitCount?r.submitCount:0,isDirty:M?!1:R.keepDirty?r.isDirty:!!(R.keepDefaultValues&&!Do(S,s)),isSubmitted:R.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:M?{}:R.keepDirtyValues?R.keepDefaultValues&&o?au(s,o):r.dirtyFields:R.keepDefaultValues&&S?au(s,S):R.keepDirty?r.dirtyFields:{},touchedFields:R.keepTouched?r.touchedFields:{},errors:R.keepErrors?r.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},k=(S,R)=>rt(Zs(S)?S(o):S,R);return{control:{register:ge,unregister:Ee,getFieldState:V,handleSubmit:Te,setError:ne,_executeSchema:O,_getWatch:F,_getDirty:N,_updateValid:w,_removeUnmounted:q,_updateFieldArray:g,_updateDisabledField:fe,_getFieldArray:b,_reset:rt,_resetDefaultValues:()=>Zs(t.defaultValues)&&t.defaultValues().then(S=>{k(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Pe,_subjects:f,_proxyFormState:d,_setErrors:C,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(S){i=S},get _defaultValues(){return s},get _names(){return a},set _names(S){a=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Q,register:ge,handleSubmit:Te,watch:se,setValue:$,getValues:z,reset:k,resetField:Se,clearErrors:de,unregister:Ee,setError:ne,setFocus:(S,R={})=>{const A=le(n,S),Y=A&&A._f;if(Y){const M=Y.refs?Y.refs[0]:Y.ref;M.focus&&(M.focus(),R.shouldSelect&&M.select())}},getFieldState:V}}function Ns(e={}){const t=et.useRef(),r=et.useRef(),[n,s]=et.useState({isDirty:!1,isValidating:!1,isLoading:Zs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Zs(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...L5(e),formState:n});const o=t.current.control;return o._options=e,Tv({subject:o._subjects.state,next:i=>{OC(i,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),et.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),et.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),et.useEffect(()=>{e.values&&!Do(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[e.values,o]),et.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),et.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),et.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=DC(n,o),t.current}const hx=(e,t,r)=>{if(e&&"reportValidity"in e){const n=le(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},$C=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?hx(n.ref,r,e):n.refs&&n.refs.forEach(s=>hx(s,r,e))}},F5=(e,t)=>{t.shouldUseNativeValidation&&$C(e,t);const r={};for(const n in e){const s=le(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(z5(t.names||Object.keys(e),n)){const i=Object.assign({},le(r,n));ut(i,"root",o),ut(r,n,i)}else ut(r,n,o)}return r},z5=(e,t)=>e.some(r=>r.startsWith(t+"."));var U5=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(f){return e.push(f)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=IC(i,t,r,s,c?[].concat(c,n.message):n.message)}e.shift()}return r},Rs=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(c){return o.shouldUseNativeValidation&&$C({},o),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:F5(U5(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}},nt;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(nt||(nt={}));var rm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(rm||(rm={}));const xe=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ws=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},ie=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),V5=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ir extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,l=0;for(;lr.message){const r={},n=[];for(const s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ir.create=e=>new Ir(e);const ra=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===xe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let BC=ra;function W5(e){BC=e}function Sd(){return BC}const kd=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},$5=[];function pe(e,t){const r=Sd(),n=kd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ra?void 0:ra].filter(s=>!!s)});e.common.issues.push(n)}class cr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return Fe;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,i=await s.value;n.push({key:o,value:i})}return cr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Fe;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}}const Fe=Object.freeze({status:"aborted"}),Pi=e=>({status:"dirty",value:e}),pr=e=>({status:"valid",value:e}),nm=e=>e.status==="aborted",sm=e=>e.status==="dirty",Vl=e=>e.status==="valid",Wl=e=>typeof Promise<"u"&&e instanceof Promise;function Cd(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function HC(e,t,r,n,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ce||(Ce={}));var Ha,Ya;class Ln{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const px=(e,t)=>{if(Vl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ir(e.common.issues);return this._error=r,this._error}}};function Be(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var l,c;const{message:d}=e;return i.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}},description:s}}class qe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Ws(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ws(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cr,ctx:{common:t.parent.common,data:t.data,parsedType:Ws(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Wl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const s={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ws(t)},o=this._parseSync({data:t,path:s.path,parent:s});return px(s,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ws(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Wl(s)?s:Promise.resolve(s));return px(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new yn({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return An.create(this,this._def)}nullable(){return ho.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fn.create(this,this._def)}promise(){return sa.create(this,this._def)}or(t){return Yl.create([this,t],this._def)}and(t){return Zl.create(this,t,this._def)}transform(t){return new yn({...Be(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Ql({...Be(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new jv({typeName:Ae.ZodBranded,type:this,...Be(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Jl({...Be(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return _c.create(this,t)}readonly(){return ec.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const B5=/^c[^\s-]{8,}$/i,H5=/^[0-9a-z]+$/,Y5=/^[0-9A-HJKMNP-TV-Z]{26}$/,Z5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K5=/^[a-z0-9_-]{21}$/i,G5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,q5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ih;const Q5=/^(?:(?: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])$/,J5=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ez=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YC="((\\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])))",tz=new RegExp(`^${YC}$`);function ZC(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function rz(e){return new RegExp(`^${ZC(e)}$`)}function KC(e){let t=`${YC}T${ZC(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function nz(e,t){return!!((t==="v4"||!t)&&Q5.test(e)||(t==="v6"||!t)&&J5.test(e))}class cn extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.string,received:o.parsedType}),Fe}const n=new cr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.lengtht.test(s),{validation:r,code:ie.invalid_string,...Ce.errToObj(n)})}_addCheck(t){return new cn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...Ce.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ce.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ce.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ce.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ce.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ce.errToObj(r)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new cn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new cn({checks:[],typeName:Ae.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Be(e)})};function sz(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class co extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.number,received:o.parsedType}),Fe}let n;const s=new cr;for(const o of this._def.checks)o.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?sz(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_finite,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new co({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new co({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew co({checks:[],typeName:Ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class uo extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.bigint,received:o.parsedType}),Fe}let n;const s=new cr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):nt.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ce.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ce.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ce.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ce.toString(r))}setLimit(t,r,n,s){return new uo({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ce.toString(s)}]})}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new uo({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Be(e)})};class $l extends qe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.boolean,received:n.parsedType}),Fe}return pr(t.data)}}$l.create=e=>new $l({typeName:Ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Be(e)});class Zo extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_type,expected:xe.date,received:o.parsedType}),Fe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:ie.invalid_date}),Fe}const n=new cr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):nt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Zo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Zo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...Be(e)});class Ed extends qe{_parse(t){if(this._getType(t)!==xe.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.symbol,received:n.parsedType}),Fe}return pr(t.data)}}Ed.create=e=>new Ed({typeName:Ae.ZodSymbol,...Be(e)});class Bl extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.undefined,received:n.parsedType}),Fe}return pr(t.data)}}Bl.create=e=>new Bl({typeName:Ae.ZodUndefined,...Be(e)});class Hl extends qe{_parse(t){if(this._getType(t)!==xe.null){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.null,received:n.parsedType}),Fe}return pr(t.data)}}Hl.create=e=>new Hl({typeName:Ae.ZodNull,...Be(e)});class na extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return pr(t.data)}}na.create=e=>new na({typeName:Ae.ZodAny,...Be(e)});class Io extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return pr(t.data)}}Io.create=e=>new Io({typeName:Ae.ZodUnknown,...Be(e)});class xs extends qe{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:ie.invalid_type,expected:xe.never,received:r.parsedType}),Fe}}xs.create=e=>new xs({typeName:Ae.ZodNever,...Be(e)});class Td extends qe{_parse(t){if(this._getType(t)!==xe.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.void,received:n.parsedType}),Fe}return pr(t.data)}}Td.create=e=>new Td({typeName:Ae.ZodVoid,...Be(e)});class fn extends qe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==xe.array)return pe(r,{code:ie.invalid_type,expected:xe.array,received:r.parsedType}),Fe;if(s.exactLength!==null){const i=r.data.length>s.exactLength.value,a=r.data.lengths.maxLength.value&&(pe(r,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Ln(r,i,r.path,a)))).then(i=>cr.mergeArray(n,i));const o=[...r.data].map((i,a)=>s.type._parseSync(new Ln(r,i,r.path,a)));return cr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new fn({...this._def,minLength:{value:t,message:Ce.toString(r)}})}max(t,r){return new fn({...this._def,maxLength:{value:t,message:Ce.toString(r)}})}length(t,r){return new fn({...this._def,exactLength:{value:t,message:Ce.toString(r)}})}nonempty(t){return this.min(1,t)}}fn.create=(e,t)=>new fn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Be(t)});function mi(e){if(e instanceof Nt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=An.create(mi(n))}return new Nt({...e._def,shape:()=>t})}else return e instanceof fn?new fn({...e._def,type:mi(e.element)}):e instanceof An?An.create(mi(e.unwrap())):e instanceof ho?ho.create(mi(e.unwrap())):e instanceof Fn?Fn.create(e.items.map(t=>mi(t))):e}class Nt extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==xe.object){const c=this._getOrReturnCtx(t);return pe(c,{code:ie.invalid_type,expected:xe.object,received:c.parsedType}),Fe}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof xs&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const d=o[c],f=s.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Ln(s,f,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof xs){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(c==="strict")a.length>0&&(pe(s,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const d of a){const f=s.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Ln(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of l){const f=await d.key,p=await d.value;c.push({key:f,value:p,alwaysSet:d.alwaysSet})}return c}).then(c=>cr.mergeObjectSync(n,c)):cr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Nt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ce.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Nt({...this._def,unknownKeys:"strip"})}passthrough(){return new Nt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Nt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Nt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Nt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Nt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Nt({...this._def,shape:()=>r})}deepPartial(){return mi(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Nt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof An;)o=o._def.innerType;r[n]=o}}),new Nt({...this._def,shape:()=>r})}keyof(){return GC(nt.objectKeys(this.shape))}}Nt.create=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strip",catchall:xs.create(),typeName:Ae.ZodObject,...Be(t)});Nt.strictCreate=(e,t)=>new Nt({shape:()=>e,unknownKeys:"strict",catchall:xs.create(),typeName:Ae.ZodObject,...Be(t)});Nt.lazycreate=(e,t)=>new Nt({shape:e,unknownKeys:"strip",catchall:xs.create(),typeName:Ae.ZodObject,...Be(t)});class Yl extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Ir(a.ctx.common.issues));return pe(r,{code:ie.invalid_union,unionErrors:i}),Fe}if(r.common.async)return Promise.all(n.map(async o=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Ir(l));return pe(r,{code:ie.invalid_union,unionErrors:a}),Fe}}get options(){return this._def.options}}Yl.create=(e,t)=>new Yl({options:e,typeName:Ae.ZodUnion,...Be(t)});const Qn=e=>e instanceof Gl?Qn(e.schema):e instanceof yn?Qn(e.innerType()):e instanceof ql?[e.value]:e instanceof fo?e.options:e instanceof Xl?nt.objectValues(e.enum):e instanceof Ql?Qn(e._def.innerType):e instanceof Bl?[void 0]:e instanceof Hl?[null]:e instanceof An?[void 0,...Qn(e.unwrap())]:e instanceof ho?[null,...Qn(e.unwrap())]:e instanceof jv||e instanceof ec?Qn(e.unwrap()):e instanceof Jl?Qn(e._def.innerType):[];class Of extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return pe(r,{code:ie.invalid_type,expected:xe.object,received:r.parsedType}),Fe;const n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Fe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const s=new Map;for(const o of r){const i=Qn(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Of({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Be(n)})}}function om(e,t){const r=Ws(e),n=Ws(t);if(e===t)return{valid:!0,data:e};if(r===xe.object&&n===xe.object){const s=nt.objectKeys(t),o=nt.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=om(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(r===xe.array&&n===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(nm(o)||nm(i))return Fe;const a=om(o.value,i.value);return a.valid?((sm(o)||sm(i))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:ie.invalid_intersection_types}),Fe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Zl.create=(e,t,r)=>new Zl({left:e,right:t,typeName:Ae.ZodIntersection,...Be(r)});class Fn extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.array)return pe(n,{code:ie.invalid_type,expected:xe.array,received:n.parsedType}),Fe;if(n.data.lengththis._def.items.length&&(pe(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ln(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>cr.mergeArray(r,i)):cr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Fn({...this._def,rest:t})}}Fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:e,typeName:Ae.ZodTuple,rest:null,...Be(t)})};class Kl extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return pe(n,{code:ie.invalid_type,expected:xe.object,received:n.parsedType}),Fe;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in n.data)s.push({key:o._parse(new Ln(n,a,n.path,a)),value:i._parse(new Ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?cr.mergeObjectAsync(r,s):cr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof qe?new Kl({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Be(n)}):new Kl({keyType:cn.create(),valueType:t,typeName:Ae.ZodRecord,...Be(r)})}}class Nd extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.map)return pe(n,{code:ie.invalid_type,expected:xe.map,received:n.parsedType}),Fe;const s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,l],c)=>({key:s._parse(new Ln(n,a,n.path,[c,"key"])),value:o._parse(new Ln(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return Fe;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return Fe;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}}Nd.create=(e,t,r)=>new Nd({valueType:t,keyType:e,typeName:Ae.ZodMap,...Be(r)});class Ko extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.set)return pe(n,{code:ie.invalid_type,expected:xe.set,received:n.parsedType}),Fe;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(pe(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const d of l){if(d.status==="aborted")return Fe;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>o._parse(new Ln(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,r){return new Ko({...this._def,minSize:{value:t,message:Ce.toString(r)}})}max(t,r){return new Ko({...this._def,maxSize:{value:t,message:Ce.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ko.create=(e,t)=>new Ko({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Be(t)});class Yi extends qe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.function)return pe(r,{code:ie.invalid_type,expected:xe.function,received:r.parsedType}),Fe;function n(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),ra].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function s(a,l){return kd({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sd(),ra].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof sa){const a=this;return pr(async function(...l){const c=new Ir([]),d=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(n(l,m)),c}),f=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(m=>{throw c.addIssue(s(f,m)),c})})}else{const a=this;return pr(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Ir([n(l,c.error)]);const d=Reflect.apply(i,this,c.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new Ir([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Yi({...this._def,args:Fn.create(t).rest(Io.create())})}returns(t){return new Yi({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Yi({args:t||Fn.create([]).rest(Io.create()),returns:r||Io.create(),typeName:Ae.ZodFunction,...Be(n)})}}class Gl extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Gl.create=(e,t)=>new Gl({getter:e,typeName:Ae.ZodLazy,...Be(t)});class ql extends qe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Fe}return{status:"valid",value:t.data}}get value(){return this._def.value}}ql.create=(e,t)=>new ql({value:e,typeName:Ae.ZodLiteral,...Be(t)});function GC(e,t){return new fo({values:e,typeName:Ae.ZodEnum,...Be(t)})}class fo extends qe{constructor(){super(...arguments),Ha.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:nt.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Fe}if(Cd(this,Ha)||HC(this,Ha,new Set(this._def.values)),!Cd(this,Ha).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Fe}return pr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return fo.create(t,{...this._def,...r})}exclude(t,r=this._def){return fo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ha=new WeakMap;fo.create=GC;class Xl extends qe{constructor(){super(...arguments),Ya.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==xe.string&&n.parsedType!==xe.number){const s=nt.objectValues(r);return pe(n,{expected:nt.joinValues(s),received:n.parsedType,code:ie.invalid_type}),Fe}if(Cd(this,Ya)||HC(this,Ya,new Set(nt.getValidEnumValues(this._def.values))),!Cd(this,Ya).has(t.data)){const s=nt.objectValues(r);return pe(n,{received:n.data,code:ie.invalid_enum_value,options:s}),Fe}return pr(t.data)}get enum(){return this._def.values}}Ya=new WeakMap;Xl.create=(e,t)=>new Xl({values:e,typeName:Ae.ZodNativeEnum,...Be(t)});class sa extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.promise&&r.common.async===!1)return pe(r,{code:ie.invalid_type,expected:xe.promise,received:r.parsedType}),Fe;const n=r.parsedType===xe.promise?r.data:Promise.resolve(r.data);return pr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}sa.create=(e,t)=>new sa({type:e,typeName:Ae.ZodPromise,...Be(t)});class yn extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Fe;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Fe:l.status==="dirty"||r.value==="dirty"?Pi(l.value):l});{if(r.value==="aborted")return Fe;const a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Fe:a.status==="dirty"||r.value==="dirty"?Pi(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Fe:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Fe:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Vl(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Vl(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);nt.assertNever(s)}}yn.create=(e,t,r)=>new yn({schema:e,typeName:Ae.ZodEffects,effect:t,...Be(r)});yn.createWithPreprocess=(e,t,r)=>new yn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Be(r)});class An extends qe{_parse(t){return this._getType(t)===xe.undefined?pr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}An.create=(e,t)=>new An({innerType:e,typeName:Ae.ZodOptional,...Be(t)});class ho extends qe{_parse(t){return this._getType(t)===xe.null?pr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ho.create=(e,t)=>new ho({innerType:e,typeName:Ae.ZodNullable,...Be(t)});class Ql extends qe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===xe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Ql.create=(e,t)=>new Ql({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});class Jl extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Wl(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ir(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ir(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Jl.create=(e,t)=>new Jl({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});class Rd extends qe{_parse(t){if(this._getType(t)!==xe.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:ie.invalid_type,expected:xe.nan,received:n.parsedType}),Fe}return{status:"valid",value:t.data}}}Rd.create=e=>new Rd({typeName:Ae.ZodNaN,...Be(e)});const oz=Symbol("zod_brand");class jv extends qe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class _c extends qe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Fe:o.status==="dirty"?(r.dirty(),Pi(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Fe:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new _c({in:t,out:r,typeName:Ae.ZodPipeline})}}class ec extends qe{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Vl(s)&&(s.value=Object.freeze(s.value)),s);return Wl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:Ae.ZodReadonly,...Be(t)});function qC(e,t={},r){return e?na.create().superRefine((n,s)=>{var o,i;if(!e(n)){const a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,l=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):na.create()}const iz={object:Nt.lazycreate};var Ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));const az=(e,t={message:`Input not instance of ${e.name}`})=>qC(r=>r instanceof e,t),XC=cn.create,QC=co.create,lz=Rd.create,cz=uo.create,JC=$l.create,uz=Zo.create,dz=Ed.create,fz=Bl.create,hz=Hl.create,pz=na.create,mz=Io.create,gz=xs.create,vz=Td.create,yz=fn.create,xz=Nt.create,wz=Nt.strictCreate,_z=Yl.create,bz=Of.create,Sz=Zl.create,kz=Fn.create,Cz=Kl.create,Ez=Nd.create,Tz=Ko.create,Nz=Yi.create,Rz=Gl.create,jz=ql.create,Pz=fo.create,Dz=Xl.create,Oz=sa.create,mx=yn.create,Az=An.create,Mz=ho.create,Iz=yn.createWithPreprocess,Lz=_c.create,Fz=()=>XC().optional(),zz=()=>QC().optional(),Uz=()=>JC().optional(),Vz={string:e=>cn.create({...e,coerce:!0}),number:e=>co.create({...e,coerce:!0}),boolean:e=>$l.create({...e,coerce:!0}),bigint:e=>uo.create({...e,coerce:!0}),date:e=>Zo.create({...e,coerce:!0})},Wz=Fe;var Ne=Object.freeze({__proto__:null,defaultErrorMap:ra,setErrorMap:W5,getErrorMap:Sd,makeIssue:kd,EMPTY_PATH:$5,addIssueToContext:pe,ParseStatus:cr,INVALID:Fe,DIRTY:Pi,OK:pr,isAborted:nm,isDirty:sm,isValid:Vl,isAsync:Wl,get util(){return nt},get objectUtil(){return rm},ZodParsedType:xe,getParsedType:Ws,ZodType:qe,datetimeRegex:KC,ZodString:cn,ZodNumber:co,ZodBigInt:uo,ZodBoolean:$l,ZodDate:Zo,ZodSymbol:Ed,ZodUndefined:Bl,ZodNull:Hl,ZodAny:na,ZodUnknown:Io,ZodNever:xs,ZodVoid:Td,ZodArray:fn,ZodObject:Nt,ZodUnion:Yl,ZodDiscriminatedUnion:Of,ZodIntersection:Zl,ZodTuple:Fn,ZodRecord:Kl,ZodMap:Nd,ZodSet:Ko,ZodFunction:Yi,ZodLazy:Gl,ZodLiteral:ql,ZodEnum:fo,ZodNativeEnum:Xl,ZodPromise:sa,ZodEffects:yn,ZodTransformer:yn,ZodOptional:An,ZodNullable:ho,ZodDefault:Ql,ZodCatch:Jl,ZodNaN:Rd,BRAND:oz,ZodBranded:jv,ZodPipeline:_c,ZodReadonly:ec,custom:qC,Schema:qe,ZodSchema:qe,late:iz,get ZodFirstPartyTypeKind(){return Ae},coerce:Vz,any:pz,array:yz,bigint:cz,boolean:JC,date:uz,discriminatedUnion:bz,effect:mx,enum:Pz,function:Nz,instanceof:az,intersection:Sz,lazy:Rz,literal:jz,map:Ez,nan:lz,nativeEnum:Dz,never:gz,null:hz,nullable:Mz,number:QC,object:xz,oboolean:Uz,onumber:zz,optional:Az,ostring:Fz,pipeline:Lz,preprocess:Iz,promise:Oz,record:Cz,set:Tz,strictObject:wz,string:XC,symbol:dz,transformer:mx,tuple:kz,undefined:fz,union:_z,unknown:mz,void:vz,NEVER:Wz,ZodIssueCode:ie,quotelessJson:V5,ZodError:Ir}),$z="Label",eE=y.forwardRef((e,t)=>u.jsx(Me.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));eE.displayName=$z;var tE=eE;const Bz=ic("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pv=y.forwardRef(({className:e,...t},r)=>u.jsx(tE,{ref:r,className:ve(Bz(),e),...t}));Pv.displayName=tE.displayName;const js=S5,rE=y.createContext({}),$e=({...e})=>u.jsx(rE.Provider,{value:{name:e.name},children:u.jsx(T5,{...e})}),Af=()=>{const e=y.useContext(rE),t=y.useContext(nE),{getFieldState:r,formState:n}=Df(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},nE=y.createContext({}),ze=y.forwardRef(({className:e,...t},r)=>{const n=y.useId();return u.jsx(nE.Provider,{value:{id:n},children:u.jsx("div",{ref:r,className:ve("space-y-2",e),...t})})});ze.displayName="FormItem";const Ue=y.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Af();return u.jsx(Pv,{ref:r,className:ve(n&&"text-destructive",e),htmlFor:s,...t})});Ue.displayName="FormLabel";const Ve=y.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=Af();return u.jsx(ms,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});Ve.displayName="FormControl";const Hz=y.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Af();return u.jsx("p",{ref:r,id:n,className:ve("text-sm text-muted-foreground",e),...t})});Hz.displayName="FormDescription";const Le=y.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=Af(),i=s?String(s==null?void 0:s.message):t;return i?u.jsx("p",{ref:n,id:o,className:ve("text-sm font-medium text-destructive",e),...r,children:i}):null});Le.displayName="FormMessage";function im(e,[t,r]){return Math.min(r,Math.max(t,e))}var Yz=[" ","Enter","ArrowUp","ArrowDown"],Zz=[" ","Enter"],bc="Select",[Mf,If,Kz]=tf(bc),[wa,uU]=Xr(bc,[Kz,ma]),Lf=ma(),[Gz,xo]=wa(bc),[qz,Xz]=wa(bc),sE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:p,required:m}=e,x=Lf(t),[v,w]=y.useState(null),[h,g]=y.useState(null),[_,C]=y.useState(!1),T=rf(c),[E=!1,j]=oo({prop:n,defaultProp:s,onChange:o}),[O,P]=oo({prop:i,defaultProp:a,onChange:l}),L=y.useRef(null),q=v?!!v.closest("form"):!0,[N,F]=y.useState(new Set),b=Array.from(N).map(W=>W.props.value).join(";");return u.jsx(Tg,{...x,children:u.jsxs(Gz,{required:m,scope:t,trigger:v,onTriggerChange:w,valueNode:h,onValueNodeChange:g,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:On(),value:O,onValueChange:P,open:E,onOpenChange:j,dir:T,triggerPointerDownPosRef:L,disabled:p,children:[u.jsx(Mf.Provider,{scope:t,children:u.jsx(qz,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(W=>{F(te=>new Set(te).add(W))},[]),onNativeOptionRemove:y.useCallback(W=>{F(te=>{const $=new Set(te);return $.delete(W),$})},[]),children:r})}),q?u.jsxs(jE,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:W=>P(W.target.value),disabled:p,children:[O===void 0?u.jsx("option",{value:""}):null,Array.from(N)]},b):null]})})};sE.displayName=bc;var oE="SelectTrigger",iE=y.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Lf(r),i=xo(oE,r),a=i.disabled||n,l=Xe(t,i.onTriggerChange),c=If(r),[d,f,p]=PE(x=>{const v=c().filter(g=>!g.disabled),w=v.find(g=>g.value===i.value),h=DE(v,x,w);h!==void 0&&i.onValueChange(h.value)}),m=()=>{a||(i.onOpenChange(!0),p())};return u.jsx(Ng,{asChild:!0,...o,children:u.jsx(Me.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RE(i.value)?"":void 0,...s,ref:l,onClick:ue(s.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ue(s.onPointerDown,x=>{const v=x.target;v.hasPointerCapture(x.pointerId)&&v.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(m(),i.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ue(s.onKeyDown,x=>{const v=d.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&f(x.key),!(v&&x.key===" ")&&Yz.includes(x.key)&&(m(),x.preventDefault())})})})});iE.displayName=oE;var aE="SelectValue",lE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=xo(aE,r),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=Xe(t,l.onValueNodeChange);return nr(()=>{c(d)},[c,d]),u.jsx(Me.span,{...a,ref:f,style:{pointerEvents:"none"},children:RE(l.value)?u.jsx(u.Fragment,{children:i}):o})});lE.displayName=aE;var Qz="SelectIcon",cE=y.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return u.jsx(Me.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});cE.displayName=Qz;var Jz="SelectPortal",uE=e=>u.jsx(lc,{asChild:!0,...e});uE.displayName=Jz;var Go="SelectContent",dE=y.forwardRef((e,t)=>{const r=xo(Go,e.__scopeSelect),[n,s]=y.useState();if(nr(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?_s.createPortal(u.jsx(fE,{scope:e.__scopeSelect,children:u.jsx(Mf.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(hE,{...e,ref:t})});dE.displayName=Go;var ts=10,[fE,wo]=wa(Go),e6="SelectContentImpl",hE=y.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:w,...h}=e,g=xo(Go,r),[_,C]=y.useState(null),[T,E]=y.useState(null),j=Xe(t,fe=>C(fe)),[O,P]=y.useState(null),[L,q]=y.useState(null),N=If(r),[F,b]=y.useState(!1),W=y.useRef(!1);y.useEffect(()=>{if(_)return Pg(_)},[_]),yg();const te=y.useCallback(fe=>{const[ge,...be]=N().map(Se=>Se.ref.current),[Pe]=be.slice(-1),Te=document.activeElement;for(const Se of fe)if(Se===Te||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ge&&T&&(T.scrollTop=0),Se===Pe&&T&&(T.scrollTop=T.scrollHeight),Se==null||Se.focus(),document.activeElement!==Te))return},[N,T]),$=y.useCallback(()=>te([O,_]),[te,O,_]);y.useEffect(()=>{F&&$()},[F,$]);const{onOpenChange:Z,triggerPointerDownPosRef:I}=g;y.useEffect(()=>{if(_){let fe={x:0,y:0};const ge=Pe=>{var Te,Se;fe={x:Math.abs(Math.round(Pe.pageX)-(((Te=I.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Pe.pageY)-(((Se=I.current)==null?void 0:Se.y)??0))}},be=Pe=>{fe.x<=10&&fe.y<=10?Pe.preventDefault():_.contains(Pe.target)||Z(!1),document.removeEventListener("pointermove",ge),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",be,{capture:!0})}}},[_,Z,I]),y.useEffect(()=>{const fe=()=>Z(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[Z]);const[Q,z]=PE(fe=>{const ge=N().filter(Te=>!Te.disabled),be=ge.find(Te=>Te.ref.current===document.activeElement),Pe=DE(ge,fe,be);Pe&&setTimeout(()=>Pe.ref.current.focus())}),V=y.useCallback((fe,ge,be)=>{const Pe=!W.current&&!be;(g.value!==void 0&&g.value===ge||Pe)&&(P(fe),Pe&&(W.current=!0))},[g.value]),de=y.useCallback(()=>_==null?void 0:_.focus(),[_]),ne=y.useCallback((fe,ge,be)=>{const Pe=!W.current&&!be;(g.value!==void 0&&g.value===ge||Pe)&&q(fe)},[g.value]),se=n==="popper"?am:pE,Ee=se===am?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:w}:{};return u.jsx(fE,{scope:r,content:_,viewport:T,onViewportChange:E,itemRefCallback:V,selectedItem:O,onItemLeave:de,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:L,position:n,isPositioned:F,searchRef:Q,children:u.jsx(cf,{as:ms,allowPinchZoom:!0,children:u.jsx(nf,{asChild:!0,trapped:g.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:ue(s,fe=>{var ge;(ge=g.trigger)==null||ge.focus({preventScroll:!0}),fe.preventDefault()}),children:u.jsx(fa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:u.jsx(se,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:fe=>fe.preventDefault(),...h,...Ee,onPlaced:()=>b(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:ue(h.onKeyDown,fe=>{const ge=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ge&&fe.key.length===1&&z(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let Pe=N().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(Pe=Pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Te=fe.target,Se=Pe.indexOf(Te);Pe=Pe.slice(Se+1)}setTimeout(()=>te(Pe)),fe.preventDefault()}})})})})})})});hE.displayName=e6;var t6="SelectItemAlignedPosition",pE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=xo(Go,r),i=wo(Go,r),[a,l]=y.useState(null),[c,d]=y.useState(null),f=Xe(t,j=>d(j)),p=If(r),m=y.useRef(!1),x=y.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:h,focusSelectedItem:g}=i,_=y.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&v&&w&&h){const j=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),L=h.getBoundingClientRect();if(o.dir!=="rtl"){const Te=L.left-O.left,Se=P.left-Te,rt=j.left-Se,k=j.width+rt,J=Math.max(k,O.width),K=window.innerWidth-ts,D=im(Se,[ts,K-J]);a.style.minWidth=k+"px",a.style.left=D+"px"}else{const Te=O.right-L.right,Se=window.innerWidth-P.right-Te,rt=window.innerWidth-j.right-Se,k=j.width+rt,J=Math.max(k,O.width),K=window.innerWidth-ts,D=im(Se,[ts,K-J]);a.style.minWidth=k+"px",a.style.right=D+"px"}const q=p(),N=window.innerHeight-ts*2,F=v.scrollHeight,b=window.getComputedStyle(c),W=parseInt(b.borderTopWidth,10),te=parseInt(b.paddingTop,10),$=parseInt(b.borderBottomWidth,10),Z=parseInt(b.paddingBottom,10),I=W+te+F+Z+$,Q=Math.min(w.offsetHeight*5,I),z=window.getComputedStyle(v),V=parseInt(z.paddingTop,10),de=parseInt(z.paddingBottom,10),ne=j.top+j.height/2-ts,se=N-ne,Ee=w.offsetHeight/2,fe=w.offsetTop+Ee,ge=W+te+fe,be=I-ge;if(ge<=ne){const Te=w===q[q.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-v.offsetTop-v.offsetHeight,rt=Math.max(se,Ee+(Te?de:0)+Se+$),k=ge+rt;a.style.height=k+"px"}else{const Te=w===q[0].ref.current;a.style.top="0px";const rt=Math.max(ne,W+v.offsetTop+(Te?V:0)+Ee)+be;a.style.height=rt+"px",v.scrollTop=ge-ne+v.offsetTop}a.style.margin=`${ts}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=N+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,v,w,h,o.dir,n]);nr(()=>_(),[_]);const[C,T]=y.useState();nr(()=>{c&&T(window.getComputedStyle(c).zIndex)},[c]);const E=y.useCallback(j=>{j&&x.current===!0&&(_(),g==null||g(),x.current=!1)},[_,g]);return u.jsx(n6,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:u.jsx(Me.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});pE.displayName=t6;var r6="SelectPopperPosition",am=y.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=ts,...o}=e,i=Lf(r);return u.jsx(Rg,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});am.displayName=r6;var[n6,Dv]=wa(Go,{}),lm="SelectViewport",mE=y.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=wo(lm,r),i=Dv(lm,r),a=Xe(t,o.onViewportChange),l=y.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),u.jsx(Mf.Slot,{scope:r,children:u.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ue(s.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const m=Math.abs(l.current-d.scrollTop);if(m>0){const x=window.innerHeight-ts*2,v=parseFloat(f.style.minHeight),w=parseFloat(f.style.height),h=Math.max(v,w);if(h0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});mE.displayName=lm;var gE="SelectGroup",[s6,o6]=wa(gE),vE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=On();return u.jsx(s6,{scope:r,id:s,children:u.jsx(Me.div,{role:"group","aria-labelledby":s,...n,ref:t})})});vE.displayName=gE;var yE="SelectLabel",xE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=o6(yE,r);return u.jsx(Me.div,{id:s.id,...n,ref:t})});xE.displayName=yE;var jd="SelectItem",[i6,wE]=wa(jd),_E=y.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=xo(jd,r),l=wo(jd,r),c=a.value===n,[d,f]=y.useState(o??""),[p,m]=y.useState(!1),x=Xe(t,h=>{var g;return(g=l.itemRefCallback)==null?void 0:g.call(l,h,n,s)}),v=On(),w=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(i6,{scope:r,value:n,disabled:s,textId:v,isSelected:c,onItemTextChange:y.useCallback(h=>{f(g=>g||((h==null?void 0:h.textContent)??"").trim())},[]),children:u.jsx(Mf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:u.jsx(Me.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:ue(i.onFocus,()=>m(!0)),onBlur:ue(i.onBlur,()=>m(!1)),onPointerUp:ue(i.onPointerUp,w),onPointerMove:ue(i.onPointerMove,h=>{var g;s?(g=l.onItemLeave)==null||g.call(l):h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(i.onPointerLeave,h=>{var g;h.currentTarget===document.activeElement&&((g=l.onItemLeave)==null||g.call(l))}),onKeyDown:ue(i.onKeyDown,h=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&h.key===" "||(Zz.includes(h.key)&&w(),h.key===" "&&h.preventDefault())})})})})});_E.displayName=jd;var Za="SelectItemText",bE=y.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=xo(Za,r),a=wo(Za,r),l=wE(Za,r),c=Xz(Za,r),[d,f]=y.useState(null),p=Xe(t,h=>f(h),l.onItemTextChange,h=>{var g;return(g=a.itemTextRefCallback)==null?void 0:g.call(a,h,l.value,l.disabled)}),m=d==null?void 0:d.textContent,x=y.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=c;return nr(()=>(v(x),()=>w(x)),[v,w,x]),u.jsxs(u.Fragment,{children:[u.jsx(Me.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?_s.createPortal(o.children,i.valueNode):null]})});bE.displayName=Za;var SE="SelectItemIndicator",kE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return wE(SE,r).isSelected?u.jsx(Me.span,{"aria-hidden":!0,...n,ref:t}):null});kE.displayName=SE;var cm="SelectScrollUpButton",CE=y.forwardRef((e,t)=>{const r=wo(cm,e.__scopeSelect),n=Dv(cm,e.__scopeSelect),[s,o]=y.useState(!1),i=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(TE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});CE.displayName=cm;var um="SelectScrollDownButton",EE=y.forwardRef((e,t)=>{const r=wo(um,e.__scopeSelect),n=Dv(um,e.__scopeSelect),[s,o]=y.useState(!1),i=Xe(t,n.onScrollButtonChange);return nr(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(TE,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});EE.displayName=um;var TE=y.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=wo("SelectScrollButton",r),i=y.useRef(null),a=If(r),l=y.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),nr(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(Me.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ue(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:ue(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:ue(s.onPointerLeave,()=>{l()})})}),a6="SelectSeparator",NE=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(Me.div,{"aria-hidden":!0,...n,ref:t})});NE.displayName=a6;var dm="SelectArrow",l6=y.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Lf(r),o=xo(dm,r),i=wo(dm,r);return o.open&&i.position==="popper"?u.jsx(jg,{...s,...n,ref:t}):null});l6.displayName=dm;function RE(e){return e===""||e===void 0}var jE=y.forwardRef((e,t)=>{const{value:r,...n}=e,s=y.useRef(null),o=Xe(t,s),i=Wk(r);return y.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[i,r]),u.jsx(xc,{asChild:!0,children:u.jsx("select",{...n,ref:o,defaultValue:r})})});jE.displayName="BubbleSelect";function PE(e){const t=Pt(e),r=y.useRef(""),n=y.useRef(0),s=y.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=y.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function DE(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=c6(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function c6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var u6=sE,OE=iE,d6=lE,f6=cE,h6=uE,AE=dE,p6=mE,m6=vE,ME=xE,IE=_E,g6=bE,v6=kE,LE=CE,FE=EE,zE=NE;const ju=u6,Pu=m6,Du=d6,al=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(OE,{ref:n,className:ve("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,u.jsx(f6,{asChild:!0,children:u.jsx(X_,{className:"h-4 w-4 opacity-50"})})]}));al.displayName=OE.displayName;const UE=y.forwardRef(({className:e,...t},r)=>u.jsx(LE,{ref:r,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Rj,{className:"h-4 w-4"})}));UE.displayName=LE.displayName;const VE=y.forwardRef(({className:e,...t},r)=>u.jsx(FE,{ref:r,className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(X_,{className:"h-4 w-4"})}));VE.displayName=FE.displayName;const ll=y.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(h6,{children:u.jsxs(AE,{ref:s,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[u.jsx(UE,{}),u.jsx(p6,{className:ve("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(VE,{})]})}));ll.displayName=AE.displayName;const cl=y.forwardRef(({className:e,...t},r)=>u.jsx(ME,{ref:r,className:ve("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));cl.displayName=ME.displayName;const ul=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(IE,{ref:n,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(v6,{children:u.jsx(q_,{className:"h-4 w-4"})})}),u.jsx(g6,{children:t})]}));ul.displayName=IE.displayName;const y6=y.forwardRef(({className:e,...t},r)=>u.jsx(zE,{ref:r,className:ve("-mx-1 my-1 h-px bg-muted",e),...t}));y6.displayName=zE.displayName;const fm=new Map([["aliyun-cdn",["阿里云-CDN","/imgs/providers/aliyun.svg"]],["aliyun-oss",["阿里云-OSS","/imgs/providers/aliyun.svg"]],["tencent-cdn",["腾讯云-CDN","/imgs/providers/tencent.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["qiniu-cdn",["七牛云-CDN","/imgs/providers/qiniu.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),x6=Array.from(fm.keys()),w6=Hg,_6=Yg,b6=Zg,WE=y.forwardRef(({className:e,...t},r)=>u.jsx(dc,{ref:r,className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));WE.displayName=dc.displayName;const $E=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(b6,{children:[u.jsx(WE,{}),u.jsxs(fc,{ref:n,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(ff,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(pg,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$E.displayName=fc.displayName;const BE=({className:e,...t})=>u.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});BE.displayName="DialogHeader";const HE=y.forwardRef(({className:e,...t},r)=>u.jsx(hc,{ref:r,className:ve("text-lg font-semibold leading-none tracking-tight",e),...t}));HE.displayName=hc.displayName;const S6=y.forwardRef(({className:e,...t},r)=>u.jsx(pc,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));S6.displayName=pc.displayName;const Lo=new Map([["tencent",["腾讯云","/imgs/providers/tencent.svg"]],["aliyun",["阿里云","/imgs/providers/aliyun.svg"]],["cloudflare",["Cloudflare","/imgs/providers/cloudflare.svg"]],["qiniu",["七牛云","/imgs/providers/qiniu.svg"]],["ssh",["SSH部署","/imgs/providers/ssh.svg"]],["webhook",["Webhook","/imgs/providers/webhook.svg"]]]),_a=Ne.union([Ne.literal("aliyun"),Ne.literal("tencent"),Ne.literal("ssh"),Ne.literal("webhook"),Ne.literal("cloudflare"),Ne.literal("qiniu")],{message:"请选择云服务商"}),k6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,secretId:Ne.string().min(1).max(64),secretKey:Ne.string().min(1).max(64)});let o={secretId:"",secretKey:""};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"tencent",secretId:o.secretId,secretKey:o.secretKey}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{secretId:l.secretId,secretKey:l.secretKey}};try{const d=await xa(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx($e,{control:i.control,name:"name",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"secretId",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"SecretId"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入SecretId",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"secretKey",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"SecretKey"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入SecretKey",...l})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})},C6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,accessKeyId:Ne.string().min(1).max(64),accessSecretId:Ne.string().min(1).max(64)});let o={accessKeyId:"",accessKeySecret:""};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"aliyun",accessKeyId:o.accessKeyId,accessSecretId:o.accessKeySecret}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{accessKeyId:l.accessKeyId,accessKeySecret:l.accessSecretId}};try{const d=await xa(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})});return}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx($e,{control:i.control,name:"name",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"accessKeyId",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"AccessKeyId"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入AccessKeyId",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"accessSecretId",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"AccessKeySecret"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入AccessKeySecret",...l})}),u.jsx(Le,{})]})}),u.jsx(Le,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})},YE=y.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:ve("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));YE.displayName="Textarea";const E6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,host:Ne.string().ip({message:"请输入合法的IP地址"}),port:Ne.string().min(1).max(5),username:Ne.string().min(1).max(64),password:Ne.string().min(0).max(64),key:Ne.string().min(0).max(20480),keyFile:Ne.string().optional(),command:Ne.string().min(1).max(2048),certPath:Ne.string().min(0).max(2048),keyPath:Ne.string().min(0).max(2048)});let o={host:"127.0.0.1",port:"22",username:"root",password:"",key:"",keyFile:"",command:"sudo service nginx restart",certPath:"/etc/nginx/ssl/certificate.crt",keyPath:"/etc/nginx/ssl/private.key"};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"ssh",host:o.host,port:o.port,username:o.username,password:o.password,key:o.key,keyFile:o.keyFile,certPath:o.certPath,keyPath:o.keyPath,command:o.command}}),a=async c=>{console.log(c);const d={id:c.id,name:c.name,configType:c.configType,config:{host:c.host,port:c.port,username:c.username,password:c.password,key:c.key,command:c.command,certPath:c.certPath,keyPath:c.keyPath}};try{const f=await xa(d);if(t(),d.id=f.id,d.created=f.created,d.updated=f.updated,c.id){n(d);return}r(d)}catch(f){Object.entries(f.response.data).forEach(([m,x])=>{i.setError(m,{type:"manual",message:x.message})});return}},l=async c=>{var p;const d=(p=c.target.files)==null?void 0:p[0];if(!d)return;const f=await f5(d);i.setValue("key",f),i.setValue("keyFile","")};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:c=>{c.stopPropagation(),i.handleSubmit(a)(c)},className:"space-y-3",children:[u.jsx($e,{control:i.control,name:"name",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:c})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:c})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...c})}),u.jsx(Le,{})]})}),u.jsxs("div",{className:"flex space-x-2",children:[u.jsx($e,{control:i.control,name:"host",render:({field:c})=>u.jsxs(ze,{className:"grow",children:[u.jsx(Ue,{children:"服务器IP"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入Host",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"port",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"SSH端口"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入Port",...c,type:"number"})}),u.jsx(Le,{})]})})]}),u.jsx($e,{control:i.control,name:"username",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"用户名"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入用户名",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"password",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"密码"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入密码",...c,type:"password"})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"key",render:({field:c})=>u.jsxs(ze,{hidden:!0,children:[u.jsx(Ue,{children:"Key(使用证书登录)"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入Key",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"keyFile",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"Key(使用证书登录)"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入Key",...c,type:"file",onChange:l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"certPath",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"证书上传路径"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入证书上传路径",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"keyPath",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"私钥上传路径"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入私钥上传路径",...c})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"command",render:({field:c})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"Command"}),u.jsx(Ve,{children:u.jsx(YE,{placeholder:"请输入要执行的命令",...c})}),u.jsx(Le,{})]})}),u.jsx(Le,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})},T6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,url:Ne.string().url()});let o={url:""};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"webhook",url:o.url}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{url:l.url}};try{const d=await xa(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx($e,{control:i.control,name:"name",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"url",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"Webhook Url"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入Webhook Url",...l})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})},N6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,dnsApiToken:Ne.string().min(1).max(64)});let o={dnsApiToken:""};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"cloudflare",dnsApiToken:o.dnsApiToken}}),a=async l=>{console.log(l);const c={id:l.id,name:l.name,configType:l.configType,config:{dnsApiToken:l.dnsApiToken}};try{const d=await xa(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})})}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:l=>{console.log(l),l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx($e,{control:i.control,name:"name",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"dnsApiToken",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"CLOUD_DNS_API_TOKEN"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入CLOUD_DNS_API_TOKEN",...l})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})},R6=({data:e,onAfterReq:t})=>{const{addAccess:r,updateAccess:n}=yo(),s=Ne.object({id:Ne.string().optional(),name:Ne.string().min(1).max(64),configType:_a,accessKey:Ne.string().min(1).max(64),secretKey:Ne.string().min(1).max(64)});let o={accessKey:"",secretKey:""};e&&(o=e.config);const i=Ns({resolver:Rs(s),defaultValues:{id:e==null?void 0:e.id,name:e==null?void 0:e.name,configType:"qiniu",accessKey:o.accessKey,secretKey:o.secretKey}}),a=async l=>{const c={id:l.id,name:l.name,configType:l.configType,config:{accessKey:l.accessKey,secretKey:l.secretKey}};try{const d=await xa(c);if(t(),c.id=d.id,c.created=d.created,c.updated=d.updated,l.id){n(c);return}r(c)}catch(d){Object.entries(d.response.data).forEach(([p,m])=>{i.setError(p,{type:"manual",message:m.message})});return}};return u.jsx(u.Fragment,{children:u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...i,children:u.jsxs("form",{onSubmit:l=>{l.stopPropagation(),i.handleSubmit(a)(l)},className:"space-y-8",children:[u.jsx($e,{control:i.control,name:"name",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"名称"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入授权名称",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"id",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"configType",render:({field:l})=>u.jsxs(ze,{className:"hidden",children:[u.jsx(Ue,{children:"配置类型"}),u.jsx(Ve,{children:u.jsx(Ke,{...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"accessKey",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"AccessKey"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入AccessKey",...l})}),u.jsx(Le,{})]})}),u.jsx($e,{control:i.control,name:"secretKey",render:({field:l})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"SecretKey"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入SecretKey",...l})}),u.jsx(Le,{})]})}),u.jsx(Le,{}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})})};function dl({trigger:e,op:t,data:r,className:n}){const[s,o]=y.useState(!1),i=Array.from(Lo.keys()),[a,l]=y.useState((r==null?void 0:r.configType)||"");let c=u.jsx(u.Fragment,{children:" "});switch(a){case"tencent":c=u.jsx(k6,{data:r,onAfterReq:()=>{o(!1)}});break;case"aliyun":c=u.jsx(C6,{data:r,onAfterReq:()=>{o(!1)}});break;case"ssh":c=u.jsx(E6,{data:r,onAfterReq:()=>{o(!1)}});break;case"webhook":c=u.jsx(T6,{data:r,onAfterReq:()=>{o(!1)}});break;case"cloudflare":c=u.jsx(N6,{data:r,onAfterReq:()=>{o(!1)}});break;case"qiniu":c=u.jsx(R6,{data:r,onAfterReq:()=>{o(!1)}});break}const d=f=>f==a?"border-primary":"";return u.jsxs(w6,{onOpenChange:o,open:s,children:[u.jsx(_6,{asChild:!0,className:ve(n),children:e}),u.jsxs($E,{className:"sm:max-w-[600px] w-full dark:text-stone-200",children:[u.jsx(BE,{children:u.jsxs(HE,{children:[t=="add"?"添加":"编辑","授权"]})}),u.jsxs("div",{className:"container",children:[u.jsx(Pv,{children:"服务商"}),u.jsxs(ju,{onValueChange:f=>{console.log(f),l(f)},defaultValue:a,children:[u.jsx(al,{className:"mt-3",children:u.jsx(Du,{placeholder:"请选择服务商"})}),u.jsx(ll,{children:u.jsxs(Pu,{children:[u.jsx(cl,{children:"服务商"}),i.map(f=>{var p,m;return u.jsx(ul,{value:f,children:u.jsxs("div",{className:ve("flex items-center space-x-2 rounded cursor-pointer",d(f)),children:[u.jsx("img",{src:(p=Lo.get(f))==null?void 0:p[1],className:"h-6 w-6"}),u.jsx("div",{children:(m=Lo.get(f))==null?void 0:m[0]})]})},f)})]})})]}),c]})]})]})}const j6=()=>{const{config:{accesses:e}}=yo(),[t,r]=y.useState(),n=zn();y.useEffect(()=>{const m=new URLSearchParams(n.search).get("id");m&&(async()=>{const v=await g5(m);r(v)})()},[n.search]);const s=Ne.object({id:Ne.string().optional(),domain:Ne.string().regex(/^(?:\*\.)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,{message:"请输入正确的域名"}),access:Ne.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择DNS服务商授权配置"}),targetAccess:Ne.string().regex(/^[a-zA-Z0-9]+$/,{message:"请选择部署服务商配置"}),targetType:Ne.string().regex(/^[a-zA-Z0-9-]+$/,{message:"请选择部署服务类型"})}),o=Ns({resolver:Rs(s),defaultValues:{id:"",domain:"",access:"",targetAccess:"",targetType:""}});y.useEffect(()=>{t&&o.reset({id:t.id,domain:t.domain,access:t.access,targetAccess:t.targetAccess,targetType:t.targetType})},[t,o]);const[i,a]=y.useState(t?t.targetType:""),l=e.filter(p=>{if(i=="")return!0;const m=o.getValues().targetType.split("-");return p.configType===m[0]}),{toast:c}=Ef(),d=Un(),f=async p=>{const m={id:p.id,crontab:"0 0 * * *",domain:p.domain,access:p.access,targetAccess:p.targetAccess,targetType:p.targetType};try{await tm(m);let x="域名编辑成功";m.id==""&&(x="域名添加成功"),c({title:"成功",description:x}),d("/")}catch(x){Object.entries(x.response.data).forEach(([w,h])=>{o.setError(w,{type:"manual",message:h.message})});return}};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"",children:[u.jsx(bv,{}),u.jsxs("div",{className:"border-b dark:border-stone-500 h-10 text-muted-foreground",children:[t!=null&&t.id?"编辑":"新增","域名"]}),u.jsx("div",{className:"max-w-[35em] mx-auto mt-10",children:u.jsx(js,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(f),className:"space-y-8 dark:text-stone-200",children:[u.jsx($e,{control:o.control,name:"domain",render:({field:p})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"域名"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"请输入域名",...p})}),u.jsx(Le,{})]})}),u.jsx($e,{control:o.control,name:"access",render:({field:p})=>u.jsxs(ze,{children:[u.jsxs(Ue,{className:"flex w-full justify-between",children:[u.jsx("div",{children:"DNS 服务商授权配置"}),u.jsx(dl,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(y0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Ve,{children:u.jsxs(ju,{...p,value:p.value,onValueChange:m=>{o.setValue("access",m)},children:[u.jsx(al,{children:u.jsx(Du,{placeholder:"请选择授权配置"})}),u.jsx(ll,{children:u.jsxs(Pu,{children:[u.jsx(cl,{children:"服务商授权配置"}),e.map(m=>{var x;return u.jsx(ul,{value:m.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(x=Lo.get(m.configType))==null?void 0:x[1]}),u.jsx("div",{children:m.name})]})},m.id)})]})})]})}),u.jsx(Le,{})]})}),u.jsx($e,{control:o.control,name:"targetType",render:({field:p})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"部署服务类型"}),u.jsx(Ve,{children:u.jsxs(ju,{...p,onValueChange:m=>{a(m),o.setValue("targetType",m)},children:[u.jsx(al,{children:u.jsx(Du,{placeholder:"请选择部署服务类型"})}),u.jsx(ll,{children:u.jsxs(Pu,{children:[u.jsx(cl,{children:"部署服务类型"}),x6.map(m=>{var x,v;return u.jsx(ul,{value:m,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(x=fm.get(m))==null?void 0:x[1]}),u.jsx("div",{children:(v=fm.get(m))==null?void 0:v[0]})]})},m)})]})})]})}),u.jsx(Le,{})]})}),u.jsx($e,{control:o.control,name:"targetAccess",render:({field:p})=>u.jsxs(ze,{children:[u.jsxs(Ue,{className:"w-full flex justify-between",children:[u.jsx("div",{children:"部署服务商授权配置"}),u.jsx(dl,{trigger:u.jsxs("div",{className:"font-normal text-primary hover:underline cursor-pointer flex items-center",children:[u.jsx(y0,{size:14}),"新增"]}),op:"add"})]}),u.jsx(Ve,{children:u.jsxs(ju,{...p,onValueChange:m=>{o.setValue("targetAccess",m)},children:[u.jsx(al,{children:u.jsx(Du,{placeholder:"请选择授权配置"})}),u.jsx(ll,{children:u.jsxs(Pu,{children:[u.jsx(cl,{children:"服务商授权配置"}),l.map(m=>{var x;return u.jsx(ul,{value:m.id,children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("img",{className:"w-6",src:(x=Lo.get(m.configType))==null?void 0:x[1]}),u.jsx("div",{children:m.name})]})},m.id)})]})})]})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"保存"})})]})})})]})})},P6=()=>{const{config:e,deleteAccess:t}=yo(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Un(),i=zn(),a=new URLSearchParams(i.search),l=a.get("page"),c=l?Number(l):1,d=(c-1)*n,f=d+n,p=async m=>{const x=await U4(m);t(x.id)};return u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),u.jsx(dl,{trigger:u.jsx(vt,{children:"添加授权"}),op:"add"})]}),r.length===0?u.jsxs("div",{className:"flex flex-col items-center mt-10",children:[u.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:u.jsx(Oj,{size:40,className:"text-primary"})}),u.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),u.jsx(dl,{trigger:u.jsx(vt,{children:"添加授权"}),op:"add",className:"mt-3"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"名称"}),u.jsx("div",{className:"w-48",children:"服务商"}),u.jsx("div",{className:"w-52",children:"创建时间"}),u.jsx("div",{className:"w-52",children:"更新时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.slice(d,f).map(m=>{var x,v;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:m.name}),u.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[u.jsx("img",{src:(x=Lo.get(m.configType))==null?void 0:x[1],className:"w-6"}),u.jsx("div",{children:(v=Lo.get(m.configType))==null?void 0:v[0]})]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于 ",m.created&&Ul(m.created)]}),u.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于 ",m.updated&&Ul(m.updated)]}),u.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[u.jsx(dl,{trigger:u.jsx(vt,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:m}),u.jsx(Ht,{orientation:"vertical",className:"h-4 mx-2"}),u.jsx(vt,{variant:"link",className:"p-0",onClick:()=>{p(m)},children:"删除"})]})]},m.id)}),u.jsx(pk,{totalPages:s,currentPage:c,onPageChange:m=>{a.set("page",m.toString()),o({search:a.toString()})}})]})]})},D6=ic("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),ZE=y.forwardRef(({className:e,variant:t,...r},n)=>u.jsx("div",{ref:n,role:"alert",className:ve(D6({variant:t}),e),...r}));ZE.displayName="Alert";const KE=y.forwardRef(({className:e,...t},r)=>u.jsx("h5",{ref:r,className:ve("mb-1 font-medium leading-none tracking-tight",e),...t}));KE.displayName="AlertTitle";const GE=y.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ve("text-sm [&_p]:leading-relaxed",e),...t}));GE.displayName="AlertDescription";function O6(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var Ov="ScrollArea",[qE,dU]=Xr(Ov),[A6,en]=qE(Ov),XE=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=y.useState(null),[c,d]=y.useState(null),[f,p]=y.useState(null),[m,x]=y.useState(null),[v,w]=y.useState(null),[h,g]=y.useState(0),[_,C]=y.useState(0),[T,E]=y.useState(!1),[j,O]=y.useState(!1),P=Xe(t,q=>l(q)),L=rf(s);return u.jsx(A6,{scope:r,type:n,dir:L,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:T,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:w,scrollbarYEnabled:j,onScrollbarYEnabledChange:O,onCornerWidthChange:g,onCornerHeightChange:C,children:u.jsx(Me.div,{dir:L,...i,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});XE.displayName=Ov;var QE="ScrollAreaViewport",JE=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=en(QE,r),a=y.useRef(null),l=Xe(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),u.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});JE.displayName=QE;var $n="ScrollAreaScrollbar",Av=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return y.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?u.jsx(M6,{...n,ref:t,forceMount:r}):s.type==="scroll"?u.jsx(I6,{...n,ref:t,forceMount:r}):s.type==="auto"?u.jsx(eT,{...n,ref:t,forceMount:r}):s.type==="always"?u.jsx(Mv,{...n,ref:t}):null});Av.displayName=$n;var M6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),[o,i]=y.useState(!1);return y.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),u.jsx(Cr,{present:r||o,children:u.jsx(eT,{"data-state":o?"visible":"hidden",...n,ref:t})})}),I6=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=en($n,e.__scopeScrollArea),o=e.orientation==="horizontal",i=zf(()=>l("SCROLL_END"),100),[a,l]=O6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),y.useEffect(()=>{const c=s.viewport,d=o?"scrollLeft":"scrollTop";if(c){let f=c[d];const p=()=>{const m=c[d];f!==m&&(l("SCROLL"),i()),f=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[s.viewport,o,l,i]),u.jsx(Cr,{present:r||a!=="hidden",children:u.jsx(Mv,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ue(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ue(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),eT=y.forwardRef((e,t)=>{const r=en($n,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=y.useState(!1),a=e.orientation==="horizontal",l=zf(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=en($n,e.__scopeScrollArea),o=y.useRef(null),i=y.useRef(0),[a,l]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=oT(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function f(p,m){return W6(p,i.current,a,m)}return r==="horizontal"?u.jsx(L6,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollLeft,m=gx(p,a,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):r==="vertical"?u.jsx(F6,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const p=s.viewport.scrollTop,m=gx(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),L6=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Xe(t,l,o.onScrollbarXChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(rT,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ff(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),aT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Dd(i.paddingLeft),paddingEnd:Dd(i.paddingRight)}})}})}),F6=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=en($n,e.__scopeScrollArea),[i,a]=y.useState(),l=y.useRef(null),c=Xe(t,l,o.onScrollbarYChange);return y.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(rT,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ff(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const p=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),aT(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Dd(i.paddingTop),paddingEnd:Dd(i.paddingBottom)}})}})}),[z6,tT]=qE($n),rT=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...p}=e,m=en($n,r),[x,v]=y.useState(null),w=Xe(t,P=>v(P)),h=y.useRef(null),g=y.useRef(""),_=m.viewport,C=n.content-n.viewport,T=Pt(d),E=Pt(l),j=zf(f,10);function O(P){if(h.current){const L=P.clientX-h.current.left,q=P.clientY-h.current.top;c({x:L,y:q})}}return y.useEffect(()=>{const P=L=>{const q=L.target;(x==null?void 0:x.contains(q))&&T(L,C)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[_,x,C,T]),y.useEffect(E,[n,E]),oa(x,j),oa(m.content,j),u.jsx(z6,{scope:r,scrollbar:x,hasThumb:s,onThumbChange:Pt(o),onThumbPointerUp:Pt(i),onThumbPositionChange:E,onThumbPointerDown:Pt(a),children:u.jsx(Me.div,{...p,ref:w,style:{position:"absolute",...p.style},onPointerDown:ue(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),h.current=x.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),O(P))}),onPointerMove:ue(e.onPointerMove,O),onPointerUp:ue(e.onPointerUp,P=>{const L=P.target;L.hasPointerCapture(P.pointerId)&&L.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),Pd="ScrollAreaThumb",nT=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=tT(Pd,e.__scopeScrollArea);return u.jsx(Cr,{present:r||s.hasThumb,children:u.jsx(U6,{ref:t,...n})})}),U6=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=en(Pd,r),i=tT(Pd,r),{onThumbPositionChange:a}=i,l=Xe(t,f=>i.onThumbChange(f)),c=y.useRef(),d=zf(()=>{c.current&&(c.current(),c.current=void 0)},100);return y.useEffect(()=>{const f=o.viewport;if(f){const p=()=>{if(d(),!c.current){const m=$6(f,a);c.current=m,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[o.viewport,d,a]),u.jsx(Me.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ue(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),x=f.clientX-m.left,v=f.clientY-m.top;i.onThumbPointerDown({x,y:v})}),onPointerUp:ue(e.onPointerUp,i.onThumbPointerUp)})});nT.displayName=Pd;var Iv="ScrollAreaCorner",sT=y.forwardRef((e,t)=>{const r=en(Iv,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(V6,{...e,ref:t}):null});sT.displayName=Iv;var V6=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=en(Iv,r),[o,i]=y.useState(0),[a,l]=y.useState(0),c=!!(o&&a);return oa(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),oa(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),c?u.jsx(Me.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Dd(e){return e?parseInt(e,10):0}function oT(e,t){const r=e/t;return isNaN(r)?0:r}function Ff(e){const t=oT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function W6(e,t,r,n="ltr"){const s=Ff(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return iT([l,c],f)(e)}function gx(e,t,r="ltr"){const n=Ff(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],c=im(e,l);return iT([0,i],[0,a])(c)}function iT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function aT(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function zf(e,t){const r=Pt(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function oa(e,t){const r=Pt(t);nr(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var lT=XE,B6=JE,H6=sT;const cT=y.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(lT,{ref:n,className:ve("relative overflow-hidden",e),...r,children:[u.jsx(B6,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(uT,{}),u.jsx(H6,{})]}));cT.displayName=lT.displayName;const uT=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(Av,{ref:n,orientation:t,className:ve("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(nT,{className:"relative flex-1 rounded-full bg-border"})}));uT.displayName=Av.displayName;const Y6=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await Dt().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},Z6=()=>{const e=Un(),[t,r]=y.useState(),[n]=kj(),s=n.get("domain");return y.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const a=await Y6(i);r(a.items)})()},[s]),u.jsxs(cT,{className:"h-[80vh] overflow-hidden",children:[u.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[u.jsx("div",{className:"w-48",children:"域名"}),u.jsx("div",{className:"w-24",children:"状态"}),u.jsx("div",{className:"w-56",children:"阶段"}),u.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),u.jsx("div",{className:"grow",children:"操作"})]}),u.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,a;return u.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[u.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),u.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:o.phase==="deploy"&&o.phaseSuccess?u.jsx(Q_,{size:16,className:"text-green-700"}):u.jsx(J_,{size:16,className:"text-red-700"})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:u.jsx(ck,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),u.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:Ul(o.deployedAt)}),u.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:u.jsxs(oS,{children:[u.jsx(iS,{asChild:!0,children:u.jsx(vt,{variant:"link",className:"p-0",children:"日志"})}),u.jsxs(Kg,{className:"sm:max-w-5xl",children:[u.jsx(lS,{children:u.jsxs(cS,{children:[(a=o.expand.domain)==null?void 0:a.domain,"-",o.id,"部署详情"]})}),u.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&u.jsx(u.Fragment,{children:o.log.check.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.apply&&u.jsx(u.Fragment,{children:o.log.apply.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.info&&l.info.map(c=>u.jsx("div",{className:"mt-1 text-green-600",children:c})),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))}),o.log.deploy&&u.jsx(u.Fragment,{children:o.log.deploy.map(l=>u.jsxs("div",{className:"flex flex-col mt-2",children:[u.jsxs("div",{className:"flex",children:[u.jsxs("div",{children:["[",l.time,"]"]}),u.jsx("div",{className:"ml-2",children:l.message})]}),l.error&&u.jsx("div",{className:"mt-1 text-red-600",children:l.error})]}))})]})]})]})})]},o.id)})]}):u.jsx(u.Fragment,{children:u.jsxs(ZE,{className:"max-w-[40em] mx-auto mt-20",children:[u.jsx(KE,{children:"暂无数据"}),u.jsxs(GE,{children:[u.jsxs("div",{className:"flex items-center mt-5",children:[u.jsx("div",{children:u.jsx(Ij,{className:"text-yellow-400",size:36})}),u.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),u.jsx("div",{className:"mt-2 flex justify-end",children:u.jsx(vt,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},hm=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",K6=Ne.object({username:Ne.string().email({message:"请输入正确的邮箱地址"}),password:Ne.string().min(10,{message:"密码至少10个字符"})}),G6=()=>{const e=Ns({resolver:Rs(K6),defaultValues:{username:"",password:""}}),t=async n=>{try{await Dt().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=hm(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Un();return u.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("img",{src:"/vite.svg",className:"w-16"})}),u.jsx(js,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[u.jsx($e,{control:e.control,name:"username",render:({field:n})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"用户名"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"email",...n})}),u.jsx(Le,{})]})}),u.jsx($e,{control:e.control,name:"password",render:({field:n})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"密码"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"shadcn",...n,type:"password"})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"登录"})})]})})]})},q6=()=>Dt().authStore.isValid&&Dt().authStore.isAdmin?u.jsx(K_,{to:"/"}):u.jsx("div",{className:"container",children:u.jsx(hg,{})}),X6=Ne.object({oldPassword:Ne.string().min(10,{message:"密码至少10个字符"}),newPassword:Ne.string().min(10,{message:"密码至少10个字符"}),confirmPassword:Ne.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),Q6=()=>{const{toast:e}=Ef(),t=Un(),r=Ns({resolver:Rs(X6),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await Dt().admins.authWithPassword((o=Dt().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(a){const l=hm(a);r.setError("oldPassword",{message:l})}try{await Dt().admins.update((i=Dt().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),Dt().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(a){const l=hm(a);e({title:"修改密码失败",description:l,variant:"destructive"})}};return u.jsx(u.Fragment,{children:u.jsx(js,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[u.jsx($e,{control:r.control,name:"oldPassword",render:({field:s})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"当前密码"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"当前密码",...s,type:"password"})}),u.jsx(Le,{})]})}),u.jsx($e,{control:r.control,name:"newPassword",render:({field:s})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"新密码"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"newPassword",...s,type:"password"})}),u.jsx(Le,{})]})}),u.jsx($e,{control:r.control,name:"confirmPassword",render:({field:s})=>u.jsxs(ze,{children:[u.jsx(Ue,{children:"确认密码"}),u.jsx(Ve,{children:u.jsx(Ke,{placeholder:"confirmPassword",...s,type:"password"})}),u.jsx(Le,{})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsx(vt,{type:"submit",children:"确认修改"})})]})})})},J6=()=>u.jsxs("div",{children:[u.jsx(bv,{}),u.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"设置密码"}),u.jsx("div",{className:"w-full sm:w-[35em] mt-10 flex flex-col p-3 mx-auto",children:u.jsx(hg,{})})]}),eU=cj([{path:"/",element:u.jsx(q4,{}),children:[{path:"/",element:u.jsx(w5,{})},{path:"/edit",element:u.jsx(j6,{})},{path:"/access",element:u.jsx(P6,{})},{path:"/history",element:u.jsx(Z6,{})},{path:"/setting",element:u.jsx(J6,{}),children:[{path:"/setting/password",element:u.jsx(Q6,{})}]}]},{path:"/login",element:u.jsx(q6,{}),children:[{path:"/login",element:u.jsx(G6,{})}]},{path:"/about",element:u.jsx("div",{children:"About"})}]);Lh.createRoot(document.getElementById("root")).render(u.jsx(et.StrictMode,{children:u.jsx(B4,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:u.jsx(yj,{router:eU})})}))});export default tU(); diff --git a/ui/dist/index.html b/ui/dist/index.html index 816d4716..f5034ce3 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/src/components/certimate/AccessEdit.tsx b/ui/src/components/certimate/AccessEdit.tsx index 623d9646..c7824fb6 100644 --- a/ui/src/components/certimate/AccessEdit.tsx +++ b/ui/src/components/certimate/AccessEdit.tsx @@ -28,6 +28,7 @@ import { SelectValue, } from "../ui/select"; import AccessCloudflareForm from "./AccessCloudflareForm"; +import AccessQiniuForm from "./AccessQiniuForm"; type TargetConfigEditProps = { op: "add" | "edit"; @@ -99,6 +100,16 @@ export function AccessEdit({ /> ); break; + case "qiniu": + form = ( + { + setOpen(false); + }} + /> + ); + break; } const getOptionCls = (val: string) => { @@ -122,6 +133,7 @@ export function AccessEdit({ console.log(val); setConfigType(val); }} + defaultValue={configType} > @@ -130,7 +142,7 @@ export function AccessEdit({ 服务商 {typeKeys.map((key) => ( - +
void; +}) => { + const { addAccess, updateAccess } = useConfig(); + const formSchema = z.object({ + id: z.string().optional(), + name: z.string().min(1).max(64), + configType: accessFormType, + accessKey: z.string().min(1).max(64), + secretKey: z.string().min(1).max(64), + }); + + let config: QiniuConfig = { + accessKey: "", + secretKey: "", + }; + if (data) config = data.config as QiniuConfig; + + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + id: data?.id, + name: data?.name, + configType: "qiniu", + accessKey: config.accessKey, + secretKey: config.secretKey, + }, + }); + + const onSubmit = async (data: z.infer) => { + const req: Access = { + id: data.id as string, + name: data.name, + configType: data.configType, + config: { + accessKey: data.accessKey, + secretKey: data.secretKey, + }, + }; + + try { + const rs = await save(req); + + onAfterReq(); + + req.id = rs.id; + req.created = rs.created; + req.updated = rs.updated; + if (data.id) { + updateAccess(req); + return; + } + addAccess(req); + } catch (e) { + const err = e as ClientResponseError; + + Object.entries(err.response.data as PbErrorData).forEach( + ([key, value]) => { + form.setError(key as keyof z.infer, { + type: "manual", + message: value.message, + }); + } + ); + + return; + } + }; + + return ( + <> +
+
+ { + e.stopPropagation(); + form.handleSubmit(onSubmit)(e); + }} + className="space-y-8" + > + ( + + 名称 + + + + + + + )} + /> + + ( + + 配置类型 + + + + + + + )} + /> + + ( + + 配置类型 + + + + + + + )} + /> + + ( + + AccessKey + + + + + + + )} + /> + + ( + + SecretKey + + + + + + + )} + /> + + + +
+ +
+ + +
+ + ); +}; + +export default AccessQiniuForm; diff --git a/ui/src/domain/access.ts b/ui/src/domain/access.ts index fb07d5ca..d01fa53b 100644 --- a/ui/src/domain/access.ts +++ b/ui/src/domain/access.ts @@ -4,6 +4,7 @@ export const accessTypeMap: Map = new Map([ ["tencent", ["腾讯云", "/imgs/providers/tencent.svg"]], ["aliyun", ["阿里云", "/imgs/providers/aliyun.svg"]], ["cloudflare", ["Cloudflare", "/imgs/providers/cloudflare.svg"]], + ["qiniu", ["七牛云", "/imgs/providers/qiniu.svg"]], ["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]], ["webhook", ["Webhook", "/imgs/providers/webhook.svg"]], ]); @@ -15,6 +16,7 @@ export const accessFormType = z.union( z.literal("ssh"), z.literal("webhook"), z.literal("cloudflare"), + z.literal("qiniu"), ], { message: "请选择云服务商" } ); @@ -28,12 +30,18 @@ export type Access = { | AliyunConfig | SSHConfig | WebhookConfig - | CloudflareConfig; + | CloudflareConfig + | QiniuConfig; deleted?: string; created?: string; updated?: string; }; +export type QiniuConfig = { + accessKey: string; + secretKey: string; +}; + export type WebhookConfig = { url: string; }; diff --git a/ui/src/domain/domain.ts b/ui/src/domain/domain.ts index 08149908..ded1a177 100644 --- a/ui/src/domain/domain.ts +++ b/ui/src/domain/domain.ts @@ -32,6 +32,7 @@ export const targetTypeMap: Map = new Map([ ["aliyun-oss", ["阿里云-OSS", "/imgs/providers/aliyun.svg"]], ["tencent-cdn", ["腾讯云-CDN", "/imgs/providers/tencent.svg"]], ["ssh", ["SSH部署", "/imgs/providers/ssh.svg"]], + ["qiniu-cdn", ["七牛云-CDN", "/imgs/providers/qiniu.svg"]], ["webhook", ["Webhook", "/imgs/providers/webhook.svg"]], ]);